query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Defines the props that are shared by default.
public function share(Request $request) { $location = Location::get(); if (!$location) { throw new Exception('location_service_failure'); } $key = env('WEATHER_API_KEY', ''); $lat = $location->latitude; $lng = $location->longitude; $locationArray = [ 'countryCode' => $location->countryCode, 'regionCode' => $location->regionCode, 'cityName' => $location->cityName, 'lat' => $lat, 'lng' => $lng, ]; $weather = Http::get("https://api.openweathermap.org/data/2.5/onecall?lat=$lat&lon=$lng&units=metric&appid=$key"); $weather->throw(new HttpClientException('weather_service_failure')); $weatherArray = [ 'current' => $weather['current'], 'daily' => $weather['daily'], 'hourly' => $weather['hourly'], 'minutely' => $weather['minutely'], ]; return array_merge(parent::share($request), [ 'location' => $locationArray, 'weather' => $weatherArray ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initProps()\n {\n foreach ($this->cmds as $key => $parseValues) {\n $this->props[$key] = false;\n }\n\n foreach ($this->flags as $key => $parseValues) {\n $this->props[$key] = false;\n }\n }", "public function set_default_properties(){\n\t\t$this->properties = array(\n\t\t\t'apply_adjacent_buffer' => __( 'Apply_adjacent_buffer', 'woocommerce-bookings' ),\n\t\t\t'availability' => __( 'Availability', 'woocommerce-bookings' ),\n\t\t\t'block_cost' => __( 'Block_cost', 'woocommerce-bookings' ),\n\t\t\t'buffer_period' => __( 'Buffer_period', 'woocommerce-bookings' ),\n\t\t\t'calendar_display_mode' => __( 'Calendar_display_mode', 'woocommerce-bookings' ),\n\t\t\t'cancel_limit_unit' => __( 'Cancel_limit_unit', 'woocommerce-bookings' ),\n\t\t\t'cancel_limit' => __( 'Cancel_limit', 'woocommerce-bookings' ),\n\t\t\t'check_start_block_only' => __( 'Check_start_block_only', 'woocommerce-bookings' ),\n\t\t\t'cost' => __( 'Cost', 'woocommerce-bookings' ),\n\t\t\t'default_date_availability' => __( 'Default_date_availability', 'woocommerce-bookings' ),\n\t\t\t'display_cost' => __( 'Display_cost', 'woocommerce-bookings' ),\n\t\t\t'duration_type' => __( 'Duration_type', 'woocommerce-bookings' ),\n\t\t\t'duration_unit' => __( 'Duration_unit', 'woocommerce-bookings' ),\n\t\t\t'duration' => __( 'Duration', 'woocommerce-bookings' ),\n\t\t\t'enable_range_picker' => __( 'Enable_range_picker', 'woocommerce-bookings' ),\n\t\t\t'first_block_time' => __( 'First_block_time', 'woocommerce-bookings' ),\n\t\t\t'has_person_cost_multiplier' => __( 'Has_person_cost_multiplier', 'woocommerce-bookings' ),\n\t\t\t'has_person_qty_multiplier' => __( 'Has_person_qty_multiplier', 'woocommerce-bookings' ),\n\t\t\t'has_person_types' => __( 'Has_person_types', 'woocommerce-bookings' ),\n\t\t\t'has_persons' => __( 'Has_persons', 'woocommerce-bookings' ),\n\t\t\t'has_resources' => __( 'Has_resources', 'woocommerce-bookings' ),\n\t\t\t'has_restricted_days' => __( 'Has_restricted_days', 'woocommerce-bookings' ),\n\t\t\t'max_date_unit' => __( 'Max_date_unit', 'woocommerce-bookings' ),\n\t\t\t'max_date_value' => __( 'Max_date_value', 'woocommerce-bookings' ),\n\t\t\t'max_duration' => __( 'Max_duration', 'woocommerce-bookings' ),\n\t\t\t'max_persons' => __( 'Max_persons', 'woocommerce-bookings' ),\n\t\t\t'min_date_unit' => __( 'Min_date_unit', 'woocommerce-bookings' ),\n\t\t\t'min_date_value' => __( 'Min_date_value', 'woocommerce-bookings' ),\n\t\t\t'min_duration' => __( 'Min_duration', 'woocommerce-bookings' ),\n\t\t\t'min_persons' => __( 'Min_persons', 'woocommerce-bookings' ),\n\t\t\t'person_types' => __( 'Person_types', 'woocommerce-bookings' ),\n\t\t\t'pricing' => __( 'Pricing', 'woocommerce-bookings' ),\n\t\t\t'qty' => __( 'Qty', 'woocommerce-bookings' ),\n\t\t\t'requires_confirmation' => __( 'Requires_confirmation', 'woocommerce-bookings' ),\n\t\t\t'resource_label' => __( 'Resource_label', 'woocommerce-bookings' ),\n\t\t\t'resource_base_costs' => __( 'Resource_base_costs', 'woocommerce-bookings' ),\n\t\t\t'resource_block_costs' => __( 'Resource_block_costs', 'woocommerce-bookings' ),\n\t\t\t'resource_ids' => __( 'Resource_ids', 'woocommerce-bookings' ),\n\t\t\t'resources_assignment' => __( 'Resources_assignment', 'woocommerce-bookings' ),\n\t\t\t'restricted_days' => __( 'Restricted_days', 'woocommerce-bookings' ),\n\t\t\t'user_can_cancel' => __( 'User_can_cancel', 'woocommerce-bookings' ),\n\t\t);\n\t}", "public function provideShared() {\n return [\n 'notShared' => [false],\n 'shared' => [true]\n ];\n }", "static function get_default_property_names()\r\n {\r\n return array(self :: PROPERTY_COURSE_GROUP, self :: PROPERTY_USER);\r\n }", "protected function get_default_item_props() {\n\t\treturn (object) array(\n\t\t\t'object' => null,\n\t\t\t'tax_class' => '',\n\t\t\t'taxable' => false,\n\t\t\t'quantity' => 0,\n\t\t\t'product' => false,\n\t\t\t'price_includes_tax' => false,\n\t\t\t'subtotal' => 0,\n\t\t\t'subtotal_tax' => 0,\n\t\t\t'total' => 0,\n\t\t\t'total_tax' => 0,\n\t\t\t'taxes' => array(),\n\t\t);\n\t}", "private function shareModelPropsToView(): void\n {\n $model = static::${'modelClass'};\n View::share('props', (new $model())->getEditableProperties());\n }", "protected function getCommonAttributes()\n {\n return array(\n 'autocreated' => array('values' => array('a', 'aut', 'autocreated'), 'variant' => true),\n 'mandatory' => array('values' => array('m', 'man', 'mandatory'), 'variant' => true),\n 'protected' => array('values' => array('p', 'pro', 'protected'), 'variant' => true),\n 'COPY' => array('values' => array('COPY'), 'variant' => false),\n 'VERSION' => array('values' => array('VERSION'), 'variant' => false),\n 'INITIALIZE' => array('values' => array('INITIALIZE'), 'variant' => false),\n 'COMPUTE' => array('values' => array('COMPUTE'), 'variant' => false),\n 'IGNORE' => array('values' => array('IGNORE'), 'variant' => false),\n 'ABORT' => array('values' => array('ABORT'), 'variant' => false),\n 'OPV' => array('values' => array('OPV'), 'variant' => true),\n );\n }", "public function getDefaultProperties () {\n return array(\n 'deleted' => 0,\n 'published' => 1,\n 'active' => 1,\n 'only_check_permissions' => 0,\n 'checkCustomPermissions' => 0,\n 'checkByRelatedObjects' => 1,\n 'needCounters' => 0,\n );\n }", "public function init_settings()\n {\n /** @noinspection PhpUndefinedClassInspection */\n parent::init_settings();\n\n $sharedOptions = get_option(SharedPersistor::OPTION_NAME, []) ?: [];\n $this->settings = array_merge($this->settings, $sharedOptions);\n }", "protected function initComponentProps()\n {\n if (!in_array($this->mode, [self::MODE_VERTICAL, self::MODE_HORIZONTAL])) {\n throw new InvalidConfigException();\n }\n\n if (!in_array($this->theme, [self::THEME_LIGHT, self::THEME_DARK, self::THEME_PRIMARY])) {\n throw new InvalidConfigException();\n }\n\n if ($this->theme == self::THEME_PRIMARY && $this->mode != self::MODE_HORIZONTAL) {\n throw new InvalidConfigException('Primary theme can only be used when mode=\"horizontal\"');\n }\n\n $this->componentProps['mode'] = $this->mode;\n $this->componentProps['theme'] = $this->theme;\n $this->componentProps['accordion'] = $this->accordion;\n $this->componentProps['width'] = $this->width;\n if (!empty($this->openNames) && is_array($this->openNames)) {\n $this->componentProps['open-names'] = $this->openNames;\n }\n }", "protected function buildPropertyDefaults() {\n }", "public function set_props($args)\n {\n }", "function setCommonInfo()\n\t{\n\t\t$this->configobj = new configclass();\t\t\n\t\t\n\t}", "function get_default_properties()\r\n {\r\n return $this->defaultProperties;\r\n }", "public function default_styles()\n {\n if( ! is_array(self::$styles))\n {\n self::$styles = array();\n }\n self::$styles[]= 'modules/xview/vendor/bluetrip/css/screen.css';\n self::$styles[]= 'modules/xview/vendor/superfish/css/superfish.css';\n self::$styles[]= 'modules/xview/vendor/superfish/css/superfish-navbar.css';\n self::$styles[]= 'modules/xview/vendor/jqueryui/css/flick/jquery-ui-1.8.4.custom.css';\n self::$styles[]= 'modules/xview/media/xhtml.css';\n\n }", "public function set_defaults() {\n\n\t\t// Retrieve the stylesheet option to set the proper defaults\n\t\t$style_option = tribe_get_option( 'stylesheetOption', 'tribe' );\n\n\t\tswitch ( $style_option ) {\n\t\t\tcase 'full': // Full styles\n\t\t\t\t$this->defaults = array(\n\t\t\t\t\t'table_bg_color' => '#fff',\n\t\t\t\t\t'highlight_color' => '#666',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'skeleton': // Skeleton styles\n\t\t\tdefault: // tribe styles is the default so add full and theme (tribe)\n\t\t\t\t$this->defaults = array(\n\t\t\t\t\t'table_bg_color' => '#f9f9f9',\n\t\t\t\t\t'highlight_color' => '#21759b',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t}", "static function get_default_property_names()\r\n {\r\n return array(self :: PROPERTY_ITEM_ID, self :: PROPERTY_USER_ID);\r\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 }", "function __construct($defaultProperties = array ())\r\n {\r\n $this->defaultProperties = $defaultProperties;\r\n }", "function props() {\n\t\treturn array(\n\t\t\t'aaroncampbell',\n\t\t\t'aaronholbrook', // props missed by committer\n\t\t\t'alecrust',\n\t\t\t'alex-ye',\n\t\t\t'alexkingorg',\n\t\t\t'alexvorn2',\n\t\t\t'alyssonweb',\n\t\t\t'ampt',\n\t\t\t'andrear', // andrea.r\n\t\t\t'andrewryno',\n\t\t\t'andrewspittle',\n\t\t\t'andy',\n\t\t\t'apokalyptik',\n\t\t\t'azaozz',\n\t\t\t'bainternet',\n\t\t\t'bananastalktome',\n\t\t\t'barrykooij',\n\t\t\t'batmoo',\n\t\t\t'barry',\n\t\t\t'bbrooks', // given props as 'Ben Brooks'\n\t\t\t'benkulbertis',\n\t\t\t'bergius',\n\t\t\t'betzster',\n\t\t\t'bigdawggi',\n\t\t\t'bolo1988',\n\t\t\t'bpetty',\n\t\t\t'bradparbs',\n\t\t\t'bradthomas127',\n\t\t\t'bradyvercher',\n\t\t\t'brandondove',\n\t\t\t'BrianLayman',\n\t\t\t'c3mdigital',\n\t\t\t'cannona',\n\t\t\t'casben79',\n\t\t\t'Caspie',\n\t\t\t'cdog',\n\t\t\t'cfinke',\n\t\t\t'chellycat',\n\t\t\t'chexee',\n\t\t\t'Chouby',\n\t\t\t'chriswallace',\n\t\t\t'coffee2code',\n\t\t\t'corvannoorloos',\n\t\t\t'dan-rivera', // Dan Rivera\n\t\t\t'dd32',\n\t\t\t'deltafactory',\n\t\t\t'DH-Shredder',\n\t\t\t'dimadin',\n\t\t\t'djzone',\n\t\t\t'dllh',\n\t\t\t'doublesharp',\n\t\t\t'DrewAPicture',\n\t\t\t'drewstrojny',\n\t\t\t'duck_',\n\t\t\t'eddiemoya',\n\t\t\t'elyobo',\n\t\t\t'emiluzelac',\n\t\t\t'empireoflight',\n\t\t\t'ericlewis',\n\t\t\t'ericmann',\n\t\t\t'ericwahlforss',\n\t\t\t'ethitter',\n\t\t\t'evansolomon',\n\t\t\t'f-j-kaiser', // F J Kaiser\n\t\t\t'fadingdust',\n\t\t\t'foxinni',\n\t\t\t'gandham',\n\t\t\t'GaryJ', // given props as Gary-J\n\t\t\t'garyc40',\n\t\t\t'GeertDD',\n\t\t\t'georgestephanis',\n\t\t\t'GhostToast',\n\t\t\t'gluten',\n\t\t\t'gnarf',\n\t\t\t'goldenapples',\n\t\t\t'greenshady',\n\t\t\t'GregLone',\n\t\t\t'griffinjt',\n\t\t\t'hakre',\n\t\t\t'hanni',\n\t\t\t'hardy101',\n\t\t\t'hd-J',\n\t\t\t'hebbet',\n\t\t\t'helenyhou',\n\t\t\t'hugobaeta',\n\t\t\t'husobj',\n\t\t\t'iamfriendly',\n\t\t\t'iammattthomas',\n\t\t\t'iamtakashi',\n\t\t\t'iandstewart',\n\t\t\t'ikailo',\n\t\t\t'Ipstenu',\n\t\t\t'itworx',\n\t\t\t'j-idris',\n\t\t\t'jakemgold',\n\t\t\t'jakubtyrcha', // jakub.tyrcha\n\t\t\t'jamescollins',\n\t\t\t'jammitch',\n\t\t\t'jenmylo',\n\t\t\t'Japh',\n\t\t\t'JarretC',\n\t\t\t'javert03',\n\t\t\t'Jayjdk',\n\t\t\t'jblz',\n\t\t\t'jbrinley',\n\t\t\t'jcakec',\n\t\t\t'jeffsebring',\n\t\t\t'jeremyfelt',\n\t\t\t'JerrySarcastic',\n\t\t\t'jkudish',\n\t\t\t'jndetlefsen',\n\t\t\t'joehoyle',\n\t\t\t'joelhardi',\n\t\t\t'johnbillion',\n\t\t\t'johnjamesjacoby',\n\t\t\t'johnpbloch',\n\t\t\t'jond3r',\n\t\t\t'jondavidjohn',\n\t\t\t'joostdekeijzer',\n\t\t\t'jorbin',\n\t\t\t'josephscott',\n\t\t\t'jtsternberg',\n\t\t\t'JustinSainton',\n\t\t\t'Kawauso',\n\t\t\t'Keruspe',\n\t\t\t'kitchin',\n\t\t\t'klagraff',\n\t\t\t'knutsp',\n\t\t\t'koke',\n\t\t\t'koop',\n\t\t\t'kopepasah',\n\t\t\t'kovshenin',\n\t\t\t'kurtpayne',\n\t\t\t'Kyrylo',\n\t\t\t'lancewillett',\n\t\t\t'larysa',\n\t\t\t'Latz',\n\t\t\t'ldebrouwer',\n\t\t\t'leogermani',\n\t\t\t'lessbloat',\n\t\t\t'lesteph',\n\t\t\t'lgedeon',\n\t\t\t'lightningspirit',\n\t\t\t'linuxologos',\n\t\t\t'MadtownLems',\n\t\t\t'mailnew2ster',\n\t\t\t'Mamaduka',\n\t\t\t'maor',\n\t\t\t'MarcusPope',\n\t\t\t'markel',\n\t\t\t'markjaquith',\n\t\t\t'markoheijnen',\n\t\t\t'markoheinjen',\n\t\t\t'martythornley',\n\t\t\t'matt',\n\t\t\t'mattdanner',\n\t\t\t'mattwiebe',\n\t\t\t'MattyRob',\n\t\t\t'maxcutler',\n\t\t\t'mbijon',\n\t\t\t'mdawaffe',\n\t\t\t'mdgl',\n\t\t\t'melchoyce',\n\t\t\t'merty',\n\t\t\t'mfields',\n\t\t\t'mgdl',\n\t\t\t'MikeHansenMe',\n\t\t\t'mikelittle',\n\t\t\t'mikeschinkel',\n\t\t\t'mimecine',\n\t\t\t'miqrogroove',\n\t\t\t'mitchoyoshitaka',\n\t\t\t'mohanjith',\n\t\t\t'Moraleidame', // Moraleida.me\n\t\t\t'mpvanwinkle77',\n\t\t\t'mrroundhill',\n\t\t\t'mtdesign',\n\t\t\t'murky',\n\t\t\t'nacin',\n\t\t\t'Nao',\n\t\t\t'nbachiyski',\n\t\t\t'neoxx',\n\t\t\t'niallkennedy',\n\t\t\t'nikolov.tmw',\n\t\t\t'nprasath002',\n\t\t\t'ntm',\n\t\t\t'nvartolomei',\n\t\t\t'obenland',\n\t\t\t'ocean90',\n\t\t\t'op12no2',\n\t\t\t'Otto42',\n\t\t\t'pas5027', // props missed by committer (r22460)\n\t\t\t'pavelevap',\n\t\t\t'pdclark',\n\t\t\t'pento',\n\t\t\t'PeteMall',\n\t\t\t'philiparthurmoore',\n\t\t\t'phill_brown',\n\t\t\t'picklepete',\n\t\t\t'picklewagon',\n\t\t\t'PotterSys',\n\t\t\t'pross',\n\t\t\t'r-a-y',\n\t\t\t'ramiy',\n\t\t\t'rmccue',\n\t\t\t'rstern',\n\t\t\t'ryan',\n\t\t\t'ryanimel',\n\t\t\t'RyanJKoehler',\n\t\t\t'ryelle',\n\t\t\t'rzen',\n\t\t\t'sabreuse',\n\t\t\t'saltcod',\n\t\t\t'saracannon',\n\t\t\t'sc0ttclark',\n\t\t\t'sc0ttkclark',\n\t\t\t'scottgonzalez', // scott.gonzalez (props missed by committer, r22513)\n\t\t\t'scribu',\n\t\t\t'sennza',\n\t\t\t'senzza',\n\t\t\t'sergeysbetkenovgaroru', // [email protected]\n\t\t\t'SergeyBiryukov',\n\t\t\t'simonwheatley',\n\t\t\t'sirzooro',\n\t\t\t'sivel',\n\t\t\t'sixhours',\n\t\t\t'solarissmoke',\n\t\t\t'ssamture',\n\t\t\t'sterlo',\n\t\t\t'sumindmitriy',\n\t\t\t'sushkov',\n\t\t\t'swekitsune',\n\t\t\t'targz-1', // tar.gz\n\t\t\t'taylorde',\n\t\t\t'thee17',\n\t\t\t'timbeks',\n\t\t\t'timfs',\n\t\t\t'tlovett1',\n\t\t\t'tmoorewp',\n\t\t\t'TobiasBg',\n\t\t\t'tollmanz',\n\t\t\t'TomasM',\n\t\t\t'TomAuger',\n\t\t\t'tommcfarlin',\n\t\t\t'toppa',\n\t\t\t'toscho',\n\t\t\t'tott',\n\t\t\t'trepmal',\n\t\t\t'usermrpapa',\n\t\t\t'vhauri',\n\t\t\t'viniciusmassuchetto',\n\t\t\t'Viper007Bond',\n\t\t\t'waclawjacek',\n\t\t\t'waldojaquith',\n\t\t\t'webord',\n\t\t\t'westi',\n\t\t\t'wet',\n\t\t\t'willmot',\n\t\t\t'wojtekszkutnik', // wojtek.szkutnik\n\t\t\t'wonderboymusic',\n\t\t\t'wpmuguru',\n\t\t\t'wpsmith',\n\t\t\t'xibe',\n\t\t\t'xknown',\n\t\t\t'yoavf',\n\t\t\t'yogi-t', // Yogi T\n\t\t\t'zamoose',\n\t\t\t'zeo',\n\t\t);\n\t}", "protected function defineSettings()\n\t{\n\t\treturn array(\n\t\t\t'columns' => AttributeType::Mixed,\n\t\t\t'defaults' => AttributeType::Mixed,\n\t\t);\n\t}", "public function populateDefaults()\n {\n // Populate Defaults (from parent):\n \n parent::populateDefaults();\n \n // Populate Defaults:\n \n $this->Title = _t(__CLASS__ . '.DEFAULTTITLE', 'Share via Email');\n }", "public function setProperties() {\n\t\t$this->public_prop = 'public';\n\t\t$this->protected_prop = 100;\n\t\t$this->private_prop = true;\n\n\t\t// Set a non-predefined property.\n\t\t$this->dynamic = new self();\n\t}", "static function get_default_property_names($extended_property_names = array())\r\n {\r\n return array(self :: PROPERTY_COURSE, self :: PROPERTY_USER, self :: PROPERTY_STATUS);\r\n }", "public function getAllProperties() {\n\t\t$bean = $this->unbox();\n\n\t\t$properties = $this->properties;\n\n\t\t$sourceInstance = $this->getSourceInstance();\n\t\tif ($sourceInstance !== null) {\n\t\t\t$sourceServer = $this->getSourceServer();\n\t\t\tif ($sourceServer !== null) {\n\t\t\t\t$properties = array_merge($properties, $this->addPrefixProperties($sourceServer->box()->getProperties(), 'source'));\n\t\t\t}\n\t\t\t$properties = array_merge($properties, $this->addPrefixProperties($sourceInstance->box()->getProperties(), 'source'));\n\t\t}\n\n\t\t$targetInstance = $this->getTargetInstance();\n\t\tif ($targetInstance !== null) {\n\t\t\t$targetServer = $this->getTargetServer();\n\t\t\tif ($targetServer !== null) {\n\t\t\t\t$properties = array_merge($properties, $this->addPrefixProperties($targetServer->box()->getProperties(), 'remote'));\n\t\t\t}\n\t\t\t$properties = array_merge($properties, $this->addPrefixProperties($targetInstance->box()->getProperties(), 'remote'));\n\t\t}\n\n\t\t// Finally some special \n\t\t$properties['deploymentId'] = $bean->id;\n\t\t$config = Zend_Registry::get('config');\n\t\t$properties['buildscriptDir'] = $config->directories->buildscript;\n\t\treturn $properties;\n\t}", "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}", "function setDefaults() {\r\n\t\t$this->border='1px solid #46b0ee';\r\n\t\t$this->fgColor='#ff9000';\r\n\t\t$this->bgColor='#FFFFFF';\r\n\t}", "public function props()\n\t{\n\t\treturn $this->props;\n\t}", "protected static function define_other_properties() {\n $attachmentdefinition = stored_file_exporter::read_properties_definition();\n $attachmentdefinition['urls'] = [\n 'type' => [\n 'export' => [\n 'type' => PARAM_URL,\n 'description' => 'The URL used to export the attachment',\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ]\n ]\n ];\n $attachmentdefinition['html'] = [\n 'type' => [\n 'plagiarism' => [\n 'type' => PARAM_RAW,\n 'description' => 'The HTML source for the Plagiarism Response',\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n ]\n ];\n\n return [\n 'id' => ['type' => PARAM_INT],\n 'subject' => ['type' => PARAM_TEXT],\n 'replysubject' => ['type' => PARAM_TEXT],\n 'message' => ['type' => PARAM_RAW],\n 'messageformat' => ['type' => PARAM_INT],\n 'author' => ['type' => author_exporter::read_properties_definition()],\n 'discussionid' => ['type' => PARAM_INT],\n 'hasparent' => ['type' => PARAM_BOOL],\n 'parentid' => [\n 'type' => PARAM_INT,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'timecreated' => ['type' => PARAM_INT],\n 'unread' => [\n 'type' => PARAM_BOOL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'isdeleted' => ['type' => PARAM_BOOL],\n 'isprivatereply' => ['type' => PARAM_BOOL],\n 'haswordcount' => ['type' => PARAM_BOOL],\n 'wordcount' => [\n 'type' => PARAM_INT,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'charcount' => [\n 'type' => PARAM_INT,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'capabilities' => [\n 'type' => [\n 'view' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can view the post',\n ],\n 'edit' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can edit the post',\n ],\n 'delete' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can delete the post',\n ],\n 'split' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can split the post',\n ],\n 'reply' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can reply to the post',\n ],\n 'selfenrol' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can self enrol into the course',\n ],\n 'export' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can export the post',\n ],\n 'controlreadstatus' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can control the read status of the post',\n ],\n 'canreplyprivately' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can post a private reply',\n ]\n ]\n ],\n 'urls' => [\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED,\n 'type' => [\n 'view' => [\n 'description' => 'The URL used to view the post',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'viewisolated' => [\n 'description' => 'The URL used to view the post in isolation',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'viewparent' => [\n 'description' => 'The URL used to view the parent of the post',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'edit' => [\n 'description' => 'The URL used to edit the post',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'delete' => [\n 'description' => 'The URL used to delete the post',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'split' => [\n 'description' => 'The URL used to split the discussion ' .\n 'with the selected post being the first post in the new discussion',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'reply' => [\n 'description' => 'The URL used to reply to the post',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'export' => [\n 'description' => 'The URL used to export the post',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'markasread' => [\n 'description' => 'The URL used to mark the post as read',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'markasunread' => [\n 'description' => 'The URL used to mark the post as unread',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'discuss' => [\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ]\n ]\n ],\n 'attachments' => [\n 'multiple' => true,\n 'type' => $attachmentdefinition\n ],\n 'tags' => [\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED,\n 'multiple' => true,\n 'type' => [\n 'id' => [\n 'type' => PARAM_INT,\n 'description' => 'The ID of the Tag',\n 'null' => NULL_NOT_ALLOWED,\n ],\n 'tagid' => [\n 'type' => PARAM_INT,\n 'description' => 'The tagid',\n 'null' => NULL_NOT_ALLOWED,\n ],\n 'isstandard' => [\n 'type' => PARAM_BOOL,\n 'description' => 'Whether this is a standard tag',\n 'null' => NULL_NOT_ALLOWED,\n ],\n 'displayname' => [\n 'type' => PARAM_TEXT,\n 'description' => 'The display name of the tag',\n 'null' => NULL_NOT_ALLOWED,\n ],\n 'flag' => [\n 'type' => PARAM_BOOL,\n 'description' => 'Wehther this tag is flagged',\n 'null' => NULL_NOT_ALLOWED,\n ],\n 'urls' => [\n 'description' => 'URLs associated with the tag',\n 'null' => NULL_NOT_ALLOWED,\n 'type' => [\n 'view' => [\n 'type' => PARAM_URL,\n 'description' => 'The URL to view the tag',\n 'null' => NULL_NOT_ALLOWED,\n ],\n ]\n ]\n ]\n ],\n 'html' => [\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED,\n 'type' => [\n 'rating' => [\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED,\n 'type' => PARAM_RAW,\n 'description' => 'The HTML source to rate the post',\n ],\n 'taglist' => [\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED,\n 'type' => PARAM_RAW,\n 'description' => 'The HTML source to view the list of tags',\n ],\n 'authorsubheading' => [\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED,\n 'type' => PARAM_RAW,\n 'description' => 'The HTML source to view the author details',\n ],\n ]\n ]\n ];\n }", "public function default_settings() : array {\n\t\treturn [\n\t\t\t'layout' => 'block',\n\t\t\t'newsletter' => '',\n\t\t\t'theme' => 'light',\n\t\t\t'type' => 'subscribe',\n\t\t];\n\t}", "private static function default_settings() {\n\t\treturn array(\n\t\t\t'module_ga' => true,\n\t\t\t'module_ip' => true,\n\t\t\t'module_log' => true,\n\t\t\t'sent_data' => false,\n\t\t\t'api_key' => '',\n\t\t\t'mark_as_approved' => true,\n\t\t);\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}", "private static function initialize_defaults() {\r\n\t\t\tself::$default_settings['credentials'] = array();\r\n\r\n\t\t\tself::$default_settings['has_first_question'] = 'no';\r\n\r\n\t\t\t// We want the Urtaks to appear by default, so let's append them\r\n\t\t\tself::$default_settings['placement'] = 'append';\r\n\r\n\t\t\t// We want to default post types to 'post' and 'page'\r\n\t\t\tself::$default_settings['post-types'] = array('page', 'post');\r\n\r\n\t\t\t// We want users to be able to start Urtaks by default\r\n\t\t\tself::$default_settings['user-start'] = 'yes';\r\n\r\n\t\t\t// We want Urtaks to support community moderation by default so that we get more questions and responses\r\n\t\t\tself::$default_settings['moderation'] = 'community';\r\n\r\n\t\t\t// Auto height and width\r\n\t\t\tself::$default_settings['height'] = '';\r\n\t\t\tself::$default_settings['width'] = '';\r\n\r\n\t\t\t// Counter settings\r\n\t\t\tself::$default_settings['counter-icon'] = 'yes';\r\n\t\t\tself::$default_settings['counter-responses'] = 'yes';\r\n\r\n\t\t\t// Profanity\r\n\t\t\tself::$default_settings['blacklisting'] = 'no';\r\n\t\t\tself::$default_settings['blacklist_override'] = 'no';\r\n\t\t\tself::$default_settings['blacklist_words'] = '';\r\n\t\t}", "static function get_default_property_names()\r\n {\r\n return parent :: get_default_property_names(array(self :: PROPERTY_TARGET_USER_ID));\r\n }", "static function get_default_property_names()\n {\n return array(self :: PROPERTY_ID, self :: PROPERTY_NAME, self :: PROPERTY_DESCRIPTION, self :: PROPERTY_BEGIN, self :: PROPERTY_END, self :: PROPERTY_AGREEMENT_ID, self :: PROPERTY_OWNER);\n }", "protected function get_default_shipping_props() {\n\t\treturn (object) array(\n\t\t\t'object' => null,\n\t\t\t'tax_class' => '',\n\t\t\t'taxable' => false,\n\t\t\t'total' => 0,\n\t\t\t'total_tax' => 0,\n\t\t\t'taxes' => array(),\n\t\t);\n\t}", "public function setMemberDefaults(){\n parent::setMemberDefaults();\n \n $this->id = $this->id ? $this->id : UniqId::get(\"rbn-\");\n if (!$this->collarTriangleWidth) {\n $this->collarTriangleWidth = StyleUtil::getHalf($this->collarWidth);\n }\n if (!$this->collarColor) {\n if ($this->barColor){\n $this->collarColor = $this->barColor;\n }\n else if( $this->barGradient ){\n $this->collarColor = GradientInfo::getLastColor($this->barGradient);\n }\n }\n }", "function commonAssign()\n\t{\n\t\tparent::commonAssign();\n\t\t$this->xt->assign(\"add_link\", true);\n\t\t$this->xt->assign(\"addselectlink_attrs\",\"id = \\\"addSelBtn\\\" \");\n\t\t$this->xt->assign(\"recordcontrolsad_block\",true);\n\t\t$this->xt->assign(\"checkbox_header\", true);\n\t\t\n\t\t$this->xt->assign(\"checkboxheader_attrs\", \"id=\\\"chooseAll_\".$this->id.\"\\\" data-checked=\\\"0\\\"\");\n\t}", "public static function getDefaultWidgetSettings(){\n return array(\n 'ChatBox' => array(\n 'chatboxHeight' => 300,\n 'chatmessageHeight' => 50,\n ),\n 'NoteBox' => array(\n 'noteboxHeight' => 200,\n 'notemessageHeight' => 50,\n ),\n 'DocViewer' => array(\n 'docboxHeight' => 200,\n ),\n 'TopSites' => array(\n 'topsitesHeight' => 200,\n 'urltitleHeight' => 10,\n ),\n 'MediaBox' => array(\n 'mediaBoxHeight' => 150,\n 'hideUsers' => array(),\n ),\n 'TimeZone' => array(\n 'clockType' => 'analog'\n ),\n 'SmallCalendar' => array(\n 'justMe' => 'false'\n ),\n 'FilterControls' => array(\n 'order' => array()\n )\n );\n }", "private function _setDefaults() {\r\n\t\t$checked = $selected = '';\r\n\t\t$isAdmin = $hasCart = false;\r\n\t\tif($this->isAdmin()) {\r\n\t\t\t$isAdmin = true;\r\n\t\t}\r\n\t\tif($this->Session->check('Order.id')) {\r\n\t\t\t$hasCart = true;\r\n\t\t}\r\n\t\t$this->set(compact('checked', 'selected', 'isAdmin', 'hasCart'));\r\n\t\t\r\n\t\t$this->layout = 'shop';\r\n\t\tif(isset($this->params['admin'])) {\r\n\t\t\t$this->layout = 'admin';\r\n\t\t}\r\n\t}", "function bdpp_default_settings() {\n\t\n\tglobal $bdpp_options;\n\t\n\t$bdpp_options = array(\n\t\t\t\t\t'post_types'\t\t\t=> array(0 => 'post'),\n\t\t\t\t\t'trend_post_types'\t\t=> array(),\n\t\t\t\t\t'sharing_enable'\t\t=> 0,\n\t\t\t\t\t'sharing'\t\t\t\t=> array(),\n\t\t\t\t\t'sharing_lbl'\t\t\t=> esc_html__('Share this', 'blog-designer-pack'),\n\t\t\t\t\t'sharing_design'\t\t=> 'design-1',\n\t\t\t\t\t'sharing_post_types'\t=> array(),\n\t\t\t\t\t'disable_font_awsm_css'\t=> 0,\n\t\t\t\t\t'disable_owl_css'\t\t=> 0,\n\t\t\t\t\t'custom_css'\t\t\t=> '',\n\t\t\t\t);\n\n\t$default_options = apply_filters('bdpp_default_options_values', $bdpp_options );\n\n\t// Update default options\n\tupdate_option( 'bdpp_opts', $default_options );\n\t\n\t// Overwrite global variable when option is update\n\t$bdpp_options = bdpp_get_settings();\n}", "public function useDefaults()\n\t{\n\t\t$this->use_defaults = true;\n\t}", "public function applyDefaultValues()\n {\n $this->is_active = false;\n $this->is_closed = false;\n }", "public function get_props() : array\n {\n return $this->additional['props'] ?? [];\n }", "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}", "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 __construct($props)\n {\n $this->props = $props;\n }", "private function setDefaults()\n {\n /** @var Property $property */\n foreach($this->properties as $name => $property)\n {\n $property->applyDefault();\n }\n }", "public function set_properties( $args ) {\n\n\t\t// Reset default property values\n\t\t$reset = array(\n\t\t\t'debug_mode' => false,\n\t\t\t'parant_plugin_slug' => '',\n\t\t\t'view' => plugin_dir_path( __FILE__ ) . 'wpaddons-io-sdk/view/wordpress-plugins.php',\n\t\t);\n\n\t\t// Define properties\n\t\tforeach ( $reset as $name => $default ) {\n\n\t\t\tif ( array_key_exists( $name, $args ) ) {\n\t\t\t\t// If set, use defined values\n\t\t\t\t$this->{$name} = $args[$name];\n\t\t\t} else {\n\t\t\t\t// If not set, use default values\n\t\t\t\t$this->{$name} = $default;\n\t\t\t}\n\n\t\t}\n\n\t}", "public function _setProps() {\n $dataController = get_called_class();\n $dataController::_getMapper();\n $dataController::_getModel();\n }", "public function applyDefaultValues()\n {\n $this->shnttype = '';\n $this->shntseq = 0;\n $this->shntkey2 = '';\n $this->shntform = '';\n }", "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}", "protected function defaultAttributes(){\n return [\n 'parentId' => 0, \n 'projectId' => 0, \n 'done' => 0, \n 'potion' => 0, \n 'notes' => array(), \n 'name' => '', \n ];\n }", "function load_default_vars()\r\n {\r\n parent::load_default_vars();\r\n $this->vars['URL_REPOS'] = '//your-private-repos-server/repos/'; // Unnecessary\r\n $this->vars['URL_RSC'] = $this->vars['URL_ASSETS'] . $this->manifest['activity_current'] . '/';\r\n }", "public function getIsShared()\n {\n if (array_key_exists(\"isShared\", $this->_propDict)) {\n return $this->_propDict[\"isShared\"];\n } else {\n return null;\n }\n }", "abstract public function field_props();", "public function __clone()\n {\n foreach ( $this->props as $path => $propStorage )\n {\n $this->props[$path] = clone $propStorage;\n }\n }", "public static function getDefaultVars(){\n\t\treturn Array(\n\t\t\t//--whether to output debug messages for this class\n\t\t\t'debug'=> false\n\t\t\t,'contentRelativePath'=> '_content'\n\t\t\t,'host'=> ($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['PWD']\n\t\t\t,'webRoot'=> ($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : $_SERVER['PWD']\n\t\t\t,'wpRelativePath'=> '_wp'\n\t\t\t,'protocol'=> (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) ? 'https' : 'http'\n\t\t);\n\t}", "protected function defineOptions() {\r\n $options = parent::defineOptions();\r\n $options['view_type'] = array('default' => 'web');\r\n\t$options['image_style'] = array('default' => '');\r\n\t$options['link_to_entity'] = array('default' => '');\r\n\r\n return $options;\r\n }", "public function setupDefaultContextVariables(): void\n {\n $this->sharedState()->basePath = '/';\n }", "protected function fillProperties()\n {\n foreach ($this as $key => $value) {\n if ($this->isPrivate($key)) {\n continue;\n }\n $this->currentProperties[\"{$key}\"] = $value;\n $this->newProperties[\"{$key}\"] = $value;\n }\n }", "public function defaultMediaSetting() {\n\t\tupdate_option( 'image_default_align', 'center' );\n\t\tupdate_option( 'image_default_link_type', 'none' );\n\t\tupdate_option( 'image_default_size', 'full' );\n\t}", "public function set_defaults()\n {\n $this->dir = null;\n $this->out = 'a';\n $this->mod = false;\n $this->err = false;\n $this->nort = false;\n $this->nostd = false;\n $this->quiet = false;\n $this->werror = false;\n $this->run = false;\n $this->format = false;\n $this->check = false;\n $this->version = false;\n $this->lib_paths = [ realpath(__DIR__ . '/../lib') ]; // install dir\n $this->log_dest = null; // stderr\n $this->log_time = false;\n $this->log_width = 80;\n $this->log_level = LOG_LEVEL_WARNING;\n $this->pack = null; // defaults to \"zip\"\n $this->stub = null; // defaults to \"none\"\n }", "public static function getShared()\r\n\t{\r\n\t\treturn self::$shared;\r\n\t}", "abstract protected function properties();", "protected function doCommonAssignments()\n\t{\n\t\t$this->message = $this->getMessages(); // ?\n\t\tparent::doCommonAssignments();\n\t}", "protected static function getDefaultSettings()\n {\n return array(\n 'prefix' => '',\n 'throw_exception' => false,\n 'connection' => null\n );\n }", "private function fn_register_common_variables() {\n\t\t$current_user = wp_get_current_user();\n\t\t//perhaps we don't need this variable. still, lets continue with this.\n\t\t$this->app_data['swpmvc_current_user'] = $current_user;\n\t\t$this->app_data['inline_js'] = '';\n\t}", "public function applyDefaultValues()\n {\n $this->phadtype = '';\n $this->phadid = '';\n $this->phadsubid = '';\n $this->phadsubidseq = 0;\n $this->phadcont = '';\n }", "protected function _defaultConfig()\n {\n return [\n 'tooltip' => [\n 'backgroundColor' => 'rgba(0,0,0,0.8)',\n 'padding' => [8, 12, 8, 12],\n 'axisPointer' => [\n 'type' => 'line',\n 'lineStyle' => [\n 'color' => '#607D8B',\n 'width' => 1\n ],\n 'crossStyle' => [\n 'color' => '#607D8B'\n ],\n 'shadowStyle' => [\n 'color' => 'rgba(200,200,200,0.2)'\n ]\n ],\n 'textStyle' => [\n 'fontFamily' => 'Roboto, sans-serif'\n ],\n ],\n 'color' => [\n '#2ec7c9','#b6a2de','#5ab1ef','#ffb980','#d87a80',\n '#8d98b3','#e5cf0d','#97b552','#95706d','#dc69aa',\n '#07a2a4','#9a7fd1','#588dd5','#f5994e','#c05050',\n '#59678c','#c9ab00','#7eb00a','#6f5553','#c14089'\n ],\n 'animation' => false,\n 'settings' => [\n 'height' => 420\n ],\n 'series' => []\n ];\n }", "public function get_css_common()\n {\n return array\n (\n \"lgwebapp.css\"\n );\n }", "static function get_default_property_names($extended_property_names = array())\r\n {\r\n return parent :: get_default_property_names(array(self :: PROPERTY_ID, self :: PROPERTY_NAME, self :: PROPERTY_DESCRIPTION));\r\n }", "private function configureHookCommon($params = false)\n {\n $lang = Tools::strtoupper($this->context->language->language_code);\n $currency = Tools::strtoupper($this->context->currency->iso_code);\n $search_engine_id = Configuration::get('DF_HASHID_' . $currency . '_' . $lang);\n $df_region = Configuration::get('DF_REGION');\n $script = Configuration::get('DOOFINDER_SCRIPT_' . $lang);\n $extra_css = Configuration::get('DF_EXTRA_CSS');\n $installation_ID = Configuration::get('DF_INSTALLATION_ID');\n if (empty($df_querySelector)) {\n $df_querySelector = '#search_query_top';\n }\n $this->smarty->assign([\n 'ENT_QUOTES' => ENT_QUOTES,\n 'lang' => Tools::strtolower($lang),\n 'script_html' => dfTools::fixScriptTag($script),\n 'extra_css_html' => dfTools::fixStyleTag($extra_css),\n 'productLinks' => $this->productLinks,\n 'search_engine_id' => $search_engine_id,\n 'df_region' => $df_region,\n 'self' => dirname(__FILE__),\n 'df_another_params' => $params,\n 'installation_ID' => $installation_ID,\n 'currency' => $currency,\n ]);\n }", "public function commonSettings(): array;", "private function _settings()\n\t{\n\t\tif(Utils::config('timestamps') or Utils::config('t'))\n\t\t\t$this->_timestamps = \"\\tpublic static \\$timestamps = true;\\n\\n\";\n\t}", "protected function defaults() {\n\t\t\t$config = array(\n\t\t\t\t'version' => $this->version,\n\t\t\t\t'autoshowpt' => array(\n\t\t\t\t\t//'post'=> true\n\t\t\t\t),\n\t\t\t\t'usept' => array(\n\t\t\t\t\t'post' => true\n\t\t\t\t),\n\t\t\t\t'usetax' => array(),\n\t\t\t\t'autoshowrss' => false,\n\t\t\t\t'do_c2c' => 1,\n\t\t\t\t'do_t2t' => 0,\n\t\t\t\t'do_t2c' => 0,\n\t\t\t\t'do_k2c' => 0,\n\t\t\t\t'do_k2t' => 0,\n\t\t\t\t'do_x2x' => 1,\n\t\t\t\t'minscore' => 50,\n\t\t\t\t'maxresults' => 5,\n\t\t\t\t'cachetime' => 60,\n\t\t\t\t'filterpriority' => 10,\n\t\t\t\t'log' => false,\n\t\t\t\t'loglevel' => false,\n\t\t\t\t'storage' => 'postmeta',\n\t\t\t\t'storage_id' => 'better-related-',\n\t\t\t\t'querylimit' => 1000,\n\t\t\t\t't_querylimit' => 10000,\n\t\t\t\t'mtime' => time(),\n\t\t\t\t'relatedtitle' => sprintf(\n\t\t\t\t\t\"<strong>%s</strong>\",\n\t\t\t\t\t__( 'Related content:', 'better-related' )\n\t\t\t\t),\n\t\t\t\t'relatednone' => sprintf(\n\t\t\t\t\t\"<p>%s</p>\",\n\t\t\t\t\t__( 'No related content found.', 'better-related' )\n\t\t\t\t),\n\t\t\t\t'thanks' => 'below',\n\t\t\t\t'stylesheet' => true,\n\t\t\t\t'showdetails' => false\n\t\t\t);\n\t\t\treturn $config;\n\t\t}", "public function defineProperties()\n {\n return [\n 'title' => [\n 'title' => 'Widget title',\n 'default' => self::DEFAULT_TITLE,\n 'type' => 'string',\n 'validationPattern' => '^.+$',\n 'validationMessage' => 'The Widget Title is required.'\n ],\n\n 'recordsCount' => [\n 'title' => 'Number of records to show (-1: ALL)',\n 'default' => self::DEFAULT_RECORDS_COUNT,\n 'type' => 'string',\n 'validationPattern' => '^-?[0-9]+$'\n ],\n ];\n }", "public function getIsShared()\n {\n return $this->getProperty(\"IsShared\");\n }", "private function getProperties(){\n\n\n\t\t$props = get_post_meta(\n\t\t\t$this->post_id,\n\t\t\t'_column_props_'.$this->fullId,\n\t\t\ttrue\n\t\t);\n\n\n\n\t\t$defaults = $this->getDefaultColumnArgs();\n\t\t$props = wp_parse_args( $props, $defaults );\n\n\t\t$this->properties = $props;\n\n\t}", "protected function add_common_attribute_classes(){\n\t\tparent::add_common_attribute_classes();\n\t}", "public function setPublicShareKeyIDAndMasterKeyId() {\n\t\t$this->publicShareKeyId = $this->config->getAppValue('encryption',\n\t\t\t'publicShareKeyId');\n\t\tif (is_null($this->publicShareKeyId) || ($this->publicShareKeyId === '')) {\n\t\t\t$this->publicShareKeyId = 'pubShare_' . substr(md5(time()), 0, 8);\n\t\t\t$this->config->setAppValue('encryption', 'publicShareKeyId', $this->publicShareKeyId);\n\t\t}\n\n\t\t$this->masterKeyId = $this->config->getAppValue('encryption',\n\t\t\t'masterKeyId');\n\t\tif (is_null($this->masterKeyId) || ($this->masterKeyId === '')) {\n\t\t\t$this->masterKeyId = 'master_' . substr(md5(time()), 0, 8);\n\t\t\t$this->config->setAppValue('encryption', 'masterKeyId', $this->masterKeyId);\n\t\t}\n \t}", "public function mergeTemplateVars()\n {\n $title = $this->data[IrhpPermitType::DATA_KEY]['name']['description'];\n\n $this->templateVarsConfig['generic']['browserTitle'] = $title;\n $this->templateVarsConfig['generic']['title'] = $title;\n\n parent::mergeTemplateVars();\n }", "static function get_default_property_names($extended_property_names = array())\n {\n return parent :: get_default_property_names(array(self :: PROPERTY_FIRST_NAME, self :: PROPERTY_LAST_NAME, self :: PROPERTY_EMAIL, self :: PROPERTY_AFFILIATION, self :: PROPERTY_PASSWORD, self :: PROPERTY_GROUP, self :: PROPERTY_STATUS));\n }", "protected function getOverridableProperties()\n {\n return array_merge($this->config->overridableProperties, $this->requestConfig->overridableProperties);\n }", "protected function get_default_params() {\n\t\t$defaults = [];\n\t\t$schema = $this->get_public_item_schema();\n\t\tforeach ( $schema['properties'] as $arg => $options ) {\n\t\t\tif ( isset( $options['default'] ) ) {\n\t\t\t\t$defaults[ $arg ] = $options['default'];\n\t\t\t}\n\t\t}\n\t\treturn $defaults;\n\t}", "static function get_default_property_names($extended_property_names = array())\r\n\t{\r\n\t\treturn parent :: get_default_property_names(array (self :: PROPERTY_FROM_USER_ID, self :: PROPERTY_TO_USER_ID, self :: PROPERTY_DATE, self :: PROPERTY_MESSAGE));\r\n\t}", "protected function resetProperties() {}", "protected function baseConfigurationDefaults() {\n return array(\n 'id' => $this->getPluginId(),\n 'label' => '',\n 'cache' => DRUPAL_CACHE_PER_ROLE,\n );\n }", "protected function reset_properties() {\n\t\t$this->author = false;\n\t\t$this->readme = array();\n\t\t$this->theme = false;\n\t\t$this->theme_post = false;\n\t\t$this->theme_slug = '';\n\t\t$this->theme_dir = '';\n\t\t$this->theme_name = '';\n\t\t$this->tmp_svn_dir = '';\n\t\t$this->trac_changeset = 0;\n\t\t$this->trac_ticket = (object) array(\n\t\t\t'id' => 0,\n\t\t\t'resolution' => '',\n\t\t\t'summary' => '',\n\t\t\t'keywords' => [],\n\t\t\t'parent_link' => '',\n\t\t\t'priority' => '',\n\t\t\t'diff_line' => '',\n\t\t\t'description' => '',\n\t\t);\n\t\t$this->version_status = 'new';\n\t\t$this->importing_from = 'upload';\n\t\t$this->commit_msg = '';\n\n\t\t// $this->tmp_dir = ''; // Temporary folder per each instance of this class. Doesn't need to be reset each time.\n\t\t// $this->trac = false; // This can stay active, Trac access won't change between calls.\n\t}", "public function init()\n {\n parent::init();\n\n static::$tcCommon = $this->tcModule;\n\n $properties = array_keys(Yii::getObjectVars($this));\n $params = $this->module->params;\n foreach ($params as $property => $value) {\n if (in_array($property, $properties)) {\n $this->$property = $value;\n }\n }\n }", "public function populateDefaults() {\n\t\t$this->owner->ShowInMenus = false;\n\t\t$this->owner->ShowInSearch = false;\n\t\t$this->owner->SubmitButtonText = \"Show my results\";\n \t}", "protected function CustomVariables ()\r\n\t{\r\n\t\t// Overwrite variables if you want them custom\r\n\t\t$this->Set ('autoload', true);\r\n\t\t$this->Set ('enable_query_strings', false);\r\n\t\t\r\n\t\t// Add your own variables\r\n\t\t$this->Set ('database_host', 'localhost');\r\n\t\t$this->Set ('database_user', 'database_username');\r\n\t\t$this->Set ('database_pass', 'database_password');\r\n\t\t$this->Set ('database_name', 'database_name');\r\n\t\t$this->Set ('database_prefix', 'database_prefix');\r\n\t}", "function setProperty() {\n $instance = $this->CI->ciwy->current_instance[$this->component_name];\n $properties = func_get_arg(0);\n if (is_array($properties)) {\n foreach($properties as $key => $val) {\n if ( ! isset($this->component_property[$key])) {\n $message = '[' . $this->CI->ciwy->library_name . '] '. $key . ' is not a '.$this->component_name .' Property.';\n log_message('error', $message);\n show_error($message);\n } else {\n $this->CI->ciwy->component_config[$instance]['Config'][$key] = $val;\n }\n }\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 get_default_params()\n {\n }", "function default_options() {\r\n\t\t$this->version = BF_VERSION;\r\n\t\t\r\n\t\t$this->footer_message = sprintf( __('<strong>&copy; %s</strong>. All Rights Reserved.'), get_bloginfo('name') );\r\n\t\t\r\n\t\t$this->home_link = __('Home', 'buffet');\r\n\t\t$this->blog_link = __('Blog', 'buffet');\r\n\t\t$this->topnav_linkcat = 0;\r\n\t\t\r\n\t\t$this->index_news_thumbs = true;\r\n\t\t\r\n\t\t$this->archive_news_thumbs = true;\r\n\r\n\t\t$this->hooks = array();\r\n\t}", "private function mergeDefaultSettings(){\n\t\t//Get a copy of the default configuration.\n\t\t$defaultConfig = $this->getDefaultConfig();\n\t\t//Check for a 'general' section\n\t\tif(array_key_exists('general', $this->configuration)){\n\t\t\t//If it exists, compare the default keys to the loaded config for missing values\n\t\t\t$missingGeneral = array_diff_key($defaultConfig['general'], $this->configuration['general']);\n\t\t\t//Iterate through the missing values and attach them to the running configuration.\n\t\t\tif(count($missingGeneral) > 0){\n\t\t\t\tforeach($missingGeneral as $key=>$parameter){\n\t\t\t\t\t$this->configuration['general'][$key] = $parameter;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t//Section doesn't exist, so we need to set it to the defaults.\n\t\t\t$this->configuration['general'] = $defaultConfig['general'];\n\t\t}\n\t\t//Check for a 'options' section\n\t\tif(array_key_exists('options', $this->configuration)){\n\t\t\t//If it exists, compare the default keys to the loaded config for missing values\n\t\t\t$missingOptions = array_diff_key($defaultConfig['options'], $this->configuration['options']);\n\t\t\t//Iterate through the missing values and attach them to the running configuration.\n\t\t\tif(count($missionOptions) > 0){\n\t\t\t\tforeach($missingOptions as $key=>$parameter){\n\t\t\t\t\t$this->configuration['options'][$key] = $parameter;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t//Section doesn't exist, so we need to set it to the defaults.\n\t\t\t$this->configuration['options'] = $defaultConfig['options'];\n\t\t}\n\t}", "protected function defaultParams()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function initVars() {\n\n\t\t}", "private static function get_default_properties()\r\n {\r\n $content_object_alias = RepositoryDataManager :: get_instance()->get_alias(ContentObject :: get_table_name());\r\n \r\n $properties = array();\r\n $properties[] = new GalleryObjectTableProperty(ContentObject :: PROPERTY_TITLE, $content_object_alias);\r\n $properties[] = new GalleryObjectTableProperty(ContentObject :: PROPERTY_DESCRIPTION, $content_object_alias);\r\n return $properties;\r\n }", "private function getDefaultAttributes()\n {\n return array('lastPhotoId' => '', 'lastActionId' => '', 'lastGroupId' => '', 'lastWebhookId' => '', 'password' => '');\n }" ]
[ "0.5947392", "0.5346081", "0.53405166", "0.53042525", "0.5266392", "0.52301306", "0.52056587", "0.518751", "0.51378745", "0.5104388", "0.5095114", "0.5061604", "0.50492287", "0.50486624", "0.5039966", "0.5026632", "0.50234526", "0.5004508", "0.49763393", "0.4962831", "0.49071822", "0.4906092", "0.49047866", "0.48904285", "0.4861618", "0.48555833", "0.48345354", "0.4834381", "0.48114416", "0.48067087", "0.480482", "0.4794349", "0.47927743", "0.47853154", "0.47760776", "0.47759515", "0.47672996", "0.4755035", "0.47463825", "0.47416523", "0.47308934", "0.47290146", "0.47210115", "0.47118437", "0.47106543", "0.47066206", "0.4699808", "0.46962807", "0.468272", "0.46741286", "0.4668198", "0.46420735", "0.46363947", "0.46363717", "0.46321365", "0.46295515", "0.46262908", "0.46189693", "0.46175352", "0.4602107", "0.4587677", "0.45781153", "0.45649886", "0.4561859", "0.4557", "0.45498866", "0.45474783", "0.45473835", "0.454729", "0.45425937", "0.45419648", "0.45324877", "0.4531014", "0.45280597", "0.4523466", "0.45190594", "0.4518922", "0.4510504", "0.45092934", "0.4507205", "0.4502973", "0.45025906", "0.44998938", "0.44979325", "0.4496778", "0.4496141", "0.44920838", "0.44908735", "0.44792512", "0.44744703", "0.44717473", "0.4463687", "0.44625023", "0.4461459", "0.44598973", "0.4457016", "0.44550428", "0.4450792", "0.44501907", "0.44480816", "0.44415578" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('MatHangTable')->insert([ 'id' =>'1', 'id_Xuatxu' => '3', 'id_MaLoai'=>1, 'id_LKLT'=>"1", 'id_LDVT'=>2, 'id_NhaCC'=>, 'TenMH'=>'Sản Phẩm a', 'BiDanh'=>'ah1', 'TenThuonghieu'=>'Olay', 'TenXuatXu'=>'Hàn Quốc', 'GiaTriKLT'=>'32', 'GiaTriDVT'=>'1', 'MoTaSP'=>'không mô tả', 'Hinh'=>'', 'GiaNhap'=>321000, 'GiaBan'=>450000, 'GiaGiam'=>15000, 'MaSPKM'=>'KM1', 'SLKM'=>25, 'Tinhtrang'=>1, ]); DB::table('MatHangTable')->insert([ 'id' =>'2', 'id_Xuatxu' => '2', 'id_MaLoai'=>1, 'id_LKLT'=>"1", 'id_LDVT'=>2, 'id_NhaCC'=>, 'TenMH'=>'Sản Phẩm d', 'BiDanh'=>'ah2', 'TenThuonghieu'=>'Olay', 'TenXuatXu'=>'Hàn Quốc', 'GiaTriKLT'=>'15', 'GiaTriDVT'=>'1', 'MoTaSP'=>'không mô tả', 'Hinh'=>'', 'GiaNhap'=>210000, 'GiaBan'=>480000, 'GiaGiam'=>35000, 'MaSPKM'=>'KM2', 'SLKM'=>25, 'Tinhtrang'=>1, ]); DB::table('MatHangTable')->insert([ 'id' =>'3', 'id_Xuatxu' => '1', 'id_MaLoai'=>1, 'id_LKLT'=>"1", 'id_LDVT'=>2, 'id_NhaCC'=>, 'TenMH'=>'Sản Phẩm c', 'BiDanh'=>'ah3', 'TenThuonghieu'=>'Olay', 'TenXuatXu'=>'Mỹ', 'GiaTriKLT'=>'22', 'GiaTriDVT'=>'1', 'MoTaSP'=>'không mô tả', 'Hinh'=>'', 'GiaNhap'=>421000, 'GiaBan'=>580000, 'GiaGiam'=>15000, 'MaSPKM'=>'KM1', 'SLKM'=>25, 'Tinhtrang'=>1, ]); DB::table('MatHangTable')->insert([ 'id' =>'4', 'id_Xuatxu' => '3', 'id_MaLoai'=>2, 'id_LKLT'=>"1", 'id_LDVT'=>2, 'id_NhaCC'=>, 'TenMH'=>'Sản Phẩm d', 'BiDanh'=>'ah4', 'TenThuonghieu'=>'Olay', 'TenXuatXu'=>'Pháp', 'GiaTriKLT'=>'18', 'GiaTriDVT'=>'1', 'MoTaSP'=>'không mô tả', 'Hinh'=>'', 'GiaNhap'=>221000, 'GiaBan'=>350000, 'GiaGiam'=>25000, 'MaSPKM'=>'KM1', 'SLKM'=>25, 'Tinhtrang'=>1, ]); DB::table('MatHangTable')->insert([ 'id' =>'5', 'id_Xuatxu' => '3', 'id_MaLoai'=>2, 'id_LKLT'=>"1", 'id_LDVT'=>2, 'id_NhaCC'=>, 'TenMH'=>'Sản Phẩm e', 'BiDanh'=>'ah5', 'TenThuonghieu'=>'Olay', 'TenXuatXu'=>'Pháp', 'GiaTriKLT'=>'18', 'GiaTriDVT'=>'1', 'MoTaSP'=>'không mô tả', 'Hinh'=>'', 'GiaNhap'=>221000, 'GiaBan'=>650000, 'GiaGiam'=>25000, 'MaSPKM'=>'KM1', 'SLKM'=>20, 'Tinhtrang'=>1, ]); DB::table('MatHangTable')->insert([ 'id' =>'6', 'id_Xuatxu' => '3', 'id_MaLoai'=>2, 'id_LKLT'=>"1", 'id_LDVT'=>2, 'id_NhaCC'=>, 'TenMH'=>'Sản Phẩm f', 'BiDanh'=>'ah6', 'TenThuonghieu'=>'Olay', 'TenXuatXu'=>'Pháp', 'GiaTriKLT'=>'18', 'GiaTriDVT'=>'1', 'MoTaSP'=>'không mô tả', 'Hinh'=>'', 'GiaNhap'=>221000, 'GiaBan'=>650000, 'GiaGiam'=>25000, 'MaSPKM'=>'KM1', 'SLKM'=>20, 'Tinhtrang'=>1, ]); DB::table('MatHangTable')->insert([ 'id' =>'7', 'id_Xuatxu' => '3', 'id_MaLoai'=>3, 'id_LKLT'=>"1", 'id_LDVT'=>2, 'id_NhaCC'=>, 'TenMH'=>'Sản Phẩm g', 'BiDanh'=>'ah7', 'TenThuonghieu'=>'Olay', 'TenXuatXu'=>'Pháp', 'GiaTriKLT'=>'13', 'GiaTriDVT'=>'1', 'MoTaSP'=>'không mô tả', 'Hinh'=>'', 'GiaNhap'=>375000, 'GiaBan'=>550000, 'GiaGiam'=>25000, 'MaSPKM'=>'KM1', 'SLKM'=>20, 'Tinhtrang'=>1, ]); DB::table('MatHangTable')->insert([ 'id' =>'8', 'id_Xuatxu' => '3', 'id_MaLoai'=>3, 'id_LKLT'=>"1", 'id_LDVT'=>2, 'id_NhaCC'=>, 'TenMH'=>'Sản Phẩm h', 'BiDanh'=>'ah8', 'TenThuonghieu'=>'Olay', 'TenXuatXu'=>'Anh', 'GiaTriKLT'=>'15', 'GiaTriDVT'=>'1', 'MoTaSP'=>'không mô tả', 'Hinh'=>'', 'GiaNhap'=>250000, 'GiaBan'=>650000, 'GiaGiam'=>25000, 'MaSPKM'=>'KM1', 'SLKM'=>20, 'Tinhtrang'=>1, ]); DB::table('MatHangTable')->insert([ 'id' =>'9', 'id_Xuatxu' => '3', 'id_MaLoai'=>3, 'id_LKLT'=>"1", 'id_LDVT'=>2, 'id_NhaCC'=>, 'TenMH'=>'Sản Phẩm i', 'BiDanh'=>'ah9', 'TenThuonghieu'=>'Olay', 'TenXuatXu'=>'Pháp', 'GiaTriKLT'=>'18', 'GiaTriDVT'=>'1', 'MoTaSP'=>'không mô tả', 'Hinh'=>'', 'GiaNhap'=>421000, 'GiaBan'=>550000, 'GiaGiam'=>25000, 'MaSPKM'=>'KM1', 'SLKM'=>20, 'Tinhtrang'=>1, ]); DB::table('MatHangTable')->insert([ 'id' =>'10', 'id_Xuatxu' => '3', 'id_MaLoai'=>3, 'id_LKLT'=>"1", 'id_LDVT'=>2, 'id_NhaCC'=>, 'TenMH'=>'Sản Phẩm k', 'BiDanh'=>'ah10', 'TenThuonghieu'=>'Olay', 'TenXuatXu'=>'Trung Quốc', 'GiaTriKLT'=>'18', 'GiaTriDVT'=>'1', 'MoTaSP'=>'không mô tả', 'Hinh'=>'', 'GiaNhap'=>420000, 'GiaBan'=>550000, 'GiaGiam'=>25000, 'MaSPKM'=>'KM1', 'SLKM'=>20, 'Tinhtrang'=>1, ]); DB::table('MatHangTable')->insert([ 'id' =>'11', 'id_Xuatxu' => '3', 'id_MaLoai'=>3, 'id_LKLT'=>"1", 'id_LDVT'=>2, 'id_NhaCC'=>, 'TenMH'=>'Sản Phẩm l', 'BiDanh'=>'ah11', 'TenThuonghieu'=>'Olay', 'TenXuatXu'=>'Trung Quốc', 'GiaTriKLT'=>'18', 'GiaTriDVT'=>'1', 'MoTaSP'=>'không mô tả', 'Hinh'=>'', 'GiaNhap'=>250000, 'GiaBan'=>350000, 'GiaGiam'=>25000, 'MaSPKM'=>'KM1', 'SLKM'=>20, 'Tinhtrang'=>1, ]); DB::table('MatHangTable')->insert([ 'id' =>'12', 'id_Xuatxu' => '3', 'id_MaLoai'=>2, 'id_LKLT'=>"1", 'id_LDVT'=>2, 'id_NhaCC'=>, 'TenMH'=>'Sản Phẩm m', 'BiDanh'=>'ah12', 'TenThuonghieu'=>'Olay', 'TenXuatXu'=>'Trung Quốc', 'GiaTriKLT'=>'18', 'GiaTriDVT'=>'1', 'MoTaSP'=>'không mô tả', 'Hinh'=>'', 'GiaNhap'=>520000, 'GiaBan'=>650000, 'GiaGiam'=>25000, 'MaSPKM'=>'KM1', 'SLKM'=>20, 'Tinhtrang'=>1, ]); DB::table('MatHangTable')->insert([ 'id' =>'13', 'id_Xuatxu' => '3', 'id_MaLoai'=>1, 'id_LKLT'=>"1", 'id_LDVT'=>2, 'id_NhaCC'=>, 'TenMH'=>'Sản Phẩm n', 'BiDanh'=>'ah13', 'TenThuonghieu'=>'Olay', 'TenXuatXu'=>'Mỹ', 'GiaTriKLT'=>'18', 'GiaTriDVT'=>'1', 'MoTaSP'=>'không mô tả', 'Hinh'=>'', 'GiaNhap'=>420000, 'GiaBan'=>550000, 'GiaGiam'=>25000, 'MaSPKM'=>'KM1', 'SLKM'=>20, 'Tinhtrang'=>1, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(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(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 // $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 // 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 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(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\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 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.8014072", "0.7980389", "0.7977261", "0.79545176", "0.7951285", "0.7949779", "0.79447794", "0.79427236", "0.7938544", "0.7937133", "0.7933888", "0.7892658", "0.78813094", "0.7879304", "0.78790134", "0.7875582", "0.78718805", "0.7870327", "0.7851507", "0.78506047", "0.7841656", "0.7834773", "0.782799", "0.7819246", "0.7809116", "0.7803176", "0.7802559", "0.7800953", "0.7799208", "0.77958846", "0.77905864", "0.7788729", "0.7786444", "0.7778857", "0.7777666", "0.7765372", "0.77626014", "0.7762562", "0.77622634", "0.77615577", "0.7760895", "0.77596897", "0.7757152", "0.7753893", "0.77497184", "0.77495176", "0.77468747", "0.77301675", "0.77291715", "0.772798", "0.7716827", "0.77145964", "0.7714208", "0.7713344", "0.77125347", "0.771253", "0.7711237", "0.77112275", "0.77108705", "0.7710304", "0.7705747", "0.77048707", "0.770442", "0.77041996", "0.77028614", "0.77021116", "0.77008957", "0.7698864", "0.76987725", "0.7697583", "0.76966494", "0.76945114", "0.7692977", "0.7691408", "0.76907796", "0.7688464", "0.7687695", "0.7686974", "0.7686826", "0.76851374", "0.7684132", "0.7679417", "0.7678492", "0.76778567", "0.76769906", "0.76728696", "0.7671034", "0.76692134", "0.7668971", "0.7668952", "0.7666531", "0.7662757", "0.7662455", "0.76616526", "0.765996", "0.7656754", "0.765413", "0.76537156", "0.76526105", "0.76523715", "0.7652133" ]
0.0
-1
Event function that is called when a new user connects to the WebSocket server.
public function onOpen(ConnectionInterface $conn) { echo "new connection from {$conn->remoteAddress}\n"; $this->users->attach($conn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onOpen(ConnectionInterface $conn)\n {\n /** @var QueryString $GET */\n $GET = $conn->WebSocket->request->getQuery();\n if(empty($this->users[$GET->get('userId')])) $this->users[$GET->get('userId')] = [];\n $this->users[$GET->get('userId')][] = $conn;\n\n echo \"New connection! ({$conn->resourceId})\".PHP_EOL;\n }", "abstract protected function onClientConnected(WebSocketClient $client);", "public function on_user_add(&$user) {\r\n\t\t$this->socket_array[(int)$user->socket] = $user;\r\n\t}", "function wsOnOpen($clientID)\n{\n\tglobal $Server;\n\t$ip = long2ip( $Server->wsClients[$clientID][6] );\n\n\t$Server->log( \"$ip ($clientID) has connected.\" );\n\t// You may have expected a message about user connecting sent to all users here, but user connected\n\t// is sent upon nick change instead, because we don't have the nickname when a user connects\n}", "public function onReady() {\n\t\t$appInstance = $this; // a reference to this application instance for ExampleWebSocketRoute\n\t\t\\PHPDaemon\\WebSocket\\WebSocketServer::getInstance()->addRoute('ExamplePubSub', function ($client) use ($appInstance) {\n\t\t\treturn new ExamplePubSubWebSocketRoute($client, $appInstance);\n\t\t});\n\t\t$this->sql = \\PHPDaemon\\Clients\\MySQLClient::getInstance();\n\t\t$this->pubsub = new \\PHPDaemon\\PubSub();\n\t\t$this->pubsub->addEvent('usersNum', \\PHPDaemon\\PubSubEvent::init()\n\t\t\t\t\t\t\t\t\t\t\t\t ->onActivation(function ($pubsub) use ($appInstance) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t \\PHPDaemon\\Daemon::log('onActivation');\n\t\t\t\t\t\t\t\t\t\t\t\t\t if (isset($pubsub->event)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \\PHPDaemon\\Timer::setTimeout($pubsub->event, 0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t return;\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 $pubsub->event = setTimeout(function ($timer) use ($pubsub, $appInstance) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $appInstance->sql->getConnection(function ($sql) use ($pubsub) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t if (!$sql->connected) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t return;\n\t\t\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\t\t $sql->query('SELECT COUNT(*) `num` FROM `dle_users`', function ($sql, $success) use ($pubsub) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $pubsub->pub(sizeof($sql->resultRows) ? $sql->resultRows[0]['num'] : 'null');\n\t\t\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\t });\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $timer->timeout(5e6); // 5 seconds\n\t\t\t\t\t\t\t\t\t\t\t\t\t }, 0);\n\t\t\t\t\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t\t\t\t\t\t ->onDeactivation(function ($pubsub) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t if (isset($pubsub->event)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \\PHPDaemon\\Timer::cancelTimeout($pubsub->event);\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t })\n\t\t);\n\t}", "protected function connected ($user)\n\t\t{\n\t\t\t//Send welcome message to user\n\t\t\t$welcome_message = 'Hello!<br>Welcome to the Websocket server!<br>Type \"help\" to see what commands are available.';\n\t\t\t$this->stdout(\"\\n\\nTESTING OUTPUT\\n\\n\");\n\t\t\t$this->send($user, $welcome_message);\n\t\t}", "protected function connected($user)\n\t{\n\t}", "public function onOpen(ConnectionInterface $conn) {\n $this->clients->attach($conn);\n\n // We have to check if event callback must be called\n if (!empty($this->CI->ci_websocket->callback['open'])) {\n\n // At this moment we have to check if we have authent callback defined\n call_user_func_array($this->CI->ci_websocket->callback['open'],\n array($this->clients,$conn));\n\n // Output\n if ($this->CI->ci_websocket->debug) {\n output('info', 'Callback open \"' . $this->CI->ci_websocket->callback['open'][1] . '\" called');\n }\n }else{\n\t\t\techo \"New connection! ({$conn->resourceId})\\n\";\n\t\t}\n }", "public function configuration()\n {\n $this->socketIO->on('connection', function($socket)\n {\n $socket->loggedUser = false;\n\n // cuando se ejecute en el cliente el evento add user\n $socket->on('add user', function ($username) use($socket)\n {\n\n // guardamos al usuario en sesión\n $socket->username = $username;\n\n //añadimos al cliente a la lista global\n #$this->usernames[$username] = $username;\n array_push($this->usernames, $username);\n ++$this->numUsers;\n\n $socket->loggedUser = true;\n $socket->emit('login', array(\n 'numUsers' => $this->numUsers,\n 'usernames' => $this->usernames,\n ));\n\n // notificamos a todos que un usuario ha entrado\n $socket->broadcast->emit('user joined', array(\n 'username' => $socket->username,\n 'numUsers' => $this->numUsers,\n \"usernames\"=> $this->usernames\n ));\n\n });\n\n // cuando se ejecute en el cliente el evento new message\n $socket->on('new message', function($message) use($socket)\n {\n //me notifico del mensaje que he escrito\n $socket->emit(\"new message\", array(\n \"action\" => \"yo\",\n \"message\" => \"Yo: \" . $message\n )\n );\n\n //notificamos al resto del mensaje que he escrito\n $socket->broadcast->emit(\"new message\", array(\n \"action\" => \"chat\",\n \"message\" => $socket->username . \" dice: \" . $message\n ));\n });\n\n // cuando se ejecute en el cliente el evento status\n $socket->on('status', function () use ($socket) {\n\n $socket->emit('status', array(\n 'numUsers' => $this->numUsers,\n \"usernames\"=> array_values($this->usernames)\n ));\n });\n\n // cuando se ejecute en el cliente el evento user logout\n $socket->on('user logout', function () use($socket)\n {\n\n if($socket->loggedUser)\n {\n //actualizamos la lista de usuarios conectados\n unset($this->usernames[$socket->username]);\n $this->numUsers--;\n\n // notificamos de forma global que el usuario está fuera\n $socket->broadcast->emit('user left', array(\n 'username' => $socket->username,\n 'numUsers' => $this->numUsers,\n \"usernames\"=> $this->usernames\n ));\n }\n });\n\n //evento de socketio cada vez que un nuevo socket se desconecta (cierra la web o actualiza el navegador)\n $socket->on('disconnect', function () use($socket)\n {\n // eliminamos al usuario de la lista de usuarios\n if($socket->loggedUser) {\n //actualizamos la lista de usuarios conectados\n //unset($this->usernames[$socket->username]);\n //$this->numUsers--;\n $key = array_search($socket->username, $this->usernames);\n unset($this->usernames[$key]);\n --$this->numUsers;\n\n // notificamos de forma global que el usuario está fuera\n $socket->broadcast->emit('user left', array(\n 'username' => $socket->username,\n 'numUsers' => $this->numUsers,\n 'usernames' => $this->usernames\n ));\n }\n });\n });\n }", "function wsOnOpen($clientID) {\n\t\t$ip = long2ip($this->socket->wsClients[$clientID][6]);\n\n\n\n\n\t\t$this->socket->log(\"$ip ($clientID) has connected.\");\n\n\n\n\t\t//Send a join notice to everyone but the person who joined\n\t\tforeach ($this->socket->wsClients as $id => $client)\n\t\t\tif ($id != $clientID)\n\t\t\t\t$this->socket->wsSend($id, json_encode(array('tipo'=>'conexion','clienteId'=>$clientID ,'ip'=>$ip)));\n\n\t}", "protected function connecting($user) {\n // Override to handle a connecting user, after the instance of the User is created, but before\n // the handshake has completed.\n }", "function onOpen(Ratchet\\ConnectionInterface $conn)\r\n {\r\n echo \"connected: \" . $conn->resourceId . \"\\n\";\r\n $this->clients->attach($conn);\r\n\r\n\r\n foreach($this->clients as $client) {\r\n if ($conn->resourceId !== $client->resourceId){\r\n $connection_obj = array(\r\n 'type' => 'newConnection',\r\n 'resourceId' => $conn->resourceId\r\n );\r\n\r\n\r\n $client->send(json_encode($connection_obj));\r\n }else {\r\n\r\n $connection_obj = array(\r\n 'type' => 'yourId',\r\n 'resourceId' => $conn->resourceId\r\n );\r\n $client->send(json_encode($connection_obj));\r\n }\r\n }\r\n }", "public function onNewUserCreated($name)\n {\n $this->_logger->debug(\"New user: $name\");\n }", "function subscribeUser()\n\t\t{\n\t\t\techo $this->email.\"add to the database !!\";\n\t\t}", "static public function on_user_login( $nick )\n\t{\n\t\tself::umode( core::$config->nickserv->nick, $nick, '+r' );\n\t}", "public function onUserLogin($event) {\n\n Log::info('event catched');\n }", "public function addUserConnected(Request $request){\n $socket = Socket::query()->find($request->get('user_id'));\n if(is_null($socket)){\n $socket = new Socket();\n $socket->user_id = $request->get('user_id');\n $socket->socket = $request->get('socket');\n $socket->save();\n return Response::raw(201, $socket);\n }else if(!is_null($socket)){\n $socket->socket = $request->get('socket');\n $socket->update(['user_id' => $request->get('user_id'), 'socket' => $request->get('socket')]);\n return Response::raw(200, $socket);\n }else{\n return Response::raw(200, []);\n }\n }", "public function onLogin( $user )\n {\n // Update the users online timestamp.\n //\n $this->userRepository->updateOnlineCheckAt( $user );\n }", "function onOpen(\\Ratchet\\ConnectionInterface $conn)\n {\n $this->conexiones[] = $conn;\n\n\n\n\n\n\n }", "public function on_start(){\r\n\t\t$u = new User();\r\n\t\tif ($u->isRegistered()) {\r\n\t\t\t$ui = UserInfo::getByID($u->getUserID());\r\n\t\t\t$this->myUI = $ui;\r\n\t\t\t$color = $ui->getUserFavoriteColor(); // \"favorite color\"\r\n\t\t\t$this->set('favoriteColor',$color);\r\n\t\t}\r\n\t\t$form = Loader::helper('form');\r\n\t\t$this->set('form', $form);\r\n\t\t$hcolor = Loader::helper('form/color');\r\n\t\t$this->set('hcolor', $hcolor);\r\n\r\n\t}", "private function addUser()\n {\n $this->online->addUser($this->user, $this->place, $this->loginTime);\n }", "abstract protected function connected($user);", "abstract protected function connected($user);", "protected function connecting($user)\n\t{\n\t\t// Override to handle a connecting user, after the instance of the User is created, but before\n\t\t// the handshake has completed.\n\t}", "public function onOpen(ConnectionInterface $conn) {\n $this->clients->attach($conn);\n //include('../functions.php');\n\n $getToken = $conn->httpRequest->getUri()->getQuery();\n\n parse_str($getToken,$setToken);\n //update_connection_id($conn->resourceId,$setToken);\n $token = $setToken['token'];\n echo \"New connection! ({$conn->resourceId})\\n\";\n \n $connection = mysqli_connect(\"localhost\",\"root\",\"\",\"chat\");\n $user_connection_id = $conn->resourceId;\n $query = \"UPDATE chat_user SET user_connection_id = '$user_connection_id' WHERE user_token = '$token'\";\n $execute = mysqli_query($connection,$query);\n\n\n //echo $setToken\"\\n\";\n }", "public function onOpen(ConnectionInterface $conn) {\n $this->clients->attach($conn);\n\n echo sprintf(\"[%s] New socket client connected ({$conn->resourceId})\\n\", date('Y-m-d H:i:s'));\n }", "public function track_helper_connection_start() {\n\t\tWC_Tracks::record_event( 'extensions_subscriptions_connect' );\n\t}", "public function connected()\n {\n }", "function wsOnOpen($clientID)\r\n{\r\n\tglobal $Server, $bigbroadcast, $t1, $ready;\r\n\t$ip = long2ip( $Server->wsClients[$clientID][6] );\r\n\r\n\techo \"$ip ($clientID) has connected.\\n\" ;\r\n\tnewPlayer($clientID);\r\n\tif($ready)\r\n\t{\r\n\t\tsleep(1);\r\n\t\tbigBroadcast();\r\n\r\n\t}\r\n\t\r\n\t//Send a join notice to everyone but the person who joined\r\n\t/*foreach ( $Server->wsClients as $id => $client )\r\n\t\tif ( $id != $clientID )\r\n\t\t\t$Server->wsSend($id, \"Visitor $clientID ($ip) has joined the room.\");*/\r\n}", "public function onConnect(\\swoole_server $server, $client_id, $from_id)\n {\n }", "abstract protected function onMessageRecieved(WebSocketClient $sender, $message);", "public function onOpen(ConnectionInterface $conn) {\r\n $this->clients->attach($conn);\r\n \r\n $conn_param = $this->parse_url_param($conn->httpRequest->getRequestTarget());\r\n //個人チャットを開いたときの処理\r\n if ($conn_param[\"mode\"] == \"private\") {\r\n //ログイン状態を確認してクライアントに送信\r\n $this->login_status_send($conn, $conn_param, 'online');\r\n }\r\n \r\n echo \"New connection! ({$conn->resourceId})\\n\";\r\n }", "public static function onLocalUserCreated( $user, $autocreated ) {\n global $wgWebhooksNewUser;\n if (!$wgWebhooksNewUser) {\n return;\n }\n\n $email = \"\";\n\t\t$realname = \"\";\n\t\t$ipaddress = \"\";\n\t\ttry { $email = $user->getEmail(); } catch (Exception $e) {}\n\t\ttry { $realname = $user->getRealName(); } catch (Exception $e) {}\n\t\ttry { $ipaddress = $user->getRequest()->getIP(); } catch (Exception $e) {}\n\n self::sendMessage('NewUser', [\n 'user' => (string) $user,\n 'email' => $email,\n 'realname' => $realname,\n 'ip' => $ipaddress,\n 'autocreated' => $autocreated\n ]);\n }", "public function onUserRegistered()\n {\n $client = $this->clientManager->createClient();\n $client->setAllowedGrantTypes(array('token', 'authorization_code', ['password']));\n $this->clientManager->updateClient($client);\n }", "public function onOpen(ConnectionInterface $conn)\n {\n $this->clients->attach($conn);\n // Store data user from the client\n //$this->clients->offsetSet($conn, $storage);\n\n $msg = $this->messageFactory->monitoringConnexion();\n echo \"New connection ! ({$conn->resourceId})\\n\";\n }", "function onOpen(ConnectionInterface $conn)\n {\n $this->clients->attach($conn);\n\n echo \"New connection! ({$conn->resourceId})\\n\";\n }", "public function run() {\n$this->header('Content-Type: text/html');\n?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\t<title>WebSocket test page</title>\n</head>\n<body>\n<script type=\"text/javascript\">\n\tfunction create() {\n\t\t// Example\n\t\tws = new WebSocket('ws://'+document.domain+':8047/ExamplePubSub');\n\t\tws.onopen = function () {document.getElementById('log').innerHTML += 'WebSocket opened <br/>';}\n\t\tws.onmessage = function (e) {document.getElementById('log').innerHTML += 'WebSocket message: '+e.data+' <br/>';}\n\t\tws.onclose = function () {document.getElementById('log').innerHTML += 'WebSocket closed <br/>';}\n\t}\n\tfunction subscribe() {\n\t\tws.send('{\"type\":\"subscribe\",\"event\":\"usersNum\"}');\n\t}\n</script>\n<button onclick=\"create();\">Create WebSocket</button>\n<button onclick=\"subscribe();\">Send subscribe</button>\n<button onclick=\"ws.close();\">Close WebSocket</button>\n<div id=\"log\" style=\"width:300px; height: 300px; border: 1px solid #999999; overflow:auto;\"></div>\n</body>\n</html>\n<?php\n}", "public static function create_user_handler($event)\n {\n //get the event data.\n $event_data = $event->get_data();\n\n try {\n //user data\n $userid=false;\n if(array_key_exists('relateduserid', $event_data)){\n $userid = $event_data['relateduserid'];\n $event_data['userid'] = $userid;\n }elseif(array_key_exists('userid', $event_data)){\n $userid = $event_data['userid'];\n }\n if ($userid) {\n $exists = usermanager::user_exists($userid);\n if(!$exists){\n $success = usermanager::create_user(0,$userid,\"\",0);\n }\n }\n\n } catch (\\Exception $error) {\n debugging(\"fetching user error for authplugin request failed with error: \" . $error->getMessage(), DEBUG_ALL);\n }\n }", "static function momentConnect()\r\n {\r\n $user = self::getCurrentUser();\r\n\r\n if ($user !== NULL)\r\n {\r\n $user->setOffline(0);\r\n self::updateUser($user);\r\n }\r\n }", "public function onOpen(ConnectionInterface $conn)\n {\n $conn->WebSocket = new \\stdClass();\n $conn->WebSocket->established = false;\n }", "public function handle(UserUpdated $event)\n {\n $this->amqpService->publish($event);\n }", "public function getSubscribedEvents()\n {\n return [\n 'App\\Model\\Authentication\\UserAuthenticator::onLoggedIn'\n ];\n }", "public function onUserLoginPassed($event)\n {\n debug($event);\n }", "public function broadcastOn()\n {\n return new Channel('user-activity');\n }", "public function connected()\n {\n $this->connected = true;\n }", "public function handleEvent() : void\n {\n $this->event = new LoginEvent($this->user,\n $this->dateTimeHandler->getDateObjectFromString($this->date),\n $this->dateTimeHandler->getDateObjectFromString($this->time));\n $this->persistEvent();\n }", "public function usersConnectedEventAction(Request $request)\n {\n $em=$this->getDoctrine()->getManager();\n\n $users=$em->getRepository(Membre::class)->findAll();\n return $this->render('@User/Events/usersconnected.html.twig',array('users'=>$users));\n }", "function _note_is_connected()\n {\n eval(PUBSUB_MUTATE);\n if (!$this->_connected)\n {\n $this->_connected = 1;\n kn_apply($this->_handlers['onConnect'],\n array_merge(array($this),\n $this->_handlers['args']));\n }\n }", "public function broadcastOn()\n {\n return new Channel('notification_user');\n }", "function appConnected(){\n\n}", "function playerConnect($player) {\n\n\t\t// request information about the new player ...\n\t\t// ... and callback to function newPlayer() ...\n\t\t$this->addCall('GetPlayerInfo', array($player[0]), 0, 'newPlayer');\n\t}", "public function onJoin()\n {\n $chan = ltrim(trim(strtolower($this->event->getArgument(0))), \":\");\n $nick = trim($this->event->getNick());\n\n $this->store[$chan][$nick] = self::REGULAR;\n }", "public function postLogin($objUser)\n {\n $this->registerMember($objUser->id, $this->Input->get('events'), $GLOBALS['EVENT_REGISTRATION']);\n }", "public function on_registration( $user_id ) {\n\t\tmnetwork_add_user( $user_id, get_current_blog_id() );\n\t}", "public function onUserSignUp($event) \n {\n $event->user->notify(new NotifyUser($event->user, 'signup'));\n }", "function onOpen(ConnectionInterface $conn)\n {\n $this->clients->attach($conn);\n\n $this->modx->log(1, print_r($conn,1));\n $this->modx->log(1, \"New connection! ({$conn->resourceId})\");\n }", "public function onOpen(ConnectionInterface $conn) {\n $this->clients->attach($conn);\n echo \"New connection! ({$conn->resourceId})\\n\";\n }", "public function onOpen(ConnectionInterface $conn) \n\t{\n\t\techo \"Client connected\" . PHP_EOL;\n\t\t$this->clients->attach($conn);\n\t}", "public function broadcastOn()\n {\n return new Channel('user'.$this->user->id);\n }", "public function handleUserLogin($event) {\n //Log user login\n $activity = new Activity;\n $activity->activity_type = 'login';\n $activity->actor_id = $event->user->id;\n $activity->actor_type = 'user';\n $activity->activity_data = '';\n $activity->user_agent = $this->request->header('User-Agent');\n $activity->actor_ip = $this->request->ip();\n $activity->save();\n }", "public function onOpen(ConnectionInterface $conn) {\n $this->clients->attach($conn);\n\n echo \"New connection! ({$conn->resourceId})\\n\";\n }", "public function onOpen(ConnectionInterface $conn) {\n $this->clients->attach($conn);\n\n echo \"New connection! ({$conn->resourceId})\\n\";\n }", "public function onOpen(ConnectionInterface $conn) {\n\t\t\t//add authenticated field to the connection object before attaching it to the clients storage\n\t\t\t$conn->authenticated = false;\n\t\t\t//add last message seq field to the client's object for future usage.\n\t\t\t$conn->last_message_seq = \"\";\n\t\t\t// Store the new connection to send messages to later\n\t\t\t$this->clients->attach($conn);\n\t\t\techo \"New connection! ({$conn->resourceId})\\n\";\n\t\t\techo \"num of open connections = \" . count($this->clients).\"\\n\";\n\t\t\t$this->logEvent(\"New connection interface {$conn->resourceId} opened..\");\n\t\t\t$this->logEvent(\"num of open connections = \" . count($this->clients).\"\\n\");\n\t\t}", "public static function user_created(core\\event\\user_created $event)\n {\n\n global $CFG;\n $user_data = user_get_users_by_id(array($event->relateduserid));\n\n // User password should be encrypted. Using Openssl for it.\n // We will use token as the key as it is present on both sites.\n // Open SSL encryption initialization.\n $enc_method = 'AES-128-CTR';\n\n\n $api_handler = api_handler_instance();\n if (isset($CFG->eb_connection_settings)) {\n $sites = unserialize($CFG->eb_connection_settings);\n $synch_conditions = unserialize($CFG->eb_synch_settings);\n\n foreach ($sites as $key => $value) {\n if ($synch_conditions[$value[\"wp_name\"]][\"user_creation\"] && $value['wp_token']) {\n $password = '';\n $enc_iv = '';\n // If new password in not empty\n if (isset($_POST['newpassword']) && $_POST['newpassword']) {\n $enc_key = openssl_digest($value[\"wp_token\"], 'SHA256', true);\n $enc_iv = substr(hash('sha256', $value[\"wp_token\"]), 0, 16);\n // $crypttext = openssl_encrypt($_POST['newpassword'], $enc_method, $enc_key, 0, $enc_iv) . \"::\" . bin2hex($enc_iv);\n $password = openssl_encrypt($_POST['newpassword'], $enc_method, $enc_key, 0, $enc_iv);\n }\n\n $request_data = array(\n 'action' => 'user_creation',\n 'user_id' => $event->relateduserid,\n 'user_name' => $user_data[$event->relateduserid]->username,\n 'first_name' => $user_data[$event->relateduserid]->firstname,\n 'last_name' => $user_data[$event->relateduserid]->lastname,\n 'email' => $user_data[$event->relateduserid]->email,\n 'password' => $password,\n 'enc_iv' => $enc_iv,\n 'secret_key' => $value['wp_token'], // Adding Token for verification in WP from Moodle.\n );\n\n $api_handler->connect_to_wp_with_args($value[\"wp_url\"], $request_data);\n }\n }\n }\n\n }", "public function store()\n\t{\n $this->pusher->trigger(Input::get('channel_name'), 'userNewMessage', array('username'=>Sentry::getUser()->username), Input::get('socket_id'));\n $this->pusher->presence_auth(Input::get('channel_name'),Input::get('socket_id'), '123456', array('username'=>Sentry::getUser()->username));\n return $this->pusher->get('/channels/demoChannel');\n\t}", "public function onOpen(ConnectionInterface $conn) {\n $this->clients->attach($conn);\n //var_dump($conn);\n echo \"New connection!\" . \" id :\" . $conn->resourceId. \"\\n\";\n }", "public function listen() :void {\n\n echo \"Starting websocket server on... \" . $this->address . \":\" . $this->port;\n \n socket_listen($this->server);\n socket_set_nonblock($this->server);\n $this->clients[] = new WebSocket($this->server);\n\n do {\n\n $read = array_map(function($ws) {return $ws->socket;}, $this->clients);\n $write = null; \n $except = null;\n\n $ready = socket_select($read, $write, $except, 0);\n if ($ready === false) {\n if ($this->onError !== null) {\n $callback = $this->onError;\n $callback(\"[\".socket_last_error().\"]\".\" \".socket_strerror(socket_last_error()));\n }\n\n return;\n }\n\n if ($ready < 1) continue;\n\n // check if there is a client trying to connect.\n if (in_array($this->server, $read)) {\n if (($client = socket_accept($this->server)) !== false) {\n\n // send websocket handshake headers.\n if (!$this->sendHandshakeHeaders($client)) {\n continue;\n }\n\n // add the new client to the $clients array.\n $ws = new WebSocket($client);\n $this->clients[] = $ws;\n\n // call \"connection\" event handler for each new client.\n if ($this->onConnect !== null) {\n $callback = $this->onConnect;\n $callback($ws);\n }\n\n // remove the listening socket from the clients-with-data array.\n $key = array_search($this->server, $read);\n unset($read[$key]);\n }\n }\n\n foreach ($read as $key => $client) {\n\n $buffer = \"\";\n $bytes = @socket_recv($client, $buffer, 2048, 0);\n\n // check if the client is disconnected.\n if ($bytes === false) {\n\n // remove client from $clients array\n // and call disconnect event handler.\n unset($this->clients[$key]);\n if ($this->onDisconnect !== null) {\n $callback = $this->onDisconnect;\n $callback();\n }\n\n continue;\n }\n\n $ws = $this->clients[$key];\n $callback = $ws->onMessage;\n if ($callback !== null) {\n $callback($ws, $this->unmask($buffer));\n }\n }\n } while (true);\n socket_close($this->server);\n }", "public function __construct() {\n\t\t$this->CI = &get_instance();\n\n $this->clients = new SplObjectStorage;\n\n\n // We have to check if event callback must be called\n if (!empty($this->CI->ci_websocket->callback['init'])) {\n\n // At this moment we have to check if we have authent callback defined\n call_user_func_array($this->CI->ci_websocket->callback['init'],\n array());\n\n // Output\n if ($this->CI->ci_websocket->debug) {\n output('info', 'Callback init \"' . $this->CI->ci_websocket->callback['init'][1] . '\" called');\n }\n }\n\t\t// Output\n\t\t\toutput('success',\n\t\t\t\t'Running server on host ' . $this->CI->ci_websocket->host . ':' . $this->CI->ci_websocket->port);\n\n }", "public function addNewClient() {\n\t\t$this->Db->query(\"INSERT INTO `yp_sessions` (`hash`, `last_time`) \n\t\t\tVALUES ('{$this->_thisClientHash()}', '{$this->Request->time}');\");\n\n\t\t\n\t}", "public function onOpen(ConnectionInterface $conn)\n {\n $this->clients->attach($conn);\n echo \"new connection ! ({$conn->resourceId})\\n\";\n }", "function onOpen\t($SocketID\t\t)\t//...successful handshake\n\t\t\t{ $this->Log(\"Handshake with socket #$SocketID successful\"); }", "private function onJoin()\n {\n $payload = $this->clientEvent->getPayload();\n\n if ($this->authUserByToken($payload['token'] ?? null)) {\n $this->send($this->replyEvent());\n\n $this->send(\n (new StateContentEvent(\n $this->getService('quest.quest_manager')->getStateData($this->getUserId())\n ))\n );\n }\n }", "public function onCreateClient(Event $event)\n {\n $version = \\Yii::getVersion();\n\n $clientConfig = $event['client']->getConfig();\n $commandParams = $clientConfig->get(Client::COMMAND_PARAMS) ?: array();\n $clientConfig->set(Client::COMMAND_PARAMS, array_merge_recursive($commandParams, array(\n UserAgentListener::OPTION => 'YII2/' . $version . ' YII2MOD/' . $version,\n )));\n }", "public function onopen(Socket $sckt, $data)\n {\n $packet = $this->check_data($data);\n\n //check if we have a valid packet\n if(is_array($packet)){\n //load the users data\n $sckt->user = new user_mdl($packet[\"payload\"]);\n\n //store the users socket and if the user is successfully added fetch the first eight posts for the user\n $this->add_user($sckt)?$this->post($sckt,\"post_login\",\"valid\"):$this->post($sckt,\"post_login\",\"invalid\");\n }\n\n\n }", "public function init(){\n $this->on(SELF::EVENT_NEW_USER,[$this,'SendMailToAdmin']);\n\t\t$this->created_at = time();\n\t}", "public function track_helper_connection_complete() {\n\t\tWC_Tracks::record_event( 'extensions_subscriptions_connected' );\n\t}", "public function handle(UserWasRegistered $event)\n {\n\n // Send the message using the mailer contract (Amazon SES)\n $this->mailer->send('emails.welcome', ['name' => $event->user->name], function ($message) use ($event) {\n $message->from('[email protected]', 'Differ');\n $message->subject(sprintf('Welcome to differ, %s!', $event->user->name));\n $message->to($event->user->email);\n });\n }", "function wp_new_user_notification($user_id, $plaintext_pass = '')\n {\n }", "function onUserLogin($user,$option)\n\t{\t\n\t\t$this->afterLogin($user, $option);\n\t}", "protected function connect($socket) \n\t{\n\t\t$user = new $this->userClass(uniqid('u'), $socket);\n\n\t\t$this->users[$user->id] = $user;\n\t\t$this->sockets[$user->id] = $socket;\n\n\t\t$this->connecting($user);\n\t}", "public function onOpen(ConnectionInterface $conn)\n {\n $conn->userId = null;\n $this->clients->attach($conn);\n }", "public function newUser(Closure $handleNewUser)\n {\n $this->handleNewUser = $handleNewUser;\n }", "public function onConnected($cb) {\n\t\tif ($this->connected) {\n\t\t\tcall_user_func($cb, $this);\n\t\t} else {\n\t\t\tif (!$this->onConnected) {\n\t\t\t\t$this->onConnected = new StackCallbacks;\n\t\t\t}\n\t\t\t$this->onConnected->push($cb);\n\t\t}\n\t}", "function onLaunch() {\n // context and resourceLink properties of the class instance\n // to access the current user, context and resource link.\n\n//\t$this->reason = 'Incomplete data';\n// $this->ok = false;\n//\t$users = $context->getMemberships();\n\n }", "public function onUserLogin(Login $event)\n {\n if (auth()->check()) {\n $expiresAt = Carbon::now()->addMinutes(5);\n $userId = auth()->user()->id;\n\n Cache::put('user-is-online-' . $userId, true, $expiresAt);\n\n $user = User::find($userId);\n\n $user->is_logged_in = 1;\n\n $user->save();\n }\n }", "function welcome_user(){\n \n global $connection;\n \n echo $_SESSION['username'];\n}", "function on_start(){\n //$userID = $u->getUserID();\n \n //print \"runnin\";\n //$cartEventClassName = 'ScottcAffiliateRelation';\n //$cartEventClassPath = 'packages/scottc_affiliates/libraries/affiliate_relation.php';\n $eventClassName = 'AffiliateGateway';\n $eventClassPath = 'packages/affiliate_gateway/libraries/affiliate_gateway.php';\n \n define(\"ENABLE_APPLICATION_EVENTS\", true);\n \n Events::extend('on_start', $eventClassName, 'eventOnStart', $eventClassPath, $_GET);\n //Events::extend('on_page_view', 'AffiliateGateway', 'eventOnStart', 'packages/affiliate_gateway/libraries/affiliate_gateway.php');\n \n // if($_GET){\n // Loader::library('affiliate_relation',SCOTTECOMAFFILATESPACKAGEHANDLE);\n // $har = new ScottcAffiliateRelation($_GET);\n // }\n }", "public function start()\n {\n $this->server->on(\"open\", [$this, 'wsOpen']);\n $this->server->on(\"message\", [$this, 'wsMessage']);\n $this->server->on(\"close\", [$this, 'wsClose']);\n\n $this->server->start();\n }", "public function onOpen(ConnectionInterface $conn)\n\t{\n\t\t$this->clients->attach($conn);\n\t\techo \"someone connected: reflected-xss\\n\";\n\t}", "function onOpen(ConnectionInterface $conn)\n {\n $this->clients->attach($conn);\n }", "public function onOpen(ConnectionInterface $conn)\n {\n $this->connections[] = $conn;\n echo \"New connection \\n\";\n }", "abstract protected function onClientDisconnected(WebSocketClient $client);", "public function acceptConnection(Request $request)\n {\n $AuthUser = User::where('email', $request->input('authenticated'))->first();\n $user = User::where('name', $request->input('acceptConnectionFrom'))->first();\n $AuthUser->acceptConnectionRequest($user);\n return 'Connected';\n }", "public function on_user_activation( $user_id, $pass, $meta ) {\n\t\t$blog_id = get_current_blog_id();\n\t\tmnetwork_add_user( $user_id, $blog_id );\n\t}", "public function iniciar_socket(){\n\t\t$this->socket= new PHPWebSocket();\t\n\t\t\n\t\t$this->socket->bind('message', 'wsOnMessage');\n\t\t$this->socket->bind('open', 'wsOnOpen');\n\t\t$this->socket->bind('close', 'wsOnClose'); \n\n\n\t\treturn $this->socket->wsStartServer('192.168.1.104','9300');\n\t//\treturn $this->socket->wsStartServer('10.20.0.68','8180');\n\t\t\n\n\t}", "public function onUserLoginComplete(&$user)\n {\n // @ToDo: Add code here to auto log into the forum.\n return true;\n }", "public static function addUser()\n {\n // ADD NEW DATA TO A TABLE\n // MAKE SURE TO SEND USERS TO THE /users page when a user is added\n }", "public function subscribes();", "public function updateLastConnect()\n {\n $s = 'UPDATE `users` SET `last_connect`=now() WHERE `userID`=%d';\n $params = array($this->userID);\n $this->conn->query($s, $params);\n }", "protected function onConnect($socket) {\n $client = new Client($socket, Cluster::$mainLoop);\n $worker = false;\n // find any available client\n foreach($this->workers as $w) {\n if (!$w->pipe) {\n $worker = $w;\n break;\n }\n }\n // forward the message\n if ($worker && $worker->pipe($client)) return;\n // no available worker, server is unavailable\n $client->end(Cluster::$busy);\n }" ]
[ "0.7034876", "0.6938503", "0.6439499", "0.63925016", "0.6170298", "0.6148819", "0.59281355", "0.5854689", "0.57586795", "0.5747205", "0.5715446", "0.5701054", "0.56625396", "0.5642664", "0.5620012", "0.5604752", "0.55724883", "0.5522115", "0.55186266", "0.5498154", "0.5491874", "0.5491673", "0.5491673", "0.54715496", "0.5443622", "0.5436283", "0.5429347", "0.542021", "0.5414375", "0.538995", "0.5352519", "0.5351837", "0.5351037", "0.53510296", "0.53376955", "0.5320841", "0.5296296", "0.5291677", "0.52803415", "0.5272494", "0.5269347", "0.52602327", "0.5242783", "0.52208793", "0.5212734", "0.5208888", "0.5165315", "0.51614267", "0.515868", "0.5152013", "0.5150855", "0.51428473", "0.51427984", "0.51303357", "0.51258117", "0.51230633", "0.5121046", "0.5115587", "0.5113302", "0.51125646", "0.5111137", "0.5107592", "0.5088964", "0.5080218", "0.50788826", "0.5075424", "0.5073378", "0.5070542", "0.5064239", "0.5055484", "0.503945", "0.5029722", "0.50257295", "0.5024049", "0.502229", "0.5020905", "0.4983669", "0.49622968", "0.4961527", "0.49537662", "0.49416885", "0.4940371", "0.4939158", "0.49390966", "0.49336898", "0.4928484", "0.49274525", "0.49190053", "0.49167782", "0.49042958", "0.49039343", "0.49024495", "0.49004522", "0.489956", "0.48952922", "0.48935127", "0.48918208", "0.48911732", "0.4870714", "0.4860618" ]
0.6049925
6
Event function that is called when a user disconnects from the WebSocket server.
public function onClose(ConnectionInterface $conn) { echo "connection closed by {$conn->remoteAddress}\n"; $this->users->detach($conn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function onClientDisconnected(WebSocketClient $client);", "public function onConnectionClosed();", "public function onClose(ConnectionInterface $connection) {\n\n $user = $connection->user;\n\n $this->clients->detach($connection);\n\n $this->sendToAll([\n 'type' => 'disconnect-user',\n 'user' => $user->toArray()\n ]);\n\n echo \"Connection {$connection->resourceId} has disconnected\\n\";\n }", "function onClose(\\Ratchet\\ConnectionInterface $conn)\n {\n// echo 'BYE';\n }", "function onClose(Ratchet\\ConnectionInterface $conn)\r\n {\r\n echo $conn->resourceId . \" has disconnected\\n\";\r\n\r\n $message = array(\r\n 'resourceId' => $conn->resourceId,\r\n 'type' => 'closeConnection'\r\n );\r\n \r\n foreach($this->clients as $client){\r\n if ($conn !== $client){\r\n $client->send(json_encode($message));\r\n }\r\n }\r\n\r\n $this->clients->detach($conn);\r\n }", "public function onClose(ConnectionInterface $conn) {\n $this->clients->detach($conn);\n\n if (!empty($this->CI->ci_websocket->callback['close'])) {\n\n // At this moment we have to check if we have authent callback defined\n call_user_func_array($this->CI->ci_websocket->callback['close'],\n array($this->clients,$conn));\n\n // Output\n if ($this->CI->ci_websocket->debug) {\n output('info', 'Callback close \"' . $this->CI->ci_websocket->callback['close'][1] . '\" called');\n }\n }else{\n\t\t\techo \"Connection ({$conn->resourceId}) has disconnected\\n\";\n\t\t}\n }", "function onClose(\\Ratchet\\ConnectionInterface $conn)\n {\n // TODO: Implement onClose() method.\n }", "public function disconnect()\r\n {\r\n }", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "function onClose(ConnectionInterface $conn)\n {\n foreach($this->users as $key => $val){\n foreach($val as $k => $v){\n if($conn === $v){\n unset($this->users[$key][$k]);\n if(empty($this->users[$key]))unset($this->users[$key]);\n }\n }\n }\n\n echo \"Connection {$conn->resourceId} has disconnected\\n\";\n }", "public function disconnect(): void;", "public function disconnect()\n\t{\n\t}", "public function disconnect()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->state = self::STATE_UPDATE;\r\n\r\n $this->connection->close();\r\n $this->connection = null;\r\n $this->state = self::STATE_NOT_CONNECTED;\r\n }\r\n }", "function disconnect ()\n {\n if ( $this->socket )\n {\n $this->writeFrame(new StompFrame('DISCONNECT'));\n }\n socket_shutdown($this->socket, 1);\n usleep(500);\n socket_shutdown($this->socket, 2);\n socket_close($this->socket);\n $this->socket = NULL;\n }", "public function track_helper_disconnected() {\n\t\tWC_Tracks::record_event( 'extensions_subscriptions_disconnect' );\n\t}", "public function notifyDisconnected(StreamObserver $observer): void;", "function onClose(ConnectionInterface $conn)\n {\n $this->clients->detach($conn);\n\n echo \"Connection {$conn->resourceId} has disconnected\\n\";\n }", "function Disconnect() {}", "function disconnect() ;", "function disconnectBL() {\n if ( !empty($_SESSION['userId']) )\n {\n echo 'Bye '.$_SESSION['userId'];\n session_destroy();\n }\n else\n {\n echo \"notConnected\";\n }\n }", "public function handleUserLogout($event) {}", "public function onQuit()\n {\n $nick = trim($this->event->getNick());\n\n foreach ($this->store as $chan => $store) {\n if (isset($store[$nick])) {\n unset($this->store[$chan][$nick]);\n }\n }\n }", "public function onClose(ConnectionInterface $conn) {\r\n unset($this->clients[$conn->resourceId]);\r\n\r\n echo \"Connection {$conn->resourceId} has disconnected\\n\";\r\n }", "protected function disconnect() {\n $this->connection = null;\n echo $this->name . ' disconnected' .\"<br>\";\n }", "public function onClose(ConnectionInterface $conn) {\n\n if ($this->clients->contains($conn)) {\n $this->clients->detach($conn);\n }\n if ($this->admins->contains($conn)) {\n $this->admins->detach($conn);\n }\n\n echo \"Connection {$conn->resourceId} has disconnected\\n\";\n }", "public static function onDisconnected(&$remote)\n {\n --$remote['multiple']['simultaneousConnections'];\n }", "public function onClose(ConnectionInterface $conn) {\n $this->clients->detach($conn);\n echo \"Connection {$conn->resourceId} has disconnected\\n\";\n }", "abstract public function disconnect();", "abstract public function disconnect();", "abstract public function disconnect();", "public function disconnect() {\n\t\t@fclose ( $this->socket );\n\t}", "public function disconnect()\n\t{\n\t\tself::$connected_client[self::$connection_params]->disconnect();\n\t\tself::$connected_client[self::$connection_params] = null;\n\t}", "public function serverClosed(ServerClosedEvent $event): void;", "public function onClose(ConnectionInterface $conn)\n {\n $this->clients->detach($conn);\n echo \"connection ! ({$conn->resourceId}) has disconnected\\n\";\n }", "protected function disconnectIfConnected() {}", "public function onClose(ConnectionInterface $conn) {\n $this->clients->detach($conn);\n\n echo \"Connection {$conn->resourceId} has disconnected\\n\";\n }", "public function disconnect(): void\n {\n }", "function __DESTRUCT() {\n self::disconnect();\n }", "abstract function disconnect($socket);", "function wsOnClose($clientID, $status) {\n\n\t\t$ip = long2ip($this->socket->wsClients[$clientID][6]);\n\t\t$name = sprintf($this->socket->wsClients[$clientID][12]);\n\n\t\t\t\t$this->socket->log(\"$ip ($clientID) has disconnected. $name\");\n \n\t\t//Send a user left notice to everyone in the room\n\t\tforeach ($this->socket->wsClients as $id => $client)\n\t\t\t$this->socket->wsSend($id, json_encode(array('tipo'=>'desconexion','cliente'=>$clientID ,'ip'=>$ip )));\n\t}", "public function disconnect()\n\t{\n\t\tself::$connected_client[$this->profile]->disconnect();\n\t\tself::$connected_client[$this->profile] = null;\n\t}", "public function onClose(ConnectionInterface $conn) {\r\n $conn_param = $this->parse_url_param($conn->httpRequest->getRequestTarget());\r\n\r\n if ($conn_param[\"mode\"] == \"private\") {// 個人チャットの場合、退室を相手に伝える\r\n //ログイン状態を確認してクライアントに送信\r\n $this->login_status_send($conn, $conn_param, 'offline');\r\n }\r\n \r\n $this->clients->detach($conn);\r\n echo \"Connection {$conn->resourceId} has disconnected\\n\";\r\n }", "public function onClose(ConnectionInterface $conn) {\n echo \"Connection {$conn->resourceId} has disconnected... \\n\";\n }", "public function Disconnect () {\n $this->sendString('QUIT');\n\n fclose($this->pop_conn);\n }", "function disconnect_user() {\n\tunset( $_SESSION['GHOME'] );\n\tunset( $_SESSION['GHOME_CUSER'] );\n}", "public function onUserLogout($event)\n {\n debug($event);\n }", "protected function _disconnect() {\n\t\t@fclose($this->socket);\n\t\t$this->socket = NULL;\n\t}", "public function onClose(ConnectionInterface $conn)\n {\n $this->clients->detach($conn);\n echo \"Connection {$conn->resourceId} has disconnected\\n\";\n }", "public function onClose(ConnectionInterface $conn) {\n $this->clients->detach($conn);\n\n echo \"Connection {$conn->resourceId} has disconnected\\n\";\n }", "public function onClose(ConnectionInterface $conn) {\n $this->clients->detach($conn);\n\n echo \"Connection {$conn->resourceId} has disconnected\\n\";\n }", "public function onClose(ConnectionInterface $conn) {\n $this->clients->detach($conn);\n\n echo \"Connection {$conn->resourceId} has disconnected\\n\";\n }", "public function onUserLogout($event) {\n\n Log::info('event catched');\n\n }", "function wsOnClose($clientID, $status) {\n\tglobal $Server;\n\tglobal $userlist;\n\t$ip = long2ip( $Server->wsClients[$clientID][6] );\n\n\t$Server->log( \"$ip ($clientID) has disconnected.\" );\n\n\t//Send a user left notice to everyone in the room\n\t$data = array(\n\t\t'message' => $userlist[$clientID].' disconnected.'\n\t);\n\tunset($userlist[$clientID]);\n\tSendToAllClients('servmsg', $data);\n\t$data = array(\n\t\t'userlist' => $userlist\n\t);\n\tSendToAllClients('updateuserlist', $data);\n}", "function wsOnClose($clientID, $status) {\r\n\tglobal $Server, $players;\r\n\t$ip = long2ip( $Server->wsClients[$clientID][6] );\r\n\r\n\techo $players[$clientID]->name . \" has disconnected.\\n\" ;\r\n\r\n\t//Send a user left notice to everyone in the room\r\n\tforeach ( $Server->wsClients as $id => $client )\r\n\t\t$Server->wsSend($id, \"Visitor $clientID ($ip) has left the room.\");\r\n}", "public function onClose(ConnectionInterface $conn) {\n\t\t\t//if the connecion had a station id field disconnect the station\n\t\t\tif(isset($conn->station_id)){\n\t\t\t\t$this->logEvent(\"connection closed with station \".$conn->station_ID.\" on interface \".$conn->resourceId);\n\t\t\t\tshell_exec(\"php index.php message discoonectStation \".$conn->station_ID.\" &\");\n\t\t\t}else{\n\t\t\t\t$this->logEvent(\"connection closed on interface \".$conn->resourceId);\n\t\t\t}\n\t\t\t// The connection is closed, remove it, as we can no longer send it messages\n\t\t\t$this->clients->detach($conn);\n\t\t\techo \"Client {$conn->resourceId} disconnected\\n\";\n\t\t}", "function playerDisconnect($player) {\n\n\t\t// delete player and put him into the player item ...\n\t\t$player_item = new Player();\n\t\t$player_item = $this->server->players->removePlayer($player[0]);\n\n\t\t// display message ...\n\t\t$this->console('>> player {1} left the game [{2}]',\n\t\t$player_item->id,\n\t\t$player_item->login);\n\n\t\t// release a new player disconnect event ...\n\t\t$this->releaseEvent('onPlayerDisconnect', $player_item);\n\t}", "public function disconnect()\n {\n parent::disconnect();\n\n unset($this->connection);\n }", "function onPlayerDisconnect($login) {\n\t\tHeadsUpWidget::Erase($login);\n\t}", "public static function disconnect() {\n\tself::$instance->disconnect();\n }", "public function onClose(ConnectionInterface $conn)\n {\n // The connection is closed, remove it, as we can no longer send it messages\n $this->clients->detach($conn);\n\n echo \"Disconnected ($conn->resourceId)\\n\";\n\n $this->log->info(\"Disconnected $conn->resourceId\");\n }", "public function disconnect()\n\t{\n\t\t$this->disconnectInternal();\n\t}", "public function onLogout()\n {\n // TODO: Implement onLogout() method.\n }", "protected function disconnect()\r\n {\r\n $this->log( \"Closing connection and shutting down.\" );\r\n \r\n fclose( $this->_conn );\r\n exit;\r\n }", "public function fbDisconnect()\r\n \t{\r\n \t\t// no session exists to disconnect\r\n \t\tif (!$this->_client->getUser())\r\n \t\t{\r\n \t\t\treturn true;\r\n \t\t}\r\n \t\treturn $this->_client->getLogoutUrl();\r\n \t}", "public function onClose(Connection $connection);", "public static function disconnect()\n\t{\n\t\tself::getConnection()->disconnect();\n\t}", "function onClose(ConnectionInterface $conn)\n {\n $this->clients->detach($conn);\n }", "public function disconnect() {\n if ($this->client) {\n $this->client->disconnect();\n }\n }", "public function onShutdown();", "public function onShutdown();", "public function pdisconnect(): void\n {\n }", "public function disconnect() {\r\n\t\t//print_r( 'PhpseclibClient::disconnect()');\r\n\t\tif ($this->connected()) {\r\n\t\t\t$this->_disconnect();\r\n\t\t}\r\n\t}", "public function disconnect() \n\t{\n\t\tunset($this->connection);\n\t}", "function onError(Ratchet\\ConnectionInterface $conn, Exception $e)\r\n {\r\n echo \"An error has occurred: {$e->getMessage()}\\n\";\r\n $this->clients->detach($conn);\r\n $conn->close();\r\n }", "public function onClose(ConnectionInterface $conn) {\n $this->clients->detach($conn);\n if($this->totalNameSet>0){\n $this->totalNameSet=$this->totalNameSet-1;\n } \n echo \"Connection {$conn->resourceId} has disconnected\\n\";\n echo \"Nombre seteados\".$this->totalNameSet.\"</br>\";\n }", "public function disconnect($connection);", "function playerDisconnect($player) {\n\n\t\t// check for relay server\n\t\tif (!$this->server->isrelay && array_key_exists($player[0], $this->server->relayslist)) {\n\t\t\t// log console message\n\t\t\t$this->console('>>> relay server {1} ({2}) disconnected', $player[0],\n\t\t\t stripColors($this->server->relayslist[$player[0]]['NickName'], false));\n\n\t\t\tunset($this->server->relayslist[$player[0]]);\n\t\t\treturn;\n\t\t}\n\n\t\t// delete player and put him into the player item\n\t\t// ignore event if disconnect fluke after player already left,\n\t\t// or on relay if player from master server (which wasn't added)\n\t\tif (!$player_item = $this->server->players->removePlayer($player[0]))\n\t\t\treturn;\n\n\t\t// log console message\n\t\t$this->console('>> player {1} left the game [{2} : {3} : {4}]',\n\t\t $player_item->pid,\n\t\t $player_item->login,\n\t\t $player_item->nickname,\n\t\t formatTimeH($player_item->getTimeOnline() * 1000, false));\n\n\t\t// throw 'player disconnects' event\n\t\t$this->releaseEvent('onPlayerDisconnect', $player_item);\n\t}", "public function onClose(ConnectionInterface $conn)\n\t{\n\t\t$this->clients->detach($conn);\n\t}", "public function disconnect()\n {\n $this->connection->disconnect();\n }", "public function disconnect()\n\t{\n\t\t$this->_connection = null;\n\t}", "public function onLogout()\n {\n \n }", "function graphql_deactivation_callback()\n {\n }", "public function disconnect()\n {\n $this->client->close();\n }", "public function unsubscribe(): void;", "function disconnect(){\n\t\t$this->dbconn = null;\n\t\t$this->logger->info('RECOLIN DB DB disconnected successfully');\n\t}", "public function onClose(ConnectionInterface $conn)\n {\n $this->clients->detach($conn);\n }", "public function disconnect()\n {\n if ($this->m_connect) $this->m_connect->Disconnect();\n }", "public function disconnect($user_id)\n {\n return $this->send('disconnect', [\n 'user' => (string) $user_id\n ]);\n }", "protected function connectionDestruct()\t{}", "public static function disconnect(){\n\t\tself::$cnx = NULL;\t\n\t\t\n\t}", "static public function disconnect_url() {\n\t\treturn Controller::join_links(\"facebook\", \"disconnect\");\n\t}", "function on_deactivation ()\n{\n}", "function on_deactivation ()\n{\n}" ]
[ "0.7654642", "0.6935726", "0.6802278", "0.6703611", "0.665572", "0.65716463", "0.6518616", "0.6437045", "0.64265066", "0.64265066", "0.64265066", "0.64265066", "0.64265066", "0.64265066", "0.64265066", "0.64265066", "0.63856894", "0.6341516", "0.6341453", "0.63060534", "0.62954885", "0.62848383", "0.6274146", "0.62590235", "0.6245384", "0.62373024", "0.6235921", "0.6204479", "0.6199233", "0.6189586", "0.6188448", "0.6185104", "0.6174658", "0.61583227", "0.6153243", "0.6153243", "0.6153243", "0.61497694", "0.6142972", "0.61245984", "0.6109024", "0.60897917", "0.6089387", "0.6087298", "0.6084068", "0.6080412", "0.60758847", "0.6072993", "0.607299", "0.6072722", "0.6066426", "0.6064622", "0.606416", "0.6054787", "0.60492826", "0.6046344", "0.6046344", "0.6046344", "0.6013855", "0.60035014", "0.59920186", "0.5988629", "0.59505916", "0.5946665", "0.5933038", "0.59299827", "0.5927282", "0.59018433", "0.59014404", "0.5885615", "0.5884586", "0.5858464", "0.58360434", "0.5817594", "0.58149403", "0.5808283", "0.5808283", "0.580806", "0.57940674", "0.5787224", "0.577541", "0.57631105", "0.57581604", "0.57508177", "0.5697878", "0.5689095", "0.5671885", "0.5655634", "0.5651817", "0.56486744", "0.5643722", "0.56328195", "0.5626532", "0.56156385", "0.5602038", "0.5592461", "0.55909973", "0.55717397", "0.5565005", "0.5565005" ]
0.6151372
37
Event function that is called when a user sends a message to the WebSocket server.
public function onMessage(ConnectionInterface $sender, $msg) { echo "received message '$msg' from {$sender->remoteAddress}\n"; $response = strrev($msg); $sender->send($response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function onMessageRecieved(WebSocketClient $sender, $message);", "public function handleSendEvent(object $message): void;", "function wsOnMessage($clientID, $message, $messageLength, $binary) {\n\tglobal $Server;\n\tglobal $userlist;\n\t$ip = long2ip( $Server->wsClients[$clientID][6] );\n\n\tif ($messageLength == 0) {\n\t\t$Server->wsClose($clientID);\n\t\treturn;\n\t}\n\t\n\t// TODO: Add handling of different events\n\t// addmms\n\t// chatmsg\n\t// accept\n\t// decline\n\t\n\t// Params contain type and data\n\t$params = json_decode($message, true);\n\n\t// Parse command based on type\n\tswitch ($params['type']) {\n\t\tcase 'chatmsg':\n//The speaker is the only person in the room. Don't let them feel lonely.\n//\t\tif ( sizeof($Server->wsClients) == 1 ) {\n//\t\t\t$Server->wsSend($clientID, 'You are the only one here.');\n//\t\t}\n\t\t\t$message = $params['data'][0];\n\t\t\t$data = array(\n\t\t\t\t'clientid' => $clientID,\n\t\t\t\t'ip' => $ip,\n\t\t\t\t'nickname' => $userlist[$clientID],\n\t\t\t\t'message' => $message\n\t\t\t);\n\t\t\tSendToAllClients('chatmsg', $data);\n\t\tbreak;\n\t\t\t\n\t\tcase 'setnick':\n\t\t\t// If clientID already has a nick, we pass the old nickname on aswell\n\t\t\t$oldnickname = array_key_exists($clientID, $userlist) ? $userlist[$clientID] : '';\n\t\t\t$newnickname = $params['data'][0]; \n\t\t\t\n\t\t\t// Avoid confusion, disallow two users the same nickname, add trailing number\n\t\t\t$i = 0;\n\t\t\tforeach ($userlist as $id => $nickname) {\n\t\t\t\tif ($i > 0 && $newnickname.$i == $nickname) {\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\tif ($newnickname == $nickname) {\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($i > 0) {\n\t\t\t\t$newnickname = $newnickname.$i;\n\t\t\t}\n\t\t\t$userlist[$clientID] = $newnickname;\n\n\t\t\t$data = array(\n\t\t\t\t'clientid' => $clientID,\n\t\t\t\t'ip' => $ip,\n\t\t\t\t'newnickname' => $newnickname,\n\t\t\t\t'oldnickname' => $oldnickname\n\t\t\t);\n\t\t\tSendToAllClientsExcept($clientID, 'setnick', $data);\n\t\t\t$data = array(\n\t\t\t\t'userlist' => $userlist\n\t\t\t);\n\t\t\tSendToAllClients('updateuserlist', $data); // At the moment this means that userlist is updated whenver anyone connects\n\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\t// :|\n\t\tbreak;\n\t}\n}", "abstract protected function onClientConnected(WebSocketClient $client);", "public function onMessage($msgData) {\r\n\r\n }", "function onMessage(ConnectionInterface $from, $msg);", "public function sendMessage()\n {\n $userId = auth()->user()->id;\n\n // Save the message\n Message::create([\n 'room_id' => $this->roomId,\n 'user_id' => $userId,\n 'message' => $this->message,\n ]);\n\n // Remove the value of the message after saving\n $this->message = \"\";\n\n // Prompt the server that we sent a message\n $this->dispatchBrowserEvent('chat-send-message', [\n 'room_id' => $this->roomId,\n 'user_id' => $userId,\n ]);\n }", "public function handleSendMessage() {\n\t\t$json = file_get_contents(\"php://input\"); //vytánutí všech dat z POST požadavku - data ve formátu JSON\n\t\t$data = Json::decode($json); //prijata zprava dekodovana z JSONu\n\t\t$user = $this->getPresenter()->getUser();\n\t\t$addMessage = $this->addMessage($data, $user);\n\t\tif (!empty($addMessage)) {\n\t\t\t$this->sendRefreshResponse($data->lastid);\n\t\t}\n\t}", "public function sendEvent(string $topic, $message): void;", "function wsOnReceive($clientID, $message, $messageLength, $binary) {\r\n\tglobal $Server;\r\n\r\n\t$message = json_decode($message, true);\r\n\t$command = $message['command'];\r\n\t$argument = $message['argument'];\r\n\r\n\t// check if message length is 0\r\n\tif ($messageLength == 0) {\r\n\t\t$Server->wsClose($clientID);\r\n\t\treturn;\r\n\t}\r\n\t$command($clientID, $argument);\r\n\r\n\t//The speaker is the only person in the room. Don't let them feel lonely.\r\n\t/*foreach ( $Server->wsClients as $id => $client )\r\n\t\tif ( $id != $clientID )\r\n\t\t\t$Server->wsSend($id, \"Visitor $clientID ($ip) said \\\"$message\\\"\");\r\n\t*/\r\n}", "public function sendMessage(){\n\n\n }", "public function handle(UserUpdated $event)\n {\n $this->amqpService->publish($event);\n }", "public function onSend($msg){\n $data = json_decode($msg);\n $action = isset($data['action'])? $data['action']:'';\n echo \"Message has been sent\";\n \n if(array_key_exists($action,$this->subscriber_topics)){\n echo \"Received msg, broacasting to $action\";\n $this->subscriber_topics[$action]->broadcast($msg);\n }\n }", "public function onMessage(ConnectionInterface $from, $msg) {\n if (!empty($this->CI->ci_websocket->callback['msg'])) {\n\n // At this moment we have to check if we have authent callback defined\n call_user_func_array($this->CI->ci_websocket->callback['msg'],\n array($from,$msg, $this->clients));\n\n // Output\n if ($this->CI->ci_websocket->debug) {\n output('info', 'Callback msg \"' . $this->CI->ci_websocket->callback['msg'][1] . '\" called');\n }\n }\n }", "public static function onMessage($clientId, $message)\n {\n// $user->name = Str::random(10);\n// $user->email = Str::random(10) . '@' . Str::random(3) . '.com';\n// $user->password = Str::random(16);\n// $user->save();\n Log::channel('custom')->info($clientId . ' message:' . $message);\n }", "public abstract function sendMessage();", "function onMessage(ConnectionInterface $conn, $msg)\n {\n /** @noinspection PhpComposerExtensionStubsInspection */\n $event = json_decode($msg);\n $this->mEventsController->onNewEvent($event, function ($person, $roomId,$alert) {\n $res = json_encode([\"person\" => $person, \"room\" => $roomId,\"type\"=>\"position\"]);\n foreach ($this->clients as $client) {\n $client->send($res);\n if ($alert != null) {\n $client->send(json_encode([\"person\" => $person, \"room\" => $roomId,\"type\"=>\"alert\"]));\n }\n }\n });\n }", "public function run() {\n$this->header('Content-Type: text/html');\n?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\t<title>WebSocket test page</title>\n</head>\n<body>\n<script type=\"text/javascript\">\n\tfunction create() {\n\t\t// Example\n\t\tws = new WebSocket('ws://'+document.domain+':8047/ExamplePubSub');\n\t\tws.onopen = function () {document.getElementById('log').innerHTML += 'WebSocket opened <br/>';}\n\t\tws.onmessage = function (e) {document.getElementById('log').innerHTML += 'WebSocket message: '+e.data+' <br/>';}\n\t\tws.onclose = function () {document.getElementById('log').innerHTML += 'WebSocket closed <br/>';}\n\t}\n\tfunction subscribe() {\n\t\tws.send('{\"type\":\"subscribe\",\"event\":\"usersNum\"}');\n\t}\n</script>\n<button onclick=\"create();\">Create WebSocket</button>\n<button onclick=\"subscribe();\">Send subscribe</button>\n<button onclick=\"ws.close();\">Close WebSocket</button>\n<div id=\"log\" style=\"width:300px; height: 300px; border: 1px solid #999999; overflow:auto;\"></div>\n</body>\n</html>\n<?php\n}", "function wsOnMessage($clientID, $message, $messageLength, $binary) {\n\t\n\n\t\t$ip = long2ip($this->socket->wsClients[$clientID][6]);\t\t\n\t\n\t//\t$this->socket->log(\"$ip ($clientID) send to message.\");\t\n\n\t\t// check if message length is 0\n\t\tif ($messageLength == 0) {\n\t\t\t$this->socket->wsClose($clientID);\n\t\t\treturn;\n\t\t}\n\t\t//print_r($message);\n\t\t$msj=json_decode($message);\n\t\t//$this->socket->log($msj);\n\n\t\tprint_r($msj);\n\n\t\t//Si es un mensaje tipo {'cliente':'admin'} seteo la posicion 12 \n\t\tif (isset($msj->cliente)){\n\n\t\t\t//print_r($this->socket->wsClients[$clientID]);\n\t\t\t\n\t\t\t$this->socket->wsClients[$clientID][12] = $msj->cliente;\n\t\t\t\n\t\t\tprint ($msj->cliente);\n\t\t\n\n\n\t\t}\n\t\n\n\t\tforeach ($this->socket->wsClients as $id => $client){\n\t\t\t//verifico si ya tienen definido un tipo en la posicion 12\n\t\t\tif(isset($client[12])){\n\t\t\t\t//Si esta definido el destino ({'origen':'admin','destino':'silla','texto':'mensaje'})\n\t\t\t\tif(isset($msj->destino)){\n\t\t\t\t\t//como si sabemos que tipo de cliente es verificamos si el mensaje es para el\n\t\t\t\t\tif($client[12]==$msj->destino){\n\t\t\t\t\t\t//enviamos solo al cliente destino\n\t\t\t\t\t\t$this->socket->wsSend($id,json_encode ($msj));\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif($client[12]==\"php\"){\n\t\t\t\t\t\t//enviamos solo al cliente php\n\t\t\t\t\t\t$this->socket->wsSend($id,json_encode ($msj));\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t//Reenvio en mensaje al mismo cliente que envio\n\t\t\t\t\t//si es diferente de servidor no retorna\n\t\t\t\t\t/*\n\t\t\t\t\tif(($msj->destino!=\"servidor\")){\n\t\t\t\t\t\tif($client[12]==$msj->origen){\n\t\t\t\t\t\t//enviamos solo al cliente destino\n\t\t\t\t\t\t$this->socket->wsSend($id, json_encode($msj));\n\t\t\t\t\t }\t\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t}else{\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t\n\n\t\t\t\t\t$this->socket->wsSend($id,json_encode ($msj));\n\t\t\t\t}\n\t\t\t}\n\t \t//\t$this->socket->log(\"$ip ($clientID) se guardo\");\n\t\t}\n\n\t\t \n\t}", "public function event_msg($who, $message)\r\n\t{\r\n\t\r\n\t}", "function send_message_to_player( $socket, $data ) {\r\n\tif($socket->process == true) {\r\n\t\t$obj = json_decode( $data );\r\n\t\t$user_id = $obj->user_id;\r\n\t\t$message = $obj->message;\r\n\t\t\r\n\t\t$player = id_to_player( $user_id, false );\r\n\t\tif( isset($player) ) {\r\n\t\t\t$player->write( 'message`' . $message );\r\n\t\t}\r\n\t\t$socket->write('{\"status\":\"ok\"}');\r\n\t}\r\n}", "public function onMessage($sw, $frame)\n {\n if (!$frame->finish)\n return;\n\n $_POST = \\json_decode($frame->data, true);\n if ($_POST && $uri = &$_POST['m']) {\n\n $this->callRequest($uri, $frame);\n \\Swoolet\\log($uri, $frame->fd);\n\n $this->response($frame->fd, self::$msg);\n }\n }", "public function handleSubscriptionEvent(object $message): void;", "function onMessage(Ratchet\\ConnectionInterface $from, $msg)\r\n {\r\n \r\n \r\n\r\n $message = json_decode($msg);\r\n \r\n $message->resourceId = $from->resourceId;\r\n\r\n if ($message->type == 'yourId'){\r\n $from->send(json_encode($message));\r\n } else {\r\n foreach($this->clients as $client){\r\n if ($from !== $client){\r\n $client->send(json_encode($message));\r\n }\r\n }\r\n }\r\n }", "function wsOnOpen($clientID)\n{\n\tglobal $Server;\n\t$ip = long2ip( $Server->wsClients[$clientID][6] );\n\n\t$Server->log( \"$ip ($clientID) has connected.\" );\n\t// You may have expected a message about user connecting sent to all users here, but user connected\n\t// is sent upon nick change instead, because we don't have the nickname when a user connects\n}", "private function send_msg() {\r\n }", "public function send($message);", "public function send($message);", "public function send($message);", "public function send($message);", "public abstract function send(Hermes_Message_Data $message);", "public function onMessage($connection){\n\t\t// REQUEST_URI.\n\t\t$workerman_url_info = parse_url($_SERVER['REQUEST_URI']);\n\t\tif(!$workerman_url_info){\n\t\t\tHttp::header('HTTP/1.1 400 Bad Request');\n\t\t\t$connection->close('<h1>400 Bad Request</h1>');\n\t\t\treturn;\n\t\t}\n\t\t$_SERVER['REMOTE_ADDR'] = $connection->getRemoteIp();\n\t\t$_SERVER['REMOTE_PORT'] = $connection->getRemotePort();\n\n\t\t$content = call_user_func($this->onReceive, $connection);\n\n\t\tif(strtolower($_SERVER['HTTP_CONNECTION']) === \"keep-alive\"){\n\t\t\t$connection->send($content);\n\t\t}else{\n\t\t\t$connection->close($content);\n\t\t}\n\t}", "public function sendBasicMessage(User $user, string $message): void {\n broadcast(new ServerMessageEvent($user, $message));\n }", "public static function onMessage($client_id, $message)\n {\n // debug\n echo \"client:{$_SERVER['REMOTE_ADDR']}:{$_SERVER['REMOTE_PORT']} gateway:{$_SERVER['GATEWAY_ADDR']}:{$_SERVER['GATEWAY_PORT']} client_id:$client_id session:\".json_encode($_SESSION).\" onMessage:\".$message.\"\\n\";\n \n // 客户端传递的是json数据\n $message_data = json_decode($message, true);\n\n if(!$message_data)\n {\n return ;\n }\n \n // 根据类型执行不同的业务\n switch($message_data['type'])\n {\n // 客户端回应服务端的心跳\n case 'pong':\n return;\n // 客户端登录 message格式: {type:login, name:xx, room_id:1} ,添加到客户端,广播给所有客户端xx进入聊天室\n case 'login':\n \n // 把房间号昵称放到session中\n $room_id = $message_data['room_id'];\n\t\t$client_name = $message_data['client_name'];\n $_SESSION['room_id'] = $room_id;\n\t\t$_SESSION['client_name'] = $client_name;\n\n }\n }", "function sendEvent( $event )\n {\n Event_Manager::notify( $event );\n }", "public function eventsAction()\n {\n $callback = function ($msg) {\n //check the db before running anything\n if (!$this->isDbConnected('db')) {\n return ;\n }\n\n if ($this->di->has('dblocal')) {\n if (!$this->isDbConnected('dblocal')) {\n return ;\n }\n }\n\n //we get the data from our event trigger and unserialize\n $event = unserialize($msg->body);\n\n //overwrite the user who is running this process\n if (isset($event['userData']) && $event['userData'] instanceof Users) {\n $this->di->setShared('userData', $event['userData']);\n }\n\n //lets fire the event\n $this->events->fire($event['event'], $event['source'], $event['data']);\n\n $this->log->info(\n \"Notification ({$event['event']}) - Process ID \" . $msg->delivery_info['consumer_tag']\n );\n };\n\n Queue::process(QUEUE::EVENTS, $callback);\n }", "protected function send_message($user = array(), $message = array(), $client = array())\n\t{\n\t\t// Send the message\n\t\t$user->send($message);\n\n\t\t// We have to check if event callback must be called\n\t\tif (!empty($this->CI->ci_websocket->callback['event'])) {\n\n\t\t\t// At this moment we have to check if we have authent callback defined\n\t\t\tcall_user_func_array($this->CI->ci_websocket->callback['event'],\n\t\t\t\tarray((valid_json($message) ? json_decode($message) : $message)));\n\n\t\t\t// Output\n\t\t\tif ($this->CI->ci_websocket->debug) {\n\t\t\t\toutput('info', 'Callback event \"' . $this->CI->ci_websocket->callback['event'][1] . '\" called');\n\t\t\t}\n\t\t}\n\n\t\t// Output\n\t\tif ($this->CI->ci_websocket->debug) {\n\t\t\toutput('info',\n\t\t\t\t'Client (' . $client->resourceId . ') send \\'' . $message . '\\' to (' . $user->resourceId . ')');\n\t\t}\n\t}", "function wsOnOpen($clientID) {\n\t\t$ip = long2ip($this->socket->wsClients[$clientID][6]);\n\n\n\n\n\t\t$this->socket->log(\"$ip ($clientID) has connected.\");\n\n\n\n\t\t//Send a join notice to everyone but the person who joined\n\t\tforeach ($this->socket->wsClients as $id => $client)\n\t\t\tif ($id != $clientID)\n\t\t\t\t$this->socket->wsSend($id, json_encode(array('tipo'=>'conexion','clienteId'=>$clientID ,'ip'=>$ip)));\n\n\t}", "public function wsMessage($server, $frame)\n {\n }", "public function handleDeliveryEvent(object $message): void;", "public function send($message)\n {\n }", "public function onMessage(ConnectionInterface $from, $msg)\n\t{\n\t}", "public function broadcastMessage(Request $request)\n {\n $user = Auth::user(); //AMBIL USER YANG SEDANG LOGIN\n //SIMPAN DATA KE TABLE MESSAGES MELALUI USER\n $message = $user->messages()->create([\n 'message' => $request->message\n ]);\n\n //BROADCAST EVENTNYA \n broadcast(new MessageSent($user, $message))->toOthers();\n return response()->json(['status' => 'Message Sent!']);\n }", "public function send_events()\n {\n }", "public function send_msg($message)\r\n\t{\r\n\t\t$this->server->send_msg($this->channel, $message);\r\n\t}", "public function callback() {\n $params = array();\n parse_str( $_POST['form_data'], $params );\n\n if ( !wp_verify_nonce( $params['nonce'], 'sk-operation-messages' ) ) {\n die( 'Hey hey, stop messing around!!!' );\n }\n\n if ( isset( $params['om_message_id'] ) ) {\n\n if ( $this->update_message( $params['om_message_id'], $params ) ) {\n\n wp_send_json_success(\n 'Updated!!'\n );\n\n }\n\n }\n\n // Check OK. Save the message.\n if ( $this->save_message( $params ) ) {\n\n wp_send_json_success(\n 'Created!'\n );\n\n }\n\n wp_send_json_error( 'Failed!' );\n\n }", "public function actionSendMessage() {\n\n // get data, sent by client\n $data = Yii::app()->request->getPost('chat', array());\n\n // try to store message\n $model = new Chat();\n $result = $model->storeMessage($data);\n\n // prepare return array, set status\n $response = array(\n 'status' => (bool)$result\n );\n\n // encode return array\n echo json_encode($response);\n\n // force app to end\n Yii::app()->end();\n\t}", "public function onMessage($connect, $data)\n {\n// echo $this->decode($data)['payload'] . PHP_EOL;\n }", "public function onMessage(string $data, AbstractConnection $connection)\n {\n $connection->write($data);\n }", "public function store()\n\t{\n $this->pusher->trigger(Input::get('channel_name'), 'userNewMessage', array('username'=>Sentry::getUser()->username), Input::get('socket_id'));\n $this->pusher->presence_auth(Input::get('channel_name'),Input::get('socket_id'), '123456', array('username'=>Sentry::getUser()->username));\n return $this->pusher->get('/channels/demoChannel');\n\t}", "public function onMessage(ConnectionInterface $from, $msg)\n {\n }", "protected function connected ($user)\n\t\t{\n\t\t\t//Send welcome message to user\n\t\t\t$welcome_message = 'Hello!<br>Welcome to the Websocket server!<br>Type \"help\" to see what commands are available.';\n\t\t\t$this->stdout(\"\\n\\nTESTING OUTPUT\\n\\n\");\n\t\t\t$this->send($user, $welcome_message);\n\t\t}", "function onMessage(\\Ratchet\\ConnectionInterface $from, $msg)\n {\n\n if ($msg == 1){\n echo count($this->conexiones);\n foreach ($this->conexiones as $conexione){\n $consulta = $this->conexion->query(\"SELECT * FROM coordenas\");\n foreach ($consulta as $cons){\n $this->con [] = $cons;\n }\n $msg = json_encode($this->con);\n $conexione->send($msg);\n }\n }else{\n $datos = json_decode($msg, true);\n $sentencia = $this->conexion->prepare(\"INSERT INTO coordenas (coor_x, coor_y, color, grosor) values (?,?,?,?)\");\n foreach ($datos as $coordenadas){\n $sentencia->bindValue(1, $coordenadas['x']);\n $sentencia->bindValue(2, $coordenadas['y']);\n $sentencia->bindValue(3, $coordenadas['color']);\n $sentencia->bindValue(4, $coordenadas['grosor']);\n $sentencia->execute();\n }\n }\n\n //foreach ($this->conexiones as $conexion) {\n // if ($conexion != $from) {\n // $conexion->send($msg);\n //}\n //}\n\n\n }", "public function onMessage(ConnectionInterface $from, $msg) {\n\t\t\t//log the received message to the cmd\n\t\t\techo \"New message from \".$from->resourceId.\" :\\n\".$msg.\"\\n\";\n\t\t\t$this->logEvent(\"New Message from interface \".$from->resourceId.\" :\\n\".$msg.\"\");\n\t\t\t//load the message helper\n\t\t\t//$this->load->helper(\"message_helper\");\n\t\t\t//the json decoded message\n\t\t\t$decoded_msg = \"\";\n\t\t\t//check if the message is in JSON format\n\t\t\ttry{\n\t\t\t\t//echo \"\\n\".$msg.\"\\n\";\n\t\t\t\t$decoded_msg = json_decode($msg);\n\t\t\t\t//echo \"\\n\".$decoded_msg.\"\\n\";\n\t\t\t\t//get the message sequence \n\t\t\t\t$message_sequence = $decoded_msg->msg_seq;\n\t\t\t\tif($message_sequence != \"\")// if the message sequence is valid\n\t\t\t\t{\n\t\t\t\t\t//echo \"\\n\".$message_sequence.\"\\n\";\n\t\t\t\t\t//echo \"\\n\".$from->last_message_seq.\"\\n\";\n\t\t\t\t\tif($message_sequence != $from->last_message_seq){//if the message wasn't a duplicate to the last message\n\t\t\t\t\t\t//parse the not allowed characters using the url_encode\n\t\t\t\t\t\t$msg = urlencode($msg);\n\t\t\t\t\t\t//if the connection is not authorized yet then this message should be the authentication message\n\t\t\t\t\t\tif(!$from->authenticated){\n\t\t\t\t\t\t\t//get the satation_ID from the message\n\t\t\t\t\t\t\t$station_ID = $decoded_msg->station_id;\n\t\t\t\t\t\t\techo \"\\n\".$station_ID.\"\\n\";\n\t\t\t\t\t\t\t//check this station existence in the database\n\t\t\t\t\t\t\t$station_exists = shell_exec(\"php index.php main checkStation \".$station_ID.\" &\");\n\t\t\t\t\t\t\techo \"\\n\".$station_exists.\"\\n\";\n\t\t\t\t\t\t\t//if the returned station id > 0 then the station was found\n\t\t\t\t\t\t\tif($station_exists > 0){\n\t\t\t\t\t\t\t\t$this->logEvent(\"Station \".$station_ID.\" connected on interface \".$from->resourceId.\".\");\n\t\t\t\t\t\t\t\t//check for station id duplication\n\t\t\t\t\t\t\t\t$duplicate = $this->check_duplicate_station_ID($station_ID);\n\t\t\t\t\t\t\t\tif(!$duplicate){\n\t\t\t\t\t\t\t\t\t//if the station exists in the database then set the connection authenticated field to true \n\t\t\t\t\t\t\t\t\t$from->authenticated = true;\n\t\t\t\t\t\t\t\t\t//and add the station id to the connection object\n\t\t\t\t\t\t\t\t\t$from->station_id = $station_exists * 1;\n\t\t\t\t\t\t\t\t\t$from->station_ID = $station_ID;\n\t\t\t\t\t\t\t\t\t$this->logEvent(\"Parsing and executing message(seq = \".$message_sequence.\") from interface \".$from->resourceId.\".\");\n\t\t\t\t\t\t\t\t\t//send the message to the station controller to be parsed and executed\n\t\t\t\t\t\t\t\t\t$result = shell_exec(\"php index.php main receiveMessage \".$msg.\" &\");\n\t\t\t\t\t\t\t\t\techo $result;\n\t\t\t\t\t\t\t\t\t//log the action to the cmd\n\t\t\t\t\t\t\t\t\t//echo sprintf('Connection %d sending main \"%s\"\\n', $from->resourceId, $msg);\n\t\t\t\t\t\t\t\t\t//if the result came back from the execution == valid then acknoledge the \n\t\t\t\t\t\t\t\t\t//message else just return the error message\n\t\t\t\t\t\t\t\t\t//echo $result.\"\\n\";\n\t\t\t\t\t\t\t\t\t//if($result == SUCCESS){\n\t\t\t\t\t\t\t\t\t//setting the last message sequence as the current message\n\t\t\t\t\t\t\t\t\t$from->last_message_seq = $message_sequence;\n\t\t\t\t\t\t\t\t\t//send back the result message to the station\n\t\t\t\t\t\t\t\t\t$this->sendToClient($from,$result,$message_sequence);\n\t\t\t\t\t\t\t\t\t/*}else{\n\t\t\t\t\t\t\t\t\t\t//send back the returned error message to the station\n\t\t\t\t\t\t\t\t\t\t$this->sendToClient($from,$result,$message_sequence);\n\t\t\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\techo \"Station (\".$station_ID.\") on interface has a the same station id as an already connected station\\n\";\n\t\t\t\t\t\t\t\t\t$this->logEvent(\"Station (\".$station_ID.\") on interface has a the same station id as an already connected station.\");\n\t\t\t\t\t\t\t\t\t$result = shell_exec(\"php index.php sendMail send \".$station_ID.\" &\");\n\t\t\t\t\t\t\t\t\techo \"Closing connectin with Stattion(\".$station_ID.\") on interface {$from->resourceId}..\\n\";\n\t\t\t\t\t\t\t\t\t$this->logEvent(\"Closing connectin with Stattion(\".$station_ID.\") on interface {$from->resourceId}..\");\n\t\t\t\t\t\t\t\t\techo \"closing\\n\";\n\t\t\t\t\t\t\t\t\t$from->close();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$this->logEvent(\"Connected on interface \".$from->resourceId.\" is not authorized.\");\n\t\t\t\t\t\t\t\techo \"Unauthorized connection {$from->resourceId} closed 1\\n\";\n\t\t\t\t\t\t\t\t$this->sendToClient($from,$this->UNAUTHORIZED,\"\");\n\t\t\t\t\t\t\t\techo \"closing\\n\";\n\t\t\t\t\t\t\t\t$from->close();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//echo sprintf('Connection %d sending message \"%s\"\\n', $from->resourceId, $msg);\n\t\t\t\t\t\t\t$this->logEvent(\"Parsing and executing message(seq = \".$message_sequence.\") from interface \".$from->resourceId.\".\");\n\t\t\t\t\t\t\t//send the message to the station controller to be parsed\n\t\t\t\t\t\t\t$result = shell_exec(\"php index.php main receiveMessage \".$msg.\" &\");\n\t\t\t\t\t\t\t//if the result came back from the execution == valid then acknoledge the \n\t\t\t\t\t\t\t//message else just return the error message\n\t\t\t\t\t\t\t//echo \"\\n\".$result.\"\\n\";\n\t\t\t\t\t\t\t//if($result == |SUCCESS){\n\t\t\t\t\t\t\t\t//setting the last message sequence as the current message\n\t\t\t\t\t\t\t\techo $result;\n\t\t\t\t\t\t\t$from->last_message_seq = $message_sequence;\n\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t//send back the result message to the station\n\t\t\t\t\t\t\t$this->sendToClient($from,$result,$message_sequence);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tthrow new Exception('Invalid message sequence');\n\t\t\t\t}\n\t\t\t}catch(Exception $e){\n\t\t\t\t$this->logEvent(\"Invalid message sequence sent from interface \".$from->resourceId.\".\");\n\t\t\t\techo \"Invalid message from connection {$from->resourceId}\\n\".$e->getMessage();\n\t\t\t\t$code = $this->MESSAGE_PARSING_ERROR;\n\t\t\t\t$this->sendToClient($from,$code,\"\");\n\t\t\t\t//if the connection that sent the misformatted message is not authenticated close the connection\n\t\t\t\tif(!$from->authenticated){\n\t\t\t\t\t$this->logEvent(\"Connected on interface \".$from->resourceId.\" is not authorized.\");\n\t\t\t\t\techo \"Unauthorized connection {$from->resourceId} closed 2\\n\";\n\t\t\t\t\t$code = $this->UNAUTHORIZED;\n\t\t\t\t\t$this->sendToClient($from,$code,\"\");\n\t\t\t\t\techo \"closing\\n\";\n\t\t\t\t\t$from->close();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function handle(FlashMessageAwareInterface $event);", "function sendUserMessage($user, $message)\n\t{\n\t\t$this->sendMessage($user, $message);\n\t}", "function wsOnOpen($clientID)\r\n{\r\n\tglobal $Server, $bigbroadcast, $t1, $ready;\r\n\t$ip = long2ip( $Server->wsClients[$clientID][6] );\r\n\r\n\techo \"$ip ($clientID) has connected.\\n\" ;\r\n\tnewPlayer($clientID);\r\n\tif($ready)\r\n\t{\r\n\t\tsleep(1);\r\n\t\tbigBroadcast();\r\n\r\n\t}\r\n\t\r\n\t//Send a join notice to everyone but the person who joined\r\n\t/*foreach ( $Server->wsClients as $id => $client )\r\n\t\tif ( $id != $clientID )\r\n\t\t\t$Server->wsSend($id, \"Visitor $clientID ($ip) has joined the room.\");*/\r\n}", "public function sendMessage(BotMessage $message): void;", "public function broadcast($server, $message);", "public function listen() :void {\n\n echo \"Starting websocket server on... \" . $this->address . \":\" . $this->port;\n \n socket_listen($this->server);\n socket_set_nonblock($this->server);\n $this->clients[] = new WebSocket($this->server);\n\n do {\n\n $read = array_map(function($ws) {return $ws->socket;}, $this->clients);\n $write = null; \n $except = null;\n\n $ready = socket_select($read, $write, $except, 0);\n if ($ready === false) {\n if ($this->onError !== null) {\n $callback = $this->onError;\n $callback(\"[\".socket_last_error().\"]\".\" \".socket_strerror(socket_last_error()));\n }\n\n return;\n }\n\n if ($ready < 1) continue;\n\n // check if there is a client trying to connect.\n if (in_array($this->server, $read)) {\n if (($client = socket_accept($this->server)) !== false) {\n\n // send websocket handshake headers.\n if (!$this->sendHandshakeHeaders($client)) {\n continue;\n }\n\n // add the new client to the $clients array.\n $ws = new WebSocket($client);\n $this->clients[] = $ws;\n\n // call \"connection\" event handler for each new client.\n if ($this->onConnect !== null) {\n $callback = $this->onConnect;\n $callback($ws);\n }\n\n // remove the listening socket from the clients-with-data array.\n $key = array_search($this->server, $read);\n unset($read[$key]);\n }\n }\n\n foreach ($read as $key => $client) {\n\n $buffer = \"\";\n $bytes = @socket_recv($client, $buffer, 2048, 0);\n\n // check if the client is disconnected.\n if ($bytes === false) {\n\n // remove client from $clients array\n // and call disconnect event handler.\n unset($this->clients[$key]);\n if ($this->onDisconnect !== null) {\n $callback = $this->onDisconnect;\n $callback();\n }\n\n continue;\n }\n\n $ws = $this->clients[$key];\n $callback = $ws->onMessage;\n if ($callback !== null) {\n $callback($ws, $this->unmask($buffer));\n }\n }\n } while (true);\n socket_close($this->server);\n }", "public function broadcastOn()\n {\n return ['new-message'.$this->for_user_id];\n }", "public function handle()\n {\n $websocketServer = new WebSocketServer();\n $websocketServer->start();\n }", "public static function sendMessage($message) {\n $context = new \\ZMQContext();\n $socket = $context->getSocket(\\ZMQ::SOCKET_PUSH, 'my pusher');\n $socket->connect(\"tcp://localhost:5555\");\n $socket->send($message);\n }", "public function sendWelcomeMsg()\n\t{\n\t}", "public function onReady() {\n\t\t$appInstance = $this; // a reference to this application instance for ExampleWebSocketRoute\n\t\t\\PHPDaemon\\WebSocket\\WebSocketServer::getInstance()->addRoute('ExamplePubSub', function ($client) use ($appInstance) {\n\t\t\treturn new ExamplePubSubWebSocketRoute($client, $appInstance);\n\t\t});\n\t\t$this->sql = \\PHPDaemon\\Clients\\MySQLClient::getInstance();\n\t\t$this->pubsub = new \\PHPDaemon\\PubSub();\n\t\t$this->pubsub->addEvent('usersNum', \\PHPDaemon\\PubSubEvent::init()\n\t\t\t\t\t\t\t\t\t\t\t\t ->onActivation(function ($pubsub) use ($appInstance) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t \\PHPDaemon\\Daemon::log('onActivation');\n\t\t\t\t\t\t\t\t\t\t\t\t\t if (isset($pubsub->event)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \\PHPDaemon\\Timer::setTimeout($pubsub->event, 0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t return;\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 $pubsub->event = setTimeout(function ($timer) use ($pubsub, $appInstance) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $appInstance->sql->getConnection(function ($sql) use ($pubsub) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t if (!$sql->connected) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t return;\n\t\t\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\t\t $sql->query('SELECT COUNT(*) `num` FROM `dle_users`', function ($sql, $success) use ($pubsub) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $pubsub->pub(sizeof($sql->resultRows) ? $sql->resultRows[0]['num'] : 'null');\n\t\t\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\t });\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $timer->timeout(5e6); // 5 seconds\n\t\t\t\t\t\t\t\t\t\t\t\t\t }, 0);\n\t\t\t\t\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t\t\t\t\t\t ->onDeactivation(function ($pubsub) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t if (isset($pubsub->event)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \\PHPDaemon\\Timer::cancelTimeout($pubsub->event);\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t })\n\t\t);\n\t}", "public function onMessage($clientChat, $receivedText)\n\t{\n\t}", "function onMessage(ConnectionInterface $from, $msg)\n {\n $notification = json_decode($msg,true);\n\n if($notification['token'] == $this->GFS_NOTIFICATION_TOKEN){\n $notification = $notification['notification'];\n if(!empty($this->users[$notification['userId']])){\n foreach ($this->users[$notification['userId']] as $client) {\n // The sender is not the receiver, send to each client connected\n $client->send(json_encode($notification));\n }\n }\n }\n }", "protected function send($user, $message)\n\t{\n\t\tif ( $user->handshake ) \n\t\t{\n\t\t\t$message = $this->frame($message,$user);\n\t\t\t$result = @socket_write($user->socket, $message, strlen($message));\n\t\t}\n\t\telse \n\t\t{\n\t\t// User has not yet performed their handshake.Store for sending later.\n\n\t\t\t$holdingMessage = array('user' => $user, 'message' => $message);\n\t\t\t$this->heldMessages[] = $holdingMessage;\n\t\t}\n\t}", "public function send(mixed $message): void;", "public function sendMessage($user_id, $message)\n {\n $this->_Database->query(\"INSERT INTO chat (chat_id, user_id, message, time_posted) VALUES ('', :user_id, :message, CURRENT_TIMESTAMP)\", array(':user_id' => $user_id, ':message' => $message));\n }", "function sendChannelMessage($message)\n\t{\n\t\t$this->sendMessage($this->channel, $message);\n\t}", "public function send($message, $callback);", "public function broadcastOn()\n {\n return new Channel('notification_user');\n }", "public function beforeSendPerformed(Swift_Events_SendEvent $evt)\n {\n $message = $evt->getMessage();\n\n if (call_user_func($this->callback, $message))\n {\n parent::beforeSendPerformed($evt);\n }\n }", "public function writeMessage ()\n {\n $authObject = new Authenticate();\n $authObject->validateWriteMessage($_GET[\"controller\"]);\n \n $body = $_POST[\"body\"];\n $subject = $_POST[\"subject\"];\n \n $sentto = $_POST[\"sentto\"];\n \n $this->createUser();\n \n if (($this->_objUser->messageSend($body, $subject, $sentto)) == false) {\n $this->setCustomMessage(\"ErrorMessage\", \"Problem in sending message\");\n } else {\n $this->setCustomMessage(\"SuccessMessage\", \"Message sent successfully\");\n }\n }", "function onOpen(ConnectionInterface $conn)\n {\n /** @var QueryString $GET */\n $GET = $conn->WebSocket->request->getQuery();\n if(empty($this->users[$GET->get('userId')])) $this->users[$GET->get('userId')] = [];\n $this->users[$GET->get('userId')][] = $conn;\n\n echo \"New connection! ({$conn->resourceId})\".PHP_EOL;\n }", "public function onData(int $clientId, Websocket\\Message $msg) {\n $this->endpoint->broadcast(yield $msg);\n }", "public function onEvent();", "public function sendMessage($message)\n\t{\n\t\tglobal $log;\n\n\t\tif (!empty($this->channel)) {\n\t\t\t$log->print(date('H:i:s', time()));\n\t\t\t$log->println(' > ' . $message, COLOR_BOT_MESSAGE);\n\t\t\t$this->send('PRIVMSG #' . $this->channel . ' : ' . $message);\n\t\t} else\n\t\t\techo '[ERROR] No channel were joined' . PHP_EOL;\n\t}", "abstract protected function onClientDisconnected(WebSocketClient $client);", "public function postAction() {\n\t\t$this->sendMessage();\n\t}", "public function send() {}", "public function send() {}", "public function send() {}", "public function send() {}", "public function send() {}", "public function handleOpenEvent(object $message): void;", "private function onPing()\n {\n $this->send($this->replyEvent());\n }", "public function on_user_add(&$user) {\r\n\t\t$this->socket_array[(int)$user->socket] = $user;\r\n\t}", "public function sendMessage(){\n //Gets the recievers id\n $userId = $_POST[\"userIdForMessage\"];\n //gets the message text\n $messageText = $_POST[\"messageText\"];\n //Makes sure not of the above variables are empty\n if(empty($userId) == false && empty($messageText) == false){\n //Gets the other users name\n $usersName = $this->individualGroupModel->getTheUsersName($userId); \n //Checks if the users have already been connected\n $groupUserToUserConnection = $this->individualGroupModel->checkGroupMessageConnection($userId); \n\n //If the size of groupuser to user connection is 0 means the users have never messaged before\n if(sizeof($groupUserToUserConnection) == 0){\n $groupInfo = $this->individualGroupModel->getGroupInformation($_SESSION['current_group']); \n $this->individualGroupModel->createGroupMessageConnectionRecord($userId, $usersName, $groupInfo);\n }\n //Insert message\n $this->individualGroupModel->sendMessageFromGroup($userId, $messageText, $usersName); \n //redirect to the group page\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }else{\n //redirect\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }\n }", "public function broadcastOn()\n {\n return new Channel('chess');\n }", "public function MessageSink($TimeStamp, $SenderID, $Message, $Data)\n {\n parent::MessageSink($TimeStamp, $SenderID, $Message, $Data);\n\n if ($Message == IPS_KERNELMESSAGE && $Data[0] == KR_READY) {\n $this->RegisterHook('/hook/webgraph');\n }\n }", "public function handle(UserWasRegistered $event)\n {\n\n // Send the message using the mailer contract (Amazon SES)\n $this->mailer->send('emails.welcome', ['name' => $event->user->name], function ($message) use ($event) {\n $message->from('[email protected]', 'Differ');\n $message->subject(sprintf('Welcome to differ, %s!', $event->user->name));\n $message->to($event->user->email);\n });\n }", "public function onReceivedMessage($data)\n {\n try {\n // Decode incoming data and log it\n $message = json_decode($data, true, 512, JSON_THROW_ON_ERROR);\n echo print_r($message, true);\n } catch (\\JsonException $e) {\n // If it's not valid JSON, we can ignore it, but we should send and\n // ACK regardless. NOTE: This is probably the opening message from\n // OOCSI\n $this->connection->send('.');\n return;\n }\n \n // Send back a dot as acknowledgement\n $this->connection->send('.');\n\n // Check if the message contains a timestamp\n if (!$message['timestamp']) {\n onDataReceived($message);\n }\n\n // Pass the data off to the next function\n $this->handleData($message);\n }", "public function push($message);", "public function broadcastEvent(\\Montage\\Event\\Event $event);", "function sendMessageToClient( $MsgSock, $Message ) {\n\t$Size = strlen( $Message );\n\n\tif ( socket_write( $MsgSock, $Message, $Size ) < $Size )\n\t\tob_flush();\n\n\tif ( $GLOBALS[ 'FLAG_DEBUG' ] ) {\n\t\tprint( $GLOBALS[ 'PREFIX_DEBUG' ] . $Message );\n\t}\n\n\treturn;\n}", "public function webhookHandler()\n {\n // Get Update\n $update = $this->telegram->commandsHandler(true);\n\n // Get Message\n $message = $update->getMessage();\n\n // Edge Case?\n if ($message === null) {\n return 'Ok';\n }\n\n // Track Data\n $this->logChatroom($message);\n\n // Okie Doke\n return 'Ok';\n }", "public function handleMessage(User $user, string $type, string|int $forMessage = null, int $id = null): void {\n $message = $this->serverMessageBuilder->buildWithAdditionalInformation($type, $forMessage);\n\n broadcast(new ServerMessageEvent($user, $message, $id));\n }", "public function onMessage( callable $fCallback )\n\t{\n\t\t$this->m_cSubscriber->on( 'messages', function ( $msg ) use ( $fCallback ) {\n\n\t\t\tvar_dump( \"PubSubZmq onMessage\", $msg, json_encode( $msg, JSON_NUMERIC_CHECK /*| JSON_FORCE_OBJECT*/ ) );\n\n\t\t\tcall_user_func_array( $fCallback, array( json_encode( $msg, JSON_NUMERIC_CHECK /*| JSON_FORCE_OBJECT*/ ) ) );\n\t\t} );\n\t}", "public function handle(MessageSent $event)\n {\n Log::channel('mail')->info(\n 'SENT From: '.$event->message->getFrom()[0]->getAddress()\n .' to: '.$event->message->getTo()[0]->getAddress()\n .', subject: '.$event->message->getSubject()\n //.', data: '.print_r($event->data, true)\n );\n }" ]
[ "0.73342466", "0.67716205", "0.65874314", "0.65827554", "0.65678304", "0.64386886", "0.6383517", "0.62717795", "0.6154262", "0.6121851", "0.60810363", "0.60745895", "0.606751", "0.6057296", "0.601663", "0.6014884", "0.59988445", "0.5993076", "0.5942476", "0.58811116", "0.5878896", "0.58697116", "0.5842894", "0.5793089", "0.57705617", "0.5758531", "0.5752635", "0.5752635", "0.5752635", "0.5752635", "0.5751883", "0.57409185", "0.5737722", "0.573092", "0.5690611", "0.567651", "0.56610644", "0.5647577", "0.5631317", "0.5584243", "0.55756485", "0.5572515", "0.5555183", "0.55536807", "0.55454504", "0.55418915", "0.55411226", "0.5528336", "0.55133253", "0.55076087", "0.5493814", "0.5485155", "0.5466466", "0.54631174", "0.54501235", "0.54496074", "0.54419506", "0.5439371", "0.5418549", "0.53927124", "0.53861773", "0.5374286", "0.5371603", "0.5364702", "0.5358338", "0.53522503", "0.5340459", "0.5330317", "0.5328322", "0.5325773", "0.5313395", "0.5308087", "0.5296164", "0.52959305", "0.52825963", "0.52797323", "0.5259856", "0.5256188", "0.5254611", "0.5245691", "0.5238012", "0.5237632", "0.5237632", "0.5237632", "0.5237632", "0.5237632", "0.523062", "0.5229825", "0.5229787", "0.5229297", "0.52267325", "0.5223366", "0.5211458", "0.5210173", "0.51905376", "0.51903623", "0.51843446", "0.5182428", "0.5182192", "0.51821506", "0.5180813" ]
0.0
-1
Event function that is called when an error occurs during handshake or an event.
public function onError(ConnectionInterface $conn, Exception $err) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function errorOccured();", "public function onForcedFaxNegotiationFailure( Streamwide_Engine_Events_Event $event )\n {\n return $this->dispatchErrorEvent( self::FAX_NOT_RECEIVED_ERR_CODE );\n }", "function error(){}", "public function onKernelException()\n {\n echo '<br> something wrong happened ! exeption event listener successfuly fired :D ';\n }", "function OnAfterError(){\n }", "function onError(\\Ratchet\\ConnectionInterface $conn, \\Exception $e)\n {\n // TODO: Implement onError() method.\n }", "public function onUserLoginFailed($event)\n {\n }", "function onError(ConnectionInterface $conn, \\Exception $e)\n {\n echo \"An error has occurred: {$e->getMessage()}\\n\";\n\n $conn->close();\n }", "function onError(ConnectionInterface $conn, \\Exception $e)\n {\n echo \"An error has occurred: {$e->getMessage()}\\n\";\n\n $conn->close();\n }", "public abstract function onFail();", "function onError(ConnectionInterface $conn, \\Exception $e)\n {\n echo \"$e\\n\";\n $conn->close();\n }", "public function serverHeartbeatFailed(ServerHeartbeatFailedEvent $event): void;", "public function onFailure() {\n\t\tif ($this->onConnected) {\n\t\t\t$this->onConnected->executeAll($this);\n\t\t\t$this->onConnected = null;\n\t\t}\n\t}", "public static function failed_event_method()\n {\n return false;\n }", "public function onConnectionClosed();", "public function onError(ConnectionInterface $conn, \\Exception $e): void\n {\n echo \"Error {$e->getMessage()}\\n\";\n }", "function api_err_handler($buffer) {\n if (!empty($GLOBALS['api_fn_complete'])) return '';\n return api_error(-32000, \"Unexpected error\", $buffer, $GLOBALS['api_req']['id']);\n}", "public function onNoTriesLeft( Streamwide_Engine_Events_Event $event )\n {\n $this->dispatchErrorEvent( self::NO_TRIES_LEFT_ERR_CODE );\n }", "function accept_error_cb($listener, $ctx) {\n\t\tfprintf(STDERR, \"Got an error %d (%s) on the listener. \"\n\t\t\t.\"Shutting down.\\n\",\n\t\t\tEventUtil::getLastSocketErrno(),\n\t\t\tEventUtil::getLastSocketError());\n\n\t\t$this->base->exit(NULL);\n\t}", "public function onShutdown($error);", "public function error();", "public static function w_error_handler($errno, $errstr, $errfile, $errline, $errcontext) {\n\t\terror_log('An error occurred sending purchase to woomio, and was bypassed. ' . $errno . ': ' . $errstr);\n\t\treturn true;\n\t}", "abstract public function error();", "function api_error_setup() {\n\tset_exception_handler(function(Throwable $e) {\n\t\ttry {\n\t\t\techo APIException::make_json_string(APIException::map_to_code($e), $e);\n\t\t\tls_log($e->__toString(), LOGERR);\n\t\t} catch (Exception $e) {\n\t\t\t/*\n\t\t\t* Exceptions thrown in the exception handler\n\t\t\t* cause hard to debug fatal errors. Handle them.\n\t\t\t*/\n\t\t\techo '{\"error\":'.API_E_INTERNAL.', \"e_msg\":\"'.$e->getMessage().\n\t\t\t\t' (in exception handler, '.$e->getFile().' '.$e->getLine().')\"}';\n\t\t}\n\t\texit(1);\n\t});\n}", "function as_error_handler($errno, $errstr, $errfile, $errline){\n\t\t$msg = 'Error('.$errno.') '.$errstr.' in '. $errfile.':'. $errline;\n\t\t$this->catch_error( $msg, 'clickgs plugin crashed');\n\t}", "function onError(Ratchet\\ConnectionInterface $conn, Exception $e)\r\n {\r\n echo \"An error has occurred: {$e->getMessage()}\\n\";\r\n $this->clients->detach($conn);\r\n $conn->close();\r\n }", "public function onOmnipayRequestError(Event $event)\n {\n $this->logger->error($this->gateway_name, $event->toArray());\n }", "protected function session_start_error($errno, $errstr)\n {\n }", "function fatal_error_handler() {\n $last_error = error_get_last();\n $this->logger->error($last_error);\n if ($last_error['type'] === E_ERROR) {\n header('Location: '.$this->fallback);\n exit;\n }\n }", "public function initialize() {\n $callback = array($this, 'handleException');\n Zibo::getInstance()->registerEventListener(Zibo::EVENT_ERROR, $callback, 75);\n }", "function errorCode()\n {\n }", "private function error()\n {\n $json = array_merge($this->data, ['message' => $this->error, 'class' => 'error']);\n wp_send_json($json);\n }", "function authError()\r\n\t{\r\n\t\t$ajax = ajax();\r\n\t\t\r\n\t\t$ajax->warning(\"Could no Authenticate. Please re-login\");\r\n\t}", "function ibase_free_event_handler($event): void\n{\n error_clear_last();\n $safeResult = \\ibase_free_event_handler($event);\n if ($safeResult === false) {\n throw IbaseException::createFromPhpError();\n }\n}", "protected abstract function send_error($ex=null) ;", "public function runError() {\n\t\t\t$this->setSession('sError', $this->getError());\n\n\t\t\t// Set the router\n\t\t\tredirect(\n\t\t\t\t$this->getUrl(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'sRouter' => 'error', \n\t\t\t\t\t\t'sController' => 'index'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}", "protected function errorAction() {}", "function exception_handler($ex) {\n // now let the plugin send the exception to client\n $this->send_error($ex);\n // not much else we can do now, add some logging later\n exit(1);\n }", "abstract public function handleFatalError($e);", "function trigger_socket_error($socket = null)\n {\n $code = $socket ? socket_last_error($socket) : socket_last_error();\n debug_print_backtrace();\n trigger_error(\"[${code}] \" . socket_strerror($code), E_USER_ERROR);\n }", "public function onEvent();", "public function getEvent()\n {\n throw new Kronolith_Exception($this->_errormsg);\n }", "function msgsrv_last_error () {}", "function errorHandler($errno,$errstr){\n\t global $errors;\n\n\t raiseError(\"We are working to solve an internal issue in our service. Please, try later.\", Constants::HTTP_INTERNAL_SERVER_ERROR);\n\t}", "function fatalErrorHandler() {\n global $cfg;\n $error = error_get_last();\n if(($error['type'] === E_ERROR) || ($error['type'] === E_USER_ERROR)){\n header(\"HTTP/1.1 500 Server Error\");\n readfile($cfg['source_root'] . \"/500.html\");\n //error_log(print_r($error, true));\n //error_log(print_r(debug_backtrace(), true));\n exit();\n }\n/*\n if(($error['type'] === E_ERROR) || ($error['type'] === E_USER_ERROR)){\n $_SESSION['error'] = $error;\n header(\"Location:\".$cfg['root'].\"exception/\");\n exit;\n }\n*/\n}", "public function onError(ConnectionInterface $conn, \\Exception $e)\n {\n // TODO: Implement onError() method.\n }", "public function handleRenderingFailureEvent(object $message): void;", "public function errorMode(){}", "function ssl_event_cb($bev, $events, $ctx) {\n\t\techo __METHOD__, PHP_EOL;\n\t\tif ($events & EventBufferEvent::ERROR) {\n\t\t\tfprintf(STDERR, \"Error! Events: 0x%x\\n\", $events);\n\t\t\t// Fetch errors from the SSL error stack\n\t\t\twhile ($err = $bev->sslError()) {\n\t\t\t\tfprintf(STDERR, \"Bufferevent error %s.\\n\", $err);\n\t\t\t}\n\t\t}\n\n\t\tif ($events & (EventBufferEvent::EOF | EventBufferEvent::ERROR)) {\n\t\t\t$bev->free();\n\t\t}\n\t}", "public function error() {\n\t\tnonce_generate();\n\t\t$this->title = !empty($_SESSION['title']) ? $_SESSION['title'] : 'Error';\n\t\tif (!empty($_SESSION['data'])) {\n\t\t\t$data = $_SESSION['data'];\n\t\t} else {\n\t\t\t$data = array(\n\t\t\t\t'error' => 'An unknown error ocurred.',\n\t\t\t\t'link' => ''\n\t\t\t);\n\t\t}\n\t\t$this->content = $this->View->getHtml('content-error', $data, $this->title);\n\t}", "public function onHttpError($callback)\r\n {\r\n $this->http_error_callbacks->push($callback);\r\n }", "protected function callError($message) {\n if ($this->quit_on_error) {\n header('HTTP/1.0 500 Internal Server Error');\n echo(\"<h3>A system error occured, Please try again later.</h3>\");\n if ($this->debug)\n echo (\"<br>Crash Information:<br><p style=\\\"font-family: monospace;\\\">\" . $message . \"</p>\");\n exit();\n } else {\n $this->error_handler($message);\n }\n }", "function errorHandlerOn()\n\t{\n\t\t$this->bErrorHandler = true;\n\t}", "public static function tryError()\n\t{\n\t\tset_error_handler(array(__CLASS__, '_errorHandler'), E_ALL);\n\t\tself::$errorMsg = NULL;\n\t}", "private function failure() : void\n {\n (new Repository())->disconnect();\n (new Session())->set('user','success', 'Une erreur est survenue nous vous prions de réessayer ultèrieurement');\n header('Location:' . self::REDIRECT_HOME);\n die();\n }", "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 }", "function error_handler ($errnor, $errstr, $errfile, $errline) {\n // is blocking their being caught. For now, suppress the PHP error\n // so as to match the missing HPHP one.\n //echo \"error handler<<<\\n\";\n //var_dump($errnor, $errstr, $errfile, $errline) ;\n //echo \">>>\\n\";\n return true;\n}", "function trigger_error($error, $error_code) {\n switch($error_code) {\n case DB_CONNECTION_ERROR :\n case DB_SERVER_CONNECTION_ERROR :\n die($error);\n break;\n case DB_QUERY_ERROR :\n array_push($this->errors,$error);\n break;\n default:\n array_push($this->errors,$error_code.' '.$error);\n break;\n }\n return false;\n }", "function error_handler($errno, $string, $file, $line, $context) {\n throw new Trails_Exception(500, $string);\n }", "function halt( $msg )\n {\n $this->Error = @mysql_error( $this->Link_ID );\n $this->Errno = @mysql_errno( $this->Link_ID );\n\n if ( $this->locked )\n {\n $this->unlock();\n }\n\n if ( $this->Halt_On_Error == \"no\" )\n return;\n\n $this->haltmsg( $msg );\n\n if ( $this->Halt_On_Error != \"report\" )\n die( \"Session halted.\" );\n }", "function my_error($msg) {\n\theader('HTTP/1.1 500 Internal Server Error');\n\ttrigger_error($msg,E_USER_ERROR);\n}", "public function errorOccurred(): bool\n {\n return $this->serverErrorOccurred() || $this->clientErrorOccurred();\n }", "public function onError($callback)\n {\n $handler = new EventListener(null, $callback);\n $this->dispatcher->addListener('server.error', array($handler, 'testAndExecute'));\n }", "public function error()\n\t{\n\t}", "function getError();", "function getError();", "public function handle(\\Exception $error);", "public function OnInvalidKey()\n {\n $this->response(403, 'Access denied ' . $_SERVER['REMOTE_ADDR'], 'Unauthorized', null);\n }", "function onOpen\t($SocketID\t\t)\t//...successful handshake\n\t\t\t{ $this->Log(\"Handshake with socket #$SocketID successful\"); }", "function error($why)\n {\n eval(PUBSUB_MUTATE);\n if (!$this->_closed)\n {\n kn_apply($this->_handlers['onError'],\n array_merge(array($this, $why, $this->_connected),\n $this->_handlers['args']));\n }\n $this->destroy();\n }", "public static function trap_errors_begin(){\n\t\t\tself::$trapprevhndlr=set_error_handler(array('Errors','handle_trap'));\n\t\t}", "public function onWorkerError(Swoole\\Server $swooleServer, $workerId, $workerPid, $exitCode, $sigNo)\n {\n }", "public function handleError(Enlight_Event_EventArgs $args)\n {\n $front = $args->get('subject');\n\n if (!method_exists($front, 'getParam') || !$front->getParam('noErrorHandler')) {\n if (isset($this->config['exceptionHandler'])) {\n $this->bugsnagHandler->registerExceptionHandler(false);\n\n // restore default error handler\n restore_exception_handler();\n }\n\n if (isset($this->config['errorHandler'])) {\n $this->bugsnagHandler->registerErrorHandler(false);\n\n // restore default error handler\n restore_error_handler();\n }\n }\n }", "public function error()\n {\n $this->appendLog(\n 'error',\n \\func_get_args(),\n $this->internal->getErrorCaller()\n );\n }", "protected function onError(Blackbox_Exception $e,Blackbox_Data $data, Blackbox_IStateData $state)\n\t{\n\t\tif ($event = $this->getEventName())\n\t\t{\n\t\t\t$this->logEvent($event, 'ERROR', VendorAPI_Blackbox_EventLog::FAIL);\n\t\t}\n\t}", "public function errorAction()\n {\n $this->_logger->debug(__('Calling errorAction'));\n try {\n $this->loadLayout()\n ->_initLayoutMessages('checkout/session')\n ->_initLayoutMessages('catalog/session')\n ->_initLayoutMessages('customer/session');\n $this->renderLayout();\n $this->_logger->info(__('Successful to redirect to error page.'));\n } catch (\\Exception $e) {\n $this->_logger->error(json_encode($this->getRequest()->getParams()));\n $this->_getCheckoutSession()->addError(__('An error occurred during redirecting to error page.'));\n }\n }", "public function onError(ConnectionInterface $conexion, \\Exception $e)\n {\n echo \"Un error inesperado ha ocurrido: {$e->getMessage()}\\n\";\n $conexion->close(); // Al ocurrir el error cerrar la conexion\n }", "protected function error()\n {\n $this->response = $this->response->withStatus(500);\n $this->jsonBody([\n 'input' => $this->payload->getInput(),\n 'error' => $this->payload->getOutput(),\n ]);\n }", "private function loginFailed()\n {\n //Login failed...\n }", "abstract protected function handleError(\\Exception $e);", "function PopError()\n {\n }", "function customError($errno, $errstr)\n {\n $_SESSION['err_msg'] = \"<b>Error:</b> [$errno] $errstr<br />\"; \n header(\"location: ../_php_fail.php\");\n die();\n }", "function shutdown_handler() {\n ini_set(\"error_log\", \"/tmp/php-error.log\");\n $error = error_get_last();\n\n if(!is_null($error)) {\n # http://us1.php.net/manual/en/errorfunc.constants.php\n $info = array(\n 'error' => var_export($error, true)\n );\n\n $url = ($_SERVER['SERVER_PORT'] == 443 ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n $args = <<<EOT\nurl : {$url}\nerror : {$info['error']}\nEOT;\n error_log($args, 0);\n }\n }", "public function logError(){\n AbstractLoggedException::$dbMessage .= \"Invalid URI requestd; \";\n parent::log();\n }", "function handle_signin_error($transport) {\n\t\t$this->error->get(MC_INTERR, true);\n\t\t$this->error->get(MC_ERROR, true);\n\n\t\tswitch($transport->faultcode) {\n\t\t\tcase 'soap:UserAuthen':\n\t\t\tcase 'soap:AuthzError':\n\t\t\tcase 'soap:WrongParams':\n\t\t\tcase 'soap:MissingPerson':\n\t\t\tcase 'soap:PersonsDenied':\n\t\t\tcase 'soap:LoginError':\n\t\t\t\t$this->error->add(MC_ERROR, 'LOGIN_INVALID');\n\t\t\tbreak;\n\n\t\t\tcase 'soap:UserDelayed':\n\t\t\t\t$this->error->add(MC_ERROR, 'LOGIN_DELAYED');\n\t\t\tbreak;\n\n\t\t\tcase 'soap:UserFraudError':\n\t\t\t\t$this->error->add(MC_ERROR, null, $transport->faultstring);\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->error->add(MC_ERROR, $transport->faultstring ? null : 'LOGIN_INVALID', $transport->faultstring ? $transport->faultstring : null);\n\t\t\tbreak;\n\t\t}\n\t}", "public function triggerError() {\n $this->_errors = true;\n }", "function actions_init($event, $object_type, $object) {\n \tregister_action(\"error\");\n \treturn true;\n }", "public function isClientError();", "public function logError() {}", "public function error() {\n\t\t$connection = $this -> connect();\n\t\treturn $connection -> error;\n\t}", "function died($error) {\n\t$_SESSION['deletingTwitchError']=$error;\n\techo $error;\n\theader( 'Location: '.redirect('viewtwitch.php'));\n\tdie();\n}", "public function actionError() {\n if ($error = Yii::app()->errorHandler->error) {\n\t\t\t$this->sendRestResponse(500,array(\n\t\t\t\t'status' => false,\n\t\t\t\t'message' => $error['message'],\n\t\t\t\t'data' => $error,\n\t\t\t));\t\t\t\n }\n\t}", "public function setupErrorHandler()\n {\n $this->error_handler = set_error_handler(array($this, 'error_handler'));\n }", "public function handleError($e)\n {\n $code = (int) $e->getCode();\n $message = $e->getMessage();\n if ( !in_array($code, $this->_allowedErrorCodes) && $this->isDebugging ) {\n $code = self::ERROR_UNKNOWN;\n }\n \n $this->_server->fault($message, $code, null);\n \n /*\n * Due to a bug in Zend_Json_Server_Error, we have to modify the error\n * response to make sure the custom error code makes it to the client.\n */\n $badJson = $this->_server->getResponse()->toJson();\n \n $decoded = Zend_Json::decode($badJson);\n if ( isset($decoded['error']) \n && isset($decoded['error']['code']) ) {\n $decoded['error']['code'] = $code;\n }\n \n $json = Zend_Json::encode($decoded);\n \n if ($code == self::ERROR_CREDENTIALS_INVALID \n || $code == self::ERROR_DIGEST_INVALID \n || $code == self::ERROR_DIGEST_MISSING) {\n $this->sendAuthChallengeHeader();\n }\n \n header('Content-Type: application/json');\n if (isset($_GET['d'])) die($_GET['jsoncallback'].\"(\".$json.\")\");\n else die($json);\n }", "public function errorAction()\n {\n $errors = $this->_getParam('error_handler');\n\n switch ($errors->type) {\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n\n // 404 error -- controller or action not found\n $this->getResponse()->setHttpResponseCode(404);\n $this->view->message = 'Page not found';\n break;\n default:\n // Generic application error\n $this->getResponse()->setHttpResponseCode(500);\n $this->view->message = 'Application error';\n break;\n }\n\n $this->view->exception = $errors->exception;\n $this->view->request = $errors->request;\n $this->_response->clearBody();\n }", "public function ses_error_handler( $errno, $errstr, $errfile, $errline, $errcontext ) {\r\n\r\n\t\tif ( ! ( error_reporting() & $errno ) ) { // phpcs:ignore\r\n\t\t\t// This error code is not included in error_reporting,\r\n\t\t\t// so let it fall through to the standard PHP error handler.\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$error = explode( \"\\n\", $errstr );\r\n\r\n\t\t// Record the error essential text.\r\n\t\tDebug::set( $error[0] );\r\n\r\n\t\t// Don't execute PHP internal error handler.\r\n\t\treturn true;\r\n\t}", "function handleError()\n{\n\tglobal $g_error_msg, $g_debug_msg;\n\tinclude_once(atkconfig('atkroot'). 'atk/errors/class.atkerrorhandlerbase.inc');\n\t$errorHandlers = atkconfig('error_handlers', array('mail'=>array('mailto' => atkconfig('mailreport'))));\n\tforeach ($errorHandlers as $key => $value)\n\t{\n\t\tif (is_numeric($key))\n\t\t$key = $value;\n\t\t$errorHandlerObject = atkErrorHandlerBase::get($key, $value);\n\t\t$errorHandlerObject->handle($g_error_msg, $g_debug_msg);\n\t}\n}", "public function fatal_handler()\n {\n $error = error_get_last();\n\n if ($error !== null && is_array($error) && $error['type'] == E_ERROR)\n {\n $settings = require CODE_ROOT . '/src/settings.php';\n $app = new \\Slim\\App($settings);\n\n require CODE_ROOT . '/src/dependencies.php';\n\n $view = $app->getContainer()->get('view');\n\n $logger = $app->getContainer()->get('logger');\n $logger->emergency('An unrecoverable error has ocurred!', $error);\n\n echo $view->fetch('error.twig');\n }\n\n exit;\n }", "function APIerror() {\n\t\t$session = JFactory::getSession();\n\n\t\t$order_id = $session->get('wbtypayments.order_id', 0);\n\n\t\t// Initialize database\n\t\t$db = JFactory::getDBO();\n\n\t\tsession_start();\n\t\t$resArray=$_SESSION['reshash'];\n\n\t\t// Get any URL errors\n\t\tif(isset($_SESSION['curl_error_no'])) {\n\t\t\t$errorCode= $_SESSION['curl_error_no'] ;\n\t\t\t$errorMessage=$_SESSION['curl_error_msg'] ;\n\t\t\tsession_unset();\n\t\t} else {\n\t\t\t// Create a new row in the errors table with this order ID\n\t\t\t$query = \"INSERT INTO #__wbty_payments_errors (`number`,`message`,`order_id`) VALUES ('\".$resArray['L_ERRORCODE0'].\"','\".$resArray['L_LONGMESSAGE0'].\"','$order_id')\";\n\t\t\t$db->setQuery($query);\n\t\t\t$db->query();\n\t\t\t$error_id = $db->insertid();\n\n\t\t\tforeach($resArray as $key => $value) {\n\t\t\t\tswitch ($key) {\n\t\t\t\t\tcase 'L_ERRORCODE0':\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'L_LONGMESSAGE0':\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$query = \"INSERT INTO #__wbty_payments_error_extra_items (`error_id`,`name`,`value`) VALUES ('\".$error_id.\"','\".$key.\"','\".$value.\"')\";\n\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t$db->query();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public function onError(MvcEvent $event)\n {\n $app = $event->getApplication();\n $serviceManager = $app->getServiceManager();\n if ($this->authenticationService->hasIdentity()) {\n $serviceManager->get('ZfcRbac\\View\\Strategy\\UnauthorizedStrategy')->onError($event);\n } else {\n $serviceManager->get('ZfcRbac\\View\\Strategy\\RedirectStrategy')->onError($event);\n }\n }" ]
[ "0.68167263", "0.62676585", "0.62595105", "0.62479335", "0.6154236", "0.61383426", "0.6010534", "0.58959365", "0.58959365", "0.5859031", "0.58250344", "0.58194315", "0.576358", "0.57508874", "0.5703376", "0.56794167", "0.56770444", "0.5670169", "0.5658375", "0.5640785", "0.563124", "0.56224346", "0.55710053", "0.5560725", "0.55436015", "0.5527414", "0.5514083", "0.5494893", "0.5492542", "0.54752696", "0.5467909", "0.5465934", "0.54649305", "0.54640895", "0.54608566", "0.54407364", "0.5417314", "0.54170585", "0.5408462", "0.53987724", "0.5385301", "0.5378352", "0.5372194", "0.53671485", "0.53616863", "0.535816", "0.53486097", "0.53454494", "0.5341542", "0.5338525", "0.5336491", "0.5321948", "0.5321514", "0.531467", "0.53137815", "0.52860904", "0.5283236", "0.52741724", "0.52665854", "0.525061", "0.5250037", "0.5237989", "0.52357125", "0.52353084", "0.5233987", "0.5233987", "0.5232374", "0.5231918", "0.52303994", "0.52112746", "0.5211258", "0.52052784", "0.51985073", "0.5195853", "0.5193851", "0.5191848", "0.5189656", "0.5185009", "0.5177281", "0.5176545", "0.51707816", "0.5170455", "0.51591027", "0.5154389", "0.5154252", "0.5151069", "0.5143741", "0.513865", "0.51348335", "0.5134806", "0.5134537", "0.51259786", "0.5122653", "0.5120905", "0.5120597", "0.51187825", "0.510858", "0.51080716", "0.51075584", "0.5104331" ]
0.58420265
10
function to get category
public function get_category() { $data['get_category'] = $this->Category_model->get_category(); return $data['get_category']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCategory();", "public function getCategory();", "public function getCategory() {}", "public function category() {\n\t\treturn $this->get_category();\n\t}", "public function getCategory()\n {\n }", "public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }", "public function get_category(){\n\t\treturn $this->category;\n\t}", "function the_category() {\n\tglobal $discussion;\n\treturn $discussion['category'];\n}", "public function getCategory()\n\t{\n\t\treturn $this->data['category'];\n\t}", "public function getCategory(): string;", "function getCategory() {\n // Load categories.\n $categories = userpoints_get_categories();\n return isset($categories[$this->getTid()]) ? $categories[$this->getTid()] : $categories[userpoints_get_default_tid()];\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "function category(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT cat_name FROM q_quiz_cat WHERE cat_id = %d\", GetSQLValueString($this->fk_quiz_cat, \"int\"));\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\treturn $row_getQuery['cat_name'];\n\t}", "function getCategory()\r\n\t\t{\r\n\t\t\treturn $this->category;\r\n\t\t\t\r\n\t\t}", "public static function getCategory()\n {\n return self::$category;\n }", "function getCategory() \n {\n return $this->instance->getCategory();\n }", "public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "function get_Category()\n {\n try {\n return $this->mCategory;\n }catch(Exception $e){\n $this->error->throwException('303', 'No s`ha pogut retornar la informació', $e);\n }\n }", "public function getCat()\n {\n $query = $this->db->get('categories');\n\n return $query->result();\n }", "function getCategory() {\n\t\t$categoryId = JRequest::getInt('category_id', 0) ;\n\t\t$sql = 'SELECT * FROM #__eb_categories WHERE id='.$categoryId;\n\t\t$this->_db->setQuery($sql) ;\n\t\treturn $this->_db->loadObject();\t\t\t\n\t}", "public function getCategory($name);", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}", "public function getCategory(){\n return $this->category;\n }", "public function get_category(){\n\t\t$this->load->model('seller/product_model');\n\t\t$category = $this->product_model->get_category();\n\t\treturn $category;\n\t}", "public function getCategory() {\n return $this->category;\n }", "public function getCategory()\n\t{\n\t\treturn $this->category;\n\t}", "private function getCategory() {\n return '';\n }", "public function getCategory()\n {\n return $this->_category;\n }", "public function get_category()\n {\n return $this->primary_category();\n }", "public function getCategory() {\n return $this->category;\n }", "function category()\n\t{\n\n\t\t//$CI =& get_instance();\n\t\t$this->load->model('shop/categories_m');\n\n\t\t$id = $this->attribute('id', '');\n\t\t$field = $this->attribute('field', '');\n\n\t\t$category = $this->categories_m->get( $id );\n\t\n\n\t\tif($category)\n\t\t{\n\t\t\tif($field != '')\n\t\t\t{\n\t\t\t\treturn array('result' => $category->$field );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn (array) $category;\n\t\t\t}\n\t\t}\n\n\t\treturn array('result' => '');\n\n\t}", "public function getCategory() {\n\t\treturn $this->category;\n\t}", "private function getCategory()\n {\n $catobj = (object)Array();\n $catobj->preview = $this->getFilePath('preview');\n $catobj->category = $this->category_number;\n $catobj->html = $this->getContent();\n $catobj->googleFonts = [];\n $catobj->contentCss = $this->getFilePath('relative_css');\n $catobj->contentClass = $this->getCSSClass($this->getFilePath('css'));\n return $catobj;\n }", "public function getCategory()\n {\n\n return $this->category;\n }", "public function GetCategory()\r\n {\r\n return AppHelper::GetCategory($this->Core);\r\n }", "public function getCategories();", "public function getCategories();", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory(){\r\n return Mage::registry('current_category');\r\n }", "public function getViewedCategory();", "function get_catname($cat_id)\n {\n }", "public function get_category()\n {\n return 'Graphical';\n }", "public function get_category()\n {\n return 'Graphical';\n }", "function get_cat() {\r\n \r\n $query = $this->db->get('categories');\r\n return $query->result_array();\r\n }", "public function getProduct_category () {\n\t$preValue = $this->preGetValue(\"product_category\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_category\")->preGetData($this);\n\treturn $data;\n}", "public function getCat()\n {\n return $this->cat = get_the_category($this->id);\n }", "public function getCategory(): string|null;", "public function get_categorie(){\n\t\treturn $this->search_categorie;\n\t}", "public function getCategoryId();", "function get_cat_name($cat_id)\n {\n }", "private function getCategory() {\n\n $category = Category::with('records');\n /**\n * Filter slug\n */\n $category = Category::where('slug', $this->property('categorySlug'));\n\n /**\n * Filter active only\n */\n if( $this->property('activeOnly') ) {\n $category->isActive();\n }\n\n $categoryDetail = $category->first();\n\n return $categoryDetail;\n\n }", "public function get_category_permastruct()\n {\n }", "public function getCategory()\n {\n return \"Injection Flaws\"; //See category.php for list of all the categories\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 getCategoria()\n {\n return $this->categoria;\n }", "public function getCategoria()\n {\n return $this->categoria;\n }", "public function getCategorie()\n {\n return $this->categorie;\n }", "function getCategory(){\n\t\t\t$data = array(); \n\t\t\t$query = \"select * from packages_category\";\n\t\t\t$result = mysql_query($query);\n\t\t \n\t\t\tif($result){\n\t\t\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\t\tarray_push($data,$row);\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t}else{\n\t\t\t\tdie(\"error in mysql query \" . mysql_error());\n\t\t\t}\n\t\t}", "function get_category_by_id($cate_id) {\n App::import(\"Model\", \"Category\");\n $model = new Category();\n $categoryInfo = $model->findById($cate_id);\n return (!empty($categoryInfo['Category']['title']))?$categoryInfo['Category']['title']:\"\";\n }", "function get_category_by_id($cate_id) {\n App::import(\"Model\", \"Category\");\n $model = new Category();\n $categoryInfo = $model->findById($cate_id);\n return $categoryInfo['Category']['title'];\n }", "public function getCategory(): ?string;", "public function get_category()\n\t{\n\t\tglobal $module_name, $nv_Cache;\n\n\t\t$category = array();\n\n\t\t$sql = \"SELECT * FROM \" . $this->table_prefix . \"_category ORDER BY weight ASC\";\n\t\t$result = $this->db_cache( $sql, 'id', $module_name );\n\n\t\t$category[0] = array(\n\t\t\t'id' => 0,\n\t\t\t'title' => $this->lang('unknow'),\n\t\t\t'keywords' => '',\n\t\t\t'description' => ''\n\t\t);\n\n\t\tif( ! empty( $result ) )\n\t\t{\n\t\t\tforeach( $result as $row )\n\t\t\t{\n\t\t\t\t$category[$row['id']] = array(\n\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t'title' => $row['title'],\n\t\t\t\t\t'keywords' => $row['keywords'],\n\t\t\t\t\t'description' => $row['description']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $category;\n\t}", "public function get_category()\n {\n return 'Information Display';\n }", "function get_categoria($id){\t\n\t\t$sql=\"SELECT nombre_cat FROM categoria WHERE id_cat='$id'\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t$resultado=mysql_fetch_array($consulta);\n\n\t\treturn $resultado['nombre_cat'];\n\t}", "function getCategory()\n\t{\n\t\t//global $catarray;\n\t\t$getcat=array();\n\t\tinclude(\"config.php\");\n\t\tglobal $conn, $stmt;\n\t\t$stmt=$conn->prepare(\"SELECT name FROM category\");\n\t\t$stmt->bind_result($name);\n\t\t$stmt->execute();\n\t\twhile($stmt->fetch())\n\t\t{\n\t\t\tarray_push($getcat,array(\"name\"=>$name));\n\t\t}\n\t\treturn $getcat;\n\t}", "public function get_category($key = 0)\n {\n }", "public function get_category($key = 0)\n {\n }", "public function get_category($key = 0)\n {\n }", "function article_category() {\n $category = Registry::get('category');\n return $category->title;\n}", "public function category() {\n\t\treturn static::get_thrive_basic_label();\n\t}", "public function getCategoria()\n {\n return $this->categoria;\n }", "public function getCategory() {\r\n return \\models\\Database::validateData($this->_category, 'string|specialchars|strip_tags');\r\n }", "public function getCategory() {\n return $this->randomQuote->category_name;\n }", "public function findCategories();", "function &getCategory($index) {\n\t\treturn $this->domit_rss_categories[$index];\n\t}", "function &getCategory($index) {\n\t\treturn $this->domit_rss_categories[$index];\n\t}", "public function getCategory()\n {\n return $this->readOneof(2);\n }", "public function getCategory($id){\n $category = Product::find($id)->category_id;\n return $category;\n }", "function getCategoryNameById($id = null){\n\t}", "function get_cat_ID($cat_name)\n {\n }" ]
[ "0.8412069", "0.8412069", "0.83770454", "0.8022635", "0.7941426", "0.7889097", "0.7808731", "0.77566826", "0.77459335", "0.77339804", "0.7683892", "0.76803803", "0.76803803", "0.76803803", "0.7636858", "0.7635879", "0.7618767", "0.7604141", "0.7569231", "0.75404495", "0.75404495", "0.7538859", "0.75350475", "0.75337493", "0.752573", "0.75051135", "0.75051135", "0.75051135", "0.75051135", "0.75051135", "0.75051135", "0.75051135", "0.75051135", "0.75051135", "0.75051135", "0.75051135", "0.75051135", "0.75051135", "0.75051135", "0.75051135", "0.75051135", "0.7468724", "0.7462186", "0.74571604", "0.7450573", "0.74273396", "0.7426166", "0.7421567", "0.7359711", "0.7334746", "0.7334186", "0.73187494", "0.7302603", "0.7300811", "0.72976464", "0.7296481", "0.7296481", "0.7292755", "0.72916466", "0.72507477", "0.7248262", "0.72431946", "0.72431946", "0.72124505", "0.7200833", "0.7195073", "0.71713084", "0.71669334", "0.71588844", "0.7143523", "0.71361387", "0.7119933", "0.7119108", "0.71111935", "0.7092172", "0.7092172", "0.7086907", "0.70759726", "0.70737046", "0.70713484", "0.70613647", "0.7055823", "0.7054833", "0.70531917", "0.7048234", "0.7042982", "0.7042982", "0.7042071", "0.70378304", "0.70233256", "0.7019129", "0.70106715", "0.7003859", "0.69952357", "0.699006", "0.699006", "0.69849426", "0.69795823", "0.6970456", "0.6964974" ]
0.75747603
18
function to update category
public function update_category() { $category_id = $_GET['category_id']; $data['category_branch_location'] = $this->get_branch_location(); $data['update_category'] = $this->Category_crud->get_category_by_id($category_id); $this->load->view('restaurant/category/update_category', $data); if (isset($_POST['save_update_category'])) { $imagename = $_FILES['category_image_upload']['name']; if (!empty($imagename)) { $config['upload_path'] = "assets/lib/images/category/"; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->load->library('upload', $config); $this->upload->initialize($config); if (!$this->upload->do_upload('category_image_upload')) { $error = array('error' => $this->upload->display_errors()); } else { $success = array('image_metadata' => $this->upload->data()); } $update_category = array( 'ar_name' => $_POST['category_ar_name'], 'en_name' => $_POST['category_en_name'], 'discount' => $_POST['category_discount'], 'image' => $imagename ); $this->Category_crud->update_category_information($category_id, $update_category); redirect(rest_path('Category')); } else { $update_category = array( 'ar_name' => $_POST['category_ar_name'], 'en_name' => $_POST['category_en_name'], 'discount' => $_POST['category_discount'], 'image' => $_POST['category_image'] ); $this->Category_crud->update_category_information($category_id, $update_category); redirect(rest_path('Category')); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }", "function wp_update_category($catarr)\n {\n }", "function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }", "function update_category_cache()\n {\n }", "public function updateCate()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['upcategory'];\n\t\t\t$category_id = $_POST['upcategory_id'];\n\t\t\t$sql = \" update lib_book_species set category = '{$category}' where category in \n\t\t\t\t\t(select category from lib_category where category_id = {$category_id});\n\t\t\t\t\tupdate lib_category set category='\" . $category . \"' where category_id='\" . $category_id . \"';\n\t\t\t\t\t\";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Modify successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function testUpdateCategoryUsingPUT()\n {\n }", "public function updateCategories()\n {\n $this->updateCategoriesByType();\n $this->updateCategoriesByParent();\n $this->updateCategoriesByID();\n }", "public function updated(Category $category)\n {\n //\n }", "public function update_category(){\n $query = \"UPDATE {$this->table} SET cat_title = :cat_title WHERE {$this->table}.cat_id = :cat_id\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_title',$this->cat_title);\n $stmt->bindParam(':cat_id',$this->cat_id);\n $stmt->execute();\n return $stmt;\n }", "public function testUpdateItemSubCategory()\n {\n }", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}", "function update_category($category_id)\n {\n $this->db->update('tbl_category',$this, array('category_id'=>$category_id));\n }", "public function updated(Category $category)\n {\n //\n }", "public function updateCategory(){\n\t\t \n\t\t$file_id = $this->category_model->updateCategory($_POST['id'],$_POST['name']);\n\t\t echo $file_id;\n\t\t\t\t\n }", "public function update_category ($data) {\n\t\t$slug = \\Illuminate\\Support\\Str::slug($data->category, '-');\n\t\t$category = Category::find($data->category_id);\n\t\t$category->category = $data->category;\n\t\t$category->slug = $slug;\n\t\t$category->description = $data->description;\n\n\t\t$category->save();\n\t\treturn true;\n\t}", "function update_category_detail($siteData, $category_id) {\n $this->db->where('id', $category_id);\n $this->db->update('category', $siteData);\n }", "public function update()\n {\n $category = CategoryService::load(\\Request::input('id'))->update(\\Request::all());\n \\Msg::success($category->name . ' has been <strong>updated</strong>');\n return redir('account/categories');\n }", "function fm_update_category($name, $catid = NULL, $groupid = 0) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($catid != NULL) {\r\n\t\t$update->id = $catid;\r\n\t\t$update->name = $name;\r\n\t\t$update->timemodified = time();\r\n\t\tif (!update_record('fmanager_categories', $update)) {\r\n\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\t$new->name = $name;\r\n\t\tif ($groupid == 0){\r\n\t\t\t$new->owner = $USER->id;\r\n\t\t\t$new->ownertype = OWNERISUSER;\r\n\t\t} else {\r\n\t\t\t$new->owner = $groupid;\r\n\t\t\t$new->ownertype = OWNERISGROUP;\r\n\t\t}\r\n\t\t$new->timemodified = time();\r\n\t\tif (!insert_record('fmanager_categories', $new)) {\r\n\t\t\terror(get_string(\"errnoinsert\",'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "function update_category_detail($siteData,$category_id)\n\t{\n\t\t$this->db->where('id', $category_id);\n\t\t$this->db->update('category', $siteData); \n\t\t\n\t}", "function saveCat()\n {\n //update stuff\n }", "public function update(Request $request ,Category $update){\n $update -> category_name_en = $request -> blog_category_name_en;\n $update -> category_name_lng = $request -> blog_category_name_lng;\n $update -> category_name_en_slug = strtolower(str_replace(' ' , '-' , $request -> blog_category_name_en));\n $update -> category_name_lng_slug = str_replace(' ' , '-' , $request -> blog_category_name_lng);\n $update -> update();\n return true;\n }", "function setCategory($id, $category){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//category value of a question in the database\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Accepts 2 parameters, the question ID value, and the new value (int)\r\n\t\t$query= \"UPDATE `tbl_question` SET `category` = '$category' WHERE `tbl_question`.`question_id` =$id LIMIT 1 ;\";\r\n\t\t$result = $this->mdb2->query($query) or die('An unknown error occurred while updating the data');\r\n\t\tif(MDB2::isError($result)){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\t\r\n\t}", "protected function updateCategory($req){\n if(!empty($req['parent_id'])){\n $parent_id = $req['parent_id'];\n }else{\n $parent_id=\"0\";\n }\n if(isset($req['cat_image']) && !isset($req['banner_image'])){\n $cat_image_path=public_path('category_images/Normal');\n $sort = $req['sort'];\n $cat_file_name=$this->fileUploading($cat_image_path,$req['cat_image']);\n $category=array('name'=>$req['name'],\n 'description'=>$req['desc'],\n 'parent_id'=>$parent_id,\n 'thumb_image'=>$cat_file_name,\n 'sort_order' => $sort,\n 'updated_at'=>date('Y-m-d H:i:s'));\n \n }\n else if(isset($req['banner_image']) && !isset($req['cat_image'])){\n $cat_banner_image=public_path('category_images/Banner');\n $banner_file_name=$this->fileUploading($cat_banner_image,$req['banner_image']);\n $sort = $req['sort'];\n $category=array('name'=>$req['name'],\n 'description'=>$req['desc'],\n 'parent_id'=>$parent_id,\n 'banner_image'=> $banner_file_name,\n 'sort_order' => $sort,\n 'updated_at'=>date('Y-m-d H:i:s'));\n }\n else if(isset($req['banner_image']) && isset($req['cat_image'])){\n $cat_image_path=public_path('category_images/Normal');\n $cat_file_name=$this->fileUploading($cat_image_path,$req['cat_image']);\n $sort = $req['sort'];\n $cat_banner_image=public_path('category_images/Banner');\n $banner_file_name=$this->fileUploading($cat_banner_image,$req['banner_image']);\n $category=array('name'=>$req['name'],\n 'description'=>$req['desc'],\n 'parent_id'=>$parent_id,\n 'thumb_image'=>$cat_file_name,\n 'banner_image'=> $banner_file_name,\n 'sort_order' => $sort,\n 'updated_at'=>date('Y-m-d H:i:s'));\n }else{\n $category=array('name'=>$req['name'],\n 'description'=>$req['desc'],\n 'parent_id'=>$parent_id,\n 'sort_order' => $req['sort'],\n 'updated_at'=>date('Y-m-d H:i:s'));\n }\n \n \n if($parent_id != \"0\"){\n $attribute_subcat_id = \"\";\n if($parent_id == 147){\n $attribute_subcat_id = 25;\n }elseif ($parent_id == 143) {\n $attribute_subcat_id = 26;\n }elseif ($parent_id == 78) {\n $attribute_subcat_id = 28;\n }\n $attr_arr=array(\n 'attribute_id'=>$attribute_subcat_id,\n 'option_value'=> $req['name'],\n );\n\n $isAttrExist = DB::table('attribute_options')->where('option_value', $req['name'])->first();\n if(!$isAttrExist){\n $cosplay_yes_insert=DB::table('attribute_options')->insert($attr_arr);\n }\n } \n \n $cond = array('category_id'=>$req['category_id']);\n Site_model::update_data('category',$category,$cond);\n \n if(isset($req['costume_list']) && $parent_id!=\"0\"){\n Site_model::delete_single('costume_to_category',$cond);\n foreach(array_unique($req['costume_list']) as $key=>$value){\n DB::table('costume_to_category')\n ->where('costume_id', $value)\n ->where('category_id', '!=', $req['category_id'])\n ->delete();\n $category_coustume=array('costume_id'=>$value,\n 'category_id'=>$req['category_id'],\n 'sort_no'=>$key,\n );\n Site_model::insert_get_id('costume_to_category',$category_coustume);\n }\n }\n $this->urlRewrites($req['category_id'],\"update\",$req['old_category'],$req['name'],$req['elements_change']);\n return true;\n }", "public function categories_update($param = null)\r\n {\r\n if (isset($_POST[\"cat_id\"]) && !empty($_POST[\"cat_id\"])) {\r\n $action = $_POST[\"cat_id\"];\r\n $newValue = $_POST[\"cat_descr\"];\r\n $update = Category::find($action)->update(['cat_descr' => $newValue]);\r\n echo $update;\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "public function updateCategory(array $data, int $id): void\n {\n }", "private function update($cat){\r\n\t\tif(!$this->acceptUpdates) return;//do not allow health coach to change answers\r\n\t\tif(!isset($this->categories[$cat])) throw new Exception(\"Invalid category\");\r\n\r\n\t\t$sql=\"UPDATE `u_mod_ifocus` SET \";\r\n\t\t$comma=false;\r\n\t\tforeach($this->data[$cat] as $key=>$value){\r\n\t\t\tif($comma) $sql.=\" , \";\r\n\t\t\t$sql.=\"`\".$key.\"`='\".$this->dbOb->escape_string($value).\"'\";\r\n\t\t\t$comma=true;\r\n\t\t}\r\n\t\tif(!$comma) return; //cant update a section we have no data for\r\n\t\tif(!$this->id) return; //can't update a record we haven't loaded\r\n\r\n\t\t$sql .= \", last_completed = '\" . $cat . \"'\";\r\n\r\n\t\tif($cat==\"biometric_data\"){\r\n\t\t\tif(!$this->isCompleted()) $sql.=\", date_completed=NOW() \";\r\n\t\t\t//upon completion reward points for Health Assessment Questions\r\n\t\t\t$im=new IncentivePointsModel();\r\n\t\t\tif($this->data[\"preventative_health\"][\"q12\"]==1){\r\n\t\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"FluShot\");\r\n\t\t\t}\r\n\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"Complete\");\r\n\t\t}\r\n\r\n\t\t$sql .= \" ,date_updated=NOW() WHERE id = '\" . $this->data['id'] . \"'\";\r\n\t\t$this->dbOb->update($sql);\r\n\t}", "public function category_update(){ \n\n\n if (!has_role($this->session->userdata('user_id'), 'CATEGORY_UPDATE')) {\n redirect(base_url('page_not_found'));\n }\n\n $data['parent'] = $this->input->post('parent');\n $data['last_modified'] = date(\"Y-m-d H:i:s\");\n $data['name'] = $this->input->post('name');\n \n if(!$this->category_model->is_parent_category($data['parent'])){\n\n $this->session->set_flashdata('category_save_failed', \"Failed to update sub category!!\");\n }else{\n\n \n $category_id = $this->input->post('cat_id');\n\n\n\n\n if($this->category_model->update_category($category_id, $data)){\n\n $this->logger\n ->user($this->session->userdata('user_id')) //Set UserID, who created this Action\n ->user_details($this->user_model->getUserInfoByIpAddress())\n ->type('category_update') //Entry type like, Post, Page, Entry\n ->id($category_id) //Entry ID\n ->token('UPDATE') //Token identify Action\n ->comment($this->session->userdata('name'). ' update a category.')\n ->log(); //Add Database Entry\n\n $this->session->set_flashdata('category_save_success', \"Category information Updated Successfully!!\");\n } else {\n $this->session->set_flashdata('category_save_failed', \"Category update fialied!!\");\n }\n }\n redirect(base_url('categories'));\n }", "public function update_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n //category id\n $id = $this->input->post('category_id', true);\n if ($this->gallery_category_model->update_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_updated\"));\n redirect('admin_category/gallery_categories');\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }", "public static function updateCategory($a_obj)\n\t{\n\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarCategory.php');\n\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarAppointmentColors.php');\n\t\t\n\t\tif($cat = ilCalendarCategory::_getInstanceByObjId($a_obj->getId()))\n\t\t{\n\t\t\t$cat->setTitle($a_obj->getTitle());\n\t\t\t$cat->update();\n\t\t}\n\t\treturn true;\n\t}", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "function multi_entry_category_update()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ($this->input->get_post('entry_ids') === FALSE OR $this->input->get_post('type') === FALSE)\n\t\t{\n\t\t\treturn $this->dsp->no_access_message($this->lang->line('unauthorized_to_edit'));\n\t\t}\n\n\t\tif ($this->input->get_post('category') === FALSE OR ! is_array($_POST['category']) OR count($_POST['category']) == 0)\n\t\t{\n\t\t\treturn $this->output->show_user_error('submission', $this->lang->line('no_categories_selected'));\n\t\t}\n\n\t\t/** ---------------------------------\n\t\t/**\t Fetch categories\n\t\t/** ---------------------------------*/\n\n\t\t// We do this first so we can destroy the category index from\n\t\t// the $_POST array since we use a separate table to store categories in\n\t\t\n\t\t$this->api->instantiate('channel_categories');\n\n\t\tforeach ($_POST['category'] as $cat_id)\n\t\t{\n\t\t\t$this->api_channel_categories->cat_parents[] = $cat_id;\n\t\t}\n\n\t\tif ($this->api_channel_categories->assign_cat_parent == TRUE)\n\t\t{\n\t\t\t$this->api_channel_categories->fetch_category_parents($_POST['category']);\n\t\t}\n\n\t\t$this->api_channel_categories->cat_parents = array_unique($this->api_channel_categories->cat_parents);\n\n\t\tsort($this->api_channel_categories->cat_parents);\n\n\t\tunset($_POST['category']);\n\n\t\t$ids = array();\n\n\t\tforeach (explode('|', $_POST['entry_ids']) as $entry_id)\n\t\t{\n\t\t\t$ids[] = $this->db->escape_str($entry_id);\n\t\t}\n\n\t\tunset($_POST['entry_ids']);\n\n\t\t$entries_string = implode(\"','\", $ids);\n\n\t\t/** -----------------------------\n\t\t/**\t Get Category Group IDs\n\t\t/** -----------------------------*/\n\t\t$query = $this->db->query(\"SELECT DISTINCT exp_channels.cat_group FROM exp_channels, exp_channel_titles\n\t\t\t\t\t\t\t WHERE exp_channel_titles.channel_id = exp_channels.channel_id\n\t\t\t\t\t\t\t AND exp_channel_titles.entry_id IN ('\".$entries_string.\"')\");\n\n\t\t$valid = 'n';\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$valid = 'y';\n\t\t\t$last = explode('|', $query->row('cat_group') );\n\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$valid_cats = array_intersect($last, explode('|', $row['cat_group']));\n\n\t\t\t\tif (count($valid_cats) == 0)\n\t\t\t\t{\n\t\t\t\t\t$valid = 'n';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($valid == 'n')\n\t\t{\n\t\t\treturn $this->dsp->show_user_error($this->lang->line('no_category_group_match'));\n\t\t}\n\n\t\t/** -----------------------------\n\t\t/**\t Remove Valid Cats, Then Add...\n\t\t/** -----------------------------*/\n\n\t\t$valid_cat_ids = array();\n\t\t$query = $this->db->query(\"SELECT cat_id FROM exp_categories\n\t\t\t\t\t\t\t WHERE group_id IN ('\".implode(\"','\", $valid_cats).\"')\n\t\t\t\t\t\t\t AND cat_id IN ('\".implode(\"','\", $this->api_channel_categories->cat_parents).\"')\");\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM exp_category_posts WHERE cat_id = \".$row['cat_id'].\" AND entry_id IN ('\".$entries_string.\"')\");\n\t\t\t\t$valid_cat_ids[] = $row['cat_id'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->input->get_post('type') == 'add')\n\t\t{\n\t\t\t$insert_cats = array_intersect($this->api_channel_categories->cat_parents, $valid_cat_ids);\n\t\t\t// How brutish...\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t\tforeach($insert_cats as $val)\n\t\t\t\t{\n\t\t\t\t\t$this->db->query($this->db->insert_string('exp_category_posts', array('entry_id' => $id, 'cat_id' => $val)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t/** ---------------------------------\n\t\t/**\t Clear caches if needed\n\t\t/** ---------------------------------*/\n\n\t\tif ($this->config->item('new_posts_clear_caches') == 'y')\n\t\t{\n\t\t\t$this->functions->clear_caching('all');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->functions->clear_caching('sql');\n\t\t}\n\t\t\n\t\t$this->session->set_flashdata('message_success', $this->lang->line('multi_entries_updated'));\n\t\t$this->functions->redirect(BASE.AMP.'C=content_edit');\n\t}", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function UpdateCategory($_category)\n\t\t{\n\t\t\t$query = \"update categories set \";\n\t\t\t$query .= \"categoryname = '\" . $this->CheckString($_category->getCategoryName()) . \"', \";\n\t\t\t$query .= \"parentcategoryid = \" . $_category->getParentCategoryID() . \", \";\n\t\t\t$query .= \"filtered = \" . $this->CheckBoolean($_category->getFiltered()) . \" , \";\n\t\t\t$query .= \"displayorder = \" . $_category->getDisplayOrder() . \" \";\n\t\t\t$query .= \" where categoryid = \" . $_category->getCategoryID();\n\t\t\treturn $query;\n\t\t}", "public function update(){\n $service_category = new OsServiceCategoryModel($this->params['service_category']['id']);\n $service_category->set_data($this->params['service_category']);\n if($service_category->save()){\n $response_html = __('Service Category Updated. ID: ', 'latepoint') . $service_category->id;\n $status = LATEPOINT_STATUS_SUCCESS;\n }else{\n $response_html = $service_category->get_error_messages();\n $status = LATEPOINT_STATUS_ERROR;\n }\n if($this->get_return_format() == 'json'){\n $this->send_json(array('status' => $status, 'message' => $response_html));\n }\n }", "public function update(StoreCategory $request)\n {\n\n //get request\n $param = $request->toArray();\n\n //format category key => value\n $param['sort'] = $param['sort'] == null ? 50 : $param['sort'];\n $param['photo'] = $param['photo'] == null ? \"/static/boot/img/no_img.jpg\" : $param['photo'];\n $param['status'] = empty($param['status']) ? 0 : 1;\n\n //create category key => value\n $Category = Category::find($param['id']);\n\n //save category\n if ($Category->update($param)) {\n\n return response()->json(['success' => true, 'url' => route('category-index')]);\n }\n }", "function setIssueCategory( $sessionID, $issueID, $category ) {\r\n\t\tif($this->userCanSetIssueCategory( $sessionID, $issueID )){\r\n\t \t\t$userID = $_SESSION[ 'userid' ];\r\n\t\t\t$this->sendIssueAlerts($issueID, 'Issue level changed.');\r\n\t\t\t$query=\"UPDATE issues SET Modifier='$userID', Category='$category' WHERE ID='$issueID'\";\r\n\t\t\t$result=mysql_query($query);\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t}", "public function update()\n\t{\n\t\t$input = \\Input::all();\n\n\t\t$category = Category::findOrFail($input.id);\n\n\t\tif($category){\n\t\t\t$category->name = $input.name;\n\t\t\t$result = $category->save();\n\t\t}\n\n\t\tif($result){\n\t\t\treturn \"true\";\n\t\t}\n\t\treturn \"false\";\n\t}", "function update_category($catid, $catname) {\r\n\r\n $conn = db_connect();\r\n\r\n $query = \"update categories\r\n set catname='\".$catname.\"'\r\n where catid='\".$catid.\"'\";\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\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 }", "public function UpdatePost_Category(Request $request){\n $postId = Post::query()->find($request->postID);\n $postId->categories()->detach($request->OldcategoryId);\n $postId->categories()->attach($request->categoryId); \n\n }", "public function update()\n {\n $model = $this->model()::findOrFail(request('_id'));\n $data = array_merge(request()->all(), ['slug' => request('name')]);\n $category = $model->update($data);\n return redirect()->route('admin.'.$this->table().'.index');\n }", "public function update(categoryRequest $request, Category $category)\n {\n $image = $request->file('img');\n\n if ( $image != null ){\n //new image upload\n $image = $this->fileHandler->fileUploadedBackend($request->file('img'),$this->storeName,'img');\n $request['image'] = $image;\n // old image unlink\n if($request->oldImg = null){\n $this->fileHandler->imageDeleteBackend($request->oldImg,$this->storeName);\n }\n \n }\n\n $request['slug'] = strtolower(str_replace(' ', '-', $request->name));\n $request['status'] = ($request->status)?1:0;\n $update = $category->update($request->all());\n if($update){\n return Redirect::route('category.index')->with('success','Category Updated Successfully.');\n }else{\n return Redirect::route('category.index')->with('warning','Category could not be update.');\n }\n }", "public static function updateCategory($data, $id)\n {\n \t$query = \"UPDATE categories SET name = :name WHERE id = :id\";\n \t$result = DB::update($query, ['name' => $data->name, 'id' => $id]);\n\n \treturn $result;\n }", "function fm_update_folders_cats($catid) {\r\n\t// Changes all associated links to deleted cat to 0\r\n\tif ($linkcats = get_records('fmanager_folders', \"category\", $catid)) {\r\n\t\tforeach ($linkcats as $lc) {\t\t\r\n\t\t\t$lc->category = 0;\r\n\t\t\tif (!update_record('fmanager_folders', $lc)) {\r\n\t\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function fm_update_links_cats($catid) {\r\n\t// Changes all associated links to deleted cat to 0\r\n\tif ($linkcats = get_records('fmanager_link', \"category\", $catid)) {\r\n\t\tforeach ($linkcats as $lc) {\t\t\r\n\t\t\t$lc->category = 0;\r\n\t\t\tif (!update_record('fmanager_link', $lc)) {\r\n\t\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "public function setCategory() {\n /**\n *\n * @todo make a separate config file for the default category ?!\n */\n $defaultCategory = 1;\n $category = Category::find()->all();\n $newCat = $this->strProcessing($this->category);\n $k = NULL;\n if (!empty($newCat)) {\n foreach ($category as $value) {\n $cat = explode(',', $value['synonyms']);\n $cat = array_map(array($this, 'strProcessing'), $cat);\n $k = array_search($newCat, $cat);\n if ($k !== NULL && $k !== FALSE) {\n $k = $value['id'];\n break;\n }\n }\n }\n if ($k) {\n $this->category = $k;\n } else {\n $this->category = $defaultCategory;\n }\n return TRUE;\n }", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "public function editCategory()\r\n{\r\n $query_string = \"UPDATE categories \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"categoryname = :categoryname, \";\r\n $query_string .= \"categorydescription = :categorydescription \";\r\n $query_string .= \"WHERE categoryid = :categoryid\";\r\n\r\n return $query_string;\r\n}", "public function run_change_cat($cat,$id){\n\n\t\t$sql = \"UPDATE `categories` SET `cat` = '$cat' WHERE `id` = $id\";\n\n\t\t\t$this->query($sql);\n\t}", "public function update(Request $request, category $category)\n {\n $categoryCheck = category::where('categoryname', $request->categoryname)->first();\n\n if ($categoryCheck == null) {\n category::where('id', $category->id)\n ->update(['categoryname' => $request->categoryname]);\n\n $request->session()->flash('info', 'Update category Success fully');\n return redirect()->action('CategoryController@index');\n } else {\n if ($categoryCheck->id == $category->id) {\n category::where('id', $category->id)\n ->update(['categoryname' => $request->categoryname]);\n\n $request->session()->flash('info', 'Update category Success fully');\n return redirect()->action('CategoryController@index');\n\n }\n $request->session()->flash('danger', 'category has already exit');\n return redirect()->action('CategoryController@index');\n }\n }", "function modifyCategory()\n{\n global $connection;\n global $updateCategorySuccess, $updateCategoryError;\n $updateCategorySuccess = $updateCategoryError = '';\n\n if (isset($_POST['btn_save_category'])) {\n $category_id = $_POST['txt_userid'];\n\n $updateColumncategory = '';\n\n $category_name = htmlentities($_POST['category_name']);\n if (!empty($category_name)) {\n $updateColumncategory .= \"category = '$category_name',\";\n }\n\n $updateColumncategory = rtrim($updateColumncategory, ',');\n\n $query_update = \"UPDATE product_category SET $updateColumncategory WHERE id_category = '$category_id'\";\n $result_update = mysqli_query($connection, $query_update);\n\n if ($result_update) {\n $updateCategorySuccess = '<script language=\"javascript\">\n swal(\"Sukses!\", \"Kategoria u modifikua me sukses!\", \"success\")\n </script>';\n } else {\n $updateCategoryError = '<script language=\"javascript\">\n swal(\"Gabim!\", \"Ka ndodhur një gabim gjatë modifikimit të kategorisë! Provoni përsëri!\", \"error\")\n </script>';\n }\n }\n}", "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 update_category($id)\n\t{\n\t\t$config = array(\n 'upload_path' => \"uploads/category/\",\n 'upload_url' => base_url() . \"uploads/category/\",\n 'allowed_types' => \"gif|jpg|png|jpeg\"\n );\n\n $this->load->library('upload', $config);\n $category_name=ucwords(strtolower($this->input->post('category_name')));\n if($this->upload->do_upload('userfile')) {\n\n $data['userfile'] = $this->upload->data();\n $filename = $data['userfile']['file_name'];\n\t\t \n $datalist = array( \n 'category_img' => base_url().'uploads/category/'.$filename, \n 'meta_keyword' => $this->input->post('meta_keyword'),\n 'meta_description' => $this->input->post('meta_description'),\n 'category_name'=> $this->input->post('category_name'),\n\t\t\t\t'category_description'=> $this->input->post('category_description'), \n 'category_slug' => $this->input->post('category_slug'),\n 'status'=>$this->input->post('status'), \n );\n }else{\n $datalist = array( \n 'meta_keyword' => $this->input->post('meta_keyword'),\n 'meta_description' => $this->input->post('meta_description'),\n 'category_name'=> $this->input->post('category_name'),\n\t\t\t\t'category_description'=> $this->input->post('category_description'), \n 'category_slug' => $this->input->post('category_slug'),\n 'status'=>$this->input->post('status'),\n );\n } \n\n $query= $this->General_model->show_data_id('categories',$id,'category_Id','update',$datalist);\n $this->session->set_flashdata('success', 'Product category Updated successfully.');\n redirect('superpanel/categorie');\n\t}", "public function published_category($category_id){\n \n DB::table('tbl_category')\n ->where('category_id', $category_id)\n ->update(['publication_status' => 1]); \n return Redirect::to('/manage-category');\n }", "public function update_cat_att()\n\t\t{\n\t\t\t$id=$this->input->post('cat_id');\n\t\t\t$cat_name=$this->input->post('cat_edit_name');\n\t\t\t$update=$this->db->where(\"f_att_id\",$id)->update('food_attribute',array(\"f_att_name\"=>$cat_name));\n\t\t\tif($update)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t}", "public function setUpdateCategory(?UpdateCategory $value): void {\n $this->getBackingStore()->set('updateCategory', $value);\n }", "function pnAddressBook_admin_updatecategories() {\r\n\r\n\t$output = new pnHTML();\r\n\r\n // Security check\r\n if (!pnSecAuthAction(0, 'pnAddressBook::', '::', ACCESS_ADMIN)) {\r\n $output->Text(pnVarPrepHTMLDisplay(_PNADDRESSBOOK_NOAUTH));\r\n $output->Text(pnAddressBook_themetable('end'));\r\n\t\treturn $output->GetOutput();\r\n }\r\n\r\n\tlist($id,$del,$name,$newname) = pnVarCleanFromInput('id','del','name','newname');\r\n\tif(is_array($del)) {\r\n $dels = implode(',',$del);\r\n }\r\n\r\n\t$modID = $modName = array();\r\n\r\n\tif(isset($id)) {\r\n\t\tforeach($id as $k=>$i) {\r\n \t$found = false;\r\n \tif(count($del)) {\r\n \tforeach($del as $d) {\r\n \tif($i == $d) {\r\n \t$found = true;\r\n \tbreak;\r\n \t}\r\n \t}\r\n \t}\r\n \tif(!$found) {\r\n \tarray_push($modID,$i);\r\n \tarray_push($modName,$name[$k]);\r\n }\r\n \t}\r\n\t}\r\n\r\n\t$pntable = pnDBGetTables();\r\n\t$cat_table = $pntable[pnaddressbook_categories];\r\n\t$cat_column = $pntable['pnaddressbook_categories_column'];\r\n\r\n\t$updates = array();\r\n foreach($modID as $k=>$id) {\r\n array_push($updates,\"UPDATE $cat_table\r\n SET $cat_column[name]='\".pnVarPrepForStore($modName[$k]).\"'\r\n WHERE $cat_column[nr]=$id\");\r\n\t}\r\n\r\n\t$error = '';\r\n\r\n\tif(pnModAPIFunc(__PNADDRESSBOOK__,'admin','updateCategories',array('updates'=>$updates))) {\r\n \tif (empty($error)) { $error .= 'UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\telse { $error .= ' - UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t}\r\n\r\n\t$delete = \"DELETE FROM $cat_table WHERE $cat_column[nr] IN ($dels)\";\r\n\tif(isset($dels)) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','deleteCategories',array('delete'=>$delete))) {\r\n if (empty($error)) { $error .= 'DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n }\r\n }\r\n\r\n\tif( (isset($newname)) && ($newname != '') ) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','addCategories',array('name'=>$newname))) {\r\n if (empty($error)) { $error .= 'INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t}\r\n }\r\n\r\n\t$args=array('msg'=>$error);\r\n\r\n\tpnRedirect(pnModURL(__PNADDRESSBOOK__, 'admin', 'categories',$args));\r\n\treturn true;\r\n}", "function updateCategory($id) {\n\t$request = Slim::getInstance()->request();\n\t$body = $request->getBody();\n\t$category = json_decode($body);\n\t$sql = \"UPDATE category SET name=:name, description=:description WHERE id=:id\";\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->prepare($sql); \n\t\t$stmt->bindParam(\"name\", $category->name);\n\t\t$stmt->bindParam(\"description\", $category->description);\n\t\t$stmt->bindParam(\"id\", $id);\n\t\t$stmt->execute();\n\t\t$db = null;\n\t\techo json_encode($category);\n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}", "public function edit_category($category) {\n $this->category();\n $categories_sql_string = \"SELECT * FROM category WHERE id = \" . $category . \" limit 1\";\n $connection = new Database(\"sbrettsc_db\");\n $menu_array = $connection->get_array_from_query($categories_sql_string);\n $data = array(\"menu_array\" => array_shift($menu_array));\n\n $this->loadView(\"editors/category_editor\", $data);\n }", "public function update(UpdateCategoryRequest $request)\n {\n $category = Apiato::call('Category@UpdateCategoryAction', [$request]);\n\n // ..\n }", "function update_category( $category_title, $category_image_icon, $sort_order, $status, $category_id )\n\t{\n\t\tif( $category_image_icon != \"\" )\n\t\t{\n\t\t\t$full_image = $this -> get_category_image_icon( $category_id );\n\t\t\tif(is_file( $full_image ) )\n\t\t\t{\n\t\t\t\tunlink( $full_image );\n\t\t\t}\n\t\t\t\n\t\t\t$image_qry = \"`category_image_icon` = '\".$category_image_icon.\"', \";\n\t\t}\t//\tEnd of if( $category_image_icon != \"\" && $advertisment_small_image != \"\" )\n\t\t\n\t\t\t$q = \"UPDATE title_dev_categories SET `category_title` = '\".$category_title.\"', \".$image_qry.\" `sort_order` = '\".$sort_order.\"', `status` = '\".$status.\"', `modifieddate` = '\".date('Y-m-d H:i:s').\"' WHERE category_id = \".$category_id;\n\t\t$r = $this -> db -> updateRecord( $q );\n\t\tif( $r )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n $category->exp_group_name = $request->exp_group_name;\n $category->exp_group_desc = $request->exp_group_desc;\n\n if ( $request->exp_group_status == '1' or $request->exp_group_status == '0')\n {\n \n $category->exp_group_status = $request->exp_group_status;\n }\n\n\n \n\n\n\n \n $category->save();\n return redirect()->route('admin.categories.index');\n }", "public function update(Category $category, Request $request)\n {\n \n\n $user_check = \\Auth::user();\n if (in_array($user_check->level, [0, 1])) {\n /** @var Form $form */\n $form = \\FormBuilder::create(CategoryForm::class);\n if (!$form->isValid()) {\n return redirect()\n ->back()\n ->withErrors($form->getErrors())\n ->withInput();\n }\n $data = $form->getFieldValues();\n\n $upload = $data['image']->storeAs('public/img', $data['image']);\n // Se tiver funcionado o arquivo foi armazenado em storage/app/public/img/nomedinamicoarquivo.extensao\n \n $category->event_type_id = $request['event_type_id'];\n $category->name = $request['name'];\n $category->position = $request['position'];\n $category->image = $data['image']->getClientOriginalName();\n $category->save();\n \n\n session()->flash('message', 'Categoria editada com sucesso');\n return redirect()->route('category.index');\n } else {\n session()->flash('message', 'Desculpe! Essa área é restrita a administração.');\n return view('includes.message');\n }\n }", "public function updateCategory($id_category,$name_cate)\n\t\t{\n\t\t\t$sql = \"UPDATE tbl_category_products SET name_cate= :name_cate WHERE id_category = :id_category\";\n\t\t\t$pre = $this->pdo->prepare($sql);\n\n\t\t\t$pre->bindParam(':id_category', $id_category);\n\t\t\t$pre->bindParam(':name_cate', $name_cate);\n\n\t\t\treturn $pre->execute();\n\n\t\t}", "public function update(Request $request, Category $category)\n {\n $this->validate($request, [\n 'name' => 'required|max:191',\n // 'parent_id' => 'required|not_in:0',\n 'image' => 'mimes:jpg,jpeg,png|max:1000'\n ]);\n\n $params = $request->except('_token');\n $collection = collect($params);\n\n if ($collection->has('image') && ($params['image'] instanceof UploadedFile)) {\n if ($category->image != null) {\n $this->deleteOne($category->image);\n }\n $image = $this->uploadOne($params['image'], 'categories');\n } else {\n $image = null;\n }\n\n $featured = $collection->has('featured') ? 1 : 0;\n $menu = $collection->has('menu') ? 1 : 0;\n $merge = $collection->merge(compact('menu', 'image', 'featured'));\n $category->update($merge->all());\n\n return redirect(route('admin.categories.index'))->with('success', 'Category Updated Successfully!');\n }", "public function update($id)\n\t{\n\t\t$description = Input::get('description');\n\t\t$acronym = substr($description,0,1);\n\t\t$category = Category::find($id);\n\t\t$category->description = $description; \n\t\t$category->acronym = $acronym; \n\t\t$category->save(); \n\t\treturn Response::json($category);\n/*\t\treturn Response::json(array('success'=>\"La categoria fue actualizada exitosamente\"));*/\n\t}", "function classiera_update_my_category_fields($term_id) {\r\n\tif(isset($_POST['taxonomy'])){\t\r\n\t if($_POST['taxonomy'] == 'category'):\r\n\t\t$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);\r\n\t\t$tag_extra_fields[$term_id]['your_image_url'] = strip_tags($_POST['your_image_url']);\r\n\t\t$tag_extra_fields[$term_id]['category_image'] = $_POST['category_image'];\r\n\t\t$tag_extra_fields[$term_id]['category_icon_code'] = $_POST['category_icon_code'];\r\n\t\t$tag_extra_fields[$term_id]['category_icon_color'] = $_POST['category_icon_color'];\r\n\t\tupdate_option(MY_CATEGORY_FIELDS, $tag_extra_fields);\r\n\t endif;\r\n\t}\r\n}", "public function updateAssociatedCategories(){\n foreach ($this->getTable()->getAssociatedCategories() as $meal_category) {\n try{\n $cat = new Yourdelivery_Model_Meal_Category($meal_category['id']);\n $img = $cat->getImage(true);\n }\n catch (Yourdelivery_Exception_Database_Inconsistency $e){\n continue;\n } \n }\n }", "public function updateCategory(Request $request,$cat_id)\n {\n // validate input of category name..\n $request->validate([\n 'category_name' => 'required|max:255'\n ]);\n // update category by cat_id..\n $data = array();\n $data['category_name'] = $request->category_name;\n //$data['updated_at'] = Carbon::now();\n $update_category = DB::table('categories')->where('id',$cat_id)->update($data);\n if ($update_category)\n {\n // Display a toaster Updated message..\n $notification = array(\n 'message' => 'Category Updated successfully.',\n 'alert-type' => 'success'\n );\n return Redirect()->route('categories')->with($notification);\n }else {\n // Display a toaster No Updated message..\n $notification = array(\n 'message' => 'Nothing Data To Update.',\n 'alert-type' => 'warning'\n );\n return Redirect()->route('categories')->with($notification);\n }\n }", "public function update(CategoryRequest $request, Category $category)\n {\n $category->update([\n 'categoryname' => $request->input('categoryname'),\n 'categorydescription' => $request->input('categorydescription'),\n ]);\n \n if($request->new_photo){\n if($category->categoryphoto){\n unlink($category->categoryphoto);\n }\n $position = strpos($request->new_photo, ';');\n $sub = substr($request->new_photo, 0, $position);\n $file_extension = explode('/', $sub)[1];\n $name = time().\".\".$file_extension;\n $img = Image::make($request->new_photo)->resize(240,200);\n $upload_path = 'photos/category/';\n $image_url = $upload_path.$name;\n $img->save($image_url);\n $category->update([\n 'categoryphoto' => $image_url,\n ]);\n }\n\n return response()->json([\n 'type' => 'success',\n 'message' => \"data updated\",\n ],200);\n }", "public function updateCategory($parameters,$id)\n {\n \t $this->db->update('product_category', $parameters, array('product_id' => $id));\n return true;\n }", "public function multi_entry_category_update()\n {\n // Does the user have permission?\n if ( !ee()->publisher_helper->allowed_group('can_access_content'))\n {\n show_error(lang('unauthorized_access'));\n }\n\n $entries = ee()->input->post('entry_ids', TRUE);\n $cat_ids = ee()->input->post('category', TRUE);\n $type = ee()->input->post('type', TRUE);\n $entry_ids = array();\n\n if ( !$entries || !$type)\n {\n show_error(lang('unauthorized_to_edit'));\n }\n\n if ( !$cat_ids || !is_array($cat_ids) || empty($cat_ids))\n {\n return ee()->output->show_user_error('submission', lang('no_categories_selected'));\n }\n\n // For the entries affected, sync publisher_category_posts to category_posts\n\n foreach (explode('|', trim($entries)) as $entry_id)\n {\n $entry_ids[] = $entry_id;\n }\n\n // default states\n $default_language_id = ee()->publisher_model->default_language_id;;\n $default_view_status = ee()->publisher_setting->default_view_status();\n $states = array();\n\n foreach($entry_ids as $entry_id)\n {\n // we'll always have a state for the default language and status\n $states = array(array(\n 'publisher_lang_id' => $default_language_id,\n 'publisher_status' => $default_view_status\n ));\n\n if ($type == 'add')\n {\n // Adding categories\n // ----------------------------------------------------------------\n\n // We want to add categories to all the open and draft versions\n // of an entry without changing existing category selections\n\n // for each entry, look up existing distinct states\n $query = ee()->db->distinct()\n ->select('publisher_lang_id, publisher_status')\n ->where('entry_id', $entry_id)\n ->get('publisher_titles');\n\n if ($query->num_rows() > 0)\n {\n $result = $query->result_array();\n\n foreach($result as $row)\n {\n if (FALSE === ($row['publisher_lang_id'] == $default_language_id && $row['publisher_status'] == $default_view_status))\n {\n $states[] = array(\n 'publisher_lang_id' => $row['publisher_lang_id'],\n 'publisher_status' => $row['publisher_status']\n );\n }\n }\n }\n\n // build an an array of records to insert into publisher_category_posts\n $data = array();\n\n foreach($states as $state)\n {\n // add the new categories\n foreach($cat_ids as $cat_id)\n {\n $data[] = array(\n 'entry_id' => $entry_id,\n 'cat_id' => $cat_id,\n 'publisher_lang_id' => $state['publisher_lang_id'],\n 'publisher_status' => $state['publisher_status']\n );\n }\n }\n\n // delete any relationships with the newly added categories that already exist\n // for this entry so that we don't end up with duplicate rows\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n\n // (re)insert the categories with the appropriate states\n ee()->db->insert_batch('publisher_category_posts', $data);\n }\n\n elseif($type == 'remove')\n {\n // Removing categories\n // ----------------------------------------------------------------\n\n // we're simply removing the selected categories from all versions of the entry\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n }\n }\n }", "public function updatecategory($args)\n {\n if (!SecurityUtil::checkPermission('Dizkus::', \"::\", ACCESS_ADMIN)) {\n return LogUtil::registerPermissionError();\n }\n \n // copy all entries from $args to $obj that are found in the categories table\n // this prevents possible SQL errors if non existing keys are passed to this function\n $ztables = DBUtil::getTables();\n $obj = array();\n foreach ($args as $key => $arg) {\n if (array_key_exists($key, $ztables['dizkus_categories_column'])) {\n $obj[$key] = $arg;\n }\n }\n \n if (isset($obj['cat_id'])) {\n $obj = DBUtil::updateObject($obj, 'dizkus_categories', null, 'cat_id');\n return true;\n }\n \n return false;\n }", "public function update(Category $category, int $id): Category\n {\n }", "public function setUpdateCategory($val)\n {\n $this->_propDict[\"updateCategory\"] = $val;\n return $this;\n }", "function set_rights_of_cat($p_catid, $p_suggest_right, $p_suggest_group_right, &$p_changed){\n// Hauptprozedur. Diese wird aufgerufen um die Rechte einer Kategorie zu setzen, inklusive deren Unterkategorien.\n// $p_catid = KategorienID, welche gesetzt werden soll.\n// $p_suggested_right = Die rechte welche gesetzt werden sollen.\n// $p_changed = Anzahl der Korrekturen oder (-1): Gewuenschte aenderung war nicht zulaessig! \n $database = &JFactory::getDBO();\n // Kategorie laden aus Datenbank.\n $l_sql = \"SELECT parent_id, cat_access, cat_group_access FROM #__jdownloads_cats WHERE cat_id = \".$p_catid;\n $database->setQuery($l_sql);\n $l_catrow = $database->loadObjectList();\n if (!isset($l_catrow[0]) && ($p_catid > 0)){\n // Die Kategorie existiert nicht. Nicht weiterfahren.\n return '';\n }\n // Urspruengliche Rechte der Kategorie lesen.\n $l_rights_from = $l_catrow[0]->cat_access;\n //$l_rights_from_group = $l_catrow[0]->cat_group_access;\n if ($l_catrow[0]->parent_id == 0){\n // Es ist eine Hauptkategorie. Darueberliegende Kategorien muessen nicht nach niedrigen Rechten durchsucht werden.\n $l_rights_to_set = $p_suggest_right;\n } else {\n // Es ist eine Unterkategorie. Darueberliegenden Kategoriebaum nach niedrigen Rechten (=hoeherer Wert) durchsuchen.\n // Damit wird gewaehrleitet, dass eine Unterkategorie keine hoeheren Rechte erhalten kann.\n $l_rights_to_set = get_lowest_rights($p_catid, $p_suggest_right);\n if ($l_rights_to_set > $p_suggest_right) $p_changed = -1;\n }\n // Die Rechte der Kategorie und aller Unter- und Unter-Unter-Kategorien setzen.\n set_rights_to_tree($p_catid, $l_rights_to_set, $l_rights_from, $p_suggest_group_right, $p_changed);\n}", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function update(Request $request, $category)\n {\n $request->validate([\n 'name' => 'required|string|unique:categories,name,' . $category,\n 'slug' => 'required'\n ]);\n\n Category::whereId($category)->first()->update([\n 'name' => $request->name,\n 'slug' => make_slug($request->slug, '-'),\n 'description' => $request->description,\n 'status' => $request->status\n ]);\n\n return back()->with([\n 'url' => 'cats.index',\n 'type' => 'success',\n 'message' => 'تم تعديل القسم بنجاح '\n ]);\n }", "public function categoryUpdated($categoryId, $categoryName, $type = 'all')\n {\n $key = 'getCategoryByName' . $categoryName . $categoryId . language;\n // self::$cache->delete($key);\n }", "public function updateCategoriesByID()\n {\n global $config, $rlListingTypes, $rlDb;\n\n if (!$config['cache']) {\n return false;\n }\n\n $sql = \"SELECT *, `Modified`, CONCAT('categories+name+', `Key`) AS `pName`, CONCAT('categories+title+', `Key`) AS `pTitle` \";\n $sql .= \"FROM `{db_prefix}categories` \";\n $sql .= \"WHERE `Status` = 'active'\";\n $categories = $rlDb->getAll($sql, 'ID');\n\n $this->set('cache_categories_by_id', $categories);\n }", "public function returnUpdateCat() {\n return $this->category_id;\n }", "public function addCategoryToGroupById($gorup_id, $category_id);", "public function categorylist($c){\n $this->cat_id = $c; \n }", "public function testUpdateCategoryByIdWithSuccess()\n {\n $category = new Category();\n $category->setVisibility([Category::VISIBILITY_FACEBOOK, Category::VISIBILITY_MOBILE]);\n $category->setPosition(555);\n $category->setActive(false);\n\n $i18nUS = new I18n();\n $i18nUS->setLocale('en_US');\n $i18nUS->setName('Category name here');\n $i18nUS->setDescription('Description of category here');\n\n $category->setI18n([$i18nUS]);\n\n $this->resourceAPI->updateCategoryById($this->resourceId, $category);\n\n $categoryResponse = $this->resourceAPI->getCategoryById($this->resourceId);\n $category = $categoryResponse->getData()[0];\n $this->assertEquals(555, $category->getPosition());\n $this->assertEquals(false, $category->getActive());\n }", "public function update(Request $request, Category $category)\n {\n $request->validate([\n 'name' => 'required | string | unique:categories,id',\n 'role' => 'required'\n ]);\n $input = $request->only(['name', 'role', 'mainid', 'subid', 'status', 'featured']);\n $category->update($input); \n\n Toastr::success('Category updated successfully :)','Success');\n return redirect()->route($this->route.'index');\n }", "public function update(Request $request, Category $category)\n {\n $category->name = $request->name;\n $category->slug = Str::slug($request->slug);\n $category->save();\n\n return $this->apiResponse(ResultTypeController::Success, $category,\"Kategori Güncellendi\",200 );\n }", "function update_category_status($category_id,$category_status)\n {\n if($category_status==0)\n {\n $new_stat=\"1\";\n }\n elseif($category_status==1)\n {\n $new_stat=\"0\";\n }\n $query = $this->db->query(\"UPDATE tbl_category SET category_status = '$new_stat' WHERE category_id='$category_id'\");\n //echo $this->db->last_query();\n }" ]
[ "0.81891274", "0.77369666", "0.7539791", "0.7485624", "0.7469842", "0.72384894", "0.71285075", "0.7119705", "0.70992917", "0.7095617", "0.70151657", "0.6978497", "0.69397867", "0.6915729", "0.68732697", "0.68602175", "0.68553513", "0.6852658", "0.6852301", "0.6837294", "0.68205696", "0.6772279", "0.6733686", "0.67167306", "0.6703123", "0.6691455", "0.6670569", "0.6662475", "0.66605026", "0.6656667", "0.6651883", "0.66382205", "0.6632157", "0.6604034", "0.660319", "0.6584589", "0.65678144", "0.6565732", "0.65500486", "0.65421134", "0.6541556", "0.6532079", "0.6527884", "0.651658", "0.6503376", "0.6502587", "0.6496282", "0.64931834", "0.64770204", "0.6473281", "0.6458472", "0.64580834", "0.6457365", "0.6451633", "0.64510983", "0.6450215", "0.64434683", "0.6437875", "0.643669", "0.64345044", "0.64331037", "0.6428075", "0.64238703", "0.6419789", "0.64172846", "0.64172846", "0.64172846", "0.64172846", "0.64172846", "0.64172846", "0.64172846", "0.64172846", "0.64172846", "0.64172846", "0.64128375", "0.6411586", "0.640827", "0.6406184", "0.6404558", "0.64037496", "0.6400806", "0.6400233", "0.6399487", "0.6395922", "0.6393892", "0.6390127", "0.63879645", "0.63749444", "0.63704705", "0.6369256", "0.6364479", "0.6361038", "0.63527364", "0.6352589", "0.6352212", "0.63506436", "0.6348806", "0.6339365", "0.6336047", "0.63340765" ]
0.6461277
50
function to get branch and location
public function get_branch_location() { $data['category_branch_location'] = $this->Category_model->get_branch_location(); return $data['category_branch_location']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBranch()\n {\n return $this->branch;\n }", "public function getBranch()\n {\n return $this->branch;\n }", "public function getBranch()\n {\n return $this->_options['branch'];\n }", "public function getBranchOf()\n {\n return $this->branchOf;\n }", "public function getBranch() /*: string*/ {\n if ($this->branch === null) {\n throw new \\Exception(\"Branch is not initialized\");\n }\n return $this->branch;\n }", "public function getBranchInfo()\n {\n $this->db->select('*');\n $this->db->where('komoku_id', KOMOKU_SHOUSHA);\n $result = $this->db->get('m_komoku');\n return $result->result_array();\n }", "public function getBranches();", "protected function getBranch()\n {\n $branches = $this->terminal->run($this->git->branch());\n\n preg_match('/\\*\\s([\\w]*)/', $branches, $matches);\n \n if (!empty($matches[1])) {\n $this->branch = $matches[1];\n }\n \n $this->output->write('<info>' . $this->branch . '</info>' . PHP_EOL);\n }", "function GetBranch($usn){\r\n\t$formattedusn = preg_replace('/\\s+/', '', $usn);\r\n\t$properusn = strtolower($formattedusn);\r\n\t$branch = ($properusn[5].$properusn[6]);\r\n\tif($branch==cs) {\r\n $branch=\"C.S.E.\";\r\n }elseif ($branch==ec){\r\n $branch=\"E.C.E.\";\r\n\t}elseif ($branch==me) {\r\n $branch=\"Mech Eng.\";\r\n }elseif ($branch==cv){\r\n $branch=\"Civil Eng.\";\r\n }else{\r\n\t\t$branch=\"No Branch set.\";\r\n\t}\r\n\treturn $branch;\r\n}", "public function getBranchName()\n {\n if ($this->_branch === false) {\n $this->_branch = preg_match('#^/-([^/]+)-#', $this->getPathInfo(), $matches)\n ? $matches[1]\n : null;\n }\n\n return $this->_branch;\n }", "function _versioncontrol_git_log_get_branches() {\n $logs = _versioncontrol_git_log_exec('git show-ref --heads'); // Query branches.\n $branches = _versioncontrol_git_log_parse_branches($logs); // Parse output.\n return $branches;\n}", "public function getSource()\n {\n return 'branch';\n }", "function get_branch_to_order($customer_id, $branch_id) {\n\t \t$sql = \"SELECT \".TB_PREF.\"cust_branch.br_name, \"\n\t\t\t.TB_PREF.\"cust_branch.br_address, \"\n\t\t\t.TB_PREF.\"cust_branch.br_post_address, \"\n\t\t\t.\" default_location, location_name, default_ship_via, \"\n\t\t\t.TB_PREF.\"tax_groups.name AS tax_group_name, \"\n\t\t\t.TB_PREF.\"tax_groups.id AS tax_group_id\n\t\t\tFROM \".TB_PREF.\"cust_branch, \"\n\t\t\t .TB_PREF.\"tax_groups, \"\n\t\t\t .TB_PREF.\"locations\n\t\t\tWHERE \".TB_PREF.\"cust_branch.tax_group_id = \".TB_PREF.\"tax_groups.id\n\t\t\t\tAND \".TB_PREF.\"locations.loc_code=default_location\n\t\t\t\tAND \".TB_PREF.\"cust_branch.branch_code=\".db_escape($branch_id).\"\n\t\t\t\tAND \".TB_PREF.\"cust_branch.debtor_no = \".db_escape($customer_id);\n\n \t return db_query($sql,\"Customer Branch Record Retreive\");\n}", "function getLocation();", "function determine_branch_name( $request) {\n // push request, branch is in request[ref]\n if (isset($reqest['ref'])) {\n // strip out the refs/head nonsense -- doesn't look like bare\n // branch is listed anywhere in the request\n return preg_replace(\"|refs/heads/|\", \"\", $request['ref']);\n }\n\n _log(\"Unable to determine branch name. Maybe this wasn't a pull or merge request?\");\n}", "public function getSearchBranch()\n {\n return $this->search_branch;\n }", "function test_get_branch()\r\n\t{\r\n\t\t$rnc = 1;\r\n\t\t$depth = 2;\r\n\t\t$npl = 3; \r\n\t\t// Create a new tree\r\n\t\t$this->_create_sub_node($rnc, $depth, $npl);\r\n\t\t$allnodes = $this->_tree->get_all_nodes();\r\n\t\t$branch = $this->_tree->get_branch($npl, true);\r\n\t\t$this->assertEqual($allnodes, $branch, 'Result differs from getAllNodes()');\r\n\t}", "public function getLocation();", "public function getLocation();", "public function getBranchId()\n {\n return $this->branch_id;\n }", "function getBranchAddress($username){\n\n global $db;\n\n $stmt=$db->prepare('SELECT address from branch JOIN(\n \n SELECT client_branch as branch\n FROM client\n JOIN\n (\n SELECT client_id AS client\n FROM person\n JOIN\n client ON client_id = person_id\n WHERE username = ?\n )\n ON client_id = client\n )\n ON branch_id=branch;');\n\n $stmt->execute(array($username));\n return $stmt->fetchColumn();\n }", "public function branch()\n {\n $result = $this->git('symbolic-ref --short HEAD');\n if (empty($result)) {\n return 'master';\n }\n\n return $result;\n }", "public function getBranchID()\n {\n return $this->BranchID;\n }", "public function getCurrentBranch() : string\n {\n $process = $this->runProcess(new Process('git branch'));\n\n $branches = collect(explode(PHP_EOL, $process->getOutput()));\n\n $currentBranch = $branches->first(function(string $branch) {\n return str_contains($branch, '*');\n });\n\n return trim(str_replace('*', '', $currentBranch));\n }", "public function remoteBranch() : string\n {\n return (string) $this->getOrError('remote_branch');\n }", "function particularbranch($id)\n\t{\n\t\t$getParsubbrand=\"SELECT * from brand where brand_id = $id\";\n\t\t$subbrand_data=$this->get_results( $getParsubbrand );\n\t\treturn $subbrand_data;\n\t}", "private function getLocation() {\n }", "public function company_lookup_branch() {\n $this->layout = 'ajax';\n $this->loadModel('Branch');\n $branches = $this->Branch->find('all', array(\n 'conditions' => array('Branch.comp_id' => $this->Auth->user('id'))\n ));\n $this->set('branch', $branches);\n }", "public function getLocationbase()\n {\n return $this->locationbase;\n }", "public function targetBranch() : string\n {\n return (string) $this->getOrError('target_branch');\n }", "private function getLocation(){\n \n $location = [];\n $node = $this->getNode();\n $locationreference = $node->field_location_reference->entity;\n \n if($locationreference){\n $location = $locationreference->field_location->view(array('type' => 'LocationAddressFormatter', 'label' => 'hidden'));\n $location[0]['#prefix'] = '<i class=\"icon icon-home icon-smaller\"></i>';\n }\n \n return $location;\n \t\n }", "public function company_showLookupBranch() {\n $this->layout = 'ajax';\n $this->loadModel('Branch');\n if (!empty($_POST)) {\n $findBranch = $this->Branch->findById($_POST['data']['Branch']['check']);\n $this->set('findBranch', $findBranch);\n }\n }", "public function getNumber_branch()\n {\n return $this->fv_number_branch;\n }", "public function getUserLocation();", "private function getLocation()\n {\n $this->location = null;\n \n if ($this->fingerprint !== null && $this->end_point !== null) {\n $this->location = $this->end_point.$this->fingerprint;\n } else {\n $info = $this->getPost();\n \n if (isset($info['Location']) === true) {\n $this->fingerprint = str_replace($this->end_point, '', $info['Location']);\n $this->location = $info['Location'];\n }\n }\n \n return $this->location;\n }", "function getLocation(){ return $this->_Location;}", "public function getCanonicalLocation(): string;", "public function get_location()\n\t{\n\t\treturn $this->location;\n\t}", "public function getBranch($branch_id) {\r\n\r\n $sql = \"SELECT name FROM branch WHERE id=?\";\r\n\r\n $stmt = $this->connect()->prepare($sql);\r\n\r\n $stmt->execute([$branch_id]);\r\n\r\n return ($stmt->fetch());\r\n }", "public function get_location()\r\n\t\t{\r\n\t\t\t$retArr = $this->obj->getBasics();\r\n\r\n\t\t\treturn $retArr;\r\n\t\t}", "public function get_login_branch_name(){\n $settings = new Settings();\n $branch_id=$settings->employeeBranch();\n return response()->json([\n 'branch_id' => $branch_id\n ], $this->successStatus);\n }", "public function getBranchDetails_post()\n {\n\t\t$token = '1';\n\t\t//$tokens = AUTHORIZATION::validateToken($token);\n\t\t// print_r(getallheaders());\n\t\t// echo $token;die();\n\t\t//print_r($tokens);die;\n $requestedBy = $this->post('requestedBy');\n $getBranch = $this->branch_model->getBranch($requestedBy);\n if ($getBranch['branchStatus'])\n {\n // Set the response and exit\n $this->response($getBranch);\n }\n else\n {\n // Set the response and exit\n $this->response([\n 'message' => 'No records found!',\n 'branchStatus' => false\n ]);\n }\n }", "public function getLocation() {\n\t\treturn($this->location);\n\t}", "function ffd_get_base_location() {\r\n\t$default = apply_filters( 'ffd_get_base_location', get_option( 'ffd_default_country' ) );\r\n\r\n\treturn ffd_format_country_state_string( $default );\r\n}", "public function getGitCloneLocation()\n {\n return $this->gitCloneLocation;\n }", "function venture_geo_get_location($city, $state, $country) {\n $location = \"$city, \";\n $location .= ($state ? $state : $country);\n return $location;\n}", "private function _getBranches()\n\t{\n\t\t// If we don't have a configuration file for the repository PANIC!\n\t\tif (!file_exists($this->_root . '/.git/config'))\n\t\t{\n\t\t\tthrow new RuntimeException('Not a valid Git repository at ' . $this->_root);\n\t\t}\n\n\t\t// Initialize variables.\n\t\t$branches = array();\n\n\t\t// Parse the repository configuration file.\n\t\t$config = parse_ini_file($this->_root . '/.git/config', true);\n\n\t\t// Go find the remotes from the configuration file.\n\t\tforeach ($config as $section => $data)\n\t\t{\n\t\t\tif (strpos($section, 'branch ') === 0)\n\t\t\t{\n\t\t\t\t$branches[] = trim(substr($section, 7));\n\t\t\t}\n\t\t}\n\n\t\treturn $branches;\n\t}", "protected function determineBuildBranchAncestor($branch) {\n // Check whether the latest build of the production branch is something we\n // can start from with.\n $productionBranch = $this->phappManifest->getGitBranchProduction();\n $productionBuildBranch = $this->phappManifest->getGitBranchForBuild($productionBranch);\n $process = $this->_execSilent(\"git log --format=oneline $productionBuildBranch --grep \\\"Build .* commit \\\"\");\n\n if ($process->isSuccessful() && $output = $process->getOutput()) {\n // Parse the message to get the source commit hash.\n list($first_line) = explode(\"\\n\", $output, 2);\n $matches = [];\n if (preg_match('/Build .* commit (\\S*)./', $first_line, $matches)) {\n $sourceCommit = $matches[1];\n }\n }\n\n // If the source commit of the last build has been found, verify the\n // to-be-built branch is based upon it. Else, we need to start a new build\n // branch.\n if (!empty($sourceCommit)) {\n $process = $this->_execSilent(\"git log --format=oneline $sourceCommit..$branch\");\n $sourceIsParent = $process->isSuccessful() && $process->getOutput() != '';\n\n if ($sourceIsParent) {\n return $productionBuildBranch;\n }\n\n // Check whether the source commit is the same as to-be-built commit.\n $process = $this->_execSilent(\"git reflog $sourceCommit\");\n $hash1 = $process->isSuccessful() ? $process->getOutput() : FALSE;\n $process = $this->_execSilent(\"git reflog $branch\");\n $hash2 = $process->isSuccessful() ? $process->getOutput() : FALSE;\n if ($hash1 && $hash2 && $hash1 == $hash2) {\n return $productionBuildBranch;\n }\n }\n\n // No relationship between the to-be-built and the last built commit could\n // be found. Thus, start a new build branch based upon the to-be-built\n // branch.\n return $branch;\n }", "static function getCurrentVersion($branch=\"latest_stable\")\n\t{\n\t\t$url = \"svn://localhost/ci_base_core/branches/\".$branch.\"/.version\";\n\t\t//file_put_contents(\"../logs/index.getCurrentVersion.branch_url.txt\", print_r($url, true));\n\t\t$out = false;\n\t\n\t\tif (function_exists('curl_init'))\n\t\t{\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\tcurl_setopt($ch, CURLOPT_USERAGENT, 'BA5E');\n\t\t\t$out = curl_exec($ch);\n\t\n\t\t\tif (false === $out)\n\t\t\t{\n\t\t\t\ttrigger_error('Not sure what it is, but there\\'s a problem with contacting the update server. Maybe this will help: \"' . curl_error($ch) . '\"');\n\t\t\t}\n\t\t\techo curl_error($ch);\n\t\t\tcurl_close($ch);\n\t\t}else{\n\t\t\tthrow new Exception(\"curl is required for this action\");\n\t\t}\n\t\n\t\t\n\t\treturn ($out !== false) ? $out : VERSION;\n\t}", "public function getBranchlessPath()\n {\n $pattern = '#^/?-' . $this->getBranchName() . '-/?#';\n return preg_replace($pattern, '', $this->getPathInfo());\n }", "function & get_branch($id, $add_sql = array())\r\n\t{\r\n\t\tif (!($this_node = $this->get_node($id)))\r\n\t\t{\r\n \tdebug :: write_error('NESE_ERROR_NOT_FOUND',\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('id' => $id)\r\n \t);\n \treturn false;\r\n\t\t} \r\n\t\tif ($this->_sort_mode == NESE_SORT_LEVEL)\r\n\t\t{\r\n\t\t\t$sql = sprintf('SELECT %s %s FROM %s %s WHERE %s.root_id=%s %s ORDER BY %s.level, %s.%s ASC',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_get_select_fields(),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'columns'),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'join'),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table, $this_node['root_id'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'append'),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table, $this->_secondary_sort);\r\n\t\t} \n\t\telseif ($this->_sort_mode == NESE_SORT_PREORDER)\r\n\t\t{\r\n\t\t\t$sql = sprintf('SELECT %s %s FROM %s %s WHERE %s.root_id=%s %s ORDER BY %s.l ASC',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_get_select_fields(),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'columns'),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'join'),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table, $this_node['root_id'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'append'),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table);\r\n\t\t} \r\n\r\n\t\t$node_set =& $this->_get_result_set($sql);\r\n\r\n\t\tif ($this->_sort_mode == NESE_SORT_PREORDER && ($this->_secondary_sort != $this->_default_secondary_sort))\r\n\t\t{\r\n\t\t\tuasort($node_set, array($this, '_sec_sort'));\r\n\t\t} \r\n\t\treturn $node_set;\r\n\t}", "public function GetParentAddress($token);", "function locationinfo($client, $organizationId)\r\n {\r\n // echo \"\\nOrganizational Units:\\n\\n\";\r\n // $organizationalunits = $client->getOrganizationApi()->listOrganizationalUnits($organizationId);\r\n\r\n // foreach ($organizationalunits as $organizationalunit) {\r\n // echo \" \" . $organizationalunit->getOrganizationalUnitId() . \" -> \" . $organizationalunit->getname() . \"\\n\";\r\n // }\r\n $locationname = \"\";\r\n // echo \"\\nOrganization Locations:\\n\\n\";\r\n\r\n $organizationLocations = $client->getOrganizationApi()->listOrganizationLocations($organizationId);\r\n\r\n foreach ($organizationLocations as $organizationLocation) {\r\n // echo \" \" . $organizationLocation->getLocationId() . \" -> \" . $organizationLocation->getLocationName() . \"\\n\";\r\n $locationname = $organizationLocation->getLocationName();\r\n }\r\n\r\n //echo \" \" . $organizationLocation->getLocationId() . \" -> \" . $organizationLocation->getLocationName() . \"\\n\";\r\n return $organizationLocations[0];\r\n }", "private function _populateBranch()\n {\n return $this->branch->create(\n $this->branchData['name'], \n $this->branchData['region_ID'], \n $this->branchData['promotor_ID']\n );\n }", "public function getEnvironment()\n {\n return 'branch';\n }", "public function findbranch()\n\t{\n\t\t$post = $this->input->post();\n\t\t$data = $this->AjaxDB->findBranch(['course'=>$post['id']]);\n\t\t$d[] = 'Choose Branch';\n\t\tif (!empty($data)) {\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$d[$value->id] = $value->branch_name;\n\t\t\t}\n\t\t}\n\t\t$result = form_dropdown('branch',$d,'',['class'=>'form-control input-sm','id'=>'bid']);\n\t\techo $result;\n\t}", "public function getLocation()\n {\n return $this->getParameter('location');\n }", "public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}", "public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}", "public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}", "public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}", "public function getLocation() { return $this->location; }", "public function getAllBranches() {\n\t\t\t$dbFunctions\t= new dbFunctions();\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\n\t\t\t$table\t\t\t= 'tb_branch';\n\t\t\t$select_what\t= '*';\n\t\t\t$conditions\t\t= \"1 ORDER BY vc_branch\";\n\t\t\t$return\t\t\t= $db->getAllRows_Arr($table, $select_what, $conditions);\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function getMainTalentBranch(){\r\n\t \t$result = 0;\r\n\t \t$branch1 = intval($this->getMainTalentBranch1());\r\n\t \t$branch2 = intval($this->getMainTalentBranch2());\r\n\t \t$branch3 = intval($this->getMainTalentBranch3());\r\n\t \tif(($branch1 <> 0) && ($branch1 > $branch2) && ($branch1 > $branch3)) {\r\n\t\t \t$result = 1;\r\n\t \t} elseif(($branch2 <> 0) && ($branch2 > $branch1) && ($branch2 > $branch3)) {\r\n\t\t \t$result = 2;\r\n\t \t} elseif(($branch3 <> 0) && ($branch3 > $branch1) && ($branch3 > $branch2)) {\r\n\t\t \t$result = 3;\r\n\t \t}\r\n\t\treturn $result;\r\n\t}", "public function getLocation()\n\t{\n\t\treturn $this->_location;\n\t}", "public function getLocation()\n {\n return $this->banner_location_id;\n }", "public function get_form_location($form_id,$hierarchy_id){\n $sql = 'SELECT location_id from form_location where form_id = '.$form_id.' and form_hierarchy_id = '.$hierarchy_id;\n $res = $this->db->query($sql);\n return $res->result_array();\n }", "public function getBusinessLocationCode()\n {\n return $this->businessLocationCode;\n }", "function project_location($id)\n{\n\t$ptlocation=mysql_fetch_array(mysql_query(\"select location_name from manage_property_type_location where pt_loc='$id'\"));\n\treturn $ptlocation['location_name'];\n\t}", "public function getLocation() {\r\n return $this->location;\r\n }", "public function getLocation()\r\n {\r\n return $this->location;\r\n }", "public function getExistingBranchForTestCase()\n {\n $branchName = $this->getDevBranchName();\n $devBranch = new DevBranches($this->getDefaultClient());\n\n $branches = $devBranch->listBranches();\n $branch = null;\n // get branch detail\n foreach ($branches as $branchItem) {\n if ($branchItem['name'] === $branchName) {\n $branch = $branchItem;\n }\n }\n if (!isset($branch)) {\n $this->testCase->fail(sprintf('Reuse existing branch: branch %s not found.', $branchName));\n }\n\n return $branch;\n }", "public static function getBucketLocation($bucket)\n\t{\n\t\t// TODO: Implement getBucketLocation() method.\n\t}", "public function getPathLocation(): string;", "public function location()\n {\n $city = $this->city;\n if ($city) {\n $subdivision = $city->subdivision;\n $country = $subdivision->country;\n\n $this->attributes['location'] = $city->name . ' ' . $subdivision->abbreviation . ', ' . $country->name;\n } else {\n $this->attributes['location'] = null;\n }\n }", "function getCurTrackLocation(){\n\t}", "private function branches()\r\n {\r\n return (isset($this->_session[$this->_branchKey]) ?\r\n $this->_session[$this->_branchKey] : []);\r\n }", "public function getLocation() {\n return $this->location;\n }", "public function branches()\n {\n return $this->_refs('heads');\n }", "public function getLocation() {\n\t\tif(isset($this->data['mdid'])) {\n\t\t\treturn $this->data['md_folder'] . $this->data['md_filename'];\n\t\t}\n\t\treturn ;\n\t}", "function check_branch($appid,$steamcmd) { \t\n \n$cmd = \"$steamcmd +app_info_update 1 +app_info_print $appid +quit 2>/dev/null\"; \n$data= shell_exec($cmd);\nfile_put_contents(\"$appid.txt\",$data);\n$kv = VDFParse(\"$appid.txt\");\nunlink(\"$appid.txt\");\nreturn $kv[$appid]['depots']['branches']; // just send the branches back\n}", "function get_all_branches()\r\r\n\t{\r\r\n\t\t$query = $this->db->get($this->_table_branches);\r\r\n\t\t\r\r\n\t\t// Check if Result is Greater Than Zero\r\r\n\t\tif($query->num_rows() > 0)\r\r\n\t\t{\r\r\n\t\t\treturn $query->result();\r\r\n\t\t}\r\r\n\t}", "public function getBucketLocation($bucket)\n\t{\n\t\t$url = 'https://' . $bucket . '.' . $this->options->get('api.url') . '/?location';\n\n\t\t// Send the request and process the response\n\t\treturn $this->commonGetOperations($url);\n\t}", "public function getLocationInformation() : LoggerLocationInfo\n {\n if ($this->locationInfo === null) {\n \n $locationInfo = array();\n $trace = debug_backtrace();\n $prevHop = null;\n \n // Make a downsearch to identify the caller.\n $hop = array_pop($trace);\n\n while ($hop !== null) {\n \n if (isset($hop['class'])) {\n \n // We are sometimes in functions = no class available: avoid php warning here.\n //$className = strtolower(substr($hop['class'], 8));\n $className = strtolower(str_replace('log4php\\\\', '', strtolower($hop['class'])));\n \n if (!empty($className)\n && (($className === 'logger') || (strtolower(get_parent_class($className)) === 'logger'))\n ) {\n \n $locationInfo['line'] = $hop['line'];\n $locationInfo['file'] = $hop['file'];\n break;\n \n }//end if\n \n }//end if\n \n $prevHop = $hop;\n $hop = array_pop($trace);\n \n }//end while\n \n if (isset($prevHop['class'])) {\n $locationInfo['class'] = $prevHop['class'];\n } else {\n $locationInfo['class'] = 'main';\n }//end if\n \n if ((isset($prevHop['function'])) \n && ($prevHop['function'] !== 'include') \n && ($prevHop['function'] !== 'include_once') \n && ($prevHop['function'] !== 'require') \n && ($prevHop['function'] !== 'require_once')\n ) {\n $locationInfo['function'] = $prevHop['function'];\n } else {\n $locationInfo['function'] = 'main';\n }//end if\n \n $this->locationInfo = new LoggerLocationInfo($locationInfo);\n \n }//end if\n \n return $this->locationInfo;\n \n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getLocation()\n {\n return $this->location;\n }", "public function getBranch(NodeInterface $node)\r\n {\r\n $params = compact('node');\r\n $event = $this->getEventManager()->trigger(__FUNCTION__.'.pre', $this, $params);\r\n if ($event->stopped()) {\r\n return $event->last();\r\n }\r\n\r\n $result = $this->mapper->getBranch($node);\r\n\r\n $params['__RESULT__'] = $result;\r\n $this->getEventManager()->trigger(__FUNCTION__.'.post', $this, $params);\r\n\r\n return $result;\r\n }", "function mb_locations()\n {\n }", "public function branching()\n {\n }" ]
[ "0.6536095", "0.6536095", "0.64267313", "0.64188987", "0.6408203", "0.6360562", "0.62474173", "0.6195869", "0.6134331", "0.61105436", "0.60455585", "0.60140353", "0.59977937", "0.5967617", "0.5910091", "0.58967876", "0.5886438", "0.5876694", "0.5876694", "0.5855066", "0.58533096", "0.58459723", "0.58192915", "0.5808994", "0.58029056", "0.57753175", "0.5752675", "0.57094854", "0.57087016", "0.56709355", "0.56704", "0.5636352", "0.5616588", "0.55993223", "0.55903065", "0.5584743", "0.5583475", "0.55617636", "0.5539094", "0.5519819", "0.5515956", "0.54964995", "0.548698", "0.5475781", "0.54607815", "0.54526174", "0.5447494", "0.5416659", "0.5397068", "0.5395212", "0.5382164", "0.5361701", "0.53501725", "0.5348206", "0.5337077", "0.5331969", "0.53298736", "0.5328621", "0.5328621", "0.5328621", "0.5328621", "0.5317521", "0.5313793", "0.5299259", "0.52906305", "0.52859557", "0.52844006", "0.52772135", "0.5276788", "0.52760726", "0.52726984", "0.52632594", "0.52603567", "0.52549237", "0.52536666", "0.5249496", "0.5247983", "0.524065", "0.524039", "0.52293545", "0.52217", "0.5210637", "0.52078575", "0.5193933", "0.5175254", "0.5175254", "0.5175254", "0.5175254", "0.5175254", "0.5175254", "0.5175254", "0.5175254", "0.5175254", "0.5175254", "0.5175254", "0.5175254", "0.5175254", "0.5172731", "0.5166859", "0.51653105" ]
0.7846424
0
function to delete category
public function delete_category() { $category_id = $_GET['category_id']; $data['delete_category'] = $this->Category_crud->get_category_by_id($category_id); $this->load->view('restaurant/category/delete_category_model', $data); if (isset($_POST['delete_category_yes'])) { $this->Category_crud->delete_category_sub_category_item($category_id); redirect(rest_path('Category')); } if (isset($_POST['delete_category_no'])) { $this->Category_crud->delete_category($category_id); redirect(rest_path('Category')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function product_category_delete(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\tmysql_q(\"DELETE FROM product_category WHERE id='\".add_slash($_r['id']).\"'\");\n\n\t\tredirect(\"product_category.htm\", \"\");\n\t}", "public function delete(){\n\n\t\t$sql = new Sql();\n\n\t\t$sql->query(\"DELETE FROM tb_categories WHERE idcategory=:idcategory\",array(\n\t\t\t\":idcategory\"=>$this->getidcategory()\n\t\t));\n\n\t\tCategory::updateFile();\n\t}", "public function deleteAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Game_Service_Category::getCategory($id);\r\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\r\n\t\t$result = Game_Service_Category::deleteCategory($id);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "public function delete() {\n $sql = sprintf(\"DELETE FROM category WHERE id=%d\", $this->id);\n self::$connection->execute($sql);\n }", "public function delete_category()\r\n\t\t{\r\n\t\t\t$this->errno = DB_OK;\r\n\t\t\t\r\n\t\t\tif ( $this->cat_id == -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tSuch category hasn't been created\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"START TRANSACTION;\");\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tTransaction is needed despite the one query as delete is on cascade\r\n\t\t\t\r\n\t\t\tif ( ! ( $result = $this->con->query ( \"DELETE FROM category WHERE cat_id=$this->cat_id\" ) ) )\r\n\t\t\t{\t\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to connect\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( $this->con->affected_rows == 0 )\r\n\t\t\t{\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = CATEGORY_DONT_EXIST;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthis query should affect 1 row\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"COMMIT;\");\r\n\t\t\t\r\n\t\t}", "public function deletecategory(){\n\t\n\t\t$id = $this->request->getParameter(\"actionid\");\n\t\t$modelCategory = new CaCategory();\n\t\t$modelCategory->delete($id);\n\t\n\t\t// generate view\n\t\t$this->redirect(\"catalogadmin/categories\");\n\t}", "public function remove_category() {\n\t\t$this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(Request::get(\"cat\"));\n\t\t$this->model->categories->unlink($category);\n if(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\t\n\t}", "public function deleteCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n /*删除分类下的子分类*/\n $key = $_REQUEST['id'];\n $condition['id'] = $key;\n $form = M(\"categoryinfo\");\n $data = $form->where($condition)->delete(); \n $data_all = $form->select();\n for ($i = 0;$i< count($data_all);$i++)\n {\n if ($data_all[$i]['father'] == $key) \n {\n $condition['id'] = $data_all[$i]['id'];\n $form->where($condition)->delete();\n }\n } \n /*删除分类下的菜品*/\n $food = M('foodinfo');\n $data_food = $food->select();\n for ($i = 0;$i< count($data_food);$i++)\n {\n if ($data_food[$i]['father'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n if ($data_food[$i]['category'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n } \n\t\t$this->redirect('/index.php/Admin/dish');\n //$this->display();\n }", "public function delete_category(){\n $query = \"DELETE FROM {$this->table} WHERE {$this->table}.cat_id = (:cat_id)\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_id', $this->cat_id);\n $stmt->execute();\n return $stmt;\n \n }", "public function deletePost(){\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"delete_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n if ($categoryModel->deleteCategory($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category deleted successfully!\",\"success\");\n }\n } catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function delete_category($id)\n { \n\t $query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n @unlink(str_replace(base_url(),'',$query[0]->category_img));\n \n $query=$this->General_model->show_data_id('categories',$id,'category_Id','delete','');\n $this->session->set_flashdata('success','Product Category Deleted successfully'); \n redirect('superpanel/categorie');\n\t\n\t }", "public function delete(): void\n {\n $query_lang = 'DELETE FROM '. rex::getTablePrefix() .'d2u_linkbox_categories '\n .'WHERE category_id = '. $this->category_id;\n $result_lang = rex_sql::factory();\n $result_lang->setQuery($query_lang);\n }", "public function delete()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n try{\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/delete\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n\n }", "function cat_delete_link()\n{\n return Parrot::getInstance()->getUrl(\"admin/category/\" . discussion::encode_title(cat_title()) . \"/delete\");\n}", "public function delete_category($category_id){\n \n DB::table('tbl_category')\n ->where('category_id',$category_id)\n ->delete();\n return Redirect::to('/manage-category');\n }", "function delete_category($cat_id)\n { \n $sql = \"DELETE FROM prod_categories WHERE `cat_id` = \\\"$cat_id\\\" LIMIT 1\";\n \n //echo $sql ;\n \n\t//submit query\n \n include 'connect.php';\n \n $result = mysqli_query($link, $sql); //returns object\n \n \n \n if (!$result) \n {\n\t\t\t\t\n $err = mysqli_error($link);\n //echo $err ;\n //echo 'error g et_user';\n\t\t\t\t\t\t\t\t\n }\n else\n { \n echo 'Kategoria u fshi nga sistemi!!!' ;\n }\n\n // close connection \n \n }", "function delete($category_id)\n {\n $query = \"DELETE FROM categories WHERE categories_id = '$category_id'\";\n $result = $this->db->delete($query);\n }", "public function delcategory() {\n extract($_GET);\n //print_r($_GET);die();\n // call to model function to del category from db\n $result = $this->dash_model->delcategory($mat_cat_id);\n\n echo json_encode($result);\n }", "function ciniki_directory_categoryDelete(&$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 'category_id'=>array('required'=>'yes', 'default'=>'', 'blank'=>'yes', 'name'=>'Category'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'directory', 'private', 'checkAccess');\n $ac = ciniki_directory_checkAccess($ciniki, $args['tnid'], 'ciniki.directory.categoryDelete');\n if( $ac['stat'] != 'ok' ) {\n return $ac;\n }\n\n //\n // Get the category uuid\n //\n $strsql = \"SELECT uuid FROM ciniki_directory_categories \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \" \n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['category']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.directory.12', 'msg'=>'The category does not exist'));\n }\n $uuid = $rc['category']['uuid'];\n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Get the list of entries to remove from this category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_directory_category_entries \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND category_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'entry');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $entries = $rc['rows'];\n foreach($entries as $entry) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category_entry', \n $entry['id'], $entry['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n //\n // Delete the object\n //\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category', $args['category_id'], $uuid, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'directory');\n\n return array('stat'=>'ok');\n}", "public function delete_category($id) {\n $this->category();\n\n $connection = new Database(\"sbrettsc_db\");\n $connection->do_sql(\"DELETE FROM category WHERE id = \" . $id);\n $this->index();\n\n }", "function delete( $catID=-1 )\r\n {\r\n\r\n if ( $catID == -1 )\r\n $catID = $this->ID;\r\n\r\n $category = new eZImageCategory( $catID );\r\n\r\n $categoryList = $category->getByParent( $category );\r\n\r\n foreach ( $categoryList as $category )\r\n {\r\n $category->delete();\r\n }\r\n\r\n foreach ( $this->images() as $image )\r\n {\r\n $image->delete();\r\n }\r\n\r\n $categoryID = $category->id();\r\n\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->begin( );\r\n\r\n $res1 = $db->query( \"DELETE FROM eZImageCatalogue_Category WHERE ID='$categoryID'\" );\r\n $res2 = $db->query( \"DELETE FROM eZImageCatalogue_CategoryPermission WHERE ObjectID='$this->ID'\" );\r\n\r\n if ( ( $res1 == false ) || ( $res2 == false ) )\r\n $db->rollback( );\r\n else\r\n $db->commit();\r\n\r\n }", "public function action_delete()\n {\n if($this->category->has_subcategories())\n {\n // Response faile info\n $this->request->response = View::factory('error', array(\n 'message' => '该分类有子分类,无法删除', \n ));\n }\n else\n {\n if($this->category->delete())\n {\n // Delete successfully\n // Delete search results as well\n $this->request->redirect('category/tree');\n }\n else\n {\n // Failed\n $this->request->response = View::factory('error', array(\n 'message' => '删除失败', \n ));\n }\n }\n }", "function delete_category($category_id) {\n global $db;\n $query = \n ' DELETE FROM categories \n WHERE cat_categoryID = :category_id';\n $statement = $db->prepare($query);\n $statement->bindValue(':category_id', $category_id);\n $statement->execute();\n $statement->closeCursor();\n}", "public function delete_gallery_category_post()\n {\n prevent_author();\n\n $id = $this->input->post('category_id', true);\n\n //check if category has posts\n if ($this->gallery_image_model->get_category_image_count($id) > 0) {\n $this->session->set_flashdata('error', trans(\"msg_delete_images\"));\n redirect($this->agent->referrer());\n }\n\n if ($this->gallery_category_model->delete_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_deleted\"));\n redirect($this->agent->referrer());\n } else {\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }", "public function EliminarCategorias()\n\t{\n\n\t\t$sql = \" select codcategoria from productos where codcategoria = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcategoria\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\n\t\t\t$sql = \" delete from categorias where codcategoria = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codcategoria);\n\t\t\t$codcategoria = base64_decode($_GET[\"codcategoria\"]);\n\t\t\t$stmt->execute();\n\n\t\t\theader(\"Location: categorias?mesage=1\");\n\t\t\texit;\n\n\t\t}else {\n\n\t\t\theader(\"Location: categorias?mesage=2\");\n\t\t\texit;\n\t\t}\n\n\t}", "public function deleted(Category $category)\n {\n //\n }", "public function deleteAction()\n {\n // enforce permissions.\n $this->acl->check('categories', 'manage');\n\n // require post request method.\n $request = $this->getRequest();\n if (!$request->isPost()) {\n throw new P4Cms_AccessDeniedException(\n \"Cannot delete category. Request method must be http post.\"\n );\n }\n\n $id = $request->getParam('id', $request->getParam('category'));\n $category = Category_Model_Category::fetch($id);\n $category->delete();\n\n $this->view->category = $category;\n }", "function ccategories_delete($category)\n\t{\n\t\tlusers_require(\"categories/delete\");\n\n\t\t$content = mcategories_get_content($category);\n\t\tmcategories_delete($category);\n\t\tmcontent_delete($content[\"id\"]);\n\n\t\tlcache_delete_all();\n\n\t\tluri_redirect(\"main/user/admin/categories\", l(\"Category successfully deleted.\"));\n\t}", "function ciniki_foodmarket_categoryDelete(&$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 'category_id'=>array('required'=>'yes', 'blank'=>'yes', 'name'=>'Category'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'foodmarket', 'private', 'checkAccess');\n $rc = ciniki_foodmarket_checkAccess($ciniki, $args['tnid'], 'ciniki.foodmarket.categoryDelete');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the current settings for the category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_foodmarket_categories \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.foodmarket', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['category']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.5', 'msg'=>'Category does not exist.'));\n }\n $category = $rc['category'];\n\n // \n // Check for any child categories\n //\n $strsql = \"SELECT COUNT(id) AS children \"\n . \"FROM ciniki_foodmarket_categories \"\n . \"WHERE ciniki_foodmarket_categories.parent_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbSingleCount');\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.foodmarket', 'num');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.6', 'msg'=>'You still have ' . $rc['num'] . ' child categor' . ($rc['num']>1?'ies':'y') . '.'));\n }\n\n //\n // Check for items already in the category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_foodmarket_category_items \"\n . \"WHERE category_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.foodmarket', 'item');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.149', 'msg'=>'Unable to load item', 'err'=>$rc['err']));\n }\n $items = isset($rc['rows']) ? $rc['rows'] : array();\n \n //\n // Start transaction\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDelete');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.foodmarket');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Remove any items from the category first\n //\n foreach($items as $item) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.foodmarket.categoryitem', $item['id'], $item['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.foodmarket');\n return $rc;\n }\n }\n\n //\n // Remove the category\n //\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.foodmarket.category', $args['category_id'], $category['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.foodmarket');\n return $rc;\n }\n\n //\n // Commit the transaction\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.foodmarket');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'foodmarket');\n\n return array('stat'=>'ok');\n}", "public function remove_category($id) {\r\n\t\t\treturn parent::delete($id);\r\n\t\t}", "public function delete() {\n\t\t$sql = 'delete from cart_categories where categories_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\t$sql = 'delete from cart_categories_description where categories_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\t$cats = $this->getSubCategories();\n\t\tforeach ($cats as $cat) {\n\t\t\t$cat->delete();\n\t\t}\n\t}", "function delete_category($category_id)\n {\n $this->db->update('tbl_category',$this,array('category_id'=>$category_id));\n //echo $this->db->last_query();\n }", "function delete_categoria($idcategoria)\n {\n return $this->db->delete('categoria',array('idcategoria'=>$idcategoria));\n }", "function categoryRemove(){\n\tif(startSession() && isset($_SESSION['UserID']))\n\t{\n\t\t$CatID\t\t\t \t= strip_tags($_GET['id']);\t#int - primaryKey\n\n\t\t$db = pdo(); # pdo() creates and returns a PDO object\n\n\t\t$sql = \"DELETE FROM ma_Categories WHERE CatID = :CatID\";\n\n\t\t$stmt = $db->prepare($sql);\n\t\t//INTEGER EXAMPLE $stmt->bindValue(1, $id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':CatID', $CatID, PDO::PARAM_INT);\n\n\t\ttry {$stmt->execute();} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\t\t#feedback success or failure of update\n\n\t\tif ($stmt->rowCount() > 0)\n\t\t{//success! provide feedback, chance to change another!\n\t\t\tfeedback(\"Category Removed Successfully\",\"success\");\n\t\t}else{//Problem! Provide feedback!\n\t\t\tfeedback(\"Category Not Trashed!\",\"warning\");\n\t\t}\n\t\tmyRedirect(THIS_PAGE);\n\t}\n\t#script for expanding textarea\n}", "public function deleteCategories($category_id){\n if(DB::table('tbl_post')->where('category_id',$category_id)->first()){\n $name = DB::table('tbl_categories')->where('id',$category_id)->first();\n Session::put('massege','Không thể xóa danh mục \"'.$name->name.'\".');\n }\n else{\n DB::table('tbl_categories')->where('id',$category_id)->delete();\n Session::put('massege','Xoá danh mục thành công.');\n }\n return Redirect::to('categories');\n \n }", "public function actionCategoryDelete()\n {\n $this->_assertCanManageCategories();\n\n $category_id = $this->_input->filterSingle('faq_id', XenForo_Input::UINT);\n\n // Delete category\n $dw = XenForo_DataWriter::create('Iversia_FAQ_DataWriter_Category');\n $dw->setExistingData($category_id);\n $dw->delete();\n\n // Delete associated questions\n $this->_getQuestionModel()->deleteOrphanQuestions($category_id);\n\n return $this->responseRedirect(\n XenForo_ControllerResponse_Redirect::SUCCESS,\n XenForo_Link::buildPublicLink('faq'),\n new XenForo_Phrase('iversia_faq_category_deleted')\n );\n }", "public function modelDelete($category_id){\r\n\t\t\t$conn = Connection::getInstance();\r\n\t\t\t// chuan bi truy van \r\n\t\t\t$query = $conn->prepare(\"delete from tbl_category where category_id=:category_id\");\r\n\t\t\t//thuc thi truy van \r\n\t\t\t$query->execute(array(\"category_id\"=>$category_id));\r\n\t\t\t\r\n\t\t}", "public function categories_delete($param = null)\r\n {\r\n if (isset($_POST[\"cat_id\"]) && !empty($_POST[\"cat_id\"])) {\r\n $action = $_POST[\"cat_id\"];\r\n $delete = Category::find($action)->delete();\r\n $total = Category::count();\r\n echo json_encode([\"total\" => $total, \"isDeleted\" => $delete]);\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }", "public function deleteCategory($id) {\n\t\t$stmt = $mysqli->prepare(\"DELETE FROM categorie WHERE cat_id = ?\");\n\t\t$stmt->bind_param('i', $id);\n\t\t$stmt->execute();\n\t\t$stmt->close();\n\t}", "public function deleteCategory()\r\n{\r\n $query_string = \"DELETE FROM categories \";\r\n $query_string .= \"WHERE categoryid= :categoryid\";\r\n\r\n return $query_string;\r\n}", "public function deleteClean() {\n\n $id = $this->request->get('category_id');\n\n // check category valid\n $category = ApplicationCategory::find($id)->first();\n\n $next_id = $this->request->get('next_category_id');\n\n\n $category_next = ApplicationCategory::find($next_id)->first();\n\n // check if exists.\n\n DB::table('apps')\n ->where('category_id', $id)\n ->update(['category_id' => $next_id]);\n\n $category->delete();\n\n return redirect('/develop/categories');\n\n\n }", "public function deleteCategoryLangaugeAction(){\n $ebookers_obj = new Ep_Ebookers_Managelist();\n //to call a function to delete themes//\n $ebookers_obj->deleteCategoryLangauge($this->_request->getParams());\n //unset($_REQUEST);\n exit;\n }", "public function delete_assets_category() {\n\t\t\n\t\tif($this->input->post('type')=='delete_record') {\n\t\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t$id = $this->uri->segment(4);\n\t\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t$result = $this->Assets_model->delete_assets_category_record($id);\n\t\t\tif(isset($id)) {\n\t\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_deleted');\n\t\t\t} else {\n\t\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t\t}\n\t\t\t$this->output($Return);\n\t\t}\n\t}", "public function DeleteGroupCategory() {\n\t\t\t$this->objGroupCategory->Delete();\n\t\t}", "function deleteCategory($id) {\n\t$sql = \"DELETE FROM category WHERE id=:id\";\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->prepare($sql); \n\t\t$stmt->bindParam(\"id\", $id);\n\t\t$stmt->execute();\n\t\t$db = null;\n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}", "function deleting_categories (){\r\n if(isset($_GET['delete'])){\r\n $delete_cat_id_get = $_GET['delete'];\r\n $delete_cat_id_get = escape($delete_cat_id_get) ;\r\n $sql = \"DELETE FROM categories WHERE cat_id ='$delete_cat_id_get' \";\r\n $result = execute($sql);\r\n confirm($sql); \r\n redirect('categories.php');\r\n }\r\n \r\n}", "function delete(){\n if(isset($_GET['id'])){\n eliminar_categoria($_GET['id']); \n }\n }", "public function deleted(Category $category)\n {\n //\n }", "function deleteCategoryMeta($cat_id) {\n\t\t$course_meta = new CourseMeta($cat_id);\n\t\t$course_meta->delete();\n\t}", "public function supcat($id)\n{\n $this->categories->delCat($id);\n redirect('administration/categorie');\n}", "public function delete($id_category){\n $category = \\App\\Models\\Category::find($id_category); // find the id and save it to variable category\n $category->delete();\n return redirect('/category')->with('success', 'Delete data success');\n }", "public function deleteCategory($cat_id)\n {\n DB::table('categories')->where('id',$cat_id)->delete();\n // Display a toaster Deleted message..\n $notification = array(\n 'message' => 'Category Deleted successfully.',\n 'alert-type' => 'success'\n );\n return Redirect()->back()->with($notification);\n }", "public static function deleteCategoryController(){\n\n\n \t \t if (isset($_POST[\"editCategoryId\"])) {\n\n\n \t \t \t\t\t// NOTA: Se pasa un valor entero como array ya que el modelo de productos recibe de varios métodos\n \t \t\t\t\t\t$dataController = array(\"idcategory\"=>$_POST[\"editCategoryId\"]);\n\n \t \t\t\t\t\t// Esta variable se envía al modelos para proceder a eliminar la categoria\n \t \t\t\t\t\t$dataIdCategoryController = $_POST[\"editCategoryId\"];\n\n \t \t\t\t\t\t// VER PRODUCTOS ASOCIADOS A LA CATEGORIA\n\t\t\t\t\t\t// $answerProducts = productsModel::ViewProductById($dataController, \"productos\");\n\n\t\t\t\t\t\t// foreach ($answerProducts as $row => $item) {\n\n\t\t\t\t\t\t// $dataProductController = array(\"id\"=>$item[\"id\"], \"idcategory\"=>0, \"enable\"=> 1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// $answerDeleteProducts = productsModel::disableProductByIdCategory($dataProductController, \"productos\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$answerDeleteCategory = categorieModel::deleteCategoryModel($dataIdCategoryController, \"categorias\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t \t\tif ($answerDeleteCategory == 1) {\n\n\t \t\t\t\t\techo '<script >swal({\n\n\t\t\t\t\t\t\t\ttitle: \"¡OK!\",\n\t\t\t\t\t\t\t\ttext: \"¡Categoría eliminada correctamente!\",\n\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\tfunction(isConfirm){\n\n\t\t\t\t\t\t\t\t\tif (isConfirm) {\n\n\n\t\t\t\t\t\t\t\t\t\twindow.location = \"categories\";\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t</script>';\n\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\techo \"error\";\n\n\t \t\n\t\t\t\t\t\t\t\t }\n\t\t\t\t \t\t}\n\t\t\t\t}", "function Category_delete($id){\n $data= Category::findOrFail($id);\n $data -> delete();\n\n return back();\n }", "public function delete_category() {\r\n $id = $this->uri->segment(3);\r\n $delete = $this->faq_model->delete_menu($id);\r\n\r\n if ($delete) {\r\n $this->session->set_flashdata('succ_msg', 'Menu Deleted Successfully');\r\n } else {\r\n $this->session->set_flashdata('error_msg', 'Unable to Delete Successfully');\r\n }\r\n redirect(base_url() . 'faq/category_list');\r\n }", "function delete_category($action, $id)\r\n{\r\n\tglobal $dropbox_cnf;\r\n\tglobal $_user, $is_courseAdmin, $is_courseTutor;\r\n\r\n\t// an additional check that might not be necessary\r\n\tif ($action=='deletereceivedcategory')\r\n\t{\r\n\t\t$sentreceived='received';\r\n\t\t$entries_table=$dropbox_cnf['tbl_post'];\r\n\t\t$id_field='file_id';\r\n\t}\r\n\telseif ($action=='deletesentcategory')\r\n\t{\r\n\t\t$sentreceived='sent';\r\n\t\t$entries_table=$dropbox_cnf['tbl_file'];\r\n\t\t$id_field='id';\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// step 1: delete the category\r\n\t$sql=\"DELETE FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"' AND $sentreceived='1'\";\r\n\t$result=api_sql_query($sql);\r\n\r\n\t// step 2: delete all the documents in this category\r\n\t$sql=\"SELECT * FROM \".$entries_table.\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t$result=api_sql_query($sql);\r\n\r\n\twhile ($row=mysql_fetch_array($result))\r\n\t{\r\n\t\t$dropboxfile=new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor);\r\n\t\tif ($action=='deletereceivedcategory')\r\n\t\t{\r\n\t\t\t$dropboxfile->deleteReceivedWork($row[$id_field]);\r\n\t\t}\r\n\t\tif ($action=='deletesentcategory')\r\n\t\t{\r\n\t\t\t$dropboxfile->deleteSentWork($row[$id_field]);\r\n\t\t}\r\n\t}\r\n}", "function deleteAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');//lay id cua record can xoa\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t//tien hanh xoa\n\t\t\tif($myProductCat->delete())\n\t\t\t{\n\t\t\t\t$redirectMsg = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succDelete']);\n\t\t\t\t\n\t\t\t\t$this->registry->me->writelog('ProductCategorydelete', $myProductCat->id, array('name' => $myProductCat->name[$langCode])); \t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$redirectMsg = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['errDelete']);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t}\n\t\t\n\t\t$this->registry->smarty->assign(array('redirect' => $this->getRedirectUrl(),\n\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));\n\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t\t\n\t}", "public function page_delete_cat()\n\t{\n\t\tif (check_confirm())\n\t\t{\n\t\t\tif ($this->id > 0)\n\t\t\t{\n\t\t\t\t// On met a jour l'ordre des categories\n\t\t\t\t$sql = 'SELECT cat_order\n\t\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat\n\t\t\t\t\t\tWHERE cat_id = ' . $this->id;\n\t\t\t\t$cat_order = Fsb::$db->get($sql, 'cat_order');\n\t\t\t\tif (!$cat_order)\n\t\t\t\t{\n\t\t\t\t\tDisplay::message('no_result');\n\t\t\t\t}\n\n\t\t\t\tFsb::$db->update('smilies_cat', array(\n\t\t\t\t\t'cat_order' =>\tarray('(cat_order - 1)', 'is_field' => true),\n\t\t\t\t), 'WHERE cat_order > ' . $cat_order);\n\n\t\t\t\t// Suppression de la categorie\n\t\t\t\t$sql = 'DELETE FROM ' . SQL_PREFIX . 'smilies_cat\n\t\t\t\t\t\tWHERE cat_id = ' . $this->id;\n\t\t\t\tFsb::$db->query($sql);\n\n\t\t\t\t$sql = 'DELETE FROM ' . SQL_PREFIX . 'smilies\n\t\t\t\t\t\tWHERE smiley_cat = ' . $this->id;\n\t\t\t\tFsb::$db->query($sql);\n\t\t\t\tFsb::$db->destroy_cache('smilies_');\n\t\t\t}\n\n\t\t\tLog::add(Log::ADMIN, 'log_smiley_delete_cat');\n\t\t\tDisplay::message('adm_smiley_well_cat_delete', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t\telse if (Http::request('confirm_no', 'post'))\n\t\t{\n\t\t\tHttp::redirect('index.' . PHPEXT . '?p=posts_smiley');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDisplay::confirmation(Fsb::$session->lang('adm_smiley_delete_cat_confirm'), 'index.' . PHPEXT . '?p=posts_smiley', array('mode' => $this->mode, 'id' => $this->id));\n\t\t}\n\t}", "public function delete(){\n $sql = \"DELETE FROM categorias WHERE id={$this->getId()}\";\n $delete = $this->db->query($sql);\n\t\t$result = false;\n\t\tif($delete){\n\t\t\t$result = true;\n\t\t}\n\t\treturn $result;\n }", "private function delCategory($idx) {\n \t$query = Category::find()->where('ID != 1 && PARENTID='.$idx)->all();\n \tforeach($query as $items) {\n \t\t$this->delCategory($items['ID']);\n \t}\n\n \t$Postmodel = Products::findAll(['CATEGORYID'=>$idx]);\n \tforeach($Postmodel as $items) {\n \t\t$items->CATEGORYID = 0;\n \t\t$items->save();\n \t}\n \t$this->findModel_category($idx)->delete();\n }", "public function deleteCategory(int $id): void\n {\n }", "function remove_category($category_id) {\n\t\t$category_image_query = olc_db_query(\"SELECT categories_image FROM \".TABLE_CATEGORIES.\" WHERE categories_id = '\".olc_db_input($category_id).\"'\");\n\t\t$category_image = olc_db_fetch_array($category_image_query);\n\n\t\t$duplicate_image_query = olc_db_query(\"SELECT count(*) AS total FROM \".TABLE_CATEGORIES.\" WHERE categories_image = '\".olc_db_input($category_image['categories_image']).\"'\");\n\t\t$duplicate_image = olc_db_fetch_array($duplicate_image_query);\n\n\t\tif ($duplicate_image['total'] < 2) {\n\t\t\tif (file_exists(DIR_FS_CATALOG_IMAGES.'categories/'.$category_image['categories_image'])) {\n\t\t\t\t@ unlink(DIR_FS_CATALOG_IMAGES.'categories/'.$category_image['categories_image']);\n\t\t\t}\n\t\t}\n\n\t\tolc_db_query(\"DELETE FROM \".TABLE_CATEGORIES.\" WHERE categories_id = '\".olc_db_input($category_id).\"'\");\n\t\tolc_db_query(\"DELETE FROM \".TABLE_CATEGORIES_DESCRIPTION.\" WHERE categories_id = '\".olc_db_input($category_id).\"'\");\n\t\tolc_db_query(\"DELETE FROM \".TABLE_PRODUCTS_TO_CATEGORIES.\" WHERE categories_id = '\".olc_db_input($category_id).\"'\");\n\n\t\tif (USE_CACHE == TRUE_STRING_S) {\n\t\t\tolc_reset_cache_block('categories');\n\t\t\tolc_reset_cache_block('also_purchased');\n\t\t}\n\n\t}", "public function Eliminar(){\n \n \n if (!$this->model->igualar($_REQUEST['id'])) {//si una categoria no esta asignada la puede eliminar\n \n $this->model->Eliminar($_REQUEST['id']);\n header('Location: ?c=Categoria'); \n }\n else{\n \n header('Location: ?c=Categoria&error'); //de lo contrario no se podra eliminar asta que se elimine el cliente que la tiene\n }\n\n\n\n \n \n \n\n\n\n\n \n \n \n }", "function testDeletingCategory()\n {\n \n $this->tester->seeRecord('common\\models\\Category', ['description' => 'abc']);\n\n $category = Category::find()->where(['description' => 'abc'])->One();\n $category->delete();\n\n $this->tester->dontseeRecord('common\\models\\Category', ['description' => 'abc']);;\n }", "function delete_kategori($id_kategori_point)\n {\n return $this->db->delete('kategori',array('id_kategori_point'=>$id_kategori_point));\n }", "function deleteCat(){\n if (isset($_GET['delete'])) {\n global $conn;\n $deletecat=$_GET['delete'];\n $dquery=\"DELETE FROM categores WHERE cat_id={$deletecat}\";\n $dquery_run=mysqli_query($conn,$dquery);\n if (!$dquery_run) {\n echo \"<h1>Delte Query Problrm</h1>\";\n }\n header(\"Location: catagoires.php\");\n }\n }", "function delete_category($FormID) {\r\n $conn = db_connect();\r\n\r\n $query = \"delete from PortfolioCategories\r\n where PortCatID='\".$FormID.\"'\";\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "public function delete_categoria($cat_id) {\n $conectar=parent::conexion();\n parent::set_names();\n $sql=\"UPDATE tm_categoria SET est=0 where cat_id=?\";\n $sql=$conectar->prepare($sql);\n // envia parametro\n $sql->bindValue(1,$cat_id);\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 deleteIndex($category, $id);", "public function delete ($id){\n\t\t\t$this->category_m->delete($id);\n\t\t\tredirect('admin/category');\n\t}", "function deleteProductCategory($connection, int $catId)\n{\n if(is_int($catId))\n {\n if(mysqli_num_rows(mysqli_query($connection, \"SELECT id FROM productCategories WHERE id = '$catId' LIMIT 1\")) == 1)\n {\n $run = mysqli_query($connection , \"DELETE from productCategories WHERE id = '$catId'\");\n if($run)\n {\n return array\n (\n \"result\" => true\n );\n }\n else\n {\n return array\n (\n \"result\" => false,\n \"error\" => mysqli_error($connection)\n );\n }\n\n }\n else\n {\n return array\n (\n \"result\" => false,\n \"error\" => \"Nu s-a gasit nici o categorie in baza id-ului specificat!\"\n );\n }\n }\n else\n {\n return array\n (\n \"result\" => false,\n \"error\" => \"Nici un ID de categorie specificat!\"\n );\n }\n}", "public function delete(int $id)\n {\n // if (is_null($of_category)) {\n // return 'false';\n // }\n \n // if ($of_category->delete()) {\n // return 'success';\n // }\n\n // return 'error'; \n }", "public function category_delete(Request $request)\n {\n $id = $request->id;\n\n $op = $request->op; // get operation number \n\n switch($op) {\n /** Event Categories */\n case 1:\n $model = new Category;\n $entity_id = 1;\n break;\n\n /** Sponsor Categories */\n case 2:\n $model = new SponsorCategory;\n $entity_id = 12;\n break;\n\n /** Offer Categories */\n case 3:\n $model = new OfferCategory;\n $entity_id = 7;\n break;\n\n /** Doctors Specialization Categories */\n case 4:\n $model = new DoctorsCategory;\n $entity_id = 11;\n break;\n\n default:\n return redirect()->back();\n break;\n }\n\n // delete from localization - Arabic version\n try {\n EntityLocalization::where('entity_id', $entity_id)->where('item_id', $id)->delete();\n } catch (\\Exception $ex) {\n return response()->json(['error', 'error deleting arabic']);\n }\n\n // delete from interests - English version\n try {\n $model::where('id', $id)->delete();\n } catch (\\Exception $ex) {\n return response()->json(['error', 'error deleting english']);\n }\n\n // return success response\n return response()->json(['success', 'success']);\n }", "public static function delete_category($id){\n try {\n DB::update(DB_TABLE_CATEGORY)\n ->set(array(\n DB_COLUMN_CATEGORY_DELETE_FLAG => 1,\n DB_COLUMN_CATEGORY_UPDATE_DATETIME => Utility::current_datetime(),\n ))\n ->where(DB_COLUMN_CATEGORY_ID, $id)\n ->execute();\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n }\n }", "public function deletecategory($args)\n {\n if (!SecurityUtil::checkPermission('Dizkus::', \"::\", ACCESS_ADMIN)) {\n return LogUtil::registerPermissionError();\n }\n \n if (isset($args['cat_id'])) {\n // read all the forums in this category\n $forums = $this->readforums(array('cat_id' => $args['cat_id']));\n if (is_array($forums) && count($forums)>0) {\n foreach ($forums as $forum) {\n // remove all forums in this category\n ModUtil::apiFunc('Dizkus', 'admin', 'deleteforum',\n array('forum_id' => $forum['forum_id'],\n 'ok' => 1));\n } //foreach forum\n }\n // now we can delete the category\n return DBUtil::deleteObject($args, 'dizkus_categories', null, 'cat_id');\n }\n \n return LogUtil::registerError($this->__('Error! The action you wanted to perform was not successful for some reason, maybe because of a problem with what you input. Please check and try again.'));\n }", "public function destroy($kw_category_id = 0, $id)\n {\n\n }", "public function deletecategory($id)\n {\n\t\t$this->delete_cat_once($id);\n $this->session->set_flashdata(\"mess\", \"Xóa thành công!\");\n\t\tredirect($_SERVER['HTTP_REFERER']);\n }", "function deleteRecord($id){\n $category=Category::find($id);\n $category->delete();\n }", "public function destroy($category)\n {\n\n $item = BountyCategory::where('id', $category)->delete();\n\n \n \n\n session()->flash('success',\"deleted successfully\");\n return redirect()->back();\n }", "function DeleteCategory()\n{\n if (isset($_POST['deletebtn'])) {\n global $connection;\n\n $connesione = $_POST['deleteImp'];\n\n $delete_query = \"DELETE FROM video_category WHERE id_category='$connesione'\";\n $delete_result = mysqli_query($connection, $delete_query);\n\n if ($delete_result) {\n return header('Location: video_categorie.php?delete=true');\n } else {\n return header('Location: video_categorie.php?delete=false');\n }\n }\n}", "function delete( $catID = -1 )\r\n {\r\n if ( $catID == -1 )\r\n $catID = $this->ID;\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n// $answers =& $this->answers();\r\n\r\n if ( is_array ( $answers ) )\r\n {\r\n foreach ( $answers as $answer )\r\n {\r\n $answer->delete();\r\n }\r\n }\r\n\r\n $res[] = $db->query( \"DELETE FROM eZQuiz_Alternative WHERE ID='$catID'\" );\r\n eZDB::finish( $res, $db );\r\n }", "function delete_advertisment( $category_id )\n\t{\n\n\t\t\t$full_image = $this -> get_category_image_icon( $category_id );\n\t\t\tif( $full_image != \"\" && file_exists( $full_image ) && $full_image != $category_image_icon )\n\t\t\t{\n\t\t\t\tunlink( $full_image );\n\t\t\t}\n\t\t\t\n\t\t\n\t\t$q = \"DELETE FROM title_dev_categories WHERE category_id = \".$category_id;\n\t\t$r = $this -> db -> deleteRecord( $q );\n\t\tif( $r )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function deleteCategory($category_id)\n {\n $category = Category::find($category_id);\n if($category)\n {\n $category->delete();\n $category_mangas = CategoryManga::where('category_id',$category_id)->get();\n foreach ($category_mangas as $category_manga)\n {\n $category_manga->delete();\n }\n }\n\n return redirect(route('panel.listCategory'));\n }", "function delCategory($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "public function delete()\n {\n if(($this->session->userdata('logged_in') != true) && ($this->session->userdata('logged_in_as') != 'admin'))\n {\n redirect('siteadmin', 'refresh');\n }\n \n $category_deletion_type = $this->input->post('category_deletion_type');\n \n /* starts to delete multiple categories */\n if ($category_deletion_type == 'multiple') \n {\n $category_id = $this->input->post('category_id');\n $c \t = 0;\n for( $i = 0; $i < count($category_id); $i++ )\n {\n $id = $category_id[$i];\n\n $check_category = $this->common_model->query_single_row_by_single_source('boutique_products', 'category_id', $id);\n if (count($check_category) == 0)\n {\n if( $this->common_model->delete_data('id', $id, 'boutique_categories') )\n $c++;\n }\n }\n if( $c == 0 )\n $this->session->set_flashdata('error_message', 'Could not delete any category!!');\n \n elseif( $c == 1 )\n $this->session->set_flashdata('success_message', 'A category was deleted successfully');\n \n elseif( $c > 1 )\n $this->session->set_flashdata('success_message', 'Multiple categories were deleted successfully');\n }\n /* ends to delete multiple category */\n \n /* starts to delete single category */\n else {\n $id = $this->input->post('single_category_id');\n $check_category = $this->common_model->query_single_row_by_single_source('boutique_products', 'category_id', $id);\n if (count($check_category) == 0)\n {\n if( $this->common_model->delete_data('id', $id, 'boutique_categories') )\n $this->session->set_flashdata('success_message', 'A category was deleted successfully');\n else\n $this->session->set_flashdata('error_message', 'Could not delete!! The category is in used');\n }\n else\n $this->session->set_flashdata('error_message', 'Could not delete the category!!');\n }\n /* ends to delete single category */ \n \n redirect(base_url().'category', 'refresh');\n }", "public function remove_post()\n {\n $input = $this->input->post();\n $data=$this->Category_model->deleteData($input);\n $this->response(['Item deleted successfully.'], REST_Controller::HTTP_OK);\n }", "public function delete_academic_article_category()\n {\n // check status for delete\n $creator = json_decode($this->input->post('creator'));\n if($creator==null || $creator==''){\n echo 'fail';\n exit;\n }\n $creatorID = $this->Check__model->chk_token($creator);\n $statusUser = $this->Check__model->chk_status($creatorID);\n if( $statusUser != 'admin' ){\n echo 'fail';\n exit ;\n }\n //delete\n $academic_article_categoryID = json_decode($this->input->post('academic_article_categoryID'));\n $academic_article_category['aac_id'] = $academic_article_categoryID;\n $AAC_status = $this->academic_article_model->delete_academic_article_category($academic_article_category);\n if($AAC_status == true){\n echo $academic_article_categoryID ;\n } \n\n }", "public function deletecategory($id)\n {\n\t\t$this->delete_brand_once($id);\t\t\n $this->session->set_flashdata(\"mess\", \"Xóa thành công!\");\n\t\tredirect($_SERVER['HTTP_REFERER']);\n }", "public function destroy($id)\n {\n $del = $this->Category->delete($id);\n if($del): echo \"Category Deleted Successfully\"; else: \"Error deleting this data... Please try again later\"; endif;\n\n\n }", "public function actionDelete()\n\t{\n\t\t$categoryId = $this->_input->filterSingle('product_category_id', XenForo_Input::INT);\n\n\t\tif ($this->isConfirmedPost())\n\t\t{\n\t\t\t$writer = XenForo_DataWriter::create('Brivium_Store_DataWriter_Category');\n\t\t\t$writer->setExistingData($categoryId);\n\n\t\t\tif ($this->_input->filterSingle('move_child_categories', XenForo_Input::BINARY))\n\t\t\t{\n\t\t\t\t$parentCategoryId = $this->_input->filterSingle('parent_category_id', XenForo_Input::UINT);\n\n\t\t\t\tif ($parentCategoryId)\n\t\t\t\t{\n\t\t\t\t\t$parentCategory = $this->_getCategoryModel()->getCategoryById($parentCategoryId);\n\n\t\t\t\t\tif (!$parentCategory)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $this->responseError(new XenForo_Phrase('BRS_specified_destination_category_does_not_exist'));\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// no destination category id, so set it to 0 (root category)\n\t\t\t\t\t$parentCategoryId = 0;\n\t\t\t\t}\n\n\t\t\t\t$writer->setOption(Brivium_Store_DataWriter_Category::OPTION_CHILD_CATEGORY_DESTINATION_PARENT_ID, $parentCategoryId);\n\t\t\t}\n\n\t\t\t$writer->delete();\n\n\t\t\treturn $this->responseRedirect(\n\t\t\t\tXenForo_ControllerResponse_Redirect::SUCCESS,\n\t\t\t\tXenForo_Link::buildAdminLink('store')\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($categoryId)\n\t\t\t{\n\t\t\t\treturn $this->responseReroute('Brivium_Store_ControllerAdmin_Store', 'deleteConfirm');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $this->responseError(new XenForo_Phrase('requested_category_not_found'), 404);\n\t\t\t}\n\t\t}\n\t}", "function categories_delete()\n{\n // Get database information\n $dbconn = xarDBGetConn();\n $xartable = xarDBGetTables();\n\n // Delete categories table\n $query = \"DROP TABLE \".$xartable['categories'];\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n // Delete links table\n $query = \"DROP TABLE \".$xartable['categories_linkage'];\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n // Delete categories ext privileges table\n $query = \"DROP TABLE \".$xartable['categories_ext_privileges'];\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n // Delete module variables\n// xarModDelVar('categories', 'bold');\n xarModDelVar('categories', 'catsperpage');\n\n // Remove module hooks\n if (!xarModUnregisterHook('item', 'new', 'GUI',\n 'categories', 'admin', 'newhook')) return;\n if (!xarModUnregisterHook('item', 'create', 'API',\n 'categories', 'admin', 'createhook')) return;\n if (!xarModUnregisterHook('item', 'modify', 'GUI',\n 'categories', 'admin', 'modifyhook')) return;\n if (!xarModUnregisterHook('item', 'update', 'API',\n 'categories', 'admin', 'updatehook'))return;\n if (!xarModUnregisterHook('item', 'delete', 'API',\n 'categories', 'admin', 'deletehook'))return;\n if (!xarModUnregisterHook('module', 'modifyconfig', 'GUI',\n 'categories', 'admin', 'modifyconfighook'))return;\n if (!xarModUnregisterHook('module', 'updateconfig', 'API',\n 'categories', 'admin', 'updateconfighook'))return;\n if (!xarModUnregisterHook('module', 'remove', 'API',\n 'categories', 'admin', 'removehook')) return;\n\n // UnRegister blocks\n if (!xarModAPIFunc('blocks', 'admin', 'unregister_block_type',\n array('modName' => 'categories',\n 'blockType'=> 'navigation'))) return;\n\n xarTplUnregisterTag('categories-navigation');\n xarTplUnregisterTag('categories-filter');\n xarTplUnregisterTag('categories-catinfo');\n /**\n * Remove instances and masks\n */\n\n // Remove Masks and Instances\n xarRemoveMasks('categories');\n xarRemoveInstances('categories');\n\n // Deletion successful\n return true;\n}", "public function remove(Request $request){\n try{\n $category=Category::where('id',$request->id)->first();\n if($category){\n $category->delete();\n return Response::json(['success'=>'Category removed successfully !']);\n }else{\n return Response::json(['error'=>'Category not found!']);\n }\n }catch(\\Illuminate\\Database\\QueryException $exception){\n return Response::json(['error'=>'Category belongs to an article.So you cann\\'t delete this category!']);\n }\n }", "public function delete(){\n\t\t$ok=false;\t\t\n\t\tif (isset($_POST[\"idCategoria\"])) {\n\t\t\t$tabla = \"categorias\";\t\t\t\n\t\t\t$datos = $_POST[\"idCategoria\"];\t\t\t\n\t\t\t//borro la categoría\n\t\t\t$respuesta = ModeloCategorias::delete($tabla, $datos);\n\t\t\tif ($respuesta == \"OK\") {\n\t\t\t\t$ok=true;\t\n\t\t\t}else {\n\t\t\t\t$ok=false;\t\n\t\t\t}\n\t\t}\n\t\treturn json_encode($ok);\n\t}", "function delete( $catID = -1 )\r\n {\r\n if ( $catID == -1 )\r\n $catID = $this->ID;\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $alternatives =& $this->alternatives();\r\n if ( is_array( $alternatives ) )\r\n {\r\n foreach ( $alternatives as $alternative )\r\n {\r\n $alternative->delete();\r\n }\r\n }\r\n\r\n $res[] = $db->query( \"DELETE FROM eZQuiz_Question WHERE ID='$this->ID'\" );\r\n eZDB::finish( $res, $db );\r\n\r\n }", "public function destroy($id)\n {\n\n $cat= Category::find($id); //fetch data\n $cat->delete(); // Data delete\n return redirect('category');\n }", "public function delete(Request $request,$id){\n\t\t$cat = new category();\n\t\t$cat->where(\"pk_category_news_id\",\"=\",$id)->delete();\n\t}", "public function remove() {\n if ( is_null( $this->id ) )\n return;\n\n $this->prepare(\n 'DELETE FROM `categories` WHERE `category_id` = :category_id OR `parent_category_id` = :parent_category_id'\n , 'ii'\n , array( ':category_id' => $this->id, ':parent_category_id' => $this->id )\n )->query();\n }", "function eliminar_Categoria(){\n try{\n $conexion = Conexion(); \n $sql = \"DELETE FROM tbl_categoria WHERE id_categoria = '$this->id';\"; \n $conexion->query($sql);\n echo\"<script type=\\\"text/javascript\\\">alert('Catalogo Eliminado'); window.location='../Vista/Categoria.php'; </script>\";\n }catch (Exception $e){\n echo\"<script type=\\\"text/javascript\\\">alert('Este catalogo contiene productos asociados, Implosible eliminar. '); window.location='../Vista/Categoria.php'; </script>\";\n } \n }", "function shophead_deleted($category_id = \"\")\n {\n $id = base64_decode($category_id);\n $categroy_data = $this->ProductCategory->find('first', array('conditions' => array('ProductCategory.id' => $id)));\n \n App::import('Model', 'ProductSubCategory');\n $this -> ProductSubCategory = new ProductSubCategory();\n $subcategories=$this->ProductSubCategory->find(\"list\",array('conditions'=>array(\"ProductSubCategory.product_category_id\"=>$id)));\n \n if(count($subcategories)==0){\n if (!empty($categroy_data)) {\n $new_business_data = $categroy_data['ProductCategory']['id'];\n if ($this->ProductCategory->delete($new_business_data)) {\n $this->Session->write('flash', array(DELETE_RECORD, 'success'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n } else {\n $this->Session->write('flash', array(FAILURE_MSG, 'failure'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n } else {\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }else{\n $this->Session->write('flash', array(CAT_CHILD_EXIST, 'failure'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }", "public function testSuccessDeleteCategory()\n {\n $service = $this->app->make(CategoryServiceInterface::class);\n\n $categoryA = 'categoryA' ;\n \n $service = $this->app->make(CategoryServiceInterface::class);\n $cateA = $service->save(null, $categoryA);\n\n $this->assertDatabaseHas('categories', [\n 'name' => $categoryA\n ]);\n \n $service->delete($cateA->id);\n $this->assertDatabaseMissing('categories', [\n 'name' => $categoryA\n ]);\n }" ]
[ "0.806734", "0.7868333", "0.78312993", "0.78284895", "0.77868664", "0.77768135", "0.76278305", "0.76135665", "0.7610701", "0.75457287", "0.74990773", "0.7480619", "0.7477582", "0.74124753", "0.7352465", "0.7316523", "0.73014915", "0.7295821", "0.7279788", "0.7262396", "0.7240054", "0.72320944", "0.7219742", "0.7192954", "0.7188458", "0.71817195", "0.71525186", "0.714635", "0.71363646", "0.7136058", "0.71297437", "0.7114257", "0.70738894", "0.7065047", "0.7064203", "0.7047622", "0.70445305", "0.70419186", "0.7035403", "0.7034129", "0.7031545", "0.7020338", "0.7013391", "0.69988865", "0.69975406", "0.6991665", "0.69842744", "0.6970412", "0.6967615", "0.6958654", "0.6953799", "0.6952343", "0.69514924", "0.6948974", "0.6945745", "0.69439685", "0.6939732", "0.69220495", "0.6895176", "0.6890786", "0.68731713", "0.6872957", "0.68696123", "0.68636024", "0.68592006", "0.6858976", "0.6855571", "0.68555576", "0.68553257", "0.6851676", "0.6851046", "0.6846012", "0.68447024", "0.68372333", "0.68369925", "0.6813099", "0.6808826", "0.6808392", "0.6807148", "0.68056405", "0.6805319", "0.6801279", "0.67920715", "0.67884076", "0.67826724", "0.6780266", "0.67647886", "0.67534477", "0.6743585", "0.6730156", "0.6726647", "0.6724934", "0.67195696", "0.6716687", "0.66980183", "0.66941833", "0.6693156", "0.66893125", "0.6688895", "0.6681281" ]
0.7691669
6
function to get printer that would to print this category on it
public function get_printer() { $data['get_printer'] = $this->Category_crud->get_printer(); return $data['get_printer']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPrinter();", "public function getPrinter()\n {\n return $this -> printer;\n }", "public function getPrinter()\n {\n return $this->printer;\n }", "function GetPrinterName() { return 'natbib'; }", "function printer_create_dc($printer_handle)\n{\n}", "public function getPrintClip() {}", "public function get_print_instance() {\n\n\t\treturn $this->print;\n\t}", "public function getPrintArea() {}", "public function getPrint() {\r\n\t\treturn $this->getPrintCanvas() . $this->getPrintJavaScriptHTML();\r\n\t}", "public function get_category_permastruct()\n {\n }", "function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}", "public function getArticleProductPrintSides();", "function initializePrintCategory($cid) {\n checkService('print', $cid);\n if (is_null(get_print_category($cid)) || count(get_print_category($cid)) == 0 || empty($_SESSION['cart']['print'][$cid])) {\n unset($_SESSION['cart']['print'][$cid]);\n return;\n }\n $dlt_count = 0;\n foreach ($_SESSION['cart']['print'][$cid] as $key=>$prod) {\n if (!array_key_exists('quantity', $prod) || $prod['quantity'] == -1) {\n if (array_key_exists('filepath', $prod))\n unlink(url_to_path($prod['filepath']));\n array_splice($_SESSION['cart']['print'][$cid], $key - $dlt_count, 1);\n $dlt_count++;\n }\n }\n}", "public function category() {\n\t\treturn static::get_thrive_basic_label();\n\t}", "public function getPrint() {\n\t\treturn 'new google.maps.Marker(' . $this->getPrintOptions() . ')';\n\t}", "function wc_marketplace_category() {\n global $wmp;\n $wmp->output_report_category();\n }", "public function getWillPrint() {}", "function print_categories( $thisId ) { \n $thisCat = get_the_category( $thisId );\n foreach( $thisCat as $cat ) {\n echo $cat->slug . \" \";\n }\n}", "public static function USBPrint($printerIp)\n {\n// $printer = new Printer($connector);\n $connector = new NetworkPrintConnector($printerIp, 9100);\n $printer = new Printer($connector);\n return $printer;\n }", "public function getPrintOptions() {\r\n\t\treturn $this->options->getPrint();\r\n\t}", "public function get_category()\n {\n return C__CATG__INVOICE;\n }", "public function category() {\n\t\treturn static::get_thrive_advanced_label();\n\t}", "function primary_category_name() {\n\n\tglobal $post_id;\n\t$term = get_the_terms( $post_id, 'primary-category' );\n\tif ( ! $term ) {\n\t\treturn;\n\t} else {\n\t\techo $term[0]->name;\n\t}\n\n}", "public function getPrintCanvasId() {\r\n\t\treturn $this->getCanvasId();\r\n\t}", "public function get_category()\n {\n return C__CATG__VOIP_PHONE_LINE;\n }", "public function get_report_category()\r\n {\r\n return $this->m_report_category;\r\n }", "public function get_category()\n {\n return 'Information Display';\n }", "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 getPrint() {\n\t\treturn (($this->type !== '' && count($this->coords) > 0) ? sprintf('{ \\'type\\': \\'%s\\' }', $this->type, '[' . implode('], [', $this->coords) . ']') : 'null');\n\t}", "public function getPrettyPrinter()\n {\n return $this->prettyPrinter;\n }", "public function __toString() {\n\t\treturn $this->getPrint();\n\t}", "function AfficheImprimante($display_print)\r\n{\r\n\r\n if ($display_print) {\r\n\r\n echo \"<ul id=\\\"ButtonBarPrint\\\">\";\r\n echo \"<li id=\\\"ButtonBarPrint1\\\">\";\r\n\t echo \"<a href='javascript:window.print()'></a>\";\r\n echo \"</li>\";\r\n echo \"</ul>\";\r\n\r\n }\r\n}", "public function getCategory()\n {\n return \"Injection Flaws\"; //See category.php for list of all the categories\n }", "public function category() {\n\t\treturn $this->get_category();\n\t}", "public function toString() {\n return $this->getClassName(). '<'.$this->cat->toString().'>';\n }", "function printer_close($printer_handle)\n{\n}", "public function getCategory(){\r\n return Mage::registry('current_category');\r\n }", "public function getDidPrint() {}", "public function getPrintFlag() {}", "function the_category() {\n\tglobal $discussion;\n\treturn $discussion['category'];\n}", "private function getCategory() {\n return '';\n }", "public function getProdCategory()\n {\n return $this->prod_category;\n }", "public function getPaper()\n {\n return $this->paper;\n }", "function com_print_typeinfo($comobject, $dispinterface = null, $wantsink = false) {}", "public function selectByPrinter($printerID){\n\t\t$this->db->join('compatibilities', 'printerID = ' . $printerID);\n\t\t$this->db->where('compatibilities.productID = products.ID');\n\t\t$this->db->where('products.available = 1');\n\t\treturn $this->db->get('products')->result();\n\t}", "function printlist($idcat){\n\t\n\t$cats0 = bucleCatPDF('',$idcat); // devuelve todas las categorias de la categoria\n\tif (count($cats0)>0){ // si hay categorias\n\t\tforeach ( $cats0 as $cat0 ){\n\t\t\t$prods = getProductsByCat($cat0['id']); // devuelte todos los productos de esa categoria\n\t\t\tif( is_array($prods) && count($prods)>0 ){ // si hay productos en esa categoria \n\t\t\t\t$_html = renderCategoriaxProducto($cat0['id']);\t// imprime todos los productos de esa categoria\n\t\t\t\techo $_html;\t\t\t\t\t\t\t\t\t\t\t\t\t// param1: idcat, param2: nombre categoria\n\t\t\t}else{ // si no hay productos en esa categoria\n\t\t\t\tprintlist($cat0['id']);\t// paso a la sig. categoria\n\t\t\t}\t\t\t\n\t\t}\n\t}else{ // si no hay categorias \n\t\t$prods = getProductsByCat($idcat); // prueba suerte si hay productos\n\t\t$categoria = new Categoria($idcat); // creo instancia de categoria para crear nombre \n\t\tif( is_array($prods) && count($prods)>0 ){ // si hay productos\n\t\t\t$_html = renderCategoriaxProducto($idcat);\t // imprimo los productos de esa categoria\n\t\t\techo $_html;\n\t\t}\n\t}\t }", "public function get_category()\n {\n return 'Graphical';\n }", "public function get_category()\n {\n return 'Graphical';\n }", "public function getProduct_category () {\n\t$preValue = $this->preGetValue(\"product_category\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_category\")->preGetData($this);\n\treturn $data;\n}", "public function getDocumentProductCfop()\n {\n return (string) $this->document_product_cfop;\n }", "public function get_category(){\n\t\treturn $this->category;\n\t}", "function printPreviewTitle($printpage){\n\tif($printpage==\"mortality_sales\"){\n\t\treturn \"MORTALITY AND SALES REPORTS\";\n\t}elseif($printpage==\"farrowing_reports\"){\n\t\treturn \"FARROWING RECORDS\";\n\t}elseif($printpage==\"breeding_list\"){\n\t\treturn \"BREEDING RECORDS\";\n\t}elseif($printpage==\"promotionreport\"){\n\t\treturn \"PROMOTION RECORDS\";\n\t}elseif($printpage==\"calendarreport\"){\n\t\treturn \"CALENDAR MONITORING\";\n\t}elseif($printpage==\"experimentreport\"){\n\t\treturn \"EXPERIMENT RECORDS\";\n\t}elseif($printpage==\"morpologyreport\"){\n\t\treturn \"GROSS MORPOLOGY RECORDS\";\n\t}elseif($printpage==\"morpometricreport\"){\n\t\treturn \"MORPOMETRIC RECORDS\";\n\t}elseif($printpage==\"slaughtered\"){\n\t\treturn \"SLAUGHTERED RECORDS\";\n\t}elseif($printpage==\"insemination\"){\n\t\treturn \"INSEMINATION RECORDS\";\n\t}elseif($printpage==\"inventory\"){\n\t\treturn \"LIVESTOCK INVENTORY RECORD\";\n\t}elseif($printpage==\"santa_cruz\"){\n\t\treturn \"SANTA CRUZ FARMER POPULATION\";\n\t}elseif($printpage==\"torrijos\"){\n\t\treturn \"TORRIJOS FARMER POPULATION\";\n\t}elseif($printpage==\"buenavista\"){\n\t\treturn \"BUENAVISTA FARMER POPULATION\";\n\t}elseif($printpage==\"gasan\"){\n\t\treturn \"GASAN FARMER POPULATION\";\n\t}elseif($printpage==\"boac\"){\n\t\treturn \"BOAC FARMER POPULATION\";\n\t}elseif($printpage==\"mogpog\"){\n\t\treturn \"MOGPOG FARMER POPULATION\";\n\t}elseif($printpage==\"dailyInventory\"){\n\t\treturn \"Native Pig Monthly Inventory\";\n\t}elseif($printpage==\"stat\"){\n\t\treturn \"Statistical Reports\";\n\t}elseif($printpage==\"scprint\"){\n\t\treturn \"Native Pig Population in Santa Cruz\";\n\t}elseif($printpage==\"torrijosprint\"){\n\t\treturn \"Native Pig Population in Torrijos\";\n\t}elseif($printpage==\"buenavistaprint\"){\n\t\treturn \"Native Pig Population in Buenavista\";\n\t}elseif($printpage==\"gasanprint\"){\n\t\treturn \"Native Pig Population in Gasan\";\n\t}elseif($printpage==\"boacprint\"){\n\t\treturn \"Native Pig Population in Boac\";\n\t}elseif($printpage==\"mogpogprint\"){\n\t\treturn \"Native Pig Population in Mogpog\";\n\t}elseif($printpage==\"printfarmerperbarangay\"){\n\t\treturn \"PRINT FARMER PER BARANGAY\";\n\t}\n\n\n\n\n}", "public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }", "public function getPrintScaling() {}", "function comic_display($filter = 'default') { echo get_comic_url('comic', null, $filter); }", "public function getPrintButton()\n {\n $data['id'] = $this->getRma()->getId();\n return $this->getUrl('adminhtml/rma/printPackage', $data);\n }", "public function getCurrentCategory()\n {\n return $this->registry->registry('current_category');\n }", "function getPagetop () {\n\t\t$this->_goTop();\n\t\t$this->_goFin();\n\t\treturn $this->_roof[\"dtd\"].implode(\"\\n\",$this->_roof[\"meta\"]).\"\\n\".implode(\"\\n\",$this->_roof[\"cuerpo\"]).$this->_roof[\"fin\"];\n\t}", "public function get_catR()\n {\n return $this->_catR;\n }", "function getDocumentCategoryTplInfo()\n\t{\n\t\t$oModuleModel = getModel('module');\n\t\t$oMemberModel = getModel('member');\n\t\t// Get information on the menu for the parameter settings\n\t\t$module_srl = Context::get('module_srl');\n\t\t$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);\n\t\t// Check permissions\n\t\t$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));\n\t\tif(!$grant->manager) return new Object(-1,'msg_not_permitted');\n\n\t\t$category_srl = Context::get('category_srl');\n\t\t$category_info = $this->getCategory($category_srl);\n\t\tif(!$category_info)\n\t\t{\n\t\t\treturn new Object(-1, 'msg_invalid_request');\n\t\t}\n\n\t\t$this->add('category_info', $category_info);\n\t}", "function rnf_postie_default_trip_category($category) {\n // Geo functions are provided by the rnf-geo plugin, check for it:\n if (!function_exists('rnf_geo_current_trip')) {\n return $category;\n }\n\n // Get the current trip\n $current = rnf_geo_current_trip();\n\n // If there is one _and_ it has an associated category, pass its ID\n if ($current && !empty($current->wp_category)) {\n return $current->wp_category->term_id;\n }\n\n return $category;\n}", "public function __toString()\n {\n return $this->categoryName;\n }", "function printableString () {\n \t\t$classname = get_class($this);\n \t\t$string = 'a';\n \t\t\n \t\tif (in_array(strtolower($classname[0]), array('a', 'e', 'i', 'o', 'u')))\n \t\t\t$string .= 'n';\n \t\t\n \t\t$classname[0] = strtoupper($classname[0]);\n \t\t$string .= ' '.$classname;\n \t\t\n \t\treturn $string;\n \t}", "function get_category_link($category)\n {\n }", "public function getPrintState() {}", "public function getCategory()\n {\n }", "function list_categories() {\n $project_parent_category = get_category_by_slug('project');\n $project_parent_category_id=$project_parent_category->term_id;\n $categories=get_the_category();\n $count = 0;\n foreach($categories as $category){\n if($category->category_parent==$project_parent_category_id){\n if ($count == 0) {\n echo '<div class=\"category-symbology\">';\n\n if(get_post_type(get_the_id()) == 'discussion') { echo '<i class=\"social-foundicon-chat\"> </i> '; }\n }\n echo \"<a class='one-category' href='/project/\". $category->slug . \"'>\" . $category->name . \"</a>\";\n if ($count == 0) {\n echo '</div>';\n } \n $count++;\n }\n }\n\n //emit a chat symbol for discussion\n if($count == 0 && get_post_type(get_the_id()) == 'discussion') {\n generate_discussion_w_no_category();\n }\n}", "public function getPrintCanvas() {\r\n\t\t$size = array();\r\n\t\tif ($this->height) $size[] = 'height: ' . $this->height . 'px';\r\n\t\tif ($this->width) $size[] = 'width: ' . $this->width . 'px';\r\n\t\t$style = (count($size) > 0 ? ' style=\"' . implode('; ', t3lib_div::removeArrayEntryByValue($size, NULL)) . ';\"' : '');\r\n\t\treturn LF . '<div id=\"' . $this->getPrintCanvasId() . '\"' . $style . '></div>';\r\n\t}", "public function get_category()\n {\n return $this->primary_category();\n }", "public function getCategory() {}", "function getCategory() \n {\n return $this->instance->getCategory();\n }", "private function retrieve_category_description() {\n\t\treturn $this->retrieve_term_description();\n\t}", "public static function getCategory()\n {\n return self::$category;\n }", "function get_cat_name($cat_id)\n {\n }", "public function getDisplay();", "abstract protected function handlePrinterData(string $info, string $default_printer): Printer;", "function primary_category() {\n\n\tglobal $post_id;\n\t$term = get_the_terms( $post_id, 'primary-category' );\n\tif ( ! $term ) {\n\t\treturn;\n\t} else {\n\t\techo '<a class=\"primary-category-link\" href=\"' . get_home_url() . '/' . $term[0]->taxonomy . '/' . $term[0]->slug . '\"><strong>' . $term[0]->name . '</strong></a>';\n\t}\n\n}", "function getCategory()\r\n\t\t{\r\n\t\t\treturn $this->category;\r\n\t\t\t\r\n\t\t}", "function get_linkcatname($id = 0)\n {\n }", "public function __toString()\n {\n return $this->nomcat;\n }", "public function token_the_category() {\n\t\treturn implode( ', ', wp_list_pluck( (array)get_the_category(), 'name' ) );\n\t}", "public function __toString(){\n return $this->nomConsole;\n // to show the id of the Category in the select\n // return $this->id;\n }", "function get_catname($cat_id)\n {\n }", "function _get_path_print($pid) {\n\t\t\t\t$path = $this->_get_path($pid);\n\t\t\t\tif (is_error($path)) return $path->txt;\n\t\t\t\t\n\t\t\t\t$ret = '';\n\t\t\t\tforeach($path as $node) $ret .= '/'.$node['name'];\n\t\t\t\treturn $ret;\n\t\t\t}", "function getPrintStyles(){\r\n require $this->sRessourcesFile;\r\n if (in_array(\"print_styles\", $this->aSelectedFields)){\r\n $aParams['sSchemaVmap'] = array('value' => $this->aProperties['schema_vmap'], 'type' => 'schema_name');\r\n $aParams['user_id'] = array('value' => $this->aValues['my_vitis_id'], 'type' => 'number');\r\n $oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getUserPrintStyles'], $aParams);\r\n\t\t$sListPrintStyleId = \"\";\r\n $aListPrintStyleId = array();\r\n\t\twhile($aLigne=$this->oConnection->oBd->ligneSuivante ($oPDOresult)) {\r\n\t\t\tif ($sListPrintStyleId == \"\"){\r\n\t\t\t\t$sListPrintStyleId = $aLigne[\"printstyle_id\"];\r\n\t\t\t}else{\r\n\t\t\t\t$sListPrintStyleId .= \"|\".$aLigne[\"printstyle_id\"];\r\n\t\t\t}\r\n $aListPrintStyleId[] = $aLigne[\"name\"];\r\n\t\t}\r\n\t\t$oPDOresult=$this->oConnection->oBd->fermeResultat();\r\n $this->aFields['print_styles'] = $sListPrintStyleId;\r\n $this->aFields['print_styles_label'] = implode(',', $aListPrintStyleId);\r\n }\r\n }", "public function printings() {\n return $this->hasMany('Rockit\\Models\\Printing');\n }", "function showRetailerCategories( )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories WHERE status = 1 and category_type = 1 order by \tsort_order asc \";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "function hwm_label_printer_form() {\n if( current_user_can('administrator' ) )\n return gravity_form( 22 );\n}", "public static function setPrinter($printer)\n {\n //buscar os dados referente a impressora na base de dados\n //estabelecer qual interface usar (CUPS, REDE, QZ, FILE, etc.)\n //estabelecer qual template usar:\n // Zebra ZPL2,\n // Zebra/Eltron ELP2,\n // Argox PPLA/PPLB,\n // Intermec IPL,\n // DataMax DPL, etc.)\n //carrega classe de acesso a base de dados\n $dbase = new DBase();\n //carrega impressoras\n self::$printer = $dbase->getPrinter($printer);\n \n }", "function printCategory($row, $name, $pretty, $displayPurchases, $readOnly, $modifyList, $i, $last, $printConsider = 0){\n\n // handle any special categories first\n if($row[\"catSortOrder\"] < 0){\n if($row[\"catSortOrder\"] == -1000){\n if($row[\"catSubDescription\"] != \"\"){\n print \"\\n<table width=100% border=0 cellpadding=0 cellspacing=0>\";\n print \"<tr><td valign=top>\\n\";\n print \"<table cellpadding=0 cellspacing=0><tr><td>\\n\";\n print $row[\"catSubDescription\"];// . \"<br>&nbsp;\\n\";\n print \"</td></tr><tr><td>&nbsp;</td></tr></table>\\n\";\n print \"</td></tr></table>\\n\";\n }\n return;\n }\n if($printConsider == 0 and $row[\"catSortOrder\"] == -10000)\n return;\n }\n\n print \"\\n<table width=100% border=0 cellpadding=0 cellspacing=0><tr>\\n\";\n\n if($modifyList){\n print \"<td valign=top style=\\\"border-bottom: 1px solid rgb(128,255,128);\\\">\";\n }\n else{\n print \"<td valign=top>\";\n }\n\n print \"\\n<table cellpadding=0 cellspacing=0>\";\n print \"<tr>\";\n\n if($modifyList and $row[\"catSortOrder\"] != -10000){\n ?>\n <td NOWRAP class=goldenRod valign=top>\n <a class=\"menuLink\" href=\"editCategory.php?cso=<?php echo $row[\"catSortOrder\"] ?>&cid=<?php echo $row[\"cid\"] ?>&cname=<?php echo $row[\"name\"] ?>\">[edit]</a>\n <a class=\"menuLinkRed\" title=\"Click this to delete the category\" href=\"deleteCategory.php?cso=<?php echo $row[\"catSortOrder\"] ?>&cid=<?php echo $row[\"cid\"] ?>&cname=<?php echo $row[\"name\"] ?>&referrer=modifyList.php\">[del]</a>\n<?php \n if ($last == 1){\n print \"<img width=26px height=26px src=\\\"../images/space.GIF\\\">\";\n }\n else{\n if ($i != 0){\n print \"<a href=\\\"moveCategory.php?dir=up&cid=\" . $row[\"cid\"] . \"&cso=\" . $row[\"catSortOrder\"] . \"\\\"><img width=13px height=13px border=0 src=\\\"../images/up_arrow_lightBlue.gif\\\" title=\\\"Click this arrow to move the category up\\\" lowsrc=\\\"../images/space.GIF\\\"></a>\";\n }\n \n if($i != $last - 1){\n print \"<a href=\\\"moveCategory.php?dir=down&cid=\" . $row[\"cid\"] . \"&cso=\" . $row[\"catSortOrder\"] . \"\\\"><img width=13px height=13px border=0 src=\\\"../images/down_arrow_lightBlue.gif\\\" title=\\\"Click this arrow to move the category down\\\" lowsrc=\\\"../images/space.GIF\\\"></a>\";\n if($i == 0){\n print \"<img width=13px height=13px src=\\\"../images/space.GIF\\\">\";\n }\n }\n else{\n print \"<img width=13px height=13px src=\\\"../images/space.GIF\\\">\";\n }\n }\n \n print \"</td><td>\";\n\n }\n else{\n print \"\\n<tr><td>\\n\";\n }\n \n if($row[\"name\"] != \"\"){\n $text = \"<b>\" . $row[\"name\"] . \"</b> \";\n }\n\n if($row[\"description\"] != \"\"){\n $text .= $row[\"description\"] . ' ';\n }\n \n if($row[\"linkname\"] != \"\"){\n $text .= \" - <a href='\" . $row[\"linkurl\"] . \"'>\" . $row[\"linkname\"] . \"</a>\";\n }\n $len = strlen($text);\n\n if($text != \"\"){\n print $text;\n }\n \n\n if($row[\"catSubDescription\"] != \"\"){\n if($text != \"\"){\n print \"<br>\";\n }\n print $row[\"catSubDescription\"];// . \"<br>&nbsp;\";\n }\n \n print \"\\n</td></tr>\\n\";\n print \"</table>\\n\";\n \n print \"</td></tr></table>\\n\";\n\n print \"<table cellpadding=0 cellspacing=0><tr>\";\n\n\n // Now begin iterating through items in this category\n $query = \"select * from items where cid=\" . $row[\"cid\"] . \n \" order by itemSortOrder\";\n\n $rs2 = mysql_query($query) or die(\"Could not query: \" . mysql_error());\n\n $j = 0; \n $last2 = mysql_num_rows($rs2);\n\n // before we print out the item details, need to display either a checkbox\n // or a drop down box to allow people to purchase the item\n while($row2 = mysql_fetch_assoc($rs2)){\n print \"\\n<tr>\\n\";\n \n if($modifyList){\n?>\n <td NOWRAP class=\"goldenRod\" valign=\"top\">\n <a class=\"menuLink\" href=\"editItem.php?iso=<?php echo $row2[\"itemSortOrder\"] ?>&iid=<?php echo $row2[\"iid\"] ?>&cid=<?php echo $row[\"cid\"] ?>&cname=<?php echo $row[\"name\"] ?>\">[edit]</a>\n <a class=\"menuLinkRed\" title=\"Click this to delete the item\" href=\"deleteItem.php?iso=<?php echo $row2[\"itemSortOrder\"] ?>&iid=<?php echo $row2[\"iid\"] ?>&cid=<?php echo $row[\"cid\"] ?>&cname=<?php echo $row[\"name\"] ?>&referrer=modifyList.php\">[del]</a>\n<?php \n\n if($last2 == 1){\n print \"<img width=26px height=13px src=\\\"../images/space.GIF\\\">\";\n }\n else{\n if ($j != 0){\n print \"<a href=\\\"moveItem.php?dir=up&cid=\" . $row[\"cid\"] . \"&iid=\" . $row2[\"iid\"] . \"&iso=\" . $row2[\"itemSortOrder\"] . \"\\\"><img width=13px height=13px border=0 src=\\\"../images/up_arrow_lyellow.gif\\\" title=\\\"Click this arrow to move the item up\\\" lowsrc=\\\"../images/space.GIF\\\"></a>\";\n }\n \n if($j != $last2 - 1){\n print \"<a href=\\\"moveItem.php?dir=down&cid=\" . $row[\"cid\"] . \"&iid=\" . $row2[\"iid\"] . \"&iso=\" . $row2[\"itemSortOrder\"] . \"\\\"><img width=13px height=13px border=0 src=\\\"../images/down_arrow_lyellow.gif\\\" title=\\\"Click this arrow to move the item down\\\" lowsrc=\\\"../images/space.GIF\\\"></a>\";\n if($j == 0){\n print \"<img width=13px height=13px src=\\\"../images/space.GIF\\\">\";\n }\n }\n else{\n print \"<img width=13px height=13px src=\\\"../images/space.GIF\\\">\";\n }\n }\n\n\n print \"</td>\";\n }\n\n $bought = 0;\n $quantity = 0;\n $iid = $row2[\"iid\"]; \n \n if($row2[\"allowCheck\"] == \"true\"){\n\n if(modifyList == 0){\n $query = \"SELECT sum(quantity) as numBought FROM purchaseHistory WHERE iid=\" . $iid . \" GROUP BY iid\";\n $rs = mysql_query($query) or die(\"Could not query: \" . mysql_error());\n \n if($sumRow = mysql_fetch_assoc($rs)){\n $bought = $sumRow[\"numBought\"];\n } \n }\n\n print \"<td align=right valign=top width=1px>\\n\";\n $quantity = $row2[\"quantity\"];\n \n if($quantity > 1){\n // person wants more than one of the items so use a drop down box \n // instead of a checkbox.\n\n if($displayPurchases == 0) // not displaying purchases so reset bought\n $bought = 0;\n \n if(($quantity - $bought) > 0 and !$readOnly){\n // if the person's desired quantity has not been reached yet, display\n // a drop-down\n\n $titley = \"\";\n if($displayPurchases == 1)\n $titley = \"title=\\\"Select the number you have purchased\\\"\";\n\n print \"<select $titley name=\" . $iid . \">\";\n for($i = 0; $i <= $quantity - $bought; $i++){\n print \"<option value='\" . $i . \"'>\" . $i . \"</option>\";\n }\n }\n else{ // Everything already bought, display disabled drop down\n print \"<select disabled>\";\n }\n print \"</select>\";\n }\n else{\n // person only wants one of the item so display a checkbox\n if($bought > 0){\n // disable the box if the item has already been bought\n $val = \"checked=true disabled=true\";\n }\n else{\n if($readOnly)\n $val = \"disabled=true\";\n else\n $val = \"\";\n }\n \n if($displayPurchases == 0)\n $val = \"\";\n\n $titley = \"\";\n if($displayPurchases == 1)\n $titley = \"title=\\\"Click here if you purchased this item\\\"\";\n\n print \"<input $titley type='checkbox' name='\" . $iid . \"' \" . $val . \">\";\n }\n print \"</td><td>\";\n }\n else{\n // can't check this item off so don't display checkbox or drop down\n print \"<td colspan=2>\";\n }\n \n printItem($row2, $pretty, $name, $quantity, $bought);\n \n print \"\\n</td></tr>\\n\"; \n $j++;\n }\n if($modifyList){\n?>\n</table>\n\n<table width=100% cellspacing=0 cellpadding=0>\n<tr><td class=\"goldenRod\" align=\"center\">\n<b>\n<a class=\"menuLink\" href=\"addItem.php?cid=<?php echo $row[\"cid\"] ?>&cname=<?php echo $row[\"name\"] ?>\">Add New Item to <u><?php echo $row[\"name\"] ?></u></a></b>\n</td></tr>\n<tr><td>&nbsp;</td></tr>\n<?php\n }\n else{\n print \"<tr><td>&nbsp;</td></tr>\"; // blank line\n }\n print \"</table>\";\n}", "protected function c_parsePrinterAttributes() {\n\n //if ($this->clientoutput->status != \"successfull-ok\")\n // return false;\n \n $pr = -1;\n for ($i = 0 ; $i < count($this->clientoutput->response) ; $i++) {\n\t\t\n if ($this->clientoutput->response[$i]['attributes'] == \"printer-attributes\")\n $pr ++;\n\t\t\t\t\n $k = -1; \n for ($j = 0 ; $j < (count($this->clientoutput->response[$i]) - 1) ; $j ++)\n if (!empty($this->clientoutput->response[$i][$j]['name'])) {\n $k++;\n $l = 0;\n $this->parsed[$pr][$k]['range'] = $this->clientoutput->response[$i]['attributes'];\n $this->parsed[$pr][$k]['name'] = $this->clientoutput->response[$i][$j]['name'];\n $this->parsed[$pr][$k]['type'] = $this->clientoutput->response[$i][$j]['type'];\n $this->parsed[$pr][$k][$l] = $this->clientoutput->response[$i][$j]['value'];\n } else {\n $l ++;\n $this->parsed[$pr][$k][$l] = $this->clientoutput->response[$i][$j]['value'];\n }\n }\n \n //$this->clientoutput->response = array();\n\n $this->client_printer_attributes = new stdClass();\n\t\t\n for ($pr_nbr = 0 ; $pr_nbr <= $pr ; $pr_nbr ++) {\n\t\t\n $pr_index = \"pr_\".$pr_nbr;\n $this->client_printer_attributes->$pr_index = new stdClass();\n\t\t\t\n for ($i = 0 ; $i < count($this->parsed[$pr_nbr]) ; $i ++) {\n $name = $this->parsed[$pr_nbr][$i]['name'];\n $php_name = str_replace('-','_',$name);\n $type = $this->parsed[$pr_nbr][$i]['type'];\n $range = $this->parsed[$pr_nbr][$i]['range'];\n $this->client_printer_attributes->$pr_index->$php_name = new stdClass();\n $this->client_printer_attributes->$pr_index->$php_name->_type = $type;\n $this->client_printer_attributes->$pr_index->$php_name->_range = $range;\n for ($j = 0 ; $j < (count($this->parsed[$pr_nbr][$i]) - 3) ; $j ++) {\n # This causes incorrect parsing of integer job attributes.\n # 2010-08-16\n # bpkroth\n #$value = self::_interpretAttribute($name,$type,$this->parsed[$job_nbr][$i][$j]);\n $value = $this->parsed[$pr_nbr][$i][$j];\n $index = '_value'.$j;\n $this->client_printer_attributes->$pr_index->$php_name->$index = $value;\n }\n }\n }\n \n $this->parsed = array(); \n }", "public function getCategory()\n {\n return $this->_category;\n }", "public function getPrntfmt()\n {\n return $this->prntfmt;\n }", "public function print();", "function get_first_comic_permalink() {\n\t$terminal = get_first_comic();\n\treturn !empty($terminal) ? get_permalink($terminal->ID) : false;\n}", "public function path()\n {\n return $this->dispatch(new GetCategoryPath($this));\n }", "function getCategories() {\n\t\treturn $this->enumerateBySymbolic(CATEGORY_SYMBOLIC, 0, 0);\n\t}", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }" ]
[ "0.7400668", "0.6859968", "0.6748694", "0.63765824", "0.6251554", "0.6093854", "0.59891593", "0.578682", "0.56962395", "0.5675855", "0.5536019", "0.54635394", "0.5420744", "0.5416333", "0.54016167", "0.5398349", "0.53568083", "0.53254265", "0.53174317", "0.53154683", "0.53127605", "0.52851766", "0.5279782", "0.5278695", "0.5270502", "0.5256499", "0.5210252", "0.520977", "0.520977", "0.52068824", "0.5201699", "0.5172327", "0.5153421", "0.5152498", "0.51521116", "0.51517314", "0.51370764", "0.5135076", "0.51305073", "0.5129713", "0.5120256", "0.5112379", "0.5107867", "0.5091467", "0.502773", "0.5027522", "0.5008561", "0.4990162", "0.4990162", "0.49886125", "0.49784645", "0.49766803", "0.4959798", "0.49553484", "0.49358192", "0.49351108", "0.4923907", "0.49195528", "0.4916614", "0.49157596", "0.49097964", "0.49077815", "0.4903919", "0.48958898", "0.4878677", "0.48669732", "0.48566756", "0.48550892", "0.48448035", "0.48423666", "0.48383328", "0.48361468", "0.48346084", "0.48321778", "0.48288053", "0.48221856", "0.48202917", "0.48184317", "0.48112473", "0.4809981", "0.48056346", "0.47922733", "0.47850177", "0.47784603", "0.47705302", "0.47618178", "0.47598937", "0.47596663", "0.47568268", "0.47550067", "0.4754198", "0.473624", "0.47361603", "0.47305477", "0.47274995", "0.47264192", "0.47219992", "0.47198623", "0.47134942", "0.47134942" ]
0.75373244
0
function to insert category information
public function get_category_form_by_ajax() { $category_count = $_POST['id']; $data['category_id'] = $category_count; $data['category_branch_location'] = $this->get_branch_location(); $data['get_printer'] = $this->get_printer(); $this->load->view('restaurant/category/insert_category_form', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertCategory($data){\n\treturn dbInsert('categories', $data);\n}", "public function insert() {\n\t\t\t$conn = parent::connect();\n\t\t\t$sql = \"INSERT INTO \" . TBL_CATEGORY . \" ( \n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\talias,\n\t\t\t\t\t\t\t\tdescription\n\t\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t\t:title,\n\t\t\t\t\t\t\t\t:alias,\n\t\t\t\t\t\t\t\t:description\t\t\t\t\n\t\t\t\t\t\t\t)\";\n\t\t\ttry {\n\t\t\t\t$st = $conn->prepare($sql);\n\t\t\t\t$st->bindValue(\":title\", $this->data[\"title\"], PDO::PARAM_STR);\n\t\t\t\t$st->bindValue(\":alias\", $this->data[\"alias\"], PDO::PARAM_STR);\n\t\t\t\t$st->bindValue(\":description\", $this->data[\"description\"], PDO::PARAM_STR);\n\t\t\t\t$st->execute();\n\t\t\t\tparent::disconnect($conn);\n\t\t\t} catch (PDOException $e) {\n\t\t\t\tparent::disconnect($conn);\n\t\t\t\tdie(\"Query failed: \" . $e->getMessage());\n\t\t\t}\n\t\t}", "function add_category() {\r\n\r\n\tif(isset($_POST['addcategory'])){\r\n\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\tif(empty($_POST['cat_parent_id'])){$cat_parent_id\t\t= \"0\";}\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\t\r\n\r\n\t\t$xyquery = \"INSERT INTO categories (\";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"cat_name \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",cat_desc_short \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",cat_desc_long \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",cat_url\";}\r\n\t\t$xyquery .= \",cat_date\";\r\n\t\t$xyquery .= \",cat_mod\";\r\n\t\t$xyquery .= \",cat_mod_by\";\r\n\t\tif (!empty($page_template)){$xyquery .= \",page_template\";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",cat_meta_title\";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",cat_meta_keywords\";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",cat_meta_description\";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \") VALUES ( \";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"'$cat_name' \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",'$cat_desc_short' \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",'$cat_desc_long' \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",'$cat_parent_id' \";\t}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",'0' \";\t}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",'$cat_url' \";}\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",'$cat_mod_by' \";\r\n\t\tif (!empty($page_template)){$xyquery .= \",'$page_template' \";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",'$cat_meta_title' \";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",'$cat_meta_keywords' \";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",'$cat_meta_description' \";}\r\n\t\tif (!empty($insert_keywords)){$xyquery .= \",'$insert_keywords' \";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \" )\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" has been created!</h4></center>\";\r\n\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been created.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "function InsertCategory_board()\n {\n $this->model->InsertCategory();\n }", "public function save_category_info($data) {\n $this->db->insert('tbl_category', $data);\n }", "function insert(category $cat)\n {\n $query = \"INSERT INTO categories (categories_id, name, tag, description, slug, active)\n VALUE ('$cat->category_id', '$cat->name', '$cat->tag', '$cat->description', '$cat->slug', $cat->active)\";\n $result = $this->db->insert($query);\n }", "function target_add_cat($cat)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $cat['name']);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat (id, name, view_order, cat_opt) \n\t VALUES('. (int)$cat['id'] .','. _esc($cat['name']) .','. (int)$cat['view_order'] .', 3)');\n\t$GLOBALS['cat_map'][ $cat['id'] ] = $cat['id'];\n/*\nfud_use('cat.inc', true);\n$nc = new fud_cat;\n$nc->name = $c->name;\n$nc->description = $c->description;\n$nc->view_order = $c->disporder;\n$nc->cat_opt = 1|2;\t// This should be the default in cat.inc. Fix in next release and del this line.\n$GLOBALS['cat_map'][$c->fid] = $nc->add('LAST');\t// FIRST should also be defaulted.\n*/\n}", "public function createCategory();", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "function insert_cat()\n\t {\n\t\t $cat_par_id = $_POST['cat_par_id'];\n\t\t if(mysql_real_escape_string(trim($_POST['cat_title']))=='')\n\t\t {\n\t\t return '<span class=\"err\">please enter the category title</span>';\n\t\t }\n\t\t else\n\t\t {\n\t\t mysql_query(\"insert into category(cat_par_id,cat_title,cat_des) values('$cat_par_id','\".mysql_real_escape_string(trim($_POST['cat_title'])).\"','\".mysql_real_escape_string(trim($_POST['cat_des'])).\"')\");\n\t\t unset($_POST);\n\t\t return '<span class=\"fine\">category inserted successfully...</span>';\n\t\t }\n \t \n }", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "protected function storeCategoryIntoDatabase( &$category, &$languages, $exist_meta_title, &$layout_ids, &$available_store_ids, &$url_alias_ids ) {\n\t\t$category_id = $category['category_id'];\n\t\t$image_name = $this->db->escape($category['image']);\n\t\t$parent_id = $category['parent_id'];\n\t\t$top = $category['top'];\n\t\t$top = ((strtoupper($top)==\"TRUE\") || (strtoupper($top)==\"YES\") || (strtoupper($top)==\"ENABLED\")) ? 1 : 0;\n\t\t$columns = $category['columns'];\n\t\t$sort_order = $category['sort_order'];\n\t\t$date_added = $category['date_added'];\n\t\t$date_modified = $category['date_modified'];\n\t\t$names = $category['names'];\n\t\t$descriptions = $category['descriptions'];\n\t\tif ($exist_meta_title) {\n\t\t\t$meta_titles = $category['meta_titles'];\n\t\t}\n\t\t$meta_descriptions = $category['meta_descriptions'];\n\t\t$meta_keywords = $category['meta_keywords'];\n\t\t$seo_keyword = $category['seo_keyword'];\n\t\t$store_ids = $category['store_ids'];\n\t\t$layout = $category['layout'];\n\t\t$status = $category['status'];\n\t\t$status = ((strtoupper($status)==\"TRUE\") || (strtoupper($status)==\"YES\") || (strtoupper($status)==\"ENABLED\")) ? 1 : 0;\n\n\t\t// generate and execute SQL for inserting the category\n\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category` (`category_id`, `image`, `parent_id`, `top`, `column`, `sort_order`, `date_added`, `date_modified`, `status`) VALUES \";\n\t\t$sql .= \"( $category_id, '$image_name', $parent_id, $top, $columns, $sort_order, \";\n\t\t$sql .= ($date_added=='NOW()') ? \"$date_added,\" : \"'$date_added',\";\n\t\t$sql .= ($date_modified=='NOW()') ? \"$date_modified,\" : \"'$date_modified',\";\n\t\t$sql .= \" $status);\";\n\t\t$this->db->query( $sql );\n\t\tforeach ($languages as $language) {\n\t\t\t$language_code = $language['code'];\n\t\t\t$language_id = $language['language_id'];\n\t\t\t$name = isset($names[$language_code]) ? $this->db->escape($names[$language_code]) : '';\n\t\t\t$description = isset($descriptions[$language_code]) ? $this->db->escape($descriptions[$language_code]) : '';\n\t\t\tif ($exist_meta_title) {\n\t\t\t\t$meta_title = isset($meta_titles[$language_code]) ? $this->db->escape($meta_titles[$language_code]) : '';\n\t\t\t}\n\t\t\t$meta_description = isset($meta_descriptions[$language_code]) ? $this->db->escape($meta_descriptions[$language_code]) : '';\n\t\t\t$meta_keyword = isset($meta_keywords[$language_code]) ? $this->db->escape($meta_keywords[$language_code]) : '';\n\t\t\tif ($exist_meta_title) {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_description` (`category_id`, `language_id`, `name`, `description`, `meta_title`, `meta_description`, `meta_keyword`) VALUES \";\n\t\t\t\t$sql .= \"( $category_id, $language_id, '$name', '$description', '$meta_title', '$meta_description', '$meta_keyword' );\";\n\t\t\t} else {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_description` (`category_id`, `language_id`, `name`, `description`, `meta_description`, `meta_keyword`) VALUES \";\n\t\t\t\t$sql .= \"( $category_id, $language_id, '$name', '$description', '$meta_description', '$meta_keyword' );\";\n\t\t\t}\n\t\t\t$this->db->query( $sql );\n\t\t}\n\t\tif ($seo_keyword) {\n\t\t\tif (isset($url_alias_ids[$category_id])) {\n\t\t\t\t$url_alias_id = $url_alias_ids[$category_id];\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"url_alias` (`url_alias_id`,`query`,`keyword`) VALUES ($url_alias_id,'category_id=$category_id','$seo_keyword');\";\n\t\t\t\tunset($url_alias_ids[$category_id]);\n\t\t\t} else {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"url_alias` (`query`,`keyword`) VALUES ('category_id=$category_id','$seo_keyword');\";\n\t\t\t}\n\t\t\t$this->db->query($sql);\n\t\t}\n\t\tforeach ($store_ids as $store_id) {\n\t\t\tif (in_array((int)$store_id,$available_store_ids)) {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_to_store` (`category_id`,`store_id`) VALUES ($category_id,$store_id);\";\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\t}\n\t\t$layouts = array();\n\t\tforeach ($layout as $layout_part) {\n\t\t\t$next_layout = explode(':',$layout_part);\n\t\t\tif ($next_layout===false) {\n\t\t\t\t$next_layout = array( 0, $layout_part );\n\t\t\t} else if (count($next_layout)==1) {\n\t\t\t\t$next_layout = array( 0, $layout_part );\n\t\t\t}\n\t\t\tif ( (count($next_layout)==2) && (in_array((int)$next_layout[0],$available_store_ids)) && (is_string($next_layout[1])) ) {\n\t\t\t\t$store_id = (int)$next_layout[0];\n\t\t\t\t$layout_name = $next_layout[1];\n\t\t\t\tif (isset($layout_ids[$layout_name])) {\n\t\t\t\t\t$layout_id = (int)$layout_ids[$layout_name];\n\t\t\t\t\tif (!isset($layouts[$store_id])) {\n\t\t\t\t\t\t$layouts[$store_id] = $layout_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ($layouts as $store_id => $layout_id) {\n\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_to_layout` (`category_id`,`store_id`,`layout_id`) VALUES ($category_id,$store_id,$layout_id);\";\n\t\t\t$this->db->query($sql);\n\t\t}\n\t}", "public function create_category(){\n $query = \"INSERT INTO {$this->table} (cat_title) VALUES (:cat_title)\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_title',$this->cat_title); \n $stmt->execute();\n return $stmt;\n }", "public function addCathegory($values)\n\t{\n\t\treturn $this->getTable('kategoria')->insert(array(\n\t\t\t'Nazov' => $values->nazov,\n\t\t));\n\t}", "function add_category($name, $price, $discount){\n\tglobal $db;\n\t$query = \n ' INSERT INTO categories\n (cat_categoryID, cat_categoryName, cat_price, cat_discount)\n VALUES\n (null, :name, :cat_price, :cat_discount)';\n $statement = $db->prepare($query);\n $statement->bindValue(':name', $name);\n $statement->bindValue(':cat_price', $price);\n $statement->bindValue(':cat_discount', $discount);\n $statement->execute();\n $statement->closeCursor();\n}", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "public function create_category ( $cat_info, $username )\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t{\r\n\t\t\t$this->errno = DB_OK;\r\n\t\t\t\r\n\t\t\tif ( $this->cat_id != -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tThe not exist category is obvious that has no id yet\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$user = new user( $username , LOGGED_IN );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tcreating an object of the user who wants to create a category\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//\tit is mandatory to be logged in\r\n\t\t\t$attr_length = 0; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tinitialize with 0 in case the attribute array hasn't been set\r\n\r\n\t\t\tif ( !isset ( $cat_info ) )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tif the cat_info structure is null\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_INPUT;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthen the input is wrong\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\r\n\t\t\tif ( isset ( $cat_info->attr_info_array ) )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$attr_length = count ( $cat_info->attr_info_array );\r\n\t\t\t\r\n\t\t\tif ( $attr_length == 0 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthe existance of at least one attribute is mandatory\r\n\t\t\t{\r\n\t\t\t\t$this->errno = NOT_ENOUGH_ATTRIBUTES;\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\r\n\t\t\tif ( !( $result = $this->con->query( \"SELECT cat_id FROM category WHERE cat_name=\\\"$cat_info->cat_name\\\"\" ) ) )\t//\tfiguring out if category with such name exists\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\r\n\t\t\tif ( $result->num_rows != 0 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tif category exists error code should be returned\r\n\t\t\t{\r\n\t\t\t\t$result->close();\r\n\t\t\t\t$this->errno = CATEGORY_EXISTS;\r\n\t\t\t\treturn ;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t/* gathering all keywords into one variable with # as delimiter to insert it to the database */\r\n\r\n\t\t\t$kw_length = 0; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tinitialize with 0 in case the keywords array hasn't been set\r\n\t\r\n\t\t\tif ( ! is_null ( $cat_info->cat_keywords ) )\r\n\t\t\t\t$kw_length = count( $cat_info->cat_keywords );\r\n\r\n\t\t\tif ( $kw_length == 0 )\r\n\t\t\t\t$kw = NULL;\r\n\t\t\telse\r\n\t\t\t\t$kw = \"#\".$cat_info->cat_keywords[0];\r\n\t\t\t\r\n\t\t\tfor ( $i = 1; $i < $kw_length; $i++ )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tgenerating the keyword string which will enter to the database\r\n\t\t\t\t$kw = $kw.\"#\".$cat_info->cat_keywords[$i];\r\n\t\t\t\r\n\t\t\tif ( ! ( $result = $this->con->query( \"SELECT user_id FROM user WHERE username=\\\"\".$username.\"\\\"\" ) ) )\t\t\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to query\t\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( $result->num_rows == 1 )\r\n\t\t\t{\r\n\t\t\t\t$row = $result->fetch_row();\r\n\t\t\t\t$user_id = $row[0];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tgetting user id to inform other tables once the category has \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//\tbeen created\t\t\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t$result->close();\r\n\t\t\t\t$this->errno = USERNAME_DONT_EXIST;\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\r\n\t\t\t$query = \"INSERT INTO category ( cat_name, is_open\" ;\t\t\t\t\t\t\t\t\t\t\t\t//\trows cat_name and is open should always have value\r\n\t\t\t\r\n\t\t\t/* on the other hand the following variables may have null value as its existance is optional in the database */\r\n\t\t\tif ( !is_null( $kw ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", cat_keywords\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( !is_null( $cat_info->cat_description ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", cat_description\";\r\n\t\t\t}\r\n\t\r\n\t\t\tif ( !is_null( $cat_info->cat_image ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", cat_image\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( !is_null( $cat_info->cat_video ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", cat_video\";\r\n\t\t\t}\t\r\n\t\r\n\t\t\t$query = $query.\" ) VALUES ( \\\"$cat_info->cat_name\\\", $cat_info->is_open\";\r\n\t\r\n\t\t\tif ( !is_null( $kw ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", \\\"$kw\\\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( !is_null( $cat_info->cat_description ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", \\\"$cat_info->cat_description\\\"\";\r\n\t\t\t}\r\n\r\n\t\t\tif ( !is_null( $cat_info->cat_image ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", \\\"$cat_info->cat_image\\\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( !is_null( $cat_info->cat_video ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", \\\"$cat_info->cat_video\\\"\";\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t$query = $query.\" )\";\r\n\r\n\t\t\t$this->con->query(\"START TRANSACTION;\");\r\n\t\t\t\r\n\t\t\t/* inserting to the database */\r\n\t\t\tif ( !$this->con->query( $query ) )\r\n\t\t\t{\r\n\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tfailed to query\t\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\r\n\t\t\tif( $this->con->affected_rows != 1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthis query should affect 1 row\r\n\t\t\t{\t\t\t\t\t\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t/* fill the class variable with the apropriate value */\t\t\r\n\t\t\t$this->cat_id = $this->con->insert_id;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tstoring the id in the class\r\n\t\t\r\n\t\t\tif ( !$this->con->query( \"INSERT INTO user_has_rights VALUES ( $this->cat_id, $user_id,\".MODERATOR.\" )\" ) )\r\n\t\t\t{\t\t\t\t\t\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tfailed to query\t\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\r\n\r\n\t\t\tif( $this->con->affected_rows != 1 )\r\n\t\t\t{\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthis query should affect 1 row\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\r\n\t\t\t$this->insert_attributes ( $cat_info->attr_info_array );\r\n\t\r\n\t\t\tif ( $this->errno != DB_OK )\r\n\t\t\t{\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\r\n\t\t\t$this->con->query(\"COMMIT;\");\r\n\t\t\t\r\n\t\t\t/* initialize class's variables */\r\n\t\t\t$this->cat_name = $cat_info->cat_name;\r\n\t\t\t$this->is_open = $cat_info->is_open;\r\n\t\t\t$this->cat_description = $cat_info->cat_description;\r\n\r\n\t\t\tif ( $kw_length == 0 )\r\n\t\t\t\t$this->cat_keywords = NULL;\r\n\t\t\telse\r\n\t\t\t\t$this->cat_keywords = $cat_info->cat_keywords;\r\n\t\t\t\t\r\n\t\t\t$this->image = $cat_info->cat_image;\r\n\t\t\t$this->video = $cat_info->cat_video;\r\n\t\t\t\r\n\t\t\t$this->rate = 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tDummy initial value as the aggreed default rate is 0\r\n\t\t}", "public function addCategory()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['category'];\n\t\t\t$sql = \"insert into lib_category (category,add_date,staff_id) \n\t\t\t\t\tvalues('\" . $category . \"','\" . date('Y-m-d') . \"','\" . cookie('staffAccount') . \"') \";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Add successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "function createCategory($category)\r\n{\r\n $results = false;\r\n \r\n $db = dbconnect();\r\n \r\n $stmt = $db->prepare(\"INSERT INTO categories SET category = :category\");\r\n \r\n $binds = array(\r\n // Used to place new array information under a new ID in Categories table\r\n \":category\" => $category,\r\n );\r\n \r\n if ($stmt->execute($binds) && $stmt->rowCount() > 0) \r\n {\r\n $results = true;\r\n }\r\n \r\n return $results; \r\n}", "function createCategories()\n {\n $currentCategories = $this->loadCategories();\n\n foreach ($this->categories as $category)\n {\n // Skip adding category if it already exists\n if (in_array($category, $currentCategories))\n {\n continue;\n }\n\n // Create a copy of the template array for category properties\n $data = array_merge($this->categoryTemplate);\n\n // Set the category description from the translation key in en-GB.com_cajobboard.sys.ini\n // remove any spaces from the category title when building the translation key\n $data['title'] = Text::_('COM_CAJOBBOARD_CATEGORY_TITLE_' . strtoupper(str_replace(' ', '', $category)));\n\n $data['description'] = $data['title'];\n\n // Initialize a new category\n $category = Table::getInstance('Category');\n\n // Bind passed category parameters to Category model\n $category->bind($data);\n\n // setLocation(integer $referenceId, string $position = 'after')\n $category->setLocation($category->getRootId(), 'last-child');\n\n // Check to make sure our data is valid. check() will auto generate alias if not set above.\n if (!$category->check())\n {\n throw new \\Exception($category->getError(), 500);\n\n return false;\n }\n\n // Store the category\n if (!$category->store(true))\n {\n throw new \\Exception($category->getError(), 500);\n\n return false;\n }\n\n // Build the path for our category and set it in the database\n $category->rebuildPath($category->id);\n }\n\n Table::getInstance('Category')->rebuild();\n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function insertCateDes($categoryNameSub,$categories_id,$languages_data_id){\n DB::table('categories_description')->insert([\n 'categories_name' => $categoryNameSub,\n 'categories_id' => $categories_id,\n 'language_id' => $languages_data_id\n ]);\n }", "function insertCate($category, $add_group) {\r\t\t$sql = \"INSERT INTO category (c_name, c_main_id) VALUES ('\".$category.\"', '\".$add_group.\"')\";\r\t\t$this->db->query($sql);\r\t\t\r\t\tif ($this->db->insert_id() > 0)\r\t\t\treturn $this->db->insert_id();\r\t\telse\r\t\t\treturn FALSE;\r\t}", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "public function addCategory($category_name){\n\n //write the query to insert into taable\n $query = \"INSERT INTO category(category_name) \n VALUES ('$category_name')\";\n\n //check if the query() runs // data is insert into users table\n if ($this->dbobj->dbcon->query($query)===true){\n\n\n \n echo \" Category was successfully added\";\n \n }\n else{\n echo \"Error\".$this->dbobj->dbcon->error;\n }\n }", "function add_cat() {\n $item = mysql_real_escape_string($_POST['cat']);\n $sql = \"INSERT INTO Categories (name) \n VALUES ('$item')\";\n\tmysql_query($sql);\n}", "function process_categories() {\n\t\t$this->categories = apply_filters( 'wp_import_categories', $this->categories );\n\n\t\tif ( empty( $this->categories ) )\n\t\t\treturn;\n\n\t\tforeach ( $this->categories as $cat ) {\n\t\t\t// if the category already exists leave it alone\n\t\t\t$term_id = term_exists( $cat['category_nicename'], 'category' );\n\t\t\tif ( $term_id ) {\n\t\t\t\tif ( is_array($term_id) ) $term_id = $term_id['term_id'];\n\t\t\t\tif ( isset($cat['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($cat['term_id'])] = (int) $term_id;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$category_parent = empty( $cat['category_parent'] ) ? 0 : category_exists( $cat['category_parent'] );\n\t\t\t$category_description = isset( $cat['category_description'] ) ? $cat['category_description'] : '';\n\t\t\t$catarr = array(\n\t\t\t\t'category_nicename' => $cat['category_nicename'],\n\t\t\t\t'category_parent' => $category_parent,\n\t\t\t\t'cat_name' => $cat['cat_name'],\n\t\t\t\t'category_description' => $category_description\n\t\t\t);\n\n\t\t\t$id = wp_insert_category( $catarr );\n\t\t\tif ( ! is_wp_error( $id ) ) {\n\t\t\t\tif ( isset($cat['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($cat['term_id'])] = $id;\n\t\t\t} else {\n\t\t\t\tprintf( 'Failed to import category %s', esc_html($cat['category_nicename']) );\n\t\t\t\tif ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )\n\t\t\t\t\techo ': ' . $id->get_error_message();\n\t\t\t\techo '<br />';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tunset( $this->categories );\n\t}", "public function insert_category($category){\n\n\t\t mysql_query(\"INSERT INTO `categories` SET `cat` = '$category'\");\n\n\t\t\treturn true;\n\n\t}", "function insertCategories() {\n\tglobal $connection;\n\tif (isset($_POST['submit'])) {\n\n\t\t$title = escape($_POST['cat_title']);\n\n\t\tif ($title === \"\" || empty($title)) {\n\t\t\techo \"This field should not be empty\";\n\t\t} else {\n\n\t\t\t$stmt = mysqli_prepare($connection, \"INSERT INTO categories(cat_title) VALUES(?)\");\n\n\t\t\tmysqli_stmt_bind_param($stmt, 's', $title);\n\n\t\t\tmysqli_stmt_execute($stmt);\n\n\t\t\tif (!$stmt) {\n\t\t\t\tdie(\"QUERY FAILED\");\n\t\t\t}\n\t\t}\n\t\tmysqli_stmt_close($stmt);\n\t}\n\n}", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "function addCategory()\r\n{\r\n global $conn;\r\n global $_POST;\r\n \r\n \r\n if(isset($_POST[\"cat_name\"]) && $_POST[\"cat_name\"]<>''){ \r\n \r\n\t $catname = $_POST[\"cat_name\"];\r\n\t \r\n\t $sqlquery = \"select * from tbl_categories where cat_name= '$catname'\";\r\n\t \r\n\t $result = mysql_query($sqlquery,$conn) or die(mysql_error());\r\n\t if(mysql_num_rows($result) >0){\r\n\t \t$str = \"Data Already Exists\";\r\n\t }else{\r\n\t $sql = \"insert into `tbl_categories` (`cat_name`, `cat_description`) \r\n\t \t\t\tvalues (\" . strtoupper(sqlvalue(@$_POST[\"cat_name\"], true)).\", \" . strtoupper(sqlvalue(@$_POST[\"cat_description\"], true)).\")\";\r\n\t //echo \"SQL :\".$sql;\r\n \tmysql_query($sql, $conn) or die(mysql_error());\r\n\t \tif(mysql_affected_rows()>0){\r\n\t \t\t$str = \"Record Added Successfully\";\r\n\t \t}\r\n\t }\r\n }else{\r\n \t\t$str = \"Wrong Data Entry \";\r\n }\r\n echo $str;\r\n}", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function InsertCategory($_category)\n\t\t{\n\t\t\t$query = \"insert into categories(\";\n\t\t\t$query .= \"categoryname,\";\n\t\t\t$query .= \"parentcategoryid,\";\n\t\t\t$query .= \"filtered,\";\n\t\t\t$query .= \"displayorder\";\n\t\t\t$query .= \")\";\n\t\t\t$query .= \" values (\";\n\t\t\t$query .= \"'\" . $this->CheckString($_category->getCategoryName()) . \"', \";\n\t\t\t$query .= $_category->getParentCategoryID() . \", \";\n\t\t\t$query .= $this->CheckBoolean($_category->getFiltered()) . \" , \";\n\t\t\t$query .= $_category->getDisplayOrder() . \" \";\n\t\t\t$query .= \" )\";\n\t\t\treturn $query;\n\t\t}", "private function packCategory()\n {\n /** @var modCategory $category */\n $category = $this->modx->newObject('modCategory');\n $category->set('category', self::PKG_NAME);\n\n $this->packCategoryElements($category, 'plugins');\n\n $this->builder->putVehicle($this->builder->createVehicle($category, [\n xPDOTransport::UNIQUE_KEY => 'category',\n xPDOTransport::PRESERVE_KEYS => false,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::RELATED_OBJECTS => true,\n xPDOTransport::RELATED_OBJECT_ATTRIBUTES => [\n 'Plugins' => [\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => 'name'\n ],\n 'PluginEvents' => [\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => ['pluginid','event'],\n ]\n ]\n ]));\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 insert_category($categories_data, $dest_category_id, $action = 'insert') {\n\n\t\t$categories_id = olc_db_prepare_input($categories_data['categories_id']);\n\n\t\t$sort_order = olc_db_prepare_input($categories_data['sort_order']);\n\t\t$categories_status = olc_db_prepare_input($categories_data['status']);\n\n\n\n\n\n\t\t$customers_statuses_array = olc_get_customers_statuses();\n\n\t\t$permission = array ();\n\t\tfor ($i = 0; $n = sizeof($customers_statuses_array), $i < $n; $i ++) {\n\t\t\tif (isset($customers_statuses_array[$i]['id']))\n\t\t\t\t$permission[$customers_statuses_array[$i]['id']] = 0;\n\t\t}\n\t\tif (isset ($categories_data['groups']))\n\t\t\tforeach ($categories_data['groups'] AS $dummy => $b) {\n\t\t\t\t$permission[$b] = 1;\n\t\t\t}\n\t\t// build array\n\t\tif ($permission['all']==1) {\n\t\t\t$permission = array ();\n\t\t\tend($customers_statuses_array);\n\t\t\tfor ($i = 0; $n = key($customers_statuses_array), $i < $n+1; $i ++) {\n\t\t\t\tif (isset($customers_statuses_array[$i]['id']))\n\t\t\t\t\t$permission[$customers_statuses_array[$i]['id']] = 1;\n\t\t\t}\n\t\t}\n\t\t\n\n\t\t$permission_array = array ();\n\t\t\n\t\t\n\t\t// set pointer to last key\n\t\tend($customers_statuses_array);\t\t\n\t\tfor ($i = 0; $n = key($customers_statuses_array), $i < $n+1; $i ++) {\n\t\t\tif (isset($customers_statuses_array[$i]['id'])) {\n\t\t\t\t$permission_array = array_merge($permission_array, array ('group_permission_'.$customers_statuses_array[$i]['id'] => $permission[$customers_statuses_array[$i]['id']]));\n\t\t\t}\n\t\t}\n\n\n\t\t$sql_data_array = array ('sort_order' => $sort_order, 'categories_status' => $categories_status, 'products_sorting' => olc_db_prepare_input($categories_data['products_sorting']), 'products_sorting2' => olc_db_prepare_input($categories_data['products_sorting2']), 'categories_template' => olc_db_prepare_input($categories_data['categories_template']), 'listing_template' => olc_db_prepare_input($categories_data['listing_template']));\n\t\t$sql_data_array = array_merge($sql_data_array,$permission_array);\n\t\tif ($action == 'insert') {\n\t\t\t$insert_sql_data = array ('parent_id' => $dest_category_id, 'date_added' => 'now()');\n\t\t\t$sql_data_array = olc_array_merge($sql_data_array, $insert_sql_data);\n\t\t\tolc_db_perform(TABLE_CATEGORIES, $sql_data_array);\n\t\t\t$categories_id = olc_db_insert_id();\n\t\t}\n\t\telseif ($action == 'update') {\n\t\t\t$update_sql_data = array ('last_modified' => 'now()');\n\t\t\t$sql_data_array = olc_array_merge($sql_data_array, $update_sql_data);\n\t\t\tolc_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', 'categories_id = \\''.$categories_id.'\\'');\n\t\t}\n\t\tolc_set_groups($categories_id, $permission_array);\n\t\t$languages = olc_get_languages();\n\t\tforeach ($languages AS $lang) {\n\t\t\t$categories_name_array = $categories_data['name'];\n\t\t\t$sql_data_array = array ('categories_name' => olc_db_prepare_input($categories_data['categories_name'][$lang['id']]), 'categories_heading_title' => olc_db_prepare_input($categories_data['categories_heading_title'][$lang['id']]), 'categories_description' => olc_db_prepare_input($categories_data['categories_description'][$lang['id']]), 'categories_meta_title' => olc_db_prepare_input($categories_data['categories_meta_title'][$lang['id']]), 'categories_meta_description' => olc_db_prepare_input($categories_data['categories_meta_description'][$lang['id']]), 'categories_meta_keywords' => olc_db_prepare_input($categories_data['categories_meta_keywords'][$lang['id']]));\n\n\n\t\t\tif ($action == 'insert') {\n\t\t\t\t$insert_sql_data = array ('categories_id' => $categories_id, 'language_id' => $lang['id']);\n\t\t\t\t$sql_data_array = olc_array_merge($sql_data_array, $insert_sql_data);\n\t\t\t\tolc_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);\n\t\t\t}\n\t\t\telseif ($action == 'update') {\n\t\t\t\tolc_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', 'categories_id = \\''.$categories_id.'\\' and language_id = \\''.$lang['id'].'\\'');\n\t\t\t}\n\t\t}\n\n\t\tif ($categories_image = & olc_try_upload('categories_image', DIR_FS_CATALOG_IMAGES.'categories/')) {\n\t\t\t$cname_arr = explode('.', $categories_image->filename);\n\t\t\t$cnsuffix = array_pop($cname_arr);\n\t\t\t$categories_image_name = $categories_id.'.'.$cnsuffix;\n\t\t\t@ unlink(DIR_FS_CATALOG_IMAGES.'categories/'.$categories_image_name);\n\t\t\trename(DIR_FS_CATALOG_IMAGES.'categories/'.$categories_image->filename, DIR_FS_CATALOG_IMAGES.'categories/'.$categories_image_name);\n\t\t\tolc_db_query(\"SQL_UPDATE \".TABLE_CATEGORIES.\"\n\t\t\t\t\t\t \t\t SET categories_image = '\".olc_db_input($categories_image_name).\"'\n\t\t\t\t\t\t \t\t WHERE categories_id = '\".(int) $categories_id.\"'\");\n\t\t}\n\n\t\tif ($categories_data['del_cat_pic'] == 'yes') {\n\t\t\t@ unlink(DIR_FS_CATALOG_IMAGES.'categories/'.$categories_data['categories_previous_image']);\n\t\t\tolc_db_query(\"SQL_UPDATE \".TABLE_CATEGORIES.\"\n\t\t\t\t\t\t \t\t SET categories_image = ''\n\t\t\t\t\t\t \t\t WHERE categories_id = '\".(int) $categories_id.\"'\");\n\t\t}\n\n\t}", "function add_categroy( $category_title, $category_image_icon, $sort_order, $status )\n\t{\n\t\t$q = \"INSERT INTO title_dev_categories(`category_title`, `category_image_icon`, `sort_order`, `status`, `addeddate`, `modifieddate`)\n\t\t\t VALUES('\".$category_title.\"', '\".$category_image_icon.\"', '\".$sort_order.\"', '\".$status.\"', '\".date('Y-m-d H:i:s').\"', '\".date('Y-m-d H:i:s').\"')\";\n\t\t$r = $this -> db -> insertRecord( $q );\n\t\tif( $r )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public static function func_ajax_add_category() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n $self = self::sanitize($_POST['name']);\n $day = self::sanitize($_POST['day']);\n $desc = self::sanitize($_POST['description']);\n $wpdb->query($wpdb->prepare( \"INSERT INTO \".$wpdb->prefix.self::$table_name .\" VALUES (%d, %s, %s, %s)\", null, $self,$day,$desc ));\n die();\n\t\t\t\t}\n\t\t\n\t\t}", "public function addCategory($table, $data)\n {\n\n if (isset($data)) {\n $result=$this->dynamicInsert($table, $data);\n }\n }", "public function addCategory(Category $category){\n $req =$this->db->prepare('INSERT INTO p5_files_category(category_name)\n VALUES(?)');\n $req->execute(array($category->getCategory_name()));\n }", "function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }", "function ccategories_create()\n\t{\n\t\tlusers_require(\"categories/create\");\n\n\t\t$post_data = linput_post();\n\t\t$post_data = linput_post_checkbox($post_data, \"content\");\n\t\t$content = $post_data[\"content\"];\n\n\t\tif (hform_validate(array(\"name\", \"link\", \"parentid\")))\n\t\t{\n\t\t\t$cat_created = mcategories_create($post_data);\n\t\t\tif ($content) $content_created = mcontent_create($post_data);\n\t\t\telse $content_created = false;\n\n\t\t\tif (($cat_created && !$content) || ($content && $cat_created && $content_created))\n\t\t\t{\n\t\t\t\tlcache_delete_all();\n\t\t\t\thmessage_set(l(\"Category successfully created.\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($cat_created) mcategories_delete($post_data[\"link\"]);\n\t\t\t\tif ($content_created) mcontent_delete($post_data[\"link\"]);\n\t\t\t\thmessage_set(l(\"Category create error.\") . \" \" . l(\"Link already in use.\"));\n\t\t\t}\n\n\t\t\tluri_redirect(\"main/user/admin/categories\");\n\t\t}\n\t\telse luri_redirect(\"main/user/admin/categories_create\", l(\"All fields marked with * are required.\"));\n\t}", "public function addCategoryToGroupById($gorup_id, $category_id);", "public function insert(PDO &$pdo) {\n\t\t// make sure category doesn't already exist\n\t\tif($this->categoryId === null) {\n\t\t\t//create query template\n\t\t\t$query\n\t\t\t\t= \"INSERT INTO category (name) VALUES (:name)\";\n\t\t\t$statement = $pdo->prepare($query);\n\n\t\t\t// bind the variables to the place holders in the template\n\t\t\t$parameters = array(\"name\" => $this->name);\n\t\t\t$statement->execute($parameters);\n\n\t\t\t//update null subcategory with what mySQL just gave us\n\t\t\t$this->categoryId = intval($pdo->lastInsertId());\n\t\t}\n\t}", "public function insert_category() {\n\n $this->load->model('Categories');\n\n $category_id = $this->auth->generator(15);\n\n\n\n //Customer basic information adding.\n\n $data = array(\n\n 'category_id' => $category_id,\n\n 'category_name' => $this->input->post('category_name'),\n\n 'status' => 1\n\n );\n\n\n\n $result = $this->Categories->category_entry($data);\n\n\n\n if ($result == TRUE) {\n\n $this->session->set_userdata(array('message' => display('successfully_added')));\n\n echo TRUE;\n\n } else {\n\n $this->session->set_userdata(array('error_message' => display('already_exists')));\n\n echo FALSE;\n\n }\n\n }", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function add_cat() { \n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\tdie();\n\t\t}\n\t\t$main_cat_id = $this->input->post('main_cat_id');\n\t\t$title = $this->input->post('title'); \n\n\n\t\t$array_data['main_cat_id'] = $main_cat_id ; \n\t\t$array_data['title'] = $title ; \n\t\t$this->db->insert(\"categories\" , $array_data); \n\t\t$result = array('statu' => 'ok');\n\t\techo json_encode($result);\n\n\t}", "public function add_category() {\n\t\n\t\tif($this->input->post('add_type')=='add_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name'),\n\t\t'created_at' => date('d-m-Y h:i:s')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->add_assets_category($data);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_added');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function createCategory($item,$asid)\n\t{\n\n\t\t$tname=$this->tablename('catalog_category_entity');\n $item['entity_id']=$item['category_id'];\n $item['path']=$this->getPathCategory($item);\n\t\t\n if(!empty($item['path'])){\n $item['path'].=\"/\".$item['entity_id'];\n \n $item['attribute_set_id']=$asid;\n $item['entity_type_id']=$this->cat_etype;\n $item['created_at']=strftime(\"%Y-%m-%d %H:%M:%S\");\n $item['updated_at']=strftime(\"%Y-%m-%d %H:%M:%S\");\n $columns=array_intersect(array_keys($item), $this->getCatCols());\n $values=$this->filterkvarr($item, $columns);\n $sql=\"INSERT INTO `$tname` (\".implode(\",\",$columns).\") VALUES (\".$this->arr2values($columns).\")\";\n //$this->log($sql,\"debug\");\n $lastid=$this->insert($sql,array_values($values));\n return $lastid;\n }else{\n return false;\n }\n\t}", "public function createNewCategory()\r\n{\r\n $query_string = \"INSERT INTO categories \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"categoryname = :categoryname, \";\r\n $query_string .= \"categorydescription = :categorydescription\";\r\n\r\n return $query_string;\r\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 }", "function create(){\n\t\t$sql = \"insert into tbl_post (category_id,title,rank,slug,status,bodytext,image,created_by,modified_by,created_date,modified_date) \n\n\t\tvalues('$this->category_id','$this->title','$this->rank','$this->slug','$this->status','$this->bodytext','$this->image','$this->created_by','$this->modified_by','$this->created_date','$this->modified_date')\";\n\t\t\n\t\t$st = $this->insert($sql);\n\t\t\n\t\tif (is_integer($st)) {\n\t\t\tforeach($this->tags as $tag){\n\t\t\t\t$sql = \"insert into tbl_tag_post(post_id,tag_id) values('$st','$tag')\";\n\t\t\t\t$this->insert($sql);\n\t\t\t}\n\t\t\treturn \"Post Inserted with id $st\";\n\t\t}else{\n\t\t\techo \"Failed to insert Post\";\n\t\t}\n\t}", "public function add_attr_cat()\n\t{\n\t\t$rest_id=$this->session->userdata('user_rest_uns');\n\t\t$cat_name=$this->input->post('cat_name');\n\t\t$query=$this->db->insert(\"food_attribute\",array(\"f_att_name\"=>$cat_name,\"rest_id\"=>$rest_id));\n\t\t\n\t\tif($query)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio 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/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "function insertBlogCategoryData($conn,$blog_name,$blog_desc,$is_display,$cur_date)\n{\n\t\n\t$sqlInsert = \"INSERT INTO blog_category_mst(blog_cat_name,blog_cat_desc,is_display,created_at) VALUES ('\".$blog_name.\"','\".$blog_desc.\"','\".$is_display.\"','\".$cur_date.\"')\";\n\t$resultArray = $conn -> insertQuery($sqlInsert);\n\t\n}", "function add_categoria($params)\n {\n $this->db->insert('categoria',$params);\n return $this->db->insert_id();\n }", "function SELLMYHOME_add_category( $cat_name, $taxonomy ){\n //Check if term exists before attempting to create\n if( !term_exists( $cat_name, $taxonomy ) ){\n $my_cat = array('cat_name' => $cat_name, \n 'category_description' => 'Default, Permanent Category', \n 'category_nicename' => SELLMYHOME_clean($cat_name), \n 'category_parent' => '',\n 'taxonomy' => $taxonomy);\n\n // Create the category\n wp_insert_category($my_cat); \n } \n}", "function addCategory() {\n var_dump($this->request->data);\n if ($this->request->is('post') || $this->request->is('put')) {\n $ci = $this->CategoryItem->create();\n var_dump($ci);\n if ($this->CategoryItem->save($this->request->data)) {\n $this->Session->setFlash(__('The %s has been saved', __('link')), 'flash/success');\n } else {\n $this->Session->setFlash(__('The %s could not be saved. Please, try again.', __('link')), 'flash/failure');\n }\n// $this->redirect(array('action' => 'edit', $this->Item->id));\n } else {\n $this->redirect(array('action' => 'index'));\n }\n }", "function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->begin( );\r\n\r\n $name = $db->escapeString( $this->Name );\r\n $description = $db->escapeString( $this->Description );\r\n\r\n if ( !isset( $this->ID ) )\r\n {\r\n $db->lock( \"eZImageCatalogue_Category\" );\r\n\r\n $this->ID = $db->nextID( \"eZImageCatalogue_Category\", \"ID\" );\r\n\r\n $db->query( \"INSERT INTO eZImageCatalogue_Category\r\n ( ID, Name, Description, UserID, ParentID, SectionID ) VALUES\r\n ( '$this->ID', '$name', '$description', '$this->UserID', '$this->ParentID', '$this->SectionID' )\" );\r\n $db->unlock();\r\n }\r\n else\r\n {\r\n $db->query( \"UPDATE eZImageCatalogue_Category SET\r\n Name='$name',\r\n Description='$description',\r\n UserID='$this->UserID',\r\n ParentID='$this->ParentID',\r\n SectionID='$this->SectionID' WHERE ID='$this->ID'\" );\r\n }\r\n\r\n\r\n if ( $dbError == true )\r\n $db->rollback( );\r\n else\r\n $db->commit();\r\n\r\n\r\n return true;\r\n }", "function store_addcategory()\r\n{\r\n\tglobal $_user;\r\n\tglobal $dropbox_cnf;\r\n\r\n\t// check if the target is valid\r\n\tif ($_POST['target']=='sent')\r\n\t{\r\n\t\t$sent=1;\r\n\t\t$received=0;\r\n\t}\r\n\telseif ($_POST['target']=='received')\r\n\t{\r\n\t\t$sent=0;\r\n\t\t$received=1;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// check if the category name is valid\r\n\tif ($_POST['category_name']=='')\r\n\t{\r\n\t\treturn get_lang('ErrorPleaseGiveCategoryName');\r\n\t}\r\n\r\n\tif (!$_POST['edit_id'])\r\n\t{\r\n\t\t// step 3a, we check if the category doesn't already exist\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE user_id='\".$_user['user_id'].\"' AND cat_name='\".Database::escape_string($_POST['category_name']).\"' AND received='\".$received.\"' AND sent='\".$sent.\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\r\n\r\n\t\t// step 3b, we add the category if it does not exist yet.\r\n\t\tif (mysql_num_rows($result)==0)\r\n\t\t{\r\n\t\t\t$sql=\"INSERT INTO \".$dropbox_cnf['tbl_category'].\" (cat_name, received, sent, user_id)\r\n\t\t\t\t\tVALUES ('\".Database::escape_string($_POST['category_name']).\"', '\".Database::escape_string($received).\"', '\".Database::escape_string($sent).\"', '\".Database::escape_string($_user['user_id']).\"')\";\r\n\t\t\tapi_sql_query($sql);\r\n\t\t\treturn get_lang('CategoryStored');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn get_lang('CategoryAlreadyExistsEditIt');\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$sql=\"UPDATE \".$dropbox_cnf['tbl_category'].\" SET cat_name='\".Database::escape_string($_POST['category_name']).\"', received='\".Database::escape_string($received).\"' , sent='\".Database::escape_string($sent).\"'\r\n\t\t\t\tWHERE user_id='\".Database::escape_string($_user['user_id']).\"'\r\n\t\t\t\tAND cat_id='\".Database::escape_string($_POST['edit_id']).\"'\";\r\n\t\tapi_sql_query($sql);\r\n\t\treturn get_lang('CategoryModified');\r\n\t}\r\n}", "public function run()\n {\n Category::insert([\n \t['name'=>'Sci-fi','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Suspense','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Religious','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Romance','created_at'=>NULL,'updated_at'=>NULL]]);\n }", "public function addCategoryToGroupByName($gorup_name, $category_name);", "public function category()\n { \n if($this->access_role->is_Admin() == false) show_404();\n $this->load->model('Category_Model');\n \n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n if($this->form_validation->run('category_insert') ){\n $this->Category_Model->add_category(); \n } else {\n $error = ['class'=>'warning','text'=> validation_errors()];\n $this->session->set_flashdata('sms_flash', $error); \n redirect('Dashboard/category');\n }\n } \n else{\n $data = $this->Category_Model->view_category();\n }\n \n $this->load->view('admin/category_content',$data);\n }", "function add_utility_bill_category()\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['created_on']\t\t\t\t=\ttime();\n\t\t$data['created_by']\t\t\t\t=\t$this->session->userdata('user_id');\n\t\t$data['timestamp']\t\t\t\t=\ttime();\n\t\t$data['updated_by']\t\t\t\t=\t$this->session->userdata('user_id');\n\n\t\t$this->db->insert('utility_bill_category', $data);\n\n\t\t$this->session->set_flashdata('success', 'New utility bill category has been added successfully.');\n\n\t\tredirect(base_url() . 'utility_bill_categories', 'refresh');\n\t}", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "function process_addcategories($parent_id, $catname, $alias, $description, $date_add, $date_modify, $ordering, $enabled){\n\t\t $sql = \"INSERT INTO product_category (`parent_id`, `title`, `alias`, `description`, `date_add`, `date_modify`, `ordering`, `enabled`) \n\t\t\t\t VALUES (?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t $max_catid = $this->dbObj->last_insert_id($sql, array($parent_id, $this->dbObj->fix_quotes_dquotes($catname), $alias, $description, $date_add, $date_modify, $ordering, $enabled));\n\t\t if($max_catid > 0){\n\t\t\t return $max_catid;\n\t\t } else {\n\t\t\t return -1;\n\t\t }\n\t }", "function addCategory($monographId, $categoryId) {\n\t\t$this->update(\n\t\t\t'INSERT INTO submission_categories\n\t\t\t\t(submission_id, category_id)\n\t\t\tVALUES\n\t\t\t\t(?, ?)',\n\t\t\tarray(\n\t\t\t\t(int) $monographId,\n\t\t\t\t(int) $categoryId\n\t\t\t)\n\t\t);\n\t}", "function insert_metadata_categories($metadata, $object) {\n global $DB;\n\n $sql = \"SELECT MAX(sortorder) AS maxi FROM {custom_info_category} WHERE objectname=?\";\n $record = $DB->get_record_sql($sql, array($object));\n $sortorder = $record->maxi;\n foreach ($metadata as $cat => $drop) {\n if ( $DB->record_exists('custom_info_category', array('objectname'=>$object, 'name'=>$cat)) ) {\n echo \"[$cat] already exists.<br />\\n\";\n } else {\n $sortorder++;\n echo \"inserting [$cat].<br />\\n\";\n $record = new StdClass;\n $record->objectname = $object;\n $record->name = $cat;\n $record->sortorder = $sortorder;\n $DB->insert_record('custom_info_category', $record);\n }\n }\n}", "public function insert_post_category($postID, $category_name){\n\n\t\t$meta_key = 'post_category';\n\n\t\t$query = $this->db->prepare(\"INSERT INTO `nw_postmeta` (post_id,meta_key,meta_value) VALUES (?,?,?)\");\n\t\t$query-> bindValue(1, $postID);\n\t\t$query-> bindValue(2, $meta_key);\n\t\t$query-> bindValue(3, $category_name);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$check = $this->check_category_taxonomy($category_name);\n\t\t\tif($check === true){\n\t\t\t\t$this->insert_taxonomy_category($postID, $category_name);\n\t\t\t}else if($check === false){\n\t\t\t\t\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}catch(PDOException $e){\n\t\t\tdie($e ->getMessage());\n\t\t}\n\t}", "function additem ($category = null, $name = null, $weight = null, $price = null){\n try {\n $data=array(\"name\"=>$name,\"weight\"=>$weight,\"price\"=>$price);\n foreach ($this->content as $inventary) \n array_push($inventary->$category ,$data);\n } catch (Exception $e) {\n echo \"your selected category not found or add it first\";\n }\n }", "public function categories_add($param = null)\r\n {\r\n if (isset($_POST[\"cat_descr\"]) && !empty($_POST[\"cat_descr\"])) {\r\n $action = $_POST[\"cat_descr\"];\r\n $datas = Category::updateOrCreate([\r\n 'cat_descr' => $action,\r\n ]);\r\n // Return last insert row:\r\n echo $datas;\r\n } else {\r\n echo json_encode([\"message\" => \"ERROR!\"]);\r\n }\r\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}", "public function storeCategory(array $data): void\n {\n }", "public function add_postAction() {\r\n\t\t$info = $this->getPost(array('sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$result = Game_Service_Category::addCategory($info);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "public function addCategory(){\n\n\t\tif (($categoryName = $this->input->get_post('categoryName')) && ($categoryTypeId = $this->input->get_post('categoryTypeId')) && \n ($description = $this->input->get_post('description')) && ($categoryImage = $this->input->get_post('categoryImage'))) {\n\t\t\t\n\t\t\t\n\t\t\t$data = array(\n\t\t\t\t'categoryName' => $categoryName,\n\t\t\t\t'categoryTypeId' => $categoryTypeId,\n\t\t\t\t'description' => $description,\n\t\t\t\t'categoryImage' => $categoryImage\n\t\t\t);\n \n $ret = $this->Lootel_model->addCategory($data);\n\t\t\t\n\t\t\tif($ret){\n\t\t\t\t$response = array(\"status\"=>true,\"message\"=>\"Success\",\"userid\"=>$ret);\n\t\t\t}else{\n\t\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Record not saved\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Required parameter not found\");\n\t\t}\n\t\techo json_encode($response);\n\t}", "function wp_ajax_press_this_add_category()\n {\n }", "function upload_metas(){\r\n\t\r\n\t\t$cat_id \t\t\t= clean_input($_POST['cat_id']);\r\n\t\t$cat_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_keywords \t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_descriptions \t= clean_input($_POST['cat_meta_description']);\r\n\t\t\r\n\t\tif(isset($_POST['upload'])){\r\n\t\t\r\n\t\t$query = \"INSERT INTO categories WHERE cat_id ='$cat_id' \";\r\n\t\t$result = mysql_query($query) or die(mysql_error());\r\n\t\t\r\n\t\treturn $result;\r\n\t\t}\r\n\t}", "public function insertCategory($cat_id, $text_de, $text_en) {\n\t\t$query = \"INSERT INTO categorie (cat_id, text_de, text_en) VALUES ('$cat_id', '$text_de', '$text_en')\";\n\t\t$this->query ( $query );\n\t}", "public function save() {\n if (self::getCategoryById($this->id) == null) {\n // should create\n $sql = \"INSERT INTO category (name) VALUES ('%s') RETURNING id;\";\n $auth_user = User::getUserById(1);\n $sql = sprintf($sql, pg_escape_string($this->name));\n $results = self::$connection->execute($sql);\n $this->id = $results[0][\"id\"];\n } else {\n // should update\n $sql = \"UPDATE category SET name='%s' WHERE id=%d\";\n $sql = sprintf($sql, pg_escape_string($this->name), addslashes($this->id));\n self::$connection->execute($sql);\n }\n }", "function insertEntry(&$request, $newRowId) {\n\n\t\t$application =& PKPApplication::getApplication();\n\t\t$request =& $application->getRequest();\n\n\t\t$categoryId = $newRowId['name'];\n\t\t$categoryDao =& DAORegistry::getDAO('CategoryDAO');\n\t\t$monographDao =& DAORegistry::getDAO('MonographDAO');\n\t\t$press =& $request->getPress();\n\t\t$monograph =& $this->getMonograph();\n\n\t\t$category =& $categoryDao->getById($categoryId, $press->getId());\n\t\tif (!$category) return true;\n\n\t\t// Associate the category with the monograph\n\t\t$monographDao->addCategory(\n\t\t\t$monograph->getId(),\n\t\t\t$categoryId\n\t\t);\n\t}", "public function add_category($name = ''){\n\t\t$query = $this->db->insert('categories', array('cat_name'=>$name));\n\t\treturn $query;\n\t}", "function _make_cat_compat(&$category)\n {\n }", "public function create()\n {\n if ($this->request->getPost()) {\n $data = [\n 'name' => $this->request->getPost('category_name'),\n 'parent_id' => ($this->request->getPost('parent_category')) ? $this->request->getPost('parent_category') : NULL\n ];\n }\n\n $res = $this->model->insert($data);\n if ($res) {\n session()->setFlashdata('message', 'Category has been created successfully.');\n } else {\n session()->setFlashdata('message', 'Category cannot be created. Please try again Later.');\n }\n\n return $this->response->redirect('/category');\n }", "function create_cat($data=null){\n $this->load->model('pagesortingmodel');\n $this->pagesortingmodel->create_category($data);\n $this->load->view('admin/create_categories');\n }", "function addCategory($data){\n\t\t\t\n\t\t\t$token = '847895ee848fdb5fb2d43b275705470c';\n\t\t\t$domainname = 'https://elearning.inaba.ac.id';\n\t\t\t$functionname = 'core_course_create_categories';\n\t\t\t$restformat = 'json';\n\t\t\t\t$category = new stdClass();\n\t\t\t\t$category->name=$data['nama'];\t\n\t\t\t\t$category->parent=$data['parent'];\t\t\t\t\t\n\t\t\t\t$category->description='<p>'.$data['nama'].'</p>';\n\t\t\t\t$category->idnumber=$data['idnumber'];\t\t\t\t\t\n\t\t\t\t$category->descriptionformat=1;\t\t\t\t\t\t\t\t\t\n\t\t\t\t$categories = array($category);\n\t\t\t\t$params = array('categories' => $categories);\n\t\t\t\t/// REST CALL\n\t\t\t\t//header('Content-Type: text/plain');\n\t\t\t\t$serverurl = $domainname . '/webservice/rest/server.php'. '?wstoken=' . $token . '&wsfunction='.$functionname;\n\t\t\t\trequire_once($conf['model_dir'].'m_curl.php');\n\t\t\t\t$curl = new curl;\n\t\t\t\t//if rest format == 'xml', then we do not add the param for backward compatibility with Moodle < 2.2\n\t\t\t\t$restformat = ($restformat == 'json')?'&moodlewsrestformat=' . $restformat:'';\n\t\t\t\t$resp = $curl->post($serverurl . $restformat, $params);\n\t\t\t\t$data = json_decode($resp, true);\n\t\t\t\t\n\t\t\t\t\n\n\t\t\n\n\t\t}", "private function _storeCreatedCategoryId() {\r\n $I = $this->BackendTester;\r\n\r\n $I->click('.row-title');\r\n\r\n $tagId = null;\r\n\r\n $url = $I->grabFromCurrentUrl();\r\n\r\n $url = substr($url, strpos($url, '?') + 1);\r\n\r\n parse_str($url, $array);\r\n\r\n if (isset($array['tag_ID']))\r\n $tagId = $array['tag_ID'];\r\n\r\n $I->setVar('category_id', $tagId);\r\n\r\n return $tagId;\r\n }", "function get_addcategory_cat($page_id, $level, $current_id = 0, $pageid_prefix = '') {\n\t\n\tglobal $ft;\n\n\t$query = sprintf(\"\n SELECT \n category_id, \n category_parent_id, \n category_name \n FROM \n %1\\$s \n WHERE \n category_parent_id = '%2\\$d' \n ORDER BY \n category_id \n ASC\", \n\t\n TABLE_CATEGORY, \n $page_id\n );\n\n\t$db = new DB_SQL;\n\t$db->query($query);\n\t\n\t$id = isset($_GET['id']) ? intval($_GET['id']) : 0;\n\t\t\n\twhile($db->next_record()) {\n\t\n\t\t$cat_id = $db->f(\"category_id\");\n\t\t$cat_parent_id = $db->f(\"category_parent_id\");\n\t\t$cat_name = $db->f(\"category_name\");\n\t\n\t\t$ft->assign(array(\n 'C_ID'\t\t=>$pageid_prefix . $cat_id,\n 'C_NAME'\t=>str_repeat('&nbsp; ', $level) . \"- \" .$cat_name,\n 'CURRENT' =>$cat_id == $current_id ? 'selected=\"selected\"' : ''\n ));\n\n $ft->parse('CATEGORY_ROW', \".category_row\");\n\t\t\n\t\tget_addcategory_cat($cat_id, $level+2, $current_id, $pageid_prefix);\n\t}\n}", "public function newAction()\n {\n\t\tTag::appendTitle('Add New Category');\n }", "public function run()\n {\n Category::insert([\n [\n 'name' => 'exchange',\n 'slug' =>'exchange',\n ],\n [\n 'name' => 'card',\n 'slug' =>'card',\n\n ],\n [\n 'name' => 'loan',\n 'slug' =>'loan',\n\n ],\n [\n 'name' => 'wallet',\n 'slug' =>'wallet',\n\n ],\n [\n 'name' => 'interest account',\n 'slug' =>'interest-account',\n\n ],\n\n ]);\n }", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "public function run()\n {\n $this->insertCategories('Fast Food', 'Brza Hrana');\n $this->insertCategories('Barbecue', 'Roštilj');\n $this->insertCategories('Dessert', 'Desert');\n $this->insertCategories('Icecream', 'Sladoled');\n $this->insertCategories('Soup', 'Juha');\n }", "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "public function addCategory($data)\n {\n $item=array(\n 'name'=>$data['name']\n );\n\n $this->db->insert('defect_categories',$item);\n return true;\n }", "public function add_new_category_post(){\n $data = $this->security->xss_clean($_POST);\n $data = $this->DeviceCategory_model->add_new_category($data);\n if (isset($data['status']) == 'FALSE')\n {\n $this->response($data, REST_Controller::HTTP_SEE_OTHER);\n }\n $this->set_response($data, REST_Controller::HTTP_CREATED);\n }", "public function run()\n {\n DB::table('category')->insert($this->getData());\n }", "function addChoiceCategory($data){\n\n\t\t$this->db->insert('tbl_choice_category',$data);\n\t\treturn $this->db->insert_id();\n\t\t\n\t}" ]
[ "0.7077886", "0.706604", "0.70463437", "0.7024284", "0.6999519", "0.6958674", "0.69291216", "0.69209373", "0.69158804", "0.6871572", "0.6814281", "0.67500216", "0.6736799", "0.66526103", "0.6647954", "0.66455215", "0.6643374", "0.66071266", "0.66028905", "0.65850914", "0.6571084", "0.651245", "0.6507199", "0.6502195", "0.6494186", "0.6460202", "0.64599025", "0.6459387", "0.6437909", "0.64334434", "0.64324796", "0.641549", "0.64002585", "0.63994324", "0.63930005", "0.639103", "0.6377077", "0.6353593", "0.6351672", "0.63274544", "0.63049716", "0.63019615", "0.6295069", "0.62899244", "0.62679493", "0.62554824", "0.62517655", "0.62466663", "0.6239436", "0.62336963", "0.6208344", "0.620405", "0.61971307", "0.6197119", "0.61875945", "0.6187532", "0.61870193", "0.61861485", "0.6183684", "0.6182341", "0.6176384", "0.61726815", "0.617266", "0.61712015", "0.61636555", "0.61617947", "0.61486375", "0.61455727", "0.6123875", "0.6115609", "0.6104859", "0.61046726", "0.6104057", "0.61040455", "0.6098547", "0.60897195", "0.60878223", "0.6079793", "0.6073334", "0.60728145", "0.6069796", "0.6067052", "0.6061738", "0.6046493", "0.60419655", "0.60390973", "0.6028903", "0.60265034", "0.60238534", "0.600024", "0.599141", "0.5987244", "0.5987156", "0.5985112", "0.59726727", "0.597194", "0.5970252", "0.5966381", "0.59611505", "0.5959672", "0.59579986" ]
0.0
-1
function to insert category
public function insert_category() { $counter = $_POST['category_form_number']; $data = array(); for ($i = 1; $i <= $counter; $i++) { $config['upload_path'] = "assets/lib/images/category/"; $config['allowed_types'] = 'jpg|png|jpeg'; $this->load->library('upload', $config); $imagename = $_FILES['category_image_' . $i]['name']; $this->upload->initialize($config); if (!$this->upload->do_upload('category_image_' . $i)) { $error = array('error' => $this->upload->display_errors()); } else { $success = array('image_metadata' => $this->upload->data()); } $ar_name = $_POST['category_ar_name_' . $i]; $en_name = $_POST['category_en_name_' . $i]; $discount = $_POST['category_discount_' . $i]; if (isset($_POST['category_printer_' . $i])) { $printer = json_encode($_POST['category_printer_' . $i]); } else { $printer = NULL; } if (isset($_POST['category_brnach_location_' . $i])) { $branch_location = $_POST['category_brnach_location_' . $i]; foreach ($branch_location as $key => $value) { $branch_location_id = $value; $sub_array = array('ar_name' => $ar_name, 'en_name' => $en_name, 'discount' => $discount / 100, 'branch_location_id' => $branch_location_id, 'image' => $imagename, 'printer_id' => $printer); array_push($data, $sub_array); } } else { $branch_location_id = NULL; $sub_array = array('ar_name' => $ar_name, 'en_name' => $en_name, 'discount' => $discount / 100, 'branch_location_id' => $branch_location_id, 'image' => $imagename, 'printer_id' => $printer); array_push($data, $sub_array); } } $this->Category_crud->insert_category($data); redirect(rest_path('Category')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createCategory();", "function insertCategory($data){\n\treturn dbInsert('categories', $data);\n}", "function InsertCategory_board()\n {\n $this->model->InsertCategory();\n }", "function target_add_cat($cat)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $cat['name']);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat (id, name, view_order, cat_opt) \n\t VALUES('. (int)$cat['id'] .','. _esc($cat['name']) .','. (int)$cat['view_order'] .', 3)');\n\t$GLOBALS['cat_map'][ $cat['id'] ] = $cat['id'];\n/*\nfud_use('cat.inc', true);\n$nc = new fud_cat;\n$nc->name = $c->name;\n$nc->description = $c->description;\n$nc->view_order = $c->disporder;\n$nc->cat_opt = 1|2;\t// This should be the default in cat.inc. Fix in next release and del this line.\n$GLOBALS['cat_map'][$c->fid] = $nc->add('LAST');\t// FIRST should also be defaulted.\n*/\n}", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "function insert(category $cat)\n {\n $query = \"INSERT INTO categories (categories_id, name, tag, description, slug, active)\n VALUE ('$cat->category_id', '$cat->name', '$cat->tag', '$cat->description', '$cat->slug', $cat->active)\";\n $result = $this->db->insert($query);\n }", "function add_category() {\r\n\r\n\tif(isset($_POST['addcategory'])){\r\n\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\tif(empty($_POST['cat_parent_id'])){$cat_parent_id\t\t= \"0\";}\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\t\r\n\r\n\t\t$xyquery = \"INSERT INTO categories (\";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"cat_name \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",cat_desc_short \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",cat_desc_long \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",cat_url\";}\r\n\t\t$xyquery .= \",cat_date\";\r\n\t\t$xyquery .= \",cat_mod\";\r\n\t\t$xyquery .= \",cat_mod_by\";\r\n\t\tif (!empty($page_template)){$xyquery .= \",page_template\";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",cat_meta_title\";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",cat_meta_keywords\";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",cat_meta_description\";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \") VALUES ( \";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"'$cat_name' \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",'$cat_desc_short' \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",'$cat_desc_long' \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",'$cat_parent_id' \";\t}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",'0' \";\t}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",'$cat_url' \";}\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",'$cat_mod_by' \";\r\n\t\tif (!empty($page_template)){$xyquery .= \",'$page_template' \";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",'$cat_meta_title' \";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",'$cat_meta_keywords' \";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",'$cat_meta_description' \";}\r\n\t\tif (!empty($insert_keywords)){$xyquery .= \",'$insert_keywords' \";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \" )\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" has been created!</h4></center>\";\r\n\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been created.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "function insert_cat()\n\t {\n\t\t $cat_par_id = $_POST['cat_par_id'];\n\t\t if(mysql_real_escape_string(trim($_POST['cat_title']))=='')\n\t\t {\n\t\t return '<span class=\"err\">please enter the category title</span>';\n\t\t }\n\t\t else\n\t\t {\n\t\t mysql_query(\"insert into category(cat_par_id,cat_title,cat_des) values('$cat_par_id','\".mysql_real_escape_string(trim($_POST['cat_title'])).\"','\".mysql_real_escape_string(trim($_POST['cat_des'])).\"')\");\n\t\t unset($_POST);\n\t\t return '<span class=\"fine\">category inserted successfully...</span>';\n\t\t }\n \t \n }", "function insertCate($category, $add_group) {\r\t\t$sql = \"INSERT INTO category (c_name, c_main_id) VALUES ('\".$category.\"', '\".$add_group.\"')\";\r\t\t$this->db->query($sql);\r\t\t\r\t\tif ($this->db->insert_id() > 0)\r\t\t\treturn $this->db->insert_id();\r\t\telse\r\t\t\treturn FALSE;\r\t}", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "public function addCathegory($values)\n\t{\n\t\treturn $this->getTable('kategoria')->insert(array(\n\t\t\t'Nazov' => $values->nazov,\n\t\t));\n\t}", "function createCategory($category)\r\n{\r\n $results = false;\r\n \r\n $db = dbconnect();\r\n \r\n $stmt = $db->prepare(\"INSERT INTO categories SET category = :category\");\r\n \r\n $binds = array(\r\n // Used to place new array information under a new ID in Categories table\r\n \":category\" => $category,\r\n );\r\n \r\n if ($stmt->execute($binds) && $stmt->rowCount() > 0) \r\n {\r\n $results = true;\r\n }\r\n \r\n return $results; \r\n}", "public function addCategoryToGroupById($gorup_id, $category_id);", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function create_category(){\n $query = \"INSERT INTO {$this->table} (cat_title) VALUES (:cat_title)\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_title',$this->cat_title); \n $stmt->execute();\n return $stmt;\n }", "public function insert_category($category){\n\n\t\t mysql_query(\"INSERT INTO `categories` SET `cat` = '$category'\");\n\n\t\t\treturn true;\n\n\t}", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "function add_category($name, $price, $discount){\n\tglobal $db;\n\t$query = \n ' INSERT INTO categories\n (cat_categoryID, cat_categoryName, cat_price, cat_discount)\n VALUES\n (null, :name, :cat_price, :cat_discount)';\n $statement = $db->prepare($query);\n $statement->bindValue(':name', $name);\n $statement->bindValue(':cat_price', $price);\n $statement->bindValue(':cat_discount', $discount);\n $statement->execute();\n $statement->closeCursor();\n}", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function addCategory()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['category'];\n\t\t\t$sql = \"insert into lib_category (category,add_date,staff_id) \n\t\t\t\t\tvalues('\" . $category . \"','\" . date('Y-m-d') . \"','\" . cookie('staffAccount') . \"') \";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Add successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function addCategoryToGroupByName($gorup_name, $category_name);", "public function insert() {\n\t\t\t$conn = parent::connect();\n\t\t\t$sql = \"INSERT INTO \" . TBL_CATEGORY . \" ( \n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\talias,\n\t\t\t\t\t\t\t\tdescription\n\t\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t\t:title,\n\t\t\t\t\t\t\t\t:alias,\n\t\t\t\t\t\t\t\t:description\t\t\t\t\n\t\t\t\t\t\t\t)\";\n\t\t\ttry {\n\t\t\t\t$st = $conn->prepare($sql);\n\t\t\t\t$st->bindValue(\":title\", $this->data[\"title\"], PDO::PARAM_STR);\n\t\t\t\t$st->bindValue(\":alias\", $this->data[\"alias\"], PDO::PARAM_STR);\n\t\t\t\t$st->bindValue(\":description\", $this->data[\"description\"], PDO::PARAM_STR);\n\t\t\t\t$st->execute();\n\t\t\t\tparent::disconnect($conn);\n\t\t\t} catch (PDOException $e) {\n\t\t\t\tparent::disconnect($conn);\n\t\t\t\tdie(\"Query failed: \" . $e->getMessage());\n\t\t\t}\n\t\t}", "function add_cat() {\n $item = mysql_real_escape_string($_POST['cat']);\n $sql = \"INSERT INTO Categories (name) \n VALUES ('$item')\";\n\tmysql_query($sql);\n}", "public function addCategory($category_name){\n\n //write the query to insert into taable\n $query = \"INSERT INTO category(category_name) \n VALUES ('$category_name')\";\n\n //check if the query() runs // data is insert into users table\n if ($this->dbobj->dbcon->query($query)===true){\n\n\n \n echo \" Category was successfully added\";\n \n }\n else{\n echo \"Error\".$this->dbobj->dbcon->error;\n }\n }", "function SELLMYHOME_add_category( $cat_name, $taxonomy ){\n //Check if term exists before attempting to create\n if( !term_exists( $cat_name, $taxonomy ) ){\n $my_cat = array('cat_name' => $cat_name, \n 'category_description' => 'Default, Permanent Category', \n 'category_nicename' => SELLMYHOME_clean($cat_name), \n 'category_parent' => '',\n 'taxonomy' => $taxonomy);\n\n // Create the category\n wp_insert_category($my_cat); \n } \n}", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "function add_categoria($params)\n {\n $this->db->insert('categoria',$params);\n return $this->db->insert_id();\n }", "public function addCategory(Category $category){\n $req =$this->db->prepare('INSERT INTO p5_files_category(category_name)\n VALUES(?)');\n $req->execute(array($category->getCategory_name()));\n }", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function InsertCategory($_category)\n\t\t{\n\t\t\t$query = \"insert into categories(\";\n\t\t\t$query .= \"categoryname,\";\n\t\t\t$query .= \"parentcategoryid,\";\n\t\t\t$query .= \"filtered,\";\n\t\t\t$query .= \"displayorder\";\n\t\t\t$query .= \")\";\n\t\t\t$query .= \" values (\";\n\t\t\t$query .= \"'\" . $this->CheckString($_category->getCategoryName()) . \"', \";\n\t\t\t$query .= $_category->getParentCategoryID() . \", \";\n\t\t\t$query .= $this->CheckBoolean($_category->getFiltered()) . \" , \";\n\t\t\t$query .= $_category->getDisplayOrder() . \" \";\n\t\t\t$query .= \" )\";\n\t\t\treturn $query;\n\t\t}", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function add(Category $category);", "public function insert_category() {\n\n $this->load->model('Categories');\n\n $category_id = $this->auth->generator(15);\n\n\n\n //Customer basic information adding.\n\n $data = array(\n\n 'category_id' => $category_id,\n\n 'category_name' => $this->input->post('category_name'),\n\n 'status' => 1\n\n );\n\n\n\n $result = $this->Categories->category_entry($data);\n\n\n\n if ($result == TRUE) {\n\n $this->session->set_userdata(array('message' => display('successfully_added')));\n\n echo TRUE;\n\n } else {\n\n $this->session->set_userdata(array('error_message' => display('already_exists')));\n\n echo FALSE;\n\n }\n\n }", "public function addCategory($table, $data)\n {\n\n if (isset($data)) {\n $result=$this->dynamicInsert($table, $data);\n }\n }", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "function addCategory()\r\n{\r\n global $conn;\r\n global $_POST;\r\n \r\n \r\n if(isset($_POST[\"cat_name\"]) && $_POST[\"cat_name\"]<>''){ \r\n \r\n\t $catname = $_POST[\"cat_name\"];\r\n\t \r\n\t $sqlquery = \"select * from tbl_categories where cat_name= '$catname'\";\r\n\t \r\n\t $result = mysql_query($sqlquery,$conn) or die(mysql_error());\r\n\t if(mysql_num_rows($result) >0){\r\n\t \t$str = \"Data Already Exists\";\r\n\t }else{\r\n\t $sql = \"insert into `tbl_categories` (`cat_name`, `cat_description`) \r\n\t \t\t\tvalues (\" . strtoupper(sqlvalue(@$_POST[\"cat_name\"], true)).\", \" . strtoupper(sqlvalue(@$_POST[\"cat_description\"], true)).\")\";\r\n\t //echo \"SQL :\".$sql;\r\n \tmysql_query($sql, $conn) or die(mysql_error());\r\n\t \tif(mysql_affected_rows()>0){\r\n\t \t\t$str = \"Record Added Successfully\";\r\n\t \t}\r\n\t }\r\n }else{\r\n \t\t$str = \"Wrong Data Entry \";\r\n }\r\n echo $str;\r\n}", "function createCategories()\n {\n $currentCategories = $this->loadCategories();\n\n foreach ($this->categories as $category)\n {\n // Skip adding category if it already exists\n if (in_array($category, $currentCategories))\n {\n continue;\n }\n\n // Create a copy of the template array for category properties\n $data = array_merge($this->categoryTemplate);\n\n // Set the category description from the translation key in en-GB.com_cajobboard.sys.ini\n // remove any spaces from the category title when building the translation key\n $data['title'] = Text::_('COM_CAJOBBOARD_CATEGORY_TITLE_' . strtoupper(str_replace(' ', '', $category)));\n\n $data['description'] = $data['title'];\n\n // Initialize a new category\n $category = Table::getInstance('Category');\n\n // Bind passed category parameters to Category model\n $category->bind($data);\n\n // setLocation(integer $referenceId, string $position = 'after')\n $category->setLocation($category->getRootId(), 'last-child');\n\n // Check to make sure our data is valid. check() will auto generate alias if not set above.\n if (!$category->check())\n {\n throw new \\Exception($category->getError(), 500);\n\n return false;\n }\n\n // Store the category\n if (!$category->store(true))\n {\n throw new \\Exception($category->getError(), 500);\n\n return false;\n }\n\n // Build the path for our category and set it in the database\n $category->rebuildPath($category->id);\n }\n\n Table::getInstance('Category')->rebuild();\n }", "public function save_category_info($data) {\n $this->db->insert('tbl_category', $data);\n }", "public function add_cat() { \n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\tdie();\n\t\t}\n\t\t$main_cat_id = $this->input->post('main_cat_id');\n\t\t$title = $this->input->post('title'); \n\n\n\t\t$array_data['main_cat_id'] = $main_cat_id ; \n\t\t$array_data['title'] = $title ; \n\t\t$this->db->insert(\"categories\" , $array_data); \n\t\t$result = array('statu' => 'ok');\n\t\techo json_encode($result);\n\n\t}", "function addChoiceCategory($data){\n\n\t\t$this->db->insert('tbl_choice_category',$data);\n\t\treturn $this->db->insert_id();\n\t\t\n\t}", "public function add_category() {\n\t\n\t\tif($this->input->post('add_type')=='add_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name'),\n\t\t'created_at' => date('d-m-Y h:i:s')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->add_assets_category($data);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_added');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function createCategory($item,$asid)\n\t{\n\n\t\t$tname=$this->tablename('catalog_category_entity');\n $item['entity_id']=$item['category_id'];\n $item['path']=$this->getPathCategory($item);\n\t\t\n if(!empty($item['path'])){\n $item['path'].=\"/\".$item['entity_id'];\n \n $item['attribute_set_id']=$asid;\n $item['entity_type_id']=$this->cat_etype;\n $item['created_at']=strftime(\"%Y-%m-%d %H:%M:%S\");\n $item['updated_at']=strftime(\"%Y-%m-%d %H:%M:%S\");\n $columns=array_intersect(array_keys($item), $this->getCatCols());\n $values=$this->filterkvarr($item, $columns);\n $sql=\"INSERT INTO `$tname` (\".implode(\",\",$columns).\") VALUES (\".$this->arr2values($columns).\")\";\n //$this->log($sql,\"debug\");\n $lastid=$this->insert($sql,array_values($values));\n return $lastid;\n }else{\n return false;\n }\n\t}", "public function add_attr_cat()\n\t{\n\t\t$rest_id=$this->session->userdata('user_rest_uns');\n\t\t$cat_name=$this->input->post('cat_name');\n\t\t$query=$this->db->insert(\"food_attribute\",array(\"f_att_name\"=>$cat_name,\"rest_id\"=>$rest_id));\n\t\t\n\t\tif($query)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function add_category($name = ''){\n\t\t$query = $this->db->insert('categories', array('cat_name'=>$name));\n\t\treturn $query;\n\t}", "function addCategory($monographId, $categoryId) {\n\t\t$this->update(\n\t\t\t'INSERT INTO submission_categories\n\t\t\t\t(submission_id, category_id)\n\t\t\tVALUES\n\t\t\t\t(?, ?)',\n\t\t\tarray(\n\t\t\t\t(int) $monographId,\n\t\t\t\t(int) $categoryId\n\t\t\t)\n\t\t);\n\t}", "function MamboImporter_AddPostCategoryHelper( $category ){\n\t\t$chain = array();\n\t\t$term_id = -1;\n\t\tif( $category->parent ){\n\t\t\t$term_res = MamboImporter_AddPostCategoryHelper( $category->parent );\n\t\t\tif( empty($term_res['term_id']) ){\n\t\t\t\treturn $term_res;\n\t\t\t}\n\t\t\t$chain = $term_res['chain'];\n\t\t\t$term_id = $term_res['term_id'];\n\t\t}\n\t\t$term_res = wp_insert_term( $category->title, 'category', array(\n\t\t\t'slug' => $category->slug,\n\t\t\t'description' => $category->description,\n\t\t\t'parent' => $term_id\n\t\t\t));\n\t\tif( !$term_res ){\n\t\t\t$term_res = array(\n\t\t\t\t'errors' => array('unknown' => array('Unknown Error') )\n\t\t\t\t);\n\t\t}\n\t\telse if( $term_res instanceof WP_Error ){\n\t\t\t$term_res = array(\n\t\t\t\t'term_id' => $term_res->error_data['term_exists'],\n\t\t\t\t'errors' => $term_res->errors\n\t\t\t\t);\n\t\t}\n\t\tif( $term_res['term_id'] ){\n\t\t\t$chain[] = $term_res['term_id'];\n\t\t}\n\t\t$term_res['chain'] = $chain;\n\t\treturn $term_res;\n\t}", "function insertCategories() {\n\tglobal $connection;\n\tif (isset($_POST['submit'])) {\n\n\t\t$title = escape($_POST['cat_title']);\n\n\t\tif ($title === \"\" || empty($title)) {\n\t\t\techo \"This field should not be empty\";\n\t\t} else {\n\n\t\t\t$stmt = mysqli_prepare($connection, \"INSERT INTO categories(cat_title) VALUES(?)\");\n\n\t\t\tmysqli_stmt_bind_param($stmt, 's', $title);\n\n\t\t\tmysqli_stmt_execute($stmt);\n\n\t\t\tif (!$stmt) {\n\t\t\t\tdie(\"QUERY FAILED\");\n\t\t\t}\n\t\t}\n\t\tmysqli_stmt_close($stmt);\n\t}\n\n}", "public static function func_ajax_add_category() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n $self = self::sanitize($_POST['name']);\n $day = self::sanitize($_POST['day']);\n $desc = self::sanitize($_POST['description']);\n $wpdb->query($wpdb->prepare( \"INSERT INTO \".$wpdb->prefix.self::$table_name .\" VALUES (%d, %s, %s, %s)\", null, $self,$day,$desc ));\n die();\n\t\t\t\t}\n\t\t\n\t\t}", "public function insertCateDes($categoryNameSub,$categories_id,$languages_data_id){\n DB::table('categories_description')->insert([\n 'categories_name' => $categoryNameSub,\n 'categories_id' => $categories_id,\n 'language_id' => $languages_data_id\n ]);\n }", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio 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/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "function wp_ajax_press_this_add_category()\n {\n }", "public function addcategory($args)\n {\n if (!SecurityUtil::checkPermission('Dizkus::', \"::\", ACCESS_ADMIN)) {\n return LogUtil::registerPermissionError();\n }\n \n if (isset($args['cat_title'])) {\n $args['cat_order'] = DBUtil::selectObjectCount('dizkus_categories') + 1;\n $obj = DBUtil::insertObject($args, 'dizkus_categories', 'cat_id');\n return $obj['cat_id'];\n }\n \n return false;\n }", "public function addCategory($data)\n {\n $item=array(\n 'name'=>$data['name']\n );\n\n $this->db->insert('defect_categories',$item);\n return true;\n }", "function addCategory() {\n var_dump($this->request->data);\n if ($this->request->is('post') || $this->request->is('put')) {\n $ci = $this->CategoryItem->create();\n var_dump($ci);\n if ($this->CategoryItem->save($this->request->data)) {\n $this->Session->setFlash(__('The %s has been saved', __('link')), 'flash/success');\n } else {\n $this->Session->setFlash(__('The %s could not be saved. Please, try again.', __('link')), 'flash/failure');\n }\n// $this->redirect(array('action' => 'edit', $this->Item->id));\n } else {\n $this->redirect(array('action' => 'index'));\n }\n }", "function add_utility_bill_category()\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['created_on']\t\t\t\t=\ttime();\n\t\t$data['created_by']\t\t\t\t=\t$this->session->userdata('user_id');\n\t\t$data['timestamp']\t\t\t\t=\ttime();\n\t\t$data['updated_by']\t\t\t\t=\t$this->session->userdata('user_id');\n\n\t\t$this->db->insert('utility_bill_category', $data);\n\n\t\t$this->session->set_flashdata('success', 'New utility bill category has been added successfully.');\n\n\t\tredirect(base_url() . 'utility_bill_categories', 'refresh');\n\t}", "function ccategories_create()\n\t{\n\t\tlusers_require(\"categories/create\");\n\n\t\t$post_data = linput_post();\n\t\t$post_data = linput_post_checkbox($post_data, \"content\");\n\t\t$content = $post_data[\"content\"];\n\n\t\tif (hform_validate(array(\"name\", \"link\", \"parentid\")))\n\t\t{\n\t\t\t$cat_created = mcategories_create($post_data);\n\t\t\tif ($content) $content_created = mcontent_create($post_data);\n\t\t\telse $content_created = false;\n\n\t\t\tif (($cat_created && !$content) || ($content && $cat_created && $content_created))\n\t\t\t{\n\t\t\t\tlcache_delete_all();\n\t\t\t\thmessage_set(l(\"Category successfully created.\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($cat_created) mcategories_delete($post_data[\"link\"]);\n\t\t\t\tif ($content_created) mcontent_delete($post_data[\"link\"]);\n\t\t\t\thmessage_set(l(\"Category create error.\") . \" \" . l(\"Link already in use.\"));\n\t\t\t}\n\n\t\t\tluri_redirect(\"main/user/admin/categories\");\n\t\t}\n\t\telse luri_redirect(\"main/user/admin/categories_create\", l(\"All fields marked with * are required.\"));\n\t}", "public function insert(PDO &$pdo) {\n\t\t// make sure category doesn't already exist\n\t\tif($this->categoryId === null) {\n\t\t\t//create query template\n\t\t\t$query\n\t\t\t\t= \"INSERT INTO category (name) VALUES (:name)\";\n\t\t\t$statement = $pdo->prepare($query);\n\n\t\t\t// bind the variables to the place holders in the template\n\t\t\t$parameters = array(\"name\" => $this->name);\n\t\t\t$statement->execute($parameters);\n\n\t\t\t//update null subcategory with what mySQL just gave us\n\t\t\t$this->categoryId = intval($pdo->lastInsertId());\n\t\t}\n\t}", "function process_addcategories($parent_id, $catname, $alias, $description, $date_add, $date_modify, $ordering, $enabled){\n\t\t $sql = \"INSERT INTO product_category (`parent_id`, `title`, `alias`, `description`, `date_add`, `date_modify`, `ordering`, `enabled`) \n\t\t\t\t VALUES (?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t $max_catid = $this->dbObj->last_insert_id($sql, array($parent_id, $this->dbObj->fix_quotes_dquotes($catname), $alias, $description, $date_add, $date_modify, $ordering, $enabled));\n\t\t if($max_catid > 0){\n\t\t\t return $max_catid;\n\t\t } else {\n\t\t\t return -1;\n\t\t }\n\t }", "public function insertCategory($cat_id, $text_de, $text_en) {\n\t\t$query = \"INSERT INTO categorie (cat_id, text_de, text_en) VALUES ('$cat_id', '$text_de', '$text_en')\";\n\t\t$this->query ( $query );\n\t}", "public function addMultipleCategoriesToGroup();", "protected function storeCategoryIntoDatabase( &$category, &$languages, $exist_meta_title, &$layout_ids, &$available_store_ids, &$url_alias_ids ) {\n\t\t$category_id = $category['category_id'];\n\t\t$image_name = $this->db->escape($category['image']);\n\t\t$parent_id = $category['parent_id'];\n\t\t$top = $category['top'];\n\t\t$top = ((strtoupper($top)==\"TRUE\") || (strtoupper($top)==\"YES\") || (strtoupper($top)==\"ENABLED\")) ? 1 : 0;\n\t\t$columns = $category['columns'];\n\t\t$sort_order = $category['sort_order'];\n\t\t$date_added = $category['date_added'];\n\t\t$date_modified = $category['date_modified'];\n\t\t$names = $category['names'];\n\t\t$descriptions = $category['descriptions'];\n\t\tif ($exist_meta_title) {\n\t\t\t$meta_titles = $category['meta_titles'];\n\t\t}\n\t\t$meta_descriptions = $category['meta_descriptions'];\n\t\t$meta_keywords = $category['meta_keywords'];\n\t\t$seo_keyword = $category['seo_keyword'];\n\t\t$store_ids = $category['store_ids'];\n\t\t$layout = $category['layout'];\n\t\t$status = $category['status'];\n\t\t$status = ((strtoupper($status)==\"TRUE\") || (strtoupper($status)==\"YES\") || (strtoupper($status)==\"ENABLED\")) ? 1 : 0;\n\n\t\t// generate and execute SQL for inserting the category\n\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category` (`category_id`, `image`, `parent_id`, `top`, `column`, `sort_order`, `date_added`, `date_modified`, `status`) VALUES \";\n\t\t$sql .= \"( $category_id, '$image_name', $parent_id, $top, $columns, $sort_order, \";\n\t\t$sql .= ($date_added=='NOW()') ? \"$date_added,\" : \"'$date_added',\";\n\t\t$sql .= ($date_modified=='NOW()') ? \"$date_modified,\" : \"'$date_modified',\";\n\t\t$sql .= \" $status);\";\n\t\t$this->db->query( $sql );\n\t\tforeach ($languages as $language) {\n\t\t\t$language_code = $language['code'];\n\t\t\t$language_id = $language['language_id'];\n\t\t\t$name = isset($names[$language_code]) ? $this->db->escape($names[$language_code]) : '';\n\t\t\t$description = isset($descriptions[$language_code]) ? $this->db->escape($descriptions[$language_code]) : '';\n\t\t\tif ($exist_meta_title) {\n\t\t\t\t$meta_title = isset($meta_titles[$language_code]) ? $this->db->escape($meta_titles[$language_code]) : '';\n\t\t\t}\n\t\t\t$meta_description = isset($meta_descriptions[$language_code]) ? $this->db->escape($meta_descriptions[$language_code]) : '';\n\t\t\t$meta_keyword = isset($meta_keywords[$language_code]) ? $this->db->escape($meta_keywords[$language_code]) : '';\n\t\t\tif ($exist_meta_title) {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_description` (`category_id`, `language_id`, `name`, `description`, `meta_title`, `meta_description`, `meta_keyword`) VALUES \";\n\t\t\t\t$sql .= \"( $category_id, $language_id, '$name', '$description', '$meta_title', '$meta_description', '$meta_keyword' );\";\n\t\t\t} else {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_description` (`category_id`, `language_id`, `name`, `description`, `meta_description`, `meta_keyword`) VALUES \";\n\t\t\t\t$sql .= \"( $category_id, $language_id, '$name', '$description', '$meta_description', '$meta_keyword' );\";\n\t\t\t}\n\t\t\t$this->db->query( $sql );\n\t\t}\n\t\tif ($seo_keyword) {\n\t\t\tif (isset($url_alias_ids[$category_id])) {\n\t\t\t\t$url_alias_id = $url_alias_ids[$category_id];\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"url_alias` (`url_alias_id`,`query`,`keyword`) VALUES ($url_alias_id,'category_id=$category_id','$seo_keyword');\";\n\t\t\t\tunset($url_alias_ids[$category_id]);\n\t\t\t} else {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"url_alias` (`query`,`keyword`) VALUES ('category_id=$category_id','$seo_keyword');\";\n\t\t\t}\n\t\t\t$this->db->query($sql);\n\t\t}\n\t\tforeach ($store_ids as $store_id) {\n\t\t\tif (in_array((int)$store_id,$available_store_ids)) {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_to_store` (`category_id`,`store_id`) VALUES ($category_id,$store_id);\";\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\t}\n\t\t$layouts = array();\n\t\tforeach ($layout as $layout_part) {\n\t\t\t$next_layout = explode(':',$layout_part);\n\t\t\tif ($next_layout===false) {\n\t\t\t\t$next_layout = array( 0, $layout_part );\n\t\t\t} else if (count($next_layout)==1) {\n\t\t\t\t$next_layout = array( 0, $layout_part );\n\t\t\t}\n\t\t\tif ( (count($next_layout)==2) && (in_array((int)$next_layout[0],$available_store_ids)) && (is_string($next_layout[1])) ) {\n\t\t\t\t$store_id = (int)$next_layout[0];\n\t\t\t\t$layout_name = $next_layout[1];\n\t\t\t\tif (isset($layout_ids[$layout_name])) {\n\t\t\t\t\t$layout_id = (int)$layout_ids[$layout_name];\n\t\t\t\t\tif (!isset($layouts[$store_id])) {\n\t\t\t\t\t\t$layouts[$store_id] = $layout_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ($layouts as $store_id => $layout_id) {\n\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_to_layout` (`category_id`,`store_id`,`layout_id`) VALUES ($category_id,$store_id,$layout_id);\";\n\t\t\t$this->db->query($sql);\n\t\t}\n\t}", "public function createNewCategory()\r\n{\r\n $query_string = \"INSERT INTO categories \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"categoryname = :categoryname, \";\r\n $query_string .= \"categorydescription = :categorydescription\";\r\n\r\n return $query_string;\r\n}", "public function add_category($category)\n {\n if (is_array($category)) {\n $this->db->insert($this->table_name, $category);\n \n if ($this->db->insert_id() > 0) {\n return $this->db->insert_id();\n } else {\n $this->error_message = 'Category add unsuccessful. DB error.';\n return false;\n }\n } else {\n $this->error_message = 'Invalid parameter.';\n return false;\n }\n }", "function add_categroy( $category_title, $category_image_icon, $sort_order, $status )\n\t{\n\t\t$q = \"INSERT INTO title_dev_categories(`category_title`, `category_image_icon`, `sort_order`, `status`, `addeddate`, `modifieddate`)\n\t\t\t VALUES('\".$category_title.\"', '\".$category_image_icon.\"', '\".$sort_order.\"', '\".$status.\"', '\".date('Y-m-d H:i:s').\"', '\".date('Y-m-d H:i:s').\"')\";\n\t\t$r = $this -> db -> insertRecord( $q );\n\t\tif( $r )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "function _make_cat_compat(&$category)\n {\n }", "function store_addcategory()\r\n{\r\n\tglobal $_user;\r\n\tglobal $dropbox_cnf;\r\n\r\n\t// check if the target is valid\r\n\tif ($_POST['target']=='sent')\r\n\t{\r\n\t\t$sent=1;\r\n\t\t$received=0;\r\n\t}\r\n\telseif ($_POST['target']=='received')\r\n\t{\r\n\t\t$sent=0;\r\n\t\t$received=1;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// check if the category name is valid\r\n\tif ($_POST['category_name']=='')\r\n\t{\r\n\t\treturn get_lang('ErrorPleaseGiveCategoryName');\r\n\t}\r\n\r\n\tif (!$_POST['edit_id'])\r\n\t{\r\n\t\t// step 3a, we check if the category doesn't already exist\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE user_id='\".$_user['user_id'].\"' AND cat_name='\".Database::escape_string($_POST['category_name']).\"' AND received='\".$received.\"' AND sent='\".$sent.\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\r\n\r\n\t\t// step 3b, we add the category if it does not exist yet.\r\n\t\tif (mysql_num_rows($result)==0)\r\n\t\t{\r\n\t\t\t$sql=\"INSERT INTO \".$dropbox_cnf['tbl_category'].\" (cat_name, received, sent, user_id)\r\n\t\t\t\t\tVALUES ('\".Database::escape_string($_POST['category_name']).\"', '\".Database::escape_string($received).\"', '\".Database::escape_string($sent).\"', '\".Database::escape_string($_user['user_id']).\"')\";\r\n\t\t\tapi_sql_query($sql);\r\n\t\t\treturn get_lang('CategoryStored');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn get_lang('CategoryAlreadyExistsEditIt');\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$sql=\"UPDATE \".$dropbox_cnf['tbl_category'].\" SET cat_name='\".Database::escape_string($_POST['category_name']).\"', received='\".Database::escape_string($received).\"' , sent='\".Database::escape_string($sent).\"'\r\n\t\t\t\tWHERE user_id='\".Database::escape_string($_user['user_id']).\"'\r\n\t\t\t\tAND cat_id='\".Database::escape_string($_POST['edit_id']).\"'\";\r\n\t\tapi_sql_query($sql);\r\n\t\treturn get_lang('CategoryModified');\r\n\t}\r\n}", "public function add_postAction() {\r\n\t\t$info = $this->getPost(array('sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$result = Game_Service_Category::addCategory($info);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "function insert_category($categories_data, $dest_category_id, $action = 'insert') {\n\n\t\t$categories_id = olc_db_prepare_input($categories_data['categories_id']);\n\n\t\t$sort_order = olc_db_prepare_input($categories_data['sort_order']);\n\t\t$categories_status = olc_db_prepare_input($categories_data['status']);\n\n\n\n\n\n\t\t$customers_statuses_array = olc_get_customers_statuses();\n\n\t\t$permission = array ();\n\t\tfor ($i = 0; $n = sizeof($customers_statuses_array), $i < $n; $i ++) {\n\t\t\tif (isset($customers_statuses_array[$i]['id']))\n\t\t\t\t$permission[$customers_statuses_array[$i]['id']] = 0;\n\t\t}\n\t\tif (isset ($categories_data['groups']))\n\t\t\tforeach ($categories_data['groups'] AS $dummy => $b) {\n\t\t\t\t$permission[$b] = 1;\n\t\t\t}\n\t\t// build array\n\t\tif ($permission['all']==1) {\n\t\t\t$permission = array ();\n\t\t\tend($customers_statuses_array);\n\t\t\tfor ($i = 0; $n = key($customers_statuses_array), $i < $n+1; $i ++) {\n\t\t\t\tif (isset($customers_statuses_array[$i]['id']))\n\t\t\t\t\t$permission[$customers_statuses_array[$i]['id']] = 1;\n\t\t\t}\n\t\t}\n\t\t\n\n\t\t$permission_array = array ();\n\t\t\n\t\t\n\t\t// set pointer to last key\n\t\tend($customers_statuses_array);\t\t\n\t\tfor ($i = 0; $n = key($customers_statuses_array), $i < $n+1; $i ++) {\n\t\t\tif (isset($customers_statuses_array[$i]['id'])) {\n\t\t\t\t$permission_array = array_merge($permission_array, array ('group_permission_'.$customers_statuses_array[$i]['id'] => $permission[$customers_statuses_array[$i]['id']]));\n\t\t\t}\n\t\t}\n\n\n\t\t$sql_data_array = array ('sort_order' => $sort_order, 'categories_status' => $categories_status, 'products_sorting' => olc_db_prepare_input($categories_data['products_sorting']), 'products_sorting2' => olc_db_prepare_input($categories_data['products_sorting2']), 'categories_template' => olc_db_prepare_input($categories_data['categories_template']), 'listing_template' => olc_db_prepare_input($categories_data['listing_template']));\n\t\t$sql_data_array = array_merge($sql_data_array,$permission_array);\n\t\tif ($action == 'insert') {\n\t\t\t$insert_sql_data = array ('parent_id' => $dest_category_id, 'date_added' => 'now()');\n\t\t\t$sql_data_array = olc_array_merge($sql_data_array, $insert_sql_data);\n\t\t\tolc_db_perform(TABLE_CATEGORIES, $sql_data_array);\n\t\t\t$categories_id = olc_db_insert_id();\n\t\t}\n\t\telseif ($action == 'update') {\n\t\t\t$update_sql_data = array ('last_modified' => 'now()');\n\t\t\t$sql_data_array = olc_array_merge($sql_data_array, $update_sql_data);\n\t\t\tolc_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', 'categories_id = \\''.$categories_id.'\\'');\n\t\t}\n\t\tolc_set_groups($categories_id, $permission_array);\n\t\t$languages = olc_get_languages();\n\t\tforeach ($languages AS $lang) {\n\t\t\t$categories_name_array = $categories_data['name'];\n\t\t\t$sql_data_array = array ('categories_name' => olc_db_prepare_input($categories_data['categories_name'][$lang['id']]), 'categories_heading_title' => olc_db_prepare_input($categories_data['categories_heading_title'][$lang['id']]), 'categories_description' => olc_db_prepare_input($categories_data['categories_description'][$lang['id']]), 'categories_meta_title' => olc_db_prepare_input($categories_data['categories_meta_title'][$lang['id']]), 'categories_meta_description' => olc_db_prepare_input($categories_data['categories_meta_description'][$lang['id']]), 'categories_meta_keywords' => olc_db_prepare_input($categories_data['categories_meta_keywords'][$lang['id']]));\n\n\n\t\t\tif ($action == 'insert') {\n\t\t\t\t$insert_sql_data = array ('categories_id' => $categories_id, 'language_id' => $lang['id']);\n\t\t\t\t$sql_data_array = olc_array_merge($sql_data_array, $insert_sql_data);\n\t\t\t\tolc_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);\n\t\t\t}\n\t\t\telseif ($action == 'update') {\n\t\t\t\tolc_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', 'categories_id = \\''.$categories_id.'\\' and language_id = \\''.$lang['id'].'\\'');\n\t\t\t}\n\t\t}\n\n\t\tif ($categories_image = & olc_try_upload('categories_image', DIR_FS_CATALOG_IMAGES.'categories/')) {\n\t\t\t$cname_arr = explode('.', $categories_image->filename);\n\t\t\t$cnsuffix = array_pop($cname_arr);\n\t\t\t$categories_image_name = $categories_id.'.'.$cnsuffix;\n\t\t\t@ unlink(DIR_FS_CATALOG_IMAGES.'categories/'.$categories_image_name);\n\t\t\trename(DIR_FS_CATALOG_IMAGES.'categories/'.$categories_image->filename, DIR_FS_CATALOG_IMAGES.'categories/'.$categories_image_name);\n\t\t\tolc_db_query(\"SQL_UPDATE \".TABLE_CATEGORIES.\"\n\t\t\t\t\t\t \t\t SET categories_image = '\".olc_db_input($categories_image_name).\"'\n\t\t\t\t\t\t \t\t WHERE categories_id = '\".(int) $categories_id.\"'\");\n\t\t}\n\n\t\tif ($categories_data['del_cat_pic'] == 'yes') {\n\t\t\t@ unlink(DIR_FS_CATALOG_IMAGES.'categories/'.$categories_data['categories_previous_image']);\n\t\t\tolc_db_query(\"SQL_UPDATE \".TABLE_CATEGORIES.\"\n\t\t\t\t\t\t \t\t SET categories_image = ''\n\t\t\t\t\t\t \t\t WHERE categories_id = '\".(int) $categories_id.\"'\");\n\t\t}\n\n\t}", "public function addCategory(){\n\n\t\tif (($categoryName = $this->input->get_post('categoryName')) && ($categoryTypeId = $this->input->get_post('categoryTypeId')) && \n ($description = $this->input->get_post('description')) && ($categoryImage = $this->input->get_post('categoryImage'))) {\n\t\t\t\n\t\t\t\n\t\t\t$data = array(\n\t\t\t\t'categoryName' => $categoryName,\n\t\t\t\t'categoryTypeId' => $categoryTypeId,\n\t\t\t\t'description' => $description,\n\t\t\t\t'categoryImage' => $categoryImage\n\t\t\t);\n \n $ret = $this->Lootel_model->addCategory($data);\n\t\t\t\n\t\t\tif($ret){\n\t\t\t\t$response = array(\"status\"=>true,\"message\"=>\"Success\",\"userid\"=>$ret);\n\t\t\t}else{\n\t\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Record not saved\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Required parameter not found\");\n\t\t}\n\t\techo json_encode($response);\n\t}", "public function add()\n {\n $category = $this->Category->newEntity();\n if ($this->request->is('post')) {\n $category = $this->Category->patchEntity($category, $this->request->getData());\n if ($this->Category->save($category)) {\n $this->Flash->success(__('The category has been saved.'));\n\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error(__('The category could not be saved. Please, try again.'));\n }\n $this->set(compact('category'));\n }", "function create(){\n\t\t$sql = \"insert into tbl_post (category_id,title,rank,slug,status,bodytext,image,created_by,modified_by,created_date,modified_date) \n\n\t\tvalues('$this->category_id','$this->title','$this->rank','$this->slug','$this->status','$this->bodytext','$this->image','$this->created_by','$this->modified_by','$this->created_date','$this->modified_date')\";\n\t\t\n\t\t$st = $this->insert($sql);\n\t\t\n\t\tif (is_integer($st)) {\n\t\t\tforeach($this->tags as $tag){\n\t\t\t\t$sql = \"insert into tbl_tag_post(post_id,tag_id) values('$st','$tag')\";\n\t\t\t\t$this->insert($sql);\n\t\t\t}\n\t\t\treturn \"Post Inserted with id $st\";\n\t\t}else{\n\t\t\techo \"Failed to insert Post\";\n\t\t}\n\t}", "public function addPost(){\n\n if ($this->input->post(\"category_create\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n $categoryName = $this->input->post(\"category_name\");\n\n $this->validate->setRule(\"minlength\",$categoryName,3, \"Category name length must be more then 3 symbols!\");\n\n if ($this->validate->validate() === false){\n $error = $this->validate->getErrors();\n $this->view->redirect(\"/categories/manage\",$error);\n }\n\n $categoryModel = new CategoriesModel();\n try{\n if ($categoryModel->hasCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"This categories already exist!\");\n }\n\n if($categoryModel->addNewCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"Category created successfully!\",\"success\");\n }\n }catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception);\n }\n }", "function addCategory($data){\n\t\t\t\n\t\t\t$token = '847895ee848fdb5fb2d43b275705470c';\n\t\t\t$domainname = 'https://elearning.inaba.ac.id';\n\t\t\t$functionname = 'core_course_create_categories';\n\t\t\t$restformat = 'json';\n\t\t\t\t$category = new stdClass();\n\t\t\t\t$category->name=$data['nama'];\t\n\t\t\t\t$category->parent=$data['parent'];\t\t\t\t\t\n\t\t\t\t$category->description='<p>'.$data['nama'].'</p>';\n\t\t\t\t$category->idnumber=$data['idnumber'];\t\t\t\t\t\n\t\t\t\t$category->descriptionformat=1;\t\t\t\t\t\t\t\t\t\n\t\t\t\t$categories = array($category);\n\t\t\t\t$params = array('categories' => $categories);\n\t\t\t\t/// REST CALL\n\t\t\t\t//header('Content-Type: text/plain');\n\t\t\t\t$serverurl = $domainname . '/webservice/rest/server.php'. '?wstoken=' . $token . '&wsfunction='.$functionname;\n\t\t\t\trequire_once($conf['model_dir'].'m_curl.php');\n\t\t\t\t$curl = new curl;\n\t\t\t\t//if rest format == 'xml', then we do not add the param for backward compatibility with Moodle < 2.2\n\t\t\t\t$restformat = ($restformat == 'json')?'&moodlewsrestformat=' . $restformat:'';\n\t\t\t\t$resp = $curl->post($serverurl . $restformat, $params);\n\t\t\t\t$data = json_decode($resp, true);\n\t\t\t\t\n\t\t\t\t\n\n\t\t\n\n\t\t}", "function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }", "function process_categories() {\n\t\t$this->categories = apply_filters( 'wp_import_categories', $this->categories );\n\n\t\tif ( empty( $this->categories ) )\n\t\t\treturn;\n\n\t\tforeach ( $this->categories as $cat ) {\n\t\t\t// if the category already exists leave it alone\n\t\t\t$term_id = term_exists( $cat['category_nicename'], 'category' );\n\t\t\tif ( $term_id ) {\n\t\t\t\tif ( is_array($term_id) ) $term_id = $term_id['term_id'];\n\t\t\t\tif ( isset($cat['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($cat['term_id'])] = (int) $term_id;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$category_parent = empty( $cat['category_parent'] ) ? 0 : category_exists( $cat['category_parent'] );\n\t\t\t$category_description = isset( $cat['category_description'] ) ? $cat['category_description'] : '';\n\t\t\t$catarr = array(\n\t\t\t\t'category_nicename' => $cat['category_nicename'],\n\t\t\t\t'category_parent' => $category_parent,\n\t\t\t\t'cat_name' => $cat['cat_name'],\n\t\t\t\t'category_description' => $category_description\n\t\t\t);\n\n\t\t\t$id = wp_insert_category( $catarr );\n\t\t\tif ( ! is_wp_error( $id ) ) {\n\t\t\t\tif ( isset($cat['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($cat['term_id'])] = $id;\n\t\t\t} else {\n\t\t\t\tprintf( 'Failed to import category %s', esc_html($cat['category_nicename']) );\n\t\t\t\tif ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )\n\t\t\t\t\techo ': ' . $id->get_error_message();\n\t\t\t\techo '<br />';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tunset( $this->categories );\n\t}", "function EnregistrerNouvelleCategorie($nom) {\n global $mysql;\n $nom = $mysql->quote($nom);\n $requete = \"INSERT INTO \" . DB_PREFIX . \"CATEGORIES (NOM) values($nom)\";\n requete ( $requete );\n}", "public function insert_post_category($postID, $category_name){\n\n\t\t$meta_key = 'post_category';\n\n\t\t$query = $this->db->prepare(\"INSERT INTO `nw_postmeta` (post_id,meta_key,meta_value) VALUES (?,?,?)\");\n\t\t$query-> bindValue(1, $postID);\n\t\t$query-> bindValue(2, $meta_key);\n\t\t$query-> bindValue(3, $category_name);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$check = $this->check_category_taxonomy($category_name);\n\t\t\tif($check === true){\n\t\t\t\t$this->insert_taxonomy_category($postID, $category_name);\n\t\t\t}else if($check === false){\n\t\t\t\t\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}catch(PDOException $e){\n\t\t\tdie($e ->getMessage());\n\t\t}\n\t}", "public function category()\n { \n if($this->access_role->is_Admin() == false) show_404();\n $this->load->model('Category_Model');\n \n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n if($this->form_validation->run('category_insert') ){\n $this->Category_Model->add_category(); \n } else {\n $error = ['class'=>'warning','text'=> validation_errors()];\n $this->session->set_flashdata('sms_flash', $error); \n redirect('Dashboard/category');\n }\n } \n else{\n $data = $this->Category_Model->view_category();\n }\n \n $this->load->view('admin/category_content',$data);\n }", "protected function AddCategory($subcat,$parent) {\n if($subcat == \"\" || $subcat == \"0\") {\n return $parent;\n } else {\n if((int)$subcat > 0) {\n return $subcat;\n } else {\n $subcat = substr($subcat,2);\n }\n }\n\n $category = new Categories();\n $category->name = $subcat;\n $category->parent = $parent;\n $category->status = 1;\n //$category->created = date('Y-m-d H:i:s');\n $this->getEntityManager()->persist($category);\n $this->getEntityManager()->flush();\n return $category->id;\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 insertEntry(&$request, $newRowId) {\n\n\t\t$application =& PKPApplication::getApplication();\n\t\t$request =& $application->getRequest();\n\n\t\t$categoryId = $newRowId['name'];\n\t\t$categoryDao =& DAORegistry::getDAO('CategoryDAO');\n\t\t$monographDao =& DAORegistry::getDAO('MonographDAO');\n\t\t$press =& $request->getPress();\n\t\t$monograph =& $this->getMonograph();\n\n\t\t$category =& $categoryDao->getById($categoryId, $press->getId());\n\t\tif (!$category) return true;\n\n\t\t// Associate the category with the monograph\n\t\t$monographDao->addCategory(\n\t\t\t$monograph->getId(),\n\t\t\t$categoryId\n\t\t);\n\t}", "public function create()\n {\n if ($this->request->getPost()) {\n $data = [\n 'name' => $this->request->getPost('category_name'),\n 'parent_id' => ($this->request->getPost('parent_category')) ? $this->request->getPost('parent_category') : NULL\n ];\n }\n\n $res = $this->model->insert($data);\n if ($res) {\n session()->setFlashdata('message', 'Category has been created successfully.');\n } else {\n session()->setFlashdata('message', 'Category cannot be created. Please try again Later.');\n }\n\n return $this->response->redirect('/category');\n }", "public function CreateCategoryPost(request $request )\n {\n Category::insert([\n 'category' => $request['namecategory'],\n 'parent_id' => $request['parentcategory'],\n ]);\n return redirect()->action('AdminController@showcategory');\n }", "public function create_category ( $cat_info, $username )\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t{\r\n\t\t\t$this->errno = DB_OK;\r\n\t\t\t\r\n\t\t\tif ( $this->cat_id != -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tThe not exist category is obvious that has no id yet\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$user = new user( $username , LOGGED_IN );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tcreating an object of the user who wants to create a category\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//\tit is mandatory to be logged in\r\n\t\t\t$attr_length = 0; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tinitialize with 0 in case the attribute array hasn't been set\r\n\r\n\t\t\tif ( !isset ( $cat_info ) )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tif the cat_info structure is null\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_INPUT;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthen the input is wrong\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\r\n\t\t\tif ( isset ( $cat_info->attr_info_array ) )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$attr_length = count ( $cat_info->attr_info_array );\r\n\t\t\t\r\n\t\t\tif ( $attr_length == 0 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthe existance of at least one attribute is mandatory\r\n\t\t\t{\r\n\t\t\t\t$this->errno = NOT_ENOUGH_ATTRIBUTES;\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\r\n\t\t\tif ( !( $result = $this->con->query( \"SELECT cat_id FROM category WHERE cat_name=\\\"$cat_info->cat_name\\\"\" ) ) )\t//\tfiguring out if category with such name exists\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\r\n\t\t\tif ( $result->num_rows != 0 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tif category exists error code should be returned\r\n\t\t\t{\r\n\t\t\t\t$result->close();\r\n\t\t\t\t$this->errno = CATEGORY_EXISTS;\r\n\t\t\t\treturn ;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t/* gathering all keywords into one variable with # as delimiter to insert it to the database */\r\n\r\n\t\t\t$kw_length = 0; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tinitialize with 0 in case the keywords array hasn't been set\r\n\t\r\n\t\t\tif ( ! is_null ( $cat_info->cat_keywords ) )\r\n\t\t\t\t$kw_length = count( $cat_info->cat_keywords );\r\n\r\n\t\t\tif ( $kw_length == 0 )\r\n\t\t\t\t$kw = NULL;\r\n\t\t\telse\r\n\t\t\t\t$kw = \"#\".$cat_info->cat_keywords[0];\r\n\t\t\t\r\n\t\t\tfor ( $i = 1; $i < $kw_length; $i++ )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tgenerating the keyword string which will enter to the database\r\n\t\t\t\t$kw = $kw.\"#\".$cat_info->cat_keywords[$i];\r\n\t\t\t\r\n\t\t\tif ( ! ( $result = $this->con->query( \"SELECT user_id FROM user WHERE username=\\\"\".$username.\"\\\"\" ) ) )\t\t\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to query\t\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( $result->num_rows == 1 )\r\n\t\t\t{\r\n\t\t\t\t$row = $result->fetch_row();\r\n\t\t\t\t$user_id = $row[0];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tgetting user id to inform other tables once the category has \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//\tbeen created\t\t\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t$result->close();\r\n\t\t\t\t$this->errno = USERNAME_DONT_EXIST;\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\r\n\t\t\t$query = \"INSERT INTO category ( cat_name, is_open\" ;\t\t\t\t\t\t\t\t\t\t\t\t//\trows cat_name and is open should always have value\r\n\t\t\t\r\n\t\t\t/* on the other hand the following variables may have null value as its existance is optional in the database */\r\n\t\t\tif ( !is_null( $kw ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", cat_keywords\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( !is_null( $cat_info->cat_description ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", cat_description\";\r\n\t\t\t}\r\n\t\r\n\t\t\tif ( !is_null( $cat_info->cat_image ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", cat_image\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( !is_null( $cat_info->cat_video ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", cat_video\";\r\n\t\t\t}\t\r\n\t\r\n\t\t\t$query = $query.\" ) VALUES ( \\\"$cat_info->cat_name\\\", $cat_info->is_open\";\r\n\t\r\n\t\t\tif ( !is_null( $kw ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", \\\"$kw\\\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( !is_null( $cat_info->cat_description ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", \\\"$cat_info->cat_description\\\"\";\r\n\t\t\t}\r\n\r\n\t\t\tif ( !is_null( $cat_info->cat_image ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", \\\"$cat_info->cat_image\\\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( !is_null( $cat_info->cat_video ) )\r\n\t\t\t{\r\n\t\t\t\t$query = $query.\", \\\"$cat_info->cat_video\\\"\";\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t$query = $query.\" )\";\r\n\r\n\t\t\t$this->con->query(\"START TRANSACTION;\");\r\n\t\t\t\r\n\t\t\t/* inserting to the database */\r\n\t\t\tif ( !$this->con->query( $query ) )\r\n\t\t\t{\r\n\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tfailed to query\t\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\r\n\t\t\tif( $this->con->affected_rows != 1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthis query should affect 1 row\r\n\t\t\t{\t\t\t\t\t\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t/* fill the class variable with the apropriate value */\t\t\r\n\t\t\t$this->cat_id = $this->con->insert_id;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tstoring the id in the class\r\n\t\t\r\n\t\t\tif ( !$this->con->query( \"INSERT INTO user_has_rights VALUES ( $this->cat_id, $user_id,\".MODERATOR.\" )\" ) )\r\n\t\t\t{\t\t\t\t\t\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tfailed to query\t\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\r\n\r\n\t\t\tif( $this->con->affected_rows != 1 )\r\n\t\t\t{\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthis query should affect 1 row\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\r\n\t\t\t$this->insert_attributes ( $cat_info->attr_info_array );\r\n\t\r\n\t\t\tif ( $this->errno != DB_OK )\r\n\t\t\t{\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\r\n\t\t\t$this->con->query(\"COMMIT;\");\r\n\t\t\t\r\n\t\t\t/* initialize class's variables */\r\n\t\t\t$this->cat_name = $cat_info->cat_name;\r\n\t\t\t$this->is_open = $cat_info->is_open;\r\n\t\t\t$this->cat_description = $cat_info->cat_description;\r\n\r\n\t\t\tif ( $kw_length == 0 )\r\n\t\t\t\t$this->cat_keywords = NULL;\r\n\t\t\telse\r\n\t\t\t\t$this->cat_keywords = $cat_info->cat_keywords;\r\n\t\t\t\t\r\n\t\t\t$this->image = $cat_info->cat_image;\r\n\t\t\t$this->video = $cat_info->cat_video;\r\n\t\t\t\r\n\t\t\t$this->rate = 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tDummy initial value as the aggreed default rate is 0\r\n\t\t}", "function addPostCategory(){\n\t\t$this->check_permission();\n\t \t\n\t\t\n\t \t$this->load->library('form_validation');\n\t\t$this->form_validation->set_rules('category_parent_id','Category','is_unique[tbl_category.category_title]|required');\n\t\t$this->form_validation->set_rules('category_title','Category Title','is_unique[tbl_category.category_title]|required');\n\t\t\n\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t'display_in_menu' => $this->input->post('display_in_menu'),\n\t\t\t\t'category_parent_id' => $this->input->post('category_parent_id'),\n\t\t\t\t'category_title' => $this->input->post('category_title'),\n\t\t\t\t'status' => $this->input->post('status'),\n\t\t\t\t'createdby' => $this->session->userdata('id'),\n\t\t\t\t'createdon' => date_timestamp_get(date_create()),\n );\n \n $category_id = $this->Post_model->insert_data('tbl_post_category',$params);\n if($category_id){\n\t\t\t$this->session->set_flashdata('msg', '<div class=\"alert alert-success\">record Added!</div>');\n\t\t\tredirect('secure/post/addpostcategory');\n\t\t\t}\n }\n else\n {\t\t\t$data['all_categorylist'] = $this->Post_model->get_post_categorylist();\n \n \n\t\t\t$this->render_template('secure/post/addPostCategory',$data);\n }\n\t}", "public function insert_kategori()\n\t{\n\t\t$data['kategori'] = $_POST['kategori'];\n\t\t$data['tipe'] = '2';\n\t\t$outp = $this->db->insert('kategori', $data);\n\n\t\tstatus_sukses($outp); //Tampilkan Pesan\n\t}", "public function add_new_category_post(){\n $data = $this->security->xss_clean($_POST);\n $data = $this->DeviceCategory_model->add_new_category($data);\n if (isset($data['status']) == 'FALSE')\n {\n $this->response($data, REST_Controller::HTTP_SEE_OTHER);\n }\n $this->set_response($data, REST_Controller::HTTP_CREATED);\n }", "public function insert_category()\n\t{\n \n $this->form_validation->set_rules('category_slug','category_slug', 'required|is_unique[categories.category_slug]');\n if ($this->form_validation->run() == FALSE)\n { \n $this->session->set_flashdata('error', 'category Slug already exists on database !');\n redirect('superpanel/categorie/add_category');\n }\n else\n { \n\t\t$data=$this->input->post();\n\t\t$data1= array();\n\n\t\t//For Slug \n\t\t$slug =strtolower($data['category_slug']);\n $slug =preg_replace('/[^a-zA-Z0-9-_\\.]/','-',$slug);\n //End Slug\n\n\t\t$config = array(\n 'upload_path' => \"uploads/category/\",\n 'upload_url' => base_url() . \"uploads/category/\",\n 'allowed_types' => \"gif|jpg|png|jpeg\"\n );\n\n $this->load->library('upload', $config);\n\n if ($this->upload->do_upload(\"category_img\")) {\n $data['category_img'] = $this->upload->data();\n\n $data1['category_parent_Id'] = $data['category_parent_Id'];\n $data1['category_name'] = ucwords(strtolower($data['category_name']));\n $data1['category_slug'] = $data['category_slug'];\n $data1['category_img'] = base_url().'uploads/category/'.$data['category_img']['file_name'];\n $data1['category_description']= $data['category_description'];\n $data1['meta_keyword'] = $data['meta_keyword'];\n $data1['meta_description'] = $data['meta_description'];\n $data1['status'] = $data['status'];\n\n $this->session->set_flashdata('success','Product Category added successfully');\n $result=$this->General_model->show_data_id('categories','','','insert', $data1);\n redirect('superpanel/categorie');\n }else{\n $data1['category_parent_Id'] = $data['category_parent_Id'];\n $data ['category_img'] = $this->upload->data();\n $data1['category_name'] = ucwords(strtolower($data['category_name']));\n $data1['category_slug'] = $data['category_slug'];\n $data1['category_img'] = base_url().'uploads/category/'.$data['category_img']['file_name'];\n $data1['category_description']= $data['category_description'];\n $data1['meta_keyword'] = $data['meta_keyword'];\n $data1['meta_description'] = $data['meta_description'];\n $data1['status'] = $data['status'];\n\n $this->session->set_flashdata('success','Product Category added successfully');\n $result=$this->General_model->show_data_id('categories','','','insert', $data1);\n redirect('superpanel/categorie');\n }\n }\t\n \n\t}", "function create_cat($data=null){\n $this->load->model('pagesortingmodel');\n $this->pagesortingmodel->create_category($data);\n $this->load->view('admin/create_categories');\n }", "public function run()\n {\n Category::insert([\n \t['name'=>'Sci-fi','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Suspense','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Religious','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Romance','created_at'=>NULL,'updated_at'=>NULL]]);\n }", "public function categories_add($param = null)\r\n {\r\n if (isset($_POST[\"cat_descr\"]) && !empty($_POST[\"cat_descr\"])) {\r\n $action = $_POST[\"cat_descr\"];\r\n $datas = Category::updateOrCreate([\r\n 'cat_descr' => $action,\r\n ]);\r\n // Return last insert row:\r\n echo $datas;\r\n } else {\r\n echo json_encode([\"message\" => \"ERROR!\"]);\r\n }\r\n }", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\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}", "public function add_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors_form', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n if ($this->gallery_category_model->add_category()) {\n $this->session->set_flashdata('success_form', trans(\"category\") . \" \" . trans(\"msg_suc_added\"));\n redirect($this->agent->referrer());\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error_form', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }", "public function add_acct_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\nif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Accounts Category Created Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\ntheme('add_acct_category');\n\t}", "private function packCategory()\n {\n /** @var modCategory $category */\n $category = $this->modx->newObject('modCategory');\n $category->set('category', self::PKG_NAME);\n\n $this->packCategoryElements($category, 'plugins');\n\n $this->builder->putVehicle($this->builder->createVehicle($category, [\n xPDOTransport::UNIQUE_KEY => 'category',\n xPDOTransport::PRESERVE_KEYS => false,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::RELATED_OBJECTS => true,\n xPDOTransport::RELATED_OBJECT_ATTRIBUTES => [\n 'Plugins' => [\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => 'name'\n ],\n 'PluginEvents' => [\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => ['pluginid','event'],\n ]\n ]\n ]));\n }", "public function add_post()\n {\n $input = $this->input->post();\n $user=$this->session->userdata('uid');\n $data=$this->Category_model->insertData($input,$user);\n if($data==1)\n $this->response('Category information added.', REST_Controller::HTTP_CREATED);\n else\n $this->response('Category already present!', REST_Controller::HTTP_OK);\n }" ]
[ "0.75985473", "0.75416887", "0.74991786", "0.73013544", "0.7283045", "0.7258791", "0.7223839", "0.7135809", "0.7133006", "0.7132927", "0.709556", "0.7062583", "0.702961", "0.70258474", "0.7023463", "0.70222706", "0.70134056", "0.6987936", "0.6984606", "0.6984254", "0.696624", "0.6919907", "0.6895807", "0.68883073", "0.6870064", "0.6861735", "0.6819103", "0.67913926", "0.6762603", "0.67599064", "0.67545646", "0.6724894", "0.67066336", "0.6705972", "0.66829044", "0.6681593", "0.6669055", "0.665238", "0.6649874", "0.66460866", "0.66442454", "0.6635542", "0.6628218", "0.66191584", "0.6607518", "0.6599259", "0.6594615", "0.6581248", "0.65771055", "0.6561054", "0.65518165", "0.6549599", "0.65350026", "0.6522738", "0.65220743", "0.65181416", "0.6513557", "0.65112215", "0.65081775", "0.6496426", "0.64782596", "0.64778066", "0.64766335", "0.64723766", "0.6470547", "0.6463751", "0.6454062", "0.64504147", "0.64464015", "0.6445852", "0.64456517", "0.6444234", "0.6434957", "0.6429094", "0.64221704", "0.64215857", "0.64162445", "0.640204", "0.63990104", "0.63978916", "0.63898337", "0.6388316", "0.6381508", "0.637985", "0.63796586", "0.6376525", "0.6374243", "0.6364936", "0.6364125", "0.63626236", "0.6354296", "0.6343999", "0.632579", "0.6321573", "0.6320876", "0.630829", "0.63049823", "0.63047165", "0.63041353", "0.62958103", "0.6292868" ]
0.0
-1
function to download excel template
public function download_category_excel_sheet() { $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); $sheet->setCellValue('A1', 'ar_name'); $sheet->setCellValue('B1', 'en_name'); $sheet->setCellValue('C1', 'discount'); $writer = new Xlsx($spreadsheet); $filename = 'add_category_template'; header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="' . $filename . '.xlsx"'); $writer->save('php://output'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function downloadEmolumentTemplate(){\n\n $financialYear = FinancialYear::where('status', '=', true)->first();\n $items = RefEmolument::all();\n $headers = array(\n \"Content-type\"=>\"application/ms-excel\",\n \"Content-Disposition\"=>\"attachment;Filename= Personal_Emolument_Template.xls\"\n );\n\n $content = View::make('personal_emoluments/htmlViews/emolument_template', array('items' => $items, 'financialYear' => $financialYear->year));\n return Response::make($content, 200, $headers);\n }", "public function exportExcelAction()\n {\n $fileName = 'traineedoc.xls';\n $content = $this->getLayout()->createBlock('bs_traineedoc/adminhtml_traineedoc_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportExcelAction()\n {\n $fileName = 'curriculumdoc.xls';\n $content = $this->getLayout()->createBlock('bs_curriculumdoc/adminhtml_curriculumdoc_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportExcelAction()\n {\n $fileName = 'coursedoc.xls';\n $content = $this->getLayout()->createBlock('bs_coursedoc/adminhtml_coursedoc_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportExcelAction()\n {\n $fileName = 'ifeedback.xls';\n $content = $this->getLayout()->createBlock('bs_kst/adminhtml_ifeedback_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function downloadTemplate($model)\n {\n\n $file_name = 'Mark_Upload.xls';\n $tmp = Yii::getAlias('@backend') . '/web/' . Yii::getAlias('@file_template') . '/';\n $file = $tmp . $file_name;\n\n if (file_exists($file)) {\n\n try {\n\n $inputFileType = \\PHPExcel_IOFactory::identify($tmp . $file_name);\n $objReader = \\PHPExcel_IOFactory::createReader($inputFileType);\n $objPHPExcel = $objReader->load($tmp . $file_name);\n $sheet = clone $objPHPExcel->getSheet(0);\n $objPHPExcel->removeSheetByIndex(0);\n\n // validate choose subject\n if (!is_array($model->subject_id)) {\n Yii::$app->getSession()->setFlash('error', 'Bạn chưa chọn môn học để tải file mẫu');\n return;\n }\n\n // validate class\n $class = Contact::findOne($model->class_id);\n if (is_null($class)) {\n Yii::$app->getSession()->setFlash('error', 'Lớp chưa tạo trên hệ thống');\n return;\n }\n\n // find\n $subjects = Subject::find()->where(['id' => $model->subject_id])->all();\n $students = ContactDetail::find()->where(['contact_id' => $model->class_id])->all();\n\n foreach ($subjects as $subject) {\n\n $sheet_ = clone $sheet;\n\n // set school\n $school = Contact::findOne($class->path);\n $title_ = $sheet_->getCell('A2')->getValue();\n $sheet_->setCellValue('A2', str_replace(\"[school]\", $school->contact_name, $title_));\n\n // set subject\n $year = date(\"Y\") . '-' . (intval(date(\"Y\")) + 1);\n $title_ = $sheet_->getCell('A3')->getValue();\n $sheet_->setCellValue('A3', $title_ = str_replace(\"[subject]\", $subject->name, $title_));\n $sheet_->setCellValue('A3', $title_ = str_replace(\"[class]\", $class->contact_name, $title_));\n $sheet_->setCellValue('A3', $title_ = str_replace(\"[semester]\", $model->semester == 1 ? \"1\" : \"2\", $title_));\n $sheet_->setCellValue('A3', $title_ = str_replace(\"[year]\", $year, $title_));\n\n // set sheet name\n $title_ = $sheet->getTitle();\n $sheet_->setTitle($title_ = str_replace(\"subject\", $subject->name, $title_));\n $sheet_->setTitle($title_ = str_replace(\"class\", $class->contact_name, $title_));\n\n $row = 1;\n foreach ($students as $item) {\n $sheet_->setCellValue('A' . ($row + 10), $row);\n $sheet_->setCellValue('B' . ($row + 10), $subject->id);\n $sheet_->setCellValue('C' . ($row + 10), $item->id);\n $sheet_->setCellValue('D' . ($row + 10), $item->fullname);\n $row++;\n }\n $objPHPExcel->addSheet($sheet_);\n }\n\n // set file name upload\n $file_name_upload = \"Điểm_\";\n if (is_array($model->subject_id) && count($model->subject_id) == 1) {\n $file_name_upload = $file_name_upload . $subject->name . \"_\";\n }\n $file_name_upload = $file_name_upload . $class->contact_name . \"_\";\n $file_name_upload = $file_name_upload . ($model->semester == 1 ? \"HK1_\" : \"HK2_\");\n $file_name_upload = $file_name_upload . $year;\n $file_name_upload = $file_name_upload . \"_Upload.xls\";\n\n\n header(\"Content-Length: \" . filesize($file));\n header(\"Content-type: application/octet-stream\");\n header(\"Content-disposition: attachment; filename=\" . basename($file_name_upload));\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n ob_clean();\n flush();\n\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n $objWriter->save('php://output');\n\n } catch (Exception $ex) {\n }\n } else {\n Yii::$app->getSession()->setFlash('error', 'File is not exits');\n }\n }", "public function download()\n {\n\n $cus_list = array();\n $cus_list[] = ['Destination Code', 'Purpose', 'Pay Amount'];\n $cus_list[] = ['PP-ទៅមកផែភ្នំពេញ (Exp, MT​ & ទៅទទេរ)', 'EXPORT-TOLL', '1000'];\n $cus_list[] = ['PP-ទៅមកផែភ្នំពេញ (Exp, MT​ & ទៅទទេរ)', 'EXPORT-P PORT', '2000'];\n $cus_list[] = ['PP-ទៅមកផែភ្នំពេញ (Exp, MT​ & ទៅទទេរ)', 'MT to-P PORT', '3000'];\n\n return \\Excel::create('paytrip_example', function ($excel) use ($cus_list) {\n\n $excel->sheet('sheet name', function ($sheet) use ($cus_list) {\n\n $sheet->fromArray($cus_list, null, 'A1', false, false);\n $sheet->cells('A1:C1', function ($cells) {\n\n $cells->setAlignment('center');\n $cells->setFontWeight(\"bold\");\n $cells->setFontColor('#000000');\n $cells->setFontSize('12');\n });\n });\n })->download('xlsx');\n }", "public function exportExcelAction(){\r\n $fileName = 'siege.xls';\r\n $content = $this->getLayout()->createBlock('reseauchx_reservationreseau/adminhtml_siege_grid')->getExcelFile();\r\n $this->_prepareDownloadResponse($fileName, $content);\r\n }", "public function exportExcelAction()\n {\n $fileName = 'traineecert.xls';\n $content = $this->getLayout()->createBlock('bs_traineecert/adminhtml_traineecert_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportExcelAction()\n {\n $fileName = 'kstitem.xls';\n $content = $this->getLayout()->createBlock('bs_kst/adminhtml_kstitem_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "function excel_export($template = 0) {\n $data = $this->tour->get_tours()->result_object();\n $this->load->helper('report');\n $rows = array();\n $row = array(lang('tour_tour_id'), lang('tour_tour_name'), lang('tour_action_name_key'), lang('tour_sort'), lang('tour_deleted'));\n\n $n = 1;\n $rows[] = $row;\n foreach ($data as $r) {\n $row = array(\n $n ++,\n $r->tour_name,\n $r->action_name_key,\n $r->sort,\n $r->deleted,\n );\n $rows[] = $row;\n }\n\n $content = array_to_csv($rows);\n\n if ($template) {\n force_download('tours_export_mass_update.csv', $content);\n } else {\n force_download('tours_export.csv', $content);\n }\n exit;\n }", "public function download()\n {\n\n $cus_list = array();\n $cus_list[] = ['Customer Name'];\n $cus_list[] = ['Eastex'];\n $cus_list[] = ['Magnate'];\n\n // and append it to the payments array.\n return \\Excel::create('customer_example', function ($excel) use ($cus_list) {\n\n $excel->sheet('sheet name', function ($sheet) use ($cus_list) {\n\n $sheet->fromArray($cus_list, null, 'A1', false, false);\n $sheet->cells('A1', function ($cells) {\n\n $cells->setAlignment('center');\n $cells->setFontWeight(\"bold\");\n $cells->setFontColor('#000000');\n $cells->setFontSize('12');\n });\n });\n })->download('xlsx');\n }", "public function exportExcelAction()\n {\n $fileName = 'schedule.xls';\n $content = $this->getLayout()->createBlock('bs_schedule/adminhtml_schedule_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportExcelAction()\n {\n $fileName = 'equipment.xls';\n $content = $this->getLayout()->createBlock('bs_logistics/adminhtml_equipment_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function exportExcelAction()\n {\n $fileName = 'aircraft.xls';\n $content = $this->getLayout()->createBlock('bs_misc/adminhtml_aircraft_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "function download($type, $post = array()) {\n set_time_limit( 1800 );\n ini_set('memory_limit', '512M');\n\n // create a new workbook\n $workbook = new \\PhpOffice\\PhpSpreadsheet\\Spreadsheet();\n\n // set default font name and size\n $workbook->getDefaultStyle()->getFont()->setName('Arial');\n $workbook->getDefaultStyle()->getFont()->setSize(10);\n $workbook->getDefaultStyle()->getAlignment()->setIndent(1);\n\n if (isset($this->request->post['exportway'])) {\n if ($this->request->post['exportway'] == 'pid') {\n $this->min_product_id = $this->request->post['min'];\n $this->max_product_id = $this->request->post['max'];\n $this->exportway = $this->request->post['exportway'];\n } else if ($this->request->post['exportway'] == 'page') {\n $this->count_prepage = $this->request->post['min'];\n $this->page = $this->request->post['max'];\n $this->exportway = $this->request->post['exportway'];\n } else {\n echo \"exportway error!\";\n }\n }\n\n // creating the worksheet\n $i = 0;\n foreach ($this->template[$type] as $key => $value) {\n if ($i > 0) {\n $workbook->createSheet();\n }\n $workbook->setActiveSheetIndex($i++);\n $worksheet = $workbook->getActiveSheet();\n $worksheet->setTitle($key);\n $func = $this->convertUnderline('get_' . $key);\n $this->populateWorksheet($worksheet, $this->{$func}(), $value);\n $worksheet->freezePaneByColumnAndRow( 1, 2 );\n }\n\n $workbook->setActiveSheetIndex(0);\n\n $datetime = date('Y-m-d');\n //header('Content-Type: application/vnd.ms-excel');\n //header('Content-Disposition: attachment;filename=\"GDExportImport_products_'.$datetime.'.xls\"');\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=\"GDExportImport_'.$type.'_'.$datetime.'.xlsx\"');\n header('Cache-Control: max-age=0');\n\n // If you're serving to IE over SSL, then the following may be needed\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\n header('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n header('Pragma: public'); // HTTP/1.0\n\n //$writer = PhpOffice\\PhpSpreadsheet\\IOFactory::createWriter($workbook, 'Xls');\n $writer = \\PhpOffice\\PhpSpreadsheet\\IOFactory::createWriter($workbook, 'Xlsx');\n if(ob_get_length()){\n ob_clean();\n }\n\n $writer->save('php://output');\n }", "public function exportExcelAction()\n {\n $fileName = 'handovertwo.xls';\n $content = $this->getLayout()->createBlock('bs_handover/adminhtml_handovertwo_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function ctrDownloadReport() {\n\n if (isset($_GET['report'])) {\n\n $table = 'sales';\n\n if(isset($_GET['startDate']) && isset($_GET['endDate'])) {\n\n $sales = SalesModel::mdlDateRangeSales($table, $_GET['startDate'], $_GET['endDate']);\n\n } else {\n\n $item = null;\n $value = null;\n $sales = SalesModel::mdlShowSales($table, $item, $value);\n\n }\n\n /**\n * :: create the excel file\n */\n\n $name = $_GET['report'].'.xls';\n\n header('Expires: 0');\n header('Cache-control: private');\n header(\"Content-type: application/vnd.ms-excel\"); // Excel file\n header(\"Cache-Control: cache, must-revalidate\"); \n header('Content-Description: File Transfer');\n header('Last-Modified: '.date('D, d M Y H:i:s'));\n header(\"Pragma: public\"); \n header('Content-Disposition:; filename=\"'.$name.'\"');\n header(\"Content-Transfer-Encoding: binary\");\n\n echo utf8_decode(\"<table border='0'> \n \n <tr>\n <td style='font-weight:bold; border:1px solid #eee;'>Code</td> \n <td style='font-weight:bold; border:1px solid #eee;'>Client</td>\n <td style='font-weight:bold; border:1px solid #eee;'>Seller</td>\n <td style='font-weight:bold; border:1px solid #eee;'>Quantity</td>\n <td style='font-weight:bold; border:1px solid #eee;'>Products</td>\n <td style='font-weight:bold; border:1px solid #eee;'>Tax</td>\n <td style='font-weight:bold; border:1px solid #eee;'>Net Price</td>\t\t\n <td style='font-weight:bold; border:1px solid #eee;'>Total Price</td>\t\t\n <td style='font-weight:bold; border:1px solid #eee;'>Payment Method</td>\n <td style='font-weight:bold; border:1px solid #eee;'>Date</td>\t\n </tr>\");\n\n foreach ($sales as $row => $item) {\n $client = ClientController::ctrShowClients('id', $item['client_id']);\n $seller = UserController::ctrShowUsers('id', $item['seller_id']);\n\n echo utf8_decode(\"<tr>\n <td style='border: 1px solid #eee'>\".$item['code'].\"</td>\n <td style='border: 1px solid #eee'>\".$client['name'].\"</td>\n <td style='border: 1px solid #eee'>\".$seller['name'].\"</td>\n\n <td style='border: 1px solid #eee'>\");\n\n $products = json_decode($item['products'], true);\n foreach ($products as $key => $valueProducts) {\n echo utf8_decode($valueProducts['quantity'].\"<br>\");\n }\n\n echo utf8_decode(\"</td>\n\n <td style='border: 1px solid #eee'>\");\n\n $products = json_decode($item['products'], true);\n foreach ($products as $key => $valueProducts) {\n echo utf8_decode($valueProducts['description'].\"<br>\");\n }\n\n echo utf8_decode(\"</td>\n \n <td style='border: 1px solid #eee'>$ \".number_format($item['tax'], 2).\"</td>\n <td style='border: 1px solid #eee'>$ \".number_format($item['net_price'], 2).\"</td>\n <td style='border: 1px solid #eee'>$ \".number_format($item['total'], 2).\"</td>\n <td style='border: 1px solid #eee'>\".$item['payment_method'].\"</td>\n <td style='border: 1px solid #eee'>\".substr($item['date'], 0, 10).\"</td>\");\n\n \n echo \"</tr>\";\n \n }\n\n echo \"</table>\";\n\n }\n }", "public function exportExcelAction()\n {\n $fileName = 'appointments.xml';\n $grid = $this->getLayout()->createBlock('appointments/adminhtml_appointments_grid');\n $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }", "public function downloadXlsFile(Request $request) {\n //getting data\n $id = $request->id;\n $type = $request->type;\n $claim_no = $request->claim_no;\n $state = $request->state;\n $policy_no = $request->policy_no;\n $information = $request->information;\n\n if($type == 'xact') {\n $path = public_path('sample_file/test.xls');\n $labels = Label::where('user_id', $id)->get();\n if ($labels->isEmpty()) {\n $request->session()->flash('error', 'Record not found.');\n return redirect()->back();\n }\n $user = User::where('id', $id)->first();\n $user_name = $user->full_name; //setting file name\n $file_name = $user_name . '_ClaimedContent' . time();\n ///getting or loading template in which we want to put data\n $spreadsheet = \\PhpOffice\\PhpSpreadsheet\\IOFactory::load($path);\n $worksheet = $spreadsheet->getActiveSheet();\n $worksheet->setCellValue('E2', $user_name);\n $worksheet->setCellValue('H2', $claim_no);\n $worksheet->setCellValue('H3', $policy_no);\n $worksheet->setCellValue('K3', $state);\n $worksheet->setCellValue('D4', $information);\n\n $counter = 9;\n foreach ($labels as $label) {\n //specifying cells for putting data in them\n $worksheet->setCellValue('B' . $counter . '', $label->room_name);\n $worksheet->setCellValue('C' . $counter . '', $label->brand);\n $worksheet->setCellValue('D' . $counter . '', $label->model);\n $worksheet->setCellValue('E' . $counter . '', $label->item_name);\n $worksheet->setCellValue('F' . $counter . '', $label->quantity);\n $worksheet->setCellValue('G' . $counter . '', $label->age_in_years);\n $worksheet->setCellValue('H' . $counter . '', $label->age_in_months);\n $worksheet->setCellValue('J' . $counter . '', $label->cost_to_replace);\n $counter++;\n }\n $writer = \\PhpOffice\\PhpSpreadsheet\\IOFactory::createWriter($spreadsheet, 'Xls');\n //setting headers to save file in our downloads directory\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment; filename=\"' . $file_name . '.xls\"');\n header(\"Content-Transfer-Encoding: binary\");\n $writer->save(\"php://output\");\n ////end code for getting xls/csv template and append data from database in it/////\n return redirect()->back();\n } else if ($type == 'simsol') {\n \n// $result = Photo::with('getLabel.getRoom', 'getItems')->where('user_id', $id)->get();\n $result = Label::where('user_id', $id)->get();\n// dd($result);\n if($result->isEmpty()){\n $request->session()->flash('error', 'No Record Found.');\n return redirect()->back();\n }\n $unique_name = time();\n $headers = array(\n \"Content-type\" => \"text/csv\",\n \"Content-Disposition\" => \"attachment; filename=\" . $unique_name . \"_items.csv\",\n \"Pragma\" => \"no-cache\",\n \"Cache-Control\" => \"must-revalidate, post-check=0, pre-check=0\",\n \"Expires\" => \"0\"\n );\n $columns = array('Item#', 'Room', 'Brand Or Manufacturer ', 'Model#', 'Serial Number', 'Quantity Lost', 'Item Age (Years)', 'Item Age (Month)', 'Cost to Replace Pre-Tax (each)', 'Total Cost');\n\n $callback = function() use ($result, $columns) {\n $file = fopen('php://output', 'w');\n fputcsv($file, $columns);\n $count = 1;\n foreach ($result as $labels) {\n $columns_data = array();\n $columns_data[] = $count;\n $columns_data[] = $labels->room_name;\n $columns_data[] = $labels->brand;\n $columns_data[] = $labels->model;\n $columns_data[] = $labels->serial_no;\n $columns_data[] = $labels->quantity;\n $columns_data[] = $labels->age_in_years;\n $columns_data[] = $labels->age_in_months;\n $columns_data[] = $labels->cost_to_replace;\n $total = ($labels->quantity * $labels->cost_to_replace);\n $columns_data[] = round($total, 2);\n $count++;\n fputcsv($file, $columns_data);\n }\n fclose($file);\n };\n return Response::stream($callback, 200, $headers);\n }\n else if($type == 'photo'){\n $data['contents'] = Photo::with('getLabel')->with('getGroup.getGroupLabel')->where('user_id', $id)->where('is_labeled', 1)->get();\n// dd($data);\n $pdf = PDF::loadView('admin.pdf', $data);\n return $pdf->stream('document.pdf');\n $request->session()->flash('success', 'PDF created.');\n return redirect()->back();\n } else{\n $request->session()->flash('error', 'Please Select Download Type,In Which Format You Want to Download the File.');\n return redirect()->back();\n }\n }", "public function exportExcelAction()\n {\n $fileName = 'offer.xls';\n $content = $this->getLayout()->createBlock('mfb_myflyingbox/adminhtml_offer_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "private function downloadTemplate() {\n $merge = array('%VERSION%' => $this->params['version'], '%TYPE%' => $this->params['type']);\n $templateUrl = strtr($this->settings['paths']['templateUrl'], $merge);\n $result = @file_get_contents($templateUrl);\n if ($result != false) {\n return $result;\n } else {\n $this->badRequest(array('error' => 'Unable to download template'));\n }\n }", "function download(){\n\t/** Include PHPExcel */\n\trequire_once dirname(__FILE__) . '/Excel/PHPExcel.php';\n\t\n\t$objPHPExcel = new PHPExcel();\n\t\n\t// Set document properties\n\t$objPHPExcel->getProperties()->setCreator($_SESSION[\"userInfo\"][\"userName\"])\n\t\t\t\t\t\t\t\t->setLastModifiedBy($_SESSION[\"userInfo\"][\"userName\"])\n\t\t\t\t\t\t\t\t->setTitle(\"Smart Shop Inventory\")\n\t\t\t\t\t\t\t\t->setSubject(\"Smart Shop Inventory\")\n\t\t\t\t\t\t\t\t->setDescription(\"Inventory outputted from the Smart Shop database.\")\n\t\t\t\t\t\t\t\t->setKeywords(\"office PHPExcel php\")\n\t\t\t\t\t\t\t\t->setCategory(\"Inventory Data File\");\n\t\n\t//size the columns appropriately\n\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(5);\n\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(18);\n\t$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(10);\n\t$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(10);\n\t$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(20);\n\t\n\t//color the title row\n\t$objPHPExcel->getActiveSheet()\n\t\t->getStyle('A1:E1')\n\t\t->getFill()\n\t\t->setFillType(PHPExcel_Style_Fill::FILL_SOLID)\n\t\t->getStartColor()\n\t\t->setARGB('FF808080');\n\t\n\t//output the titles for the columns\n\t$objPHPExcel->setActiveSheetIndex(0)\n\t\t\t\t->setCellValue('A1', 'ID')\n\t\t\t\t->setCellValue('B1', 'Name')\n\t\t\t\t->setCellValue('C1', 'Quantity')\n\t\t\t\t->setCellValue('D1', 'Value')\n\t\t\t\t->setCellValue('E1', 'Last Updated');\n\t\n\t$items = getItems();\n\t$i = 2;\n\tforeach($items as $item){\n\t\t//populate the row with values\n\t\t$objPHPExcel->setActiveSheetIndex(0)\n\t\t\t\t->setCellValue('A'.$i, $item[\"Id\"])\n\t\t\t\t->setCellValue('B'.$i, $item[\"Name\"])\n\t\t\t\t->setCellValue('C'.$i, $item[\"Quantity\"])\n\t\t\t\t->setCellValue('D'.$i, $item[\"Value\"])\n\t\t\t\t->setCellValue('E'.$i, $item[\"Updated\"]);\n\t\t\n\t\t//Set the value cell format to currency\n\t\t$objPHPExcel->getActiveSheet()\n\t\t->getStyle('D'.$i)\n\t\t->getNumberFormat()\n\t\t->setFormatCode(\n\t\t\tPHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE\n\t\t);\n\t\n\t\t$i++;\n\t}\n\t\n\t// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n\t$objPHPExcel->setActiveSheetIndex(0);\n\t\n\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t$output = \"downloads/\" . date(\"Y-m-d_H-i\") . \"_Inventory.xlsx\";\n\t$objWriter->save($output);\n\t\n\treturn [\"success\" => true, \"message\" => $output];\n}", "function perform_export()\n {\n global $CFG;\n require_once($CFG->dirroot.'/blocks/bcgt/lib.php');\n global $CFG, $USER;\n $name = preg_replace(\"/[^a-z 0-9]/i\", \"\", $this->get_name());\n \n ob_clean();\n header(\"Pragma: public\");\n header('Content-Type: application/vnd.ms-excel; charset=utf-8');\n header('Content-Disposition: attachment; filename=\"'.$name.'.xlsx\"'); \n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: private\", false);\n\n require_once $CFG->dirroot . '/blocks/bcgt/lib/PHPExcel/Classes/PHPExcel.php';\n \n $objPHPExcel = new \\PHPExcel();\n $objPHPExcel->getProperties()\n ->setCreator(fullname($USER))\n ->setLastModifiedBy(fullname($USER))\n ->setTitle($this->get_name())\n ->setSubject($this->get_name())\n ->setDescription($this->get_description());\n\n // Remove default sheet\n $objPHPExcel->removeSheetByIndex(0);\n \n $sheetIndex = 0;\n \n // Set current sheet\n $objPHPExcel->createSheet($sheetIndex);\n $objPHPExcel->setActiveSheetIndex($sheetIndex);\n $objPHPExcel->getActiveSheet()->setTitle(\"Report\");\n \n $rowNum = 1;\n\n // Headers\n if(isset($this->header))\n {\n if(!$this->has_split_header())\n {\n $col = 0;\n foreach($this->header AS $head)\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $head);\n $col++;\n }\n $rowNum++;\n }\n else\n {\n //foreach row\n foreach($this->header AS $row)\n {\n $col = 0;\n foreach($row AS $rowObj)\n {\n $columnCount = $rowObj->colCount;\n $columnContent = $rowObj->content;\n //add all the cells, \n //thenmerge\n $startCol = $col;\n for($i=0;$i<$columnCount;$i++)\n {\n if($i == 0)\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $columnContent);\n }\n else\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, '');\n }\n $col++;\n }\n $endCol = $col;\n if($columnCount != 1)\n {\n $objPHPExcel->getActiveSheet()->mergeCells(''.PHPExcel_Cell::stringFromColumnIndex($startCol).\n ''.$rowNum.':'.PHPExcel_Cell::stringFromColumnIndex($endCol - 1).''.$rowNum);\n }\n \n \n }\n $rowNum++;\n }\n } \n \n }\n //data\n if(isset($this->data))\n {\n foreach($this->data AS $data)\n {\n $col = 0;\n foreach($data AS $cell)\n { \n if(is_a($cell, 'stdClass'))\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $this->build_excell_cell($cell));\n $objPHPExcel->getActiveSheet()->getStyle(''.PHPExcel_Cell::stringFromColumnIndex($col).''.$rowNum)->applyFromArray(\n array(\n 'fill' => array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'color' => $this->get_excell_cell_color($cell)\n ),\n 'borders' => array(\n 'outline' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN,\n 'color' => array('rgb'=>'cfcfcf')\n )\n )\n )\n ); \n if(isset($cell->colspan) && $cell->colspan > 1)\n {\n $objPHPExcel->getActiveSheet()->mergeCells(''.PHPExcel_Cell::stringFromColumnIndex($col).\n ''.$rowNum.':'.PHPExcel_Cell::stringFromColumnIndex($col + ($cell->colspan - 1)).''.$rowNum);\n \n $col = $col + ($cell->colspan - 1);\n }\n }\n else\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $cell);\n }\n \n $col++;\n } \n $rowNum++;\n }\n }\n \n // Freeze rows and cols (everything to the left of D and above 2)\n $objPHPExcel->getActiveSheet()->freezePane($this->get_frozen_panes());\n \n // End\n $objPHPExcel->setActiveSheetIndex(0);\n $objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\n ob_clean();\n $objWriter->save('php://output');\n \n exit;\n }", "public function postXlsContext() {\n error_reporting(E_ERROR);\n $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');\n $view = $viewRenderer->view;\n if ($view instanceof Zend_View_Interface) {\n /**\n * @see Zend_Json\n */\n if (method_exists($view, 'getVars')) {\n $vars = $view->getVars();\n \n $script = $viewRenderer->getViewScript();\n require_once $view->getScriptPath($script);\n \n if (!$viewRenderer->getNoRender()) {\n header('Content-Description: File Transfer');\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment; filename=' . ($vars['filename'] ? ($vars['filepath'] ? $vars['filepath'] : '') . $vars['filename'] : 'documents.xlsx'));\n }\n \n //$objWriter->save('some_excel_file.xlsx');\n //$result = $_SERVER['DOCUMENT_ROOT'] . '/some_excel_file.xlsx';\n //header('Content-Description: File Transfer');\n //header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n //header('Content-Disposition: attachment; filename=some_excel_file.xlsx');\n \n //header('Content-Transfer-Encoding: binary');\n //header('Expires: 0');\n //header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n //header('Pragma: public');\n //header('Content-Length: ' . filesize($result));\n /*ob_clean();\n flush();\n readfile($result);*/\n exit;\n } else {\n require_once 'Zend/Controller/Action/Exception.php';\n throw new Zend_Controller_Action_Exception('View does not implement the getVars() method needed to encode the view into JSON');\n }\n }\n }", "public function download()\n {\n return \\Excel::download(new UsersExport, 'data_buku_yang_dipinjam.xlsx'); \n }", "function excel_export($template = 0) {\n $data = $this->ticket->get_all()->result_object();\n $this->load->helper('report');\n $rows = array();\n $row = array(lang('items_item_number'), lang('items_name'), lang('items_category'), lang('items_supplier_id'), lang('items_cost_price'), lang('items_unit_price'), lang('items_tax_1_name'), lang('items_tax_1_percent'), lang('items_tax_2_name'), lang('items_tax_2_percent'), lang('items_tax_2_cummulative'), lang('items_quantity'), lang('items_reorder_level'), lang('items_location'), lang('items_description'), lang('items_allow_alt_desciption'), lang('items_is_serialized'), lang('items_item_id'));\n\n $rows[] = $row;\n foreach ($data as $r) {\n $taxdata = $this->Item_taxes->get_info($r->ticket_id);\n if (sizeof($taxdata) >= 2) {\n $r->taxn = $taxdata[0]['ticket_id'];\n $r->taxp = $taxdata[0]['code_ticket'];\n $r->taxn1 = $taxdata[1]['destination_name'];\n $r->taxp1 = $taxdata[1]['ticket_type_name'];\n $r->cumulative = $taxdata[1]['cumulative'] ? 'y' : '';\n } else if (sizeof($taxdata) == 1) {\n $r->taxn = $taxdata[0]['name'];\n $r->taxp = $taxdata[0]['percent'];\n $r->taxn1 = '';\n $r->taxp1 = '';\n $r->cumulative = '';\n } else {\n $r->taxn = '';\n $r->taxp = '';\n $r->taxn1 = '';\n $r->taxp1 = '';\n $r->cumulative = '';\n }\n\n $row = array(\n $r->ticket_id,\n $r->code_ticket,\n $r->destination_name,\n $r->destination_name,\n $r->ticket_type_name,\n $r->unit_price,\n $r->taxn,\n $r->taxp,\n $r->taxn1,\n $r->taxp1,\n $r->cumulative,\n $r->quantity,\n $r->reorder_level,\n $r->location,\n $r->description,\n $r->allow_alt_description,\n $r->is_serialized ? 'y' : '',\n $r->item_id\n );\n\n $rows[] = $row;\n }\n\n $content = array_to_csv($rows);\n if ($template) {\n force_download('items_export_mass_update.csv', $content);\n } else {\n force_download('items_export.csv', $content);\n }\n exit;\n }", "public function export_excel()\n {\n return (new SiswaExport)->download('StudentList.xlsx');\n }", "public function download(Request $request)\n { \n \n $data = $this->docuVaultGeneratorRepo->buildCSVDocument($request->get('client'), \n $request->get('daterange'), $request->get('date_type'), $request->get('lenders'));\n\n $reportsArray = [];\n\n foreach ($data as $key => $value) {\n $reportsArray[$key] = (array)$value; \n }\n \n Excel::create('reports', function($excel) use($reportsArray) {\n $excel->sheet('sheet1', function($sheet) use ($reportsArray) {\n $sheet->fromArray($reportsArray);\n });\n })->download('xlsx');\n }", "public function exportExcel() \n {\n $st = ST::select(\n 'no_st',\n 'tanggal_st',\n 'tujuan_st',\n 'tipe', \n 'bidang',\n 'uraian',\n \n 'tanggal_mulai',\n 'tanggal_selesai',\n 'hp',\n 'no_laporan',\n 'tanggal_laporan',\n\n 'penanggung_jawab_id',\n 'pengendali_mutu_id',\n 'pengendali_teknis_id',\n 'ketua_tim_id', \n \n 'lokasi', \n 'biaya',\n 'km_id',\n 'costsheet_id'\n \n )->get();\n\n \n\n return Excel::create('data_tugas', function($excel) use ($st){\n $excel->sheet('st_bpkp', function($sheet) use ($st) {\n $sheet->fromArray($st);\n });\n })->download('xls');\n\n }", "public function exportToExcel(){\n\t\theader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); \n\t\theader(\"Content-Disposition: attachment; filename = DataNilaiMataKuliah.xls\"); \n\t\t$data['data_nilai'] = $this->Database_Nilai->ambil_data(); \n\t\t$this->load->view('export', $data);\n\t}", "public function dowload($filename)\n {\n //\n $file= app_path() . \"/storage/exports/\" . $filename . \".xls\";\n\t\tvar_dump($file);\n \n\t\t return $this->response->download($file);\n\n }", "public function index(){\n $data = $this->Excel_model->get_stocks();\n \n \n $template = 'Myexcel.csv';\n //set absolute path to directory with template files\n $templateDir = __DIR__ . \"/../controllers/\";\n \n //set config for report\n $config = array(\n 'template' => $template,\n 'templateDir' => $templateDir\n );\n \n \n //load template\n $R = new PHPReport($config);\n \n $R->load(array(\n 'NEWS_ID' => 'news_paper',\n 'repeat' => TRUE,\n 'data' => $data \n )\n );\n \n // define output directoy \n $output_file_dir = \"/tmp/\";\n \n \n $output_file_excel = $output_file_dir . \"Myexcel.csv\";\n //download excel sheet with data in /tmp folder\n $result = $R->render('excel', $output_file_excel);\n }", "public function DowloadExcel()\n {\n return $export->sheet('sheetName', function($sheet)\n {\n\n })->export('xls');\n }", "public function scheme_download(){\n $this->load->library('PHPExcel');\n $this->load->library('PHPExcel/IOFactory');\n\n $objPHPExcel = new PHPExcel();\n \n $objPHPExcel->createSheet();\n \n $objPHPExcel->getProperties()->setTitle(\"export\")->setDescription(\"none\");\n\n $objPHPExcel->setActiveSheetIndex(0);\n\n // Field names in the first row\n $fields = array(\n 'Scheme Name',\n 'Start Date',\n 'End Date',\n 'Product'\n );\n \n $col = 0;\n foreach ($fields as $field)\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, 1, $field);\n $col++;\n }\n \n // Fetching the table data\n $this->load->model('scheme/schememodel');\n $results = $this->model_scheme_schememodel->getschemedata($this->request->get);\n \n $row = 2;\n \n foreach($results as $data)\n {\n $col = 0;\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, $row, $data['Scheme_Name']);\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(1, $row, $data['START_DATE']);\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(2, $row, $data['END_DATE']);\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(3, $row, $data['product_name']);\n $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setAutoSize(true);\n \n \n \n \n $objPHPExcel->getActiveSheet()->getStyle('A1:L1')->getFont()->setItalic(true);\n $objPHPExcel->getActiveSheet()->getStyle('A1:L1')->getFont()->setBold(true);\n $objPHPExcel->getActiveSheet()->getStyle('A1:L1')->getFont()->setSize(12);\n $objPHPExcel->getActiveSheet()->getDefaultRowDimension('A1:L1')->setRowHeight(20);\n $objPHPExcel->getActiveSheet()->getStyle('A1:L1')->getFont()->getColor()->setRGB('FF0000');\n $row++;\n }\n\n \n\n \n$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n // Sending headers to force the user to download the file\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"Attendance_report_'.date('dMy').'.xls\"');\n header('Cache-Control: max-age=0');\n\n $objWriter->save('php://output');\n \n }", "public function actionDownload()\n {\n //设置内存\n ini_set(\"memory_limit\", \"2048M\");\n set_time_limit(0);\n\n\n //获取传过来的信息(时间,公司ID之类的,根据需要查询资料生成表格)\n $params = Yii::$app->request->get();\n $objectPHPExcel = new \\PHPExcel();\n\n //设置表格头的输出\n\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('A1', '订单号');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('B1', '运单编号');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('C1', '发件人');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('D1', '发件人电话');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('E1', '发件省份');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('F1', '发件城市');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('G1', '发件区域');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('H1', '发件详细地址');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('I1', '收件人');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('J1', '收货地邮编');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('K1', '收件人电话');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('L1', '重量KG');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('M1', '体积');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('N1', '代收货款IDR');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('O1', '保价费RMB');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('P1', '货物类型');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('Q1', '订单类型');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('R1', '备注');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('S1', '中文品名');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('T1', '英文品名');\n $objectPHPExcel->setActiveSheetIndex()->setCellValue('U1', '下单日期');\n\n\n\n //跳转到recharge这个model文件的statistics方法去处理数据\n $data = Orders::download($params);\n $row_data = $data['data'];\n $row_count = $data['count'];\n\n $a_lie = array('','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');\n $b_lie = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');\n $a_k = 0;\n $b_k = 21;\n\n for ($i = 0;$i < $row_count;$i++) {\n $objectPHPExcel->setActiveSheetIndex()->setCellValue($a_lie[$a_k].$b_lie[$b_k].'1', '件数');\n $b_k++;\n if($b_k >= 26) {\n $a_k++;\n $b_k = 0;\n }\n $objectPHPExcel->setActiveSheetIndex()->setCellValue($a_lie[$a_k].$b_lie[$b_k].'1', '申报价值IDR');\n $b_k++;\n if($b_k >= 26) {\n $a_k++;\n $b_k = 0;\n }\n $objectPHPExcel->setActiveSheetIndex()->setCellValue($a_lie[$a_k].$b_lie[$b_k].'1', '物品分类1');\n $b_k++;\n if($b_k >= 26) {\n $a_k++;\n $b_k = 0;\n }\n $objectPHPExcel->setActiveSheetIndex()->setCellValue($a_lie[$a_k].$b_lie[$b_k].'1', '物品分类2');\n $b_k++;\n if($b_k >= 26) {\n $a_k++;\n $b_k = 0;\n }\n $objectPHPExcel->setActiveSheetIndex()->setCellValue($a_lie[$a_k].$b_lie[$b_k].'1', '物品分类3');\n $b_k++;\n if($b_k >= 26) {\n $a_k++;\n $b_k = 0;\n }\n $objectPHPExcel->setActiveSheetIndex()->setCellValue($a_lie[$a_k].$b_lie[$b_k].'1', '物品描述');\n $b_k++;\n if($b_k >= 26) {\n $a_k++;\n $b_k = 0;\n }\n $objectPHPExcel->setActiveSheetIndex()->setCellValue($a_lie[$a_k].$b_lie[$b_k].'1', 'URL');\n $b_k++;\n if($b_k >= 26) {\n $a_k++;\n $b_k = 0;\n }\n $objectPHPExcel->setActiveSheetIndex()->setCellValue($a_lie[$a_k].$b_lie[$b_k].'1', '供应商');\n $b_k++;\n if($b_k >= 26) {\n $a_k++;\n $b_k = 0;\n }\n $objectPHPExcel->setActiveSheetIndex()->setCellValue($a_lie[$a_k].$b_lie[$b_k].'1', '货物状态');\n $b_k++;\n if($b_k >= 26) {\n $a_k++;\n $b_k = 0;\n }\n $objectPHPExcel->setActiveSheetIndex()->setCellValue($a_lie[$a_k].$b_lie[$b_k].'1', '颜色');\n $b_k++;\n if($b_k >= 26) {\n $a_k++;\n $b_k = 0;\n }\n $objectPHPExcel->setActiveSheetIndex()->setCellValue($a_lie[$a_k].$b_lie[$b_k].'1', '尺寸');\n $b_k++;\n if($b_k >= 26) {\n $a_k++;\n $b_k = 0;\n }\n }\n //指定开始输出数据的行数\n $n = 2;\n $a_k = 0;\n $b_k = 0;\n foreach ($row_data as $v){\n foreach ($v as $value) {\n $objectPHPExcel->getActiveSheet()->setCellValue($a_lie[$a_k].$b_lie[$b_k].($n) ,$value);\n $b_k++;\n if($b_k >= 26) {\n $a_k++;\n $b_k = 0;\n }\n }\n $a_k = 0;\n $b_k = 0;\n $n = $n +1;\n }\n\n ob_end_clean();\n ob_start();\n header('Content-Type:application/vnd.ms-excel;charset=utf-8');\n\n header('Cache-Control: max-age=0');\n\n //设置输出文件名及格式\n header('Content-Disposition:attachment;filename=\"订到列表导出'.date(\"YmdHis\").'.xls\"');\n\n //导出.xls格式的话使用Excel5,若是想导出.xlsx需要使用Excel2007\n\n $objWriter= \\PHPExcel_IOFactory::createWriter($objectPHPExcel,'Excel5');\n $objWriter->save('php://output');\n ob_end_flush();\n\n //清空数据缓存\n unset($data);\n }", "public function excel()\n { \n return Excel::download(new ReporteGraduados, 'graduado.xlsx');\n }", "public function sales_report_export_xls() {\n\n //Read page parameter to display report\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $sales_exec = $this->input->get('sales_exec');\n $start_date = $this->input->get('start');\n $end_date = $this->input->get('end');\n \n\n $tabledata = $this->reportsModel->get_sales_report_data_xls($tenant_id, $start_date, $end_date, $sales_exec);\n $this->load->helper('export_helper');\n \n export_sales_report_xls($tabledata);\n }", "public function index()\n\t{\n\t\t//\n return Excel::create('Mastersheet BQu version', function($excel) {\n\n $excel->sheet('Marks-Input Sheet', function($sheet) {\n\n $sheet->loadView('export.input_sheet')\n ->with('student_module_marks_input',StudentModuleMarksInput::all()->reverse())\n ->with('module_element',ModuleElement::all())\n ->with('modules',Module::all())\n ->with('courses',ApplicationCourse::all())\n ->with('users',User::all());\n\n });\n $excel->setcreator('BQu');\n $excel->setlastModifiedBy('BQu');\n $excel->setcompany('BQuServices(PVT)LTD');\n $excel->setmanager('Rajitha');\n\n })->download('xls');\n\t}", "function renderXLS($rows,$headers,$filename) {\n $data = $this->dumpXLS($rows,$headers);\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header('Content-Type: application/xls');\n header(\"Content-Disposition: attachment;filename=\".$filename);\n header(\"Content-Transfer-Encoding: binary\");\n echo $data;\n exit();\n }", "public static function ExcelDownload($filename) {\n header(\"Expires: Sat, 01 Jan 2000 00:00:00 GMT\");\n header(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n header(\"Pragma: public\");\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Content-Description: File Transfer\");\n\n //session_cache_limiter(\"must-revalidate\");\n header(\"Content-Type: application/vnd.ms-excel\");\n header('Content-Type: text/html; charset=utf-8');\n header('Content-Disposition: attachment; filename=\"' . $filename . '.xls\"');\n }", "public function create()\n {\n\tini_set('memory_limit', '-1');\n $datas = Excel::all();\n return view('serpo.download', compact('datas'));\n }", "function export(){\n header(\"Content-type: aplication/vnd-ms-excel\");\n header(\"Content-Disposition: attachment; filename=Data_Siswa.xls\");\n \n $data ['siswa'] = $this->SiswaModel->view();\n $this->load->view('export', $data);\n }", "public function execute()\n {\n $exportFileName = $this->report->getExportFileName('xls');\n return $this->fileFactory->create($exportFileName, $this->converter->getXlsFile(), 'var');\n // return $this->fileFactory->create('export.xls', $this->converter->getXlsFile(), 'var');\n }", "public function actionExportarExcel()\n {\n\n $this->renderPartial('excel');\n\n }", "public function actionExportarExcel()\n {\n\n $this->renderPartial('excel');\n\n }", "public function actionExcel(){\n $spreadsheet = new Spreadsheet();\n \n // Set document properties\n $spreadsheet->getProperties()->setCreator('Maarten Balliauw')\n ->setLastModifiedBy('Maarten Balliauw')\n ->setTitle('Office 2007 XLSX Test Document')\n ->setSubject('Office 2007 XLSX Test Document')\n ->setDescription('Test document for Office 2007 XLSX, generated using PHP classes.')\n ->setKeywords('office 2007 openxml php')\n ->setCategory('Test result file');\n \n // Add some data\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A1', 'Hello')\n ->setCellValue('B2', 'world!')\n ->setCellValue('C1', 'Hello')\n ->setCellValue('D2', 'world!');\n \n // Miscellaneous glyphs, UTF-8\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A4', 'Miscellaneous glyphs')\n ->setCellValue('A5', 'éàèùâêîôûëïüÿäöüç');\n \n // Rename worksheet\n $spreadsheet->getActiveSheet()->setTitle('Simple');\n \n // Set active sheet index to the first sheet, so Excel opens this as the first sheet\n $spreadsheet->setActiveSheetIndex(0);\n\n $response = Yii::$app->getResponse();\n $headers = $response->getHeaders();\n \n // Redirect output to a client’s web browser (Xlsx)\n $headers->set('Content-Type', 'application/vnd.ms-excel');\n $headers->set('Content-Disposition','attachment;filename=\"01simple.xlsx\"');\n // $headers->set('Cache-Control: max-age=0');\n // $headers->setheader('Cache-Control: max-age=1');\n\n// If you're serving to IE over SSL, then the following may be needed\n // $headers->set('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n // $headers->set('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\n // $headers->set('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n // $headers->set('Pragma: public'); // HTTP/1.0\n\n //header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n // header('Content-Disposition: attachment;filename=\"01simple.xlsx\"');\n $headers->set('Cache-Control: max-age=0');\n // If you're serving to IE 9, then the following may be needed\n $headers->set('Cache-Control: max-age=1');\n \n // If you're serving to IE over SSL, then the following may be needed\n $headers->set('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n $headers->set('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\n $headers->set('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n $headers->set('Pragma: public'); // HTTP/1.0\n ob_start(); \n $writer = IOFactory::createWriter($spreadsheet, 'Xlsx');\n $writer->save(\"php://output\");\n $content = ob_get_contents();\n ob_clean();\n return $content;\n\n // exit;\n\n\n\n\n\n }", "public function export() \n {\n return Excel::download(new TraineeExport, 'trainees.xlsx');\n }", "public function template()\n\t{\n\t\t$filename = 'template-channeling'; // set filename for csv file to be exported\n\n\t\t$nm_column = array(\n\t\t\t'REK_PEMBAYARAN',\n\t\t\t'NOMORCIF',\n\t\t\t'NAMA_KOPERASI',\n\t\t\t'KD_CABANG',\n\t\t\t'TAHAP_CAIR',\n\t\t\t'NAMA_PERUSAHAAN'\n\t\t);\n\n\t\t$csv_header = '';\n\t\tforeach ($nm_column as $key => $col) {\n\t\t\t$csv_header .= $col . '|';\n\t\t}\n\t\t$csv_header .= \"\\n\";\n\n\t\t$csv_row = '7081935337|79207999|KOPEDANA|ID0010520|1|PT CAHAYA ABADI|';\n\t\t$csv_row .= \"\\n\";\n\n\t\t/* Download as CSV File */\n\t\theader('Content-type: application/csv');\n\t\theader('Content-Disposition: attachment; filename=' . $filename . '.csv');\n\t\techo $csv_header . $csv_row;\n\t\texit;\n\t}", "public function export() \n {\n return Excel::download(new EmployesListe, 'employe.xlsx');\n }", "public function exportExcelAction()\n {\n $contenedor = $this->container;\n\n $xlsExport = $contenedor->get('xls.service_xls2007');\n\n $xlsExport->excelObj->getProperties()->setCreator(\"Proyecto Base\")\n ->setLastModifiedBy(\"Proyecto Base\")\n ->setTitle(\"Demo Excel\")\n ->setSubject(\"Demo Excel\")\n ->setDescription(\"Demo Excel\")\n ->setKeywords(\"demo excel proyecto base\")\n ->setCategory(\"demo\");\n\n $xlsExport->excelObj->setActiveSheetIndex(0)\n ->setCellValue('A2', 'Título Columna 1')\n ->setCellValue('B2', 'Título Columna 2');\n\n $xlsExport->excelObj->setActiveSheetIndex(0)\n ->setCellValue('A1', \"Este el el valor de la celda\")\n ->setCellValue('B1', \"Otro valor\");\n\n $xlsExport->excelObj->getActiveSheet()->setTitle(\"Demo\");\n\n // Set active sheet index to the first sheet, so Excel opens this as the first sheet\n $xlsExport->excelObj->setActiveSheetIndex(0);\n\n //create the response\n $response = $xlsExport->getResponse();\n $response->headers->set('Content-Type', 'text/vnd.ms-excel; charset=utf-8');\n $response->headers->set('Content-Disposition', 'attachment;filename=demo_excel.xls');\n\n // If you are using a https connection, you have to set those two headers for compatibility with IE <9\n $response->headers->set('Pragma', 'public');\n $response->headers->set('Cache-Control', 'maxage=1');\n return $response;\n }", "function gttn_tpps_xlsx_generator($location, array $options = array()) {\n $dir = drupal_realpath(GTTN_TPPS_TEMP_XLSX);\n $no_header = $options['no_header'] ?? FALSE;\n $columns = $options['columns'] ?? NULL;\n $max_rows = $options['max_rows'] ?? NULL;\n\n if (!empty($columns)) {\n $new_columns = array();\n foreach ($columns as $col) {\n $new_columns[$col] = $col;\n }\n $columns = $new_columns;\n }\n\n $zip = new ZipArchive();\n $zip->open($location);\n $zip->extractTo($dir);\n\n $strings_location = $dir . '/xl/sharedStrings.xml';\n $data_location = $dir . '/xl/worksheets/sheet1.xml';\n\n // Get width of the data in the file.\n $dimension = gttn_tpps_xlsx_get_dimension($data_location);\n preg_match('/([A-Z]+)[0-9]+:([A-Z]+)[0-9]+/', $dimension, $matches);\n $left_hex = unpack('H*', $matches[1]);\n $hex = $left_hex[1];\n $right_hex = unpack('H*', $matches[2]);\n\n $strings = gttn_tpps_xlsx_get_strings($strings_location);\n $reader = new XMLReader();\n $reader->open($data_location);\n\n if (!$no_header) {\n gttn_tpps_xlsx_get_row($reader, $strings);\n }\n\n $count = 0;\n while (($row = gttn_tpps_xlsx_get_row($reader, $strings))) {\n if (!empty($max_rows) and $count >= $max_rows){\n break;\n }\n $count++;\n\n $values = array();\n\n if (empty($columns)) {\n ksort($row);\n $hex = $left_hex[1];\n while (base_convert($hex, 16, 10) <= base_convert($right_hex[1], 16, 10)) {\n $key = pack('H*', $hex);\n $values[$key] = isset($row[$key]) ? trim($row[$key]) : NULL;\n $hex = gttn_tpps_increment_hex($hex);\n }\n yield $values;\n continue;\n }\n\n foreach ($columns as $column) {\n $values[$column] = isset($row[$column]) ? trim($row[$column]) : NULL;\n }\n yield $values;\n }\n\n $reader->close();\n gttn_tpps_rmdir($dir);\n}", "public function downloadExcel(Request $request, $type)\n{\n\t$data = Branches::get()->toArray();\n\treturn Excel::create('Branch List', function($excel) use ($data) {\n\t\t$excel->sheet('mySheet', function($sheet) use ($data)\n {\n\t\t\t$sheet->fromArray($data);\n\n });\n\n\t})->download($type);\n}", "function RenderExcel($fileName) {\n ob_clean();\n if ($fileName != \"\") {\n header(\"content-disposition: attachment; filename=\" . $fileName);\n }\n header(\"Content-type: application/ms-excel\");\n\n echo \"\\n<table>\";\n for ($r=0; $r<count($this->rows); $r++) {\n echo \"\\n<tr>\";\n $colcnt=count($this->rows[$r]->cells);\n for ($c=0; $c<$colcnt; $c++) {\n echo $this->rows[$r]->cells[$c]->HtmlCell();\n }\n echo \"\\n</tr>\";\n }\n echo \"\\n</table>\";\n ob_end_flush();\n exit();\n }", "public function exportToExcel()\n {\n $data = $this->index();\n $availment_per_month_per_client = [];\n $availment_per_month_per_client['data'] = $data;\n // // use return view(path.of.blade.file, $data);\n return Excel::download(new AvailmentPerMonthPerClientExport($availment_per_month_per_client['data']), 'AVAILMENT PER MONTH PER CLIENT REPORT.xlsx');\n // return $data;\n }", "function expense_tracker_excel()\n{\n\t\t$this->layout=\"\";\n\t\t$filename=\"Expense Tracker\";\n\t\theader (\"Expires: 0\");\n\t\theader (\"Last-Modified: \" . gmdate(\"D,d M YH:i:s\") . \" GMT\");\n\t\theader (\"Cache-Control: no-cache, must-revalidate\");\n\t\theader (\"Pragma: no-cache\");\n\t\theader (\"Content-type: application/vnd.ms-excel\");\n\t\theader (\"Content-Disposition: attachment; filename=\".$filename.\".xls\");\n\t\theader (\"Content-Description: Generated Report\" );\n\n\t\t\t$from = $this->request->query('f');\n\t\t\t$to = $this->request->query('t');\n\n\t\t\t\t$from = date(\"Y-m-d\", strtotime($from));\n\t\t\t\t$to = date(\"Y-m-d\", strtotime($to));\n\n\t\t\t$s_role_id = (int)$this->Session->read('role_id');\n\t\t\t$s_society_id = (int)$this->Session->read('society_id');\n\t\t\t$s_user_id = (int)$this->Session->read('user_id');\t\n\n\t\t$this->loadmodel('society');\n\t\t$conditions=array(\"society_id\" => $s_society_id);\n\t\t$cursor=$this->society->find('all',array('conditions'=>$conditions));\n\t\tforeach($cursor as $collection)\n\t\t{\n\t\t$society_name = $collection['society']['society_name'];\n\t\t}\n\n$excel=\"<table border='1'>\n<tr>\n<th style='text-align:center;' colspan='8'>$society_name Society</th>\n</tr>\n<tr>\n<th style='text-align:left;'>Voucher #</th>\n<th style='text-align:left;'>Posting Date</th>\n<th style='text-align:left;'>Due Date</th>\n<th style='text-align:left;'>Date of Invoice</th>\n<th style='text-align:left;'>Expense Head</th>\n<th style='text-align:left;'>Invoice Reference</th>\n<th style='text-align:left;'>Party Account Head</th>\n<th style='text-align:left;'>Amount</th>\n</tr>\";\n\t\t$total = 0;\n\t\t$this->loadmodel('expense_tracker');\n\t\t$conditions=array(\"society_id\"=>$s_society_id);\n\t\t$cursor3 = $this->expense_tracker->find('all',array('conditions'=>$conditions));\n\t\tforeach($cursor3 as $collection)\n\t\t{\n\t\t\t$receipt_id = $collection['expense_tracker']['receipt_id'];\n\t\t\t$posting_date = $collection['expense_tracker']['posting_date'];\n\t\t\t$due_date = $collection['expense_tracker']['due_date'];\n\t\t\t$invoice_date = $collection['expense_tracker']['invoice_date'];\n\t\t\t$expense_head = (int)$collection['expense_tracker']['expense_head'];\n\t\t\t$invoice_reference = $collection['expense_tracker']['invoice_reference'];\n\t\t\t$party_account_head = (int)$collection['expense_tracker']['party_head'];\n\t\t\t$amount = $collection['expense_tracker']['amount'];\n\n\t\t\t\t$result5 = $this->requestAction(array('controller' => 'hms', 'action' => 'ledger_account_fetch2'),array('pass'=>array($expense_head)));\n\t\t\t\tforeach($result5 as $collection3)\n\t\t\t\t{\n\t\t\t\t$ledger_name = $collection3['ledger_account']['ledger_name'];\n\t\t\t\t}\n\n\t\t\t\t\t$result6 = $this->requestAction(array('controller' => 'hms', 'action' => 'ledger_sub_account_fetch'),array('pass'=>array($party_account_head)));\n\t\t\t\t\tforeach($result6 as $collection4)\n\t\t\t\t\t{\n\t\t\t\t\t$party_name = $collection4['ledger_sub_account']['name'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\tif($posting_date >= $from && $posting_date <= $to)\n\t\t{\n\t\t\t$total = $total+$amount;\n$excel.=\"<tr>\n<td style='text-align:right;'>$receipt_id</td>\n<td style='text-align:left;'>$posting_date</td>\n<td style='text-align:left;'>$due_date</td>\n<td style='text-align:left;'>$invoice_date</td>\n<td style='text-align:left;'>$ledger_name</td>\n<td style='text-align:left;'>$invoice_reference</td>\n<td style='text-align:left;'>$party_name</td>\n<td style='text-align:right;'>$amount</td>\n</tr>\";\n}}\n$excel.=\"<tr>\n<th colspan='7' style='text-align:right;'>Total</th>\n<th>$total</th>\n</tr>\n</table>\";\n\t\necho $excel;\n}", "public function export_utemplate() {\n global $CFG;\n\n $fs = get_file_storage();\n $xmlfile = $fs->get_file_by_id($this->utemplateid);\n $filename = $xmlfile->get_filename();\n $content = $xmlfile->get_content();\n\n // echo '<textarea rows=\"10\" cols=\"100\">'.$content.'</textarea>';\n\n $templatename = clean_filename('temptemplate-' . gmdate(\"Ymd_Hi\"));\n $exportsubdir = \"mod_surveypro/templateexport\";\n make_temp_directory($exportsubdir);\n $exportdir = \"$CFG->tempdir/$exportsubdir\";\n $exportfile = $exportdir.'/'.$templatename;\n if (!preg_match('~\\.xml$~', $exportfile)) {\n $exportfile .= '.xml';\n }\n $this->templatename = basename($exportfile);\n\n $this->trigger_event('usertemplate_exported');\n\n header(\"Content-Type: application/download\\n\");\n header(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n header('Expires: 0');\n header('Cache-Control: must-revalidate,post-check=0,pre-check=0');\n header('Pragma: public');\n $xmlfile = fopen($exportdir.'/'.$this->templatename, 'w');\n print $content;\n fclose($xmlfile);\n unlink($exportdir.'/'.$this->templatename);\n }", "public function downloadSample(Request $request) {\n $data =[[\n \"Location\" => \"Intersoft\",\n \"First Name\" => \"John\",\n \"Last Name\" => \"Doe\",\n \"Email\" => \"[email protected]\",\n \"Password\" => \"123456\",\n \"Agent Type\" => \"tele\",\n \"Certified\" => \"1\",\n \"Certification Date\" => \"2020-01-20\",\n \"Certification Exp Date\" => \"2021-01-22\",\n \"State Test\" => \"1\",\n \"State\" => \"NY,WA\",\n \"Background Check\" => \"1\",\n \"Drug Check\" => \"1\",\n \"External Id\" => \"T001\",\n \"Phone Number\" => \"1231231231\",\n \"Restrict State\" => \"NJ\",\n ],[\n\n \"Location\" => \"Intersoft\",\n \"First Name\" => \"Lisa\",\n \"Last Name\" => \"William\",\n \"Email\" => \"[email protected]\",\n \"Password\" => \"123456\",\n \"Agent Type\" => \"d2d\",\n \"Certified\" => \"1\",\n \"Certification Date\" => \"2020-01-22\",\n \"Certification Exp Date\" => \"2021-01-22\",\n \"State Test\" => \"0\",\n \"State\" => \"CA,PH\",\n \"Background Check\" => \"0\",\n \"Drug Check\" => \"1\",\n \"External Id\" => \"T002\",\n \"Phone Number\" => \"1112223334\",\n \"Restrict State\" => \"NJ\",\n ]];\n\n return Excel::create('salesagent_sample', function($excel) use ($data) {\n $excel->sheet('sheet1', function($sheet) use ($data)\n {\n $sheet->fromArray($data);\n });\n })->download(\"csv\");\n }", "function area($tahun, $area, $berdasarkan)\n {\n $this->load->helper('exportexcel');\n $namaFile = \"transaksi_area.xls\";\n $judul = \"Transaksi\";\n $tablehead = 4;\n $tablebody = 5;\n $nourut = 1;\n //penulisan header\n header(\"Pragma: public\");\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0,pre-check=0\");\n header(\"Content-Type: application/force-download\");\n header(\"Content-Type: application/octet-stream\");\n header(\"Content-Type: application/download\");\n header(\"Content-Disposition: attachment;filename=\" . $namaFile . \"\");\n header(\"Content-Transfer-Encoding: binary \");\n $area2 = \"\";\n $berdasarkan2 = \"\";\n if ($area == \"-\") {\n $area = \"Semua\";\n $area2 = \"\";\n }\n if ($berdasarkan == \"-\") {\n $berdasarkan = \"Semua\";\n $berdasarkan2 = \"\";\n }\n\n xlsBOF();\n xlsWriteLabel(0, 0, \"Laporan\");\n xlsWriteLabel(1, 0, \"Tahun\");\n xlsWriteLabel(2, 0, \"Nama\");\n xlsWriteLabel(0, 1, $berdasarkan);\n xlsWriteLabel(1, 1, $tahun);\n xlsWriteLabel(2, 1, $area);\n $kolomhead = 0;\n xlsWriteLabel($tablehead, $kolomhead++, \"No\");\n xlsWriteLabel($tablehead, $kolomhead++, \"No Faktur\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Tgl Kirim\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Jatuh Tempo\");\n xlsWriteLabel($tablehead, $kolomhead++, \"ID Pelanggan\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Nama Pelanggan\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Nama Barang\");\n xlsWriteLabel($tablehead, $kolomhead++, \"QTY\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Satuan\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Kota\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Kecamatan\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Kelurahan\");\n xlsWriteLabel($tablehead, $kolomhead++, \"No Telpon\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Surveyor\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Debt\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Jumlah\");\n\n $record = $this->mLap->laporan_area($tahun, $area2, $berdasarkan2);\n $total = 0;\n foreach ($record as $data) {\n $kolombody = 0;\n xlsWriteNumber($tablebody, $kolombody++, $nourut);\n xlsWriteLabel($tablebody, $kolombody++, $data->id_transaksi);\n xlsWriteLabel($tablebody, $kolombody++, $data->tgl_transaksi);\n xlsWriteLabel($tablebody, $kolombody++, $data->jatuh_tempo);\n xlsWriteLabel($tablebody, $kolombody++, $data->id_pelanggan);\n xlsWriteLabel($tablebody, $kolombody++, $data->nama_pelanggan);\n xlsWriteLabel($tablebody, $kolombody++, $data->nama_barang);\n xlsWriteNumber($tablebody, $kolombody++, $data->qty);\n xlsWriteLabel($tablebody, $kolombody++, $data->satuan);\n xlsWriteLabel($tablebody, $kolombody++, $data->kota);\n xlsWriteLabel($tablebody, $kolombody++, $data->kecamatan);\n xlsWriteLabel($tablebody, $kolombody++, $data->kelurahan);\n xlsWriteLabel($tablebody, $kolombody++, $data->no_telp);\n xlsWriteLabel($tablebody, $kolombody++, $data->nama_karyawan);\n xlsWriteLabel($tablebody, $kolombody++, $data->username);\n xlsWriteNumber($tablebody, $kolombody++, $data->subtotal);\n $tablebody++;\n $nourut++;\n $total += $data->subtotal;\n }\n xlsWriteLabel($tablebody, 14, 'Total');\n xlsWriteNumber($tablebody, 15, $total);\n xlsEOF();\n exit();\n }", "public function excelfiles() \r\n\t{\r\n $this->load->library(array('excel/Biffwriter', 'excel/Format', 'excel/OLEwriter',\r\n \t\t\t\t\t\t\t'excel/Parser', 'excel/Workbook', 'excel/Worksheet'));\r\n \r\n $data['data'] = $this->GsmModel->tampil()->result_object(); \r\n $this->load->view('rptexcel/excelfiles',$data);\r\n }", "public function export()\n {\n return Excel::download(new UsersExport, 'users.xlsx');\n }", "abstract protected function excel ();", "public function viewAction()\n {\n $request = Request::createFromGlobals();\n $file = $request->query->get( 'file' );\n\n $portal = $this->container->get('arii_core.portal');\n $workspace = $portal->getWorkspace();\n $path = $portal->getSessionVar('path');\n \n $filename = str_replace('//','/',$workspace.'/'.$path.'/'.$file );\n if ($this->isUtf8($filename))\n $filename = utf8_decode($filename);\n \n if (!($content = file_get_contents($filename)))\n throw new \\Exception('File not found: '.$file);\n \n $response = new Response();\n $ext = strtolower(substr($file,-3));\n switch ($ext) {\n case 'png':\n case 'jpg':\n $type = 'image/'.$ext;\n break;\n// case 'xml':\n// $type = 'text/'.$ext;\n// break;\n case 'xls':\n if (!$this->isUtf8($content))\n $content = utf8_encode($content);\n $response->headers->set('Content-type', 'application/vnd.ms-excel; charset=utf-8');\n $response->headers->set(\"Content-disposition\", \"attachment; filename=$file\"); \n $response->setContent($content);\n return $response;\n break; \n default:\n if (!$this->isUtf8($content))\n $content = utf8_encode($content);\n $type = 'text/plain';\n }\n $response->headers->set('Content-Type', $type);\n $response->setContent($content);\n return $response;\n }", "public function companiessExport(){\n \n return Excel::download( new CompaniesExport , 'companies.xls');\n\n }", "function generate_report($req, $res, $isMonthly = true, $timeUnit = null, $uid = 1) {\r\n\tif ($isMonthly) {\r\n\t\tif (is_null ( $timeUnit ) || ! is_numeric ( $timeUnit ) || $timeUnit > 12 || $timeUnit < 1) {\r\n\t\t\t$timeUnit = date ( 'M' );\r\n\t\t}\r\n\t} else {\r\n\t\tif (is_null ( $timeUnit )) {\r\n\t\t\t$timeUnit = date ( 'Y' );\r\n\t\t}\r\n\t}\r\n\t\r\n\trequire_once 'PHPExcel/PHPExcel.php';\r\n\t$objPHPExcel = new PHPExcel ();\r\n\t\r\n\theader ( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' );\r\n\theader ( 'Content-Disposition: attachment;filename=\"report_' . ($isMonthly ? 'monthly' : 'yearly') . date ( 'YMDhm' ) . '.xlsx\"' );\r\n\theader ( 'Cache-Control: max-age=0' );\r\n\t\r\n\t// Set properties\r\n\t$objPHPExcel->getProperties ()->setCreator ( \"Roy Ganor\" )->setTitle ( \"Doctors Report\" )->setSubject ( \"Doctors Report\" )->setDescription ( \"Doctors Report\" );\r\n\t\r\n\twriteSurgeries ( $req, $res, $uid, $objPHPExcel );\r\n\twriteShifts ( $req, $res, $uid, $objPHPExcel );\r\n\twriteSessions ( $req, $res, $uid, $objPHPExcel );\r\n\twriteSurgeons ( $req, $res, $uid, $objPHPExcel );\r\n\twriteOperations ( $req, $res, $uid, $objPHPExcel );\r\n\t\r\n\t$objPHPExcel->setActiveSheetIndex ( 0 );\r\n\t\r\n\t$objWriter = PHPExcel_IOFactory::createWriter ( $objPHPExcel, 'Excel2007' );\r\n\t$objWriter->save ( 'php://output' );\r\n}", "public function exportDetailsAction(Request $request)\n {\n $expDatas = json_decode(urldecode($request->request->get('exp-datas')),true);\n $dossierSelector = $this->deboost($request->request->get('exp-dossier'));\n $typedate = $request->request->get('exp-typedate');\n $exercice = $request->request->get('exp-exercice');\n $client = $this->deboost($request->request->get('exp-client'));\n\n if ($client != 0) {\n $clientValue = $this->loadRepository('Client')\n ->find($client)\n ->getNom();\n } else{\n $clientValue = 'Clients';\n }\n\n $datas = $expDatas;\n $dossier = $dossierSelector;\n $extension = '.xls';\n $title = 'Details_' . $clientValue . '_' . $exercice;\n $name = $title . $extension;\n $phpExcelObject = $this->get('phpexcel')->createPHPExcelObject();\n $backgroundTitle = '808080';\n\n $phpExcelObject->getProperties()\n ->setCreator(\"Picdata\")\n ->setLastModifiedBy(\"Picdata\")\n ->setTitle($title)\n ->setSubject($title)\n ->setDescription(\"Tableau de detail des images \" . $clientValue . \" de l'exercice \" . $exercice)\n ->setKeywords(\"Picdata tableau details \" . $clientValue)\n ->setCategory(\"exportation excel Picdata\");\n\n $sheet = $phpExcelObject->setActiveSheetIndex(0);\n \n $i = 1;\n\n $sheet->setCellValue($this->getCellIndex($i,true), '')\n ->setCellValue($this->getCellIndex($i + 1,true), 'Client')\n ->setCellValue($this->getCellIndex($i + 1), $clientValue )\n ->setCellValue($this->getCellIndex($i + 2,true), 'Exercice')\n ->setCellValue($this->getCellIndex($i + 2), $exercice);\n\n $key = 6;\n\n if ($client == 0) {\n \n } else {\n \n }\n\n }", "public function exportTaxExcelAction()\n {\n $fileName = 'tax.xml';\n $grid = $this->getLayout()->createBlock('adminhtml/report_sales_tax_grid');\n $this->_initReportAction($grid);\n $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }", "public function exportATraiterAction(Request $request){\n \t// Recherche des courriers\n \t$em = $this->getDoctrine()->getManager();\n \t$results = $em->getRepository('PenderieDefaultBundle:Dossier')->getRefusAutomatiqueATraiter();\n \n \t// ask the service for a Excel5\n \t$phpExcelObject = $this->get('phpexcel')->createPHPExcelObject();\n \t$now = new \\DateTime();\n \t$titre = \"Export des dossiers refus auto. à traiter\";\n \t$nomFichier = \"export_refus_automatique_a_traiter_\".$now->format('Y-m-d_h-i-s');\n \n \t$phpExcelObject->getProperties()->setCreator(\"Siplec Création\")\n \t->setLastModifiedBy(\"Siplec Création\")\n \t->setTitle($titre)\n \t->setSubject($titre)\n \t->setDescription($titre.\" - \".$now->format('d/m/Y H:i:s'));\n \n \t$phpExcelObject->setActiveSheetIndex(0)\n \t->setCellValue('A1', $titre)\n \t->setCellValue('A2', \"Date de génération : \".$now->format('d/m/Y H:i:s'))\n \t->setCellValue('A3', \"Effectué par : \".$this->getUser())\n \t->fromArray($results, NULL, 'A5');\n \t$phpExcelObject->getActiveSheet()->setTitle('Export');\n \t// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n \t$phpExcelObject->setActiveSheetIndex(0);\n \n \t// create the writer\n \t$writer = $this->get('phpexcel')->createWriter($phpExcelObject, 'Excel5');\n \t// create the response\n \t$response = $this->get('phpexcel')->createStreamedResponse($writer);\n \t// adding headers\n \t$response->headers->set('Content-Type', 'text/vnd.ms-excel; charset=utf-8');\n \t$response->headers->set('Content-Disposition', \"attachment;filename=$nomFichier.xls\");\n \t$response->headers->set('Pragma', 'public');\n \t$response->headers->set('Cache-Control', 'maxage=1');\n \n \treturn $response;\n }", "public function download()\n {\n $this->authorize('viewAny', User::class);\n\n return Excel::download(new UsersExport, 'users.xlsx');\n }", "public function download()\n\t{\n\t\t$get_header \t\t\t= $this->db->get_where('header', array('header_is_displayed' => 'Y'));\n\t\t$get_footer \t\t\t= $this->db->get_where('footer', array('footer_is_displayed' => 'Y'));\n\t\t\n\t\t$data['get_header']\t\t= $get_header;\n\t\t$data['get_footer']\t\t= $get_footer;\n\t\t$this->load->view('download', $data);\n\t}", "public function customerExcelExport()\n\t{\n\t\t$status = $this->uri->segment(4);\n\t\t$sortArr = array('field' => 'id', 'type' => 'desc');\n\t\t$condition = array();\n\t\t$rep_code = ltrim($this->session->userdata('fc_session_admin_rep_code'), '0');\n\t\tif ($rep_code != '') {\n\t\t\t$condition = ' and h.rep_code=\"' . $rep_code . '\"';\n\t\t} else {\n\t\t\t$condition = '';\n\t\t}\n\t\t$UserDetails = $this->order_model->view_order_detailsexcel($status, $condition, $rep_code);\n\t\t$data['getCustomerDetails'] = $UserDetails->result_array();\n\t\t//print_r($data['getCustomerDetails']); \n\t\t\n\t\t//exit;\n\t\t$data['status'] = ($status == \"Pending\") ? 'Failed' : $status;\n\t\t$data['admin_currency_symbol'] = $this->data['admin_currency_symbol'];\n\t\t$data['admin_currency_code'] = $this->data['admin_currency_code'];\n\t\t$this->load->view('admin/order/customerExportExcel', $data);\n\t}", "public function gen_excel() {\n $this->load->library('excel');\n //activate worksheet number 1\n $this->excel->setActiveSheetIndex(0);\n //name the worksheet\n $this->excel->getActiveSheet()->setTitle('Customer list');\n\n // load database\n $this->load->database();\n\n // load model\n // get all users in array formate\n $this->load->model('Welcome_model');\n\n \n// $data['res'] = $this->customer_model->load_product_data($product, $type);\n \n $table_data = $this->Welcome_model->select_Insert_data();\n \n// echo '<pre>';\n// print_r($res);\n// exit();\n \n// $this->customer_model->create_openJobOrder_excel($data);\n $this->Welcome_model->creat_Excel($table_data);\n }", "public function export()\n {\n return Excel::download(new ProductExport, 'products.xlsx');\n // return (new ProductExport)->download('products.pdf', \\Maatwebsite\\Excel\\Excel\\::MDPDF);\n }", "public function exportar_productos_requerimientos($com_id){\n date_default_timezone_set('America/Lima');\n $componente = $this->model_componente->get_componente($com_id); //// DATOS COMPONENTE\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']); /// DATOS FASE\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); //// DATOS PROYECTO\n $prod=$this->requerimientos_operaciones($com_id);\n //la fecha de exportación sera parte del nombre del archivo Excel\n $fecha = date(\"d-m-Y H:i:s\");\n\n //Inicio de exportación en Excel\n header('Content-type: application/vnd.ms-excel;charset=UTF-8');\n header(\"Content-Disposition: attachment; filename=Reporte_requerimientos_Operación_\".$componente[0]['com_componente'].\"_$fecha.xls\"); //Indica el nombre del archivo resultante\n header(\"Pragma: no-cache\");\n header(\"Expires: 0\");\n\n echo '\n <table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\">\n <tr class=\"modo1\">\n <td colspan=\"21\"></td>\n </tr>\n <tr class=\"modo1\">\n <td colspan=\"21\">\n <FONT FACE=\"courier new\" size=\"1\">\n <b>ENTIDAD : </b>'.$this->session->userdata('entidad').'<br>\n <b>PLAN OPERATIVO ANUAL POA : </b> ' . $this->gestion . '<br>\n <b>REPORTE : </b> REQUERIMIENTOS POR OPERACIONES REGISTRADAS<br>\n <b>ACTIVIDAD : </b>'.$proyecto[0]['aper_programa'].''.$proyecto[0]['aper_proyecto'].''.$proyecto[0]['aper_actividad'].' - '.mb_convert_encoding(''.$proyecto[0]['proy_nombre'], 'cp1252', 'UTF-8').'<br>\n <b>SUB ACTIVIDAD : </b>'.$componente[0]['serv_cod'].'-'.mb_convert_encoding(''.$componente[0]['com_componente'], 'cp1252', 'UTF-8').'<br>\n </font>\n </td>\n </tr>\n </table><br>';\n echo \"\".$prod.\"\";\n }", "public function employee_excel()\n {\n $this->load->view('backend/admin/employee/employee_excel');\n }", "private function initExcel()\n {\n $this->savePointer = function () {\n $arrayData = [];\n $arrayData[] = $this->headerRow;\n for ($i = 0; i < count($this->body); $i ++) {\n $arrayData[] = $this->body[$i];\n }\n $this->dataCollection->getActiveSheet()->fromArray($arrayData, NULL,\n 'A1');\n $writer = new Xlsx($this->dataCollection);\n $writer->save($this->reportPath);\n $this->dataCollection->disconnectWorksheets();\n unset($this->dataCollection);\n header('Content-type: application/vnd.ms-excel');\n header(\n 'Content-Disposition: attachment; filename=' . $this->reportTitle .\n '.xls');\n };\n }", "public function export_excel2()\n\t{\n\t\t$this->load->library('phpexcel');\n\t\t$this->load->view('admin/function/xls_format');\n\t}", "function createExcel(){\n $spreadsheet = new \\PhpOffice\\PhpSpreadsheet\\Spreadsheet();\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A1', 'Hello')\n ->setCellValue('B2', 'world!')\n ->setCellValue('C1', 'Hello')\n ->setCellValue('D2', 'world!');\n\n //Rename worksheet\n $spreadsheet->getActiveSheet()->setTitle('Simple');\n // Set active sheet index to the first sheet, so Excel opens this as the first sheet\n $spreadsheet->setActiveSheetIndex(0);\n\n //Redirect output a client's web browser\n //header('Content-Type: application/octet-stream'); // unknown mime-type\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=\"01simple.xlsx\"');\n header('Cache-Control: max-age=0');\n\n //If you're serving to IE9, then the following may be needed\n header('Cache-Control: max-age=1');\n // If you're serving to IE over SSL, then the following may be needed\n header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified\n header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n $objWriter = \\PhpOffice\\PhpSpreadsheet\\IOFactory::createWriter($spreadsheet,'Excel2007');\n $objWriter->save('php://output');\n}", "public function export(){\n \n // Skrip berikut ini adalah skrip yang bertugas untuk meng-export data tadi ke excel\n header(\"Content-type: application/vnd-ms-excel\");\n header(\"Content-Disposition: attachment; filename=Data_Transaksi.xls\");\n \n $data['header_transaksi'] = $this->header_transaksi_model->listing();\n $this->load->view('admin/export/vw_laporan_excel', $data);\n\n }", "public function export(){\n\t $list_id = $this->uri->segment(3);\n\t $list_name = $this->distributiondata->getinfobyid('title',$list_id); \n\t \t$query = $this->distributionemails->getbyattribute('list_id',$list_id);\n\t\t\tif ($query->num_rows() > 0){\n\t\t\t\t$header[] = \"Email\";\n\t\t\t\t$header[] = \"Owner\";\n\t\t\t\t$header[] = \"Domains\";\n\t\t\t\t$this->exportxls->addHeader($header);\n\t\t\t\t\n\t\t\t\tforeach ($query->result() as $row){\n\t\t\t\t\t\n\t\t\t\t\t\t$data_row = array();\n\t\t\t\t\t\t$data_row[] = $row->email;\n\t\t\t\t\t\t$data_row[] = $row->owner;\n\t\t\t\t\t\t$data_row[] = $row->domains;\n\t\t\t\t\t\t$this->exportxls->addRow($data_row);\n\t\t\t\t }\n\t\t\t}\n\t\t\n\t\t$list_name = str_replace(' ','',strtolower($list_name));\n\t\t$this->exportxls->sendFile($list_name.'.xls');\n\t}", "#[Route(path: '/download-projects-spreadsheet/{ids}/{limit}', methods: ['GET'], name: 'translationalresearch_download_projects_excel')]\n public function downloadApplicantListExcelAction(Request $request, $ids=null, $limit=null) {\n\n if (false == $this->isGranted('ROLE_TRANSRES_USER')) {\n return $this->redirect($this->generateUrl('translationalresearch-nopermission'));\n }\n\n //$limit = 2; //testing\n //exit(\"ids=\".$ids);\n //exit(\"limit=\".$limit);\n\n if( $ids ) {\n if( is_array($ids) && count($ids) == 0 ) {\n exit(\"No Projects to Export to spreadsheet\");\n }\n }\n\n if( !$ids ) {\n exit(\"No Projects to Export to spreadsheet\");\n }\n\n $transresUtil = $this->container->get('transres_util');\n\n //[YEAR] [WCMC (top level of actual institution)] [FELLOWSHIP-TYPE] Fellowship Candidate Data generated on [DATE] at [TIME] EST.xls\n //$fileName = \"Projects \".date('m/d/Y H:i').\".xlsx\";\n $fileName = \"Projects-\".date('m-d-Y').\".xlsx\";\n //exit(\"filename=\".$fileName);\n\n $projectIdsArr = explode(',', $ids);\n\n //testing\n// $transresRequestUtil = $this->container->get('transres_request_util');\n// $workRequests = $transresRequestUtil->getProjectMiniRequests(3370);\n// foreach($workRequests as $request) {\n// print_r($request);\n// $oid = $request['oid'];\n// exit('oid='.$oid);\n// }\n// exit('111');\n\n //Spout uses less memory\n $transresUtil->createProjectExcelSpout($projectIdsArr,$fileName,$limit);\n //header('Content-Disposition: attachment;filename=\"'.$fileName.'\"');\n exit();\n\n //PhpOffice\n //TODO:\n //https://phpspreadsheet.readthedocs.io/en/develop/topics/memory_saving/\n // $cache = new MyCustomPsr16Implementation();\n //\n // composer require symfony/cache\n // use Symfony\\Component\\Cache\\Simple\\FilesystemCache;\n // $cache = new FilesystemCache();\n // \\PhpOffice\\PhpSpreadsheet\\Settings::setCache($cache);\n\n $excelBlob = $transresUtil->createProjectListExcel($projectIdsArr,$limit);\n //exit(\"got excel blob\");\n\n //$writer = \\PhpOffice\\PhpSpreadsheet\\IOFactory::createWriter($excelBlob, 'Excel2007');\n $writer = \\PhpOffice\\PhpSpreadsheet\\IOFactory::createWriter($excelBlob, 'Xlsx');\n //ob_end_clean();\n //$writer->setIncludeCharts(true);\n\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=\"'.$fileName.'\"');\n //header('Content-Disposition: attachment;filename=\"fileres.xlsx\"');\n\n // Write file to the browser\n $writer->save('php://output');\n\n $excelBlob->disconnectWorksheets();\n unset($excelBlob);\n\n exit();\n }", "public function exportSalesExcelAction()\n {\n $fileName = 'sales.xml';\n $grid = $this->getLayout()->createBlock('adminhtml/report_sales_sales_grid');\n $this->_initReportAction($grid);\n $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }", "function composeXLSfile(){\r\n\trequire_once 'Spreadsheet/Excel/Writer.php';\r\n\tresetErrorMessages();\r\n\tglobal $dataBody, $emailAddress;\r\n\tglobal $writeFileOpenError, $writeFileWritingError;\r\n\r\n\tglobal $thisURL, $filename;\r\n\t$filename\t \t= substr($thisURL, strpos($thisURL, \"/\"));\r\n\t$filename\t.= \"../datasources/savedResults/\";\r\n\t\t\t/* use name of uploaded file, or specified name from form widget filenameBox\r\n\t\t\t\t\t- or email + random number if no name chosen\r\n\t\t // used to start with beginning of email address (username)\r\n\t\t\t*/\r\n\tif(isset($_REQUEST[\"filenameBox\"])){\r\n\t\t$filename\t \t.= check_input($_REQUEST[\"filenameBox\"]);\r\n\t} else { // used to be no choice of file name, now we can specify: this is the fallback\r\n\t\t\t//use beginning of email address (username) plus random number\r\n\t\t$filename\t \t.= substr($emailAddress, 0, strpos($emailAddress, \"@\" ));\r\n\t\t$filename\t \t.= rand();\r\n\t}\r\n\t\t$filename\t \t.= \".xls\";\r\n\t\t//echo \"<h4>composeXLSfile has filenameBox: \" . $_REQUEST[\"filenameBox\"] . \"; filename = '\" . $filename . \"</h4>\";\r\n\r\n\t$displayFilename = strrchr( $filename, \"/\"); //strrchr = Find last occurrence of a character in a string\r\n\t$displayFilename = str_replace( \"/\", \"\", $displayFilename);\r\n\t\t$strDebug = \"<br/><span class='highlightNumbers'>&nbsp;filename='\" . $filename . \"'; displayFilename='\" . $displayFilename . \"';&nbsp;</span><br/>\";\r\n\r\n\r\n\r\n\t$dataBody = str_replace(\"<hr/>\", \"\", $dataBody);\r\n\t$arrayData = explode(\"|\", $dataBody);\r\n\t\t//$strDebug .= \"<br/>dataBody = '\" . $dataBody . \"<br/>\";\r\n\t\tfor($i=0; $i < count($arrayData); $i++){\r\n\t\t\t$strDebug .= \"- \" . $i . \") \" . $arrayData[$i] . \"<br/>\";\r\n\t\t}//end for count(arrayData)\r\n\t\t//echo $strDebug;\r\n\r\n\t$numCols = 12; //fields, columns, in the Spreadsheet_Excel_Writer\r\n\t$numRows = count($arrayData) / $numCols; //number of fields (array elements) by number of columns\r\n\t\t$strDebug .= \"numCols='\" . $numCols . \"'; numRows='\" . $numRows . \"'<br/>\";\r\n\r\n\r\n\t$workbook = new Spreadsheet_Excel_Writer($filename); \t\t // Create workbook\r\n\t$workbook->setVersion(8);\r\n\t$numChars = strlen($displayFilename) - 4; //skip '.xls' in $displayFilename when naming sheet\r\n\t$sheetname = \"OCLC_HOLDINGS\";// . substr($displayFilename, 0, $numChars);\r\n\t$worksheet = $workbook->addWorksheet($sheetname); // Create worksheet\r\n\t$worksheet->setInputEncoding('utf-8');\t\t\t\t\t\t//so we get accented characters in XLS\r\n\t\t/*\r\n\t\t\t//test UTF-8 output: it does work in the XLS\r\n\t\t$greek = \"\\342\\345\\353\\355\\341\";\r\n\t\t$russian = \"\\xD0\\xBF\\xD0\\xBE\\xD0\\xBA\\xD0\\xB0\";\r\n\t\t$worksheet->setInputEncoding('ISO-8859-7');\r\n\t\t$worksheet->write(6, 0, $greek);\r\n\t\t$worksheet->setInputEncoding('utf-8');\r\n\t\t$worksheet->write(6, 1, $russian);\r\n\t\t*/\r\n\r\n\t\t/*set column widths: params to setColumn are:\r\n\t\t\t\t1st column index to get this width,\r\n\t\t\t\tlast column index to get this width,\r\n\t\t\t\twidth where \"column width unit is 'one character' in the 'normal font.' \",\r\n\t\t\t\tother params not used here, see http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.spreadsheet-excel-writer-worksheet.setcolumn.php */\r\n\r\n\t$worksheet->setColumn(0,0,16); //OCLC_NUMBER\r\n\t$worksheet->setColumn(1,1,16); //OCLCalternate\r\n\t$worksheet->setColumn(2,2,9); //ISSN\r\n\t$worksheet->setColumn(3,3,20); //TITLE\r\n\t$worksheet->setColumn(4,4,5); //numHolders\r\n\t$worksheet->setColumn(5,5,3); //CRLholds\r\n\t$worksheet->setColumn(6,6,5); //memberHolds\r\n\t$worksheet->setColumn(7,7,25); //allNames\r\n\t$worksheet->setColumn(8,8,25); //allCodes\r\n\t$worksheet->setColumn(9,9,5); //memberNames\r\n\t$worksheet->setColumn(10,10,5); //memberCodes\r\n\t$worksheet->setColumn(11,11,5); //memberData\r\n\r\n\t/* This freezes the first row of the worksheet: http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.worksheet.freezepanes.php*/\r\n\t$worksheet->freezePanes(array(1, 0, 0, 0, 0));\r\n\r\n\t\t//do 1st row, column headings, in bold\r\n\t$format_bold = $workbook->addFormat();\r\n\t$format_bold->setBold();\r\n\tfor($i=0; $i < $numCols; $i++){\r\n\t\t$worksheet->write(0, $i, $arrayData[$i], $format_bold); //write(row, col, data, format)\r\n\t}//end for column headings\r\n\r\n\t\t//now loop thru writing the rows of actual data\r\n\t//$index = 0; //it was 0 but now we've done the first row\r\n\t$index\t\t\t= $numCols;\r\n\tfor ($row=1; $row < $numRows-1; $row++){\r\n\t\tfor($col=0; $col < $numCols; $col++){\r\n\t\t\t\t$strDebug .= \"<p>index = \" . $index . \"; row \" . $row . \" \";\r\n\t\t\t\t$strDebug .= \" col \" . $col . \": '\" . $arrayData[$index] . \"'\";\r\n\t\t\t$worksheet->write($row, $col, $arrayData[$index]); //UNFORMATTED: no 4th parameter\r\n\t\t\t$index++;\r\n\t\t}//end for columns\r\n\t\t$strDebug .= \"</p>\";\r\n\t}//end for rows\r\n\t//echo $strDebug;\r\n\r\n\t$workbook->close();\r\n\t//$workbook->send($filename); //this would send the new file to the browser\r\n\r\n\t$numBytes \t\t\t\t\t = filesize($filename); //php.net/manual/en/function.filesize.php\r\n\t$numKB\t\t\t\t\t\t\t = $numBytes / 1000;\r\n\t$writeFileSuccessMsg = generateSuccessMessage($displayFilename, $filename);\r\n\t$writeFileSuccessMsg = str_replace(\"REPLACE_DUMMY_STRING\", $numKB, $writeFileSuccessMsg);\r\n\techo $writeFileSuccessMsg;\r\n\r\n\treturn $filename;\r\n}", "public function SendFile(){\r\n if(empty($this->XlsData))\r\n throw new exception('Xls data not available');\r\n header(\"Cache-Control: no-cache, must-revalidate\");\r\n header(\"Content-Description: ABG_PhpToXls Generated XLS Data\");\r\n header(\"Content-Disposition: attachment; filename=\\\"$this->_FileName\\\"\");\r\n header('Content-Transfer-Encoding: binary');\r\n header('Content-Type: application/force-download');\r\n header('Content-Type: application/octet-stream');\r\n header(\"Content-type: application/x-msexcel\");\r\n header(\"Expires: Mon, 1 Apr 1974 05:00:00 GMT\");\r\n header(\"Last-Modified: \".gmdate(\"D,d M YH:i:s\").\" GMT\");\r\n header(\"Pragma: no-cache\");\r\n print($this->XlsData);\r\n }", "public function test()\n {\n\t\t$data = Session::get('exdata');\n $title = ['id', 'name', 'sex'];\n\n\n $spreadsheet = new Spreadsheet();\n $worksheet = $spreadsheet->getActiveSheet();\n //设置工作表标题名称\n $worksheet->setTitle('测试Excel');\n\n //表头\n //设置单元格内容\n foreach ($title as $key => $value) {\n $worksheet->setCellValueByColumnAndRow($key + 1, 1, $value);\n }\n\t\tLog::write($data, 'exdataT');\n $row = 2; //第二行开始\n foreach ($data as $item) {\n $column = 1;\n foreach ($item as $value) {\n $worksheet->setCellValueByColumnAndRow($column, $row, $value);\n $column++;\n }\n $row++;\n }\n\n # 保存为xlsx\n $filename = '测试Excel.xlsx';\n $writer = IOFactory::createWriter($spreadsheet, 'Xlsx');\n $writer->save($filename);\n \n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=\"'.$filename.'\"');\n header('Cache-Control: max-age=0');\n $writer->save('php://output');\n\n }", "public function export(){\n header(\"Content-type: application/vnd-ms-excel\");\n header(\"Content-Disposition: attachment; filename=Data_Card.xls\");\n \n $data['card'] = $this->Card_model->get_all_card();\n $this->load->view('card/export', $data);\n }", "public function excel()\n {\n Excel::create('Lista de vehiculos', function($excel) {\n $excel->sheet('Excel sheet', function($sheet) {\n //otra opción -> $products = Product::select('name')->get();\n\n $vehiculo = Transporte::join('empleados', 'empleados.id', '=', 'transportes.chofer_id')\n ->select('transportes.nombre_Unidad','transportes.no_Serie','transportes.placas','transportes.poliza_Seguro','transportes.vigencia_Seguro','transportes.aseguradora','transportes.m3_Unidad','transportes.capacidad', \\DB::raw(\"concat(empleados.nombre,' ',empleados.apellidos) as 'name'\"))\n ->where('empleados.estado', 'Activo')\n ->get(); \n $sheet->fromArray($vehiculo);\n $sheet->row(1,['Nombre Vehiculo','Numero Serie','Placas','Poliza Seguro','Vigencia Seguro','Aseguradora','Capacidad Ubica','Capacidad','Nombre Chofer']);\n\n $sheet->setOrientation('landscape');\n });\n })->export('xls');\n }", "public function download()\n {\n if ( ! $this->exists() ) {\n throw new FileExistException('Remote template does not exist');\n }\n\n try {\n $result = $this->getSoapClient()->DownloadTemplate(array(\n 'filename' => basename($this->getName()) ));\n\n return base64_decode($result->DownloadTemplateResult);\n } catch ( SoapException $ex ) {\n throw new DownloadException('Error while downloading the remote template from Livedocx service' , $ex);\n }\n }", "protected function getXTemplate(){\n\t\treturn new XTemplate( CDT_MVC_TEMPLATE_EXCEL );\n\t}", "public function exportExcel($type);", "public function index()\n {\n $import_types = ['product' => 'products.csv'];\n\n if (array_key_exists(request('import_type'), $import_types)) {\n $path = storage_path('app/csv_templates/' . $import_types[request('import_type')]);\n\n return response()->download($path);\n }\n }", "public function exportxls()\n\t{\n\t\t// Get the input from the url / post\n\t\t$input\t\t= JFactory::getApplication()->input;\n\n\t\t// the list with pk's for the selected items to export\n\t\t$pks\t\t= $input->get('cid', array(), 'array');\n\n\t\t$model\t\t= $this->getModel('HelloWorld');\n\n\t\t// get the data from the db\n\t\t$content\t= $model->getExportData($pks);\n\n\t\t// Create PHPExcel object\n\t\t$objPHPExcel = new PHPExcel();\n\t\t$objPHPExcel->getProperties()->setCreator(\"John Doe\")\n\t\t\t->setLastModifiedBy(\"Jane Deer\")\n\t\t\t->setTitle(\"My WorkSheet\")\n\t\t\t->setSubject(\"Test Document\")\n\t\t\t->setDescription(\"Test document for XLSX, generated using PHP classes.\");\n\n\t\t$objPHPExcel->getDefaultStyle()->getFont()->setName('Arial')->setSize(12);\n\n\t\t// enter cells in worksheet\n\t\t$sht\t= $objPHPExcel->setActiveSheetIndex(0);\n\t\t$sht->fromArray( $content, NULL, 'A1' );\n\n\t\t// resize column width\n\t\t$sht->getColumnDimension('A')->setWidth(5);\n\t\t$sht->getColumnDimension('B')->setWidth(5);\n\t\t$sht->getColumnDimension('C')->setWidth(35);\n\t\t$sht->getColumnDimension('D')->setWidth(20);\n\n\t\t$sht->setSelectedCell('A1');\n\n\t\t// ********************************************\n\t\t// Export PHPExcel object\n\n\t\t// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\n\t\t// Redirect output to a client's web browser (Excel2007)\n\t\t$filename\t= \"greetings\";\n\t\t$app\t\t= JFactory::getApplication();\n\t\t$app\n\t\t-> setHeader('Content-Type','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',true)\n\t\t-> setHeader('Content-disposition','attachment;filename=\"'.$filename.'.xlsx\";creation-date=\"'\n\t\t\t\t.JFactory::getDate()->toRFC822().'\"',true)\n\t\t-> setHeader('Cache-Control','max-age=1',true)\n\t\t-> setHeader('Expires','Mon, 26 Jul 1997 05:00:00 GMT',true)\t\t// Date in the past\n\t\t-> setHeader('Last-Modified',gmdate('D, d M Y H:i:s').' GMT',true)\t// always modified\n\t\t-> setHeader('Cache-Control','cache, must-revalidate',true)\n\t\t-> setHeader('Pragma','public',true);\n\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->save('php://output');\n\t}", "public function export()\n {\n return Excel::download(new PeopleExport, 'people-' . date('Y-m-d H:i:s') . '.' . request('format', 'xlsx'));\n }", "public function export()\n {\n return Excel::download(new ClientsExport, 'companies-' . date('Y-m-d H:i:s') . '.' . request('format', 'xlsx'));\n }", "public function export(Request $request) {\n $type = isset($request->type) ? $request->type : 'xlsx';\n $data = isset($request->data) ? $request->data : [];\n return Excel::download(function($excel) use ($data) {\n $excel->sheet('Invoices', function($sheet) use ($data) {\n $sheet->fromArray($data);\n });\n }, 'invoice.'.$type);\n }", "public function actionExport()\n {\n // export data to excel file\n return $this->render('export');\n }", "public function actionExport() {\n $models = Package::model()->findAll();\n //code\n $objPHPExcel = new PHPExcel();\n /** Error reporting */\n error_reporting(E_ALL);\n ini_set('display_errors', TRUE);\n ini_set('display_startup_errors', TRUE);\n define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');\n date_default_timezone_set('Europe/London');\n /** PHPExcel_IOFactory */\n $objReader = new PHPExcel;\n $objReader = PHPExcel_IOFactory::createReader('Excel2007');\n $path = Yii::app()->basePath . '/../export/template.xlsx';\n $pathExport = Yii::app()->basePath . '/../export/daftar paket.xlsx';\n $objPHPExcel = $objReader->load($path);\n $objPHPExcel->setActiveSheetIndex(0);\n// \" Add new data to the template\"\n $sheet = $objPHPExcel->getActiveSheet();\n $row = 5;\n $rowData1 = $row - 1;\n $rowData2 = $row - 1;\n $rowData3 = $row - 1;\n $rowData4 = $row - 1;\n $rowData5 = $row - 1;\n $sheet->insertNewRowBefore($row, (count($models) - 1));\n for ($i = 1; $i <= count($models); $i++) {\n $sheet->setCellValue('A' . (($row - 2) + $i), $i);\n }\n foreach ($models as $model) {\n $sheet->setCellValue('B' . $rowData1++, \"$model->code\");\n $sheet->setCellValueExplicit('C' . $rowData2++, $model->ppk_code, PHPExcel_Cell_DataType::TYPE_STRING);\n $sheet->setCellValue('D' . $rowData3++, $model->limit);\n $sheet->setCellValue('E' . $rowData4++, $model->getTotal($model->code)[\"realization\"]);\n $sheet->setCellValue('F' . $rowData5++, $model->getTotal($model->code)[\"restMoney\"]);\n }\n $objPHPExcel->getActiveSheet()->setTitle('Daftar Paket');\n\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n $objWriter->save($pathExport);\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename=' . basename($pathExport));\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate');\n header('Pragma: public');\n header('Content-Length: ' . filesize($pathExport));\n readfile($pathExport);\n unlink($pathExport);\n exit;\n//code\n }", "public function actionDownload() {\n if(isset($_GET['type']) && isset($_GET['id'])) {\n\n $model = Project::model()->findByPk($_GET['id']);\n\n // $dataProvider = new CActiveDataProvider('Project', array('id'=>$_GET['id']));\n /*\n $keys = array_keys($model->attributes);\n $colHeads = array();\n foreach($keys as $key) {\n $colHeads[] = $model->get\n }*/\n $data = array(\n 1 => array_values($model->attributeLabels()),\n array_values($model->attributes),\n );\n\n /*\n echo '<pre>';\n print_r($model->attributeLabels());\n echo '</pre>';\n */\n\n switch($_GET['type']) {\n\n case \"excel\":\n Yii::import('application.extensions.phpexcel.JPhpExcel');\n $xls = new JPhpExcel('UTF-8', false, $model->project_name);\n $xls->addArray($data);\n $xls->generateXML($model->project_name);\n break;\n }\n }\n }", "public function export()\n {\n return Excel::download(new ProductExport, 'products-' . date('Y-m-d') . '.xlsx');\n }", "private function setHeader($excel_file_name)//this function used to set the header variable\r\n\t{\r\n\t\t\r\n\t\theader('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1\r\n\t\theader('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1\r\n\t\theader (\"Pragma: no-cache\");\r\n\t\theader(\"Expires: 0\");\r\n\t\theader('Content-Transfer-Encoding: none');\r\n\t\theader('Content-Type: application/vnd.ms-excel;'); // This should work for IE & Opera\r\n\t\theader(\"Content-type: application/x-msexcel\"); // This should work for the rest\r\n\t\theader(\"Content-Disposition: attachment; filename=$excel_file_name\");\r\n\t\t\r\n\t\t/*header('Content-type: application/ms-excel');\r\n\t\theader('Content-Disposition: attachment; filename='.$excel_file_name);*/\r\n\t\r\n\t\r\n\t}" ]
[ "0.79654384", "0.75250506", "0.7398328", "0.72662187", "0.7198402", "0.7180465", "0.7151814", "0.71487117", "0.7097534", "0.70667934", "0.70434767", "0.7039052", "0.6986554", "0.69827384", "0.69646686", "0.6949154", "0.6843675", "0.6822336", "0.68050545", "0.6789642", "0.67682934", "0.6759098", "0.6673644", "0.66570604", "0.66374177", "0.6625056", "0.65911883", "0.6582672", "0.6566583", "0.65608376", "0.6545606", "0.6543232", "0.65367305", "0.6528906", "0.652126", "0.6491645", "0.6485518", "0.6468713", "0.64489776", "0.64379144", "0.64179116", "0.639428", "0.6382279", "0.63714015", "0.6349069", "0.6349069", "0.632088", "0.6319296", "0.6318845", "0.631542", "0.63016623", "0.6296219", "0.62926203", "0.6290612", "0.6287698", "0.6265347", "0.6256567", "0.62300795", "0.6211618", "0.6208353", "0.6205783", "0.62006617", "0.61980546", "0.61860406", "0.61849487", "0.61838025", "0.6181478", "0.6177688", "0.61569643", "0.6155378", "0.61510915", "0.6149473", "0.6148796", "0.6140393", "0.61394596", "0.6137662", "0.61366403", "0.61229396", "0.61216223", "0.61159223", "0.6103934", "0.60979307", "0.609467", "0.6088606", "0.6087353", "0.60870683", "0.608435", "0.6078419", "0.6077351", "0.6076588", "0.6074313", "0.606572", "0.60612607", "0.60524035", "0.60490525", "0.6044642", "0.60430366", "0.60427815", "0.6042236", "0.60299695" ]
0.7245861
4
function to show excel data in to table
public function upload_category_excel() { $data = array(); $this->form_validation->set_rules('fileURL', 'Upload File', 'callback_checkFileValidation'); if ($this->form_validation->run() == false) { } else { if (!empty($_FILES['fileURL']['name'])) { $extension = pathinfo($_FILES['fileURL']['name'], PATHINFO_EXTENSION); if ($extension == 'csv') { $reader = new \PhpOffice\PhpSpreadsheet\Reader\Csv(); } elseif ($extension == 'xlsx') { $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); } else { $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xls(); } $spreadsheet = $reader->load($_FILES['fileURL']['tmp_name']); $allDataInSheet = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); $arrayCount = count($allDataInSheet); $flag = 0; $createArray = array('ar_name', 'en_name', 'discount'); $makeArray = array('ar_name' => 'ar_name', 'en_name' => 'en_name', 'discount' => 'discount'); $SheetDataKey = array(); $mydata = array(); foreach ($allDataInSheet as $dataInSheet) { foreach ($dataInSheet as $key => $value) { if (in_array(trim($value), $createArray)) { $value = preg_replace('/\s+/', '', $value); $SheetDataKey[trim($value)] = $key; } } } $dataDiff = array_diff_key($makeArray, $SheetDataKey); if (empty($dataDiff)) { $flag = 1; } if ($flag == 1) { for ($i = 2; $i <= $arrayCount; $i++) { $ar_name = $SheetDataKey['ar_name']; $en_name = $SheetDataKey['en_name']; $discount = $SheetDataKey['discount']; $ar_name = filter_var(trim($allDataInSheet[$i][$ar_name]), FILTER_SANITIZE_STRING); $en_name = filter_var(trim($allDataInSheet[$i][$en_name]), FILTER_SANITIZE_STRING); $discount = filter_var(trim($allDataInSheet[$i][$discount]), FILTER_SANITIZE_STRING); $fetchData = array('ar_name' => $ar_name, 'en_name' => $en_name, 'discount' => $discount); $data['dataInfo'] = $fetchData; array_push($mydata, $fetchData); } } $data['mydata'] = $mydata; $data['title'] = $this->lang->line('admin_category'); $data['page'] = rest_path('category/display_category_excel'); $data['get_printer'] = $this->get_printer(); $data['category_branch_location'] = $this->get_branch_location(); $this->load->view('index', $data); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function tuExcel(){\n $fields= $this->db->field_data('hotel');\n $query= $this->db->get('hotel');\n return array (\"fields\" => $fields, \"query\" => $query);\n }", "abstract protected function excel ();", "public function excel()\n {\n Excel::create('Lista de vehiculos', function($excel) {\n $excel->sheet('Excel sheet', function($sheet) {\n //otra opción -> $products = Product::select('name')->get();\n\n $vehiculo = Transporte::join('empleados', 'empleados.id', '=', 'transportes.chofer_id')\n ->select('transportes.nombre_Unidad','transportes.no_Serie','transportes.placas','transportes.poliza_Seguro','transportes.vigencia_Seguro','transportes.aseguradora','transportes.m3_Unidad','transportes.capacidad', \\DB::raw(\"concat(empleados.nombre,' ',empleados.apellidos) as 'name'\"))\n ->where('empleados.estado', 'Activo')\n ->get(); \n $sheet->fromArray($vehiculo);\n $sheet->row(1,['Nombre Vehiculo','Numero Serie','Placas','Poliza Seguro','Vigencia Seguro','Aseguradora','Capacidad Ubica','Capacidad','Nombre Chofer']);\n\n $sheet->setOrientation('landscape');\n });\n })->export('xls');\n }", "public function gen_excel() {\n $this->load->library('excel');\n //activate worksheet number 1\n $this->excel->setActiveSheetIndex(0);\n //name the worksheet\n $this->excel->getActiveSheet()->setTitle('Customer list');\n\n // load database\n $this->load->database();\n\n // load model\n // get all users in array formate\n $this->load->model('Welcome_model');\n\n \n// $data['res'] = $this->customer_model->load_product_data($product, $type);\n \n $table_data = $this->Welcome_model->select_Insert_data();\n \n// echo '<pre>';\n// print_r($res);\n// exit();\n \n// $this->customer_model->create_openJobOrder_excel($data);\n $this->Welcome_model->creat_Excel($table_data);\n }", "public function excelfiles() \r\n\t{\r\n $this->load->library(array('excel/Biffwriter', 'excel/Format', 'excel/OLEwriter',\r\n \t\t\t\t\t\t\t'excel/Parser', 'excel/Workbook', 'excel/Worksheet'));\r\n \r\n $data['data'] = $this->GsmModel->tampil()->result_object(); \r\n $this->load->view('rptexcel/excelfiles',$data);\r\n }", "function export_nik_unins_lunas()\n\t{\n\t\t$excel_id=$this->uri->segment(3);\n\t\t$datas = $this->model_transaction->get_lunas_gagal($excel_id);\n\t\t\n\t\t// Create new PHPExcel object\n\t\t$objPHPExcel = $this->phpexcel;\n\t\t// Set document properties\n\t\t$objPHPExcel->getProperties()->setCreator(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setLastModifiedBy(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setTitle(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setSubject(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setDescription(\"REPORT, generated using PHP classes.\")\n\t\t\t\t\t\t\t\t\t ->setKeywords(\"REPORT\")\n\t\t\t\t\t\t\t\t\t ->setCategory(\"Test result file\");\n\t\t\t\t\t\t\t\t\t \n\t\t$objPHPExcel->setActiveSheetIndex(0); \n\t\t\n\t\t/*\n\t\t| BORDER OPTION\n\t\t*/\n\t\t$styleArray['borders']['outline']['style']=PHPExcel_Style_Border::BORDER_THIN;\n\t\t$styleArray['borders']['outline']['color']['rgb']='000000';\n\t\t/*\n\t\t| SET COLUMN WIDTH\n\t\t*/\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(15);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(30);\n\n\t\t/*\n\t\t| ROW HEADER TITLE\n\t\t*/\n\t\t$row=1;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,\"List Pelunasan Tidak Sesuai\");\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row)->getFont()->setBold(true);\n\t\t\n\t\t$row+=1;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,\"NIK\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row,\"Nama\");\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':B'.$row)->getFont()->setBold(true);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':A'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B'.$row.':B'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':B'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t$row+=1;\n\t\t/*\n\t\t| ROW DATA\n\t\t*/\n\t\tfor($i=0;$i<count($datas);$i++){\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,$datas[$i]['nik']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row,$datas[$i]['nama']);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':B'.$row)->getFont()->setSize(11);\n\t\t\t$row++;\n\t\t}\n\n\t\theader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n\t\theader('Content-Disposition: attachment;filename=\"PELUNASAN TIDAK SESUAI.xlsx\"');\n\t\theader('Cache-Control: max-age=0');\n\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->save('php://output');\n\t}", "function RenderExcel($fileName) {\n ob_clean();\n if ($fileName != \"\") {\n header(\"content-disposition: attachment; filename=\" . $fileName);\n }\n header(\"Content-type: application/ms-excel\");\n\n echo \"\\n<table>\";\n for ($r=0; $r<count($this->rows); $r++) {\n echo \"\\n<tr>\";\n $colcnt=count($this->rows[$r]->cells);\n for ($c=0; $c<$colcnt; $c++) {\n echo $this->rows[$r]->cells[$c]->HtmlCell();\n }\n echo \"\\n</tr>\";\n }\n echo \"\\n</table>\";\n ob_end_flush();\n exit();\n }", "public function test()\n {\n\t\t$data = Session::get('exdata');\n $title = ['id', 'name', 'sex'];\n\n\n $spreadsheet = new Spreadsheet();\n $worksheet = $spreadsheet->getActiveSheet();\n //设置工作表标题名称\n $worksheet->setTitle('测试Excel');\n\n //表头\n //设置单元格内容\n foreach ($title as $key => $value) {\n $worksheet->setCellValueByColumnAndRow($key + 1, 1, $value);\n }\n\t\tLog::write($data, 'exdataT');\n $row = 2; //第二行开始\n foreach ($data as $item) {\n $column = 1;\n foreach ($item as $value) {\n $worksheet->setCellValueByColumnAndRow($column, $row, $value);\n $column++;\n }\n $row++;\n }\n\n # 保存为xlsx\n $filename = '测试Excel.xlsx';\n $writer = IOFactory::createWriter($spreadsheet, 'Xlsx');\n $writer->save($filename);\n \n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=\"'.$filename.'\"');\n header('Cache-Control: max-age=0');\n $writer->save('php://output');\n\n }", "public function scheme_download(){\n $this->load->library('PHPExcel');\n $this->load->library('PHPExcel/IOFactory');\n\n $objPHPExcel = new PHPExcel();\n \n $objPHPExcel->createSheet();\n \n $objPHPExcel->getProperties()->setTitle(\"export\")->setDescription(\"none\");\n\n $objPHPExcel->setActiveSheetIndex(0);\n\n // Field names in the first row\n $fields = array(\n 'Scheme Name',\n 'Start Date',\n 'End Date',\n 'Product'\n );\n \n $col = 0;\n foreach ($fields as $field)\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, 1, $field);\n $col++;\n }\n \n // Fetching the table data\n $this->load->model('scheme/schememodel');\n $results = $this->model_scheme_schememodel->getschemedata($this->request->get);\n \n $row = 2;\n \n foreach($results as $data)\n {\n $col = 0;\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, $row, $data['Scheme_Name']);\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(1, $row, $data['START_DATE']);\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(2, $row, $data['END_DATE']);\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(3, $row, $data['product_name']);\n $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setAutoSize(true);\n \n \n \n \n $objPHPExcel->getActiveSheet()->getStyle('A1:L1')->getFont()->setItalic(true);\n $objPHPExcel->getActiveSheet()->getStyle('A1:L1')->getFont()->setBold(true);\n $objPHPExcel->getActiveSheet()->getStyle('A1:L1')->getFont()->setSize(12);\n $objPHPExcel->getActiveSheet()->getDefaultRowDimension('A1:L1')->setRowHeight(20);\n $objPHPExcel->getActiveSheet()->getStyle('A1:L1')->getFont()->getColor()->setRGB('FF0000');\n $row++;\n }\n\n \n\n \n$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n // Sending headers to force the user to download the file\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"Attendance_report_'.date('dMy').'.xls\"');\n header('Cache-Control: max-age=0');\n\n $objWriter->save('php://output');\n \n }", "function renderXLS($rows,$headers,$filename) {\n $data = $this->dumpXLS($rows,$headers);\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header('Content-Type: application/xls');\n header(\"Content-Disposition: attachment;filename=\".$filename);\n header(\"Content-Transfer-Encoding: binary\");\n echo $data;\n exit();\n }", "public function excel()\n {\n Excel::create('ReporteExcel', function($excel) {\n $excel->sheet('EdadGenero', function($sheet) {\n $usersinfo = User::select(DB::raw(\"users.cc as Cedula_Ciudadania, users.lastname as Apellidos, users.name as Nombres, users.email as Email, users.cellphone as Celular, users.department as DepartamentoNac, users.city as CiudadNac, users.created_at as FechaRegistro\"))->get();\n $sheet->fromArray($usersinfo);\n });\n })->export('xls');\n\n }", "function import_xls($filename = ''){\n\t\trequire_once('includes/xls_report/PHPExcel.php');\n\t\t$xls_file = 'uploads/DataBkd/DocUpload/'.$filename;\n\n\t\t$objReader = new PHPExcel_Reader_Excel5();\n\t\t$objReader->setReadDataOnly(true);\n\t\t$objPHPExcel = $objReader->load($xls_file); #return $filename;\n\t\t$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,false);\n\t\t$totalrow = count($sheetData); #return $sheetData;\n\t\t\n\t\t$kd_prodi = $sheetData[0][1];\n\t\t# get active record\n\t\t$start_record = 9;\n\t\t$start_col = 2;\n\t\twhile ($start_record < $totalrow){\n\t\t\t$a = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nira\n\t\t\t$b = str_replace(\"'\",\"\\'\",$sheetData[$start_record][$start_col]); $start_col++; #nm_asesor\n\t\t\t$c = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nm_pt\n\t\t\t$d = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; \n\t\t\t$e = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t$f = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t# simpan ke database \n\t\t\t$api_url \t= URL_API_BKD.'bkd_dosen/insert_asesor';\n\t\t\t$parameter = array('api_search' => array($a, $b, $c, $d, $e, $f, $kd_prodi));\n\t\t\t$this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t\t\n\t\t\t$start_record++;\n\t\t\t$start_col = 2;\n\t\t}\n\t\t$api_url \t= URL_API_BKD.'bkd_dosen/get_nama_prodi';\n\t\t$parameter = array('api_search' => array($kd_prodi));\n\t\t$nm = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\n\t\t$data['status'] = '<div class=\"alert alert-success\"><i class=\"icon icon-ok-sign\"></i> Import Data Asesor untuk program studi '.$nm.' selesai...\n\t\t\t\t\t\t\t<br/>Lihat Daftar Asesor Prodi'.$nm.' <a href=\"'.base_url().'bkd/admbkd/asesor/prodi/'.$kd_prodi.'\">Klik disini</a></div>';\n\t\t$this->output99=$this->s00_lib_output;\n\t\t$this->output99->output_display('admbkd/form_import',$data);\n\t}", "public function export(){\n include APPPATH.'third_party/PHPExcel/Classes/PHPExcel.php';\n \n // Panggil class PHPExcel nya\n $excel = new PHPExcel();\n\n // Settingan awal fil excel\n $excel->getProperties()->setCreator('My Notes Code')\n ->setLastModifiedBy('My Notes Code')\n ->setTitle(\"Data Buku\")\n ->setSubject(\"tb_buku\")\n ->setDescription(\"Laporan Semua Data Buku\")\n ->setKeywords(\"Data Buku\");\n\n // Buat sebuah variabel untuk menampung pengaturan style dari header tabel\n $style_col = array(\n 'font' => array('bold' => true), // Set font nya jadi bold\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)\n 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)\n ),\n 'borders' => array(\n 'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis\n 'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis\n 'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis\n 'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis\n )\n );\n\n // Buat sebuah variabel untuk menampung pengaturan style dari isi tabel\n $style_row = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)\n 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)\n ),\n 'borders' => array(\n 'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis\n 'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis\n 'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis\n 'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis\n )\n );\n\n $excel->setActiveSheetIndex(0)->setCellValue('A1', \"RELASI INTI MEDIA ( FAMILIA, ISTANA MEDIA, QUDSI MEDIA DAN FORUM )\"); // Set kolom A1 dengan tulisan \"DATA SISWA\"\n $excel->setActiveSheetIndex(0)->setCellValue('A2', \"Jl. Permadi Nyutran RT/RW. 61/19 MJ II No. 1606 C, Wirogunan, Mergangsan, Yogyakarta 55151\"); // Set kolom A1 dengan tulisan \"DATA SISWA\"\n $excel->setActiveSheetIndex(0)->setCellValue('A3', \"Email: [email protected] Telp: (0274) 2870300\"); // Set kolom A1 dengan tulisan \"DATA SISWA\"\n $excel->setActiveSheetIndex(0)->setCellValue('A5', \"DATA BUKU\");\n $excel->getActiveSheet()->mergeCells('A1:N1'); // Set Merge Cell pada kolom A1 sampai E1\n $excel->getActiveSheet()->mergeCells('A2:N2'); // Set Merge Cell pada kolom A1 sampai E1\n $excel->getActiveSheet()->mergeCells('A3:N3'); // Set Merge Cell pada kolom A1 sampai E1\n $excel->getActiveSheet()->mergeCells('A5:N5'); // Set Merge Cell pada kolom A1 sampai E1\n $excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1\n $excel->getActiveSheet()->getStyle('A5')->getFont()->setBold(TRUE); // Set bold kolom A1\n $excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1\n $excel->getActiveSheet()->getStyle('A5')->getFont()->setSize(15);\n $excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n $excel->getActiveSheet()->getStyle('A2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n $excel->getActiveSheet()->getStyle('A3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n $excel->getActiveSheet()->getStyle('A5')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1\n\n // Buat header tabel nya pada baris ke 3\n $excel->setActiveSheetIndex(0)->setCellValue('A7', \"NO\"); // Set kolom A3 dengan tulisan \"NO\"\n $excel->setActiveSheetIndex(0)->setCellValue('B7', \"KODE BUKU\"); // Set kolom A3 dengan tulisan \"NO\"\n $excel->setActiveSheetIndex(0)->setCellValue('C7', \"JUDUL\"); // Set kolom B3 dengan tulisan \"NIS\"\n $excel->setActiveSheetIndex(0)->setCellValue('D7', \"KATEGORI\"); // Set kolom C3 dengan tulisan \"NAMA\"\n $excel->setActiveSheetIndex(0)->setCellValue('E7', \"PENULIS\"); // Set kolom D3 dengan tulisan \"JENIS KELAMIN\"\n $excel->setActiveSheetIndex(0)->setCellValue('F7', \"PENERBIT\");\n $excel->setActiveSheetIndex(0)->setCellValue('G7', \"UKURAN\");\n $excel->setActiveSheetIndex(0)->setCellValue('H7', \"JUMLAH HALAMAN\");\n $excel->setActiveSheetIndex(0)->setCellValue('I7', \"ISBN\");\n $excel->setActiveSheetIndex(0)->setCellValue('J7', \"TAHUN TERBIT\");\n $excel->setActiveSheetIndex(0)->setCellValue('K7', \"HARGA (Rp)\");\n $excel->setActiveSheetIndex(0)->setCellValue('L7', \"STOK\");\n $excel->setActiveSheetIndex(0)->setCellValue('M7', \"KETERANGAN\");\n $excel->setActiveSheetIndex(0)->setCellValue('N7', \"STATUS\");\n\n // Apply style header yang telah kita buat tadi ke masing-masing kolom header\n $excel->getActiveSheet()->getStyle('A7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('B7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('C7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('D7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('E7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('F7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('G7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('H7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('I7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('J7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('K7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('L7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('M7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('N7')->applyFromArray($style_col);\n\n\n // Panggil function view yang ada di SiswaModel untuk menampilkan semua data siswanya\n $buku = $this->buku_model->showAllBuku();\n\n $no = 1; // Untuk penomoran tabel, di awal set dengan 1\n $numrow = 8; // Set baris pertama untuk isi tabel adalah baris ke 4\n foreach($buku as $data){ // Lakukan looping pada variabel siswa\n $excel->setActiveSheetIndex(0)->setCellValue('A'.$numrow, $no);\n $excel->setActiveSheetIndex(0)->setCellValue('B'.$numrow, $data->kd_buku);\n $excel->setActiveSheetIndex(0)->setCellValue('C'.$numrow, $data->judul);\n $excel->setActiveSheetIndex(0)->setCellValue('D'.$numrow, $data->nama_kategori);\n $excel->setActiveSheetIndex(0)->setCellValue('E'.$numrow, $data->nama_penulis);\n $excel->setActiveSheetIndex(0)->setCellValue('F'.$numrow, $data->nama_penerbit);\n $excel->setActiveSheetIndex(0)->setCellValue('G'.$numrow, $data->ukuran);\n $excel->setActiveSheetIndex(0)->setCellValue('H'.$numrow, $data->jml_halaman);\n $excel->setActiveSheetIndex(0)->setCellValue('I'.$numrow, $data->isbn);\n $excel->setActiveSheetIndex(0)->setCellValue('J'.$numrow, $data->thn_terbit);\n $excel->setActiveSheetIndex(0)->setCellValue('K'.$numrow, $data->harga);\n $excel->setActiveSheetIndex(0)->setCellValue('L'.$numrow, $data->stok);\n $excel->setActiveSheetIndex(0)->setCellValue('M'.$numrow, $data->keterangan);\n $excel->setActiveSheetIndex(0)->setCellValue('N'.$numrow, $data->status);\n \n // Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)\n $excel->getActiveSheet()->getStyle('A'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('B'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('C'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('D'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('E'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('F'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('G'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('H'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('I'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('J'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('K'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('L'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('M'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('N'.$numrow)->applyFromArray($style_row);\n \n $no++; // Tambah 1 setiap kali looping\n $numrow++; // Tambah 1 setiap kali looping\n }\n\n // Set width kolom\n $excel->getActiveSheet()->getColumnDimension('A')->setWidth(5); // Set width kolom A\n $excel->getActiveSheet()->getColumnDimension('B')->setWidth(13); // Set width kolom B\n $excel->getActiveSheet()->getColumnDimension('C')->setWidth(60); // Set width kolom C\n $excel->getActiveSheet()->getColumnDimension('D')->setWidth(25); // Set width kolom D\n $excel->getActiveSheet()->getColumnDimension('E')->setWidth(40); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('F')->setWidth(15); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('G')->setWidth(13); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('H')->setWidth(20); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('I')->setWidth(20); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('J')->setWidth(15); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('K')->setWidth(18); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('L')->setWidth(10); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('M')->setWidth(40); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('N')->setWidth(15); // Set width kolom E\n \n // Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)\n $excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);\n\n // Set orientasi kertas jadi LANDSCAPE\n $excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);\n\n // Set judul file excel nya\n $excel->getActiveSheet(0)->setTitle(\"Laporan Data Buku\");\n $excel->setActiveSheetIndex(0);\n\n // Proses file excel\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment; filename=\"Data Buku.xlsx\"'); // Set nama file excel nya\n header('Cache-Control: max-age=0');\n\n $write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');\n $write->save('php://output');\n }", "public function dataTable();", "public function report_history(){ \r\n $periode = $this->input->post('periode_download');\r\n $getDate = explode(\" - \", $periode);\r\n $startDate = $getDate[0];\r\n $endDate = $getDate[1];\r\n \r\n $this->excel->setActiveSheetIndex(0);\r\n\r\n //name the worksheet\r\n $this->excel->getActiveSheet()->setTitle('History worksheet');\r\n\r\n $styleArray = array(\r\n 'borders' => array(\r\n 'allborders' => array(\r\n 'style' => PHPExcel_Style_Border::BORDER_THIN\r\n )\r\n )\r\n );\r\n\r\n $this->excel->getActiveSheet()->setCellValue('A1', 'History User');\r\n $this->excel->getActiveSheet()->getStyle(\"A1\")->getFont()->setSize(20);\r\n if(!empty($periode)){\r\n $this->excel->getActiveSheet()->setCellValue('A3', 'Start Date History : '.$startDate);\r\n $this->excel->getActiveSheet()->getStyle(\"A3\")->getFont()->setSize(12);\r\n \r\n $this->excel->getActiveSheet()->setCellValue('A4', 'End Date History : '.$endDate);\r\n $this->excel->getActiveSheet()->getStyle(\"A4\")->getFont()->setSize(12);\r\n }\r\n \r\n \r\n //set cell A1 content with some text\r\n $arrField = array('No', 'Name', 'Address', 'Agent Code', 'Agent Name', 'MG User ID', 'Email User', 'Status History', 'Gift Name', 'Value Gift', 'Point Gift', 'Last Point', 'In Point', 'Out Point', 'Current Point', 'Approved By','Tanggal History', 'Notes');\r\n \r\n $arrCellsTitle = $this->excel->setValueHorizontal($arrField, 6, 65); //array field, nomer cells, abjad cells (start 65 = A, end 90 = Z)\r\n\r\n $i = 0;\r\n foreach($arrCellsTitle as $cells){\r\n\r\n $this->excel->getActiveSheet()->setCellValue($cells, $arrField[$i]);\r\n $i++;\r\n $this->excel->getActiveSheet()->freezePane('A7');\r\n } \r\n\r\n $report_history = $this->report_model->data_ReportHistory($startDate,date('Y-m-d', strtotime($endDate. ' + 1 days')));\r\n \r\n if($report_history){\r\n $no=1;\r\n $startNum = 7;\r\n foreach ($report_history as $row) { \r\n $tanggal_history = new DateTime($row['date_create']);\r\n $tanggal_history = date_format($tanggal_history, 'd M Y H:i');\r\n \r\n $arrItem = array($no, $row['name'], $row['address'], $row['kode_agent'], $row['agent_name'], $row['mg_user_id'],$row['email'], $row['status'], $row['gift_name'], $row['value'], $row['point'], $row['last_point'], $row['in_point'], $row['out_point'], $row['current_point'], $row['username'],$tanggal_history, $row['notes']);\r\n\r\n $arrCellsItem = $this->excel->setValueHorizontal($arrItem, $startNum, 65); //array field, nomer cells, abjad cells (start 65 = A, end 90 = Z)\r\n \r\n\r\n $i = 0;\r\n foreach($arrCellsItem as $cellsItem){\r\n\r\n $this->excel->getActiveSheet()->setCellValue($cellsItem, $arrItem[$i]);\r\n $i++;\r\n\r\n //make border\r\n $this->excel->getActiveSheet()->getStyle($cellsItem)->applyFromArray($styleArray);\r\n $this->excel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);\r\n } \r\n\r\n $no++;\r\n $startNum++;\r\n }}\r\n \r\n \r\n //make border\r\n $this->excel->getActiveSheet()->getStyle('A6:R6')->applyFromArray($styleArray);\r\n\r\n //change the font size\r\n //$this->excel->getActiveSheet()->getStyle()->getFont()->setSize(10);\r\n\r\n //make the font become bold\r\n $this->excel->getActiveSheet()->getStyle('A1:R6')->getFont()->setBold(true);\r\n\r\n //merge cell\r\n $this->excel->getActiveSheet()->mergeCells('A1:R1');\r\n \r\n if(!empty($periode)){\r\n $this->excel->getActiveSheet()->mergeCells('A3:D3');\r\n $this->excel->getActiveSheet()->mergeCells('A4:D4');\r\n }\r\n \r\n //set aligment to center for that merged cell \r\n $this->excel->getActiveSheet()->getStyle('A1:R6')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\r\n $this->excel->getActiveSheet()->getStyle('A1:R6')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\r\n\r\n $filename = 'history-user.xls'; //save our workbook as this file name\r\n header('Content-Type: application/vnd.ms-excel'); //mime type\r\n header('Content-Disposition: attachment;filename=\"'.$filename.'\"'); //tell browser what's the file name\r\n header('Cache-Control: max-age=0'); //no cache\r\n \r\n //save it to Excel5 format (excel 2003 .XLS file), change this to 'Excel2007' (and adjust the filename extension, also the header mime type)\r\n //if you want to save it as .XLSX Excel 2007 format\r\n $objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5'); \r\n //force user to download the Excel file without writing it to server's HD\r\n $objWriter->save('php://output');\r\n }", "public function excel()\r\n {\r\n $data = $this->AdminJobModel->getJobsForCSV($this->xssCleanInput('ids'));\r\n $data = sortForCSV(objToArr($data));\r\n $excel = new SimpleExcel('csv'); \r\n $excel->writer->setData($data);\r\n $excel->writer->saveFile('jobs'); \r\n exit;\r\n }", "function export_nik_unins_angsuran()\n\t{\n\t\t$angsuran_id=$this->uri->segment(3);\n\t\t$datas = $this->model_transaction->get_angsuran_unins($angsuran_id);\n\n\t\t// Create new PHPExcel object\n\t\t$objPHPExcel = $this->phpexcel;\n\t\t// Set document properties\n\t\t$objPHPExcel->getProperties()->setCreator(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setLastModifiedBy(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setTitle(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setSubject(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setDescription(\"REPORT, generated using PHP classes.\")\n\t\t\t\t\t\t\t\t\t ->setKeywords(\"REPORT\")\n\t\t\t\t\t\t\t\t\t ->setCategory(\"Test result file\");\n\t\t\t\t\t\t\t\t\t \n\t\t$objPHPExcel->setActiveSheetIndex(0); \n\t\t\n\t\t/*\n\t\t| BORDER OPTION\n\t\t*/\n\t\t$styleArray['borders']['outline']['style']=PHPExcel_Style_Border::BORDER_THIN;\n\t\t$styleArray['borders']['outline']['color']['rgb']='000000';\n\t\t/*\n\t\t| SET COLUMN WIDTH\n\t\t*/\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(15);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(30);\n\n\t\t/*\n\t\t| ROW HEADER TITLE\n\t\t*/\n\t\t$row=1;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,\"List Angsuran Non-Debet\");\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row)->getFont()->setBold(true);\n\t\t\n\t\t$row+=1;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,\"NIK\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row,\"Nama\");\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':B'.$row)->getFont()->setBold(true);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':A'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B'.$row.':B'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':B'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t$row+=1;\n\t\t/*\n\t\t| ROW DATA\n\t\t*/\n\t\tfor($i=0;$i<count($datas);$i++){\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,$datas[$i]['nik']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row,$datas[$i]['nama']);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':B'.$row)->getFont()->setSize(11);\n\t\t\t$row++;\n\t\t}\n\n\t\theader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n\t\theader('Content-Disposition: attachment;filename=\"ANGSURAN NON-DEBET.xlsx\"');\n\t\theader('Cache-Control: max-age=0');\n\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->save('php://output');\n\t}", "public function employee_excel()\n {\n $this->load->view('backend/admin/employee/employee_excel');\n }", "function exportDataToExcel($table_details,$file_name,$worksheet_name)\n\n\t{\n\t// Creating a workbook\n\t$workbook = new Spreadsheet_Excel_Writer();\n\t\n\t// sending HTTP headers\n\t$workbook->send(\"$file_name\".'xls');\n\t\n\t// Creating a worksheet\n\t$worksheet =& $workbook->addWorksheet(\"'$worksheet_name'\");\n\t\n\t\n\t\tif ($table_details)\n\t\t\t{\n\t\t\t\t$colcount=0; //for setting the footer colspan\n\t\t\t\tforeach($table_details[0] as $key=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t$worksheet->write(0,$colcount ,$key );\n\t\t\t\t\t$colcount++;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t$i=0;\n\t\t\t$cnt=count($table_details);\n\t\t\t\n\t\t\tfor($j=0; $j<$cnt; $j++)\n\t\t\t\t{\n\t\n\t\t\t\t$cell=0;\n\t\t\t\tforeach($table_details[$j] as $key=>$value)\n\t\t\t\t\t{\n\t\n\t\t\t\t\t$worksheet->write($j+1,$cell ,$value );\n\t\t\t\t\t$cell++;\n\t\t\t\t\t}\n\t\n\t\t\t\t}\n\t$workbook->close();\n\t}", "public function excel()\n {\n Excel::create('clientes', function($excel) {\n $excel->sheet('Excel sheet', function($sheet) {\n //otra opción -> $products = Product::select('name')->get();\n $clientes = Cliente::\n join('regimen_fiscal', 'regimen_fiscal.id','=','cliente.id_Regimen_Fiscal')\n ->select('cliente.nombre','cliente.rfc','cliente.contacto','regimen_fiscal.nombre as RegimenFiscal', 'cliente.telefono', 'cliente.email','cliente.codigo_Postal', 'cliente.direccion_fact', 'cliente.direccion_entr', 'cantidad_venta','cliente.volumen_venta', 'cliente.email', 'cliente.saldocliente','cliente.codigo_Postal')\n ->where('cliente.estado', 'Activo')\n ->get(); \n $sheet->fromArray($clientes);\n $sheet->row(1,['Nombre','RFC','Contacto', 'Regimen Fiscal' ,'Teléfono','Email','Codigo Postal','Dirección de Facturación','Dirección de Entrega de Embarque','Asignación de Cantidad de Venta por Año',' Asignación de Volumen de Venta por Año','Saldo Cliente $']);\n $sheet->setOrientation('landscape');\n \n\n });\n })->export('xls');\n }", "public function export() \n \t\t{\n \t\t$data = $this->model_patient->export();\n \t\t#load PHPExcel library\n \t\t$this->excel->setActiveSheetIndex(0);\n \t\t#name the worksheet\n \t\t$this->excel->getActiveSheet()->setTitle('Data Pasien SN Health Center');\n \n \t\t#STYLING\n \t\t$styleArray = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN,'color' => array('argb' => '0000'))));\n \n \t\t#set report header\n \t\t$this->excel->getActiveSheet()->getStyle('A:K')->getFont()->setName('Times New Roman');\n \t\t$this->excel->getActiveSheet()->mergeCells('A1:K1');\n \t\t$this->excel->getActiveSheet()->setCellValue('A1', 'DAFTAR PASIEN APLIKASI SN HEALTH CENTER');\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(12);\n \n \n \t\t//set column name\n \t\t$this->excel->getActiveSheet()->setCellValue('A2', 'No');\n \t\t$this->excel->getActiveSheet()->setCellValue('B2', 'Nomor Registrasi');\n \t\t$this->excel->getActiveSheet()->setCellValue('C2', 'Nomor KTP');\n \t\t$this->excel->getActiveSheet()->setCellValue('D2', 'Nama');\n \t\t$this->excel->getActiveSheet()->setCellValue('E2', 'Jenis Kelamin');\n \t\t$this->excel->getActiveSheet()->setCellValue('F2', 'Tanggal Lahir');\n \t\t$this->excel->getActiveSheet()->setCellValue('G2', 'Agama');\n \t\t$this->excel->getActiveSheet()->setCellValue('H2', 'Pekerjaan');\n \t\t$this->excel->getActiveSheet()->setCellValue('I2', 'Nomor HP');\n \t\t$this->excel->getActiveSheet()->setCellValue('J2', 'Alamat');\n \t\t$this->excel->getActiveSheet()->setCellValue('K2', 'Tanggal & Waktu Registrasi');\n \n\t\t\t $this->excel->getActiveSheet()->getStyle('A2:K2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('A')->setWidth(4);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('B')->setWidth(30);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('C')->setWidth(25);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('D')->setWidth(30);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('E')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('F')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('G')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('H')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('I')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('J')->setWidth(40);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('K')->setWidth(25);\n \n \t\t$no = 3;\n \t\t$nomor = 1;\n \t\tforeach ($data as $v) \n \t\t{\n \t\t\t\n \t\t\t$this->excel->getActiveSheet()->getStyle('A' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('A' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('A' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('A' . $no, $nomor);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('B' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('B' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('B' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('B' . $no, $v->patient_noregis);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('C' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('C' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('C' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('C' . $no, strval($v->patient_noktp));\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('D' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('D' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('D' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('D' . $no, $v->patient_name);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('E' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('E' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('E' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('E' . $no, $v->patient_sex);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('F' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('F' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('F' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('F' . $no, $v->patient_datebirth);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('G' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('G' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('G' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('G' . $no, $v->patient_religion);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('H' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('H' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('H' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('H' . $no, $v->patient_job);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('I' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('I' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('I' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('I' . $no, $v->patient_phone);\n\t\t\t\t \n\t\t\t\t$this->excel->getActiveSheet()->getStyle('J' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('J' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('J' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t\t\t$this->excel->getActiveSheet()->setCellValue('J' . $no, $v->patient_address);\n\t\t\t\t\t\t\n\t\t\t\t$this->excel->getActiveSheet()->getStyle('K' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('K' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('K' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('K' . $no, $v->patient_registerdate);\n\t\t\t\t\n\t\t\t\t$no++;\n \t\t\t$nomor++;\n \t\t}\n \n \t\t$this->excel->getActiveSheet()->getStyle('A2:K' . ($no - 1))->applyFromArray($styleArray);\n \t\tob_end_clean();\n \t\t$filename = 'Daftar Pasien Aplikasi SN Health Center.xls'; //save our workbook as this file name\n \t\theader('Content-Type: application/vnd.ms-excel'); //mime type\n \t\theader('Content-Disposition: attachment;filename=\"' . $filename . '\"'); //tell browser what's the file name\n \t\theader('Cache-Control: max-age=0'); //no cache\n \t\t$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');\n \t\t$objWriter->save('php://output');\n \n \t\tredirect('admin/patient');\n \t\t}", "function irexcel()\n\t{\n\n \n ini_set('memory_limit', '-1');\n $cond = $this->Session->read(\"cond\");\n\t\t$this->layout = 'ajax';\n\t\t$results = $this->IrModule->find('all',array(\"conditions\"=>$cond));\n $this->set(\"row\", $results);\n\t\t//var $helpers = array('Excel' => array($results));\n\t\t//loadHelper('Excel');\n\t\t//var_dump($helpers);\n\t}", "public function export() \n \t\t{\n \t\t$data = $this->model_user->export();\n \t\t#load PHPExcel library\n \t\t$this->excel->setActiveSheetIndex(0);\n \t\t#name the worksheet\n \t\t$this->excel->getActiveSheet()->setTitle('Data User SN Health Care');\n \n \t\t#STYLING\n \t\t$styleArray = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN,'color' => array('argb' => '0000'))));\n \n \t\t#set report header\n \t\t$this->excel->getActiveSheet()->getStyle('A:I')->getFont()->setName('Times New Roman');\n \t\t$this->excel->getActiveSheet()->mergeCells('A1:J1');\n \t\t$this->excel->getActiveSheet()->setCellValue('A1', 'DAFTAR USER APLIKASI SN HEALTH CARE');\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);\n \t\t$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(12);\n \n \n \t\t//set column name\n \t\t$this->excel->getActiveSheet()->setCellValue('A2', 'No');\n \t\t$this->excel->getActiveSheet()->setCellValue('B2', 'Nama');\n \t\t$this->excel->getActiveSheet()->setCellValue('C2', 'Jenis Kelamin');\n \t\t$this->excel->getActiveSheet()->setCellValue('D2', 'Tanggal Lahir');\n \t\t$this->excel->getActiveSheet()->setCellValue('E2', 'Email');\n \t\t$this->excel->getActiveSheet()->setCellValue('F2', 'Password');\n \t\t$this->excel->getActiveSheet()->setCellValue('G2', 'Nomor Handphone');\n \t\t$this->excel->getActiveSheet()->setCellValue('H2', 'Wilayah');\n \t\t$this->excel->getActiveSheet()->setCellValue('I2', 'Alamat');\n \t\t$this->excel->getActiveSheet()->setCellValue('J2', 'Tanggal & Waktu Registrasi');\n \n\t\t\t $this->excel->getActiveSheet()->getStyle('A2:J2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('A')->setWidth(4);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('B')->setWidth(30);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('C')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('D')->setWidth(15);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('E')->setWidth(30);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('F')->setWidth(30);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('G')->setWidth(20);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('H')->setWidth(30);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('I')->setWidth(40);\n\t\t\t $this->excel->getActiveSheet()->getColumnDimension('J')->setWidth(25);\n \n \t\t$no = 3;\n \t\t$nomor = 1;\n \t\tforeach ($data as $v) \n \t\t{\n \t\t\t\n \t\t\t$this->excel->getActiveSheet()->getStyle('A' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('A' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('A' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('A' . $no, $nomor);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('B' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('B' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('B' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('B' . $no, $v->user_name);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('C' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('C' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('C' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('C' . $no, $v->user_sex);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('D' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('D' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('D' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('D' . $no, $v->user_datebirth);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('E' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('E' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('E' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('E' . $no, $v->user_email);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('F' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('F' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('F' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('F' . $no, $v->user_password);\n\n \t\t\t$this->excel->getActiveSheet()->getStyle('G' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('G' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('G' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('G' . $no, $v->user_phone);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('H' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('H' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('H' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('H' . $no, $v->district_name);\n\t\t\t\t \n \t\t\t$this->excel->getActiveSheet()->getStyle('I' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('I' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('I' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t\t\t$this->excel->getActiveSheet()->setCellValue('I' . $no, $v->user_address);\n\t\t\t\t \n\t\t\t\t$this->excel->getActiveSheet()->getStyle('J' . $no)->getAlignment()->setWrapText(true);\n \t\t\t$this->excel->getActiveSheet()->getStyle('J' . $no)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->getStyle('J' . $no)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n \t\t\t$this->excel->getActiveSheet()->setCellValue('J' . $no, $v->user_registerdate);\n\t\t\t\t\n\t\t\t\t$no++;\n \t\t\t$nomor++;\n \t\t}\n \n \t\t$this->excel->getActiveSheet()->getStyle('A2:J' . ($no - 1))->applyFromArray($styleArray);\n \t\tob_end_clean();\n \t\t$filename = 'Daftar User Aplikasi SN Health Care.xls'; //save our workbook as this file name\n \t\theader('Content-Type: application/vnd.ms-excel'); //mime type\n \t\theader('Content-Disposition: attachment;filename=\"' . $filename . '\"'); //tell browser what's the file name\n \t\theader('Cache-Control: max-age=0'); //no cache\n \t\t$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');\n \t\t$objWriter->save('php://output');\n \n \t\tredirect('admin/user');\n \t\t}", "public function export_excel()\n\t{\n\t$data = array(\n array ('Name', 'Surname'),\n array('Schwarz', 'Oliver'),\n array('Test', 'Peter')\n );\n\t\t\n\t\t//$data = $this->db->get('test')->result_array();\n\t\t$this->load->library('Excel-Generation/excel_xml');\n\t\t$this->excel_xml->addArray($data);\n\t\t$this->excel_xml->generateXML('my-test');\n\t}", "public function DowloadExcel()\n {\n return $export->sheet('sheetName', function($sheet)\n {\n\n })->export('xls');\n }", "public function export()\n {\n include APPPATH . 'third_party/PHPExcel.php';\n\n // Panggil class PHPExcel nya\n $excel = new PHPExcel();\n\n date_default_timezone_set('Asia/Jakarta');\n $date = date(\"mY\");\n\n // Settingan awal fil excel\n $excel->getProperties()->setCreator('Admin PTPN VIII (' .$this->session->userdata('status_login'). ')')\n ->setLastModifiedBy('Admin PTPN VIII (' .$this->session->userdata('status_login'). ')')\n ->setTitle(\"Data A1\" .$date)\n ->setSubject(\"A1\" .$date)\n ->setDescription(\"Laporan Data A1\" .$date)\n ->setKeywords(\"Data A1\" .$date);\n\n // Buat sebuah variabel untuk menampung pengaturan style dari header tabel\n $style_col = array(\n 'font' => array('bold' => true), // Set font nya jadi bold\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)\n 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)\n ),\n 'borders' => array(\n 'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis\n 'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis\n 'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis\n 'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis\n )\n );\n // Buat sebuah variabel untuk menampung pengaturan style dari isi tabel\n $style_row = array(\n 'alignment' => array(\n 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)\n ),\n 'borders' => array(\n 'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis\n 'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis\n 'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis\n 'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis\n )\n );\n\n // Buat header tabel nya pada baris ke 1\n $excel->setActiveSheetIndex(0)->setCellValue('A1', \"NPP\");\n $excel->setActiveSheetIndex(0)->setCellValue('B1', \"NAMA\");\n $excel->setActiveSheetIndex(0)->setCellValue('C1', \"NM_PGL\");\n $excel->setActiveSheetIndex(0)->setCellValue('D1', \"GLR_DPN\");\n $excel->setActiveSheetIndex(0)->setCellValue('E1', \"GLR_BLK\");\n $excel->setActiveSheetIndex(0)->setCellValue('F1', \"TPT_LAHIR\");\n $excel->setActiveSheetIndex(0)->setCellValue('G1', \"TGL_LAHIR\");\n $excel->setActiveSheetIndex(0)->setCellValue('H1', \"KELAMIN\");\n $excel->setActiveSheetIndex(0)->setCellValue('I1', \"GOL_DARAH\");\n $excel->setActiveSheetIndex(0)->setCellValue('J1', \"AGAMA\");\n $excel->setActiveSheetIndex(0)->setCellValue('K1', \"ALAMAT\");\n $excel->setActiveSheetIndex(0)->setCellValue('L1', \"KOTA\");\n $excel->setActiveSheetIndex(0)->setCellValue('M1', \"TINGGAL\");\n $excel->setActiveSheetIndex(0)->setCellValue('N1', \"SIPIL\");\n $excel->setActiveSheetIndex(0)->setCellValue('O1', \"STAT_IS\");\n $excel->setActiveSheetIndex(0)->setCellValue('P1', \"TGL_NIKAH\");\n $excel->setActiveSheetIndex(0)->setCellValue('Q1', \"TGL_CERAI\");\n $excel->setActiveSheetIndex(0)->setCellValue('R1', \"KANDUNG\");\n $excel->setActiveSheetIndex(0)->setCellValue('S1', \"ANGKAT\");\n $excel->setActiveSheetIndex(0)->setCellValue('T1', \"TANGGUNG\");\n $excel->setActiveSheetIndex(0)->setCellValue('U1', \"TGL_PPH\");\n $excel->setActiveSheetIndex(0)->setCellValue('V1', \"KD_PEND\");\n $excel->setActiveSheetIndex(0)->setCellValue('W1', \"TGL_SK\");\n $excel->setActiveSheetIndex(0)->setCellValue('X1', \"NO_SK\");\n $excel->setActiveSheetIndex(0)->setCellValue('Y1', \"KD_KELAS\");\n $excel->setActiveSheetIndex(0)->setCellValue('Z1', \"KLS_TMT\");\n $excel->setActiveSheetIndex(0)->setCellValue('AA1', \"KLS_SK\");\n $excel->setActiveSheetIndex(0)->setCellValue('AB1', \"GOL\");\n $excel->setActiveSheetIndex(0)->setCellValue('AC1', \"MK\");\n $excel->setActiveSheetIndex(0)->setCellValue('AD1', \"GOL_TMT\");\n $excel->setActiveSheetIndex(0)->setCellValue('AE1', \"GOL_SK\");\n $excel->setActiveSheetIndex(0)->setCellValue('AF1', \"GPO\");\n $excel->setActiveSheetIndex(0)->setCellValue('AG1', \"KD_KBN\");\n $excel->setActiveSheetIndex(0)->setCellValue('AH1', \"KD_ADF\");\n $excel->setActiveSheetIndex(0)->setCellValue('AI1', \"KD_JAB\");\n $excel->setActiveSheetIndex(0)->setCellValue('AJ1', \"NAMA_JAB\");\n $excel->setActiveSheetIndex(0)->setCellValue('AK1', \"KD_BUD\");\n $excel->setActiveSheetIndex(0)->setCellValue('AL1', \"JAB_TMT\");\n $excel->setActiveSheetIndex(0)->setCellValue('AM1', \"JAB_SK\");\n $excel->setActiveSheetIndex(0)->setCellValue('AN1', \"JAB_TGL\");\n $excel->setActiveSheetIndex(0)->setCellValue('AO1', \"ASTEK\");\n $excel->setActiveSheetIndex(0)->setCellValue('AP1', \"TASPEN\");\n $excel->setActiveSheetIndex(0)->setCellValue('AQ1', \"NO_KK\");\n $excel->setActiveSheetIndex(0)->setCellValue('AR1', \"NO_NIK\");\n $excel->setActiveSheetIndex(0)->setCellValue('AS1', \"NO_BPJS\");\n $excel->setActiveSheetIndex(0)->setCellValue('AT1', \"TGL_MPP\");\n $excel->setActiveSheetIndex(0)->setCellValue('AU1', \"TGL_PEN\");\n $excel->setActiveSheetIndex(0)->setCellValue('AV1', \"MKTHN\");\n $excel->setActiveSheetIndex(0)->setCellValue('AW1', \"MKBLN\");\n $excel->setActiveSheetIndex(0)->setCellValue('AX1', \"MKHR\");\n $excel->setActiveSheetIndex(0)->setCellValue('AY1', \"MPP\");\n $excel->setActiveSheetIndex(0)->setCellValue('AZ1', \"STAT_REC\");\n\n // Apply style header yang telah kita buat tadi ke masing-masing kolom header\n $excel->getActiveSheet()->getStyle('A1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('B1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('C1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('D1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('E1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('F1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('G1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('H1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('I1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('J1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('K1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('L1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('M1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('N1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('O1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('P1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY);\n $excel->getActiveSheet()->getStyle('Q1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY);\n $excel->getActiveSheet()->getStyle('R1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('S1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('T1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('U1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('V1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('W1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('X1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('Y1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('Z1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AA1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AB1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AC1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AD1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AE1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AF1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AG1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AH1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AI1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AJ1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AK1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AL1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AM1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AN1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AO1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AP1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AQ1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AR1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AS1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AT1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AU1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AV1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AW1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AX1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AY1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AZ1')->applyFromArray($style_col)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n\n // Menampilkan semua data dari tabel rekao A1\n $numrow = 2; // Set baris pertama untuk isi tabel adalah baris ke 2\n $sdm01 = $this->Model_admin->tampil_a1();\n foreach ($sdm01->result_array() as $i) { // Lakukan looping pada variabel siswa\n $excel->setActiveSheetIndex(0)->setCellValueExplicit('A' . $numrow, $i['npp'], PHPExcel_Cell_DataType::TYPE_STRING);\n $excel->setActiveSheetIndex(0)->setCellValue('B' . $numrow, $i['nama']);\n $excel->setActiveSheetIndex(0)->setCellValue('C' . $numrow, $i['nm_pgl']);\n $excel->setActiveSheetIndex(0)->setCellValue('D' . $numrow, $i['glr_dpn']);\n $excel->setActiveSheetIndex(0)->setCellValue('E' . $numrow, $i['glr_blk']);\n $excel->setActiveSheetIndex(0)->setCellValue('F' . $numrow, $i['kota_lhr']);\n $excel->setActiveSheetIndex(0)->setCellValue('G' . $numrow, date('d-m-Y', strtotime($i['tgl_lhr'])));\n $excel->setActiveSheetIndex(0)->setCellValue('H' . $numrow, $i['j_kelamin']);\n $excel->setActiveSheetIndex(0)->setCellValue('I' . $numrow, $i['gol_darah']);\n $excel->setActiveSheetIndex(0)->setCellValue('J' . $numrow, $i['agama']);\n $excel->setActiveSheetIndex(0)->setCellValue('K' . $numrow, $i['alamat_tgl']);\n $excel->setActiveSheetIndex(0)->setCellValue('L' . $numrow, '');\n $excel->setActiveSheetIndex(0)->setCellValue('M' . $numrow, '1');\n $excel->setActiveSheetIndex(0)->setCellValue('N' . $numrow, $i['st_sipil']);\n\n $sdm02 = $this->Model_admin->get_sdm02_a1($i['npp']);\n foreach ($sdm02 as $a) {\n\n $excel->setActiveSheetIndex(0)->setCellValue('O' . $numrow, '');\n $excel->setActiveSheetIndex(0)->setCellValue('P' . $numrow, date('d-m-Y', strtotime($a['tgl_nkh'])));\n $excel->setActiveSheetIndex(0)->setCellValue('Q' . $numrow, date('d-m-Y', strtotime($a['tgl_cerai'])));\n }\n\n $sdm02 = $this->Model_admin->get_sdm02_a1_anak($i['npp']);\n foreach ($sdm02 as $b) {\n $excel->setActiveSheetIndex(0)->setCellValue('R' . $numrow, '');\n $excel->setActiveSheetIndex(0)->setCellValue('S' . $numrow, '');\n $excel->setActiveSheetIndex(0)->setCellValue('T' . $numrow, $b['tanggungan']);\n $excel->setActiveSheetIndex(0)->setCellValue('U' . $numrow, '');\n }\n\n $sdm03 = $this->Model_admin->get_sdm03_a1($i['npp']);\n foreach ($sdm03 as $c) {\n $excel->setActiveSheetIndex(0)->setCellValueExplicit('V' . $numrow, $c['kd_pend'], PHPExcel_Cell_DataType::TYPE_STRING);\n }\n\n $excel->setActiveSheetIndex(0)->setCellValue('W' . $numrow, date('d-m-Y', strtotime($i['tgl_masuk'])));\n\n $sdm08 = $this->Model_admin->get_sdm08_a1($i['npp']);\n foreach ($sdm08 as $d) {\n\n $excel->setActiveSheetIndex(0)->setCellValue('X' . $numrow, $d['no_sk']);\n }\n\n $sdm16 = $this->Model_admin->get_sdm16_a1($i['npp']);\n foreach ($sdm16 as $e) {\n $excel->setActiveSheetIndex(0)->setCellValue('Y' . $numrow, $e['kd_kelas']);\n $excel->setActiveSheetIndex(0)->setCellValue('Z' . $numrow, date('d-m-Y', strtotime($e['kls_tmt'])));\n $excel->setActiveSheetIndex(0)->setCellValue('AA' . $numrow, $e['kls_sk']);\n }\n\n $sdm16 = $this->Model_admin->get_sdm16_a1_akhir($i['npp']);\n foreach ($sdm16 as $a) {\n $excel->setActiveSheetIndex(0)->setCellValueExplicit('AB' . $numrow, $a['golongan'], PHPExcel_Cell_DataType::TYPE_STRING);\n $excel->setActiveSheetIndex(0)->setCellValueExplicit('AC' . $numrow, $a['mk'], PHPExcel_Cell_DataType::TYPE_STRING);\n $excel->setActiveSheetIndex(0)->setCellValue('AD' . $numrow, date('d-m-Y', strtotime($a['gol_tmt'])));\n $excel->setActiveSheetIndex(0)->setCellValue('AE' . $numrow, $a['gol_sk']);\n $excel->setActiveSheetIndex(0)->setCellValue('AF' . $numrow, '');\n }\n\n $sdm08 = $this->Model_admin->get_sdm08_a1_akhir($i['npp']);\n foreach ($sdm08 as $a) {\n $excel->setActiveSheetIndex(0)->setCellValueExplicit('AG' . $numrow, $a['kd_kbn'], PHPExcel_Cell_DataType::TYPE_STRING);\n $excel->setActiveSheetIndex(0)->setCellValueExplicit('AH' . $numrow, $a['kd_adf'], PHPExcel_Cell_DataType::TYPE_STRING);\n $excel->setActiveSheetIndex(0)->setCellValueExplicit('AI' . $numrow, $a['kd_jab'], PHPExcel_Cell_DataType::TYPE_STRING);\n\n $jab = $this->Model_admin->get_jabatan($a['kd_jab']);\n foreach ($jab as $jab) {\n $excel->setActiveSheetIndex(0)->setCellValue('AJ' . $numrow, $jab['nama']);\n }\n\n $excel->setActiveSheetIndex(0)->setCellValueExplicit('AK' . $numrow, $a['kd_bud'], PHPExcel_Cell_DataType::TYPE_STRING);\n $excel->setActiveSheetIndex(0)->setCellValue('AL' . $numrow, date('d-m-Y', strtotime($a['jab_tmt'])));\n $excel->setActiveSheetIndex(0)->setCellValue('AM' . $numrow, $a['jab_sk']);\n $excel->setActiveSheetIndex(0)->setCellValue('AN' . $numrow, date('d-m-Y', strtotime($a['jab_tgl'])));\n }\n\n\n $excel->setActiveSheetIndex(0)->setCellValueExplicit('AO' . $numrow, $i['no_astek'], PHPExcel_Cell_DataType::TYPE_STRING);\n $excel->setActiveSheetIndex(0)->setCellValueExplicit('AP' . $numrow, $i['no_pens'], PHPExcel_Cell_DataType::TYPE_STRING);\n $excel->setActiveSheetIndex(0)->setCellValueExplicit('AQ' . $numrow, $i['no_kk'], PHPExcel_Cell_DataType::TYPE_STRING);\n $excel->setActiveSheetIndex(0)->setCellValueExplicit('AR' . $numrow, $i['no_nik'], PHPExcel_Cell_DataType::TYPE_STRING);\n $excel->setActiveSheetIndex(0)->setCellValueExplicit('AS' . $numrow, $i['no_bpjs'], PHPExcel_Cell_DataType::TYPE_STRING);\n\n $sdm16 = $this->Model_admin->get_sdm16_a1_akhir($i['npp']);\n $golongan = $sdm16[0]['golongan'];\n $golongan = (int)$golongan;\n if ($golongan >= 0 and $golongan <= 8) {\n $tgl_pen = date('Y-m-d', strtotime('+55 year +1 month', strtotime($i['tgl_lhr'])));\n $tgl_mpp = date('Y-m-d', strtotime('-6 month', strtotime($tgl_pen)));\n $excel->setActiveSheetIndex(0)->setCellValue('AT' . $numrow, date('01-m-Y', strtotime($tgl_mpp)));\n $excel->setActiveSheetIndex(0)->setCellValue('AU' . $numrow, date('01-m-Y', strtotime($tgl_pen)));\n }\n if ($golongan >= 9 and $golongan <= 16) {\n $tgl_pen = date('Y-m-d', strtotime('+56 year +1 month', strtotime($i['tgl_lhr'])));\n $tgl_mpp = date('Y-m-d', strtotime('-6 month', strtotime($tgl_pen)));\n $excel->setActiveSheetIndex(0)->setCellValue('AT' . $numrow, date('01-m-Y', strtotime($tgl_mpp)));\n $excel->setActiveSheetIndex(0)->setCellValue('AU' . $numrow, date('01-m-Y', strtotime($tgl_pen)));\n }\n\n $sdm01 = $this->Model_admin->tampil_a1($i['npp'])->result_array();\n $skrng = date_create($sdm01[0]['tgl_masuk']);\n $tgl_pen = date_create($tgl_pen);\n\n $diff = date_diff($skrng, $tgl_pen);\n\n if ($diff->y > 57) {\n $excel->setActiveSheetIndex(0)->setCellValue('AV' . $numrow, '');\n $excel->setActiveSheetIndex(0)->setCellValue('AW' . $numrow, '');\n $excel->setActiveSheetIndex(0)->setCellValue('AX' . $numrow, '');\n $excel->setActiveSheetIndex(0)->setCellValue('AY' . $numrow, '');\n $excel->setActiveSheetIndex(0)->setCellValue('AZ' . $numrow, '');\n } else {\n $excel->setActiveSheetIndex(0)->setCellValue('AV' . $numrow, $diff->y);\n $excel->setActiveSheetIndex(0)->setCellValue('AW' . $numrow, $diff->m);\n $excel->setActiveSheetIndex(0)->setCellValue('AX' . $numrow, $diff->d);\n $excel->setActiveSheetIndex(0)->setCellValue('AY' . $numrow, '');\n $excel->setActiveSheetIndex(0)->setCellValue('AZ' . $numrow, '');\n }\n\n // Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)\n $excel->getActiveSheet()->getStyle('A' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('B' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('C' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('D' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('E' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('F' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('G' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('H' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('I' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('J' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('K' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('L' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('M' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('N' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('O' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('P' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('Q' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('R' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('S' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('T' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('U' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('V' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('W' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('X' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('Y' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('Z' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AA' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AB' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AC' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AD' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AE' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AF' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AG' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AH' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AI' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AJ' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AK' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AL' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AM' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AN' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AO' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AP' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AQ' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AR' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AS' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AT' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AU' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AV' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AW' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AX' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AY' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n $excel->getActiveSheet()->getStyle('AZ' . $numrow)->applyFromArray($style_row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);\n\n $numrow++; // Tambah 1 setiap kali looping\n }\n\n\n // Set width kolom\n $excel->getActiveSheet()->getColumnDimension('A')->setWidth(15);\n $excel->getActiveSheet()->getColumnDimension('B')->setWidth(30);\n $excel->getActiveSheet()->getColumnDimension('C')->setWidth(30);\n $excel->getActiveSheet()->getColumnDimension('D')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('E')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('F')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('G')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('H')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('I')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('J')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('K')->setWidth(50);\n $excel->getActiveSheet()->getColumnDimension('L')->setWidth(20);\n $excel->getActiveSheet()->getColumnDimension('M')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('N')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('O')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('P')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('Q')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('R')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('S')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('T')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('U')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('V')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('W')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('X')->setWidth(25);\n $excel->getActiveSheet()->getColumnDimension('Y')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('Z')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('AA')->setWidth(25);\n $excel->getActiveSheet()->getColumnDimension('AB')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('AC')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('AD')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('AE')->setWidth(25);\n $excel->getActiveSheet()->getColumnDimension('AF')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('AG')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('AH')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('AI')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('AJ')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('AK')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('AL')->setWidth(25);\n $excel->getActiveSheet()->getColumnDimension('AM')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('AN')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('AO')->setWidth(15);\n $excel->getActiveSheet()->getColumnDimension('AP')->setWidth(15);\n $excel->getActiveSheet()->getColumnDimension('AQ')->setWidth(15);\n $excel->getActiveSheet()->getColumnDimension('AR')->setWidth(15);\n $excel->getActiveSheet()->getColumnDimension('AS')->setWidth(15);\n $excel->getActiveSheet()->getColumnDimension('AT')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('AU')->setWidth(10);\n $excel->getActiveSheet()->getColumnDimension('AV')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('AW')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('AX')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('AY')->setWidth(5);\n $excel->getActiveSheet()->getColumnDimension('AZ')->setWidth(5);\n\n // Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)\n $excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);\n\n // Set orientasi kertas jadi LANDSCAPE\n $excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);\n\n date_default_timezone_set('Asia/Jakarta');\n $date = date(\"mY\");\n\n // Set judul file excel nya\n $excel->getActiveSheet(0)->setTitle(\"Data A1\");\n $excel->setActiveSheetIndex(0);\n\n // Proses file excel\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment; filename=\"Data A1' . $date . '.xlsx\"'); // Set nama file excel nya\n header('Cache-Control: max-age=0');\n\n header('Content-Transfer-Encoding: binary');\n header('Accept-Ranges: bytes');\n header('Cache-control: no-cache, pre-check=0, post-check=0');\n header('Cache-control: private');\n header('Pragma: private');\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // any date in the past\n\n $write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');\n $write->save('php://output');\n }", "function ImprovedTable($header,$data)\n{\n\t//Anchuras de las columnas\n\t$w=array(60,30,20,35,35);\n\t//Cabeceras\n\t$l = mysql_connect(\"localhost\",\"pmm\",\"guhAf2eh\");\n\t//$l = mysql_connect(\"DBSERVER\",\"root\",\"root\");\n\tmysql_select_db(\"pmm_dbpruebas\", $l);\n\t//mysql_select_db(\"pmm_dbweb\", $l);\n\t$s = \"SELECT CONCAT_WS(' ',nombre,paterno,materno) AS cliente, d.calle, d.poblacion, d.estado, d.pais\n\tFROM catalogocliente cc\n\tINNER JOIN direccion d ON cc.id = d.codigo\n\tWHERE d.facturacion='SI'\n\tLIMIT 0,100\";\t\n\t$r = mysql_query($s,$l) or die($s);\n\t\n\tfor($i=0;$i<count($header);$i++)\n\t\t$this->Cell($w[$i],7,$header[$i],1,0,'C');\n\t$this->Ln();\n\t//Datos\t\n\t\twhile($row = mysql_fetch_array($r)){\n\t\t\t$this->Cell($w[0],6,$row[0],'LR');\n\t\t\t$this->Cell($w[1],6,$row[1],'LR');\n\t\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');\n\t\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');\n\t\t\t$this->Ln();\n\t\t}\n\t/*foreach($data as $row)\n\t{\n\t\t$this->Cell($w[0],6,$row[0],'LR');\n\t\t$this->Cell($w[1],6,$row[1],'LR');\n\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');\n\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');\n\t\t$this->Ln();\n\t}*/\n\t//Lnea de cierre\n\t$this->Cell(array_sum($w),0,'','T');\n}", "public function sales_report_export_xls() {\n\n //Read page parameter to display report\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $sales_exec = $this->input->get('sales_exec');\n $start_date = $this->input->get('start');\n $end_date = $this->input->get('end');\n \n\n $tabledata = $this->reportsModel->get_sales_report_data_xls($tenant_id, $start_date, $end_date, $sales_exec);\n $this->load->helper('export_helper');\n \n export_sales_report_xls($tabledata);\n }", "public function exportToExcel(){\n\t\theader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); \n\t\theader(\"Content-Disposition: attachment; filename = DataNilaiMataKuliah.xls\"); \n\t\t$data['data_nilai'] = $this->Database_Nilai->ambil_data(); \n\t\t$this->load->view('export', $data);\n\t}", "public function horometersExcel(){ \n return Excel::download(new HorometersExport, 'horometros-list-'.date('Y-m-d_H:i:s').'.xlsx');\n }", "public function report_data_college()\n{\n\n$user = $this->Muser->report_data_college();\n\n// Create new Spreadsheet object\n$spreadsheet = new Spreadsheet();\n\n//auto width cell\nforeach(range('A','I') as $columnID) {\n $spreadsheet->getActiveSheet()->getColumnDimension($columnID)\n ->setAutoSize(true);\n}\n\n// Set document properties\n$spreadsheet->getProperties()->setCreator('STMIK BANDUNG')\n->setLastModifiedBy('STMIK BANDUNG')\n->setTitle('Office 2007 XLSX Test Document')\n->setSubject('Office 2007 XLSX Test Document')\n->setDescription('Test document for Office 2007 XLSX, generated using PHP classes.')\n->setKeywords('office 2007 openxml php')\n->setCategory('result file');\n\n// Add some data\n$spreadsheet->setActiveSheetIndex(0)\n->setCellValue('A1', 'NO')\n->setCellValue('B1', 'NIM')\n->setCellValue('C1', 'NAMA')\n->setCellValue('D1', 'JURUSAN')\n->setCellValue('E1', 'ANGKATAN')\n->setCellValue('F1', 'EMAIL')\n->setCellValue('G1', 'JENIS KELAMIN')\n->setCellValue('H1', 'NO TELEPON')\n->setCellValue('I1', 'STATUS')\n\n;\n\n// Miscellaneous glyphs, UTF-8\n$i=2; $no=1; foreach($user as $data) {\n\n$spreadsheet->setActiveSheetIndex(0)\n->setCellValue('A'.$i, $no)\n->setCellValue('B'.$i, $data->nim)\n->setCellValue('C'.$i, $data->name)\n->setCellValue('D'.$i, $data->prodi)\n->setCellValue('E'.$i, $data->generation)\n->setCellValue('F'.$i, $data->email)\n->setCellValue('G'.$i, $data->gender)\n->setCellValue('H'.$i, $data->no_telp)\n->setCellValue('i'.$i, $data->status_user)\n\n;\n$i++;\n$no++;\n}\n\n\n// Rename worksheet\n$spreadsheet->getActiveSheet()->setTitle('Report Data Mahasiswa '.date('d-m-Y H'));\n\n// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n$spreadsheet->setActiveSheetIndex(0);\n\n// Redirect output to a client’s web browser (Xlsx)\nheader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\nheader('Content-Disposition: attachment;filename=\"Report Data Mahasiswa.xlsx\"');\nheader('Cache-Control: max-age=0');\n// If you're serving to IE 9, then the following may be needed\nheader('Cache-Control: max-age=1');\n\n// If you're serving to IE over SSL, then the following may be needed\nheader('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\nheader('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\nheader('Cache-Control: cache, must-revalidate'); // HTTP/1.1\nheader('Pragma: public'); // HTTP/1.0\n\n$writer = IOFactory::createWriter($spreadsheet, 'Xlsx');\n$writer->save('php://output');\nexit;\n}", "function export_finance_canceled_angsuran()\n\t{\n\t\t$angsuran_id=$this->uri->segment(3);\n\t\t$datas = $this->model_transaction->get_angsuran_canceled($angsuran_id);\n\n\t\t// Create new PHPExcel object\n\t\t$objPHPExcel = $this->phpexcel;\n\t\t// Set document properties\n\t\t$objPHPExcel->getProperties()->setCreator(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setLastModifiedBy(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setTitle(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setSubject(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setDescription(\"REPORT, generated using PHP classes.\")\n\t\t\t\t\t\t\t\t\t ->setKeywords(\"REPORT\")\n\t\t\t\t\t\t\t\t\t ->setCategory(\"Test result file\");\n\t\t\t\t\t\t\t\t\t \n\t\t$objPHPExcel->setActiveSheetIndex(0); \n\t\t\n\t\t/*\n\t\t| BORDER OPTION\n\t\t*/\n\t\t$styleArray['borders']['outline']['style']=PHPExcel_Style_Border::BORDER_THIN;\n\t\t$styleArray['borders']['outline']['color']['rgb']='000000';\n\t\t/*\n\t\t| SET COLUMN WIDTH\n\t\t*/\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(15);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(30);\n\n\t\t/*\n\t\t| ROW HEADER TITLE\n\t\t*/\n\t\t$row=1;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,\"List Angsuran Dibatalkan\");\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row)->getFont()->setBold(true);\n\t\t\n\t\t$row+=1;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,\"No. Pembiayaan\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row,\"Nama\");\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':B'.$row)->getFont()->setBold(true);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':A'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B'.$row.':B'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':B'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t$row+=1;\n\t\t/*\n\t\t| ROW DATA\n\t\t*/\n\t\tfor($i=0;$i<count($datas);$i++){\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,$datas[$i]['account_financing_no']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row,$datas[$i]['nama']);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':B'.$row)->getFont()->setSize(11);\n\t\t\t$row++;\n\t\t}\n\n\t\theader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n\t\theader('Content-Disposition: attachment;filename=\"ANGSURAN DIBATALKAN.xlsx\"');\n\t\theader('Cache-Control: max-age=0');\n\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->save('php://output');\n\t}", "public function export()\n\t{\n\t\tinclude APPPATH . 'third_party/PHPExcel/PHPExcel.php';\n\n\t\t// Panggil class PHPExcel nya\n\t\t$excel = new PHPExcel();\n\n\t\t// Settingan awal fil excel\n\t\t$excel->getProperties()->setCreator('PT Pelindo')\n\t\t\t->setLastModifiedBy('PT Pelindo')\n\t\t\t->setTitle(\"Rekap Rapor Akhlak\")\n\t\t\t->setSubject(\"Rekap Rapor Akhlak\")\n\t\t\t->setDescription(\"Rekap Rapor Akhlak\")\n\t\t\t->setKeywords(\"Rekap Rapor Akhlak\");\n\n\t\t// Buat sebuah variabel untuk menampung pengaturan style dari header tabel\n\t\t$style_col = array(\n\t\t\t'font' => array('bold' => true), // Set font nya jadi bold\n\t\t\t'alignment' => array(\n\t\t\t\t'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)\n\t\t\t\t'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)\n\t\t\t),\n\t\t\t'borders' => array(\n\t\t\t\t'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis\n\t\t\t\t'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis\n\t\t\t\t'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis\n\t\t\t\t'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis\n\t\t\t)\n\t\t);\n\n\t\t// Buat sebuah variabel untuk menampung pengaturan style dari isi tabel\n\t\t$style_row = array(\n\t\t\t'alignment' => array(\n\t\t\t\t'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)\n\t\t\t),\n\t\t\t'borders' => array(\n\t\t\t\t'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis\n\t\t\t\t'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis\n\t\t\t\t'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis\n\t\t\t\t'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis\n\t\t\t)\n\t\t);\n\n\t\t$excel->setActiveSheetIndex(0)->setCellValue('A1', \"Rekap Rapor Akhlak\"); // Set kolom A1 dengan tulisan \"Rekap Rapor Akhlak\"\n\t\t$excel->getActiveSheet()->mergeCells('A1:J1'); // Set Merge Cell pada kolom A1 sampai E1\n\t\t$excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1\n\t\t$excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1\n\t\t$excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1\n\n\t\t// Buat header tabel nya pada baris ke 3\n\t\t$excel->setActiveSheetIndex(0)->setCellValue('A3', \"NO\"); // Set kolom A3 dengan tulisan \"NO\"\n\t\t$excel->setActiveSheetIndex(0)->setCellValue('B3', \"NAMA CABANG\"); // Set kolom B3 dengan tulisan \"NIS\"\n\t\t$excel->setActiveSheetIndex(0)->setCellValue('C3', \"NILAI AMANAH\"); // Set kolom C3 dengan tulisan \"NAMA\"\n\t\t$excel->setActiveSheetIndex(0)->setCellValue('D3', \"NILAI KOMPETEN\"); // Set kolom D3 dengan tulisan \"JENIS KELAMIN\"\n\t\t$excel->setActiveSheetIndex(0)->setCellValue('E3', \"NILAI HARMONIS\"); // Set kolom E3 dengan tulisan \"ALAMAT\"\n\t\t$excel->setActiveSheetIndex(0)->setCellValue('F3', \"NILAI LOYAL\"); // Set kolom E3 dengan tulisan \"ALAMAT\"\n\t\t$excel->setActiveSheetIndex(0)->setCellValue('G3', \"NILAI ADAPTIF\"); // Set kolom E3 dengan tulisan \"ALAMAT\"\n\t\t$excel->setActiveSheetIndex(0)->setCellValue('H3', \"NILAI KOLABORATIF\"); // Set kolom E3 dengan tulisan \"ALAMAT\"\n\t\t$excel->setActiveSheetIndex(0)->setCellValue('I3', \"NILAI TOTAL\"); // Set kolom E3 dengan tulisan \"ALAMAT\"\n\t\t$excel->setActiveSheetIndex(0)->setCellValue('J3', \"TANGGAL UPLOAD\"); // Set kolom E3 dengan tulisan \"ALAMAT\"\n\n\t\t// Apply style header yang telah kita buat tadi ke masing-masing kolom header\n\t\t$excel->getActiveSheet()->getStyle('A3')->applyFromArray($style_col);\n\t\t$excel->getActiveSheet()->getStyle('B3')->applyFromArray($style_col);\n\t\t$excel->getActiveSheet()->getStyle('C3')->applyFromArray($style_col);\n\t\t$excel->getActiveSheet()->getStyle('D3')->applyFromArray($style_col);\n\t\t$excel->getActiveSheet()->getStyle('E3')->applyFromArray($style_col);\n\t\t$excel->getActiveSheet()->getStyle('F3')->applyFromArray($style_col);\n\t\t$excel->getActiveSheet()->getStyle('G3')->applyFromArray($style_col);\n\t\t$excel->getActiveSheet()->getStyle('H3')->applyFromArray($style_col);\n\t\t$excel->getActiveSheet()->getStyle('I3')->applyFromArray($style_col);\n\t\t$excel->getActiveSheet()->getStyle('J3')->applyFromArray($style_col);\n\n\t\t// Panggil function view yang ada di SiswaModel untuk menampilkan semua data siswanya\n\t\t$siswa = $this->RaporModel->view();\n\n\t\t$no = 1; // Untuk penomoran tabel, di awal set dengan 1\n\t\t$numrow = 4; // Set baris pertama untuk isi tabel adalah baris ke 4\n\t\tforeach ($siswa as $data) { // Lakukan looping pada variabel siswa\n\t\t\t$excel->setActiveSheetIndex(0)->setCellValue('A' . $numrow, $no);\n\t\t\t$excel->setActiveSheetIndex(0)->setCellValue('B' . $numrow, $data->cabang);\n\t\t\t$excel->setActiveSheetIndex(0)->setCellValue('C' . $numrow, $data->nilai_amanah . '%');\n\t\t\t$excel->setActiveSheetIndex(0)->setCellValue('D' . $numrow, $data->nilai_kompeten . '%');\n\t\t\t$excel->setActiveSheetIndex(0)->setCellValue('E' . $numrow, $data->nilai_harmonis . '%');\n\t\t\t$excel->setActiveSheetIndex(0)->setCellValue('F' . $numrow, $data->nilai_loyal . '%');\n\t\t\t$excel->setActiveSheetIndex(0)->setCellValue('G' . $numrow, $data->nilai_adaptif . '%');\n\t\t\t$excel->setActiveSheetIndex(0)->setCellValue('H' . $numrow, $data->nilai_kolab . '%');\n\t\t\t$excel->setActiveSheetIndex(0)->setCellValue('I' . $numrow, $data->nilai_total . '%');\n\t\t\t$excel->setActiveSheetIndex(0)->setCellValue('J' . $numrow, $data->created_at);\n\n\t\t\t// Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)\n\t\t\t$excel->getActiveSheet()->getStyle('A' . $numrow)->applyFromArray($style_row);\n\t\t\t$excel->getActiveSheet()->getStyle('B' . $numrow)->applyFromArray($style_row);\n\t\t\t$excel->getActiveSheet()->getStyle('C' . $numrow)->applyFromArray($style_row);\n\t\t\t$excel->getActiveSheet()->getStyle('D' . $numrow)->applyFromArray($style_row);\n\t\t\t$excel->getActiveSheet()->getStyle('E' . $numrow)->applyFromArray($style_row);\n\t\t\t$excel->getActiveSheet()->getStyle('F' . $numrow)->applyFromArray($style_row);\n\t\t\t$excel->getActiveSheet()->getStyle('G' . $numrow)->applyFromArray($style_row);\n\t\t\t$excel->getActiveSheet()->getStyle('H' . $numrow)->applyFromArray($style_row);\n\t\t\t$excel->getActiveSheet()->getStyle('I' . $numrow)->applyFromArray($style_row);\n\t\t\t$excel->getActiveSheet()->getStyle('J' . $numrow)->applyFromArray($style_row);\n\n\t\t\t$no++; // Tambah 1 setiap kali looping\n\t\t\t$numrow++; // Tambah 1 setiap kali looping\n\t\t}\n\n\t\t// Set width kolom\n\t\t$excel->getActiveSheet()->getColumnDimension('A')->setWidth(2); // Set width kolom A\n\t\t$excel->getActiveSheet()->getColumnDimension('B')->setWidth(14); // Set width kolom B\n\t\t$excel->getActiveSheet()->getColumnDimension('C')->setWidth(14); // Set width kolom C\n\t\t$excel->getActiveSheet()->getColumnDimension('D')->setWidth(16); // Set width kolom D\n\t\t$excel->getActiveSheet()->getColumnDimension('E')->setWidth(16); // Set width kolom E\n\t\t$excel->getActiveSheet()->getColumnDimension('F')->setWidth(12); // Set width kolom E\n\t\t$excel->getActiveSheet()->getColumnDimension('G')->setWidth(14); // Set width kolom E\n\t\t$excel->getActiveSheet()->getColumnDimension('H')->setWidth(19); // Set width kolom E\n\t\t$excel->getActiveSheet()->getColumnDimension('I')->setWidth(12); // Set width kolom E\n\t\t$excel->getActiveSheet()->getColumnDimension('J')->setWidth(19); // Set width kolom E\n\n\t\t// Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)\n\t\t$excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);\n\n\t\t// Set orientasi kertas jadi LANDSCAPE\n\t\t$excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);\n\n\t\t// Set judul file excel nya\n\t\t$excel->getActiveSheet(0)->setTitle(\"Rekap Rapor Akhlak\");\n\t\t$excel->setActiveSheetIndex(0);\n\n\t\t// Proses file excel\n\t\theader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n\t\theader('Content-Disposition: attachment; filename=\"Rekap Rapor Akhlak.xlsx\"'); // Set nama file excel nya\n\t\theader('Cache-Control: max-age=0');\n\n\t\t$write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');\n\t\t$write->save('php://output');\n\t}", "public function export_excel2()\n\t{\n\t\t$this->load->library('phpexcel');\n\t\t$this->load->view('admin/function/xls_format');\n\t}", "public function export_excel(){\n // Load plugin PHPExcel nya\n include APPPATH.'third_party/PHPExcel/PHPExcel.php';\n \n // Panggil class PHPExcel nya\n $excel = new PHPExcel();\n // Settingan awal fil excel\n $excel->getProperties()->setCreator('SIMITA')\n ->setLastModifiedBy('SIMITA')\n ->setTitle(\"Data Koneksi Internet\")\n ->setSubject(\"Koneksi Internet\")\n ->setDescription(\"Laporan Data Koneksi Internet\")\n ->setKeywords(\"Laporan\");\n // Buat sebuah variabel untuk menampung pengaturan style dari header tabel\n $style_col = array(\n 'font' => array('bold' => true), // Set font nya jadi bold\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)\n 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)\n ),\n 'borders' => array(\n 'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis\n 'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis\n 'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis\n 'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis\n )\n );\n // Buat sebuah variabel untuk menampung pengaturan style dari isi tabel\n $style_row = array(\n 'alignment' => array(\n 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)\n ),\n 'borders' => array(\n 'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis\n 'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis\n 'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis\n 'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis\n )\n );\n $excel->setActiveSheetIndex(0)->setCellValue('A1', \"LAPORAN DATA INVENTORY INTERNET CABANG\"); // Set kolom A1 dengan tulisan \"DATA SISWA\"\n $excel->getActiveSheet()->mergeCells('A1:G1'); // Set Merge Cell pada kolom A1 sampai E1\n $excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1\n $excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1\n $excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1\n // Buat header tabel nya pada baris ke 3\n $excel->setActiveSheetIndex(0)->setCellValue('A3', \"NO\"); // Set kolom A3 \n $excel->setActiveSheetIndex(0)->setCellValue('B3', \"CABANG\"); // Set kolom B3 \n $excel->setActiveSheetIndex(0)->setCellValue('C3', \"PROVIDER\"); // Set kolom C3 \n $excel->setActiveSheetIndex(0)->setCellValue('D3', \"NO.PELANGGAN\"); // Set kolom D3 \n $excel->setActiveSheetIndex(0)->setCellValue('E3', \"IP PUBLIC\"); // Set kolom E3 \n $excel->setActiveSheetIndex(0)->setCellValue('F3', \"Tgl. Kontrak\");\n $excel->setActiveSheetIndex(0)->setCellValue('G3', \"Tgl. Habis Kontrak\");\n // Apply style header yang telah kita buat tadi ke masing-masing kolom header\n $excel->getActiveSheet()->getStyle('A3')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('B3')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('C3')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('D3')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('E3')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('F3')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('G3')->applyFromArray($style_col);\n $internet = $this->m_internet->semua()->result();\n $no = 1; // Untuk penomoran tabel, di awal set dengan 1\n $numrow = 4; // Set baris pertama untuk isi tabel adalah baris ke 4\n foreach($internet as $data){ // Lakukan looping pada variabel\n $excel->setActiveSheetIndex(0)->setCellValue('A'.$numrow, $no);\n $excel->setActiveSheetIndex(0)->setCellValue('B'.$numrow, $data->nama_cabang);\n $excel->setActiveSheetIndex(0)->setCellValue('C'.$numrow, $data->nama_provider);\n $excel->setActiveSheetIndex(0)->setCellValue('D'.$numrow, $data->nomor_pelanggan);\n $excel->setActiveSheetIndex(0)->setCellValue('E'.$numrow, $data->ip_public);\n $excel->setActiveSheetIndex(0)->setCellValue('F'.$numrow, $data->tanggal_kontrak);\n $excel->setActiveSheetIndex(0)->setCellValue('G'.$numrow, $data->masa_kontrak);\n \n // Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)\n $excel->getActiveSheet()->getStyle('A'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('B'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('C'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('D'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('E'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('F'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('G'.$numrow)->applyFromArray($style_row);\n \n $no++; // Tambah 1 setiap kali looping\n $numrow++; // Tambah 1 setiap kali looping\n }\n // Set width kolom\n $excel->getActiveSheet()->getColumnDimension('A')->setWidth(5); // Set width kolom A\n $excel->getActiveSheet()->getColumnDimension('B')->setWidth(30); // Set width kolom B\n $excel->getActiveSheet()->getColumnDimension('C')->setWidth(25); // Set width kolom C\n $excel->getActiveSheet()->getColumnDimension('D')->setWidth(20); // Set width kolom D\n $excel->getActiveSheet()->getColumnDimension('E')->setWidth(25); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('F')->setWidth(25);\n $excel->getActiveSheet()->getColumnDimension('G')->setWidth(25);\n \n // Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)\n $excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);\n // Set orientasi kertas jadi LANDSCAPE\n $excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);\n // Set judul file excel nya\n $excel->getActiveSheet(0)->setTitle(\"Laporan Data Siswa\");\n $excel->setActiveSheetIndex(0);\n // Proses file excel\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment; filename=\"Laporan Koneksi Internet.xlsx\"'); // Set nama file excel nya\n header('Cache-Control: max-age=0');\n $write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');\n $write->save('php://output');\n }", "function preview_file(){\n\t\t\n\t\t/** Set default timezone (will throw a notice otherwise) */\n\t\tdate_default_timezone_set('Asia/Bangkok');\n\t\t/** PHPExcel */\n\t\tinclude (\"plugins/PHPExcel/Classes/PHPExcel.php\");\n\t\t/** PHPExcel_IOFactory - Reader */\n\t\tinclude (\"plugins/PHPExcel/Classes/PHPExcel/IOFactory.php\");\n\t\t\t\n\n\t\tif(isset($_FILES['uploadfile']['name'])){\n\t\t\t$file_name = $_FILES['uploadfile']['name'];\n\t\t\t$ext = pathinfo($file_name, PATHINFO_EXTENSION);\n\t\t\t\n\t\t\t//echo \": \".$file_name; //die;\n\t\t\t//Checking the file extension (ext)\n\t\t\tif($ext == \"xlsx\" || $ext == \"xls\"){\n\t\t\t\t$Path = 'uploads/payment';\t\n\t\t\t\t$filename =$Path.'/'.$file_name;\n\t\t\t\tcopy($_FILES['uploadfile']['tmp_name'],$filename);\t\n\t\t\t\t\n\t\t\t\t$inputFileName = $filename;\n\t\t\t\t//echo $inputFileName;\n\t\t\t\t\n\t\t\t/**********************PHPExcel Script to Read Excel File**********************/\n\t\t\t\t// Read your Excel workbook\n\t\t\t\ttry {\n\t\t\t\t\t//echo \"try\".$inputFileName;\n\t\t\t\t\t$inputFileType = PHPExcel_IOFactory::identify($inputFileName); //Identify the file\n\t\t\t\t\t$objReader = PHPExcel_IOFactory::createReader($inputFileType); \n\t\t\t\t\t$objReader->setReadDataOnly(true);\n\t\t\t\t\t//Creating the reader\n\t\t\t\t\t$objPHPExcel = $objReader->load($inputFileName); //Loading the file\n\t\t\t\t\t//echo \"จบ try นะ\";\n\t\t\t\t\t\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\techo \"<pre>\";\n\t\t\t\t\tprint_r($e);\n\t\t\t\t\techo \"</pre>\";\n\t\t\t\t\tdie('Error loading file \"' . pathinfo($inputFileName, PATHINFO_BASENAME) \n\t\t\t\t\t. '\": ' . $e->getMessage());\n\t\t\t\t}\n\n\t\t\t\t//ข้อมูลนำเข้า\n\t\t\t\t$this->data[\"im_exam\"] = $this->input->post(\"im_exam\");\t \t\t//ประเภทการสอบ\n\t\t\t\t$this->data[\"im_edu_bgy\"] = $this->input->post(\"im_edu_bgy\");\t \t//ปีการศึกษา\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t/* start ROW && COLUMN */\n\t\t\t\t$sheet_active = 0;\n\t\t\t\t$start_row = 2;\n\t\t\t\t$start_col = 'A';\t\n\t\t\t\t\n\t\t\t\t// Get worksheet dimensions\n\t\t\t\t$sheet = $objPHPExcel->getSheet($sheet_active); //Selecting sheet 0\t\t\t\t\n\t\t\t\t$highestRow = $sheet->getHighestRow(); \t\t//Getting number of rows\n\t\t\t\t$highestColumn = $sheet->getHighestColumn(); //Getting number of columns\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$arr_data = array(); // per project 1 row\n\t\t\t\t\n\t\t\t\tfor ($row = $start_row; $row <= $highestRow; $row++) {\t\t\n\t\t\t\t\t//******** column A-H :: expend project *********//\n\t\t\t\t\t$column_key = $sheet->rangeToArray($start_col.$row.\":\".$highestColumn.$row, NULL, TRUE, FALSE);\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($column_key)){\n\t\t\t\t\tforeach($column_key as $row_col){\n\t\t\t\t\t\t/***************** start expend **********************/\n\t\t\t\t\t\tif(!empty($row_col)){\n\t\t\t\t\t\t\t$pay_status\t\t= 2; \t//สถานะการชำระเงิน\n\t\t\t\t\t\t\t$pay_bill_no\t= \"\";\t//ref billNo\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$pay_date \t\t= \"0000-00-00\";\t\n\t\t\t\t\t\t\t$pay_amount\t\t= 0.00; //จำนวนเงินที่ชำระ\n\t\t\t\t\t\t\t$pay_receiver = \"\"; \t//ผู้รับชำระเงิน\n\t\t\t\t\t\t\t$pay_creator \t= \"\"; //ผู้บันทึก ต้องมาจาก login\n\t\t\t\t\t\tforeach($row_col as $key_col => $val_col){\n\t\t\t\t\t\t\t// แปลง index column เป็น name column\n\t\t\t\t\t\t\t$colIndex = PHPExcel_Cell::stringFromColumnIndex($key_col);\n\t\t\t\t\t\t\t//echo \"<br/>\".$key_col.\":\".$colIndex;\n\t\t\t\t\t\t\t$val_column = \"\";\n\t\t\t\t\t\t\tif($colIndex == \"C\"){ //วันที่จ่าย\n\t\t\t\t\t\t\t\t$val_date = date('d/m/Y', PHPExcel_Shared_Date::ExcelToPHP($sheet->getCell($colIndex.$row)->getValue()));\n\t\t\t\t\t\t\t\t$val_column = $val_date;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$val_column = $sheet->getCell($colIndex.$row)->getValue();\n\t\t\t\t\t\t\t\tif(empty($val_column) || $val_column == \"\"){\n\t\t\t\t\t\t\t\t\t$val_column = $val_col;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//echo \"col:\".$colIndex.\" : \".$val_column.\"<br/>\";\n\t\t\t\t\t\t\t\t//echo \"==> \".$val_col.\"===> \".$val_column;\n\t\t\t\t\t\t\tif(!empty($val_column)){\n\t\t\t\t\t\t\t\tif($colIndex == \"B\") $pay_bill_no \t= $val_column;\n\t\t\t\t\t\t\t\tif($colIndex == \"C\") $pay_date \t\t= $val_column;\n\t\t\t\t\t\t\t\tif($colIndex == \"D\") $pay_amount \t= $this->remove_comma($val_column);\n\t\t\t\t\t\t\t\tif($colIndex == \"E\") $pay_receiver \t= $val_column;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}//end each row_col\n\t\t\t\t\t\t\n\t\t\t\t\t\t}//end each num_rows row_col\n\t\t\t\t\t\t/***************** end expend **********************/\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}//end each column_key\n\t\t\t\t\t}//end each !empty column_key\n\t\t\t\t\t//if(file_exist($this->config->item(\"pbms_upload_dir\").$file_name)) {\n\t\t\t\t\t\t//echo $this->config->item(\"pbms_upload_dir\").$file_name;\n\t\t\t\t\t\t//unlink($this->config->item(\"pbms_upload_dir\").$file_name);\n\t\t\t\t\t//}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//splitDateFormTH($pay_date)\n\t\t\t\t\tarray_push($arr_data,array(\n\t\t\t\t\t\t\t\t\"arr_bill_no\" => $pay_bill_no,\n\t\t\t\t\t\t\t\t\"arr_date\" => $pay_date,\n\t\t\t\t\t\t\t\t\"arr_amount\" => $pay_amount,\n\t\t\t\t\t\t\t\t\"arr_receiver\" => $pay_receiver\n\t\t\t\t\t));\n\t\t\t\t}//end each row\n\t\t\t\t$this->data[\"section_txt\"] = \"ข้อมูลการชำระเงิน\";\t\n\t\t\t\t$this->data[\"rs_data\"] = $arr_data;\t\n\t\t\t\t$this->output(\"Payment/v_import_preview\", $this->data);\n\t\t\t\t\n\t\t\t}//end Checking file\n\t\t}//end isset file\n\t\t\n\t}", "public function index()\n {\n //\n $data=MExcel::orderBy('created_at','desc')->paginate(5);\n return view('admin.excelsheet.index',compact('data'));\n }", "public function report_data_user($kode_role)\n{\nif($kode_role != 'ALL'){\n$user = $this->Muser->report_data_userbyrole($kode_role);\n}else{\n$user = $this->Muser->report_data_user();\n}\n// Create new Spreadsheet object\n$spreadsheet = new Spreadsheet();\n\n//auto width cell\nforeach(range('A','H') as $columnID) {\n $spreadsheet->getActiveSheet()->getColumnDimension($columnID)\n ->setAutoSize(true);\n}\n\n// Set document properties\n$spreadsheet->getProperties()->setCreator('STMIK BANDUNG')\n->setLastModifiedBy('STMIK BANDUNG')\n->setTitle('Office 2007 XLSX Test Document')\n->setSubject('Office 2007 XLSX Test Document')\n->setDescription('Test document for Office 2007 XLSX, generated using PHP classes.')\n->setKeywords('office 2007 openxml php')\n->setCategory('result file');\n\n// Add some data\n$spreadsheet->setActiveSheetIndex(0)\n->setCellValue('A1', 'NO')\n->setCellValue('B1', 'NIDN')\n->setCellValue('C1', 'NAMA')\n->setCellValue('D1', 'EMAIL')\n->setCellValue('E1', 'PRODI')\n->setCellValue('F1', 'NO TELEPON')\n->setCellValue('G1', 'JENIS KELAMIN')\n->setCellValue('H1', 'HAK AKSES')\n\n;\n\n// Miscellaneous glyphs, UTF-8\n$i=2; $no=1; foreach($user as $data) {\n\n$spreadsheet->setActiveSheetIndex(0)\n->setCellValue('A'.$i, $no)\n->setCellValue('B'.$i, $data->nidn)\n->setCellValue('C'.$i, $data->name)\n->setCellValue('D'.$i, $data->email)\n->setCellValue('E'.$i, $data->prodi)\n->setCellValue('F'.$i, $data->no_telp)\n->setCellValue('G'.$i, $data->gender)\n->setCellValue('H'.$i, $data->role)\n\n;\n$i++;\n$no++;\n}\n\n\n// Rename worksheet\n$spreadsheet->getActiveSheet()->setTitle('Report Data User '.date('d-m-Y H'));\n\n// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n$spreadsheet->setActiveSheetIndex(0);\n\n// Redirect output to a client’s web browser (Xlsx)\nheader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\nheader('Content-Disposition: attachment;filename=\"Report Data User.xlsx\"');\nheader('Cache-Control: max-age=0');\n// If you're serving to IE 9, then the following may be needed\nheader('Cache-Control: max-age=1');\n\n// If you're serving to IE over SSL, then the following may be needed\nheader('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\nheader('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\nheader('Cache-Control: cache, must-revalidate'); // HTTP/1.1\nheader('Pragma: public'); // HTTP/1.0\n\n$writer = IOFactory::createWriter($spreadsheet, 'Xlsx');\n$writer->save('php://output');\nexit;\n}", "public static function showData() {\n\n\t\tforeach(self::$employee_array as $id => $employee) { // Pour chaque ligne on affiche chaque attribut correspondant au colonne du tableau\n\n\t\t\tif($employee->_entityShortName == null) // Gestion du cas où une entité a été supprimée mais pas l'employé de l'entité\n\t\t\t\techo \"<tr><td>null</td><td>\" . $employee->_lastName . \"</td><td>\" . $employee->_firstName . \"</td><td>\" . $employee->_login . \"</td><td><a href=\\\"user.php?action=modifier&id=\" . $employee->_id . \"\\\">modifier</a></td><td><a href=\\\"user.php?action=supprimer&id=\" . $id . \"\\\">supprimer</a></td></tr>\";\n\t\t\telse\n\t\t\t\techo \"<tr><td>\" . $employee->_entityShortName . \"</td><td>\" . $employee->_lastName . \"</td><td>\" . $employee->_firstName . \"</td><td>\" . $employee->_login . \"</td><td><a href=\\\"user.php?action=modifier&id=\" . $employee->_id . \"\\\">modifier</a></td><td><a href=\\\"user.php?action=supprimer&id=\" . $id . \"\\\">supprimer</a></td></tr>\";\n\t\t}\n\t}", "public function exportExcel() \n {\n $st = ST::select(\n 'no_st',\n 'tanggal_st',\n 'tujuan_st',\n 'tipe', \n 'bidang',\n 'uraian',\n \n 'tanggal_mulai',\n 'tanggal_selesai',\n 'hp',\n 'no_laporan',\n 'tanggal_laporan',\n\n 'penanggung_jawab_id',\n 'pengendali_mutu_id',\n 'pengendali_teknis_id',\n 'ketua_tim_id', \n \n 'lokasi', \n 'biaya',\n 'km_id',\n 'costsheet_id'\n \n )->get();\n\n \n\n return Excel::create('data_tugas', function($excel) use ($st){\n $excel->sheet('st_bpkp', function($sheet) use ($st) {\n $sheet->fromArray($st);\n });\n })->download('xls');\n\n }", "function outputFormat(array $headers, array $cells, $result, $content_name) {\necho '<h3>'.ucfirst($content_name).' Content</h3>';\necho '<table>';\nforeach ($headers as $val) {\necho '<th>'.$val.'</th>';\n}\nwhile($row = mysqli_fetch_array($result))\n {\n echo '<tr>';\n foreach ($cells as $val) {\n echo '<td>'.$row[$val].'</td>';\n }\n echo '</tr>';\n }\n echo '</table>';\n}", "public function excel($form=''){\n $this->load->model('Report');\n $this->Report->downloadexcel($form);\n }", "function hotels_tops(){\r\n $periode = $this->input->post('periode_Report');\r\n $getDate = explode(\" - \", $periode);\r\n $from_date = $getDate[0];\r\n $to_date = $getDate[1];\r\n $reportBy = $this->input->post('ReportBy');\r\n $hotel = $this->input->post('list_hotels');\r\n $hotels = '' ;\r\n \r\n if(!empty($hotel)){\r\n $hotels = $hotel ;\r\n }\r\n $reportHotels['hotels'] = $this->report_model->hotel_top($from_date, $to_date, $this->config->item('not_agents','agents'), $hotels);\r\n $reportHotels['hotels']['detail-agent'] = $this->report_model->HotelsBookingAgent($from_date, $to_date, $hotels, $this->config->item('not_agents','agents'));\r\n \r\n //echo $this->db->last_query();\r\n //echo '<pre>',print_r($reportHotels['hotels']);die();\r\n \r\n $this->excel->setActiveSheetIndex(0);\r\n\r\n //name the worksheet\r\n $this->excel->getActiveSheet()->setTitle($reportBy.' perfomance');\r\n\r\n $styleArray = array(\r\n 'borders' => array(\r\n 'allborders' => array(\r\n 'style' => PHPExcel_Style_Border::BORDER_THIN\r\n )\r\n )\r\n );\r\n\r\n $this->excel->getActiveSheet()->setCellValue('A1', $reportBy.'perfomance');\r\n $this->excel->getActiveSheet()->getStyle(\"A1\")->getFont()->setSize(20);\r\n \r\n \r\n \r\n $this->excel->getActiveSheet()->setCellValue('A3', 'Start Date History : '.$from_date);\r\n //$this->excel->getActiveSheet()->getStyle(\"A3\")->getFont()->setSize(12);\r\n $this->excel->getActiveSheet()->mergeCells('A3:C3');\r\n $this->excel->getActiveSheet()->getStyle('A3:C3')->getFont()->setBold(true);\r\n \r\n $this->excel->getActiveSheet()->setCellValue('A4', 'End Date History : '.$to_date);\r\n //$this->excel->getActiveSheet()->getStyle(\"A4\")->getFont()->setSize(12);\r\n $this->excel->getActiveSheet()->mergeCells('A4:C4');\r\n $this->excel->getActiveSheet()->getStyle('A4:C4')->getFont()->setBold(true);\r\n \r\n $this->excel->getActiveSheet()->setCellValue('A5', 'Hotel : '.$reportHotels['hotels'][0]['hotel']);\r\n //$this->excel->getActiveSheet()->getStyle(\"A3\")->getFont()->setSize(12);\r\n $this->excel->getActiveSheet()->mergeCells('A5:C5');\r\n $this->excel->getActiveSheet()->getStyle('A5:C5')->getFont()->setBold(true);\r\n \r\n $this->excel->getActiveSheet()->setCellValue('A6', 'City : '.$reportHotels['hotels'][0]['city']);\r\n //$this->excel->getActiveSheet()->getStyle(\"A4\")->getFont()->setSize(12);\r\n $this->excel->getActiveSheet()->mergeCells('A6:C6');\r\n $this->excel->getActiveSheet()->getStyle('A6:C6')->getFont()->setBold(true);\r\n \r\n $this->excel->getActiveSheet()->setCellValue('A7', 'Country : '.$reportHotels['hotels'][0]['country']);\r\n //$this->excel->getActiveSheet()->getStyle(\"A4\")->getFont()->setSize(12);\r\n $this->excel->getActiveSheet()->mergeCells('A7:C7');\r\n $this->excel->getActiveSheet()->getStyle('A7:C7')->getFont()->setBold(true);\r\n \r\n //set cell A1 content with some text\r\n $arrField = array('No', 'MG User ID', 'Agent Code', 'Agent Name', 'Check In', 'Check Out', 'Room', 'Night', 'Room Night', 'Point Promo', 'Jumlah Point') ;\r\n \r\n \r\n $arrCellsTitle = $this->excel->setValueHorizontal($arrField, 9, 65); //array field, nomer cells, abjad cells (start 65 = A, end 90 = Z)\r\n \r\n $i = 0;\r\n foreach($arrCellsTitle as $cells){\r\n $this->excel->getActiveSheet()->setCellValue($cells, $arrField[$i]);\r\n $i++;\r\n }\r\n \r\n //freeze row title\r\n $this->excel->getActiveSheet()->freezePane('A10');\r\n \r\n \r\n $no=1;\r\n $startNum = 10;\r\n //$startDetail = 8 ;\r\n //$startDetailUser = 11 ;\r\n foreach($reportHotels['hotels']['detail-agent'] as $row){\r\n $arrItem = array($no, $row['mg_user_id'],$row['kode_agent'], $row['AgentName'], $row['fromdate'], $row['todate'], $row['room'], $row['night'], $row['roomnight'], $row['point'],$row['point_promo']);\r\n $arrCellsItem = $this->excel->setValueHorizontal($arrItem, $startNum, 65); //array field, nomer cells, abjad cells (start 65 = A, end 90 = Z)\r\n \r\n $index = 0;\r\n foreach($arrCellsItem as $cellsItem){\r\n \r\n $this->excel->getActiveSheet()->setCellValue($cellsItem, $arrItem[$index]);\r\n $index++;\r\n \r\n // make border\r\n $this->excel->getActiveSheet()->getStyle($cellsItem)->applyFromArray($styleArray);\r\n $this->excel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1); \r\n }\r\n $startNum++;\r\n $no++;\r\n }\r\n \r\n \r\n //foreach ($reportHotels['hotels'] as $row) { \r\n // $arrItem = array($no, $row['hotel'],$row['city'], $row['country'], $row['jumlah']);\r\n // $arrCellsItem = $this->excel->setValueHorizontal($arrItem, $startNum, 65); //array field, nomer cells, abjad cells (start 65 = A, end 90 = Z)\r\n //\r\n ////make color\r\n //$this->excel->getActiveSheet()->getStyle(\"A\".$startNum.\":I\".$startNum)->applyFromArray(array(\"fill\" => array(\"type\" => PHPExcel_Style_Fill::FILL_SOLID, \"color\" => array( \"rgb\" => 'e5dcdc'))));\r\n // \r\n // $i = 0;\r\n // foreach($arrCellsItem as $cellsItem){\r\n // \r\n // $this->excel->getActiveSheet()->setCellValue($cellsItem, $arrItem[$i]);\r\n // $i++;\r\n // \r\n // // make border\r\n // $this->excel->getActiveSheet()->getStyle($cellsItem)->applyFromArray($styleArray);\r\n // $this->excel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1); \r\n // }\r\n // \r\n // $startNum = $startNum + 2;\r\n // \r\n // //set detail transaksi\r\n // /*Untuk title tulisan detail transaksi*/\r\n // $arrFieldDetails = array('List Agent') ;\r\n // \r\n // $arrCellsTitleDetails = $this->excel->setValueHorizontal($arrFieldDetails, $startDetail, 66); //array field, nomer cells, abjad cells (start 65 = A, end 90 = Z) \r\n // \r\n // $d = 0 ;\r\n // foreach($arrCellsTitleDetails as $cellsDetails){\r\n // \r\n // $this->excel->getActiveSheet()->setCellValue($cellsDetails, $arrFieldDetails[$d]);\r\n // $d++;\r\n // \r\n // // make border\r\n // $this->excel->getActiveSheet()->getStyle($cellsDetails)->applyFromArray($styleArray);\r\n // $this->excel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);\r\n // \r\n // \r\n // }\r\n // //$startDetail = $startNum + 1;\r\n // $startDetail = $startNum;\r\n // /*End Untuk title tulisan detail transaksi*/\r\n // \r\n // /*Untuk Data title detail transaksi yang ditampilkan*/\r\n // $arrFieldDetailsHeader = array('Kode Agent', 'Agent Name', 'Phone Agent', 'Hotel', 'Check Out') ;\r\n // $arrCellsTitleDetailsHeader = $this->excel->setValueHorizontal($arrFieldDetailsHeader, $startDetail, 66); //array field, nomer cells, abjad cells (start 65 = A, end 90 = Z) \r\n // $e = 0 ;\r\n // foreach($arrCellsTitleDetailsHeader as $cellsDetailsheader){\r\n // \r\n // $this->excel->getActiveSheet()->setCellValue($cellsDetailsheader, $arrFieldDetailsHeader[$e]);\r\n // \r\n // // make border\r\n // $this->excel->getActiveSheet()->getStyle($cellsDetailsheader)->applyFromArray($styleArray);\r\n // $this->excel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);\r\n // \r\n // //make the font become bold\r\n // $this->excel->getActiveSheet()->getStyle('A'.$startDetail.':I'.$startDetail)->getFont()->setBold(true);\r\n // \r\n // $e++; \r\n // }\r\n // $startDetail = $startNum + 1;\r\n // /*ENd Untuk Data title detail transaksi yang ditampilkan*/\r\n // \r\n // //Untuk loop detail transaksi user ;\r\n // \r\n // $setmulaiDetailsBooking = $startDetail;\r\n // //set isi detail booking transaksi\r\n // foreach($row['detail-agent'] as $rowsDetails){\r\n // \r\n // \r\n // $arrItemDetailsBookingTransaksi = array($rowsDetails['kode_agent'],$rowsDetails['name'],$rowsDetails['phone'],$rowsDetails['hotel'], $rowsDetails['todate']);\r\n // \r\n // $arrCellsItemDetailsBookingTransaksi = $this->excel->setValueHorizontal($arrItemDetailsBookingTransaksi, $setmulaiDetailsBooking, 66); //array field, nomer cells, abjad cells (start 65 = A, end 90 = Z)\r\n // \r\n // $a = 0;\r\n // foreach($arrCellsItemDetailsBookingTransaksi as $cellsItemDetailsBookings){\r\n // \r\n // $this->excel->getActiveSheet()->setCellValue($cellsItemDetailsBookings, $arrItemDetailsBookingTransaksi[$a]);\r\n // \r\n // \r\n // // make border\r\n // $this->excel->getActiveSheet()->getStyle($cellsItemDetailsBookings)->applyFromArray($styleArray);\r\n // $this->excel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);\r\n // \r\n // //make the font become bold\r\n // $this->excel->getActiveSheet()->getStyle('A'.$setmulaiDetailsBooking.':I'.$setmulaiDetailsBooking)->getFont()->setBold(true);\r\n // \r\n // $a++;\r\n // }\r\n // \r\n // $starttitleusers = $setmulaiDetailsBooking + 1;\r\n // \r\n // /*Untuk Data title detail transaksi yang ditampilkan*/\r\n // $arrFieldUserHeader = array('MG User ID', 'Name', 'Email', 'Room ', 'Night', 'Room Night', 'Point Promo', 'Check OUt') ;\r\n // $arrCellsTitleUserHeader = $this->excel->setValueHorizontal($arrFieldUserHeader, $starttitleusers, 66); //array field, nomer cells, abjad cells (start 65 = A, end 90 = Z) \r\n // $tus = 0 ;\r\n // foreach($arrCellsTitleUserHeader as $cellsUsersheader){\r\n // \r\n // $this->excel->getActiveSheet()->setCellValue($cellsUsersheader, $arrFieldUserHeader[$tus]);\r\n // \r\n // // make border\r\n // $this->excel->getActiveSheet()->getStyle($cellsUsersheader)->applyFromArray($styleArray);\r\n // $this->excel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);\r\n // \r\n // //make the font become bold\r\n // //$this->excel->getActiveSheet()->getStyle('A'.$starttitleusers.':I'.$starttitleusers)->getFont()->setBold(true);\r\n // \r\n // $tus++; \r\n // }\r\n // $starttitleusers = $starttitleusers;\r\n // /*ENd Untuk Data title detail transaksi yang ditampilkan*/\r\n // \r\n // \r\n // \r\n // //$starttitleusers = $setmulaiDetailsBooking + 1;\r\n // //foreach($rowsDetails['detail-user'] as $users){\r\n // // $arrItemDetailsBookingTransaksiUsers = array($users['mg_user_id'],$users['name'],$users['email'],$users['room'],$users['roomnight'],$users['point_promo']);\r\n // // $arrCellsItemDetailsBookingTransaksiUsers = $this->excel->setValueHorizontal($arrItemDetailsBookingTransaksiUsers, $startlistUser, 66); //array field, nomer cells, abjad cells (start 65 = A, end 90 = Z)\r\n // // \r\n // // $def = 0 ;\r\n // // foreach($arrCellsItemDetailsBookingTransaksiUsers as $cellsUsers){\r\n // // \r\n // // $this->excel->getActiveSheet()->setCellValue($cellsUsers, $arrItemDetailsBookingTransaksiUsers[$def]);\r\n // // \r\n // // // make border\r\n // // $this->excel->getActiveSheet()->getStyle($cellsUsers)->applyFromArray($styleArray);\r\n // // $this->excel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);\r\n // // \r\n // // //make the font become bold\r\n // // //$this->excel->getActiveSheet()->getStyle('A'.$startlistUser.':I'.$startlistUser)->getFont()->setBold(true);\r\n // // \r\n // // $def++; \r\n // // }\r\n // // \r\n // // $starttitleusers++;\r\n // //}\r\n // \r\n // $startlistUser = $starttitleusers + 1;\r\n // foreach($rowsDetails['detail-user'] as $users){\r\n // $arrItemDetailsBookingTransaksiUsers = array($users['mg_user_id'],$users['name'],$users['email'],$users['room'],$users['night'],$users['roomnight'],$users['point_promo'],$users['todate']);\r\n // $arrCellsItemDetailsBookingTransaksiUsers = $this->excel->setValueHorizontal($arrItemDetailsBookingTransaksiUsers, $startlistUser, 66); //array field, nomer cells, abjad cells (start 65 = A, end 90 = Z)\r\n // \r\n // $def = 0 ;\r\n // foreach($arrCellsItemDetailsBookingTransaksiUsers as $cellsUsers){\r\n // \r\n // $this->excel->getActiveSheet()->setCellValue($cellsUsers, $arrItemDetailsBookingTransaksiUsers[$def]);\r\n // \r\n // // make border\r\n // $this->excel->getActiveSheet()->getStyle($cellsUsers)->applyFromArray($styleArray);\r\n // $this->excel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);\r\n // \r\n // //make the font become bold\r\n // //$this->excel->getActiveSheet()->getStyle('A'.$startlistUser.':I'.$startlistUser)->getFont()->setBold(true);\r\n // \r\n // $def++; \r\n // }\r\n // \r\n // $startlistUser++;\r\n // }\r\n // \r\n // $setmulaiDetailsBooking = $startlistUser;\r\n // \r\n // \r\n // }\r\n // //End loop detail transaksi user ;\r\n // \r\n // \r\n // $startNum = ($startNum + 1 ) + count($row['detail-agent']) ;\r\n // //$startDetail = $startNum + 2 ;\r\n // //$startDetailUser = $setmulaiDetailsBooking + 1 ;\r\n // $no++;\r\n //}\r\n \r\n //make auto size \r\n for($col = 'A'; $col !== 'K'; $col++) {\r\n $this->excel->getActiveSheet()->getColumnDimension($col)->setAutoSize(true);\r\n } \r\n \r\n //make border\r\n $this->excel->getActiveSheet()->getStyle('A9:K9')->applyFromArray($styleArray);\r\n //make the font become bold\r\n $this->excel->getActiveSheet()->getStyle('A9:K9')->getFont()->setBold(true);\r\n \r\n \r\n //make color\r\n $this->excel->getActiveSheet()->getStyle(\"A9:K9\")->applyFromArray(array(\"fill\" => array(\"type\" => PHPExcel_Style_Fill::FILL_SOLID, \"color\" => array( \"rgb\" => '66CCFF'))));\r\n \r\n //change the font size\r\n //$this->excel->getActiveSheet()->getStyle()->getFont()->setSize(10);\r\n\r\n //make the font become bold\r\n $this->excel->getActiveSheet()->getStyle('A1:K1')->getFont()->setBold(true);\r\n //set row height\r\n $this->excel->getActiveSheet()->getRowDimension('1')->setRowHeight(30);\r\n\r\n //merge cell\r\n $this->excel->getActiveSheet()->mergeCells('A1:K1');\r\n\r\n //set aligment to center for that merged cell \r\n $this->excel->getActiveSheet()->getStyle('A1:K1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\r\n $this->excel->getActiveSheet()->getStyle('A1:K1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\r\n \r\n $filename = $reportBy.'-Performance'.$from_date.'-'.$to_date.'.xls'; //save our workbook as this file name\r\n header('Content-Type: application/vnd.ms-excel'); //mime type\r\n header('Content-Disposition: attachment;filename=\"'.$filename.'\"'); //tell browser what's the file name\r\n header('Cache-Control: max-age=0'); //no cache\r\n \r\n //save it to Excel5 format (excel 2003 .XLS file), change this to 'Excel2007' (and adjust the filename extension, also the header mime type)\r\n //if you want to save it as .XLSX Excel 2007 format\r\n $objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5'); \r\n //force user to download the Excel file without writing it to server's HD\r\n $objWriter->save('php://output');\r\n }", "public function get()\r\n\t{\r\n\t\t$objPHPExcel = new PHPExcel();\r\n\r\n\t\t$worksheet = $objPHPExcel->createSheet(0);\r\n\r\n\t for ($cell='A'; $cell <= 'G'; $cell++)\r\n\t {\r\n\t $worksheet->getStyle($cell.'1')->getFont()->setBold(true);\r\n\t }\r\n\r\n\t $worksheet->getStyle('A1:G1')->applyFromArray(\r\n\t \tarray(\r\n\t\t 'alignment' => array(\r\n\t\t 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,\r\n\t\t ),\r\n\t\t 'borders' => array(\r\n\t\t 'allborders' => array(\r\n\t\t 'style' => PHPExcel_Style_Border::BORDER_THIN,\r\n\t\t 'color' => array('rgb' => '000000')\r\n\t\t )\r\n\t\t ),\r\n\t\t 'fill' => array(\r\n\t\t 'type' => PHPExcel_Style_Fill::FILL_SOLID,\r\n\t\t 'color' => array('rgb' => 'F2F2F2')\r\n\t\t )\r\n\t \t)\r\n\t );\r\n\r\n\t\t// Header dokumen\r\n\t\t $worksheet->setCellValue('A1', 'NO.')\r\n\t\t \t\t ->setCellValue('B1', 'Kode MK')\r\n\t\t \t\t ->setCellValue('C1', 'Mata Kuliah')\r\n\t\t \t\t ->setCellValue('D1', 'Mata Kuliah (Asing)')\r\n\t\t \t\t ->setCellValue('E1', 'Jumlah SKS')\r\n\t\t \t\t ->setCellValue('F1', 'Semester')\r\n\t\t \t\t ->setCellValue('G1', 'Konsentrasi');\r\n\r\n\t\t$this->db->join('concentration', 'course.concentration_id = concentration.concentration_id', 'left');\r\n\t\t$row_cell = 2;\r\n\t\tforeach($this->db->get('course')->result() as $key => $value)\r\n\t\t{\r\n\t\t\t $worksheet->setCellValue('A'.$row_cell, ++$key)\r\n\t\t\t \t\t ->setCellValue('B'.$row_cell, $value->course_code)\r\n\t\t\t \t\t ->setCellValue('C'.$row_cell, $value->course_name)\r\n\t\t\t \t\t ->setCellValue('D'.$row_cell, $value->course_name_english)\r\n\t\t\t \t\t ->setCellValue('E'.$row_cell, $value->sks)\r\n\t\t\t \t\t ->setCellValue('F'.$row_cell, ucfirst($value->semester))\r\n\t\t\t \t\t ->setCellValue('G'.$row_cell, $value->concentration_name);\r\n\t\t\t$row_cell++;\r\n\t\t}\r\n\r\n\t\t// Sheet Title\r\n\t\t$worksheet->setTitle(\"DATA MATA KULIAH\");\r\n\r\n\t\t$objPHPExcel->setActiveSheetIndex(0);\r\n\r\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\r\n header(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\r\n header(\"Cache-Control: no-store, no-cache, must-revalidate\");\r\n header(\"Cache-Control: post-check=0, pre-check=0\", false);\r\n header(\"Pragma: no-cache\");\r\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\\\r\n header('Content-Disposition: attachment; filename=\"DATA-MATA-KULIAH.xlsx\"');\r\n $objWriter->save(\"php://output\");\r\n\t}", "public function visualizzazione(){\n $nameColumn = $this->getColumnName();\n $tuple = $this->read();\n foreach($nameColumn as $nome){\n $x = ' <td> '. $nome . ' </td> ';\n echo $x;\n }\n \n foreach($tuple as $ris){\n $str ='<tr> <td> '.$ris->getId(). ' </td> '.\n '<td> '.$ris->getNome(). '</td>'.\n '<td> '.$ris->getUsername(). '</td>'.\n '<td> '.$ris->getPassword(). '</td>'.\n '<td> '.$ris->getEmail(). '</td>'.\n '<td> '.$ris->getMuseo(). '</td>'.\n '</tr>';\n echo $str;\n };\n }", "public function readExcel() {\n $config['upload_path'] = \"./uploads/\";\n $config['allowed_types'] = 'xlsx|xls';\n $config['max_size'] = '25000';\n $config['file_name'] = 'BUDGET-' . date('YmdHis');\n\n $this->load->library('upload', $config);\n\n\n if ($this->upload->do_upload(\"namafile\")) {\n $data = $this->upload->data();\n $file = './uploads/' . $data['file_name'];\n\n //load the excel library\n $this->load->library('excel/phpexcel');\n //read file from path\n $objPHPExcel = PHPExcel_IOFactory::load($file);\n //get only the Cell Collection\n $cell_collection = $objPHPExcel->getActiveSheet()->getCellCollection();\n //extract to a PHP readable array format\n foreach ($cell_collection as $cell) {\n $column = $objPHPExcel->getActiveSheet()->getCell($cell)->getColumn();\n $row = $objPHPExcel->getActiveSheet()->getCell($cell)->getRow();\n $data_value = $objPHPExcel->getActiveSheet()->getCell($cell)->getValue();\n //header will/should be in row 1 only. of course this can be modified to suit your need.\n if ($row == 1) {\n $header[$row][$column] = $data_value;\n } else {\n $arr_data[$row][$column] = $data_value;\n }\n }\n // BudgetCOA, Year, BranchID, BisUnitID, DivisionID, BudgetValue, CreateDate, CreateBy, BudgetOwnID, BudgetUsed, Status, Is_trash\n $data = '';\n $flag = 1;\n $date = date('Y-m-d');\n $by = $this->session->userdata('user_id');\n\n foreach ($arr_data as $key => $value) {\n if (!empty($value[\"F\"]) && $value[\"F\"] != \"-\" && $value[\"F\"] != \"\" && !empty($value[\"A\"])) {\n $this->Budget_mdl->simpan($value[\"A\"], $value[\"B\"], $value[\"D\"], $value[\"E\"], $value[\"F\"]);\n }\n }\n\n // $this->Budget_mdl->simpanData($data);\t\n } else {\n $this->session->set_flashdata('msg', $this->upload->display_errors());\n }\n echo json_encode(TRUE);\n }", "public function DumpRenderResultsToExcel($DataArray,$PaperSize,$DateValue,$ReportsTitle){\n set_time_limit(0);\n include_once 'db_conn.php';\n include_once 'cls_codes.php';\n include_once 'cls_user.php';\n include_once 'date_time.php';\n include_once 'classes/PHPExcel.php';\n include_once 'classes/PHPExcel/IOFactory.php';\n\n //select paper size format\n if($PaperSize=='legal'){$template_file=\"accnts/awws_legal.xls\";}elseif($PaperSize=='A3'){$template_file=\"accnts/awws_a3.xls\";}\n \n //output excel files as filename will be based on reports title presented\n $file_output=\"accnts/\".$ReportsTitle.\".xls\";\n \n //declare filetype\n $FileType='Excel5';\n //initiate phpexcel algorithms and create necessary worksheets required to create reading sheets\n $objReader=PHPExcel_IOFactory::createReader($FileType);\n $objFileLoader=$objReader->load($template_file);\n //$objWrkSheet=$objFileLoader->getActiveSheet(); \n $ActiveSheet=$objFileLoader->setActiveSheetIndex(0); //workbook has only one worksheet,activate explicit\n $ActiveSheet->setCellValue(\"A1\",$ReportsTitle);\n $start_row=4;\n if(count($DataArray)==0){die();}\n foreach($DataArray as $key => $value){\n $ActiveSheet->setCellValue(\"A\".$start_row,$value['OR_date']);\n $ActiveSheet->setCellValue(\"B\".$start_row,$value['OR_num']);\n $PayeeName=cls_user_get::ProfileValue('acct_no',$value['Payee'],'applicant');\n $ActiveSheet->setCellValue(\"C\".$start_row,$PayeeName);\n $strBarangay=cls_misc::toString($value['address_brgy'],'Barangay');\n $ActiveSheet->setCellValue(\"D\".$start_row,$strBarangay);\n $ActiveSheet->setCellValue(\"E\".$start_row,$value['app_fee_partial']);\n $ActiveSheet->setCellValue(\"F\".$start_row,$value['app_fee_full']);\n $ActiveSheet->setCellValue(\"G\".$start_row,cls_misc::RemoveZerosForExcel($value['meter_fee']));\n $ActiveSheet->setCellValue(\"H\".$start_row,cls_misc::RemoveZerosForExcel($value['MLP']));\n $ActiveSheet->setCellValue(\"I\".$start_row,cls_misc::RemoveZerosForExcel($value['water_bill']));\n $ActiveSheet->setCellValue(\"J\".$start_row,cls_misc::RemoveZerosForExcel($value['penalty_fee']));\n $ActiveSheet->setCellValue(\"K\".$start_row,cls_misc::RemoveZerosForExcel($value['misc_fee']));\n $ActiveSheet->setCellValue(\"L\".$start_row,$value['total']);\n $SubTotal=$SubTotal + $value['total'];\n $start_row++;\n }\n //$start_row=$start_row +1;\n //$ActiveSheet->setCellValue(\"A\".$start_row,\"Total Collection for this Report=\".cls_misc::gFormatNumber($SubTotal));\n $ActiveSheet->getColumnDimension('A')->setAutoSize(true);\n $ActiveSheet->getColumnDimension('D')->setAutoSize(true);\n //check if file exist\n if(file_exists($file_output)){unlink($file_output);}\n //proceed to output creation\n $objWriter=PHPExcel_IOFactory::createWriter($objFileLoader,$FileType);\n $objWriter->save($file_output);\n unset($objReader);\n //create the download link for export\n cls_CollectorsReport::CreateDownloadLink($file_output);\n }", "public function import()\n\t{\n\t\tinclude APPPATH . 'third_party/PHPExcel/PHPExcel.php';\n\n\t\t$excelreader = new PHPExcel_Reader_Excel2007();\n\t\t$loadexcel = $excelreader->load('excel/' . $this->filename . '.xlsx'); // Load file yang telah diupload ke folder excel\n\t\t$sheet = $loadexcel->getActiveSheet()->toArray(null, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);\n\n\t\t// Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database\n\t\t$data = array();\n\n\t\t$numrow = 3;\n\t\t$kosong = 0;\n\t\tforeach ($sheet as $row) {\n\t\t\t// Cek $numrow apakah lebih dari 1\n\t\t\t// Artinya karena baris pertama adalah nama-nama kolom\n\t\t\t// Jadi dilewat saja, tidak usah diimport\n\t\t\tif ($numrow > 3) {\n\t\t\t\t// Kita push (add) array data ke variabel data\n\t\t\t\tarray_push($data, array(\n\t\t\t\t\t'cabang' => $row['B'],\n\t\t\t\t\t'temuan' => $row['C'],\n\t\t\t\t\t'nilai_amanah' => $row['D'],\n\t\t\t\t\t'level' => $row['E'],\n\t\t\t\t\t'tingkat' => $row['F'],\n\t\t\t\t\t'avail' => $row['G'],\n\t\t\t\t\t'util' => $row['H'],\n\t\t\t\t\t'nilai_kompeten' => $row['I'],\n\t\t\t\t\t'kaloborasi' => $row['J'],\n\t\t\t\t\t'nilai_harmonis' => $row['K'],\n\t\t\t\t\t'revenue' => $row['L'],\n\t\t\t\t\t'efisiensi' => $row['M'],\n\t\t\t\t\t'nilai_loyal' => $row['N'],\n\t\t\t\t\t'koreksi' => $row['O'],\n\t\t\t\t\t'modul' => $row['P'],\n\t\t\t\t\t'nilai_adaptif' => $row['Q'],\n\t\t\t\t\t'realisasi_kpi' => $row['R'],\n\t\t\t\t\t'realisasi_pkm' => $row['S'],\n\t\t\t\t\t'nilai_kolab' => $row['T'],\n\t\t\t\t\t'nilai_total' => $row['U'],\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$numrow++; // Tambah 1 setiap kali looping\n\t\t}\n\n\t\t// Panggil fungsi insert_multiple yg telah kita buat sebelumnya di model\n\t\t$this->RaporModel->insert_multiple($data);\n\n\t\tredirect(\"/rapor\"); // Redirect ke halaman awal (ke controller rapor fungsi index)\n\t}", "public function exceldata($cond){\n\t\t if($cond['playid']!='null'&&$cond['playid']!=''){\n\t\t\t\t$map['user_id']=$cond['playid'];\n\t\t\t}\n\t\t\tif($cond['user_phone']!='null'&&$cond['user_phone']!=''){\n\t\t\t\t$map['user_phone']=$cond['phone'];\n\t\t\t}\n\t\t\tif(!$cond['orderfile']){\n\t\t\t\t$cond['orderfile']='user_id desc';\n\t\t\t}\n\t\t\tif(!$cond['ordertype']){\n\t\t\t\t$cond['ordertype']=null;\n\t\t\t}\n $count= $this->where($map)->count();// 查询满足要求的总记录数 \n $Page= new \\Think\\Page($count,10000);// 实例化分页类 传入总记录数和每页显示的记录数(25) \n $ppp = ceil($count/10000); \n $pp = range(1,$ppp);\n $str= \"用户id,兑换游戏,兑换时间,兑换物品,联系方式\"; \n $exl11 = explode(',',$str);\n foreach ($pp as $kkk => $vvv) { \n $rs[$kkk] = $this->join('tbl_goods ON tbl_convert_good.convert_good_id = tbl_goods.good_id')->where($map)->order($cond['orderfile'].' '.$cond['ordertype'])->page($vvv.', 10000')->field('user_id,user_phone,convert_good_id,goods_name,goods_desc,data')->select();\n foreach ($rs[$kkk] as $key => $value) {\n\t\t\t\t\tif(strstr($value['convert_good_id'],\"TURNTABLE\")||strstr($value['convert_good_id'],\"CONVERT\")){\n\t\t\t\t\t\t$rs[$kkk][$key]['goods_name']=$value['goods_desc'].$value['goods_name'];\n\t\t\t\t\t\t$rs[$kkk][$key]['game_name']=$cond['gamename'];\n\t\t\t\t\t}\n\t\t\t\t}\n \n foreach ($rs[$kkk] as $k => $v){ \n if (!$v['user_id']) $v['user_id'] = '暂无数据'; \n if (!$v['game_name']) $v['game_name'] = '暂无数据'; \n if (!$v['data']) $v['data'] = '暂无数据'; \n if (!$v['goods_name']) $v['goods_name'] = '暂无数据'; \n if (!$v['user_phone']) $v['user_phone'] = '暂无数据'; \n $exl[$kkk][] = array( \n $v['user_id'],$v['game_name'],$v['data'],$v['goods_name'],$v['user_phone'] \n ); \n } \n \texportToExcel('兑换物品_'.time().$vvv.'.csv',$exl11,$exl[$kkk]); \n } \n exit();\n\t\t}", "function expense_tracker_excel()\n{\n\t\t$this->layout=\"\";\n\t\t$filename=\"Expense Tracker\";\n\t\theader (\"Expires: 0\");\n\t\theader (\"Last-Modified: \" . gmdate(\"D,d M YH:i:s\") . \" GMT\");\n\t\theader (\"Cache-Control: no-cache, must-revalidate\");\n\t\theader (\"Pragma: no-cache\");\n\t\theader (\"Content-type: application/vnd.ms-excel\");\n\t\theader (\"Content-Disposition: attachment; filename=\".$filename.\".xls\");\n\t\theader (\"Content-Description: Generated Report\" );\n\n\t\t\t$from = $this->request->query('f');\n\t\t\t$to = $this->request->query('t');\n\n\t\t\t\t$from = date(\"Y-m-d\", strtotime($from));\n\t\t\t\t$to = date(\"Y-m-d\", strtotime($to));\n\n\t\t\t$s_role_id = (int)$this->Session->read('role_id');\n\t\t\t$s_society_id = (int)$this->Session->read('society_id');\n\t\t\t$s_user_id = (int)$this->Session->read('user_id');\t\n\n\t\t$this->loadmodel('society');\n\t\t$conditions=array(\"society_id\" => $s_society_id);\n\t\t$cursor=$this->society->find('all',array('conditions'=>$conditions));\n\t\tforeach($cursor as $collection)\n\t\t{\n\t\t$society_name = $collection['society']['society_name'];\n\t\t}\n\n$excel=\"<table border='1'>\n<tr>\n<th style='text-align:center;' colspan='8'>$society_name Society</th>\n</tr>\n<tr>\n<th style='text-align:left;'>Voucher #</th>\n<th style='text-align:left;'>Posting Date</th>\n<th style='text-align:left;'>Due Date</th>\n<th style='text-align:left;'>Date of Invoice</th>\n<th style='text-align:left;'>Expense Head</th>\n<th style='text-align:left;'>Invoice Reference</th>\n<th style='text-align:left;'>Party Account Head</th>\n<th style='text-align:left;'>Amount</th>\n</tr>\";\n\t\t$total = 0;\n\t\t$this->loadmodel('expense_tracker');\n\t\t$conditions=array(\"society_id\"=>$s_society_id);\n\t\t$cursor3 = $this->expense_tracker->find('all',array('conditions'=>$conditions));\n\t\tforeach($cursor3 as $collection)\n\t\t{\n\t\t\t$receipt_id = $collection['expense_tracker']['receipt_id'];\n\t\t\t$posting_date = $collection['expense_tracker']['posting_date'];\n\t\t\t$due_date = $collection['expense_tracker']['due_date'];\n\t\t\t$invoice_date = $collection['expense_tracker']['invoice_date'];\n\t\t\t$expense_head = (int)$collection['expense_tracker']['expense_head'];\n\t\t\t$invoice_reference = $collection['expense_tracker']['invoice_reference'];\n\t\t\t$party_account_head = (int)$collection['expense_tracker']['party_head'];\n\t\t\t$amount = $collection['expense_tracker']['amount'];\n\n\t\t\t\t$result5 = $this->requestAction(array('controller' => 'hms', 'action' => 'ledger_account_fetch2'),array('pass'=>array($expense_head)));\n\t\t\t\tforeach($result5 as $collection3)\n\t\t\t\t{\n\t\t\t\t$ledger_name = $collection3['ledger_account']['ledger_name'];\n\t\t\t\t}\n\n\t\t\t\t\t$result6 = $this->requestAction(array('controller' => 'hms', 'action' => 'ledger_sub_account_fetch'),array('pass'=>array($party_account_head)));\n\t\t\t\t\tforeach($result6 as $collection4)\n\t\t\t\t\t{\n\t\t\t\t\t$party_name = $collection4['ledger_sub_account']['name'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\tif($posting_date >= $from && $posting_date <= $to)\n\t\t{\n\t\t\t$total = $total+$amount;\n$excel.=\"<tr>\n<td style='text-align:right;'>$receipt_id</td>\n<td style='text-align:left;'>$posting_date</td>\n<td style='text-align:left;'>$due_date</td>\n<td style='text-align:left;'>$invoice_date</td>\n<td style='text-align:left;'>$ledger_name</td>\n<td style='text-align:left;'>$invoice_reference</td>\n<td style='text-align:left;'>$party_name</td>\n<td style='text-align:right;'>$amount</td>\n</tr>\";\n}}\n$excel.=\"<tr>\n<th colspan='7' style='text-align:right;'>Total</th>\n<th>$total</th>\n</tr>\n</table>\";\n\t\necho $excel;\n}", "public function getActionExcel() \n {\n\n $prospects = User::join('ciudad', 'usuarios.ciudad_id', '=', 'ciudad.id') \n ->join('pais', 'usuarios.pais_id', '=', 'pais.id') \n ->orderBy('usuarios.nombre','desc') \n ->select('usuarios.nombre as nombre','usuarios.usuario as usuario', \n 'usuarios.perfil as perfil','usuarios.estado as estado','usuarios.direccion as direccion', \n 'usuarios.created_at as created_at', 'usuarios.updated_at as updated_at',\n 'ciudad.nombre as ciudad','pais.nombre as pais')->get();\n \n//dd($prospects);\n\n //$prospects = User::orderBy('nombre','desc')->get(['nombre',' usuario','perfil','estado','direccion','created_at','updated_at']);\n\n Excel::create('Lista de Usuarios ' .'-' .date('d-m-Y his'), function($excel) use($prospects)\n\n {\n $excel->sheet('Lista_Usuarios', function($sheet) use($prospects)\n { \n $data=[];\n\n array_push($data, array('Nombre','Usuario','Perfil','Estado','Dirección','Pais','Ciuadad','Ingresado','Actualizado'));\n\n foreach($prospects as $key => $value)\n {\n array_push($data, array($value->nombre,$value->usuario,$value->perfil,$value->estado,$value->direccion,$value->pais,$value->ciudad,Utils::date_en_to_es($value->created_at), Utils::datetime_en_to_es($value->updated_at)));\n\n }\n\n $sheet->fromArray($data, null, 'A1', false, false);\n\n\n // $sheet->protectCells('A1:G1', $password);\n $sheet->setPageMargin(array( 2.25, 2.30, 2.25, 2.30 ));\n $sheet->setAutoSize(true);\n //Autofiltro\n $sheet->setAutoFilter();\n //inmovilizar los titulos\n $sheet->freezeFirstRow();\n // Pinta color Titulos rango \n $sheet->row(1, function($row) \n {\n $row->setBackground('#228B22');\n });\n // Manipula celdas\n $sheet->cells('A1:I1', function($cells) \n {\n $cells->setAlignment('center');\n $cells->setFont(array(\n 'family' => 'Calibri',\n 'size' => '12',\n 'bold' => true\n ));\n\n\n });\n\n\n\n });\n })->download('xlsx');\n\n\n\n\n }", "public function index()\n\t{\n\t\t//\n return Excel::create('Mastersheet BQu version', function($excel) {\n\n $excel->sheet('Marks-Input Sheet', function($sheet) {\n\n $sheet->loadView('export.input_sheet')\n ->with('student_module_marks_input',StudentModuleMarksInput::all()->reverse())\n ->with('module_element',ModuleElement::all())\n ->with('modules',Module::all())\n ->with('courses',ApplicationCourse::all())\n ->with('users',User::all());\n\n });\n $excel->setcreator('BQu');\n $excel->setlastModifiedBy('BQu');\n $excel->setcompany('BQuServices(PVT)LTD');\n $excel->setmanager('Rajitha');\n\n })->download('xls');\n\t}", "function print_organos_colegiados()\n {\n $organos_colegiados = $this->OrganoColegiado_model->reporte_organos_colegiados();\n\n $this->load->library('excel');\n\n $object = new PHPExcel();\n $object->setActiveSheetIndex(0);\n \n //ENCABEZADOS\n $table_columns = array(\"Órgano Colegiado\", \"Comités\", \"Sesiones\", \"Acuerdos\", \"Concluidos\", \"Proceso\", \"Cancelado\", \"Sesiones sin asuntos SAF\");\n $blueBold = array(\n\t\t \"font\" => array(\n\t\t \"bold\" => true,\n\t\t \"color\" => array(\"rgb\" => \"000000\"),\n\t\t ),\n\t\t 'fill' => array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'color' => array('rgb' => 'CCCCCC')\n ),\n );\n $backRed = array(\n\t\t 'fill' => array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'color' => array('rgb' => 'ff4d4d')\n ),\n );\n $backGreen = array(\n\t\t 'fill' => array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'color' => array('rgb' => '9fff80')\n ),\n );\n $backBlue = array(\n\t\t 'fill' => array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'color' => array('rgb' => '80ccff')\n ),\n\t\t);\n\t\t$column = 0;\n\t\tforeach ($table_columns as $field) {\n $object->getActiveSheet()->setCellValueByColumnAndRow($column, 1, $field);\n\t\t\t$column++;\n\t\t}\n $object->getActiveSheet()->getStyle('A1:H1')->applyFromArray($blueBold);\n //END ENCABEZADOS\n\n //CONTENIDO\n $sumaCuentaComites = 0;\n $sumaCuentaSesiones = 0;\n $sumaCuentaAcuerdos = 0;\n $sumaCuentaConcluido = 0;\n $sumaCuentaProceso = 0;\n $sumaCuentaCancelado = 0;\n $sumaCuentaSinAcuerdos = 0;\n \n\t\t$excel_row = 2;\n\t\t$count = 1;\n\n\t\tforeach ($organos_colegiados as $row) {\n $object->getActiveSheet()->setCellValueByColumnAndRow(0, $excel_row, $row['nombreOC']);\n $object->getActiveSheet()->setCellValueByColumnAndRow(1, $excel_row, $row['cuentaComites']);\n $object->getActiveSheet()->setCellValueByColumnAndRow(2, $excel_row, $row['cuentaSesiones']);\n $object->getActiveSheet()->setCellValueByColumnAndRow(3, $excel_row, $row['cuentaAcuerdos']);\n $object->getActiveSheet()->setCellValueByColumnAndRow(4, $excel_row, $row['cuentaConcluido']);\n $object->getActiveSheet()->setCellValueByColumnAndRow(5, $excel_row, $row['cuentaProceso']);\n $object->getActiveSheet()->setCellValueByColumnAndRow(6, $excel_row, $row['cuentaCancelado']);\n $object->getActiveSheet()->setCellValueByColumnAndRow(7, $excel_row, $row['cuentaSinAcuerdos']);\n\n $sumaCuentaComites += $row['cuentaComites'];\n $sumaCuentaSesiones += $row['cuentaSesiones'];\n $sumaCuentaAcuerdos += $row['cuentaAcuerdos'];\n $sumaCuentaConcluido += $row['cuentaConcluido'];\n $sumaCuentaProceso += $row['cuentaProceso'];\n $sumaCuentaCancelado += $row['cuentaCancelado'];\n $sumaCuentaSinAcuerdos += $row['cuentaSinAcuerdos'];\n\n $excel_row++;\n $count++;\n\n\t\t}\n //END CONTENIDO\n\n //TOTALES\n $rowTotales = $excel_row++;\n $object->getActiveSheet()->setCellValueByColumnAndRow(0, $rowTotales, \"Totales:\");\n $object->getActiveSheet()->setCellValueByColumnAndRow(1, $rowTotales, $sumaCuentaComites);\n $object->getActiveSheet()->setCellValueByColumnAndRow(2, $rowTotales, $sumaCuentaSesiones);\n $object->getActiveSheet()->setCellValueByColumnAndRow(3, $rowTotales, $sumaCuentaAcuerdos);\n $object->getActiveSheet()->setCellValueByColumnAndRow(4, $rowTotales, $sumaCuentaConcluido);\n $object->getActiveSheet()->setCellValueByColumnAndRow(5, $rowTotales, $sumaCuentaProceso);\n $object->getActiveSheet()->setCellValueByColumnAndRow(6, $rowTotales, $sumaCuentaCancelado);\n $object->getActiveSheet()->setCellValueByColumnAndRow(7, $rowTotales, $sumaCuentaSinAcuerdos);\n\n //END TOTALES\n\n //GRAFICA\n\n //END GRAFICA\n\n //Ejecución del Excel\n $objWriter = PHPExcel_IOFactory::createWriter($object, 'Excel5');\n $objWriter->setIncludeCharts(true);\n\n\t\t$filename=\"Reporte_Organos_Colegiados.xls\"; //save our workbook as this file name\n\t\theader('Content-Type: application/vnd.ms-excel'); //mime type\n\t\theader('Content-Disposition: attachment;filename=\"'.$filename.'\"'); //tell browser what's the file name\n\t\theader('Cache-Control: max-age=0'); //no cache\n\n\t\t//save it to Excel5 format (excel 2003 .XLS file), change this to 'Excel2007' (and adjust the filename extension, also the header mime type)\n\t\t//if you want to save it as .XLSX Excel 2007 format\n\t\t//force user to download the Excel file without writing it to server's HD\n\t\t$objWriter->save('php://output');\n }", "function exportexcel($data,$title,$filename){\n header(\"Content-type:application/octet-stream\");\n header(\"Accept-Ranges:bytes\");\n header(\"Content-type:application/vnd.ms-excel\");\n header(\"Content-Disposition:attachment;filename=\".$filename.\".xls\");\n header(\"Pragma: no-cache\");\n header(\"Expires: 0\");\n //导出xls 开始\n if (!empty($title)){\n foreach ($title as $k => $v) {\n $title[$k]=iconv(\"UTF-8\", \"GB2312\",$v);\n }\n $title= implode(\"\\t\", $title);\n echo \"$title\\n\";\n }\n if (!empty($data)){\n foreach($data as $key=>$val){\n foreach ($val as $ck => $cv) {\n $data[$key][$ck]=iconv(\"UTF-8\", \"GB2312\", $cv);\n }\n $data[$key]=implode(\"\\t\", $data[$key]);\n }\n echo implode(\"\\n\",$data);\n }\n}", "public function getTableOfContents();", "public function passRules(){\n\t\t\n\t\t$data = array();\n\t\t//Query for get total pass\n\t\t$query = \"select fb_id,fb_name,image,c_date from tb_pass order by c_date desc\";\n\t\t$result = $this->db->query( $query );\n\t\t$data['list_report'] = $result->result_array();\n\t\t\n\t\t\n\t\t//load our new PHPExcel library\n\t\t$this->load->library('excel');\n\t\t//activate worksheet number 1\n\t\t$this->excel->setActiveSheetIndex(0);\n\t\t//name the worksheet\n\t\t$this->excel->getActiveSheet()->setTitle('General Report');\n\t\t//set cell A1 content with some text\n\t\t$i = 1 ;\n\t\t$num = 2 ;\n\t\t$this->excel->getActiveSheet()->setCellValue('A1','Number');\n\t\t$this->excel->getActiveSheet()->setCellValue('B1','FB Id');\n\t\t$this->excel->getActiveSheet()->setCellValue('C1','FB Name');\n\t\t$this->excel->getActiveSheet()->setCellValue('D1','Image');\n\t\t$this->excel->getActiveSheet()->setCellValue('E1','Assign Date');\n\t\t\n\t\tforeach( $data['list_report'] as $report ){\n\t\t\t\n\t\t\t$this->excel->getActiveSheet()->setCellValue('A'.$num,$i);\n\t\t\t$this->excel->getActiveSheet()->setCellValue('B'.$num,$report['fb_id'] );\n\t\t\t$this->excel->getActiveSheet()->setCellValue('C'.$num,$report['fb_name']);\n\t\t\t$this->excel->getActiveSheet()->setCellValue('D'.$num,$report['image']);\n\t\t\t$this->excel->getActiveSheet()->setCellValue('E'.$num,$report['c_date']);\n\t\t\t\n\t\t\t$num++;\n\t\t\t$i++;\n\t\t}\n\t\t \n\t\t$filename = $this->createFilename( 'Pass-rules' ); //save our workbook as this file name\n\t\theader('Content-Type: application/vnd.ms-excel;charset=tis-620\"'); //mime type\n\t\theader('Content-Disposition: attachment;filename=\"'.$filename.'\"'); //tell browser what's the file name\n\t\theader('Cache-Control: max-age=0'); //no cache\n\t\t\t\t\t\n\t\t//save it to Excel5 format (excel 2003 .XLS file), change this to 'Excel2007' (and adjust the filename extension, also the header mime type)\n\t\t//if you want to save it as .XLSX Excel 2007 format\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5'); \n\t\t//force user to download the Excel file without writing it to server's HD\n\t\t$objWriter->save('php://output');\n\t\t\n\t}", "public function excel()\n { \n return Excel::download(new ReporteGraduados, 'graduado.xlsx');\n }", "function showDataTable(){\n\t\t$output = \"\";\n\t\t// print the table\n\t\t$output .= \"<table summary=\\\"\".$this->summary.\"\\\">\\n\";\n\t\t// print the caption\n\t\t$output .= \"<caption>\".$this->caption.\"</caption>\\n\";\n\t\t$output .= $this->showHeader();\n\t\t// initialise variables\n\t\t$altCounter = 0;\n\t\t$altClass = \"\";\n\t\t$h = 1;\n\t\t// loop each row\n\t\tfor ($x=0; $x<count($this->rows); $x++) {\n\t\t\t// if it is time to show the header\n\t\t\tif ($h==$this->headerRepeat){\n\t\t\t\t// show the header\n\t\t\t\t$output .= $this->showHeader();\n\t\t\t\t$h = 1;\n\t\t\t}\n\t\t\t$row = $this->rows[$x];\n\t\t\t// alternate the row classes\n\t\t\tif ($this->altClasses){\n\t\t\t\tif ($this->altClasses[$altCounter]!=\"\"){ $altClass = \" class=\\\"\".$this->altClasses[$altCounter].\"\\\"\"; } else { $altClass=\"\"; }\n\t\t\t\tif ($altCounter==count($this->altClasses)-1){ $altCounter=0; } else { $altCounter++; }\n\t\t\t}\n\t\t\t// set the parameters to nothing\n\t\t\t$params = \"\";\n\t\t\t// if there are parameters for this row set\n\t\t\tif (count($this->rowParams[$x])>0){\n\t\t\t\t// loop the parameters\n\t\t\t\twhile (list($attribute, $parameter) = each($this->rowParams[$x])) {\n\t\t\t\t\t// if the parameter is 'class'\n\t\t\t\t\tif (strtolower($attribute)==\"class\"){\n\t\t\t\t\t\t// replace the altClass variable\n\t\t\t\t\t\t$altClass = \" \".strtolower($attribute).\"=\\\"$parameter\\\"\";\n\t\t\t\t\t} else{\n\t\t\t\t\t\t// otherwise build the parameters\n\t\t\t\t\t\t$params .= \" \".strtolower($attribute).\"=\\\"$parameter\\\"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// print the row\n\t\t\t$output .= \"\t<tr$altClass$params>\\n\";\n\t\t\t\t// set the colSpan to 0\n\t\t\t\t$colSpan = 0;\n\t\t\t\t$colSpanAttribute = \"\";\n\t\t\t\t// if this row has less columns than the number of fields\n\t\t\t\tif (count($row)<count($this->fields)){\n\t\t\t\t\t$colSpan = (count($this->fields)-count($row))+1;\n\t\t\t\t}\n\t\t\t\t// loop each cell\n\t\t\t\tfor ($i=0; $i<count($row); $i++) {\n\t\t\t\t\t$value = $row[$i];\n\t\t\t\t\t$value = $this->formatField($i, $x);\n\t\t\t\t\t// make the colspan attribute\n\t\t\t\t\tif ($colSpan>0 && $i==(count($row)-1)){ $colSpanAttribute = \" colspan=\\\"$colSpan\\\"\"; }\n\t\t\t\t\t// print the cell\n\t\t\t\t\t$output .= \"\t\t<td$colSpanAttribute>\".$value.\"</td>\\n\";\n\t\t\t\t}\n\t\t\t// end the row\n\t\t\t$output .= \"\t</tr>\\n\";\n\t\t\t// increment the header repeat variable\n\t\t\t$h++;\n\t\t}\n\t\t// end the table\n\t\t$output .= \"</table>\\n\\n\";\n\t\tprint $output;\n\t}", "function export(){\n\n $this->load->model(\"MBenang\");\n\n $this->load->library(\"excel\");\n\n $object = new PHPExcel();\n\n $object->setActiveSheetIndex(0);\n\n // Nama Field Baris Pertama\n $table_columns = $this->MBenang->getColoumnName();\n\n $column = 0;\n\n $object->getActiveSheet()->setCellValueByColumnAndRow($column, 1, 'Data Master Benang');\n\n $object->getActiveSheet()->setTitle('Data Master Benang');\n\n foreach($table_columns as $field){\n\n\n $object->getActiveSheet()->setCellValueByColumnAndRow($column, 2, $field);\n\n $object->getActiveSheet()->getColumnDimension()->setAutoSize(true);\n\n $object->getSheet(0)->getStyle('A3:C3')->getBorders()->getAllBorders()->getColor()->setRGB('949FA8');\n\n $column++;\n\n }\n\n $benang_data = $this->MBenang->fetch_data();\n\n $excel_row = 3;\n\n foreach($benang_data as $row){\n\n $object->getActiveSheet()->setCellValueByColumnAndRow(0, $excel_row, $row->kd_jenis);\n\n $object->getActiveSheet()->setCellValueByColumnAndRow(1, $excel_row, $row->jenis_benang);\n\n $excel_row++;\n\n }\n\n $object_writer = PHPExcel_IOFactory::createWriter($object, 'Excel2007');\n\n header('Content-Type: application/vnd.ms-excel');\n\n header('Content-Disposition: attachment;filename=\"Data-master-benang.xls\"');\n\n $object_writer->save('php://output');\n\n }", "public function importxls()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t$xls\t\t= $this->file['tmp_name'];\n\t\t\t$objPHPExcel\t= PHPExcel_IOFactory::load($xls);\n\t\t\t$sht\t\t= $objPHPExcel->getActiveSheet();\n\n\t\t\t$highestColumm\t= $sht->getHighestDataColumn();\n\t\t\t$highestRow\t= $sht->getHighestDataRow();\n\t\t\t$range\t\t= \"A1:\".$highestColumm.$highestRow;\n\n\t\t\t$rows\t\t= $sht->rangeToArray($range);\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t\treturn;\n\t}", "function data_table($show_type, $thead, $col_head_arr, $data_arr) {\r\n // Validate arguments\r\n if(gettype($thead) !== 'string'\r\n || gettype($col_head_arr) !== 'array'\r\n || gettype($data_arr) !== \"array\"\r\n ) {return false;}\r\n $colhead = $col_head_arr;\r\n $table = \"<table class='today-reports-table'><thead><td colspan='\"\r\n . count($colhead) . \"'>{$thead}</td></thead><tbody><tr>\";\r\n // Set column header of table\r\n for($i = 0; $i < count($colhead); $i++) {\r\n $table .= \"<td>{$colhead[$i]}</td>\";\r\n }\r\n $total_amount = 0;\r\n if($show_type === \"num\") {\r\n for($i = 0; $i < count($data_arr); $i++) {\r\n $table .= \"</tr><tr>\";\r\n for($j = 0; $j < count($data_arr[$i]); $j++) {\r\n $value = $data_arr[$i][$j];\r\n if(count($data_arr[$i]) - $j === 1) {\r\n $total_amount += $value;\r\n $value = number_format($value, 2);\r\n } else {\r\n $value = ucfirst($value);\r\n }\r\n $table .= \"<td>{$value}</td>\";\r\n }\r\n $table .= \"</tr>\";\r\n }\r\n } else if($show_type === \"assoc\") {\r\n for($i = 0; $i < count($data_arr); $i++) {\r\n foreach ($data_arr[$i] as $k => $v) {\r\n $key = ucfirst($k);\r\n $value = number_format($v, 2);\r\n $total_amount += $v;\r\n $table .= \"<tr><td>{$key}</td><td>{$value}</td></tr>\";\r\n }\r\n }\r\n } else {return false;}\r\n $table .= \"<tr><td>Total</td><td colspan='\" . (count($colhead) - 1)\r\n . \"'>\" . number_format($total_amount, 2) . \"</td></tr>\";\r\n $table .= \"</tbody></table>\";\r\n return $table;\r\n }", "public function f10_excel_listado($st_f10) {\n require_once('../../../librerias/Excel/PHPExcel2.php');\n \n $obCon=new conexion(1);\n $objPHPExcel = new Spreadsheet();\n \n $styleName = [\n \n 'font' => [\n 'bold' => true,\n 'size' => 20\n ]\n ];\n $styleTitle = [\n 'font' => [\n 'bold' => true,\n 'size' => 12\n ]\n ];\n \n $Campos=[\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\n \"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\n \"AA\",\"AB\",\"AC\",\"AD\",\"AE\",\"AF\",\"AG\",\"AH\",\"AI\",\"AJ\",\"AK\",\"AL\",\n \"AM\",\"AN\",\"AO\",\"AP\",\"AQ\",\"AR\",\"AS\",\"AT\",\"AU\",\"AV\",\"AW\",\"AX\",\"AY\",\"AZ\",\n \"BA\",\"BB\",\"BC\",\"BD\",\"BE\",\"BF\",\"BG\",\"BH\",\"BI\",\"BJ\",\"BK\",\"BL\",\n \"BM\",\"BN\",\"BO\",\"BP\",\"BQ\",\"BR\",\"BS\",\"BT\",\"BU\",\"BV\",\"BW\",\"BX\",\"BY\",\"BZ\",\n \"CA\",\"CB\",\"CC\",\"CD\",\"CE\",\"CF\",\"CG\",\"CH\",\"CI\",\"CJ\",\"CK\",\"CL\",\n \"CM\",\"CN\",\"CO\",\"CP\",\"CQ\",\"CR\",\"CS\",\"CT\",\"CU\",\"CV\",\"CW\",\"CX\",\"CY\",\"CZ\",\n ];\n \n $nombres_campos=[\"ID\"=>'IDENTIFICADOR',\n\t\t\t\t\"NumeroInterno\"=>'N°',\n\t\t\t\t\"NombreSucursal\"=>'SEDE',\n\t\t\t\t\"NitIPSContratada\"=>'NIT',\n\t\t\t\t\"RazonSocial\"=>'RAZON SOCIAL',\n\t\t\t\t\"Naturaleza\"=>'NATURALEZA',\n\t\t\t\t\"Modalidad\"=>'MODALIDAD',\n\t\t\t\t\"NumeroContrato\"=>'NUMERO DE CONTRATO',\n\t\t\t\t\"llaveCargue\"=>'LLAVE',\n\t\t\t\t\"ValorContrato\"=>'VALOR CONTRATO',\n\t\t\t\t\"FechaInicioContrato\"=>'FECHA INICIO VIGENCIA',\n\t\t\t\t\"FechaFinalContrato\"=>'FECHA FIN VIGENCIA',\n\t\t\t\t\"ValorGlosaxConciliar\"=>'VALOR GLOSAS POR CONCILIAR',\n\t\t\t\t\"FechaConciliacionGlosa\"=>'FECHA CONCILIACION GLOSAS',\n\t\t\t\t\"CumplimientoActaGlosas\"=>'CUMPLIMIENTO DE ACTA DE GLOSA',\n\t\t\t\t\"ResponsableConciliacionGlosa\"=>'RESPONSABLE CONCILIACIÓN GLOSAS',\n\t\t\t\t\"SaldoCuentaXPagar\"=>'SALDO CUENTA POR PAGAR (SEVEN)',\n\t\t\t\t\"FechaConciliacionCartera\"=>'FECHA DE CONCILACIÓN CARTERA',\n\t\t\t\t\"nombre_responsable_conciliacion\"=>'RESPONSABLE CONCILIACIÓN CARTERA',\n\t\t\t\t\"CumplimientoConciliacionCartera\"=>'CUMPLIMIENTO DE CONCILIACIÓN',\n\t\t\t\t\"ObservacionesCartera\"=>'OBSERVACIONES',\n\t\t\t\t\"FechaActaLiquidacion\"=>'FECHA ELABORACIÓN ACTA DE LIQUIDACIÓN',\n\t\t\t\t\"NumeroActaLiquidacion\"=>'No. ACTA DE LIQUIDACION',\n\t\t\t\t\"ActaLiquidacionFirmada\"=>'ACTA DE LIQUIDACIÓN FIRMADA',\n\t\t\t\t\"FechaActaLiquidacionFirmada\"=>'FECHA ACTA DE LIQUIDACIÓN FIRMADA',\n\t\t\t\t\"ValorFavorContra\"=>'VALOR A FAVOR (/) O EN CONTRA (+)',\n\t\t\t\t\"RegistroActaLiquidacionSeven\"=>'REGISTRO ACTA DE LIQUIDACIÓN (SEVEN)',\n\t\t\t\t\"AcuerdoPago\"=>'SE REALIZÓ ACUERDO DE PAGO',\n\t\t\t\t\"NumeroCuotasAcuerdo\"=>'No. CUOTAS',\n\t\t\t\t\"ValorTotalAcuerdo\"=>'VALOR TOTAL ACUERDO',\n\t\t\t\t\"ValorCuotaAcuerdo\"=>'VALOR CUOTA',\n\t\t\t\t\"FechaInicioAcuerdo\"=>'FECHA INICIO ACUERDO DE PAGO',\n\t\t\t\t\"FechaFinAcuerdo\"=>'FECHA FIN ACUERDO DE PAGO',\n\t\t\t\t\"ValorSaldoAcuerdo\"=>'VALOR SALDO ACUERDO',\n\t\t\t\t\"ResponsableCargue\"=>'RESPONSABLE AGS O DEPARTAMENTAL CARGUE',\n\t\t\t\t\"TipoOperacionCargue\"=>'TIPO DE OPERACIÓN',\n\t\t\t\t\"NumeroAjusteCargue\"=>'NÚMERO AJUSTE',\n\t\t\t\t\"FechaAjusteCargue\"=>'FECHA',\n\t\t\t\t\"ValorAjusteCargue\"=>'VALOR AJUSTE',\n\t\t\t\t\"SaldoActaLiquidacionCargue\"=>'SALDO ACTA DE LIQUIDACIÓN',\n\t\t\t\t\"NotificacionCargue\"=>'NOTIFICACIÓN',\n\t\t\t\t\"FechaNotificacionCargue\"=>'FECHA NOTIFICACIÓN',\n\t\t\t\t\"UsuarioCargue\"=>'USUARIO QUE CARGA',\n\t\t\t\t\"nombre_responsable_liquidacion\"=>'RESPONSABLE AGS 2',\n\t\t\t\t\"nombre_cargo_responsable_liquidacion\"=>'CARGO RESPONSABLE AGS 2',\n\t\t\t\t\"LiderAcargoLiquidacion\"=>'LIDER A CARGO',\n\t\t\t\t\"nombre_responsable_cargue_acta\"=>'RESPONSABLE CARGUE DE ACTA',\n\t\t\t\t\"Pareto\"=>'PARETO',\n\t\t\t\t\"ParetoContraloria\"=>'PARETO CONTRALORIA',\n\t\t\t\t\"Municipio\"=>'MUNICIPIO',\n\t\t\t\t\"NivelComplejidad\"=>'NIVEL COMPLEJIDAD',\n\t\t\t\t\"ObjetoContrato\"=>'OBJETO DEL CONTRATO',\n\t\t\t\t\"AnioFinalizacionContrato\"=>'AÑO FINALIZACIÓN',\n\t\t\t\t\"ObservacionesLiquidacion\"=>'OBSERVACIONES ACTAS DE LIQUIDACIÓN',\n\t\t\t\t\"SaldoInicialSeven\"=>'SALDO INICIAL (SEVEN)',\n\t\t\t\t\"GlosaInicial\"=>'GLOSA INICIAL',\n\t\t\t\t\"GlosaFavor\"=>'GLOSA A FAVOR',\n\t\t\t\t\"GlosaConciliar\"=>'GLOSA POR CONCILIAR',\n\t\t\t\t\"PendienteAuditoria\"=>'PENDIENTE DE AUDITORIA',\n\t\t\t\t\"ValorDevoluciones\"=>'VALOR DEVOLUCIONES',\n\t\t\t\t\"ValorFacturado\"=>'VALOR FACTURADO',\n\t\t\t\t\"ValorPagado\"=>'TOTAL PAGADO',\n\t\t\t\t\"FechaEnvioCruceCartera\"=>'FECHA ENVIO CRUCE DE CARTERA',\n\t\t\t\t\"DiasTranscurridos\"=>'DIAS TRANSCURRIDOS',\n\t\t\t\t\"ConciliadoAsmet\"=>'CONCILIADO POR ASMET',\n\t\t\t\t\"CausaNoLiquidacion\"=>'CAUSA DE NO LIQUIDACION DEL CONTRATO',\n\t\t\t\t\"GestionLiquidacion\"=>'GESTION PARA LA LIQUIDACION',\n\t\t\t\t\"ProcesoNoLiquidacion\"=>'PROCESO DE NO LIQUIDACION INMEDIATA',\n\t\t\t\t\"ObservacionesAdicionales\"=>'OBSERVACIONES',\n\t\t\t\t\"HYL\"=>'HYL',\n\t\t\t\t\"Liquidado31Marzo2018\"=>'LIQUIDADO A 31 DE MARZO 2018',\n\t\t\t\t\"Contrato\"=>'CONTRATO SI/NO',\n\t\t\t\t\"MarcaGerencia\"=>'MARCA JAIR',\n\t\t\t\t\"RecibeCartera\"=>'SE RECIBE CARTERA',\n\t\t\t\t\"FechaRecibeCartera\"=>'FECHA RECIBE CARTERA',\n\t\t\t\t\"RealizaCruceCartera\"=>'SE REALIZA CRUCE DE CARTERA',\n\t\t\t\t\"FechaCruce\"=>'FECHA REALIZA CRUCE DE CARTERA',\n\t\t\t\t\"EnviaOferta\"=>'SE ENVIA OFERTA',\n\t\t\t\t\"FechaEnviaOferta\"=>'FECHA ENVIA OFERTA',\n\t\t\t\t\"ActaArchivada\"=>'FECHA ENVIA OFERTA',\n\t\t\t\t\"FechaActualizacionManual\"=>'FECHA ACTUALIZACION MANUAL',\n\t\t\t\t\"usuario_edicion\"=>'USUARIO ACTUALIZA MANUAL',\n\t\t\t\t\"FechaActualizacion\"=>'FECHA ACTUALIZACION AUTOMATICA',\n\t\t\t\t\"nombre_estado\"=>'ESTADO DEL CONTRATO',\n\n\t\t\t\t];\n \n $campos_seleccionados=\"\";\n $z=0;\n $i=1;\n foreach ($nombres_campos as $key => $value) {\n $campos_seleccionados.=\"$key,\";\n $objPHPExcel->setActiveSheetIndex(0)\n ->setCellValue($Campos[$z].$i,$value);\n \n $z=$z+1;\n }\n $campos_seleccionados= substr($campos_seleccionados, 0, -1);\n $st_f10= str_replace(\"*\", $campos_seleccionados, $st_f10);\n $z=0;\n $i=2;\n $sql=$st_f10;\n \n $Consulta=$obCon->Query($sql);\n \n while($DatosConsulta=$obCon->FetchAssoc($Consulta)){\n $z=0;\n foreach ($DatosConsulta as $key => $value) {\n $objPHPExcel->setActiveSheetIndex(0)\n ->setCellValue($Campos[$z++].$i,$value);\n }\n $i++;\n }\n //Informacion del excel\n $objPHPExcel->\n getProperties()\n ->setCreator(\"www.technosoluciones.com.co\")\n ->setLastModifiedBy(\"www.technosoluciones.com.co\")\n ->setTitle(\"F10\")\n ->setSubject(\"F10\")\n ->setDescription(\"Documento generado por Techno Soluciones SAS\")\n ->setKeywords(\"techno soluciones sas\")\n ->setCategory(\"F10\"); \n \n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=\"'.\"F10\".'.xls\"');\n header('Cache-Control: max-age=0');\n header('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n header('Pragma: public'); // HTTP/1.0\n $objWriter=IOFactory::createWriter($objPHPExcel,'Xlsx');\n $objWriter->save('php://output');\n exit; \n \n }", "public function winners(){\n\t\t\n\t\t$data = array();\n\t\t\n\t\t//Query for get winner\n\t\t$query = \"select fb_id,fb_name,image,c_date from tb_winner order by c_date desc\";\n\t\t$result = $this->db->query( $query );\n\t\t$data['list_report'] = $result->result_array();\n\t\t\n\t\t\n\t\t//load our new PHPExcel library\n\t\t$this->load->library('excel');\n\t\t//activate worksheet number 1\n\t\t$this->excel->setActiveSheetIndex(0);\n\t\t//name the worksheet\n\t\t$this->excel->getActiveSheet()->setTitle('General Report');\n\t\t//set cell A1 content with some text\n\t\t$i = 1 ;\n\t\t$num = 2 ;\n\t\t$this->excel->getActiveSheet()->setCellValue('A1','Number');\n\t\t$this->excel->getActiveSheet()->setCellValue('B1','FB Id');\n\t\t$this->excel->getActiveSheet()->setCellValue('C1','FB Name');\n\t\t$this->excel->getActiveSheet()->setCellValue('D1','Image');\n\t\t$this->excel->getActiveSheet()->setCellValue('E1','Assign Date');\n\t\t\n\t\tforeach( $data['list_report'] as $report ){\n\t\t\t\n\t\t\t$this->excel->getActiveSheet()->setCellValue('A'.$num,$i);\n\t\t\t$this->excel->getActiveSheet()->setCellValue('B'.$num,$report['fb_id'] );\n\t\t\t$this->excel->getActiveSheet()->setCellValue('C'.$num,$report['fb_name']);\n\t\t\t$this->excel->getActiveSheet()->setCellValue('D'.$num,$report['image']);\n\t\t\t$this->excel->getActiveSheet()->setCellValue('E'.$num,$report['c_date']);\n\t\t\t\n\t\t\t$num++;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t \n\t\t$filename = $this->createFilename( 'Winner' ); //save our workbook as this file name\n\t\theader('Content-Type: application/vnd.ms-excel;charset=tis-620\"'); //mime type\n\t\theader('Content-Disposition: attachment;filename=\"'.$filename.'\"'); //tell browser what's the file name\n\t\theader('Cache-Control: max-age=0'); //no cache\n\t\t\t\t\t\n\t\t//save it to Excel5 format (excel 2003 .XLS file), change this to 'Excel2007' (and adjust the filename extension, also the header mime type)\n\t\t//if you want to save it as .XLSX Excel 2007 format\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5'); \n\t\t//force user to download the Excel file without writing it to server's HD\n\t\t$objWriter->save('php://output');\n\t\t\n\t}", "public function listado_xls(array $datos=array()) {\r\n\r\n $validaciones = array(\r\n \"nombre\" => \"errores_texto\"\r\n );\r\n \\core\\Validaciones::errores_validacion_request($validaciones, $datos);\r\n if (isset($_datos['values']['nombre'])) \r\n $select['where'] = \" nombre like '%{$_datos['values']['nombre']}%'\";\r\n $select['order_by'] = 'nombre';\r\n $datos['filas'] = \\modelos\\Datos_SQL::select( $select, self::$tabla);\r\n\r\n $datos['contenido_principal'] = \\core\\Vista::generar(__FUNCTION__, $datos);\r\n\r\n \\core\\HTTP_Respuesta::set_mime_type('application/excel');\r\n $http_body = \\core\\Vista_Plantilla::generar('plantilla_xls', $datos);\r\n \\core\\HTTP_Respuesta::enviar($http_body);\r\n\r\n }", "public function getTable($download=false){\n $this->getWorksheet($this->fileName, $download);\n // print_r ($this->worksheet);\n // $nr = count(array_filter($this->worksheet)); //number of rows\n // echo $nr.'Opps'. $this->totalRow;\n $html_tb ='';\n $html_tb .='<table class=\"table\" style=\"font-size:10px;\" border=\"1\"><tr><th>SN</th><th>'. implode('</th><th>', $this->unfilteredWorksheet[1]) .'</th></tr>';\n // $html_tb .='<table class=\"table\" style=\"font-size:10px;\" border=\"1\">';\n $startNum = ($this->currentPage == 1?$startNum = 2:$this->minPageNum);\n for($i=$startNum; $i<=$this->maxPageNum; $i++){\n if ($i > $this->totalRow){\n break;\n }\n $html_tb .='<tr><td>'.$i.'</td><td>'. implode('</td><td>', $this->worksheet[$i]) .'</td></tr>';\n }\n $html_tb .='</table>';\n\n return $html_tb;\n }", "function area($tahun, $area, $berdasarkan)\n {\n $this->load->helper('exportexcel');\n $namaFile = \"transaksi_area.xls\";\n $judul = \"Transaksi\";\n $tablehead = 4;\n $tablebody = 5;\n $nourut = 1;\n //penulisan header\n header(\"Pragma: public\");\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0,pre-check=0\");\n header(\"Content-Type: application/force-download\");\n header(\"Content-Type: application/octet-stream\");\n header(\"Content-Type: application/download\");\n header(\"Content-Disposition: attachment;filename=\" . $namaFile . \"\");\n header(\"Content-Transfer-Encoding: binary \");\n $area2 = \"\";\n $berdasarkan2 = \"\";\n if ($area == \"-\") {\n $area = \"Semua\";\n $area2 = \"\";\n }\n if ($berdasarkan == \"-\") {\n $berdasarkan = \"Semua\";\n $berdasarkan2 = \"\";\n }\n\n xlsBOF();\n xlsWriteLabel(0, 0, \"Laporan\");\n xlsWriteLabel(1, 0, \"Tahun\");\n xlsWriteLabel(2, 0, \"Nama\");\n xlsWriteLabel(0, 1, $berdasarkan);\n xlsWriteLabel(1, 1, $tahun);\n xlsWriteLabel(2, 1, $area);\n $kolomhead = 0;\n xlsWriteLabel($tablehead, $kolomhead++, \"No\");\n xlsWriteLabel($tablehead, $kolomhead++, \"No Faktur\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Tgl Kirim\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Jatuh Tempo\");\n xlsWriteLabel($tablehead, $kolomhead++, \"ID Pelanggan\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Nama Pelanggan\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Nama Barang\");\n xlsWriteLabel($tablehead, $kolomhead++, \"QTY\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Satuan\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Kota\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Kecamatan\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Kelurahan\");\n xlsWriteLabel($tablehead, $kolomhead++, \"No Telpon\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Surveyor\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Debt\");\n xlsWriteLabel($tablehead, $kolomhead++, \"Jumlah\");\n\n $record = $this->mLap->laporan_area($tahun, $area2, $berdasarkan2);\n $total = 0;\n foreach ($record as $data) {\n $kolombody = 0;\n xlsWriteNumber($tablebody, $kolombody++, $nourut);\n xlsWriteLabel($tablebody, $kolombody++, $data->id_transaksi);\n xlsWriteLabel($tablebody, $kolombody++, $data->tgl_transaksi);\n xlsWriteLabel($tablebody, $kolombody++, $data->jatuh_tempo);\n xlsWriteLabel($tablebody, $kolombody++, $data->id_pelanggan);\n xlsWriteLabel($tablebody, $kolombody++, $data->nama_pelanggan);\n xlsWriteLabel($tablebody, $kolombody++, $data->nama_barang);\n xlsWriteNumber($tablebody, $kolombody++, $data->qty);\n xlsWriteLabel($tablebody, $kolombody++, $data->satuan);\n xlsWriteLabel($tablebody, $kolombody++, $data->kota);\n xlsWriteLabel($tablebody, $kolombody++, $data->kecamatan);\n xlsWriteLabel($tablebody, $kolombody++, $data->kelurahan);\n xlsWriteLabel($tablebody, $kolombody++, $data->no_telp);\n xlsWriteLabel($tablebody, $kolombody++, $data->nama_karyawan);\n xlsWriteLabel($tablebody, $kolombody++, $data->username);\n xlsWriteNumber($tablebody, $kolombody++, $data->subtotal);\n $tablebody++;\n $nourut++;\n $total += $data->subtotal;\n }\n xlsWriteLabel($tablebody, 14, 'Total');\n xlsWriteNumber($tablebody, 15, $total);\n xlsEOF();\n exit();\n }", "function printCell($data,$total,$col,$field,$file_name,$module,$data2,$incentive_ytd,$incentive_type,$period,$created_date,$modified_date){\n\t\t$j = 1;\n\t\t$total = $total;\n\t\t$field_count = count($field);\n\t\t$c_count = $field_count-1;\n\t\t$k = 0;\n\t\t\n\t\t// for view incentive 1\n\t\tif($module == 'view_incentive1'){\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A1', 'Employee');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A1')->setAutoSize(true);\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B1', $data2['employee']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A2', 'Incentive Type');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A2')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A2')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B2', $incentive_type);\n\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A3', 'Period');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A3')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A3')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B3', $period);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A4', 'Productivity %');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A4')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A4')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B4', $data2['productivity']);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('B4')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A5', 'Incentive Amount (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A5')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A5')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B5', $data2['eligible_incentive_amt']);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('B5')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C1', 'No. of Candidates Interviewed');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C1')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C1')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D1', $data2['interview_candidate']);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('D1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C2', 'Individual Contribution - YTD (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C2')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C2')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D2', $incentive_ytd);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('D2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C3', 'Created Date');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C3')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C3')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D3', $created_date);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C4', 'Modified Date');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C4')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C4')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D4', $modified_date);\n\n\t\t\t// iterate the multiple rows\n\t\t\tfor($i = 8; $i <= $total+7; $i++){\n\t\t\t\tfor($j = 0; $j < $field_count; $j++){\n\t\t\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue($col[$j] . $i, strip_tags($data[$k][$field[$j]]));\n\t\t\t\t}\n\t\t\t\t$k++;\n\t\t\t}\n\t\t\n\t\t}elseif($module == 'view_incentive2'){\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A1', 'Employee');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A1')->setAutoSize(true);\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B1', $data2['employee']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A2', 'Incentive Type');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A2')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A2')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B2', $incentive_type);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A3', 'Period');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A3')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A3')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B3', $period);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A4', 'Min. Performance Target (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A4')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A4')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B4', $data2['incentive_target_amt']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A5', 'Actual Individual Contribution (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A5')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A5')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B5', $data2['achievement_amt']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C1', 'Incentive Amount (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C1')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C1')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D1', $data2['eligible_incentive_amt']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C2', 'No. of Candidates Billed');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C2')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C2')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D2', $data2['candidate_billed']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C3', 'Individual Contribution - YTD (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C3')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C3')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D3', $incentive_ytd);\n\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C4', 'Created Date');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C4')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C4')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D4', $created_date);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C5', 'Modified Date');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C5')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C5')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D5', $modified_date);\n\t\t\n\t\t\t// iterate the multiple rows\n\t\t\tfor($i = 9; $i <= $total+8; $i++){\n\t\t\t\tfor($j = 0; $j < $field_count; $j++){\n\t\t\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue($col[$j] . $i, strip_tags($data[$k][$field[$j]]));\n\t\t\t\t}\n\t\t\t\t$k++;\n\t\t\t}\n\t\t}else{\n\t\t\tfor($i = 2; $i <= $total+1; $i++){\n\t\t\t\tfor($j = 0; $j < $field_count; $j++){ \n\t\t\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue($col[$j] . $i, strip_tags($data[$k][$field[$j]]));\n\t\t\t\t}\n\t\t\t\t$k++;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t// auto size for columns \n\t\tforeach(range('A',\"$col[$c_count]\") as $columnID) {\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension($columnID)->setAutoSize(true);\n\t\t}\t\n\t\t// set the header\n\t\t$this->setHeader($file_name);\n\t}", "function toTable($data)\n{\n//print_r($data);\n\t$keys = $data[0];\n\t$keys = array_flip($keys);\n\t$result = \"<table>\\n\\t<tr>\";\n\tforeach($keys as $key)\n\t{\n\t\t$result .= '<th>' . $key . '</th>';\n\t}\n\t$result .= \"</tr>\\n\";\n\t$counter = 0;\n\tforeach($data as $item)\n\t{\n\t\t$counter++;\n\t\tif ($counter % 2 == 1)\n\t\t{\n\t\t\t$result .= \"\\t<tr>\";\n\t\t} else\n\t\t{\n\t\t\t$result .= \"\\t<tr class=\\\"odd\\\">\";\n\t\t}\n\t\tforeach($item as $value)\n\t\t{\n\t\t\t$result .= '<td>' . $value . '</td>';\n\t\t}\n\t\t$result .= \"</tr>\\n\";\n\t}\n\t$result .= \"</table>\\n\";\n\treturn $result;\n}", "public function general(){\n\t\t\n\t\t$data = array();\n\t\t//Query for get list of record\n\t\t$query = \"select cus.fb_id, cus.fb_name, cus.fb_email, cus.c_date , img.image, img.c_date as img_date\";\n\t\t$query .= \" from tb_customer cus inner join tb_image img\";\n\t\t$query .= \" on cus.fb_id = img.fb_id and cus.keygen = img.keygen \";\n\t\t$query .= \"order by cus.c_date desc\";\n\t\t$result = $this->db->query( $query );\n\t\t$data['list_report'] = $result->result_array();\n\t\t\n\t\t\n\t\t//load our new PHPExcel library\n\t\t$this->load->library('excel');\n\t\t//activate worksheet number 1\n\t\t$this->excel->setActiveSheetIndex(0);\n\t\t//name the worksheet\n\t\t$this->excel->getActiveSheet()->setTitle('General Report');\n\t\t//set cell A1 content with some text\n\t\t$i = 1 ;\n\t\t$num = 2 ;\n\t\t$this->excel->getActiveSheet()->setCellValue('A1','Number');\n\t\t$this->excel->getActiveSheet()->setCellValue('B1','FB Id');\n\t\t$this->excel->getActiveSheet()->setCellValue('C1','FB Name');\n\t\t$this->excel->getActiveSheet()->setCellValue('D1','FB Email');\n\t\t$this->excel->getActiveSheet()->setCellValue('E1','Time to play');\n\t\t$this->excel->getActiveSheet()->setCellValue('F1','Image');\n\t\t$this->excel->getActiveSheet()->setCellValue('G1','Time to image');\n\t\t\n\t\tforeach( $data['list_report'] as $report ){\n\t\t\t\n\t\t\t$this->excel->getActiveSheet()->setCellValue('A'.$num,$i);\n\t\t\t$this->excel->getActiveSheet()->setCellValue('B'.$num,$report['fb_id'] );\n\t\t\t$this->excel->getActiveSheet()->setCellValue('C'.$num,$report['fb_name']);\n\t\t\t$this->excel->getActiveSheet()->setCellValue('D'.$num,$report['fb_email']);\n\t\t\t$this->excel->getActiveSheet()->setCellValue('E'.$num,$report['c_date']);\n\t\t\t$this->excel->getActiveSheet()->setCellValue('F'.$num,$report['image']);\n\t\t\t$this->excel->getActiveSheet()->setCellValue('G'.$num,$report['img_date']);\n\t\t\t\n\t\t\t$num++;\n\t\t\t$i++;\n\t\t}\n\t\t \n\t\t$filename = $this->createFilename( 'General' ); //save our workbook as this file name\n\t\theader('Content-Type: application/vnd.ms-excel;charset=tis-620\"'); //mime type\n\t\theader('Content-Disposition: attachment;filename=\"'.$filename.'\"'); //tell browser what's the file name\n\t\theader('Cache-Control: max-age=0'); //no cache\n\t\t\t\t\t\n\t\t//save it to Excel5 format (excel 2003 .XLS file), change this to 'Excel2007' (and adjust the filename extension, also the header mime type)\n\t\t//if you want to save it as .XLSX Excel 2007 format\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5'); \n\t\t//force user to download the Excel file without writing it to server's HD\n\t\t$objWriter->save('php://output');\n\t\t\n\t}", "public function get(){\r\n $file= fopen($_GET['filename'],\"r\");\r\n $this->html .= '<h1>Table</h1>';\r\n $this->html .= '<table border =\"1\">';\r\n //check the file till end of the file\r\n while (!feof($file)) {\r\n $line=fgetcsv($file);\r\n\r\n //Type cast to array\r\n $a=(array) $line;\r\n //convert every array into one cell\r\n foreach ($a as $value ) {\r\n $this->html .= \"<td> $value </td>\";\r\n }\r\n $this->html .= '</tr>';\r\n }\r\n $this->html .= '</table>';\r\n\r\n //close the file\r\n fclose($file);\r\n\r\n}", "function download(){\n\t/** Include PHPExcel */\n\trequire_once dirname(__FILE__) . '/Excel/PHPExcel.php';\n\t\n\t$objPHPExcel = new PHPExcel();\n\t\n\t// Set document properties\n\t$objPHPExcel->getProperties()->setCreator($_SESSION[\"userInfo\"][\"userName\"])\n\t\t\t\t\t\t\t\t->setLastModifiedBy($_SESSION[\"userInfo\"][\"userName\"])\n\t\t\t\t\t\t\t\t->setTitle(\"Smart Shop Inventory\")\n\t\t\t\t\t\t\t\t->setSubject(\"Smart Shop Inventory\")\n\t\t\t\t\t\t\t\t->setDescription(\"Inventory outputted from the Smart Shop database.\")\n\t\t\t\t\t\t\t\t->setKeywords(\"office PHPExcel php\")\n\t\t\t\t\t\t\t\t->setCategory(\"Inventory Data File\");\n\t\n\t//size the columns appropriately\n\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(5);\n\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(18);\n\t$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(10);\n\t$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(10);\n\t$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(20);\n\t\n\t//color the title row\n\t$objPHPExcel->getActiveSheet()\n\t\t->getStyle('A1:E1')\n\t\t->getFill()\n\t\t->setFillType(PHPExcel_Style_Fill::FILL_SOLID)\n\t\t->getStartColor()\n\t\t->setARGB('FF808080');\n\t\n\t//output the titles for the columns\n\t$objPHPExcel->setActiveSheetIndex(0)\n\t\t\t\t->setCellValue('A1', 'ID')\n\t\t\t\t->setCellValue('B1', 'Name')\n\t\t\t\t->setCellValue('C1', 'Quantity')\n\t\t\t\t->setCellValue('D1', 'Value')\n\t\t\t\t->setCellValue('E1', 'Last Updated');\n\t\n\t$items = getItems();\n\t$i = 2;\n\tforeach($items as $item){\n\t\t//populate the row with values\n\t\t$objPHPExcel->setActiveSheetIndex(0)\n\t\t\t\t->setCellValue('A'.$i, $item[\"Id\"])\n\t\t\t\t->setCellValue('B'.$i, $item[\"Name\"])\n\t\t\t\t->setCellValue('C'.$i, $item[\"Quantity\"])\n\t\t\t\t->setCellValue('D'.$i, $item[\"Value\"])\n\t\t\t\t->setCellValue('E'.$i, $item[\"Updated\"]);\n\t\t\n\t\t//Set the value cell format to currency\n\t\t$objPHPExcel->getActiveSheet()\n\t\t->getStyle('D'.$i)\n\t\t->getNumberFormat()\n\t\t->setFormatCode(\n\t\t\tPHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE\n\t\t);\n\t\n\t\t$i++;\n\t}\n\t\n\t// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n\t$objPHPExcel->setActiveSheetIndex(0);\n\t\n\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t$output = \"downloads/\" . date(\"Y-m-d_H-i\") . \"_Inventory.xlsx\";\n\t$objWriter->save($output);\n\t\n\treturn [\"success\" => true, \"message\" => $output];\n}", "public function invoice_list_export_xls() {\n ini_set('memory_limit', '-1');\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $payment_status = $this->input->get('payment_status');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'ei.invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $company_id = $this->input->get('company_id');\n $tabledata = $this->reportsModel->get_all_invoice($tenant_id, $records_per_page, $offset, $field, $order_by, $payment_status, $start_date, $end_date, $company_id);\n\n $tabledata_count = count($tabledata);\n for ($i = 0; $i < $tabledata_count; $i++) {\n if ($tabledata[$i]->enrolment_mode === 'COMPSPON') {\n $tabledata[$i]->payment_status = $this->reportsModel->check_not_part_paid($tabledata[$i]->pymnt_due_id);\n }\n }\n $this->load->helper('export_helper');\n $count_tabledata = count($tabledata);\n $excel_titles = array('Inv #', 'Course Dt.', 'Inv Dt.', 'Taxcode', 'Name', 'Discount', 'Subsidy', 'GST', 'Net Amt.', 'Status');\n $excel_data = array();\n for ($i = 0; $i < $count_tabledata; $i++) {\n $paid_arr = array('PAID' => 'Paid', 'PARTPAID' => 'Part Paid', 'NOTPAID' => 'Not Paid');\n $paid_sty_arr = array('PAID' => 'color:green;', 'PARTPAID' => 'color:red;', 'NOTPAID' => 'color:red;');\n if ($tabledata[$i]->enrolment_mode == 'SELF') {\n $taxcode = $this->mask_format($tabledata[$i]->tax_code);\n $name = $tabledata[$i]->first_name . ' ' . $tabledata[$i]->last_name;\n $status = $paid_arr[$tabledata[$i]->payment_status];\n } else {\n if ($tabledata[$i]->company_id[0] == 'T') {\n $tenant_details = fetch_tenant_details($tabledata[$i]->company_id);\n $taxcode = $tenant_details->tenant_name;\n $name = $tenant_details->tenant_name . ' (Company)';\n } else {\n $taxcode = $tabledata[$i]->comp_regist_num;\n $name = $tabledata[$i]->company_name . ' (Company)';\n }\n $status = ($tabledata[$i]->payment_status > 0) ? 'Part Paid/Not Paid' : 'Paid';\n }\n $excel_data[$i][] = $tabledata[$i]->invoice_id;\n $excel_data[$i][] = date('d/m/Y', strtotime($tabledata[$i]->course_date));\n $excel_data[$i][] = date('d/m/Y', strtotime($tabledata[$i]->inv_date));\n $excel_data[$i][] = $taxcode;\n $excel_data[$i][] = $name;\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_discnt, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_subsdy, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_gst, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_amount, 2, '.', '') . ' SGD';\n $excel_data[$i][] = $status;\n }\n if (empty($start_date) && empty($end_date)) {\n $period = ' for ' . date('F d Y, l');\n } else {\n $period = 'for the period';\n if (!empty($start_date))\n $period .= ' from ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $start_date)->getTimestamp());\n if (!empty($end_date))\n $period .= ' to ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $end_date)->getTimestamp());\n }\n $excel_filename = 'invlice_list.xls';\n $excel_sheetname = 'Invoice List';\n $excel_main_heading = 'Accounting Reports - Invoice List & Search' . $period;\n\n export_page_fields($excel_titles, $excel_data, $excel_filename, $excel_sheetname, $excel_main_heading);\n }", "public function actionExcel(){\n $spreadsheet = new Spreadsheet();\n \n // Set document properties\n $spreadsheet->getProperties()->setCreator('Maarten Balliauw')\n ->setLastModifiedBy('Maarten Balliauw')\n ->setTitle('Office 2007 XLSX Test Document')\n ->setSubject('Office 2007 XLSX Test Document')\n ->setDescription('Test document for Office 2007 XLSX, generated using PHP classes.')\n ->setKeywords('office 2007 openxml php')\n ->setCategory('Test result file');\n \n // Add some data\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A1', 'Hello')\n ->setCellValue('B2', 'world!')\n ->setCellValue('C1', 'Hello')\n ->setCellValue('D2', 'world!');\n \n // Miscellaneous glyphs, UTF-8\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A4', 'Miscellaneous glyphs')\n ->setCellValue('A5', 'éàèùâêîôûëïüÿäöüç');\n \n // Rename worksheet\n $spreadsheet->getActiveSheet()->setTitle('Simple');\n \n // Set active sheet index to the first sheet, so Excel opens this as the first sheet\n $spreadsheet->setActiveSheetIndex(0);\n\n $response = Yii::$app->getResponse();\n $headers = $response->getHeaders();\n \n // Redirect output to a client’s web browser (Xlsx)\n $headers->set('Content-Type', 'application/vnd.ms-excel');\n $headers->set('Content-Disposition','attachment;filename=\"01simple.xlsx\"');\n // $headers->set('Cache-Control: max-age=0');\n // $headers->setheader('Cache-Control: max-age=1');\n\n// If you're serving to IE over SSL, then the following may be needed\n // $headers->set('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n // $headers->set('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\n // $headers->set('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n // $headers->set('Pragma: public'); // HTTP/1.0\n\n //header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n // header('Content-Disposition: attachment;filename=\"01simple.xlsx\"');\n $headers->set('Cache-Control: max-age=0');\n // If you're serving to IE 9, then the following may be needed\n $headers->set('Cache-Control: max-age=1');\n \n // If you're serving to IE over SSL, then the following may be needed\n $headers->set('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n $headers->set('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\n $headers->set('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n $headers->set('Pragma: public'); // HTTP/1.0\n ob_start(); \n $writer = IOFactory::createWriter($spreadsheet, 'Xlsx');\n $writer->save(\"php://output\");\n $content = ob_get_contents();\n ob_clean();\n return $content;\n\n // exit;\n\n\n\n\n\n }", "public function excel_import_product(){\n return view('product.import_product');\n }", "public function pnlExcel()\n {\n\n $Fdate = session()->get('Fdate');\n $Tdate = session()->get('Tdate');\n\n\n Excel::create('PNL(\"' . $Fdate . '\" to \"' . $Tdate . '\")', function ($excel) {\n $excel->sheet('Sheet 1', function ($sheet) {\n $Fdate = session()->get('Fdate');\n $Tdate = session()->get('Tdate');\n $fillarray = session()->get('Pnldata');\n $cosfee = (int)$fillarray[8];\n $totAdmission = $fillarray[6][0] - $fillarray[6][1];\n $totfee = $fillarray[0] + $fillarray[1] + $fillarray[2] + $fillarray[3] + $fillarray[4] + $fillarray[5];\n $grossProfit = (($fillarray[6][0] - $fillarray[6][1]) + $cosfee + $fillarray[7] + $fillarray[9] + $fillarray[0] + $fillarray[1] + $fillarray[2] + $fillarray[3] + $fillarray[4] + $fillarray[5]);\n\n $sheet->mergeCells('A1:G3');\n $ar1 = array(array('Profitability statement for the '.$Fdate.' to '.$Tdate),\n array(' '),\n array(' '),\n array(' '),\n array('INCOME'),\n array('Admission', ' ', $fillarray[6][0]),\n array('Admission Discounts 10%', ' ', $fillarray[6][1]),\n array(' ', ' ', '', $totAdmission),\n array('Fees-NC', $fillarray[0]),\n array('Fees-BC', $fillarray[1], $fillarray[0] + $fillarray[1]),\n array('Exam Fees-NC', $fillarray[2]),\n array('Exam Fees-BC', $fillarray[3], $fillarray[2] + $fillarray[3]),\n array('Extra Fees-NC', $fillarray[4]),\n array('Extra Fees-BC', $fillarray[5], $fillarray[4] + $fillarray[5], $totfee),\n array(),\n array('OTHER INCOME'),\n array('Stationary', '', $fillarray[7]),\n array('Course fee', '', $cosfee, $fillarray[7] + $fillarray[8]),\n array(),\n array('OTHER INCOME'),\n array('Others', '', $fillarray[9], $fillarray[9]),\n array('Gross Profit', '', '', $grossProfit),\n array(),\n array('EXPENSES'));//all income\n\n $sheet->fromArray($ar1, null, 'A1', false, false);\n $Totexp = 0;\n foreach ($fillarray[10] as $item) {\n $Totexp = $Totexp + $item->Tamt;\n if ($item == end($fillarray[10])) {\n $sheet->appendRow(array(\n $item->expense_type, '', $item->Tamt, $Totexp\n ));\n } else {\n $sheet->appendRow(array(\n $item->expense_type, '', $item->Tamt\n ));\n }\n }//add all expense\n\n $sheet->appendRow(array(\n 'Net Profit', '', '', $grossProfit - $Totexp\n ));\n\n\n $sheet->freezeFirstColumn();\n $sheet->cells('A1:G1', function($cells) {\n $cells->setFontColor('#ffffff');\n $cells->setBackground('#000000');\n $cells->setFont(array(\n 'family' => 'Calibri',\n 'size' => '16',\n 'bold' => true\n ));\n $cells->setValignment('center');\n $cells->setAlignment('center');\n });\n });\n })->export('xlsx');\n\n\n }", "protected function _translateToExcel()\n\t{\n\t\t// Build the header row\n\t\t$strHeaderRow = \"\";\n\t\tforeach ($this->_arrSelectedColumns as $column)\n\t\t{\n\t\t\t$strHeaderRow .= \"\\t\\t\\t\\t\\t<th>\". htmlspecialchars($this->_arrColumns[$column]) .\"</th>\\n\";\n\t\t}\n\t\t\n\t\t// Build the rows\n\t\t$strRows = \"\";\n\t\tforeach ($this->_arrReportData as $arrDetails)\n\t\t{\n\t\t\t$strRow = \"\";\n\t\t\tforeach ($this->_arrSelectedColumns as $column)\n\t\t\t{\n\t\t\t\t$strRow .= \"\\t\\t\\t\\t\\t<td>\". htmlspecialchars($arrDetails[$column]). \"</td>\\n\";\n\t\t\t}\n\t\t\t\n\t\t\t$strRows .= \"\\t\\t\\t\\t<tr>\\n$strRow\\t\\t\\t\\t</tr>\\n\";\n\t\t}\n\t\t\n\t\t$arrRenderMode\t= Sales_Report::getRenderModeDetails(Sales_Report::RENDER_MODE_EXCEL);\n\t\t$strMimeType\t= $arrRenderMode['MimeType'];\n\n\t\t// Put it all together\n\t\t$strReport = \"<html>\n\t<head>\n\t\t<meta http-equiv=\\\"content-type\\\" content=\\\"$strMimeType\\\">\n\t</head>\n\t<body>\n\t\t<table border=\\\"1\\\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n$strHeaderRow\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n$strRows\n\t\t\t</tbody>\n\t\t</table>\n\t</body>\n</html>\";\n\n\t\treturn $strReport;\n\t}", "function tabledata($data) {\r\n\techo \"<td>\" . $data . \"</td>\\n\";\r\n}", "function ReadExcelSheet($filename) {\n \n// if($fileExtension==='xls'){\n try{\n $excel = new PhpExcelReader; // creates object instance of the class\n $excel->read($filename); \n $excel_data = ''; // to store the the html tables with data of each sheet \n $excel_data .= '<h4> ' . ('') . ' <em>' . '' . '</em></h4>' . $this->AddDatatoDB($excel->sheets[0],$filename) . '<br/>';\n }\n catch(Exception $e ){\n print_r('Exception:::'.$e->getMessage());\n }\n// }\n// else {\n// //\"The file with extension \".$fileExtension.\" is still not allowed at the moment.\");\n// }\n }", "function indexSuperficie1 () {\n\n $node_id = $this->input->post('node_id');\n\n $this->load->library('PHPExcel');\n $sheet = $this->phpexcel->setActiveSheetIndex(0);\n\n $sheet->setTitle('Reporte');\n $node = Doctrine_Core::getTable('Node')->find($node_id);\n\n $q = Doctrine_Query :: create ()\n ->select('n.node_id, nt.node_type_name, ' .\n 'iodo2.infra_other_data_option_name, SUM(infra_info_usable_area) as total_usable_area, ' .\n 'COUNT(n.node_id) as quantity_node')\n ->from('Node n')\n ->innerJoin('n.NodeType nt')\n ->innerJoin('n.InfraInfo ii')\n ->innerJoin('n.InfraOtherDataValue iodv2')\n ->innerJoin('iodv2.InfraOtherDataOption iodo2')\n ->where('node_parent_id = ?', $node->node_parent_id)\n ->andWhere('n.lft > ?', $node->lft)\n ->andWhere('n.rgt < ?', $node->rgt)\n ->andWhere('iodv2.infra_other_data_attribute_id = ?', 16)\n ->andWhereIn('iodv2.infra_other_data_option_id', array(453, 305, 454, 455, 456, 313, 329, 316))\n ->groupBy('iodv2.infra_other_data_option_id, n.node_type_id')\n ->orderBy('iodo2.infra_other_data_option_name, node_type_name');\n\n $results = $q->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\n\n // titulos\n $sheet->setCellValue('A1', $this->translateTag('General', 'faculty'));\n $sheet->setCellValue('B1', $this->translateTag('General', 'enclosure_type'));\n $sheet->setCellValue('C1', $this->translateTag('General', 'quantity'));\n $sheet->setCellValue('D1', $this->translateTag('Infrastructure', 'living_area'));\n\n $rcont = 1;\n foreach ($results as $resutl) {\n\n $rcont++;\n $sheet->setCellValue('A' . $rcont, $resutl['iodo2_infra_other_data_option_name']);\n $sheet->setCellValue('B' . $rcont, $resutl['nt_node_type_name']);\n $sheet->setCellValue('C' . $rcont, $resutl['n_quantity_node']);\n $sheet->setCellValue('D' . $rcont, $resutl['n_total_usable_area']);\n\n }\n\n $sheet->getColumnDimension('A')->setAutoSize(true);\n $sheet->getColumnDimension('B')->setAutoSize(true);\n $sheet->getColumnDimension('C')->setAutoSize(true);\n $sheet->getColumnDimension('D')->setAutoSize(true);\n\n $sheet->getStyle('A1:D1')->getFont()->applyFromArray(array(\n 'bold' => true\n ));\n\n $sheet->getStyle('A1:D1')->getFill()->applyFromArray(array(\n 'type' => PHPExcel_Style_Fill :: FILL_SOLID ,\n 'color' => array (\n 'rgb' => 'd9e5f4'\n )\n ));\n\n $sheet->getStyle('A1:D' . $rcont)->getBorders()->applyFromArray(array(\n 'allborders' => array (\n 'style' => PHPExcel_Style_Border :: BORDER_THIN ,\n 'color' => array (\n 'rgb' => '808080'\n )\n )\n ));\n\n $objWriter = PHPExcel_IOFactory :: createWriter($this->phpexcel, 'Excel5');\n $objWriter->save ( $this->app->getTempFileDir($this->input->post('file_name') . '.xls'));\n echo '{\"success\": true, \"file\": \"' . $this->input->post ( 'file_name' ) . '.xls\"}';\n\n }", "public function export_data_anggota_keluarga()\n {\n $spreadsheet = new Spreadsheet();\n $currentData = $this->AnggotaKeluargaModel->findAll();\n // tulis header/nama kolom \n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A1', 'No. KK')\n ->setCellValue('B1', 'No. KTP')\n ->setCellValue('C1', 'Nama')\n ->setCellValue('D1', 'Tempat Lahir')\n ->setCellValue('E1', 'Tanggal Lahir')\n ->setCellValue('F1', 'Jenis Kelamin')\n ->setCellValue('G1', 'Status Perkawinan')\n ->setCellValue('H1', 'Pendidikan')\n ->setCellValue('I1', 'Pekerjaan')\n ->setCellValue('J1', 'Catatan');\n\n $column = 2;\n // tulis data mobil ke cell\n foreach ($currentData as $data) {\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A' . $column, $data['noKK'])\n ->setCellValue('B' . $column, $data['noKTP'])\n ->setCellValue('C' . $column, $data['nama'])\n ->setCellValue('D' . $column, $data['tempatLahir'])\n ->setCellValue('E' . $column, $data['tanggalLahir'])\n ->setCellValue('F' . $column, $data['jenisKelamin'])\n ->setCellValue('G' . $column, $data['statusPerkawinan'])\n ->setCellValue('H' . $column, $data['pendidikan'])\n ->setCellValue('I' . $column, $data['pekerjaan'])\n ->setCellValue('J' . $column, $data['catatan']);\n $column++;\n }\n // tulis dalam format .xlsx\n $writer = new Xlsx($spreadsheet);\n $fileName = 'Data Anggota Keluarga';\n\n // Redirect hasil generate xlsx ke web client\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=' . $fileName . '.xlsx');\n header('Cache-Control: max-age=0');\n\n $writer->save('php://output');\n }", "public function excel()\n {\n // we're joining hypothetical users and payments tables, retrieving\n // the payments table's primary key, the user's first and last name,\n // the user's e-mail address, the amount paid, and the payment\n // timestamp.\n\n $payments = Person::join('persons', 'persons.id', '=', 'university.id')\n ->select(\n 'university.id',\n \\DB::raw(\"concat(persons.fname, ' ', persons.lname) as `name`\"),\n 'persons.email',\n 'payments.total',\n 'persons.created_at')\n ->get();\n\n // Initialize the array which will be passed into the Excel\n // generator.\n $paymentsArray = [];\n\n // Define the Excel spreadsheet headers\n $paymentsArray[] = ['id', 'name', 'email', 'university', 'created_at'];\n\n // Convert each member of the returned collection into an array,\n // and append it to the payments array.\n foreach ($payments as $payment) {\n $paymentsArray[] = $payment->toArray();\n }\n\n // Generate and return the spreadsheet\n Excel::create('payments', function ($excel) use ($invoicesArray) {\n\n // Set the spreadsheet title, creator, and description\n $excel->setTitle('Payments');\n $excel->setCreator('Laravel')->setCompany('WJ Gilmore, LLC');\n $excel->setDescription('payments file');\n\n // Build the spreadsheet, passing in the payments array\n $excel->sheet('sheet1', function ($sheet) use ($paymentsArray) {\n $sheet->fromArray($paymentsArray, null, 'A1', false, false);\n });\n\n })->download('xlsx');\n }", "function export_log_trx_pendebetan()\n\t{\n\t\t$trx_date=$this->uri->segment(3);\n\t\t$angsuran_id=$this->uri->segment(4);\n\t\t$datas = $this->model_transaction->get_log_trx_pendebetan($trx_date,$angsuran_id);\n\t\t$data_angsuran_temp = $this->model_transaction->get_mfi_angsuran_temp_by_angsuran_id($angsuran_id);\n\n\t\t// Create new PHPExcel object\n\t\t$objPHPExcel = $this->phpexcel;\n\t\t// Set document properties\n\t\t$objPHPExcel->getProperties()->setCreator(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setLastModifiedBy(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setTitle(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setSubject(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setDescription(\"REPORT, generated using PHP classes.\")\n\t\t\t\t\t\t\t\t\t ->setKeywords(\"REPORT\")\n\t\t\t\t\t\t\t\t\t ->setCategory(\"Test result file\");\n\t\t\t\t\t\t\t\t\t \n\t\t$objPHPExcel->setActiveSheetIndex(0); \n\t\t\n\t\t/*\n\t\t| BORDER OPTION\n\t\t*/\n\t\t$styleArray['borders']['outline']['style']=PHPExcel_Style_Border::BORDER_THIN;\n\t\t$styleArray['borders']['outline']['color']['rgb']='000000';\n\t\t/*\n\t\t| SET COLUMN WIDTH\n\t\t*/\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(15);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(30);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(20);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(20);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(20);\n\n\t\t/*\n\t\t| ROW HEADER TITLE\n\t\t*/\n\t\t$row=1;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,\"List Angsuran Ter Debet\");\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row)->getFont()->setBold(true);\n\t\t\n\t\t$row+=2;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,\"NIK\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row,\"Nama\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C'.$row,\"Jumlah Pembayaran\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('D'.$row,\"Jumlah Terdebet\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.$row,\"Selisih\");\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':E'.$row)->getFont()->setBold(true);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':A'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B'.$row.':B'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C'.$row.':C'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D'.$row.':D'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('E'.$row.':E'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':E'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t$row+=1;\n\t\t/*\n\t\t| ROW DATA\n\t\t*/\n\t\tfor($i=0;$i<count($datas);$i++){\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,$datas[$i]['nik']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row,$datas[$i]['nama']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('C'.$row,$datas[$i]['jumlah_bayar']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('D'.$row,$datas[$i]['jumlah_angsuran']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.$row,($datas[$i]['jumlah_bayar']-$datas[$i]['jumlah_angsuran']));\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':E'.$row)->getFont()->setSize(11);\n\t\t\t$row++;\n\t\t}\n\n\t\theader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n\t\theader('Content-Disposition: attachment;filename=\"ANGSURAN TER DEBET_'.$data_angsuran_temp['keterangan'].'.xlsx\"');\n\t\theader('Cache-Control: max-age=0');\n\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->save('php://output');\n\t}", "function display() {\r\n echo '<table cols=\"3\" style=\"font-size:large; font-weight:bold\">';\r\n echo '<tr>'; \r\n for ($pos = 0; $pos < 9; $pos++) { \r\n echo $this->show_cell($pos); \r\n if ($pos % 3 == 2) {\r\n echo '</tr><tr>';\r\n } \r\n }\r\n echo '</tr>';\r\n echo '</table>';\r\n }", "public function invoice_audit_trail_export_xls() {\n\n //Read page parameter to display report\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $company_id = $this->input->get('company_id');\n\n //Build required values to display invoice audit report in table format\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_invoice_audit_trail($tenant_id, $records_per_page, $offset, $field, $order_by, $payment_status, $start_date, $end_date, $invoice_id, $company_id);\n\n //EXPORT PART\n $this->load->helper('export_helper');\n $count_tabledata = count($tabledata);\n $excel_titles = array('Inv #', 'Inv Dt.', 'Inv Type', 'Taxcode', 'Discount', 'Subsidy', 'GST', 'Net Amt.', 'Prev. Inv. Number', 'Next Inv. Number');\n $excel_data = array();\n for ($i = 0; $i < $count_tabledata; $i++) {\n $paid_arr = array('PAID' => 'Paid', 'PARTPAID' => 'Part Paid', 'NOTPAID' => 'Not Paid');\n $paid_sty_arr = array('PAID' => 'color:green;', 'PARTPAID' => 'color:red;', 'NOTPAID' => 'color:red;');\n if ($tabledata[$i]->enrolment_mode == 'SELF') {\n $taxcode = $tabledata[$i]->tax_code;\n $name = $tabledata[$i]->first_name . ' ' . $tabledata[$i]->last_name;\n $status = $paid_arr[$tabledata[$i]->payment_status];\n } else {\n // Modified by dummy for internal staff enroll on 01 Dec 2014.\n if ($tabledata[$i]->company_id[0] == 'T') {\n $tenant_details = fetch_tenant_details($tabledata[$i]->company_id);\n $taxcode = $tenant_details->tenant_name;\n $name = $tenant_details->tenant_name;\n } else {\n $taxcode = $tabledata[$i]->comp_regist_num;\n $name = $tabledata[$i]->company_name;\n }\n $status = ($tabledata[$i]->payment_status > 0) ? 'Part Paid/Not Paid' : 'Paid';\n }\n $inv_type1 = $tabledata[$i]->inv_type1 . ' (' . $name . ')';\n $excel_data[$i][] = $tabledata[$i]->invoice_id;\n $excel_data[$i][] = date('d/m/Y', strtotime($tabledata[$i]->inv_date));\n $excel_data[$i][] = $inv_type1;\n $excel_data[$i][] = $this->mask_format($taxcode);\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_discnt, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_subsdy, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_gst, 2, '.', '') . ' SGD';\n $excel_data[$i][] = '$ ' . number_format($tabledata[$i]->total_inv_amount, 2, '.', '') . ' SGD';\n $excel_data[$i][] = $tabledata[$i]->invoice_id;\n $excel_data[$i][] = $tabledata[$i]->regen_inv_id;\n }\n if (empty($start_date) && empty($end_date)) {\n $period = ' for ' . date('F d Y, l');\n } else {\n $period = 'for the period';\n if (!empty($start_date))\n $period .= ' from ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $start_date)->getTimestamp());\n if (!empty($end_date))\n $period .= ' to ' . date('F d Y', DateTime::createFromFormat('d-m-Y', $end_date)->getTimestamp());\n }\n $excel_filename = 'invlice_audit_list.xls';\n $excel_sheetname = 'Invoice Audit Trail';\n $excel_main_heading = 'Accounting Reports - Invoice Audit Trail' . $period;\n export_page_fields($excel_titles, $excel_data, $excel_filename, $excel_sheetname, $excel_main_heading);\n }", "public function export(){\n \n // Skrip berikut ini adalah skrip yang bertugas untuk meng-export data tadi ke excel\n header(\"Content-type: application/vnd-ms-excel\");\n header(\"Content-Disposition: attachment; filename=Data_Transaksi.xls\");\n \n $data['header_transaksi'] = $this->header_transaksi_model->listing();\n $this->load->view('admin/export/vw_laporan_excel', $data);\n\n }", "public function actionExportarExcel()\n {\n\n $this->renderPartial('excel');\n\n }", "public function actionExportarExcel()\n {\n\n $this->renderPartial('excel');\n\n }", "static public function ctrDescargarReporte(){\n if(isset($_GET[\"reporte\"])){\n $tabla=\"ventas\";\n if(isset($_GET[\"fechaInicial\"]) && isset($_GET[\"fechaFinal\"])){\n $ventas = ModeloVentas::mdlRangoFechasVentas($tabla,$_GET[\"fechaInicial\"],$_GET[\"fechaFinal\"]);\n\n }else{\n $item=null;\n $valor=null;\n $ventas = ModeloVentas::mdlMostrarVentas($tabla,$item,$valor);\n }\n \n //CREAMOS EL ARCHIVO EXCEL\n $Name=$_GET[\"reporte\"].'.xls';\n header('Expires: 0');\n header('Cache-control: private');\n header(\"Content-type: application/vnd.ms-excel\"); // Archivo de Excel\n header(\"Cache-Control: cache, must-revalidate\"); \n header('Content-Description: File Transfer');\n header('Last-Modified: '.date('D, d M Y H:i:s'));\n header(\"Pragma: public\"); \n header('Content-Disposition:; filename=\"'.$Name.'\"');\n header(\"Content-Transfer-Encoding: binary\");\n\n echo utf8_decode(\"<table border='0'>\n <tr>\n <td style='font-weight:bold; border: 1px solid #eee;'>CODIGO</td>\n <td style='font-weight:bold; border: 1px solid #eee;'>CLIENTE</td>\n <td style='font-weight:bold; border: 1px solid #eee;'>VENDEDOR</td>\n <td style='font-weight:bold; border: 1px solid #eee;'>CANTIDAD</td>\n <td style='font-weight:bold; border: 1px solid #eee;'>PRODUCTOS</td>\n <td style='font-weight:bold; border: 1px solid #eee;'>IMPUESTO</td>\n <td style='font-weight:bold; border: 1px solid #eee;'>NETO</td>\n <td style='font-weight:bold; border: 1px solid #eee;'>TOTAL</td>\n <td style='font-weight:bold; border: 1px solid #eee;'>METODO DE PAGO</td>\n <td style='font-weight:bold; border: 1px solid #eee;'>FECHA</td>\n </tr>\");\n \n foreach ($ventas as $row => $item) {\n\n $cliente= ControladorClientes::ctrMostrarClientes(\"id\",$item[\"id_cliente\"]);\n $vendedor= ControladorUsuarios::ctrMostrarUsuarios(\"id\",$item[\"id_vendedor\"]);\n\n echo utf8_decode(\"<tr>\n\t\t\t \t\t\t<td style='border:1px solid #eee;'>\".$item[\"codigo\"].\"</td> \n\t\t\t \t\t\t<td style='border:1px solid #eee;'>\".$cliente[\"nombre\"].\"</td>\n\t\t\t \t\t\t<td style='border:1px solid #eee;'>\".$vendedor[\"nombre\"].\"</td>\n\t\t\t \t\t\t<td style='border:1px solid #eee;'>\");\n\n\t\t\t \t$productos = json_decode($item[\"productos\"], true);\n\n\t\t\t \tforeach ($productos as $key => $valueProductos) {\n\t\t\t \t\t\t\n\t\t\t \t\t\techo utf8_decode($valueProductos[\"cantidad\"].\"<br>\");\n\t\t\t \t\t}\n\n\t\t\t \techo utf8_decode(\"</td><td style='border:1px solid #eee;'>\");\t\n\n\t\t \t\tforeach ($productos as $key => $valueProductos) {\n\t\t\t \t\t\t\n\t\t \t\t\techo utf8_decode($valueProductos[\"descripcion\"].\"<br>\");\n\t\t \t\t\n\t\t \t\t}\n\n\t\t \t\techo utf8_decode(\"</td>\n\t\t\t\t\t<td style='border:1px solid #eee;'>$ \".number_format($item[\"impuesto\"],2).\"</td>\n\t\t\t\t\t<td style='border:1px solid #eee;'>$ \".number_format($item[\"neto\"],2).\"</td>\t\n\t\t\t\t\t<td style='border:1px solid #eee;'>$ \".number_format($item[\"total\"],2).\"</td>\n\t\t\t\t\t<td style='border:1px solid #eee;'>\".$item[\"metodo_pago\"].\"</td>\n\t\t\t\t\t<td style='border:1px solid #eee;'>\".substr($item[\"fecha\"],0,10).\"</td>\t\t\n\t\t \t\t\t</tr>\");\n\n\n\t\t\t}\n\n\n\t\t\techo \"</table>\";\n\n\n }\n }", "public function action_export_obic(){\n\t\t$objPHPExcel = new \\PHPExcel();\n\t\t//add header\n $header = [\n '会社NO', '伝票番号', '発生日', 'システム分類', 'サイト番号', '仕訳区分', '伝票区分', '事業所コード', '行番号', '借方総勘定科目コード',\n '借方補助科目コード', '借方補助内訳科目コード', '借方部門コード', '借方取引先コード', '借方税区分', '借方税込区分',\n '借方金額', '借方消費税額', '借方消費税本体科目コード', '借方分析コード1', '借方分析コード2', '借方分析コード3', '借方分析コード4', '借方分析コード5',\n '借方資金コード', '借方プロジェクトコード', '貸方総勘定科目コード', '貸方補助科目コード', '貸方補助内訳科目コード', '貸方部門コード',\n '貸方取引先コード', '貸方税区分', '貸方税込区分', '貸方金額', '貸方消費税額', '貸方消費税本体科目コード',\n '貸方分析コード1', '貸方分析コード2', '貸方分析コード3', '貸方分析コード4', '貸方分析コード5', '貸方資金コード',\n '貸方プロジェクトコード', '明細摘要', '伝票摘要', 'ユーザID', '借方事業所コード', '貸方事業所コード'\n ];\n\n $objPHPExcel->getProperties()->setCreator('VisionVietnam')\n ->setLastModifiedBy('Phong Phu')\n ->setTitle('Office 2007 Document')\n ->setSubject('Office 2007 Document')\n ->setDescription('Document has been generated by PHP')\n ->setKeywords('Office 2007 openxml php')\n ->setCategory('OBIC File');\n $last_column = null;\n $explicit = [7,8,10,11,12,13,15,16,27,28,29,30,32];\n\n foreach($header as $i=>$v){\n\t\t\t$column = \\PHPExcel_Cell::stringFromColumnIndex($i);\n\t\t\t$objPHPExcel->setActiveSheetIndex(0)->setCellValue($column.'1',$v);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($column.'1')\n\t\t\t\t\t\t->applyFromArray([\n\t\t\t\t\t\t 'font' => [\n\t\t\t\t\t\t 'name' => 'Times New Roman',\n\t\t\t\t\t\t 'bold' => true,\n\t\t\t\t\t\t 'italic' => false,\n\t\t\t\t\t\t 'size' => 10,\n\t\t\t\t\t\t 'color' => ['rgb'=> \\PHPExcel_Style_Color::COLOR_WHITE]\n\t\t\t\t\t\t ],\n\t\t\t\t\t\t 'alignment' => [\n\t\t\t\t\t\t 'horizontal' => \\PHPExcel_Style_Alignment::HORIZONTAL_CENTER,\n\t\t\t\t\t\t 'vertical' => \\PHPExcel_Style_Alignment::VERTICAL_CENTER,\n\t\t\t\t\t\t 'wrap' => false\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t]);\n switch($i+1){\n case 4:\n case 15:\n case 16:\n case 18:\n $width = 20;\n break;\n case 13:\n case 14:\n case 20:\n case 21:\n case 22:\n case 23:\n case 24:\n case 25:\n case 30:\n case 31:\n $width = 25;\n break;\n case 10:\n case 11:\n case 12:\n case 19:\n case 26:\n case 27:\n case 28:\n $width = 30;\n break;\n case 29:\n case 44:\n case 45:\n $width = 40;\n break;\n default:\n $width = 15;\n break;\n }\n $objPHPExcel->getActiveSheet()->getColumnDimension($column)->setWidth($width);\n $last_column = $column;\n }\n //decode params\n $param = \\Input::param();\n parse_str(base64_decode($param['p']), $params);\n //get form payment content\n $rows = $this->generate_content($params);\n $i = 0;\n foreach($rows as $row){\n\t\t\tforeach($row as $k=>$v){\n\t\t\t\t$column = \\PHPExcel_Cell::stringFromColumnIndex($k);\n\t\t\t\tif(in_array($k+1,$explicit)){\n\t\t\t\t\t$objPHPExcel->setActiveSheetIndex()->setCellValueExplicit($column.($i+2),$v,\\PHPExcel_Cell_DataType::TYPE_STRING);\n\t\t\t\t}else{\n\t\t\t\t\t$objPHPExcel->setActiveSheetIndex()->setCellValue($column.($i+2),$v);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:'.$last_column.'1')->getFill()->setFillType(\\PHPExcel_Style_Fill::FILL_SOLID);\n $objPHPExcel->getActiveSheet()->getStyle('A1:'.$last_column.'1')->getFill()->getStartColor()->setRGB('5f5f5f');\n\n\t\t$objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n\t\tob_end_clean();\n\n\t\theader(\"Last-Modified: \". gmdate(\"D, d M Y H:i:s\") .\" GMT\");\n header(\"Cache-Control: max-age=0\");\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"obic-'.date('Y-m-d').'.xls\"');\n $objWriter->save('php://output');\n\t\texit;\n }", "public function CreateExcelReport(){\n\t\t$objPHPExcel = new PHPExcel();\n\n\t\t$rows = array();\n\t\t$row_count = 2; //counter to loop through the Excel spreadsheet rows\n\n\t\t$objPHPExcel->getProperties()->setCreator(\"dxLink\")\n\t\t\t\t\t\t\t ->setLastModifiedBy(\"dxLink\")\n\t\t\t\t\t\t\t ->setTitle(\"dxLink program evaluation feedback\")\n\t\t\t\t\t\t\t ->setSubject(\"dxLink program evaluation feedback\")\n\t\t\t\t\t\t\t ->setDescription(\"Generates all data from dxLink evaluation program form\")\n\t\t\t\t\t\t\t ->setKeywords(\"dxLink evaluation program form feedback\")\n\t\t\t\t\t\t\t ->setCategory(\"evaluation result file\");\n\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A1', 'First Name')\n\t\t\t\t ->setCellValue('B1', 'Last Name')\n\t\t\t\t ->setCellValue('C1', 'Program')\n\t\t\t\t ->setCellValue('D1', 'Question')\n\t\t\t\t ->setCellValue('E1', 'Answer')\n\t\t\t\t ->setCellValue('F1', 'Comment')\n\t\t\t\t ->setCellValue('G1', 'Date Posted');\n\n \t$sql = \"SELECT doctor_answers.question_id, doctor_answers.doctor_answer, DATE_FORMAT(doctor_answers.date_of_answer,'%Y-%m-%d') AS date_of_answer, doctor_answers.comments, doctors.first_name, doctors.last_name, program_sections.program_id \n\t\tFROM doctor_answers, doctors, program_sections, questions \n\t\tWHERE doctors.doctor_id = doctor_answers.doctor_id AND program_sections.program_section_id = doctor_answers.program_section_id AND program_sections.program_section_type = 'Evaluation form' AND questions.question_id = doctor_answers.question_id\n\t\tORDER BY doctor_answers.date_of_answer DESC\";\n\n $query = $this->con->prepare($sql);\n $query->execute();\n\n while($result_row = $query->fetch(PDO::FETCH_ASSOC) ){\n \t$fisrt_name = $result_row['first_name'];\n \t$last_name = $result_row['last_name'];\n \t$program_id = $result_row['program_id']; \n\t\t\t$question_id = $result_row['question_id']; \n\t\t\t$answer = $result_row['doctor_answer']; \n\t\t\t$date_posted = $result_row['date_of_answer'];\n\t\t\t$comment = $result_row['comments'];\n\t\t\t$program = $this->Get_Program($program_id);\n\t\t\t$question = $this->Get_question($question_id);\n\t\t\tarray_push($rows, array($fisrt_name, $last_name, $program, $question, $answer, $comment, $date_posted));\n }\n \n \n foreach ($rows as $row => $column) {\n\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A' . $row_count, $column[0])\n\t\t\t\t\t\t\t ->setCellValue('B' . $row_count, $column[1])\n\t\t\t\t\t\t\t ->setCellValue('C' . $row_count, $column[2])\n\t\t\t\t\t\t\t ->setCellValue('D' . $row_count, $column[3])\n\t\t\t\t\t\t\t ->setCellValue('E' . $row_count, $column[4])\n\t\t\t\t\t\t\t ->setCellValue('F' . $row_count, $column[5])\n\t\t\t\t\t\t\t ->setCellValue('G' . $row_count, $column[6]);\n\n\t\t\t$objPHPExcel->getActiveSheet()->getRowDimension($row_count)->setRowHeight(50); \n\n\t\t $row_count++;\t\t\n\t\t}\t\n\n\t\t//Set widths of all columns\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(25);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(25);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(60);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(60);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(110);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(110);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(25);\n\n\t\t//Fill design settings for first heading row\n\t\t$objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(30);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setARGB('FF808080');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G1')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G1')->getFont()->setSize(16);\n\t\t$objPHPExcel->getActiveSheet()->freezePane('A2');\n\n\t\t//Align all cells\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G' . $row_count)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G' . $row_count)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\n\n\t\t// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\t\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->save('../Reports/dxLink_Evaluation_feedback_report.xlsx');\n\t\t\n\t\techo 'exported';\n\t\treturn true;\n\t}", "function export_xls() {\n $engagementconfs = Configure::read('engagementConf');\n $this->set('engagementconfs',$engagementconfs);\n $data = $this->Session->read('xls_export');\n //$this->Session->delete('xls_export'); \n $this->set('rows',$data);\n $this->render('export_xls','export_xls');\n }", "function excel_export($template = 0) {\n $data = $this->ticket->get_all()->result_object();\n $this->load->helper('report');\n $rows = array();\n $row = array(lang('items_item_number'), lang('items_name'), lang('items_category'), lang('items_supplier_id'), lang('items_cost_price'), lang('items_unit_price'), lang('items_tax_1_name'), lang('items_tax_1_percent'), lang('items_tax_2_name'), lang('items_tax_2_percent'), lang('items_tax_2_cummulative'), lang('items_quantity'), lang('items_reorder_level'), lang('items_location'), lang('items_description'), lang('items_allow_alt_desciption'), lang('items_is_serialized'), lang('items_item_id'));\n\n $rows[] = $row;\n foreach ($data as $r) {\n $taxdata = $this->Item_taxes->get_info($r->ticket_id);\n if (sizeof($taxdata) >= 2) {\n $r->taxn = $taxdata[0]['ticket_id'];\n $r->taxp = $taxdata[0]['code_ticket'];\n $r->taxn1 = $taxdata[1]['destination_name'];\n $r->taxp1 = $taxdata[1]['ticket_type_name'];\n $r->cumulative = $taxdata[1]['cumulative'] ? 'y' : '';\n } else if (sizeof($taxdata) == 1) {\n $r->taxn = $taxdata[0]['name'];\n $r->taxp = $taxdata[0]['percent'];\n $r->taxn1 = '';\n $r->taxp1 = '';\n $r->cumulative = '';\n } else {\n $r->taxn = '';\n $r->taxp = '';\n $r->taxn1 = '';\n $r->taxp1 = '';\n $r->cumulative = '';\n }\n\n $row = array(\n $r->ticket_id,\n $r->code_ticket,\n $r->destination_name,\n $r->destination_name,\n $r->ticket_type_name,\n $r->unit_price,\n $r->taxn,\n $r->taxp,\n $r->taxn1,\n $r->taxp1,\n $r->cumulative,\n $r->quantity,\n $r->reorder_level,\n $r->location,\n $r->description,\n $r->allow_alt_description,\n $r->is_serialized ? 'y' : '',\n $r->item_id\n );\n\n $rows[] = $row;\n }\n\n $content = array_to_csv($rows);\n if ($template) {\n force_download('items_export_mass_update.csv', $content);\n } else {\n force_download('items_export.csv', $content);\n }\n exit;\n }", "public function action_list_user(){\n $param = \\Input::param();\n $export_date = isset($param['export_date'])?date('Y-m-d', strtotime($param['export_date'])):date('Y-m-d');\n\n $bank_account_type_code = ['1' => '普通', '2' => '当座'];\n $objPHPExcel = new \\PHPExcel();\n $objPHPExcel->getProperties()->setCreator('Vision')\n ->setLastModifiedBy('Vision')\n ->setTitle('Office 2007 Document')\n ->setSubject('Office 2007 Document')\n ->setDescription('Document has been generated by PHP')\n ->setKeywords('Office 2007 openxml php')\n ->setCategory('Route File');\n $header = ['社員No', //staff_no\n '社員名', //full_name\n '社員名(カナ)', //full_name_kana\n '入社年月日', // entry_day\n '退職年月日', // retirement_date\n 'ユーザID', //user_id\n 'メールアドレス', //email\n '会社名', // company_name\n '部門コード', // department_code\n '事業本部', // bisiness_division_name\n '事業部', // division_name\n '部門', //department_name\n '役職', //post_name\n '銀行', //bank_name\n '支店', //bank_branch_name\n '口座番号', //bank_account_no\n '口座種類', //bank_account_type_code\n '名義人', //bank_account_holder\n '適用開始日', //enable_start_date\n '適用終了日', //enable_end_date\n '兼任' // concurrent_post_flg\n ];\n $last_column = null;\n foreach($header as $i=>$v){\n $column = \\PHPExcel_Cell::stringFromColumnIndex($i);\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue($column.'1',$v);\n $objPHPExcel->getActiveSheet()->getStyle($column.'1')->applyFromArray($this->formatTitleHeader);\n switch($i+1){\n case 7:\n $width = 35;\n break;\n case 6:\n case 8:\n $width = 20;\n break;\n case 11:\n case 12:\n case 18:\n $width = 30;\n break;\n case 13:\n $width = 23;\n break;\n default:\n $width = 16;\n break;\n } \n $objPHPExcel->getActiveSheet()->getColumnDimension($column)->setWidth($width);\n $last_column = $column;\n } \n \n /*====================================\n * Get list user has department enable_start_date >= export day <= enable_end_date\n * Or enable_start_date >= export day && enable_end_date IS NULL\n *====================================*/\n $query = \\DB::select('MUD.*', 'MU.*',\n \\DB::expr('MC.name AS company_name'), \\DB::expr('BUS.name AS business_name'), \\DB::expr('DIV.name AS division_name'),\n \\DB::expr('DEP.name AS department_name'), \\DB::expr('DEP.code AS department_code'), \\DB::expr('MP.name AS position_name'),\n \\DB::expr('MB.name AS bank_name'), \\DB::expr('MBB.name AS bank_branch_name'))\n ->from(['m_user_department', 'MUD'])\n ->join(['m_user', 'MU'], 'left')->on('MUD.m_user_id', '=', 'MU.id')\n\n ->join(['m_department', 'DEP'], 'left')->on('DEP.id', '=', 'MUD.m_department_id')->on('DEP.level', '=', \\DB::expr(3))\n ->join(['m_department', 'DIV'], 'left')->on('DIV.id', '=', 'DEP.parent')->on('DIV.level', '=', \\DB::expr(2))\n ->join(['m_department', 'BUS'], 'left')->on('BUS.id', '=', 'DIV.parent')->on('BUS.level', '=', \\DB::expr(1))\n ->join(['m_company', 'MC'], 'left')->on('MC.id', '=', 'BUS.m_company_id')\n ->join(['m_position', 'MP'], 'left')->on('MP.id', '=', 'MUD.m_position_id')\n ->join(['m_bank', 'MB'], 'left')->on('MB.id', '=', 'MU.m_bank_id')\n ->join(['m_bank_branch', 'MBB'], 'left')->on('MBB.id', '=', 'MU.m_bank_branch_id')\n\n ->where('MU.item_status', '=', 'active')\n ->and_where('MUD.item_status', '=', 'active')\n ->and_where_open()\n ->and_where(\\DB::expr(\"'{$export_date}'\"), 'BETWEEN', [\\DB::expr('MUD.enable_start_date'), \\DB::expr('MUD.enable_end_date')])\n ->or_where_open()\n ->and_where(\\DB::expr('MUD.enable_start_date'), '<=', $export_date)\n ->and_where(\\DB::expr('MUD.enable_end_date'), 'IS', \\DB::expr('NULL'))\n ->or_where_close()\n ->and_where_close()\n\n ->and_where('DEP.item_status', '=', 'active')\n ->and_where_open()\n ->and_where(\\DB::expr(\"'{$export_date}'\"), 'BETWEEN', [\\DB::expr('DEP.enable_start_date'), \\DB::expr('DEP.enable_end_date')])\n ->or_where_open()\n ->and_where(\\DB::expr('DEP.enable_start_date'), '<=', $export_date)\n ->and_where(\\DB::expr('DEP.enable_end_date'), 'IS', \\DB::expr('NULL'))\n ->or_where_close()\n ->and_where_close()\n ->order_by('MU.staff_no', 'ASC');\n $users = $query->execute()->as_array();\n $i = $row = 0;\n foreach($users as $user){\n $row = $i+2;\n $objPHPExcel->setActiveSheetIndex()->setCellValue('A'.$row,$user['staff_no'])\n ->setCellValue('B'.$row,$user['fullname'])\n ->setCellValue('C'.$row,$user['fullname_kana'])\n ->setCellValue('D'.$row,$user['entry_date']?\\Vision_Common::system_format_date(strtotime($user['entry_date'])):null)\n ->setCellValue('E'.$row,$user['retirement_date']?\\Vision_Common::system_format_date(strtotime($user['retirement_date'])):null)\n ->setCellValue('F'.$row,$user['user_id'])\n ->setCellValue('G'.$row,$user['email'])\n ->setCellValue('H'.$row,$user['company_name'])\n ->setCellValue('I'.$row,$user['department_code'])\n ->setCellValue('J'.$row,$user['business_name'])\n ->setCellValue('K'.$row,$user['division_name'])\n ->setCellValue('L'.$row,$user['department_name'])\n ->setCellValue('M'.$row,$user['position_name'])\n ->setCellValue('N'.$row,$user['bank_name'])\n ->setCellValue('O'.$row,$user['bank_branch_name'])\n ->setCellValue('P'.$row,$user['bank_account_no'])\n ->setCellValue('Q'.$row,@$bank_account_type_code[$user['bank_account_type_code']])\n ->setCellValue('R'.$row,$user['bank_account_holder'])\n ->setCellValue('S'.$row,$user['enable_start_date']?\\Vision_Common::system_format_date(strtotime($user['enable_start_date'])):null)\n ->setCellValue('T'.$row,$user['enable_end_date']?\\Vision_Common::system_format_date(strtotime($user['enable_end_date'])):null)\n ->setCellValue('U'.$row,$user['concurrent_post_flag']?'兼任':null);\n $i++;\n }\n\n $format = ['alignment'=>array('horizontal'=> \\PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'wrap'=>true)];\n $objPHPExcel->getActiveSheet()->getStyle('A1:U1')->getFill()->setFillType(\\PHPExcel_Style_Fill::FILL_SOLID);\n $objPHPExcel->getActiveSheet()->getStyle('A1:U1')->getFill()->getStartColor()->setRGB('25a9cb');\n\n header(\"Last-Modified: \". gmdate(\"D, d M Y H:i:s\") .\" GMT\");\n header(\"Cache-Control: max-age=0\");\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"Users-'.$export_date.'.xls\"');\n $objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n $objWriter->save('php://output');\n exit; \n return \\Response::forge();\n }", "public function makeTableur()\n {\n return $this->setDocumentPropertiesWithMetas(new Spreadsheet());\n }", "public function table()\n\t{\n\t\t$this->datatables->select('testcat.test_id AS test_id, testcat_id, gender, age, score, percentile, percentile.id AS id');\n\t\t$this->datatables->from('percentile');\n\t\t$this->datatables->join('testcat', 'testcat.id = percentile.testcat_id');\n\n\t\t$this->datatables->edit_column('test_id', '$1', 'test_get_link_by_id(test_id)');\n\t\t$this->datatables->edit_column('testcat_id', '$1', 'testcat_get_link_by_id(testcat_id)');\n\t\t$this->datatables->edit_column('gender', '$1', 'gender(gender)');\n\t\t$this->datatables->edit_column('id', '$1', 'percentile_actions(id)');\n\n\t\techo $this->datatables->generate();\n\t}", "public function excelRuv(Request $request){\n $buscar = $request->buscar;\n $etapa = $request->b_etapa;\n $manzana = $request->b_manzana;\n $lote = $request->b_lote;\n $paquete = $request->b_paquete;\n\n $lotes = Ruv::join('lotes','ruvs.id','=','lotes.id')\n ->join('fraccionamientos','lotes.fraccionamiento_id','=','fraccionamientos.id')\n ->join('etapas','lotes.etapa_id','=','etapas.id')\n ->join('modelos','lotes.modelo_id','=','modelos.id')\n ->join('personal','ruvs.user_siembra','=','personal.id')\n ->leftjoin('empresas_verificadoras as emp', 'ruvs.empresa_id','=','emp.id')\n ->select('lotes.id','lotes.num_lote','lotes.paq_ruv','fraccionamientos.nombre as proyecto',\n 'etapas.num_etapa','modelos.nombre as modelo','emp.empresa','ruvs.fecha_siembra',\n 'ruvs.fecha_carga','ruvs.num_cuv','ruvs.fecha_asignacion','fecha_revision',\n 'ruvs.fecha_dtu',\n 'personal.nombre','personal.apellidos','lotes.manzana');\n\n if($buscar != '')\n $lotes = $lotes->where('lotes.fraccionamiento_id','=',$buscar);\n if($etapa != '')\n $lotes = $lotes->where('etapas.num_etapa','like','%'.$etapa.'%');\n if($manzana != '')\n $lotes = $lotes->where('lotes.manzana','like','%'.$manzana.'%');\n if($lote != '')\n $lotes = $lotes->where('lotes.num_lote','=',$lote);\n\n if($paquete != ''){\n $lotes = $lotes->where('lotes.paq_ruv','like','%'.$paquete.'%');\n }\n\n if($request->empresa != ''){\n $lotes = $lotes->where('lotes.emp_constructora','=',$request->empresa);\n }\n\n $lotes= $lotes->orderBy('proyecto','asc')\n ->orderBy('etapas.num_etapa','asc')\n ->orderBy('modelo','asc')\n ->orderBy('lotes.num_lote','asc')\n ->orderBy('lotes.paq_ruv','asc')->get();\n\n return Excel::create(\n 'RUV',\n function ($excel) use ($lotes) {\n $excel->sheet('RUV', function ($sheet) use ($lotes) {\n \n $sheet->row(1, [\n 'Proyecto', 'Etapa', 'Manzana', '# Lote', 'Modelo', 'Paquete',\n 'Fecha', 'Solicitante', 'Carga de información', 'Numero CUV', \n 'Fecha asignacion', 'Empresa asignada', 'Rev. Documental', 'DTU'\n ]);\n \n \n $sheet->cells('A1:N1', function ($cells) {\n $cells->setBackground('#052154');\n $cells->setFontColor('#ffffff');\n // Set font family\n $cells->setFontFamily('Calibri');\n \n // Set font size\n $cells->setFontSize(13);\n \n // Set font weight to bold\n $cells->setFontWeight('bold');\n $cells->setAlignment('center');\n });\n \n $cont = 1;\n \n foreach ($lotes as $index => $lote) {\n $cont++;\n if ($lote->fecha_asignacion) {\n setlocale(LC_TIME, 'es_MX.utf8');\n $tiempo = new Carbon($lote->fecha_asignacion);\n $lote->fecha_asignacion = $tiempo->formatLocalized('%d de %B de %Y');\n }\n \n \n if ($lote->fecha_siembra) {\n setlocale(LC_TIME, 'es_MX.utf8');\n $t3 = new Carbon($lote->fecha_siembra);\n $lote->fecha_siembra = $t3->formatLocalized('%d de %B de %Y');\n }\n \n if ($lote->fecha_carga) {\n setlocale(LC_TIME, 'es_MX.utf8');\n $tiempo2 = new Carbon($lote->fecha_carga);\n $lote->fecha_carga = $tiempo2->formatLocalized('%d de %B de %Y');\n }\n \n if ($lote->fecha_revision) {\n setlocale(LC_TIME, 'es_MX.utf8');\n $tiempo = new Carbon($lote->fecha_revision);\n $lote->fecha_revision = $tiempo->formatLocalized('%d de %B de %Y');\n }\n \n if ($lote->fecha_dtu) {\n setlocale(LC_TIME, 'es_MX.utf8');\n $tiempo = new Carbon($lote->fecha_dtu);\n $lote->fecha_dtu = $tiempo->formatLocalized('%d de %B de %Y');\n }\n \n $sheet->row($index + 2, [\n $lote->proyecto,\n $lote->num_etapa,\n $lote->manzana,\n $lote->num_lote,\n $lote->modelo,\n $lote->paq_ruv,\n $lote->fecha_siembra,\n $lote->nombre.' '.$lote->apellidos,\n $lote->fecha_carga,\n $lote->num_cuv,\n $lote->fecha_asignacion,\n $lote->empresa,\n $lote->fecha_revision,\n $lote->fecha_dtu,\n\n \n ]);\n }\n $num = 'A1:N' . $cont;\n $sheet->setBorder($num, 'thin');\n });\n }\n \n )->download('xls');\n }", "public function showExp(){\n \n if(count($this->arrDataExp) > 0){\n echo '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">';\n foreach($this->arrDataExp as $type=>$arrTbl){\n\n echo '<tr>';\n echo '<td>';\n echo '&nbsp;';\n echo '</td>';\n echo '</tr>';\n\t echo '<tr>';\n echo '<td>';\n\t echo '<div style=\"border:1px solid #006600; border-style:dashed; background-color:#aecde4;padding:5px;\">';\n\t echo '<font color=\"#6A3500\"><b> เงื่อนไข : </b>';\n echo $this->arrTypeTitle[$type];\n\t echo '</font>';\n\t echo '</div>';\n echo '</td>';\n echo '</tr>';\n echo '<tr>';\n echo '<td>';\n foreach($arrTbl as $tblName=>$arrData){\n\t\t if($this->arrSubTypeTitle[$tblName] != ''){ \n\t echo \"<div style='border:1px solid #6A3500;color:#6A3500; padding:3px;'><img src='images/exclamation.png' align='absmiddle' />&nbsp;\".$this->arrSubTypeTitle[$tblName].\"</div>\";\n\t\t }\n echo '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">';\n $numRows = count($arrData);\n $i = 1;\n foreach($arrData as $key=>$arrValue){\n echo '<tr>';\n echo '<td width=\"20%\">'.$arrValue['positionName'].'</td>';\n echo '<td width=\"20%\">ระดับ '.$arrValue['levelName'].'</td>';\n echo '<td width=\"20%\">'.$arrValue['dateStartPosition'].'</td>';\n echo '<td width=\"20%\">'.$arrValue['dateEndPosition'].'</td>';\n echo '<td width=\"20%\">'.$arrValue['strPeriodPosition'].'</td>';\n echo '</tr>';\n if($i == $numRows){\n echo '<tr>';\n echo '<td colspan=\"5\"><b>ประสบการณ์ดำรงตำแหน่ง เท่ากับ '.$arrValue['strPeriodPositionAll'].'</b></td>';\n echo '</tr>';\n }\n $i++;\n } \n echo '</table>';\n\t\n\t } \n echo '</td>';\n echo '</tr>'; \n\n }\n\n echo '</table>';\n }else{\n\t echo \"<div style='border:1px solid #6A3500;color:#FFFF00; padding:3px;'><img src='images/exclamation.png' align='absmiddle' />&nbsp;ไม่พบข้อมูลตำแหน่ง</div>\"; \n }\n \n }", "public function penerima_data_bansos()\n {\n $spreadsheet = new Spreadsheet();\n $currentData = $this->BansosModel->findAll();\n // tulis header/nama kolom \n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A1', 'No. KK')\n ->setCellValue('B1', 'Kepala Keluarga')\n ->setCellValue('C1', 'ID Bansos')\n ->setCellValue('D1', 'Nama Bansos')\n ->setCellValue('E1', 'Kategori')\n ->setCellValue('F1', 'Pendamping')\n ->setCellValue('G1', 'Nominal')\n ->setCellValue('H1', 'Status Anggota');\n\n $column = 2;\n // tulis data mobil ke cell\n foreach ($currentData as $data) {\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A' . $column, $data['noKK'])\n ->setCellValue('B' . $column, $data['kepalaKeluarga'])\n ->setCellValue('C' . $column, $data['idBansos'])\n ->setCellValue('D' . $column, $data['namaBansos'])\n ->setCellValue('E' . $column, $data['kategori'])\n ->setCellValue('F' . $column, $data['pendamping'])\n ->setCellValue('G' . $column, $data['nominal'])\n ->setCellValue('H' . $column, $data['statusAnggota']);\n $column++;\n }\n // tulis dalam format .xlsx\n $writer = new Xlsx($spreadsheet);\n $fileName = 'Data Penerima Bansos';\n\n // Redirect hasil generate xlsx ke web client\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=' . $fileName . '.xlsx');\n header('Cache-Control: max-age=0');\n\n $writer->save('php://output');\n }", "public function exportToxls(){\n\t\t//echo \"exportToxls\";exit;\t\t\n\t\t$tskstatus = ManageTaskStatus::select('id as Sr.No.', 'status_name')->where('deleted_status', '=', 0)->get(); \t\t\n\t\t$getCount = $tskstatus->count(); \n\n if ($getCount < 1) { \n\t\t\t return false;\t\t\t \n } else {\n\t\t\t//export to excel\n\t\t\tExcel::create('Status Data', function($excel) use($tskstatus){\n\t\t\t\t$excel->sheet('Status', function($sheet) use($tskstatus){\n\t\t\t\t\t$sheet->fromArray($tskstatus);\n\t\t\t\t});\n\t\t\t})->export('xlsx');\t\t\t\t\n\t\t}\t\t\t\t\n\t}", "public function makeExcelSheet($data)\n\t{\n\t\t/** Reading Excel with PHPExcel_IOFactory */\n\t\trequire_once 'PHPExcel/IOFactory.php';\n\n\t\t$objReader = PHPExcel_IOFactory::createReader('Excel5');\n\t\t\n\t\t// template file\n\t\t$objPHPExcel = $objReader->load(APPLICATION_PATH . '/../data/templates/com-tpl.xls');\n\n\t\t$baseRow = 11; // base row in template file\n\t\t\n\t\tforeach($data as $r => $dataRow) {\n\t\t\t$row = $baseRow + ($r+1);\n\t\t\t\n\t\t\t$objPHPExcel->getActiveSheet()->insertNewRowBefore($row,1);\n\t\t\t\n\t\t\tif (!empty($dataRow)){\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row, ucfirst($dataRow['zone']));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row, ucfirst($dataRow['village']));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('C'.$row, ucfirst($dataRow['prod_name']));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('D'.$row, $dataRow['unit_measure']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.$row, $dataRow['quantity']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('F'.$row, ucfirst($dataRow['quality']));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('G'.$row, $dataRow['price']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('H'.$row,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t ucfirst($dataRow['contact_fname']).' '.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t ucfirst($dataRow['contact_lname']).' '.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t 'TEL: ' . $dataRow['contact_tel']);\n\t\t\t}\n\t\t}\n\t\t$objPHPExcel->getActiveSheet()->removeRow($baseRow-1,1);\n\t\t\n\t\t// fill data area with white color\n\t\t$objPHPExcel->getActiveSheet()\n\t\t\t\t\t->getStyle('A'.$baseRow .':'.'H'.$row)\n\t\t\t\t\t->getFill()\n\t\t\t\t\t->applyFromArray(\n \t\t\t\t\t\t\t array(\n \t\t \t\t 'type' \t=> PHPExcel_Style_Fill::FILL_SOLID,\n \t\t\t\t\t\t 'startcolor' \t=> array('rgb' => 'FFFFFF'),\n \t\t\t\t \t 'endcolor' \t=> array('rgb' => 'FFFFFF')\n \t\t\t\t\t ));\n\t\t\n\t\t$comNo = $dataRow['com_number'];\n\t\t$deliveryDate = date('d-m-Y', strtotime($dataRow['ts_date_delivered']));\n\t\t\n\t\t$ComTitle = \"INFORMATION SUR LES PRODUITS FORESTIERS NON LIGNEUX DU \" .\n\t\t \"CERCLE DE TOMINIAN No: $comNo Du $deliveryDate\";\n\t\t\n\t\t$titleRow = $baseRow-1;\n\t\t// create new row\n\t\t$objPHPExcel->getActiveSheet()->insertNewRowBefore($titleRow,1);\n\t\t$objPHPExcel->getActiveSheet()\n\t\t\t\t\t->mergeCells('A'.$titleRow. ':'.'H'.$titleRow)\n\t\t\t\t\t->setCellValue('A'.$titleRow, $ComTitle)\n\t\t\t\t\t->getStyle('A'.$titleRow)->getFont()\n\t\t\t\t\t->setBold(true)\n\t\t\t\t\t->setSize(13)\n\t\t\t\t\t->setColor(new PHPExcel_Style_Color());\n\t\t\t\t\t\n\t//\t$objPHPExcel->getActiveSheet()->getRowDimension('A'.$titleRow)->setRowHeight(10);\n\t\t\t\t\t\n\t\t$title = 'ComNo'.$comNo;\n\t\t// set title of sheet\n\t\t$objPHPExcel->getActiveSheet()->setTitle($title);\n\n\t\t// Redirect output to a client’s web browser (Excel5)\n\t\theader('Content-Type: application/vnd.ms-excel');\n\t\theader('Content-Disposition: attachment;filename=\"communique.xls\"');\n\t\theader('Cache-Control: max-age=0');\n\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n\t\t$objWriter->save('php://output');\n\t\texit;\n\t}", "function printResult($result) {\n echo \"<br>Employee Info<br>\";\n echo \"<table class='table table-striped'>\";\n echo \"<tr><th>Username</th>\". \" \" .\"<th>Wage</th>\". \" \" .\"<th>Job Type</th>\". \" \" .\"<th>Work Schedule</th></tr>\";\n\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr><td>\" . $row[\"USERNAME\"] . \" </td><td>\" . $row[\"WAGE\"] . \" </td><td>\" . $row[\"JOBT\"] . \"</td><td>\"\n . \" \" . $row[\"WORKS\"] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n }\n echo \"</table>\";\n }" ]
[ "0.67646", "0.67189884", "0.66751486", "0.66610664", "0.65876794", "0.6479519", "0.6458022", "0.63660556", "0.63100106", "0.6304067", "0.6279873", "0.62617314", "0.6256604", "0.6253376", "0.62355787", "0.62345177", "0.62109685", "0.620764", "0.62004745", "0.61948925", "0.6190707", "0.61703485", "0.6152192", "0.61266214", "0.6117254", "0.6089968", "0.6089574", "0.6085309", "0.608215", "0.6082005", "0.60730726", "0.6061853", "0.60567003", "0.6041331", "0.6040701", "0.60225785", "0.60142255", "0.6005918", "0.60045636", "0.6003654", "0.5988617", "0.5983673", "0.59787816", "0.596662", "0.59633493", "0.5937989", "0.5913315", "0.5911843", "0.59077704", "0.5907171", "0.5906818", "0.5900163", "0.58990896", "0.58970845", "0.5896196", "0.589501", "0.58813155", "0.5868381", "0.5865254", "0.5859727", "0.58594173", "0.5855041", "0.5847845", "0.5847351", "0.58408463", "0.5826012", "0.5821181", "0.5813628", "0.57953733", "0.5787067", "0.57779014", "0.5775755", "0.57733667", "0.5771094", "0.5769563", "0.57606506", "0.575759", "0.5754145", "0.57483673", "0.5743552", "0.57420903", "0.57394", "0.57363105", "0.5732626", "0.57319736", "0.57312286", "0.57312286", "0.57277054", "0.57227975", "0.5717096", "0.5708046", "0.5706605", "0.57045686", "0.5688947", "0.5683398", "0.56688714", "0.56655544", "0.5665008", "0.5662419", "0.5661976", "0.56518227" ]
0.0
-1
function to check validation of excel extension
public function checkFileValidation($string) { $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ); if (isset($_FILES['fileURL']['name'])) { $arr_file = explode('.', $_FILES['fileURL']['name']); $extension = end($arr_file); if (($extension == 'xlsx' || $extension == 'xls' || $extension == 'csv') && in_array($_FILES['fileURL']['type'], $file_mimes)) { return true; } else { $this->form_validation->set_message('checkFileValidation', 'Please choose correct file.'); return false; } } else { $this->form_validation->set_message('checkFileValidation', 'Please choose a file.'); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function extensionValid() \n\t{\n\t\tif (!in_array($this->extension_of_file, $this->file_types)) //{\n\t\t\tthrow new Exception(\"Invalid file Extension\",5);\n\t\t//}\n\t}", "function tableValidator( &$errors, &$warnings, &$excel, &$lang ){\n $valid = 0;\n for( $col = 1; $col <= $excel->numCols(); $col++ ) {\n if( empty($excel->valueAt( 1, $col )) ){\n for( $row = 2; $row <= $excel->numRows(); $row++ ){\n if( $excel->valueAt( $row, $col) !== '' ){\n array_push( $warnings, sprintf( $lang['xlsimport_warning_column_without_name'], chr( $col + 64 )) );\n $row = $excel->numRows();\n $valid = 1;\n }\n }\n }else{\n for( $comp_col = ($col + 1); $comp_col <= $excel->numCols(); $comp_col++ ) {\n if($excel->valueAt( 1, $col ) === $excel->valueAt( 1, $comp_col )){\n array_push( $errors, sprintf( $lang['xlsimport_warning_colname_duplicate'], chr( $col + 64 ), chr( $comp_col + 64 )));\n $valid = 2;\n }\n }\n }\n }\n return $valid;\n}", "public static function xlsValidate()\n {\n $file = $_FILES['file']['name'];\n $file_part = pathinfo($file);\n $extension = $file_part['extension'];\n $support_extention = array('xls', 'xlsx');\n if (! in_array($extension, $support_extention)) {\n throw new PointException('FILE FORMAT NOT ACCEPTED, PLEASE USE XLS OR XLSX EXTENTION');\n }\n }", "protected function checkExcel(): void\n {\n if ('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' === $this->mimeType ||\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' === $this->mimeType ||\n 'application/vnd.ms-excel' === $this->mimeType ||\n 'xls' === $this->fileExtension ||\n 'xlsx' === $this->fileExtension\n ) {\n $this->iconClass = self::ICON_EXCEL;\n }\n }", "public function testValidateDocumentXlsxValidation()\n {\n }", "function testExcelFile($file_names) {\r\n\tglobal $import_summary;\r\n\tglobal $excel_files_paths;\r\n\t$validated = true;\r\n\tforeach($file_names as $excel_file_name) {\t\r\n\t\tif(!file_exists($excel_files_paths.$excel_file_name)) {\r\n\t\t\trecordErrorAndMessage('Excel Data Reading', '@@ERROR@@', \"Non-Existent File\", \"File '$excel_file_name' in directory ($excel_files_paths) does not exist. File won't be parsed.\", $excel_file_name);\r\n\t\t\t$validated = false;\r\n\t\t}\r\n\t\tif(!preg_match('/\\.xls$/', $excel_file_name)) {\r\n\t\t\trecordErrorAndMessage('Excel Data Reading', '@@ERROR@@', \"Wrong File Extension\", \"File '$excel_file_name' in directory ($excel_files_paths) is not a '.xls' file. File won't be parsed.\", $excel_file_name);\r\n\t\t\t$validated = false;\r\n\t\t}\r\n\t}\r\n\treturn $validated;\r\n}", "public function validExtension() {\t\n\t\tif(in_array($this->extension, $this->extensions)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function testValidateDocumentXlsValidation()\n {\n }", "function fileValidate($path){\n $validate_array = array();\n $excel = new PHPExcel;\n $path =public_path().\"/uploads/\".$path;\n $objPHPExcel = PHPExcel_IOFactory::load($path);\n \t\t$validate_array['fileSize'] = filesize($path);\n $validate_array['sheetCount'] = $objPHPExcel->getSheetCount();\n for($i=0;$i<$validate_array['sheetCount'];$i++){\n $activeSheet = $objPHPExcel->setActiveSheetIndex($i); // set active sheet\n\n $validate_array['sheetRow'][$i] = $activeSheet->getHighestRow();\n $validate_array['sheetColumn'][$i] = $activeSheet->getHighestColumn();\n $validate_array['sheetDimension'][$i] = $activeSheet->calculateWorksheetDimension();\n $validate_array['sheetTitle'][$i] = $activeSheet->getTitle();\n\n $cell_collection = $activeSheet->getCellCollection();\n $arr_data = array();\n foreach ($cell_collection as $key=>$cell) {\n $column = $activeSheet->getCell($cell)->getColumn();\n $colNumber = PHPExcel_Cell::columnIndexFromString($column);\n $row = $activeSheet->getCell($cell)->getRow();\n if($row == 6)\n break;\n $data_value = $activeSheet->getCell($cell)->getValue();\n $arr_data[$row][$colNumber] = $data_value;\n //$validate_array['sheetdata'][$i] = $arr_data;\n \t}\n $validate_array['sheetData'][$i] = $arr_data;\n }\n //echo \"<pre>\"; echo json_encode($validate_array,JSON_PRETTY_PRINT); exit;\n //echo \"<pre>\"; print_r ($validate_array); exit;\n return $validate_array;\n }", "function rawpheno_validate_excel_file($file, $project_id, $source) {\n $status = array();\n\n // Process the validators to make them easier to use.\n // Specifically, sort them by their scope.\n $validators = array();\n $all_validators = module_invoke_all('rawpheno_validators');\n foreach($all_validators as $k => $v) {\n $validators[ $v['scope'] ][ $k ] = $v;\n }\n\n // Todo list.\n $all_scope_validators = array('project', 'file', 'all', 'header', 'subset');\n\n // Add the libraries needed to parse excel files.\n rawpheno_add_parsing_libraries();\n\n // Before performing any validation to the excel file. Ensure first that a project is selected.\n foreach ($validators['project'] as $prj_validator_name => $prj_validator) {\n if (isset($prj_validator['validation callback']) AND function_exists($prj_validator['validation callback'])) {\n $status[ $prj_validator_name ] = call_user_func($prj_validator['validation callback'], $project_id);\n\n // If returned false then halt validation.\n if ($status[ $prj_validator_name ] === FALSE) {\n // Fail the project and set the rest to TODO.\n $status[ $prj_validator_name ] = FALSE;\n\n // Todo the rest of validators.\n // Since this is project scope and it got falsed - remove the project.\n unset($all_scope_validators[0]);\n foreach($all_scope_validators as $v) {\n foreach($validators[ $v ] as $v_name => $validator) {\n $status[ $v_name ] = 'todo';\n }\n }\n\n return $status;\n }\n }\n }\n\n // First validate the whole file. If any of these fail then halt validation.\n foreach ($validators['file'] as $validator_name => $validator) {\n if (isset($validator['validation callback']) AND function_exists($validator['validation callback'])) {\n $status[ $validator_name ] = call_user_func($validator['validation callback'], $file);\n\n // If returned false then halt validation.\n if ($status[ $validator_name ] === FALSE) {\n // Fail the file and set the rest to TODO but set the project to passed\n // first since it is assumed that project validator returned a passed value.\n $status[ 'project_selected' ] = TRUE;\n $status[ $validator_name ] = FALSE;\n\n // Todo the rest of validators.\n // Since project is completed. skip this scope.\n unset($all_scope_validators[0]);\n foreach($all_scope_validators as $v) {\n foreach($validators[ $v ] as $v_name => $validator) {\n if ($status[ $v_name ] === TRUE) {\n $status[ $v_name ] = TRUE;\n }\n elseif ($status[ $v_name ] === FALSE) {\n $status[ $v_name ] = FALSE;\n }\n else {\n $status[ $v_name ] = 'todo';\n }\n }\n }\n\n return $status;\n }\n }\n }\n\n // Open the file for reading\n $xls_obj = rawpheno_open_file($file);\n\n // Change to the correct spreadsheet.\n rawpheno_change_sheet($xls_obj, 'measurements');\n\n // This increment variable $i is required since xls and xlsx\n // parsers assign array index differently.\n // XLS starts at 1, while XLSX at 0;\n $i = 0;\n\n // Variations of Not Applicable.\n $not_applicable = array('na', 'n/a', 'n.a.');\n\n // Skip columns.\n $skip = array();\n // Project name.\n $project_name = rawpheno_function_getproject($project_id);\n // Calling all modules implementing hook_rawpheno_ignorecols_valsave_alter():\n drupal_alter('rawpheno_ignorecols_valsave', $skip, $project_name);\n\n // Iterate though each row.\n $num_errored_rows = 0;\n $storage = array();\n foreach($xls_obj as $row) {\n $i++;\n\n // Convert row into a string and check the length.\n // This will exclude empty rows.\n if (strlen(trim(implode('', $row))) >= 5) {\n\n // VALIDATE THE HEADER.\n if ($i == 1) {\n // Save the header for later.\n $header = array();\n $new_header = array();\n // Checking plot value requires cell value in Planting Date (date) and Location.\n // Store index numbers of these two traits.\n $plot_req = array();\n\n $o = 0;\n foreach ($row as $r) {\n $without_format = rawpheno_function_delformat($r);\n\n // To maintain index of both cells and header, tag either to skip or process\n // based on headers in drupal_alter hook.\n $s = (in_array($without_format, $skip)) ? 1 : 0;\n\n // Remove new lines.\n $rem_newline = str_replace(array(\"\\n\", \"\\r\"), ' ', $r);\n // Remove extra spaces.\n $rem_spaces = preg_replace('/\\s+/', ' ', $rem_newline);\n // Remove leading and trailing spaces.\n $r = trim($rem_spaces);\n $no_units = rawpheno_get_trait_name($r);\n\n $header[] = array(\n 'no format' => $without_format,\n 'original' => $r,\n 'units' => rawpheno_function_unit($without_format),\n 'no units' => $no_units,\n 'skip' => $s,\n );\n\n // Store index number of Plot trait requirements.\n if (!isset($plot_req['planting date (date)']) && $without_format == 'plantingdate(date)') {\n $plot_req['planting date (date)'] = $o;\n }\n elseif (!isset($plot_req['location']) && $without_format == 'location') {\n $plot_req['location'] = $o;\n }\n\n $o++;\n }\n\n // Foreach validator with a scope of header, execute the validation callback & save the results.\n foreach($validators['header'] as $validator_name => $validator) {\n if (isset($validator['validation callback']) AND function_exists($validator['validation callback'])) {\n $result = call_user_func($validator['validation callback'], $header, $project_id);\n\n // The status needs to keep track of which rows failed for a given header.\n if ($result === FALSE) {\n $status[ $validator_name ] = $i;\n }\n elseif (is_array($result)) {\n $status[ $validator_name ] = $result;\n }\n }\n }\n }\n // VALIDATE THE ROW.\n else {\n\n $row_has_error = FALSE;\n foreach ($row as $column_index => $cell) {\n if ($header[$column_index]['skip'] == 1) continue;\n\n $column_name = $header[$column_index]['no units'];\n if (empty($column_name)) continue;\n\n // Prior to validating, Remove non-breaking whitespace by converting it to a blank space instead of removing it,\n // in case user intends a space between words/values.\n // trim() implementation below should drop unecessary leading and trailing spaces.\n if (preg_match('/\\xc2\\xa0/', $cell)) {\n $cell = preg_replace('/\\xc2\\xa0/', ' ', $cell);\n }\n\n // We always want to strip flanking white space.\n // FYI: This is done when the data is loaded as well.\n $cell = trim($cell);\n\n // For consistency, convert all variations of not applicable to NA.\n if (is_string($cell) && in_array(strtolower($cell), $not_applicable)) {\n $cell = 'NA';\n }\n\n // Foreach validator:\n foreach (array('all','subset') as $scope) {\n foreach($validators[$scope] as $validator_name => $validator) {\n\n // Only validate if there is a validation callback.\n if (isset($validator['validation callback']) AND function_exists($validator['validation callback'])) {\n\n // Only validate if the current validator applies to the current column.\n // Specifically, if there are no defined headers it's applicable to\n // OR if the current header is in the list of applicable headers.\n if (!isset($validator['headers']) OR in_array($column_name, $validator['headers'])) {\n\n // Execute the validation callback & save the results.\n $tmp_storage = (isset($storage[$validator_name])) ? $storage[$validator_name] : array();\n $context = array(\n 'row index' => $i,\n 'column index' => $column_index,\n 'row' => $row,\n 'header' => $header\n );\n\n // If column header is Plot, attach Plot validation requirement to\n // $context array. The indexes will be used to fetch the cell value in context row.\n if ($column_name == 'Plot') {\n $context['plot_req'] = $plot_req;\n }\n\n $result = $validator['validation callback']($cell, $context, $tmp_storage, $project_id);\n\n // Note: we use tmp storage b/c passing $storage[$validator_name] directly\n // doesn't seem to work.\n $storage[$validator_name] = $tmp_storage;\n\n // The status needs to keep track of which rows failed for a given header.\n if (is_array($result)) {\n $status[ $validator_name ][ $column_name ][$i] = $result;\n $row_has_error = TRUE;\n }\n elseif ($result !== TRUE) {\n $status[ $validator_name ][ $column_name ][$i] = $i;\n $row_has_error = TRUE;\n }\n }\n }\n }\n }\n }\n\n if ($row_has_error) $num_errored_rows++;\n }\n\n // Only check until you have 10 rows with errors.\n if ($num_errored_rows >= 10) {\n // We only want to present the warning if this is not the end of the file ;-)\n $has_next = $xls_obj->next();\n if ($has_next AND strlen(trim(implode('', $has_next))) >= 1) {\n $check_limit_message = \"We have only checked the first $i lines of your file. Please fix the errors reported below and then upload the fixed file.\";\n\n if ($source == 'upload') {\n drupal_set_message($check_limit_message, 'error');\n return $status;\n }\n elseif ($source == 'backup') {\n return array('status' => $status, 'check_limit' => $check_limit_message);\n }\n }\n }\n }\n }\n\n // Make sure all validators are represented in status.\n // If they are not already then a failure wasn't recorded -thus they passed :-).\n foreach($all_validators as $validator_name => $validator) {\n if (!isset($status[$validator_name])) {\n $status[$validator_name] = TRUE;\n }\n }\n\n return $status;\n}", "public function checkExtObj() {}", "public function checkExtObj() {}", "public function rules()\n {\n return [\n \n 'excel' => 'required|mimes:csv,xls,xlsx'\n\n ];\n }", "public function extension_validation($file_ext,$extensions){\n\t\tif(in_array($file_ext,$extensions) == false){\n\t\t\treturn true;\n\t\t}\n\t}", "public function extension_validation($file_ext,$extensions){\n\t\tif(in_array($file_ext,$extensions) == false){\n\t\t\treturn true;\n\t\t}\n\t}", "protected function checkExtension() {\n\t\t\n\t\t//If no extensions set, all are valid\n\t\tif(empty($this->valid_extensions)) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$extension = $this->getExtension();\n\t\t\n\t\treturn in_array($extension, $this->valid_extensions) ? true : false;\n\t\t\n\t}", "public function rules()\n {\n return [\n //'excel' => 'required|mimes: xlsx, xls' // Excel mime type detection seems to be buggy.\n 'excel' => 'required',\n ];\n }", "public function is_file_valid($ext){\r\n\t\t$rslt = false;\r\n\r\n\t\tif($ext == '.doc' || $ext == '.DOC' || $ext == '.docx' || $ext == '.DOCX' || $ext == '.xls' || $ext == '.XLS' || $ext == '.xlsx' || $ext == '.XLSX' || $ext == '.ppt' || $ext == '.PPT' || $ext == '.pptx' || $ext == '.PPTX' || $ext == '.pdf' || $ext == '.PDF' || $ext == '.jpg' || $ext == '.JPG' || $ext == '.png' || $ext == '.PNG' || $ext == '.csv' || $ext == '.CSV' || $ext == '.gif' || $ext == '.GIF' || $ext == '.zip' || $ext == '.ZIP') {\r\n\r\n\t\t\t$rslt = true;\r\n\t\t}\r\n\r\n\t\treturn $rslt;\r\n\r\n\t}", "function checkX($currentCell,$lineCount,$cellNumber){ // CHECK 17, 18\n\t$a = array('X','x',''); //echo \"checking for an X\";\n\t$cellPassesInspection=false; // assume the cell does not pass inspection\n\t$cellPassesInspection=in_array($currentCell, $a);\n\tif ($cellPassesInspection==false){// the data has failed verification, there is no point in checking anything else... so break and throw an exception\n//\tthrowError(new Exception(\"Data failed verification at cell \" .$cellNumber.\" . In row \" . $lineCount.\".\")); // going to avoid exceptions, maybe a better way is to make an array of error locations for fixing\n\techo \"<p style='font-family:arial;color:red;font-size:14px;'> Error parsing value :<b> \" .$currentCell . \"</b> in cell number \" .$cellNumber .\" in row number \" . $lineCount .\" . Please correct the value in the csv file and resubmit!</p>\";\n\treturn false;\n\t}else{\n\techo \" <br/><B>Row \".$lineCount.\" / Cell \".$cellNumber.\" has passed verification!</B><br/>\";\n\treturn true;\n\t\t}\n\t}", "public function is_valid_vb_spec($data_array) {\n\n // Check that there are at least two rows.\n if ( count($data_array) < 2 ) {\n $this->notifier->add('There must be at least two rows in the '\n . 'uploaded dataset.', 'error');\n return false;\n }\n\n // Split the dataset into the header row and the rest of the sheet\n $header = $data_array[0]; // Just the first row\n $data_array = array_slice($data_array, 1); // Everything but the first row\n\n // Count the number of timepoint columns and check that there is\n // at least one.\n $num_timepoint_cols = count(self::ordered_columns_of_type($header, 0));\n if ($num_timepoint_cols < 1) {\n $this->notifier->add(esc_html('There must be at least one timepoint column. '\n . 'None were found. Note that syntax for timepoint column '\n . 'headers is strict: the fieldname must be machine-readable '\n . 'as a date. Try formats like \"2012\" or \"2012-08\" or \"3Q 2008\".'),\n 'error', 108);\n return false;\n }\n\n // Count the number of level columns and check that there is\n // at least one.\n $num_level_cols = count(self::ordered_columns_of_type($header, 1));\n if ($num_level_cols < 1) {\n $this->notifier->add(esc_html('There must be at least one LEVEL column. '\n . 'None were found. Note that syntax for LEVEL column '\n . 'headers is strict: the fieldname must be of the form '\n . 'LEVEL<N>, where <N> is an integer.'),\n 'error', 109);\n return false;\n }\n\n return true;\n }", "public function validateExtensionplan(){\n $allowed = array('jpeg', 'jpg', 'png');\n $filename = $this->getplanFloor('name');\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n if(!in_array($ext,$allowed)) {\n return false;\n } else {\n return true;\n }\n }", "public function mimeTypeValid()\n\t{\n\t\tif (!in_array($this->files['type'], $this->mime_types)) {\n\t\t\tthrow new Exception(\"Invalid file Extension\",6);\n\t\t}\n\t}", "protected function checkExt(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Ext) && $this->_Ext !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Ext} is not a valid value for Ext\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\tif ( $isValid && strlen($this->_Ext) > 8 ) {\n\t\t\t$inMessage .= \"Ext cannot be more than 8 characters\";\n\t\t\t$isValid = false;\n\t\t}\n\t\tif ( $isValid && strlen($this->_Ext) <= 1 ) {\n\t\t\t$inMessage .= \"Ext must be more than 1 character\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\t\t\t\n\t\treturn $isValid;\n\t}", "public function extens(){\n $this->typefl = pathinfo($this->filename, PATHINFO_EXTENSION);\n\n if(!in_array($this->typefl, $this->type)){\n echo \"Wrong extension!!!\";\n return false;\n }\n else{\n return true;\n }\n }", "public function checkExtensions()\r\n\t{\r\n\t\treturn (strcasecmp(pathinfo($this->targetFile, PATHINFO_EXTENSION), pathinfo($this->referenceFile, PATHINFO_EXTENSION)) === 0);\r\n\t}", "private function checkExtensionRowType()\n {\n $rowType = strtolower($this->extension->attributes->getNamedItem('rowType')->nodeValue);\n if (in_array($rowType, $this->dwcRequiredRowTypes, true))\n {\n return;\n }\n\n throw new \\Exception(trans('errors.rowtype_mismatch',\n ['file' => $this->file, 'row_type' => $rowType, 'type_file' => $this->extension->nodeValue]\n ));\n }", "function is_valid_extension ($ext) {\n $ext = strtolower($ext);\n return (is_valid_image_extension($ext) || is_valid_audio_extension($ext)\n || is_valid_video_extension($ext));\n }", "public function validate() {\n\t\t\n\t\tif(!is_dir($this->path)) {\n\t\t\tthrow new Exception('The path provided does not exist', '400');\n\t\t}\n\t\t\n\t\tif(!is_writeable($this->path)) {\n\t\t\tthrow new Exception('The path provided is not writeable', '400');\n\t\t}\n\t\t\n\t\tif(file_exists($this->path . $this->filename)) {\n\t\t\t\n\t\t\tif($this->allow_overwrite === false && $this->rename_if_exists === false) {\n\t\t\t\tthrow new Exception('The file ' . $this->filename . ' already exists', '400');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif($this->checkExtension() === false) {\n\t\t\tthrow new Exception('The file has an invalid extension', '400');\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t}", "private function isFileValid(): bool\n {\n return FileHelper::isExpectedExtensions($this->getPath(), $this->getFileExtensions());\n }", "public function checkFormatAllowed() {\n\t\t$imageFileType = pathinfo(basename($this->value[\"name\"]),PATHINFO_EXTENSION);\n\t\tif((($this->extension == \"\") && ($imageFileType == \"jpg\" || $imageFileType == \"png\" || $imageFileType == \"jpeg\"\n\t\t|| $imageFileType == \"gif\")) || ($this->extension == \"pdf\" && $imageFileType == \"pdf\" )) {\n\t\t return true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function isValid() ;", "function validateFileExtension(&$model, $fieldData, $fieldName, $allowedExts = array()) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n $extension = strtolower(pathinfo($fieldData[$fieldName]['name'], PATHINFO_EXTENSION));\n \n if (!is_array($allowedExts) || (!in_array('*', $allowedExts) && !in_array($extension, $allowedExts))) return false;\n \n return true;\n }", "public function validation();", "public static function validate() {}", "function valida_excel($archi){\n\nini_set(\"display_errors\",1);\nerror_reporting(E_ALL);\nrequire_once 'excel_reader2.php';\n$excel = new Spreadsheet_Excel_Reader($archi);\n //\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\n $cont = 0;\n $conta = 0;\n\t$no_conta = 0;\n\t$arre = \"\";\n\t$item_bueno=\"\";\n\t$item_malo=\"\";\n\t$cadena_buenos = \"\";\n\t$columnas =0;\n\n\t$formato = array(\"Hora de salida\",\"Numero de Grupo\",\"Fecha de incicio\",\"SAP ( Cliente)\",\"Pedido\",\"Kilos\",\"Economico\",\"Unidad Medida\",\"Fecha estimada\",\"Hora de Entrada\",\"Hora de Salida\",\"Comentarios\",\"Hora de Llegada\");\n\t$formato_actual = array();\t\n\t$bandera = true;\t\n\t$m = -1;\n\t\n\n for ($row=1;$row<2;$row++){\n \t for ($col=1;$col<=$excel->colcount();$col++) {\n \t\t $m = $m +1;\n \t\t if($excel->val($row,$col)!=\"\"){\n \t\t\t\t \t $formato_actual[$m] = strtoupper($excel->val($row,$col));\n \t\t\t\t\t $columnas = $columnas +1; \n \t\t\t\t}else{\n\t\t\t\t\t break;\n\t\t\t\t}\n \t\t }\n }\n\n\t \n if($columnas == count($formato)){\n // Echo \"formato completo\";\n \t for ($col=0;$col<count($formato_actual);$col++) {\n \t \n \t if(in_array($formato_actual[$col],$formato)){\n \t\t\t\t if( $formato_actual[$col] == $formato[$col]){\n\t\t\t\t\t // echo ' no estan en la misma posicion <b style=\"color:#00ff00;\">'.$formato_actual[$col] .'=='. $formato[$col].'</b><br />';\n\t\t\t\t\t\t\t $bandera = true;\n\t\t\t\t\t }else{\n\t\t\t\t\t // echo ' La posicion de las columnas no es correcta <b style=\"color:#993300;\">'.$formato_actual[$col] .'=='. $formato[$col].'</b><br />';\n\t\t\t\t\t\t\t $bandera = false;\n \t\t\t\t break;\n\t\t\t\t\t }\n \t\t\t }else{\n \t\t\t\t //echo \"segun este \".$formato_actual[$col].'<br />';\n \t\t\t\t\t $bandera = false;\n \t\t\t\t break;\n \t\t\t }\n \t\t}\n \t\n }else{\n \t$bandera = false;\n }\n\n\n\nreturn $bandera;\n}", "public function validate(){\n\n if(!$this->convert_and_validate_rows()){\n return 0;\n }\n\n if(!$this->validate_columns()){\n return 0;\n }\n\n if(!$this->validate_regions()){\n return 0;\n }\n\n return 1;\n }", "function is_valid_image_extension ($ext) {\n switch ($ext = strtolower($ext)) {\n //Pictures\n case 'jpg':\n case 'gif':\n case 'png':\n case 'bmp':\n case 'xbm':\n return true;\n\n //Denied extension\n default:\n return false;\n }\n }", "abstract public function validateData();", "public function isAllowedExtension()\n {\n if (!empty($this->allowed_upload_file_ext)) {\n if (!is_array($this->allowed_upload_file_ext)) {\n NUCLEUS_Exceptions::catcher(FILE_TYPE_LIST_ERROR);\n return false;\n }\n else {\n if (!in_array($this->_file_info['ext'], $this->allowed_upload_file_ext)) {\n NUCLEUS_Exceptions::catcher(UPLOAD_FILE_TYPE_DENIED);\n return false;\n }\n }\n }\n\n return true;\n }", "public function validateHeader($cell)\n {\n $array = [\n 'Cidade ou Região',\n 'Faixa CEP Inicial',\n 'Faixa CEP Final',\n 'Peso Inicial',\n 'Peso Final',\n 'Valor Frete',\n 'Prazo de Entrega',\n 'AD VALOREM ( % )',\n 'KG Adicional'\n ];\n\n if (!in_array($cell, $array, true)) {\n throw new \\InvalidArgumentException(ERROR_FILE_INVALID_IMPORT_EXCEL, E_USER_WARNING);\n }\n }", "public function validate()\n {\n return $this->ensureExtensionLoaded() &&\n $this->validateSourceLocation() &&\n $this->validateCondition() &&\n $this->validateExpressions();\n }", "function validateFile($fieldname)\n{\n $error = '';\n if (!empty($_FILES[$fieldname]['error'])) {\n switch ($_FILES[$fieldname]['error']) {\n case '1':\n $error = 'Upload maximum file is 4 MB.';\n break;\n case '2':\n $error = 'File is too big, please upload with smaller size.';\n break;\n case '3':\n $error = 'File uploaded, but only halef of file.';\n break;\n case '4':\n $error = 'There is no File to upload';\n break;\n case '6':\n $error = 'Temporary folder not exists, Please try again.';\n break;\n case '7':\n $error = 'Failed to record File into disk.';\n break;\n case '8':\n $error = 'Upload file has been stop by extension.';\n break;\n case '999':\n default:\n $error = 'No error code avaiable';\n }\n } elseif (empty($_FILES[$fieldname]['tmp_name']) || $_FILES[$fieldname]['tmp_name'] == 'none') {\n $error = 'There is no File to upload.';\n } elseif ($_FILES[$fieldname]['size'] > FILE_UPLOAD_MAX_SIZE) {\n $error = 'Upload maximum file is '.number_format(FILE_UPLOAD_MAX_SIZE/1024,2).' MB.';\n } else {\n //$get_ext = substr($_FILES[$fieldname]['name'],strlen($_FILES[$fieldname]['name'])-3,3);\t\n $cekfileformat = check_file_type($_FILES[$fieldname]);\n if (!$cekfileformat) {\n $error = 'Upload File only allow (jpg, gif, png, pdf, doc, xls, xlsx, docx)';\n }\n }\n\n return $error;\n}", "public abstract function validation();", "public function ext() {\n\t\treturn \"xls\";\n\t}", "public function rules()\n {\n return [\n 'file' => 'required',\n 'extension' => 'required|in:txt,csv,xlsx'\n ];\n }", "function isValid();", "function check_file_extension($ext, $allowed) {\nif (in_array($ext, $allowed)) {\nreturn true;\n}else {\necho \"Only .txt file allow to be uploaded\";\n}\n}", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "function ReadExcelSheet($filename) {\n \n// if($fileExtension==='xls'){\n try{\n $excel = new PhpExcelReader; // creates object instance of the class\n $excel->read($filename); \n $excel_data = ''; // to store the the html tables with data of each sheet \n $excel_data .= '<h4> ' . ('') . ' <em>' . '' . '</em></h4>' . $this->AddDatatoDB($excel->sheets[0],$filename) . '<br/>';\n }\n catch(Exception $e ){\n print_r('Exception:::'.$e->getMessage());\n }\n// }\n// else {\n// //\"The file with extension \".$fileExtension.\" is still not allowed at the moment.\");\n// }\n }", "public function isValid($_throwExceptionOnInvalidData = false);", "private function check_is_empty($excel) {\n $error_msg = '';\n if (empty($excel['taxcode']))\n $error_msg .= 'Employee Taxcode Required.';\n if (empty($excel['enrollment_type'])) {\n $error_msg .= 'Enrollment Type Required.';\n } else {\n if (($excel['enrollment_type'] != 'FIRST')) {\n if ($excel['enrollment_type'] != 'RETAKE') {\n $error_msg .='Invalid Enrollment Type';\n }\n }\n }\n if ($excel['enrollment_type'] == 'RETAKE') {\n if (empty($excel['enrol_retake_pay_mode'])) {\n $error_msg .= 'Enrollment Type being RE-TAKE, Mode of Payment is required.';\n } else {\n if ($excel['enrol_retake_pay_mode'] != 'REQUIRED') {\n if ($excel['enrol_retake_pay_mode'] != 'BYPASS') {\n $error_msg .='Invalid Re-take Payment Mode.';\n }\n }\n }\n }\n if (!empty($excel['subsidy_amount'])) {\n if (!is_numeric($excel['subsidy_amount'])) {\n $error_msg .= 'Invalid Subsidy Amount.';\n } else {\n if (empty($excel['subsidy_recd_on'])) {\n $error_msg .= 'Subsidy recd. on date required, as subsidy amount is present.';\n } else {\n if (strtotime($excel['subsidy_recd_on']) === FALSE) {\n $error_msg .= 'Invalid Subsidy Received on Date Format.';\n }\n }\n }\n }\n return $error_msg;\n }", "abstract protected function validateFile() : object;", "public function file_check($str){\n \t$allowed_mime_type_arr = array('application/pdf');\n \tif(isset($_FILES['file']['name']) && $_FILES['file']['name']!=\"\"){\n \t\t$mime = get_mime_by_extension($_FILES['file']['name']);\n \t\tif(in_array($mime, $allowed_mime_type_arr)){\n \t\t\treturn true;\n \t\t}else{\n \t\t\t$this->form_validation->set_message('file_check', 'Extension File Hanya Boleh PDF');\n \t\t\treturn false;\n \t\t}\n \t}else{\n \t\t// $this->form_validation->set_message('file_check', 'Silahkan Pilih File PDF nya.');\n \t\t// return false;\n \t\treturn true;\n \t}\n }", "function isValidDocument($docFormat, $document){\n $name = $document['name'];\n $ext = explode('.', $name);\n $ext = '.' . $ext[1];\n\n if($ext == $docFormat){\n if($document['error'] === 0){\n return true;\n }\n else{\n echo \"error uploading document\";\n return false;\n }\n }\n else{\n echo \"doc type does not match documents true extension\";\n }\n }", "public function validateExtensions($attribute){\n $infoFile = $this->$attribute;\n if (!in_array(pathinfo($infoFile['file']['name'], PATHINFO_EXTENSION), ['png', 'jpg', 'jpeg'])) {\n $this->addError($attribute, \\Yii::t('app', 'extensions',['attribute' => $this->attributeLabels()[$attribute]]));\n }\n }", "protected function validateExtension($ext,$addional_ext = [])\n\t{\n\t\t$ext = strtolower($ext);\n $valid_extensions = array_merge(['png', 'jpg', 'jpeg', 'gif', 'webp'],$addional_ext);\n\t\treturn in_array($ext,$valid_extensions);\n\t}", "public function validate($extension) {\n\n\t\t$this->validateExtensionKey($extension->getExtKey());\n\n\t\t//Other Validation\n\n\t\t//Return results\n\t\treturn $this->getValidationResult();\n\n\t}", "public function getValidExtensions();", "function validate(){\n }", "private function isValidImage() {\r\n\t\t\treturn in_array($this->extension, $this->extAllowed) ? true : false;\r\n\t\t}", "abstract public function validate();", "abstract public function validate();", "protected function checkIfNoConflictingExtensionIsInstalled() {}", "abstract protected function excel ();", "protected function _validate() {\n\t}", "function validate()\n\t{\n\t}", "public function upload_category_excel() {\n $data = array();\n $this->form_validation->set_rules('fileURL', 'Upload File', 'callback_checkFileValidation');\n if ($this->form_validation->run() == false) {\n \n } else {\n if (!empty($_FILES['fileURL']['name'])) {\n $extension = pathinfo($_FILES['fileURL']['name'], PATHINFO_EXTENSION);\n\n if ($extension == 'csv') {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();\n } elseif ($extension == 'xlsx') {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();\n } else {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xls();\n }\n\n $spreadsheet = $reader->load($_FILES['fileURL']['tmp_name']);\n $allDataInSheet = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);\n\n $arrayCount = count($allDataInSheet);\n $flag = 0;\n $createArray = array('ar_name', 'en_name', 'discount');\n $makeArray = array('ar_name' => 'ar_name', 'en_name' => 'en_name', 'discount' => 'discount');\n\n $SheetDataKey = array();\n $mydata = array();\n foreach ($allDataInSheet as $dataInSheet) {\n foreach ($dataInSheet as $key => $value) {\n if (in_array(trim($value), $createArray)) {\n $value = preg_replace('/\\s+/', '', $value);\n $SheetDataKey[trim($value)] = $key;\n }\n }\n }\n $dataDiff = array_diff_key($makeArray, $SheetDataKey);\n if (empty($dataDiff)) {\n $flag = 1;\n }\n if ($flag == 1) {\n for ($i = 2; $i <= $arrayCount; $i++) {\n $ar_name = $SheetDataKey['ar_name'];\n $en_name = $SheetDataKey['en_name'];\n $discount = $SheetDataKey['discount'];\n\n $ar_name = filter_var(trim($allDataInSheet[$i][$ar_name]), FILTER_SANITIZE_STRING);\n $en_name = filter_var(trim($allDataInSheet[$i][$en_name]), FILTER_SANITIZE_STRING);\n $discount = filter_var(trim($allDataInSheet[$i][$discount]), FILTER_SANITIZE_STRING);\n\n $fetchData = array('ar_name' => $ar_name, 'en_name' => $en_name, 'discount' => $discount);\n $data['dataInfo'] = $fetchData;\n array_push($mydata, $fetchData);\n }\n }\n $data['mydata'] = $mydata;\n $data['title'] = $this->lang->line('admin_category');\n $data['page'] = rest_path('category/display_category_excel');\n $data['get_printer'] = $this->get_printer();\n $data['category_branch_location'] = $this->get_branch_location();\n $this->load->view('index', $data);\n }\n }\n }", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function checkSubExtObj() {}", "private function writeDataValidity(): void\n {\n // Datavalidation collection\n $dataValidationCollection = $this->phpSheet->getDataValidationCollection();\n\n // Write data validations?\n if (!empty($dataValidationCollection)) {\n // DATAVALIDATIONS record\n $record = 0x01B2; // Record identifier\n $length = 0x0012; // Bytes to follow\n\n $grbit = 0x0000; // Prompt box at cell, no cached validity data at DV records\n $horPos = 0x00000000; // Horizontal position of prompt box, if fixed position\n $verPos = 0x00000000; // Vertical position of prompt box, if fixed position\n $objId = 0xFFFFFFFF; // Object identifier of drop down arrow object, or -1 if not visible\n\n $header = pack('vv', $record, $length);\n $data = pack('vVVVV', $grbit, $horPos, $verPos, $objId, count($dataValidationCollection));\n $this->append($header . $data);\n\n // DATAVALIDATION records\n $record = 0x01BE; // Record identifier\n\n foreach ($dataValidationCollection as $cellCoordinate => $dataValidation) {\n // options\n $options = 0x00000000;\n\n // data type\n $type = CellDataValidation::type($dataValidation);\n\n $options |= $type << 0;\n\n // error style\n $errorStyle = CellDataValidation::errorStyle($dataValidation);\n\n $options |= $errorStyle << 4;\n\n // explicit formula?\n if ($type == 0x03 && preg_match('/^\\\".*\\\"$/', $dataValidation->getFormula1())) {\n $options |= 0x01 << 7;\n }\n\n // empty cells allowed\n $options |= $dataValidation->getAllowBlank() << 8;\n\n // show drop down\n $options |= (!$dataValidation->getShowDropDown()) << 9;\n\n // show input message\n $options |= $dataValidation->getShowInputMessage() << 18;\n\n // show error message\n $options |= $dataValidation->getShowErrorMessage() << 19;\n\n // condition operator\n $operator = CellDataValidation::operator($dataValidation);\n\n $options |= $operator << 20;\n\n $data = pack('V', $options);\n\n // prompt title\n $promptTitle = $dataValidation->getPromptTitle() !== '' ?\n $dataValidation->getPromptTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($promptTitle);\n\n // error title\n $errorTitle = $dataValidation->getErrorTitle() !== '' ?\n $dataValidation->getErrorTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($errorTitle);\n\n // prompt text\n $prompt = $dataValidation->getPrompt() !== '' ?\n $dataValidation->getPrompt() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($prompt);\n\n // error text\n $error = $dataValidation->getError() !== '' ?\n $dataValidation->getError() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($error);\n\n // formula 1\n try {\n $formula1 = $dataValidation->getFormula1();\n if ($type == 0x03) { // list type\n $formula1 = str_replace(',', chr(0), $formula1);\n }\n $this->parser->parse($formula1);\n $formula1 = $this->parser->toReversePolish();\n $sz1 = strlen($formula1);\n } catch (PhpSpreadsheetException $e) {\n $sz1 = 0;\n $formula1 = '';\n }\n $data .= pack('vv', $sz1, 0x0000);\n $data .= $formula1;\n\n // formula 2\n try {\n $formula2 = $dataValidation->getFormula2();\n if ($formula2 === '') {\n throw new WriterException('No formula2');\n }\n $this->parser->parse($formula2);\n $formula2 = $this->parser->toReversePolish();\n $sz2 = strlen($formula2);\n } catch (PhpSpreadsheetException $e) {\n $sz2 = 0;\n $formula2 = '';\n }\n $data .= pack('vv', $sz2, 0x0000);\n $data .= $formula2;\n\n // cell range address list\n $data .= pack('v', 0x0001);\n $data .= $this->writeBIFF8CellRangeAddressFixed($cellCoordinate);\n\n $length = strlen($data);\n $header = pack('vv', $record, $length);\n\n $this->append($header . $data);\n }\n }\n }", "abstract protected function validate(): bool;", "public function isValidType( $ext=null ){\n global $VALID_FILES;\n if (!$ext)\n $ext = $this->ext; \n return (in_array( $ext, $VALID_FILES )); \n }", "function validate_expense_file() {\n return validate_post_file($this->input->post(\"file_name\"));\n }", "function resourceValidator( &$errors, &$warnings, &$resources, &$lang ){\n $valid = 0;\n foreach( $resources as $row => $res ){\n $rid = $res->resourceId();\n if( $rid == 0 ){\n $valid = 2;\n array_push( $errors, sprintf( $lang['xlsimport_error_resource_not_found'], $row ) );\n }\n\n if( $res->getType() == 0 ) {\n $valid = 2;\n array_push( $errors, sprintf( $lang['xlsimport_error_resource_type_unknown'], $row, $res->getTypeName() ) );\n }\n }\n return $valid;\n}" ]
[ "0.7111907", "0.6916137", "0.69068867", "0.6834214", "0.6832493", "0.6718815", "0.6714836", "0.6647879", "0.64669764", "0.646332", "0.6404592", "0.6402823", "0.6359192", "0.6353798", "0.6353798", "0.63263005", "0.6249764", "0.62161684", "0.61907876", "0.6153609", "0.61182797", "0.60514253", "0.6041848", "0.60356504", "0.6004539", "0.5988105", "0.5958514", "0.5958307", "0.5956339", "0.5951943", "0.59480727", "0.5873874", "0.5872759", "0.58531123", "0.57705003", "0.5768218", "0.5765847", "0.575607", "0.57446325", "0.57420623", "0.57359594", "0.5735506", "0.5718221", "0.5714686", "0.5713292", "0.569748", "0.5696625", "0.56894106", "0.56894106", "0.56894106", "0.56894106", "0.56894106", "0.56894106", "0.56894106", "0.56894106", "0.56894106", "0.56894106", "0.56894106", "0.56894106", "0.56878525", "0.56774586", "0.56754524", "0.56735474", "0.5665637", "0.5659887", "0.56577575", "0.56502634", "0.5650048", "0.5630882", "0.56284803", "0.5625666", "0.56254315", "0.56254315", "0.5611953", "0.5601622", "0.5588432", "0.5584705", "0.5579472", "0.5573399", "0.5573399", "0.5573399", "0.5573399", "0.5573399", "0.5573399", "0.5573399", "0.5573399", "0.5573399", "0.5573399", "0.5573399", "0.5573399", "0.5573399", "0.5573399", "0.5573399", "0.5573399", "0.5569469", "0.55679995", "0.55651337", "0.55625784", "0.55568206", "0.55507344" ]
0.6274524
16
function to insert the data in excel into database
public function insert_category_excel() { $counter = $_POST['category_excel_form_number']; $data = array(); for ($i = 0; $i < $counter; $i++) { $config['upload_path'] = "assets/lib/images/category/"; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->load->library('upload', $config); $imagename = $_FILES['image_' . $i]['name']; $this->upload->initialize($config); if (!$this->upload->do_upload('image_' . $i)) { $error = array('error' => $this->upload->display_errors()); } else { $success = array('image_metadata' => $this->upload->data()); } $ar_name = $_POST['ar_name_' . $i]; $en_name = $_POST['en_name_' . $i]; $discount = $_POST['discount_' . $i]; if (isset($_POST['category_printer_' . $i])) { $printer = json_encode($_POST['category_printer_' . $i]); } else { $printer = NULL; } if (isset($_POST['branch_location_' . $i])) { $branch_location = $_POST['branch_location_' . $i]; foreach ($branch_location as $key => $value) { $branch_location_id = $value; $sub_array = array('ar_name' => $ar_name, 'en_name' => $en_name, 'discount' => $discount / 100, 'branch_location_id' => $branch_location_id, 'image' => $imagename, 'printer_id' => $printer); array_push($data, $sub_array); } } else { $branch_location_id = NULL; $sub_array = array('ar_name' => $ar_name, 'en_name' => $en_name, 'discount' => $discount / 100, 'branch_location_id' => $branch_location_id, 'image' => $imagename, 'printer_id' => $printer); array_push($data, $sub_array); } } $this->Category_crud->insert_category($data); redirect(rest_path('Category')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function import_xls($filename = ''){\n\t\trequire_once('includes/xls_report/PHPExcel.php');\n\t\t$xls_file = 'uploads/DataBkd/DocUpload/'.$filename;\n\n\t\t$objReader = new PHPExcel_Reader_Excel5();\n\t\t$objReader->setReadDataOnly(true);\n\t\t$objPHPExcel = $objReader->load($xls_file); #return $filename;\n\t\t$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,false);\n\t\t$totalrow = count($sheetData); #return $sheetData;\n\t\t\n\t\t$kd_prodi = $sheetData[0][1];\n\t\t# get active record\n\t\t$start_record = 9;\n\t\t$start_col = 2;\n\t\twhile ($start_record < $totalrow){\n\t\t\t$a = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nira\n\t\t\t$b = str_replace(\"'\",\"\\'\",$sheetData[$start_record][$start_col]); $start_col++; #nm_asesor\n\t\t\t$c = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nm_pt\n\t\t\t$d = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; \n\t\t\t$e = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t$f = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t# simpan ke database \n\t\t\t$api_url \t= URL_API_BKD.'bkd_dosen/insert_asesor';\n\t\t\t$parameter = array('api_search' => array($a, $b, $c, $d, $e, $f, $kd_prodi));\n\t\t\t$this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t\t\n\t\t\t$start_record++;\n\t\t\t$start_col = 2;\n\t\t}\n\t\t$api_url \t= URL_API_BKD.'bkd_dosen/get_nama_prodi';\n\t\t$parameter = array('api_search' => array($kd_prodi));\n\t\t$nm = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\n\t\t$data['status'] = '<div class=\"alert alert-success\"><i class=\"icon icon-ok-sign\"></i> Import Data Asesor untuk program studi '.$nm.' selesai...\n\t\t\t\t\t\t\t<br/>Lihat Daftar Asesor Prodi'.$nm.' <a href=\"'.base_url().'bkd/admbkd/asesor/prodi/'.$kd_prodi.'\">Klik disini</a></div>';\n\t\t$this->output99=$this->s00_lib_output;\n\t\t$this->output99->output_display('admbkd/form_import',$data);\n\t}", "public function import()\n\t{\n\t\tinclude APPPATH . 'third_party/PHPExcel/PHPExcel.php';\n\n\t\t$excelreader = new PHPExcel_Reader_Excel2007();\n\t\t$loadexcel = $excelreader->load('excel/' . $this->filename . '.xlsx'); // Load file yang telah diupload ke folder excel\n\t\t$sheet = $loadexcel->getActiveSheet()->toArray(null, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);\n\n\t\t// Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database\n\t\t$data = array();\n\n\t\t$numrow = 3;\n\t\t$kosong = 0;\n\t\tforeach ($sheet as $row) {\n\t\t\t// Cek $numrow apakah lebih dari 1\n\t\t\t// Artinya karena baris pertama adalah nama-nama kolom\n\t\t\t// Jadi dilewat saja, tidak usah diimport\n\t\t\tif ($numrow > 3) {\n\t\t\t\t// Kita push (add) array data ke variabel data\n\t\t\t\tarray_push($data, array(\n\t\t\t\t\t'cabang' => $row['B'],\n\t\t\t\t\t'temuan' => $row['C'],\n\t\t\t\t\t'nilai_amanah' => $row['D'],\n\t\t\t\t\t'level' => $row['E'],\n\t\t\t\t\t'tingkat' => $row['F'],\n\t\t\t\t\t'avail' => $row['G'],\n\t\t\t\t\t'util' => $row['H'],\n\t\t\t\t\t'nilai_kompeten' => $row['I'],\n\t\t\t\t\t'kaloborasi' => $row['J'],\n\t\t\t\t\t'nilai_harmonis' => $row['K'],\n\t\t\t\t\t'revenue' => $row['L'],\n\t\t\t\t\t'efisiensi' => $row['M'],\n\t\t\t\t\t'nilai_loyal' => $row['N'],\n\t\t\t\t\t'koreksi' => $row['O'],\n\t\t\t\t\t'modul' => $row['P'],\n\t\t\t\t\t'nilai_adaptif' => $row['Q'],\n\t\t\t\t\t'realisasi_kpi' => $row['R'],\n\t\t\t\t\t'realisasi_pkm' => $row['S'],\n\t\t\t\t\t'nilai_kolab' => $row['T'],\n\t\t\t\t\t'nilai_total' => $row['U'],\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$numrow++; // Tambah 1 setiap kali looping\n\t\t}\n\n\t\t// Panggil fungsi insert_multiple yg telah kita buat sebelumnya di model\n\t\t$this->RaporModel->insert_multiple($data);\n\n\t\tredirect(\"/rapor\"); // Redirect ke halaman awal (ke controller rapor fungsi index)\n\t}", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_siswa' => '',\n 'nis'=>$row['A'],\n 'nisn'=>$row['B'],\n 'nama_siswa'=>$row['C'],\n 'j_kelamin'=>$row['D'],\n 'temp_lahir'=>$row['E'],\n 'tgl_lahir'=>$row['F'],\n 'kd_agama'=>$row['G'],\n 'status_keluarga'=>$row['H'],\n 'anak_ke'=>$row['I'],\n 'alamat'=>$row['J'],\n 'telp'=>$row['K'],\n 'asal_sekolah'=>$row['L'],\n 'kelas_diterima'=>$row['M'],\n 'tgl_diterima'=>$row['N'],\n 'nama_ayah'=>$row['O'],\n 'nama_ibu'=>$row['P'],\n 'alamat_orangtua'=>$row['Q'],\n 'tlp_ortu'=>$row['R'],\n 'pekerjaan_ayah'=>$row['S'],\n 'pekerjaan_ibu'=>$row['T'],\n 'nama_wali'=>$row['U'],\n 'alamat_wali'=>$row['V'],\n 'telp_wali'=>$row['W'],\n 'pekerjaan_wali'=>$row['X'],\n 'id_kelas' =>$row['Y']\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_siswa->insert_multiple($data);\n \n redirect(\"siswa\");\n }", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_guru' => '',\n 'nuptk' =>$row['A'],\n 'nama_guru' =>$row['B'],\n 'jenis_kelamin' =>$row['C'],\n 'username' =>$row['D'],\n 'password' =>password_hash($row['E'],PASSWORD_DEFAULT)\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_guru->insert_multiple($data);\n \n redirect(\"Guru\");\n }", "function import(){\n\n if(isset($_FILES[\"file\"][\"name\"])){\n\n $path = $_FILES[\"file\"][\"tmp_name\"];\n\n //object baru dari php excel\n $object = PHPExcel_IOFactory::load($path);\n\n //perulangan untuk membaca file excel\n foreach($object->getWorksheetIterator() as $worksheet){\n //row tertinggi\n $highestRow = $worksheet->getHighestRow();\n //colom tertinggi\n $highestColumn = $worksheet->getHighestColumn();\n\n //cek apakah jumlah nama dan urutan field sama\n $query = $this->MBenang->getColoumnname();\n\n for($row=3; $row<=$highestRow; $row++){\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 1\n $kd_jenis = $worksheet->getCellByColumnAndRow(0, $row)->getValue();\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 2\n $jenis_benang = $worksheet->getCellByColumnAndRow(1, $row)->getValue();\n\n $data[] = array(\n\n 'kd_jenis' => $kd_jenis,\n 'jenis_benang' => $jenis_benang\n\n );\n\n }\n\n }\n\n $this->MBenang->insertBenang($data);\n\n $this->session->set_flashdata('notif','<div class=\"alert alert-info alert alert-dismissible fade in\" role=\"alert\"><button type=\"button \" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button><h4><i class=\"icon fa fa-check\"></i> Berhasil!</h4> Data dari EXCEL Berhasil ditambahkan </div>');\n\n redirect(base_url('Benang')); \n\n }\n\n }", "public function insertExcel()\n {\n $json = file_get_contents('php://input');\n $data = json_decode($json);\n // Define the Base64 value you need to save as an image\n $b64 = explode(',', $data);\n\n // Obtain the original content (usually binary data)\n $bin = base64_decode($b64[1]);\n $filecontent = file_put_contents('evenement.xlsx', $bin);\n\n\n $allowed_ext = ['xls', 'csv', 'xlsx'];\n $filename = 'evenement.xlsx';\n $check_ext = explode(\".\", $filename);\n $file_ext = end($check_ext);\n \n\n if (in_array($file_ext, $allowed_ext)) {\n $targetPath = './evenement.xlsx';\n $spreadsheet = \\PhpOffice\\PhpSpreadsheet\\IOFactory::load($targetPath);\n $data = $spreadsheet->getActiveSheet();\n \n $highestRow = $data->getHighestRow();\n\n for($row=4; $row < $highestRow ; $row++){\n \n $number_sign = $data->getCellByColumnAndRow(1, $row)->getValue(); \n\n $first_time = $data->getCellByColumnAndRow(4, $row)->getValue();\n $min = $first_time * 24 * 60;\n $seconds = $min *60;\n $milliseconds = $seconds * 1000;\n $timefirst = ($min%60). ':'.($seconds%60).(($milliseconds===0)?'':'.'.rtrim($milliseconds%1000, '0'));\n \n $second_time = $data->getCellByColumnAndRow(5, $row)->getValue();\n $min = $second_time * 24 * 60;\n $seconds = $min *60;\n $milliseconds = $seconds * 1000;\n $timesecond = ($min%60). ':'.($seconds%60).(($milliseconds===0)?'':'.'.rtrim($milliseconds%1000, '0'));\n\n $average = $data->getCellByColumnAndRow(6, $row)->getCalculatedValue();\n $min = $average * 24 * 60;\n $seconds = $min *60;\n $milliseconds = $seconds * 1000;\n $timeaverage = ($min%60). ':'.($seconds%60).(($milliseconds===0)?'':'.'.rtrim($milliseconds%1000, '0'));\n \n $insertTrial = new Trial(array('number_sign' => $number_sign, 'first_time' => $timefirst, 'second_time' => $timesecond, 'average' => $timeaverage));\n $manager = new TrialManager();\n $trials = $manager->insertionTrial($insertTrial);\n \n }\n } else {\n echo 'invalid file';\n }\n }", "private function addData ()\n {\n foreach ($this->data as $key=>$value)\n {\n $keys[] = $key;\n $values[] = $value;\n \n }\n $cols = implode($keys, \",\");\n $dataValues = \"'\".implode($values, \"','\").\"'\";\n $query = \"INSERT INTO `$this->tablename`($cols)VALUES($dataValues);\";\n \n $conn = $this->DB->conn;\n \n $sql = $conn->query($query);\n \n if($sql == TRUE) return TRUE;\n else \n {\n \n throw new Exception(\"Error : Data Not inserted to database :( \".$conn->error);\n \n }\n \n }", "public function uploadexcel(Request $request)\n {\n try {\n Excel::load($request->file('excel'), function ($reader) {\n foreach ($reader->toObject() as $row) {\n $uuid = Uuid::generate();\n DB::table('master_rba')->insert([\n 'id' => $uuid,\n 'unit_kerja' => $row->unit_kerja,\n 'no_rba_induk' => $row->no_rba_induk,\n 'no_rba' => $row->no_rba,\n 'program' => $row->program_kegiatan,\n 'sub_program' => $row->sub_program,\n 'anggaran_pagu' => $row->pagu,\n // 'anggaran_terserap' => $row->realisasi,\n 'target' => $row->jml_output,\n 'satuan' => $row->satuan,\n // 'realisasi' => $row->realisasi,\n // 'total_progres' => $row->persentase,\n 'jadwal_pelaksanaan' => $row->jadwal_pelaksanaan,\n 'tahun' => $row->tahun,\n 'userid_created' => Session::get('ss_nama'),\n 'userid_updated' => Session::get('ss_nama'),\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }\n });\n\n Alert::success('Berhasi Menyimpan Data')->persistent('Ok');\n\n return redirect()->route('master_rba.index');\n } catch (\\Exception $e) {\n Session::flash('message', $e->getMessage());\n $validator = $e->getMessage();\n\n // Alert::error('Error', $e->getMessage())->persistent('Ok');\n return redirect()->route('master_rba.index')->withErrors($validator);\n }\n }", "function InsertDTR($sheetRow)\n{\n global $con;\n $inputs=array();\n $start_column=\"A\";\n for ($i=0; $i <= 7; $i++) {\n if (empty($sheetRow[$start_column])) {\n $inputs[$i]=\"\";\n } else {\n $inputs[$i]=$sheetRow[$start_column];\n }\n $start_column++;\n }\n $if_exists=$con->myQuery(\n \"SELECT COUNT(id) FROM acu_records WHERE ac_no=? AND action_time=? AND state=?\",\n array(\n $sheetRow[\"A\"],\n $sheetRow[\"D\"],\n $sheetRow[\"E\"]\n )\n )->fetchColumn();\n\n if (empty($if_exists)) {\n $con->myQuery(\"INSERT INTO acu_records(ac_no,acu_id,name,action_time,state,new_state,exception,operation) VALUES(?,?,?,?,?,?,?,?)\", $inputs);\n }\n}", "function Import_FileImportLibrary_CSV($table,$data){\n $this->db->insert($table, $data);\n }", "private function import_pegawai($sheet)\n\t{\n\t\tforeach ($sheet as $idx => $data) {\n\t\t\t//skip index 1 karena title excel\n\t\t\tif ($idx == 1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($data['B'] == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$nip = $data['B'];\n\t\t\t$nama = $data['C'];\n\t\t\t$tempat_lahir = $data['D'];\n\t\t\t$tanggal_lahir = $data['E'];\n\t\t\t$jenis_kelamin = $data['F'];\n\t\t\t$gol = $data['G'];\n\t\t\t$tmt_gol = $data['H'];\n\t\t\t$eselon = $data['I'];\n\t\t\t$jabatan = $data['J'];\n\t\t\t$tmt_jabatan = $data['K'];\n\t\t\t$agama = $data['L'];\n\t\t\t$sub = $data['M'];\n\t\t\t$bagian = $data['N'];\n\t\t\t$unit = $data['O'];\n\n\t\t\t// insert data\n\t\t\t$this->pegawaiModel->insert([\n\t\t\t\t'nip' => $nip,\n\t\t\t\t'name' => $nama,\n\t\t\t\t'tempat_lahir' => strtoupper($tempat_lahir),\n\t\t\t\t'tanggal_lahir' => date_format(date_create($tanggal_lahir), \"Y-m-d\"),\n\t\t\t\t'jenis_kelamin' => $jenis_kelamin,\n\t\t\t\t'gol' => $gol,\n\t\t\t\t'tmt_gol' => date_format(date_create($tmt_gol), \"Y-m-d\"),\n\t\t\t\t'eselon' => $eselon,\n\t\t\t\t'jabatan' => $jabatan,\n\t\t\t\t'tmt_jab' => date_format(date_create($tmt_jabatan), \"Y-m-d\"),\n\t\t\t\t'agama' => $agama,\n\t\t\t\t'sub_bagian' => $sub,\n\t\t\t\t'bagian' => $bagian,\n\t\t\t\t'unit' => $unit,\n\t\t\t]);\n\t\t}\n\n\t\treturn true;\n\t}", "public\tfunction ExcelDataAdd()\t{\n $configUpload['upload_path'] = FCPATH.'uploads/excel/';\n $configUpload['allowed_types'] = 'xls|xlsx|csv';\n $configUpload['max_size'] = '5000';\n $this->load->library('upload', $configUpload);\n $this->upload->do_upload('userfile');\t\n $upload_data = $this->upload->data(); //Returns array of containing all of the data related to the file you uploaded.\n $file_name = $upload_data['file_name']; //uploded file name\n\t\t $extension=$upload_data['file_ext']; // uploded file extension\n\t\t\n//$objReader =PHPExcel_IOFactory::createReader('Excel5'); //For excel 2003 \n $objReader= PHPExcel_IOFactory::createReader('Excel2007');\t// For excel 2007 \t \n //Set to read only\n $objReader->setReadDataOnly(true); \t\t \n //Load excel file\n\t\t $objPHPExcel=$objReader->load(FCPATH.'uploads/excel/'.$file_name);\t\t \n $totalrows=$objPHPExcel->setActiveSheetIndex(0)->getHighestRow(); //Count Numbe of rows avalable in excel \t \n $objWorksheet=$objPHPExcel->setActiveSheetIndex(0); \n //loop from first data untill last data\n for($i=2;$i<=$totalrows;$i++)\n {\n $FirstName= $objWorksheet->getCellByColumnAndRow(0,$i)->getValue();\t\t\t\n $LastName= $objWorksheet->getCellByColumnAndRow(1,$i)->getValue(); //Excel Column 1\n\t\t\t $Email= $objWorksheet->getCellByColumnAndRow(2,$i)->getValue(); //Excel Column 2\n\t\t\t $Mobile=$objWorksheet->getCellByColumnAndRow(3,$i)->getValue(); //Excel Column 3\n\t\t\t $Address=$objWorksheet->getCellByColumnAndRow(4,$i)->getValue(); //Excel Column 4\n\t\t\t $data_user=array('FirstName'=>$FirstName, 'LastName'=>$LastName ,'Email'=>$Email ,'Mobile'=>$Mobile , 'Address'=>$Address);\n\t\t\t $this->excel_data_insert_model->Add_User($data_user);\n \n\t\t\t\t\t\t \n }\n unlink('././uploads/excel/'.$file_name); //File Deleted After uploading in database .\t\t\t \n redirect(base_url() . \"put link were you want to redirect\");\n\t \n \n }", "public function importFile(Request $request){\n\n return $request->all();\n\n if($request->hasFile('sample_file')){\n\n $path = $request->file('sample_file')->getRealPath();\n\n $data = \\Excel::load($path)->get();\n\n\n if($data->count()){\n\n foreach ($data as $key => $value) {\n\n $personal = Personal::updateOrCreate(\n ['p00' => $value->p00],\n ['oficina_id' => $value->oficina_id,\n 'rol_id' => $value->rol_id,\n 'p00' => $value->p00,\n 'name' => $value->name]\n );\n\n $personal->save();\n\n }\n\n }\n\n }\n\n }", "public function importDataOLT()\n {\n $data = $this->varBatchImportOLT;\n $this->db->insert_batch('rekap_data_olt', $data);\n }", "public function importXLS($params) {\n\n $objectId = isset($params[\"objectId\"]) ? addText($params[\"objectId\"]) : \"0\";\n $educationSystem = isset($params[\"educationSystem\"]) ? addText($params[\"educationSystem\"]) : \"0\";\n $trainingId = isset($params[\"trainingId\"]) ? (int) $params[\"trainingId\"] : \"0\";\n $objectType = isset($params[\"objectType\"]) ? addText($params[\"objectType\"]) : \"\";\n\n //@veasna\n $type = isset($params[\"type\"]) ? addText($params[\"type\"]) : \"\";\n //\n\n $dates = isset($params[\"CREATED_DATE\"]) ? addText($params[\"CREATED_DATE\"]) : \"\";\n\n $xls = new Spreadsheet_Excel_Reader();\n $xls->setUTFEncoder('iconv');\n $xls->setOutputEncoding('UTF-8');\n $xls->read($_FILES[\"xlsfile\"]['tmp_name']);\n\n for ($iCol = 1; $iCol <= $xls->sheets[0]['numCols']; $iCol++) {\n $field = $xls->sheets[0]['cells'][1][$iCol];\n switch ($field) {\n case \"STUDENT_SCHOOL_ID\":\n $Col_STUDENT_SCHOOL_ID = $iCol;\n break;\n case \"FIRSTNAME\":\n $Col_FIRSTNAME = $iCol;\n break;\n case \"LASTNAME\":\n $Col_LASTNAME = $iCol;\n break;\n case \"FIRSTNAME_LATIN\":\n $Col_FIRSTNAME_LATIN = $iCol;\n break;\n case \"LASTNAME_LATIN\":\n $Col_LASTNAME_LATIN = $iCol;\n break;\n case \"GENDER\":\n $Col_GENDER = $iCol;\n break;\n case \"ACADEMIC_TYPE\":\n $Col_ACADEMIC_TYPE = $iCol;\n break;\n case \"DATE_BIRTH\":\n $Col_DATE_BIRTH = $iCol;\n break;\n case \"BIRTH_PLACE\":\n $Col_BIRTH_PLACE = $iCol;\n break;\n case \"EMAIL\":\n $Col_EMAIL = $iCol;\n break;\n case \"PHONE\":\n $Col_PHONE = $iCol;\n break;\n case \"ADDRESS\":\n $Col_ADDRESS = $iCol;\n break;\n case \"COUNTRY\":\n $Col_COUNTRY = $iCol;\n break;\n case \"COUNTRY_PROVINCE\":\n $Col_COUNTRY_PROVINCE = $iCol;\n break;\n case \"TOWN_CITY\":\n $Col_TOWN_CITY = $iCol;\n break;\n case \"POSTCODE_ZIPCODE\":\n $Col_POSTCODE_ZIPCODE = $iCol;\n break;\n }\n }\n\n for ($i = 1; $i <= $xls->sheets[0]['numRows']; $i++) {\n\n //STUDENT_SCHOOL_ID\n $STUDENT_SCHOOL_ID = isset($xls->sheets[0]['cells'][$i + 2][$Col_STUDENT_SCHOOL_ID]) ? $xls->sheets[0]['cells'][$i + 2][$Col_STUDENT_SCHOOL_ID] : \"\";\n //FIRSTNAME\n\n $FIRSTNAME = isset($xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME]) ? $xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME] : \"\";\n //LASTNAME\n\n $LASTNAME = isset($xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME]) ? $xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME] : \"\";\n //GENDER\n\n $FIRSTNAME_LATIN = isset($xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME_LATIN]) ? $xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME_LATIN] : \"\";\n //LASTNAME\n\n $LASTNAME_LATIN = isset($xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME_LATIN]) ? $xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME_LATIN] : \"\";\n //GENDER\n\n $GENDER = isset($xls->sheets[0]['cells'][$i + 2][$Col_GENDER]) ? $xls->sheets[0]['cells'][$i + 2][$Col_GENDER] : \"\";\n //ACADEMIC_TYPE\n\n $ACADEMIC_TYPE = isset($xls->sheets[0]['cells'][$i + 2][$Col_ACADEMIC_TYPE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_ACADEMIC_TYPE] : \"\";\n //DATE_BIRTH\n\n $DATE_BIRTH = isset($xls->sheets[0]['cells'][$i + 2][$Col_DATE_BIRTH]) ? $xls->sheets[0]['cells'][$i + 2][$Col_DATE_BIRTH] : \"\";\n //BIRTH_PLACE\n\n $BIRTH_PLACE = isset($xls->sheets[0]['cells'][$i + 2][$Col_BIRTH_PLACE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_BIRTH_PLACE] : \"\";\n //EMAIL\n\n $EMAIL = isset($xls->sheets[0]['cells'][$i + 2][$Col_EMAIL]) ? $xls->sheets[0]['cells'][$i + 2][$Col_EMAIL] : \"\";\n //PHONE\n\n $PHONE = isset($xls->sheets[0]['cells'][$i + 2][$Col_PHONE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_PHONE] : \"\";\n //ADDRESS\n\n $ADDRESS = isset($xls->sheets[0]['cells'][$i + 2][$Col_ADDRESS]) ? $xls->sheets[0]['cells'][$i + 2][$Col_ADDRESS] : \"\";\n //COUNTRY\n\n $COUNTRY = isset($xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY]) ? $xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY] : \"\";\n //COUNTRY_PROVINCE\n\n $COUNTRY_PROVINCE = isset($xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY_PROVINCE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY_PROVINCE] : \"\";\n //TOWN_CITY\n\n $TOWN_CITY = isset($xls->sheets[0]['cells'][$i + 2][$Col_TOWN_CITY]) ? $xls->sheets[0]['cells'][$i + 2][$Col_TOWN_CITY] : \"\";\n //POSTCODE_ZIPCODE\n\n $POSTCODE_ZIPCODE = isset($xls->sheets[0]['cells'][$i + 2][$Col_POSTCODE_ZIPCODE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_POSTCODE_ZIPCODE] : \"\";\n //error_log($STUDENT_SCHOOL_ID.\" ### LASTNAME: \".$LASTNAME.\" FIRSTNAME:\".$FIRSTNAME);\n\n $IMPORT_DATA['ID'] = generateGuid();\n $IMPORT_DATA['CODE'] = createCode();\n $IMPORT_DATA['ACADEMIC_TYPE'] = addText($ACADEMIC_TYPE);\n\n switch (UserAuth::systemLanguage()) {\n case \"VIETNAMESE\":\n $IMPORT_DATA['FIRSTNAME'] = setImportChartset($FIRSTNAME);\n $IMPORT_DATA['LASTNAME'] = setImportChartset($LASTNAME);\n $IMPORT_DATA['FIRSTNAME_LATIN'] = setImportChartset($FIRSTNAME_LATIN);\n $IMPORT_DATA['LASTNAME_LATIN'] = setImportChartset($LASTNAME_LATIN);\n break;\n default:\n $IMPORT_DATA['FIRSTNAME'] = addText($FIRSTNAME);\n $IMPORT_DATA['LASTNAME'] = addText($LASTNAME);\n $IMPORT_DATA['FIRSTNAME_LATIN'] = setImportChartset($FIRSTNAME_LATIN);\n $IMPORT_DATA['LASTNAME_LATIN'] = setImportChartset($LASTNAME_LATIN);\n break;\n }\n\n $IMPORT_DATA['GENDER'] = addText($GENDER);\n $IMPORT_DATA['BIRTH_PLACE'] = setImportChartset($BIRTH_PLACE);\n $IMPORT_DATA['EMAIL'] = setImportChartset($EMAIL);\n $IMPORT_DATA['PHONE'] = setImportChartset($PHONE);\n $IMPORT_DATA['ADDRESS'] = setImportChartset($ADDRESS);\n $IMPORT_DATA['COUNTRY'] = setImportChartset($COUNTRY);\n $IMPORT_DATA['COUNTRY_PROVINCE'] = setImportChartset($COUNTRY_PROVINCE);\n $IMPORT_DATA['TOWN_CITY'] = setImportChartset($TOWN_CITY);\n $IMPORT_DATA['POSTCODE_ZIPCODE'] = setImportChartset($POSTCODE_ZIPCODE);\n $IMPORT_DATA['STUDENT_SCHOOL_ID'] = setImportChartset($STUDENT_SCHOOL_ID);\n\n if (isset($DATE_BIRTH)) {\n if ($DATE_BIRTH != \"\") {\n $date = str_replace(\"/\", \".\", $DATE_BIRTH);\n if ($date) {\n $explode = explode(\".\", $date);\n $d = isset($explode[0]) ? trim($explode[0]) : \"00\";\n $m = isset($explode[1]) ? trim($explode[1]) : \"00\";\n $y = isset($explode[2]) ? trim($explode[2]) : \"0000\";\n $IMPORT_DATA['DATE_BIRTH'] = $y . \"-\" . $m . \"-\" . $d;\n } else {\n $IMPORT_DATA['DATE_BIRTH'] = \"0000-00-00\";\n }\n }\n } else {\n $IMPORT_DATA['DATE_BIRTH'] = \"0000-00-00\";\n }\n\n $IMPORT_DATA['EDUCATION_SYSTEM'] = $educationSystem;\n //error_log($objectId);\n if ($objectId)\n $IMPORT_DATA['CAMPUS'] = $objectId;\n\n if ($trainingId)\n $IMPORT_DATA['TRAINING'] = $trainingId;\n //$veansa\n if ($type)\n $IMPORT_DATA['TYPE'] = $type;\n //\n \n if ($objectType)\n $IMPORT_DATA['TARGET'] = $objectType;\n \n if ($dates) {\n $IMPORT_DATA['CREATED_DATE'] = setDatetimeFormat($dates);\n } else {\n $IMPORT_DATA['CREATED_DATE'] = getCurrentDBDateTime();\n }\n\n $IMPORT_DATA['CREATED_BY'] = Zend_Registry::get('USER')->CODE;\n if (isset($STUDENT_SCHOOL_ID) && isset($FIRSTNAME) && isset($LASTNAME)) {\n if ($STUDENT_SCHOOL_ID && $FIRSTNAME && $LASTNAME) {\n if (!$this->checkSchoolcodeInTemp($STUDENT_SCHOOL_ID)) {\n self::dbAccess()->insert('t_student_temp', $IMPORT_DATA);\n }\n }\n }\n }\n }", "public function upload()\n {\n $this->load->library('upload');\n $fileName = $_FILES['import']['name'];\n\n $config['upload_path'] = './assets'; //buat folder dengan nama assets di root folder\n $config['file_name'] = $fileName;\n $config['allowed_types'] = 'xls|xlsx|csv';\n $config['max_size'] = 10000;\n $config['overwrite'] = TRUE;\n\n $this->upload->initialize($config);\n\n if (!$this->upload->do_upload('import')) {\n $this->upload->display_errors();\n }\n $inputFileName = './assets/' . $fileName;\n\n try {\n $inputFileType = PHPExcel_IOFactory::identify($inputFileName);\n $objReader = PHPExcel_IOFactory::createReader($inputFileType);\n $objPHPExcel = $objReader->load($inputFileName);\n } catch (Exception $e) {\n die('Error loading file \"' . pathinfo($inputFileName, PATHINFO_BASENAME) . '\": ' . $e->getMessage());\n }\n\n $sheet = $objPHPExcel->getSheet(0);\n $highestRow = $sheet->getHighestRow();\n $startRow = 2;\n $rowData = array();\n if ($highestRow > 1) {\n $highestColumn = $sheet->getHighestColumn();\n $insert = FALSE;\n for ($row = 0; $row < $highestRow - 1; $row++) {\n // Read a row of data into an array\n $tmp = $sheet->rangeToArray('A' . $startRow . ':' . 'N' . $startRow++, NULL, TRUE, FALSE)[0];\n if(substr($tmp[12], 0, 1) != '0'){\n \t$tmp[12] = '0' . $tmp[12];\n }\n $data = array(\n \"nama\" => $tmp[0],\n \"merk\" => $tmp[1],\n \"tipe\" => $tmp[2],\n \"ukuran\" => $tmp[3],\n \"satuan\" => $tmp[4],\n \"hargaPasar\" => $tmp[5],\n \"biayaKirim\" => $tmp[6],\n \"resistensi\" => $tmp[7],\n \"ppn\" => $tmp[8],\n \"hargashsb\" => $tmp[9],\n \"keterangan\" => $tmp[10],\n \"spesifikasi\" => $tmp[11],\n \"kode_kategori\" => $tmp[12],\n \"tahun_anggaran\" => $tmp[13],\n \"createdBy\" => $this->ion_auth->get_user_id(),\n );\n array_push($rowData, $data);\n }\n\n if ($this->barang_m->insert_many($rowData)) {\n $this->message('Berhasil! Data berhasil di upload', 'success');\n $this->cache->delete('homepage');\n $this->cache->delete('list_kategori');\n } else {\n $this->message('Gagal! Data gagal di upload', 'danger');\n }\n } else {\n $this->message('Gagal! Data gagal di upload', 'danger');\n }\n redirect(site_url('katalog/add'));\n }", "public function gen_excel() {\n $this->load->library('excel');\n //activate worksheet number 1\n $this->excel->setActiveSheetIndex(0);\n //name the worksheet\n $this->excel->getActiveSheet()->setTitle('Customer list');\n\n // load database\n $this->load->database();\n\n // load model\n // get all users in array formate\n $this->load->model('Welcome_model');\n\n \n// $data['res'] = $this->customer_model->load_product_data($product, $type);\n \n $table_data = $this->Welcome_model->select_Insert_data();\n \n// echo '<pre>';\n// print_r($res);\n// exit();\n \n// $this->customer_model->create_openJobOrder_excel($data);\n $this->Welcome_model->creat_Excel($table_data);\n }", "public function save()\n {\n \n $this->load->library('excel');\n\n if ($this->input->post('importfile')) {\n $path = './Vendor_Invoice/';\n\n $config['upload_path'] = $path;\n $config['allowed_types'] = '*';\n $config['remove_spaces'] = true;\n\n $this->load->library('upload', $config);\n $this->upload->initialize($config);\n\n if (!$this->upload->do_upload('userfile')) {\n $data = array('error' => $this->upload->display_errors());\n } else {\n $data = array('upload_data' => $this->upload->data());\n }\n\n $fetchData = array();\n\n if (!empty($data['upload_data']['file_name'])) {\n $import_xls_file = $data['upload_data']['file_name'];\n } else {\n $import_xls_file = 0;\n }\n $inputFileName = $path . $import_xls_file;\n\n try {\n $inputFileType = PHPExcel_IOFactory::identify($inputFileName);\n $objReader = PHPExcel_IOFactory::createReader($inputFileType);\n $objPHPExcel = $objReader->load($inputFileName);\n } catch (Exception $e) {\n die('Error loading file \"' . pathinfo($inputFileName, PATHINFO_BASENAME)\n . '\": ' . $e->getMessage());\n }\n $allDataInSheet = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true);\n $vendorid = $this->input->post('vendor');\n $arrayCount = count($allDataInSheet);\n $createArray = array('attr_name','color_code');\n $makeArray = array( 'attr_name' =>'attr_name', 'color_code' => 'color_code');\n $SheetDataKey = array();\n foreach ($allDataInSheet as $dataInSheet) {\n foreach ($dataInSheet as $key => $value) {\n if (in_array(trim($value), $createArray)) {\n $value = preg_replace('/\\s+/', '', $value);\n $SheetDataKey[trim($value)] = $key;\n } else {}\n }\n }\n $data = array_diff_key($makeArray, $SheetDataKey);\n\n if (empty($data)) {\n $flag = 1;\n }\n\n if ($flag == 1) {\n\n for ($i = 2; $i <= $arrayCount; $i++) {\n \n $attr_name = $SheetDataKey['attr_name'];\n $color_code = $SheetDataKey['color_code'];\n\n $attr_name = $allDataInSheet[$i][$attr_name] != '' ? $allDataInSheet[$i][$attr_name] : \"\";\n $color_code = $allDataInSheet[$i][$color_code] != '' ? $allDataInSheet[$i][$color_code] : \"\"; \n \n // $crossProd = explode(\";\", $crossProduct);\n // $similarProd = explode(\";\", $similar_products);\n \n //\"images\" => [$image1, $image2, $image3, $image4, $image5]\n $fetchData[] = array(\"attr_name\" => $attr_name, \"color_code\" => $color_code);\n }\n\n $data['vendorInfo'] = $fetchData;\n $this->setBatchImport($fetchData);\n $last_id = $this->importData();\n\n // $this->import->tblInsertproperty($arrayOfPropTable);\n $this->session->set_flashdata(\"msg\", '<div class=\"alert alert-success\">\n Imported Successfully\n </div>');\n } else {\n\n $this->session->set_flashdata(\"msg\", '<div class=\"alert alert-danger \"> ' . $this->upload->display_errors() . '</div>');\n }\n return redirect('Admin/Vendor/ColorUpload');\n }\n }", "public function postImport()\n {\n Excel::load(Input::file('customer'), function($reader) {\n $cmp_id = Session::get('cmp_id');\n foreach ($reader->get() as $book) {\n Product::create([\n 'nombreProducto' => $book->producto,\n 'similarProducto' => $book->similar,\n 'idTipoProducto' => $book->tipo,\n 'idEmpresa' => $cmp_id,\n ]);\n }\n });\n Session::flash('message','Importacion realizada correctamente');\n return Redirect::to('product');\n }", "public function importxls()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t$xls\t\t= $this->file['tmp_name'];\n\t\t\t$objPHPExcel\t= PHPExcel_IOFactory::load($xls);\n\t\t\t$sht\t\t= $objPHPExcel->getActiveSheet();\n\n\t\t\t$highestColumm\t= $sht->getHighestDataColumn();\n\t\t\t$highestRow\t= $sht->getHighestDataRow();\n\t\t\t$range\t\t= \"A1:\".$highestColumm.$highestRow;\n\n\t\t\t$rows\t\t= $sht->rangeToArray($range);\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t\treturn;\n\t}", "public function potsSubir(){\n\n Excel::load(Input::file('file'),function($reader){\n $reader->each(function($sheet){\n foreach($sheet->toArray() as $row){\n Eps::firstOrCreate($sheet->toArray()); \n }\n\n}); \n\n});\n\n return Redirect::to('/eps');\n}", "public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }", "function uploadShopProduct(){\t\n\n $inputFileName = $_FILES['xlsFile']['tmp_name'];\n\n // Read your Excel workbook\n\n try {\n\n $inputFileType = PHPExcel_IOFactory::identify($inputFileName);\n\n $objReader = PHPExcel_IOFactory::createReader($inputFileType);\n\n $objPHPExcel = $objReader->load($inputFileName);\n\n } catch (Exception $e) {\n\n die('Error loading file \"' . pathinfo($inputFileName, PATHINFO_BASENAME)\n\n . '\": ' . $e->getMessage());\n\n }\n\n\n\n $sheet = $objPHPExcel->getSheet(0);\n\n $highestRow = $sheet->getHighestRow();\n\n $highestColumn = $sheet->getHighestColumn();\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\n\n\n $headingFlg = 0;\n\n $headChkColumn = 0;\n\n $headingData = array();\n\n $dataCounter = 0;\n\n for ( $row = 2; $row <= $highestRow; $row++ )\n\n {\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$fileData = $sheet->rangeToArray( 'A' . $row . ':' . $highestColumn . $row, NULL, TRUE, FALSE );\n\t\t\t\t\t\t\t\n\n/*\n\n$pname = $fileData[0][1];\n\n\t\t\tFor MyStore work Start\n\n\n\n*/\n\n\n$pname = $fileData[0][1];\n$sqlproddup = \"select * from ketechprod where pname = '\".addslashes($pname).\"'\";\n$resultadP = mysql_query( $sqlproddup );\n/*echo $sqlproddup;\necho \"<hr/>\";*/\n\n\n$total = mysql_num_rows( $resultadP );\n\nif( $total > 0 ) {\n\n$rowadP = mysql_fetch_array( $resultadP );\n\n/*echo \"<hr/>\";\necho \"<pre>\";\nprint_r( $rowadP );*/\n\n$p_id = $rowadP['id'];\n\n$vpArray['pid'] = \t $rowadP['id'];\n\n$vpArray['b_cat'] = \t $rowadP['pcategory'];\n\n$vpArray['p_cat'] = \t $rowadP['p_parent_cat'];\n\n$vpArray['sub_cat_text'] = \t$rowadP['sub_cat_text'];\n\n\n$ART_NO = $fileData[0][0];\n\n$SUPPL_NO = $fileData[0][2];\n\n$SUPPL_NAME = $fileData[0][3];\n\n$SUPPL_ART_NO = $fileData[0][4];\n\n$BUYER_UID = $fileData[0][5];\n\n$CONT_BUY_UNIT = $fileData[0][6];\n\n$ART_GRP_NO = $fileData[0][7];\n\n$ART_GRP_DESCR = $fileData[0][8];\n\n$ART_GRP_SUB_NO = $fileData[0][9];\n\n$ART_GRP_SUB_DESCR = $fileData[0][10];\n\n$DEPT_NO\t = $fileData[0][11];\n\n$DEPT_DESCR = $fileData[0][12];\n\n$SELL_PR\t = $fileData[0][13];\n\n$SELL_VAT = $fileData[0][14];\n\n$SPAT\t = $fileData[0][15];\n\n$MRP_PRICE = $fileData[0][16];\n\n$VAT_MY = $fileData[0][17];\n\n$BUY_VAT_NO = $fileData[0][18];\n\n$BUY_VAT_PERC = $fileData[0][19];\n\n$Offer_No = $fileData[0][20];\n\n$DMS = $fileData[0][21];\n\n$stock = $fileData[0][22];\n\n$ON_ORDER = $fileData[0][23];\n\n$LAST_DELDAY = $fileData[0][24];\n\n$LAST_SALEDAY = $fileData[0][25];\n\n$MFG_Date = $fileData[0][26];\n\n$Exp_Date = $fileData[0][27];\n\n$ART_STATUS = $fileData[0][28];\n\n$STORE = $fileData[0][29];\n\n\n\n\n\n$vpArray['vid'] = \t$_SESSION['vid'];\n\n$vpArray['baseprice'] = \t$MRP_PRICE;\n\n$vpArray['sellprice'] = \t$MRP_PRICE;\n\n$vpArray['modify_baseprice'] = \t0;\n\n$vpArray['modify_sellprice'] = \t0;\n\n$vpArray['admin_approval'] = \t1;\n\n$vpArray['f_product'] = \t0;\n\n$vpArray['mpq_fp'] = \t1;\n\n$vpArray['stock'] = \t$stock;\n\n$vpArray['status'] = \t0;\n\n$vpArray['max_buy_limit'] = \t100;\n\n$vpArray['ART_NO'] = \t$ART_NO;\n\n$vpArray['SUPPL_NO'] = \t$SUPPL_NO;\n\n$vpArray['SUPPL_NAME'] = \t$SUPPL_NAME;\n\n$vpArray['SUPPL_ART_NO'] = \t$SUPPL_ART_NO;\n\n$vpArray['BUYER_UID'] = \t$BUYER_UID;\n\n$vpArray['CONT_BUY_UNIT'] = \t$CONT_BUY_UNIT;\n\n$vpArray['ART_GRP_NO'] = \t$ART_GRP_NO;\n\n$vpArray['ART_GRP_DESCR'] = \t$ART_GRP_DESCR;\n\n$vpArray['ART_GRP_SUB_NO'] = \t$ART_GRP_SUB_NO;\n\n$vpArray['ART_GRP_SUB_DESCR'] = \t$ART_GRP_SUB_DESCR;\n\n$vpArray['DEPT_NO'] = \t$DEPT_NO;\n\n$vpArray['DEPT_DESCR'] = \t$DEPT_DESCR;\n\n$vpArray['SELL_PR'] = \t$SELL_PR;\n\n$vpArray['SELL_VAT'] = \t$SELL_VAT;\n\n$vpArray['SPAT'] = \t$SPAT;\n\n$vpArray['MRP_PRICE'] = \t$MRP_PRICE;\n\n$vpArray['VAT_MY'] = \t$VAT_MY;\n\n$vpArray['BUY_VAT_NO'] = \t$BUY_VAT_NO;\n\n$vpArray['BUY_VAT_PERC'] = \t$BUY_VAT_PERC;\n\n$vpArray['Offer_No'] = \t$Offer_No;\n\n$vpArray['DMS'] = \t$DMS;\n\n$vpArray['ON_ORDER'] = \t$ON_ORDER;\n\n$vpArray['LAST_DELDAY'] = \t$LAST_DELDAY;\n\n$vpArray['LAST_SALEDAY'] = \t$LAST_SALEDAY;\n\n$vpArray['MFG_Date'] = \t$MFG_Date;\n\n$vpArray['Exp_Date'] = \t$Exp_Date;\n\n$vpArray['ART_STATUS'] = \t$ART_STATUS;\n\n$vpArray['STORE'] = \t$STORE;\n\n$vpK = array();\n\n$vpV = array();\n\nforeach( $vpArray as $vpArrayK => $vpArrayV )\n\n{\n\n\t$vpK[] = $vpArrayK;\n\n\t$vpV[] = \"'\".addslashes($vpArrayV).\"'\";\n\t\n\t$vpupdate[] = $vpArrayK.\" = '\".addslashes($vpArrayV).\"'\";\n\n\n\n}\n\n\n\n$queryk =implode(\",\",$vpK);\n\n$queryv = implode(\",\",$vpV);\n\n$queryupdate = implode(\",\",$vpupdate);\n\n\n\t\t\t\t\t\t\t$sqlcatdup = \"select * from ketechvp_\".$_SESSION['vid'].\" where pid = '\".$p_id.\"'\";\n\n\t\t\t\t\t\t\t$result = mysql_query( $sqlcatdup );\n\n\t\t\t\t\t\t\t$total = mysql_num_rows( $result );\n\n\t\t\t\t\t\t\tif( $total > 0 )\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$sqlVprodU = \"update ketechvp_\".$_SESSION['vid'].\" SET \".$queryupdate.\" where pid = \".$p_id.\"\";\n\t\t\t\t\t\t\t\t/*echo $sqlVprodU;\n\t\t\t\t\t\t\t\techo \"<hr/>\";*/\n\t\t\t\t\t\t\t\tmysql_query( $sqlVprodU );\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t}else\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\n\n\n\n\n\n/*echo $queryk;\n\necho \"<hr/>\";\n\necho $queryv;\n\necho \"<pre>\";*/\n\n/*echo count( $vpArray );\n\nprint_r( $vpV );*/\n\n\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t//insert parent cat\n\n\t\t\t\t\t\t\t\t/*$sqlVprod = \"insert into ketechvp_clone( pid,b_cat,p_cat,sub_cat_text,baseprice,sellprice,modify_baseprice,modify_sellprice,admin_approval,stock,status,ART_NO,SUPPL_NO,SUPPL_NAME,SUPPL_ART_NO,BUYER_UID,CONT_BUY_UNIT,ART_GRP_NO,ART_GRP_DESCR,ART_GRP_SUB_NO,ART_GRP_SUB_DESCR,DEPT_NO,DEPT_DESCR,SELL_PR,SELL_VAT,SPAT,MRP_PRICE,VAT_MY,BUY_VAT_NO,BUY_VAT_PERC,Offer_No,DMS,ON_ORDER,LAST_DELDAY,LAST_SALEDAY,MFG_Date,Exp_Date,ART_STATUS,STORE)values(\".$p_id.\",'\".$Ccat_id.\"','\".$pcat_id.\"','*\".$Ccat_id.\"*',\".$MRP_PRICE.\",\".$MRP_PRICE.\",'0','0',1,'\".$stock.\"',1,'\".$ART_NO.\"','\".$SUPPL_NO.\"','\".$SUPPL_NAME.\"','\".$BUYER_UID.\"','\".$CONT_BUY_UNIT.\"','\".$ART_GRP_NO.\"','\".$ART_GRP_DESCR.\"','\".$ART_GRP_SUB_NO.\"','\".$ART_GRP_SUB_DESCR.\"','\".$DEPT_NO.\"','\".$DEPT_DESCR.\"','\".$SELL_PR.\"','\".$SELL_VAT.\"','\".$SPAT.\"','\".$MRP_PRICE.\"','\".$VAT_MY.\"','\".$BUY_VAT_NO.\"','\".$BUY_VAT_PERC.\"','\".$Offer_No.\"','\".$DMS.\"','\".$ON_ORDER.\"','\".$LAST_DELDAY.\"','\".$LAST_SALEDAY.\"','\".$MFG_Date.\"','\".$Exp_Date.\"','\".$ART_STATUS.\"','\".$STORE.\"')\";*/\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t$sqlVprod = \"insert into ketechvp_\".$_SESSION['vid'].\"(\".$queryk.\")values(\".$queryv.\")\";\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t/*echo $sqlVprod;\n\n\t\t\t\t\t\t\t\techo \"<hr/>\".$dataCounter;\t*/\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t$resultest\t= mysql_query( $sqlVprod );\n\n\t\t\t\t\t\t\t\tif( !$resultest ){\n\n\t\t\t\t\t\t\t\t\t\t\t/*echo $sqlVprod;\n\n\t\t\t\t\t\t\t\t\t\t\techo \"<hr/>\";\t*/\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t//$p_id = mysql_insert_id();\n\n\t\t\t\t\t\t\t //$pcat_id = mysql_insert_id();\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t/*echo \"<pre>\";\n\n\t\t\t\t\t\t\tprint_r( $fileData );*/\n\n\t\t\t\t\t\t\t//die();\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t/*echo \"Location: index.php?v=\".$_POST['c'].\"&f=\".$_POST['f'].\"&vid=\".$_SESSION['vid'].\"\";\n\n\t\t\t\t\t\t\techo \"<hr/>\";*/\n\n\t\t\t\t\t\t \n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\tif( $dataCounter > 60 )\n\n\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t //die();\n\n\t\t\t\t\t\t\t\t } \n\n\t\t\t\t\t\t\t\n\n }else{\n\t\t\t\t\t\t\t\t/*echo $pname;\n\t\t\t\t\t\t\t\techo \"<br/>\";*/\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n}\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\theader( \"Location: index.php?v=\".$_POST['c'].\"&f=\".$_POST['f'].\"&vid=\".$_SESSION['vid'].\"\" );\n}", "function file_import_execute() {\n\t\t$this->load->library('excel_reader');\n\n\t\t// Set output Encoding.\n\t\t$this->excel_reader->setOutputEncoding('CP1251');\n\n\t\t$this->excel_reader->read($this->session->userdata('file_upload'));\n\n\t\t// Sheet 1\n\t\t$excel = $this->excel_reader->sheets[0] ;\n\n\t\t// is it employee shift template file?\n\t\tif($excel['cells'][1][1] == 'NIK') {\n\n\t\t\t$longshift_nik = $this->m_sync_attendance->sync_final_get_long_shift();\n\t\t\t$this->db->trans_start();\n\n\t\t\tfor($j = 1; $j <= $excel['numCols']; $j++) {\n\n\t\t\t\t$date = $excel['cells'][1][$j+1];\n\t\t\t\t$date_int[$j] = $this->convertexceltime($date);\n\n\t\t\t\t$eod = $this->m_employee->eod_select_last();\n\t\t\t\t$eod_int = strtotime($eod);\n\n\t\t\t\tif($eod_int < $date_int[$j]) {\n\t\t\t\t\t$date_arr[$j] = date(\"Y-m-d\", $date_int[$j]);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor ($i = 2; $i <= $excel['numRows']; $i++) {\n\n\t\t\t\t// cek apakah NIK ada isinya?\n\t\t\t\tif(!empty($excel['cells'][$i][1])) {\n\n\t\t\t\t\t$employee = $this->m_employee->employee_select_by_nik($excel['cells'][$i][1]);\n\t\t\t\t\t$employee_check = $this->m_employee->employee_check($employee['employee_id']);\n\n\t\t\t\t\tif($employee_check) {\n\n\t\t\t\t\t\t$employee_shift['shift_emp_id'] = $employee['employee_id'];\n\n\t\t\t\t\t\tfor($j = 1; $j <= $excel['numCols']+1; $j++) {\n\n\t\t\t\t\t\t\tif(strtotime($employee['tanggal_masuk']) <= $date_int[$j]) {\n\n\t\t\t\t\t\t\t\tif(!empty($date_arr[$j])) {\n\n\t\t\t\t\t\t\t\t\t$employee_shift['shift_date'] = $date_arr[$j];\n\t\t\t\t\t\t\t\t\t$shift_code_check = $this->m_employee_shift->shift_code_check($excel['cells'][$i][$j+1], $this->session->userdata['ADMIN']['hr_plant_code']);\n\n\t\t\t\t\t\t\t\t\tif($shift_code_check) {\n\n\t\t\t\t\t\t\t\t\t\t$employee_shift['shift_code'] = $excel['cells'][$i][$j+1];\n\n\t\t\t\t\t\t\t\t\t\tif($this->m_employee_shift->shift_add_update($employee_shift,$longshift_nik)) {\n\t\t\t\t\t\t\t\t\t\t\t/*$shift = $this->m_employee_shift->shift_code_select($employee_shift['shift_code'], $this->session->userdata['ADMIN']['hr_plant_code']);\n\n\t\t\t\t\t\t\t\t\t\t\t$absent['cabang'] = $this->session->userdata['ADMIN']['hr_plant_code'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['tanggal'] = $employee_shift['shift_date'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['nik'] = $employee['nik'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift'] = $shift['shift_code'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['kd_shift'] = $shift['shift_code'];\n\n if ($this->m_upload_absent->employee_absent_select($absent)==FALSE) {\n \t\t\t\t\t\t\t\t$absent['kd_aktual'] = 'A';\n \t\t\t\t\t\t\t\t$absent['kd_aktual_temp'] = 'A';\n }\n\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift_in'] = $shift['duty_on'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift_out'] = $shift['duty_off'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift_break_in'] = $shift['break_in'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift_break_out'] = $shift['break_out'];\n\n \t\t\t $this->m_upload_absent->employee_absent_add_update($absent);*/\n\n\t\t\t\t\t\t\t\t\t\t\t$berhasil = 1;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$this->db->trans_complete();\n\n\t\t\t$object['refresh'] = 7;\n\t\t\t$object['refresh_text'] = 'Data Shift Karyawan berhasil di-upload';\n\t\t\t$object['refresh_url'] = 'employee_shift';\n\n\t\t\t//redirect('member_browse');\n\n\t\t\t$this->template->write_view('content', 'refresh', $object);\n\t\t\t$this->template->render();\n\n\t\t} else {\n\n\t\t\t\t$object['refresh_text'] = 'File Excel yang Anda upload bukan file Shift Karyawan atau file tersebut rusak. Umumnya karena di dalam file diberi warna baik pada teks maupun cell. Harap periksa kembali file Excel Anda.<br><br>SARAN: Coba pilih semua teks dan ubah warna menjadi \"Automatic\". Sebaiknya tidak ada warna pada teks, kolom dan baris dalam file Excel Anda.';\n\t\t\t\t$object['refresh_url'] = 'employee_shift/browse_result';\n\t\t\t\t$object['jag_module'] = $this->jagmodule;\n\t\t\t\t$object['error_code'] = '002';\n\t\t\t\t$object['page_title'] = 'Error '.strtoupper($object['jag_module']['web_module']).': '.$object['jag_module']['web_trans'];\n\t\t\t\t$this->template->write_view('content', 'errorweb', $object);\n\t\t\t\t$this->template->render();\n\n\t\t}\n\n\t}", "function insert_csv_param_aux($tabela, $data)\n { \n\n /**\n * Insere os dados na tabela \n * Inserts the data into the table\n */ \n $this->db->insert($tabela, $data); \n }", "public function importexcel(Request $request)\n {\n $this->validate($request, array(\n 'file' => 'required'\n ));\n $result = 1;\n if ($request->hasFile('file')) {\n $extension = File::extension($request->file->getClientOriginalName());\n if ($extension == \"xlsx\" || $extension == \"xls\" || $extension == \"csv\") {\n\n $path = $request->file->getRealPath();\n $data = Excel::load($path, function ($reader) {\n })->get();\n if (!empty($data) && $data->count()) {\n foreach ($data as $key => $value) {\n $insert[$key] = [\n 'name' => $value->name,\n 'lat' => $value->lat,\n 'long' => $value->long,\n 'loc' => \\DB::raw(\"GeomFromText('POINT(\" . $value->lat . \" \" . $value->long . \")')\"),\n 'disabledcount' => $value->disabledcount,\n 'occupied' => $value->occupied,\n 'emptyspaces' => $value->emptyspaces,\n 'empty' => 0,\n 'avaliable' => 1,\n 'user_id' => Auth::user()->id,\n 'cost' => $value->cost,\n 'parkingtype_id' => $value->parkingtype_id,\n 'reportedcount' => $value->reportedcount,\n 'validity' => 10,\n 'capacity' => $value->capacity,\n 'maximumduration' => $value->maximumduration,\n 'time' => new DateTime(),\n 'source_id' => 7,\n 'comments' => empty($value->comments) ? 'NO' : $value->comments,\n 'opendata' => 0, 'provider_id' => Auth::user()->id];\n $exists = DB::select('SELECT checkIfParkingExists(' . $insert[$key]['lat'] . ',' . $insert[$key]['long'] . ') as checkifexists');\n if (empty($exists[0]->checkifexists)) {\n $insertData = DB::table('places')->insert($insert[$key]);\n } else {\n $insertData = DB::table('places')->where('id', $exists[0]->checkifexists)->update($insert[$key]);\n }\n if ($insertData) {\n $result = $result && 1;\n } else {\n $result = $result && 0;\n }\n }\n if ($result) {\n Session::flash('success', 'Your Data has successfully imported');\n } else {\n Session::flash('error', 'Error inserting the data..');\n return back()->withErrors('Error inserting the data..');\n }\n }\n }\n return back();\n } else {\n Session::flash('error', 'File ' . ' file.!! Please upload a valid xls/csv file..!!');\n return back()->withErrors('File ' . ' file.!! Please upload a valid xls/csv file..!!');;\n }\n }", "function insertData($table, $data){\n\t\t\n\t\tvalidate();\n\n\t\t$values = $cols = \"\";\n\n\t\tforeach ($data as $key => $value) {\n\t\t\t$cols .= \" \" . $key . \",\";\n\t\t\t$values .= \" \" . $value . \",\";\n\t\t}\n\n\t\t$cols = substr($cols, 0, strlen($cols) - 1);\n\t\t$values = substr($values, 0, strlen($values) - 1);\n\n\t\t$query = \"INSERT INTO $table ($cols) VALUES ($values)\";\n\n\t\t\n\t\ttry {\n\n\t\t\t$pdo = db_init();\n\n\t\t\t$pdo->exec($query);\n\n\t\t\treturn 1;\n\t\t} catch (PDOException $e) {\n\t\t\tlogging($_SERVER['PHP_SELF'] . \", 112, Error Insert Data:\". $e->getMessage() .\" ,\" . date(\"Y-m-d\") . \" \" . date(\"h:i:sa\"));\n\t\t\treturn;\n\t\t}\n\n\t}", "function input_data($data,$table){\n\t\t$this->db->insert($table,$data);//menginputkan data ke database dengan function input_data\n }", "private function storeToDB() {\r\n\t\tDBQuery::getInstance() -> insert('INSERT INTO `CalculatedDailyNeeds`' . DBUtils2::buildMultipleInsertOnDuplikateKeyUpdate($this -> aArticleData));\r\n\t}", "public function test()\n {\n\t\t$data = Session::get('exdata');\n $title = ['id', 'name', 'sex'];\n\n\n $spreadsheet = new Spreadsheet();\n $worksheet = $spreadsheet->getActiveSheet();\n //设置工作表标题名称\n $worksheet->setTitle('测试Excel');\n\n //表头\n //设置单元格内容\n foreach ($title as $key => $value) {\n $worksheet->setCellValueByColumnAndRow($key + 1, 1, $value);\n }\n\t\tLog::write($data, 'exdataT');\n $row = 2; //第二行开始\n foreach ($data as $item) {\n $column = 1;\n foreach ($item as $value) {\n $worksheet->setCellValueByColumnAndRow($column, $row, $value);\n $column++;\n }\n $row++;\n }\n\n # 保存为xlsx\n $filename = '测试Excel.xlsx';\n $writer = IOFactory::createWriter($spreadsheet, 'Xlsx');\n $writer->save($filename);\n \n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=\"'.$filename.'\"');\n header('Cache-Control: max-age=0');\n $writer->save('php://output');\n\n }", "public function import()\n {\n $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n /**\n *text/comma-separated-values 逗號分隔CSV\n */\n if (isset($_FILES['file']['name']) && in_array($_FILES['file']['type'], $file_mimes)) //檔案是否存在\n {\n \n $arr_file = explode('.', $_FILES['file']['name']); //分割字串\n $extension = end($arr_file); //副檔名\n \n if ('csv' == $extension) \n {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();//Csv package new\n } elseif ('xlsx' == $extension) {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();//Xlsx package new \n }\n \n $spreadsheet = $reader->load($_FILES['file']['tmp_name']);\n // start customize\n $sheetData = $spreadsheet->getActiveSheet()->ToArray(); //取得sheet值並存成陣列\n //return $sheetData; return只會給予物件 所以中文會輸出unicode\n //return view('',$sheetData=>$sheetData);\n // /end customize\n $count = count($sheetData);\n if (is_array($sheetData)) \n {\n foreach ($sheetData as $row => $value) {\n Line::create([\n 'user_id' => $value[0],\n 'created_at' => now(),\n 'apporved' => now(),\n 'person_name' => $value[1],\n 'school' => $value[2],\n 'phone' => $value[3],\n ]);\n }\n } \n return redirect()->route('home')->with('message', \"新增成功!總共新增$count\" . \"筆\");//redirect home and \n }\n }", "function inputdata($data)\n\t{\n\t\t$this->db->insert($this->table, $data);\n\t}", "public function run()\n {\n\t\t$objPHPExcel = PHPExcel_IOFactory::load('public/excel-imports/designations.xlsx');\n\t\t$sheet = $objPHPExcel->getSheet(0);\n\t\t$highestRow = $sheet->getHighestDataRow();\n\t\t$highestColumn = $sheet->getHighestDataColumn();\n\t\t$header = $sheet->rangeToArray('A1:' . $highestColumn . '1', null, true, false);\n\t\t$header = $header[0];\n\t\tforeach ($header as $key => $column) {\n\t\t\tif ($column == null) {\n\t\t\t\tunset($header[$key]);\n\t\t\t}\n\t\t}\n\n\t\t$designation = $sheet->rangeToArray('A2:' . $highestColumn . $highestRow, null, true, false);\n\t\tif (!empty($designation)) {\n\t\t\tforeach ($designation as $key => $designationValue) {\n\t\t\t\t$val = [];\n\t\t\t\tforeach ($header as $headerKey => $column) {\n\t\t\t\t\tif (!$column) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$header_col = str_replace(' ', '_', strtolower($column));\n\t\t\t\t\t\t$val[$header_col] = $designationValue[$headerKey];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$val = (object) $val;\n\t\t\t\ttry {\n\t\t\t\t\tif (empty($val->company)) {\n\t\t\t\t\t\tdump('Record No: ' . ($key + 1) . ' - Company is required');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}if (empty($val->name)) {\n\t\t\t\t\t\tdump('Record No: ' . ($key + 1) . ' - Name is required');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (empty($val->grade)) {\n\t\t\t\t\t\tdump('Record No: ' . ($key + 1) . ' - Grade name is required');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tdump($val->company, $val->name, $val->grade);\n\n\t\t\t\t\t$validator = Validator::make((array) $val, [\n\t\t\t\t\t\t'name' => [\n\t\t\t\t\t\t\t'string',\n\t\t\t\t\t\t\t'max:255',\n\t\t\t\t\t\t],\n\t\t\t\t\t]);\n\t\t\t\t\tif ($validator->fails()) {\n\t\t\t\t\t\tdump('Record No: ' . ($key + 1) . ' ' . implode('', $validator->errors()->all()));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tdump($val->company, $val->name, $val->grade);\n\n\t\t\t\t\t$company = Company::select(\n\t\t\t\t\t\t'id',\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t\t\t->where('id', $val->company)\n\t\t\t\t\t\t->first();\n\t\t\t\t\tif (!$company) {\n\t\t\t\t\t\tdump('Record No: ' . ($key + 1) . ' - Company not found');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$grade = Entity::select(\n\t\t\t\t\t\t'id',\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t\t\t->where('name', $val->grade)\n\t\t\t\t\t\t->first();\n\n\t\t\t\t\tif (!$grade) {\n\t\t\t\t\t\tdump('Record No: ' . ($key + 1) . ' - Grade Not Found');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$existing_designation = Designation::where('company_id',$company->id)\n\t\t\t\t\t->where('name',$val->name)\n\t\t\t\t\t->where('grade_id',$grade->id)->first();\n\t\t\t\t\t\n\t\t\t\t\tif ($existing_designation) {\n\t\t\t\t\t\tdump('Record No: ' . ($key + 1) . ' - Designation Already Exist');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$designation = new Designation;\n\t\t\t\t\t$designation->company_id = $company->id;\n\t\t\t\t\t$designation->name = $val->name;\n\t\t\t\t\t$designation->grade_id = $grade->id;\n\t\t\t\t\t$designation->created_by = 1;\n\t\t\t\t\t$designation->save();\n\t\t\t\t\tdump(' === updated === ');\n\n\t\t\t\t} catch (\\Exception $e) {\n\t\t\t\t\tdump($e);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdd(' == completed ==');\n\t\t}\n }", "function store_data_in_db($params) {\r\n $db = get_db_handle(); ## method in helpers.php\r\n //$name = $params[0] . ' ' . $params[1] . ' ' . $params[2];\r\n $dob = $params[3] . '/' . $params[4] . '/' . $params[5];\r\n $phone = $params[11] .'-' . $params[12] . '-' . $params[13];\r\n##OK, duplicate check passed, now insert\r\n $sql = \"INSERT INTO person(first_name,last_name, dob, address, address2, city, state, zip, phone, email, gender, experience, category, medical, image) \".\r\n \"VALUES('$params[0]','$params[2]','$dob','$params[6]','$params[7]','$params[8]', '$params[9]', '$params[10]', '$phone', '$params[14]', '$params[15]', '$params[16]', '$params[17]', '$params[18]', '$params[19]');\";\r\n##echo \"The SQL statement is \",$sql; \r\n mysqli_query($db,$sql);\r\n $how_many = mysqli_affected_rows($db);\r\n echo(\"There were $how_many rows affected\");\r\n close_connector($db);\r\n }", "public function input_data($data,$table){\n\t\t$this->db->insert($table,$data);\n\t}", "public function importcccost(){\n// dd();\n $data = Excel::load('../couriers/clubcourierprices.xlsx', function($reader) {\n })->get();\n if(!empty($data) && $data->count()){\n foreach ($data as $key => $value) {\n if(!empty($value->from)){\n\n $fromId = 0;\n $toId = 0;\n $existingRegion = $this->checkCCregionexist($value->from);\n if(count($existingRegion)>0){\n $fromId = $existingRegion[0]->id;\n }else{\n $fromId = DB::table($this->DBTables['CCRegion'])->insertGetId(\n ['region' => $value->from]\n );\n }\n $existingRegion = $this->checkCCregionexist($value->to);\n if(count($existingRegion)>0){\n $toId = $existingRegion[0]->id;\n }else{\n $toId = DB::table($this->DBTables['CCRegion'])->insertGetId(\n ['region' => $value->to]\n );\n }\n $CostInsertId = DB::table($this->DBTables['CCCost'])->insertGetId(\n ['from_region_id' => $fromId, 'to_region_id'=>$toId, 'small_bag_cost'=>$value->small_bag_rrp,'standard_bag_cost'=>$value->standard_bag_rrp,'large_bag_cost'=>$value->large_bag_rrp,'transit_days'=>$value->transit_time_days]\n );\n }\n }\n }\n }", "public function loadWFData($table, $filename){\n //$filename = \"/Users/aprateek/Desktop/sms_cat_healthcare_speciality.csv\";\n error_log(\"Filenaem=\".$filename);\n $pd = array_map('str_getcsv', file($filename));\n $headers=array();\n foreach ($pd[0] as $head){\n $headers[]=trim($head);\n }\n if (count($headers) == 0){\n throw new Exception(\"The csv file has missing or malformed header\");\n }\n error_log(\"Head=\".SmsWfUtils::flatten($headers));\n \n try {\n $this->t_crtinsupd(\"DROP TABLE IF EXISTS \".$table.\";\");\n $create_stmt = \"CREATE TABLE IF NOT EXISTS \".$table.\" (\";\n foreach($headers as $head){\n $create_stmt .= self::esc($head).\" TEXT ,\";\n }\n $create_stmt = substr($create_stmt, 0, strlen($create_stmt) -1);\n $create_stmt .= \");\";\n error_log(\"create stmt=\".$create_stmt);\n $this->t_crtinsupd($create_stmt);\n }\n catch(Exception $e){\n throw new Exception(\"Error encountered while creating schema \".$e->getMessage());\n }\n \n try {\n foreach(array_splice($pd, 1) as $row){\n $insert_stmt=\"insert into \".$table.\" values (\";\n $data = array();\n for ($i=0; $i<count($pd[0]);$i++){\n $header = self::esc(trim($pd[0][$i]));\n $data[$header] = self::esc(trim($row[$i]));\n $insert_stmt .= \"'\".self::esc(trim($row[$i])).\"',\";\n }\n $insert_stmt = substr($insert_stmt, 0, strlen($insert_stmt) -1);\n $insert_stmt .= \");\";\n error_log(\"insert_stmt=\".$insert_stmt);\n $this->t_crtinsupd($insert_stmt);\n }\n }\n catch(Exception $e){\n throw new Exception(\"Error encountered while saving data \".$e->getMessage());\n }\n }", "public function actionSave($filename)\n\t{\n\t\n\t\tif (!Yii::app()->user->checkAccess('loadExcel'))\n\t\t\tthrow new CHttpException(403,Yii::t('http_status', '403'));\n\t\n\t\tif(empty($filename))\n\t\t\t$filename = $_POST['filename'];\n\t\t\t\n\t\tYii::import('application.vendors.PHPExcel',true);\n\t\t$objReader = new PHPExcel_Reader_Excel5;\n\t\t$objPHPExcel = $objReader->load(Yii::app()->basePath . '/../excel_uploads/' . $filename);\n\t\t$objWorksheet = $objPHPExcel->getActiveSheet();\n\t\t$highestRow = $objWorksheet->getHighestRow(); \n\t\t$highestColumn = $objWorksheet->getHighestColumn(); \n\t\t$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn); \n\t\n\t\t$errors = array();\n\t\tif(isset($_POST['table']) && !empty($_POST['table'])) {\n\t\t\t$green = $yellow = $red = 0;\n\t\t\t$success_msg = \"[ \".Yii::t('excel','Inserted rows').\" ]<br><br>\";\n\t\t\t$error_msg = \"[ \".Yii::t('excel','Not inserted rows').\" ]<br><br>\";\n\t\t\t$warning_msg = \"[ \".Yii::t('excel','Updated rows').\" ]<br><br>\";\n\t\t\tfor ($row = 2; $row <= $highestRow; ++$row) {\n\t\t\t\t$model_save = new $_POST['table'];\n\t\t\t\tforeach($model_save->attributeNames() as $attribute) {\n\t\t\t\t\tif($_POST['attr_'.$attribute] != \"\") { \n\t\t\t\t\t\t$model_save->setAttribute($attribute,$objWorksheet->getCellByColumnAndRow($_POST['attr_'.$attribute], $row)->getValue());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\n\t\t\t\tif($model_save->save()) {\n\t\t\t\t\t$success_msg .= Yii::t('excel','ROW ').($row-1).\": \".Yii::t('excel','insertion completed').\".<br>\";\n\t\t\t\t\t$green++;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$message = array();\n\t\t\t\t\tforeach($model_save->attributeNames() as $attribute) {\n\t\t\t\t\t\tif(isset($model_save->errors[$attribute])) {\n\t\t\t\t\t\t\tif(stripos($model_save->errors[$attribute][0],\"already\") > 0) {\n\t\t\t\t\t\t\t\t$model_update = $this->loadModel($objWorksheet->getCellByColumnAndRow($_POST['attr_'.$attribute], $row)->getValue(),$_POST['table']);\n\t\t\t\t\t\t\t\tforeach($model_update->attributeNames() as $attribute_update) {\n\t\t\t\t\t\t\t\t\tif($_POST['attr_'.$attribute_update] != \"\") { \n\t\t\t\t\t\t\t\t\t\t$model_update->setAttribute($attribute_update,$objWorksheet->getCellByColumnAndRow($_POST['attr_'.$attribute_update], $row)->getValue());\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\tif($model_update->save()) {\n\t\t\t\t\t\t\t\t\t$yellow++;\n\t\t\t\t\t\t\t\t\t$warning_msg .= Yii::t('excel','ROW ').($row-1).\": \".$model_save->errors[$attribute][0].\"<br>\";\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$red++;\n\t\t\t\t\t\t\t\t\t$error_msg .= Yii::t('excel','ROW ').($row-1).\": \".$model_update->errors[$attribute_update][0].\"<br>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$red++;\n\t\t\t\t\t\t\t\t$error_msg .= Yii::t('excel','ROW ').($row-1).\": \".$model_save->errors[$attribute][0].\"<br>\";\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\t\n\t\t\t$success_msg .= \"<br>\".Yii::t('excel','TOTAL ROWS').\": \".$green;\n\t\t\t$warning_msg .= \"<br>\".Yii::t('excel','TOTAL ROWS').\": \".$yellow;\n\t\t\t$error_msg .= \"<br>\".Yii::t('excel','TOTAL ROWS').\": \".$red;\n\t\t\t\n\t\t\tYii::app()->user->setFlash('success',$success_msg);\n\t\t\tYii::app()->user->setFlash('warning',$warning_msg);\n\t\t\tYii::app()->user->setFlash('error',$error_msg);\n\t\t\t$this->render('report',array('filename'=>$filename));\n\t\t\tYii::app()->end();\n\t\t}\n\t\t\n\t\t$setParams = false;\n\t\t$arrayData = array();\n\t\t$columnsArray = array();\n\t\t$xlsAttributes = array();\n\t\tfor ($row = 2; $row <= $highestRow; ++$row) {\n\t\t\t$rawData = array();\n\t\t\t$rawData['id'] = ($row-1);\n\t\t\tfor ($col = 0; $col <= $highestColumnIndex-1; ++$col) { \n\t\t\t\tif(!$setParams) {\n\t\t\t\t\t$columnArray = array(\"name\"=>$objWorksheet->getCellByColumnAndRow($col, 1)->getValue(),\"type\"=>\"raw\",\"value\"=>'$data[\"'.$objWorksheet->getCellByColumnAndRow($col, 1)->getValue().'\"]');\n\t\t\t\t\tarray_push($columnsArray,$columnArray);\n\t\t\t\t\tarray_push($xlsAttributes, $objWorksheet->getCellByColumnAndRow($col, 1)->getValue());\n\t\t\t\t}\n\t\t\t\t$rawData[$objWorksheet->getCellByColumnAndRow($col, 1)->getValue()] = $objWorksheet->getCellByColumnAndRow($col, $row)->getValue();\n\t\t\t}\n\t\t\tarray_push($arrayData,$rawData);\n\t\t\t$setParams = true;\n\t\t}\n\t\n\t\t$arrayDataProvider=new CArrayDataProvider($arrayData, array(\n\t 'id'=>'id',\n\t 'pagination'=>array(\n\t\t\t\t'pageSize'=>10,\n\t ),\n\t ));\n\t \n\t\t$this->render('save',array(\n\t\t\t'filename'=>$filename,\n\t\t\t'arrayDataProvider'=>$arrayDataProvider,\n\t\t\t'xlsAttributes'=>$xlsAttributes,\n\t\t\t'columnsArray'=>$columnsArray,\n\t\t));\n\t}", "public function insert($tablename,$data){\n if(!$this->select_db($this->_currentDB))\n return FALSE;\n if(!$this->_table_exists($this->_currentDB,$tablename)){\n $errmsg=sprintf(self::$_error_code_list[23], $tablename);\n $this->_trigger_error($errmsg);\n return FALSE;\n \t}\n \t$table_files=$this->_table_files($this->_currentDB,$tablename);\n \t$frmf=$table_files['frame'];\n \t$datf=$table_files['data'];\n \t$idxf=$table_files['index'];\n \tif(!is_array($data)){\n $errmsg=self::$_error_code_list[14];\n $this->_trigger_error($errmsg);\n return FALSE;\n \t}\n \t$frm=$this->_get_frame($this->_currentDB,$tablename);\n \t//check if all field was filled\n \tif(count($data)!=count($frm)){\n $errmsg=self::$_error_code_list[15];\n $this->_trigger_error($errmsg);\n return FALSE;\n \t}\n \tfor ($i=0,$num=count($data);$i<$num;$i++){\n //if one field was set to NULL\n if(@in_array('auto_increment',$frm[$i]))\n \t$data[$i]=NULL;\n if($data[$i]==NULL){\n //check if the field is auto_increment\n \tif(@!in_array('auto_increment',$frm[$i])){\n $errmsg=sprintf(self::$_error_code_list[16],$frm[$i]);\n $this->_trigger_error($errmsg);\n return FALSE;\n }\n //replace NULL with the auto_inrement number,get from the index.txt\n $auto_num=(int)file_get_contents($idxf);\n \t$data[$i]=$auto_num;\n }\n $data[$i]=$this->_escape_string($data[$i]);\n \t}\n \t$insert_str=implode($this->_field_separator,$data);\n \t$insert_str.=\"\\n\";\n \tif(file_put_contents($datf,$insert_str,FILE_APPEND) && file_put_contents($idxf,$auto_num+1)){\n \t $this->_insert_id=$auto_num;\n \t return TRUE;\n \t}else{\n \t $errmsg=self::$_error_code_list[17];\n \t return FALSE;\n \t}\n }", "function insert($table_name, $data)\n {\n $return = false;\n $columns = join(',', array_keys($data));\n\n $values = array();\n foreach (array_values($data) as $value) {\n $values[] = \"'$value'\";\n\n }\n $values = join(',', $values);\n $query = \"insert into {$table_name} ({$columns}) values($values) \";\n try {\n $this->db->query($query);\n $return = true;\n } catch (Exception $e) {\n\n }\n return $return;\n\n }", "function section_details($objPHPExcel,$school_code,$log,$type=false,$batch,$row=1,$col=0){\n\techo PHP_EOL,\"Sheet 5 Called \",PHP_EOL;\n\t$log->lwrite('Section Details ( Sheet 5 ) Called');\n\t\n\t//$arg=array('SchoolCode'=>$school_code);\n\t\n\t$arg=array('school_code'=>$school_code,'ayid'=>'3');\n\t$migrationConnection= new SONBMongoConnectionClass('upload_details');//print_r($mongoConnection);\t\n\t$find=$migrationConnection->findALL($arg);\n\t$uploadID=array();\n\t//$schoolCode=NUll;\n\t\n\tforeach($find as $id){\n\t\t//$schoolCode=$id['school_code'];\n\t\t$uploadID[]=$id['UploadID'];\n\t}\n\t\n\t\n\t$mongoConnection= new SONBMongoConnectionClass('school_boarding_detail');\n\t//$find=$mongoConnection->findALL($arg);\n\t\n\t\n\t$find=$mongoConnection->_connection->aggregateCursor(array( \n array( '$match' => array(\"SchoolCode\" => $school_code ,'UploadID'=>array('$in'=>$uploadID),'SectionCode' => array('$ne'=> null))),\n\tarray('$group'=>array('_id'=>array('ClassLevel'=>'$ClassLevel','ClassName'=>'$ClassName','Section'=>'$Section','SectionCode'=>'$SectionCode','SectionGroupCode'=>'$SectionGroupCode')))));\n\t\n//print_r($find);die\t;\n/*foreach($find as $finds){\nprint_r($finds['_id']);die;\n}*/\n\n\n\n\t\n\t//print_R($result);die;\n\t\n\n\t$objSheet = $objPHPExcel->getActiveSheet();\t\n\t$objSheet = $objPHPExcel->createSheet();\n\t\n\t$objSheet->getColumnDimension('A')->setAutoSize(TRUE);\n $objSheet->getColumnDimension('B')->setAutoSize(TRUE);\n $objSheet->getColumnDimension('C')->setAutoSize(TRUE);\n $objSheet->getColumnDimension('D')->setAutoSize(TRUE);\n $objSheet->getColumnDimension('E')->setAutoSize(TRUE);\n $objSheet->getColumnDimension('F')->setAutoSize(TRUE);\n\t$objSheet->getStyle(\"A\")->getAlignment()->setHorizontal(\\PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t$objSheet->getStyle(\"B\")->getAlignment()->setHorizontal(\\PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t$objSheet->getStyle(\"C\")->getAlignment()->setHorizontal(\\PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t$objSheet->getStyle(\"D\")->getAlignment()->setHorizontal(\\PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t$objSheet->getStyle(\"E\")->getAlignment()->setHorizontal(\\PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t$objSheet->getStyle(\"F\")->getAlignment()->setHorizontal(\\PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n $objSheet->setCellValueByColumnAndRow($col, $row, 'SectionMatch');$col++;\n $objSheet->setCellValueByColumnAndRow($col, $row, 'ClassLevel'); $col++;\n $objSheet->setCellValueByColumnAndRow($col, $row, 'ClassName'); $col++;\n $objSheet->setCellValueByColumnAndRow($col, $row, 'Section'); $col++;\n\t$objSheet->setCellValueByColumnAndRow($col, $row, 'SectionCode'); $col++;\n $objSheet->setCellValueByColumnAndRow($col, $row, 'SectionGroupCode'); $col++;\n \n\t\t\n\t$row++;\n\t//$row++;\n foreach($find as $mongofetch){ //print_r($mongofetch);die;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t$col =0;\n\t\t\t$objSheet->setCellValueByColumnAndRow($col, $row, $mongofetch['_id']['ClassLevel'].$mongofetch['_id']['Section']); $col++;\n\t\t\t$objSheet->setCellValueByColumnAndRow($col, $row, $mongofetch['_id']['ClassLevel']); $col++;\n\t\t\t$objSheet->setCellValueByColumnAndRow($col, $row, $mongofetch['_id']['ClassName']); $col++;\n\t\t\t$objSheet->setCellValueByColumnAndRow($col, $row, $mongofetch['_id']['Section']); $col++;\n\t\t\t$objSheet->setCellValueByColumnAndRow($col, $row, $mongofetch['_id']['SectionCode']); $col++;\n\t\t\t$objSheet->setCellValueByColumnAndRow($col, $row, $mongofetch['_id']['SectionGroupCode']); $col++;\n\t\t\t$row++;\n\t\t\n \n } \n //echo $row.\"<br/>\";\n \n \n \n $objSheet->setTitle('SectionDetails');\n\t\n\treturn $objSheet;\n}", "protected function insertRow()\n { \n $assignedValues = $this->getAssignedValues();\n\n $columns = implode(', ', $assignedValues['columns']);\n $values = '\\''.implode('\\', \\'', $assignedValues['values']).'\\'';\n\n $tableName = $this->getTableName($this->className);\n\n $connection = Connection::connect();\n\n $insert = $connection->prepare('insert into '.$tableName.'('.$columns.') values ('.$values.')');\n var_dump($insert);\n if ($insert->execute()) { \n return 'Row inserted successfully'; \n } else { \n var_dump($insert->errorInfo()); \n } \n }", "public function run()\n {\n \tDB::beginTransaction();\n\n Excel::import(new PageImport, storage_path('imports/pages.xls'));\n Excel::import(new PageItemImport, storage_path('imports/page_items.xls'));\n\n DB::commit();\n }", "public function run()\n {\n $objPHPExcel = PHPExcel_IOFactory::load(base_path('articles.xlsx')); // load file ra object PHPExcel\n $provinceSheet = $objPHPExcel->setActiveSheetIndex(0); // Set sheet sẽ được đọc dữ liệu\n $highestRow = $provinceSheet->getHighestRow(); // Lấy số row lớn nhất trong sheet\n for ($row = 2; $row <= $highestRow; $row++) { // For chạy từ 2 vì row 1 là title\n articles::create([\n 'title' => $provinceSheet->getCellByColumnAndRow(0, $row)->getValue(),\n 'slug' => $provinceSheet->getCellByColumnAndRow(1, $row)->getValue(),\n 'description'=>$provinceSheet->getCellByColumnAndRow(2, $row)->getValue(),\n 'content'=>$provinceSheet->getCellByColumnAndRow(3, $row)->getValue()\n ]);\n }\n\n }", "public function run()\n {\n $rows = Excel::selectSheetsByIndex(0)->load('/public/seeder_file/seeder_jabatan.xlsx', function($reader){\n //options\n })->get();\n \n $rowRules = [\n 'id' => 'required',\n 'name' => 'required',\n ];\n\n $i= 0;\n foreach($rows as $row)\n {\n $validator = Validator::make($row->toArray(), $rowRules);\n if($validator->fails())\n {\n continue;\n }\n\n try{\n $jabatan = Jabatan::create([\n 'id' => $row['id'],\n 'jabatan_name' => $row['name'],\n ]);\n \n } \n catch(Exception $e){\n continue;\n }\n $i++; \n }\n }", "public static function insert_row($dataDir)\n {\n $workbook = new Workbook($dataDir . 'Book1.xls');\n\n # Accessing the first worksheet in the Excel file\n $worksheet = $workbook->getWorksheets()->get(0);\n\n # Inserting a row into the worksheet at 3rd position\n $worksheet->getCells()->insertRows(2,1);\n\n # Saving the modified Excel file in default (that is Excel 2003) format\n $workbook->save($dataDir . \"Insert Row.xls\");\n\n print \"Insert Row Successfully.\" . PHP_EOL;\n\n }", "public function run()\n {\n DB::table('entrevistas')->insert([\n [ \n 'presentacion' => 'excelente', \n 'inteligencia' => 'excelente', \n 'formacion' => 'excelente', \n 'experiencia' => 'excelente', \n 'facilidad_expresion' => 'excelente', \n 'habilidad' => 'excelente', \n 'otros' => 'excelente',\n 'observaciones' => 'Persona apta para el cargo',\n 'aspirante_id' => 5\n ]\n \n ]);\n\n }", "public function store(Request $req)\n {\n $file = $req->file;\n $data = Excel :: toArray(new UsersImport, $file);\n //dd($data);\n // var_dump($data[0][0]);\n // echo $data[0][0]['email'];\n // // DB::tables('users')->where('email',)\n \n for($i=0;$i<sizeof($data[0]);$i++){\n $fields = [\n 'pimsid' => $data[0][$i]['pimsid'],\n 'ftid' => $data[0][$i]['ftid']\n ];\n DB::table('users')->where('email',$data[0][$i]['email'])->update($fields);\n\n }\n return redirect()->route('userList');\n }", "function file_import_execute() {\n\t\t$this->load->library('excel_reader');\n\n\t\t// Set output Encoding.\n\t\t$this->excel_reader->setOutputEncoding('CP1251');\n\n\t\t$this->excel_reader->read($this->session->userdata('file_upload'));\n\n\t\t// Sheet 1\n\t\t$excel = $this->excel_reader->sheets[0] ;\n\n\t\t// is it grpo template file?\n\t \tif($excel['cells'][1][1] == 'SFG Item No.' && $excel['cells'][1][2] == 'SFG Quantity') {\n\n\t\t\t$this->db->trans_start();\n\n\t\t\t$j = 0; // grpo_header number, started from 1, 0 assume no data\n\t\t\tfor ($i = 2; $i <= $excel['numRows']; $i++) {\n\t\t\t\t$x = $i - 1; // to check, is it same grpo header?\n\n\t\t\t\t$kode_sfg = $excel['cells'][$i][1];\n\t\t\t\t$quantity_sfg = $excel['cells'][$i][2];\n \t\t\t$material_no = $excel['cells'][$i][3];\n \t\t\t$quantity = $excel['cells'][$i][4];\n \t$plant = $excel['cells'][$i][5];\n if(empty($plant)) {\n $plant = $this->session->userdata['ADMIN']['plant'];\n }\n\n\n\t\t\t\t// check grpo header\n\t\t\t\tif(($excel['cells'][$i][1] != $excel['cells'][$x][1])||($excel['cells'][$i][5] != $excel['cells'][$x][5])) {\n\n $sfgs_header = $this->m_sfgs->sfgs_header_select_by_kode_sfg($kode_sfg,$plant);\n if ($sfgs_header!=FALSE) {\n $this->m_sfgs->sfgs_header_delete_multiple($sfgs_header);\n }\n $j++;\n\t\t\t\t // \tif($sfgs_detail_temp = $this->m_general->sap_item_groups_select_all_sfgs()) {\n $object['sfgs_headers'][$j]['plant'] = $plant;\n $object['sfgs_headers'][$j]['kode_sfg'] = $excel['cells'][$i][1];\n $item_temp = $this->m_general->sap_item_select_by_item_code($excel['cells'][$i][1]);\n $object['sfgs_headers'][$j]['nama_sfg'] = $item_temp['MAKTX'];\n $object['sfgs_headers'][$j]['quantity_sfg'] = $quantity_sfg;\n $object['sfgs_headers'][$j]['uom_sfg'] = $item_temp['UNIT'];\n\t\t\t\t\t $object['sfgs_headers'][$j]['id_user_input'] = $this->session->userdata['ADMIN']['admin_id'];\n\t\t\t\t\t $object['sfgs_headers'][$j]['filename'] = $this->session->userdata('filename_upload');\n\n\t\t\t\t\t\t$id_sfgs_header = $this->m_sfgs->sfgs_header_insert($object['sfgs_headers'][$j]);\n\n \t$sfgs_header_exist = TRUE;\n\t\t\t\t\t\t$k = 1; // grpo_detail number\n\n\t\t\t //\t\t} else {\n //\t$sfgs_header_exist = FALSE;\n\t\t\t//\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($sfgs_header_exist) {\n\n\t\t\t\t\tif($sfgs_detail_temp = $this->m_general->sap_item_select_by_item_code($material_no)) {\n $object['sfgs_details'][$j][$k]['id_sfgs_header'] = $id_sfgs_header;\n\t\t\t\t\t\t$object['sfgs_details'][$j][$k]['id_sfgs_h_detail'] = $k;\n\t\t\t\t\t\t$object['sfgs_details'][$j][$k]['material_no'] = $material_no;\n\t\t\t\t\t\t$object['sfgs_details'][$j][$k]['material_desc'] = $sfgs_detail_temp['MAKTX'];\n \t\t\t\t\t $object['sfgs_details'][$j][$k]['quantity'] = $quantity;\n\n $uom_import = $sfgs_detail_temp['UNIT'];\n if(strcasecmp($uom_import,'KG')==0) {\n $uom_import = 'G';\n }\n if(strcasecmp($uom_import,'L')==0) {\n $uom_import = 'ML';\n }\n \t\t\t$object['sfgs_details'][$j][$k]['uom'] = $uom_import;\n\n\t\t\t\t\t\t$id_sfgs_detail = $this->m_sfgs->sfgs_detail_insert($object['sfgs_details'][$j][$k]);\n\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$this->db->trans_complete();\n\n\t\t\t$object['refresh'] = 1;\n\t\t\t$object['refresh_text'] = 'Data Master Semi Finished Goods (SFG) BOM berhasil di-upload';\n\t\t\t$object['refresh_url'] = $this->session->userdata['PAGE']['sfgs_browse_result'];\n\t\t\t//redirect('member_browse');\n\n\t\t\t$this->template->write_view('content', 'refresh', $object);\n\t\t\t$this->template->render();\n\n\t\t} else {\n\n\t\t\t\t$object['refresh_text'] = 'File Excel yang Anda upload bukan file Master Semi Finished Goods (SFG) BOM atau file tersebut rusak. Umumnya karena di dalam file diberi warna baik pada teks maupun cell. Harap periksa kembali file Excel Anda.<br><br>SARAN: Coba pilih semua teks dan ubah warna menjadi \"Automatic\". Sebaiknya tidak ada warna pada teks, kolom dan baris dalam file Excel Anda.';\n\t\t\t\t$object['refresh_url'] = 'sfgs/browse_result/0/0/0/0/10';\n\t\t\t\t$object['jag_module'] = $this->jagmodule;\n\t\t\t\t$object['error_code'] = '008';\n\t\t\t\t$object['page_title'] = 'Error '.strtoupper($object['jag_module']['web_module']).': '.$object['jag_module']['web_trans'];\n\t\t\t\t$this->template->write_view('content', 'errorweb', $object);\n\t\t\t\t$this->template->render();\n\n\t\t}\n\n\t}", "public function prosesimport()\n {\n // include APPPATH.'third_party/PHPExcel/PHPExcel.php';\n\t\trequire_once APPPATH.\"/libraries/phpexcel/PHPExcel.php\"; \n\t\t \n\t\t$config['upload_path'] = FCPATH . 'uploads/temp/';\n $config['allowed_types'] = 'xlsx|xls|csv';\n $config['max_size'] = '10000';\n $config['encrypt_name'] = true;\n\n $this->load->library('upload', $config);\n\n if (!$this->upload->do_upload()) \n\t\t{\n\n //upload gagal\n $this->session->set_flashdata('notif', '<div class=\"alert alert-danger\"><b>PROSES IMPORT GAGAL!</b> '.$this->upload->display_errors().'</div>');\n //redirect halaman\n redirect('importanggota');\n\n } \n\t\telse \n\t\t{\n\n $data_upload = $this->upload->data();\n\n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/temp/'.$data_upload['file_name']); // Load file yang telah diupload ke folder excel\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n\n $data = array();\n\n $numrow = 1;\n foreach($sheet as $row){\n\t\t\t \n\t\t\t\tif($numrow > 1){\n\t\t\t\t\t // trim(strip_tags(addslashes(strtoupper($this->input->post(\"suku\", TRUE)))))\n\t\t\t\t\t// $NO_ANGGOTA = $row['A'] ; // NO ANGGOTA\n\t\t\t\t\t\n\t\t\t\t\t$gettgldaftar = trim(strip_tags($row['B'])) ; // TANGGAL DAFTAR\n\t\t\t\t\t$pec = explode(\"/\",$gettgldaftar);\n\t\t\t\t\t\n\t\t\t\t\t$settgldaftar = date_create($pec[2].\"-\".$pec[1].\"-\".$pec[0]);\n\t\t\t\t\t$TGL_DAFTAR = date_format($settgldaftar,\"Y-m-d\");\n\t\t\t\t\t \n\t\t\t\t\t// $TGL_DAFTAR = trim(strip_tags($row['B'])) ; \n\t\t\t\t\t$CABANG = trim(strip_tags(addslashes($row['C']))) ; // CABANG\n\t\t\t\t\t$NAMA = trim(strip_tags(addslashes($row['D']))) ; // NAMA ANGGOTA\n\t\t\t\t\t$TMP_LAHIR = trim(strip_tags(addslashes($row['E']))) ; // TEMPAT LAHIR\n\t\t\t\t\t\n\t\t\t\t\t$gettgllahir = trim(strip_tags($row['F'])) ; // TGL LAHIR\n\t\t\t\t\t$pech = explode(\"/\",$gettgllahir);\n\t\t\t\t\t\n\t\t\t\t\t$ctgllahir = date_create($pech[2].\"-\".$pech[1].\"-\".$pech[0]);\n\t\t\t\t\t$TGL_LAHIR = date_format($ctgllahir,\"Y-m-d\");\n\t\t\t\t\t \n\t\t\t\t\t// $TGL_LAHIR = trim(strip_tags($row['F'])) ;\n\t\t\t\t\t$ALAMAT_DOMISILI = trim(strip_tags(addslashes($row['G']))) ; // ALAMAT DOMISILI\n\t\t\t\t\t$IDPROVINSI = trim(strip_tags(addslashes($row['H']))) ; // PROVINSI\n\t\t\t\t\t$IDKOTA = trim(strip_tags(addslashes($row['I']))) ; // KOTA\n\t\t\t\t\t$IDKECAMATAN = trim(strip_tags(addslashes($row['J']))) ; // KECAMATAN\n\t\t\t\t\t$IDKELURAHAN = trim(strip_tags(addslashes($row['K']))) ; // KELURAHAN\n\t\t\t\t\t$AGAMA = trim(strip_tags(addslashes($row['L']))) ; // AGAMA\n\t\t\t\t\t$JK = trim(strip_tags(addslashes($row['M']))) ; // JENIS_KLAMIN\n\t\t\t\t\t$TELP = trim(strip_tags(addslashes($row['N']))) ; // TELP\n\t\t\t\t\t$STATUS = trim(strip_tags(addslashes($row['O']))) ; // STATUS\n\t\t\t\t\t$IDENTITAS = trim(strip_tags(addslashes($row['P']))) ; // IDENTITAS \n\t\t\t\t\t$NO_IDENTITAS = trim(strip_tags(addslashes($row['Q']))) ; // NO IDENTITAS\n\t\t\t\t\t$IBU_KANDUNG = trim(strip_tags(addslashes($row['R']))) ; // IBU KANDUNG\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t// echo $TGL_DAFTAR.\"</br>\";\n\t\t\t\t\t$nom = $this->dbasemodel->loadsql(\"SELECT COALESCE(MAX(NO_ANGGOTA), 0)+1 AS NOMER FROM m_anggota WHERE KODEPUSAT='\".$this->session->userdata('wad_kodepusat').\"' AND KODECABANG='\".$CABANG.\"'\");\n\n\t\t\t\t\t$rnom = $nom->row();\n\t\t\t\t\t$invID = str_pad($rnom->NOMER, 4, '0', STR_PAD_LEFT);\n\t\t\t\t\t\n\t\t\t\t\t$getKodecabang = $this->dbasemodel->loadsql(\"SELECT * FROM m_cabang WHERE KODE='\".$CABANG.\"'\")->row();\n\t\t\t\t\t\n\t\t\t\t\t$noAgt = $this->session->userdata('wad_kodepusat').\"-\".$getKodecabang->KODECABANG.\"-\".$invID;\n\t\t\t\t\t\n\t\t\t\t\t$arrInsert = array(\n\t\t\t\t\t\t\t\"NAMA\" => $NAMA,\n\t\t\t\t\t\t\t\"IDENTITAS\" => $IDENTITAS,\n\t\t\t\t\t\t\t\"KODEPUSAT\" => $this->session->userdata('wad_kodepusat'),\n\t\t\t\t\t\t\t\"KODECABANG\" => $CABANG,\n\t\t\t\t\t\t\t\"NO_ANGGOTA\" => $invID,\n\t\t\t\t\t\t\t\"NO_IDENTITAS\" => $NO_IDENTITAS,\n\t\t\t\t\t\t\t\"JK\" => $JK,\n\t\t\t\t\t\t\t\"TMP_LAHIR\" => $TMP_LAHIR,\n\t\t\t\t\t\t\t\"TGL_LAHIR\" => $TGL_LAHIR,\n\t\t\t\t\t\t\t\"IBU_KANDUNG\" => $IBU_KANDUNG,\n\t\t\t\t\t\t\t\"USER\" => $this->session->userdata('wad_user'),\n\t\t\t\t\t\t\t\"STATUS\" => $STATUS, \n\t\t\t\t\t\t\t\"ALAMAT\" => $ALAMAT_DOMISILI,\n\t\t\t\t\t\t\t\"ALAMAT_DOMISILI\" => $ALAMAT_DOMISILI, \n\t\t\t\t\t\t\t\"AGAMA\" => $AGAMA,\n\t\t\t\t\t\t\t\"IDPROVINSI\" => $IDPROVINSI,\n\t\t\t\t\t\t\t\"IDKOTA\" => $IDKOTA,\n\t\t\t\t\t\t\t\"IDKECAMATAN\" => $IDKECAMATAN,\n\t\t\t\t\t\t\t\"IDKELURAHAN\" => $IDKELURAHAN,\n\t\t\t\t\t\t\t\"TELP\" => $TELP, \n\t\t\t\t\t\t\t\"TGL_DAFTAR\" => $TGL_DAFTAR, //date(\"Y-m-d\"), \n\t\t\t\t\t\t\t\"JABATAN\" => '2', //date(\"Y-m-d\"), \n\t\t\t\t\t\t\t\"AKTIF\" => 'Y' //date(\"Y-m-d\"), \n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t$insertProc = $this->dbasemodel->insertDataProc('m_anggota', $arrInsert);\n\t\t\t\t\t\t\n\t\t\t\t\t$getIdKas = $this->dbasemodel->loadsql(\"SELECT * FROM jenis_kas WHERE TMPL_SIMPAN = 'Y' AND KODECABANG='\".$CABANG.\"' LIMIT 1\")->row();\n\t\t\t\t\t\t\n\t\t\t\t\t$insertsimp = array(\n\t\t\t\t\t\t'ID_ANGGOTA' => $insertProc,\n\t\t\t\t\t\t'TGL_TRX' => date(\"Y-m-d H:i:s\"),\n\t\t\t\t\t\t'ID_JENIS' => \"258\",\n\t\t\t\t\t\t'JUMLAH' => \"30000\",\n\t\t\t\t\t\t'KET_BAYAR' => \"Tabungan\",\n\t\t\t\t\t\t'AKUN' => \"Setoran\",\n\t\t\t\t\t\t'DK' => \"D\", \n\t\t\t\t\t\t'ID_KAS' => $getIdKas->ID_JNS_KAS, \n\t\t\t\t\t\t'ID_KASAKUN' => $getIdKas->IDAKUN, \n\t\t\t\t\t\t'USERNAME' => $this->session->userdata('wad_user'),\n\t\t\t\t\t\t'NAMA_PENYETOR' => $NAMA,\n\t\t\t\t\t\t'NO_IDENTITAS' => $NO_IDENTITAS,\n\t\t\t\t\t\t'ALAMAT' => $ALAMAT_DOMISILI,\n\t\t\t\t\t\t'KODEPUSAT' => $this->session->userdata('wad_kodepusat'),\n\t\t\t\t\t\t'KODECABANG' => $CABANG,\n\t\t\t\t\t\t'KOLEKTOR' => \"0\",\n\t\t\t\t\t\t'STATUS' => \"0\",\n\t\t\t\t\t\t'KETERANGAN' => 'Setoran awal simpanan pokok '.$NAMA.' '.$noAgt\n\t\t\t\t\t);\n\t\t\t\n\t\t\t\t\t$this->dbasemodel->insertData('transaksi_simp', $insertsimp);\n\t\t\t\t\t\t\n\t\t\t\t\t$insertsimp2 = array(\n\t\t\t\t\t\t'ID_ANGGOTA' => $insertProc,\n\t\t\t\t\t\t'TGL_TRX' => date(\"Y-m-d H:i:s\"),\n\t\t\t\t\t\t'ID_JENIS' => \"180\",\n\t\t\t\t\t\t'JUMLAH' => \"50000\",\n\t\t\t\t\t\t'KET_BAYAR'\t => \"Tabungan\",\n\t\t\t\t\t\t'AKUN' => \"Setoran\",\n\t\t\t\t\t\t'DK' => \"D\", \n\t\t\t\t\t\t'ID_KAS' => $getIdKas->ID_JNS_KAS,\n\t\t\t\t\t\t'ID_KASAKUN' => $getIdKas->IDAKUN, \n\t\t\t\t\t\t'USERNAME' => $this->session->userdata('wad_user'),\n\t\t\t\t\t\t'NAMA_PENYETOR' => $NAMA,\n\t\t\t\t\t\t'NO_IDENTITAS' => $NO_IDENTITAS,\n\t\t\t\t\t\t'ALAMAT' => $ALAMAT_DOMISILI,\n\t\t\t\t\t\t'KODEPUSAT' => $this->session->userdata('wad_kodepusat'),\n\t\t\t\t\t\t'KODECABANG' => $CABANG,\n\t\t\t\t\t\t'KOLEKTOR' => \"0\",\n\t\t\t\t\t\t'STATUS' => \"0\",\n\t\t\t\t\t\t'KETERANGAN' => 'Setoran awal simpanan mudharabah '.$NAMA.' '.$noAgt\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$this->dbasemodel->insertData('transaksi_simp', $insertsimp2);\n\t\t\t\t\t\t\n\t\t\t\t\t$insertsimp3 = array(\n\t\t\t\t\t\t'ID_ANGGOTA' => $insertProc,\n\t\t\t\t\t\t'TGL_TRX' => date(\"Y-m-d H:i:s\"),\n\t\t\t\t\t\t'ID_JENIS' => \"259\",\n\t\t\t\t\t\t'JUMLAH' => \"20000\",\n\t\t\t\t\t\t'KET_BAYAR' => \"Tabungan\",\n\t\t\t\t\t\t'AKUN' => \"Setoran\",\n\t\t\t\t\t\t'DK' => \"D\", \n\t\t\t\t\t\t'ID_KAS' => $getIdKas->ID_JNS_KAS,\n\t\t\t\t\t\t'ID_KASAKUN' => $getIdKas->IDAKUN, \n\t\t\t\t\t\t'USERNAME' => $this->session->userdata('wad_user'),\n\t\t\t\t\t\t'NAMA_PENYETOR' => $NAMA,\n\t\t\t\t\t\t'NO_IDENTITAS' => $NO_IDENTITAS,\n\t\t\t\t\t\t'ALAMAT' => $ALAMAT_DOMISILI,\n\t\t\t\t\t\t'KODEPUSAT' => $this->session->userdata('wad_kodepusat'),\n\t\t\t\t\t\t'KODECABANG' => $CABANG,\n\t\t\t\t\t\t'KOLEKTOR' => \"0\",\n\t\t\t\t\t\t'STATUS' => \"0\",\n\t\t\t\t\t\t'KETERANGAN' => 'Setoran awal simpanan wajib '.$NAMA.' '.$noAgt\n\t\t\t\t\t); \n\t\t\t\t\t$this->dbasemodel->insertData('transaksi_simp', $insertsimp3);\n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t$sqlcus = \"SELECT * FROM transaksi_simp WHERE UPDATE_DATA='0000-00-00 00:00:00' AND DATE(TGL_TRX)='\".date(\"Y-m-d\").\"' AND STATUS='0' AND KODECABANG='\".$CABANG.\"'\";\n\t\t\t\n\t\t\t\t\t$cus = $this->dbasemodel->loadsql($sqlcus);\n\t\t\t\t\t\n\t\t\t\t\tif($cus->num_rows()>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($cus->result() as $key)\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t// Insert data transaksi simpanan ke jurnal transaksi(table vtransaksi) \n\t\t\t\t\t\t\t$datatransaksi = array( 'tgl' => $key->TGL_TRX, 'jumlah' => $key->JUMLAH, 'keterangan' => $key->KETERANGAN, 'ket_dt' => $key->KETERANGAN, 'user' => $key->USERNAME, 'kodecabang' => $key->KODECABANG, 'idkasakun' => $key->ID_KASAKUN);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->ModelVTransaksi->insertVtransaksi($key->ID_TRX_SIMP, $datatransaksi, 'ST', $key->ID_KAS, $key->ID_JENIS, 'SIMP');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$ceklst = $this->dbasemodel->loadsql(\"SELECT * FROM m_anggota_simp WHERE IDANGGOTA='\".$key->ID_ANGGOTA.\"' AND IDJENIS_SIMP='\".$key->ID_JENIS.\"'\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($ceklst->num_rows()>0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$rchek = $ceklst->row();\n\t\t\t\t\t\t\t\t$sql = sprintf(\"UPDATE m_anggota_simp SET SALDO = (SALDO + %s) WHERE ID_ANG_SIMP = %s \", $key->JUMLAH, $rchek->ID_ANG_SIMP);\n\t\t\t\t\t\t\t\t$this->dbasemodel->loadSql($sql); \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$datacheclist = array(\"IDANGGOTA\"\t => $key->ID_ANGGOTA,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"IDJENIS_SIMP\" => $key->ID_JENIS,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"SALDO\" => $key->JUMLAH,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"TGLREG\"\t\t => date(\"Y-m-d\", strtotime($key->TGL_TRX)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t$this->dbasemodel->insertData(\"m_anggota_simp\",$datacheclist);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$wheresimp = \"ID_TRX_SIMP = '\". $key->ID_TRX_SIMP.\"'\";\n\t\t\t\t\t\t\t$updatesimp = array(\"UPDATE_DATA\"=>date(\"Y-m-d H:i:s\"), \"STATUS\"=>\"1\");\n\t\t\t\t\t\t\t$this->dbasemodel->updateData(\"transaksi_simp\", $updatesimp, $wheresimp);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$wanggota = \"IDANGGOTA = '\". $key->ID_ANGGOTA.\"'\";\n\t\t\t\t\t\t\t$uanggota = array(\"AKTIF\"=>\"Y\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->dbasemodel->updateData(\"m_anggota\", $uanggota, $wanggota);\t \n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t$numrow++;\n \n\t\t\t} \n unlink(realpath('uploads/temp/'.$data_upload['file_name']));\n \n $this->session->set_flashdata('notif', '<div class=\"alert alert-success\"><b>PROSES IMPORT BERHASIL!</b> Data berhasil diimport!</div>');\n \n redirect('importanggota');\n\n }\n }", "public function insert($data);", "public function import_excel_file() \n {\n $this->load->library('excel');\n if ($_FILES['userfile']) \n {\n $path = \"C:/xampp/htdocs/reseller/uploads/pincode_excel/\"; \n $config['upload_path'] = 'uploads/pincode_excel/';\n $config['allowed_types'] = 'xlsx|xls|jpg|png';\n $config['remove_spaces'] = TRUE;\n $this->upload->initialize($config);\n $this->load->library('upload', $config);\n if (!$this->upload->do_upload('userfile')) \n {\n $error = array('error' => $this->upload->display_errors());\n } \n else \n {\n $data = array('upload_data' => $this->upload->data());\n }\n if (!empty($data['upload_data']['file_name'])) \n {\n $import_xls_file = $data['upload_data']['file_name'];\n } \n else \n {\n $import_xls_file = 0;\n }\n $inputFileName = $path . $import_xls_file;\n try \n {\n $inputFileType = PHPExcel_IOFactory::identify($inputFileName);\n $objReader = PHPExcel_IOFactory::createReader($inputFileType);\n $objPHPExcel = $objReader->load($inputFileName);\n } \n catch (Exception $e) \n {\n die('Error loading file \"' . pathinfo($inputFileName, PATHINFO_BASENAME)\n . '\": ' . $e->getMessage());\n }\n $allDataInSheet = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true);\n $arrayCount = count($allDataInSheet);\n $flag = 0;\n $createArray = array('srno','pincode', 'pincode_amount');\n $makeArray = array('srno'=>'srno','pincode' => 'pincode','pincode_amount' => 'pincode_amount');\n $SheetDataKey = array();\n foreach ($allDataInSheet as $dataInSheet) {\n foreach ($dataInSheet as $key => $value) {\n if (in_array(trim($value), $createArray)) {\n $value = preg_replace('/\\s+/', '', $value);\n $SheetDataKey[trim($value)] = $key;\n } else {\n \n }\n }\n }\n $data = array_diff_key($makeArray, $SheetDataKey);\n if (empty($data)) \n {\n $flag = 1;\n }\n if ($flag == 1) \n {\n for ($i = 2; $i <= $arrayCount; $i++) \n {\n $addresses = array();\n $pin_code = $SheetDataKey['pincode'];\n $pin_charge = $SheetDataKey['pincode_amount'];\n $pin_code = filter_var(trim($allDataInSheet[$i][$pin_code]), FILTER_SANITIZE_STRING);\n $pin_charge = filter_var(trim($allDataInSheet[$i][$pin_charge]), FILTER_SANITIZE_STRING);\n $fetchData[] = array('pin_code' => $pin_code, 'pin_charge' => $pin_charge);\n } \n\n $data['employeeInfo'] = $fetchData;\n $current_date=date('Y-m-d H:i:s');\n $current_ip= $_SERVER['REMOTE_ADDR'];\n $current_login=$this->session->userdata('id'); \n for($i=0;$i<count($data['employeeInfo']);$i++) \n { \n $excel_file_data=$data['employeeInfo'][$i];\n $excel_file_data['pin_status']=1;\n $excel_file_data['added_by']=$current_login;\n $excel_file_data['added_date']=$current_date;\n $excel_file_data['added_ip']=$current_ip;\n $where=array(\"pin_code\"=>$excel_file_data['pin_code']);\n $select=\"all\";\n $check_pincode_data = $this->common_model->getAllwherenew_objet('pincode_master',$where,$select);\n if($check_pincode_data=='no')\n {\n $data['product_list_data'] = $this->common_model->insertData('pincode_master',$excel_file_data); \n }\n\n }\n $msg=\"File Successfully Uploaded\" ;\n } \n else \n {\n $msg1=\"Please import correct file\" ;\n }\n }\n else\n {\n $msg1=\"Please import correct file\" ;\n }\n if($msg1)\n {\n $this->session->set_flashdata('msg', $msg1);\n $this->session->set_flashdata('class_msg', 'bg-red');\n }\n else if($msg)\n {\n $this->session->set_flashdata('msg', $msg);\n $this->session->set_flashdata('class_msg', 'bg-green');\n }\n $url_path=\"pincode/add_excel_file/\";\n redirect($url_path, 'refresh');\n }", "function file_import_execute() {\n\t\t$this->load->library('excel_reader');\n\n\t\t// Set output Encoding.\n\t\t$this->excel_reader->setOutputEncoding('CP1251');\n\n\t\t$this->excel_reader->read($this->session->userdata('file_upload'));\n\n\t\t// Sheet 1\n\t\t$excel = $this->excel_reader->sheets[0] ;\n\n\t\t// is it grpo template file?\n\tif($excel['cells'][1][1] == 'Material Doc. No' && $excel['cells'][1][2] == 'Material No.') {\n\n\t\t\t$this->db->trans_start();\n\n\t\t\t$j = 0; // grpo_header number, started from 1, 0 assume no data\n\t\t\tfor ($i = 2; $i <= $excel['numRows']; $i++) {\n\t\t\t\t$x = $i - 1; // to check, is it same grpo header?\n\n\t\t\t \t$item_group_code='all';\n\t\t\t\t\t$material_no = $excel['cells'][$i][2];\n\t\t\t\t\t$quantity = $excel['cells'][$i][3];\n\n\n\t\t\t\t// check grpo header\n\t\t\t\tif($excel['cells'][$i][1] != $excel['cells'][$x][1]) {\n\n $j++;\n\n\t\t\t\t\t \t$object['tpaket_headers'][$j]['posting_date'] = date(\"Y-m-d H:i:s\");\n\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['plant'] = $this->session->userdata['ADMIN']['plant'];\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['id_tpaket_plant'] = $this->m_tpaket->id_tpaket_plant_new_select($object['tpaket_headers'][$j]['plant']);\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['storage_location'] = $this->session->userdata['ADMIN']['storage_location'];\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['status'] = '1';\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['item_group_code'] = $item_group_code;\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['id_user_input'] = $this->session->userdata['ADMIN']['admin_id'];\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['filename'] = $upload['file_name'];\n\n\t\t\t\t\t\t$id_tpaket_header = $this->m_tpaket->tpaket_header_insert($object['tpaket_headers'][$j]);\n\n \t$tpaket_header_exist = TRUE;\n\t\t\t\t\t\t$k = 1; // grpo_detail number\n\n\t\t\t\t}\n\n\t\t\t\tif($tpaket_header_exist) {\n\n\t\t\t\t\tif($tpaket_detail_temp = $this->m_general->sap_item_select_by_item_code($material_no)) {\n $object['tpaket_details'][$j][$k]['id_tpaket_header'] = $id_tpaket_header;\n\t\t\t\t\t\t $object['tpaket_details'][$j][$k]['id_tpaket_h_detail'] = $k;\n\t\t\t\t\t\t\t$object['tpaket_details'][$j][$k]['material_no'] = $material_no;\n\t\t\t\t\t\t\t$object['tpaket_details'][$j][$k]['material_desc'] = $tpaket_detail_temp['MAKTX'];\n\t\t\t\t\t\t\t$object['tpaket_details'][$j][$k]['quantity'] = $quantity;\n if ($tpaket_detail_temp['UNIT']=='L')\n $tpaket_detail_temp['UNIT'] = 'ML';\n if ($tpaket_detail_temp['UNIT']=='KG')\n $tpaket_detail_temp['UNIT'] = 'G';\n\t\t\t\t\t\t\t$object['tpaket_details'][$j][$k]['uom'] = $tpaket_detail_temp['UNIT'];\n\n//\t\t\t\t\t\t$id_tpaket_detail = $this->m_tpaket->tpaket_detail_insert($object['tpaket_details'][$j][$k]);\n \t\t\t\t if($id_tpaket_detail = $this->m_tpaket->tpaket_detail_insert($object['tpaket_details'][$j][$k])) {\n\n if(($quantity > 0)&&($item_pakets = $this->m_mpaket->mpaket_details_select_by_item_paket($material_no))) {\n if($item_pakets !== FALSE) {\n \t\t$l = 1;\n \t\tforeach ($item_pakets->result_array() as $object['temp']) {\n \t\t\tforeach($object['temp'] as $key => $value) {\n \t\t\t\t$item_paket[$key][$l] = $value;\n \t\t\t}\n \t\t\t$l++;\n \t\t\tunset($object['temp']);\n \t\t}\n \t }\n \t $c_item_paket = count($item_paket['id_mpaket_h_detail']);\n \t\t\t for($m = 1; $m <= $c_item_paket; $m++) {\n $tpaket_detail_paket['id_tpaket_h_detail_paket'] = $m;\n $tpaket_detail_paket['id_tpaket_detail'] = $id_tpaket_detail;\n $tpaket_detail_paket['id_tpaket_header'] = $id_tpaket_header;\n $tpaket_detail_paket['material_no_paket'] = $material_no;\n $tpaket_detail_paket['material_no'] = $item_paket['material_no'][$m];\n $tpaket_detail_paket['material_desc'] = $item_paket['material_desc'][$m];\n $tpaket_detail_paket['quantity'] = ($item_paket['quantity'][$m]/$item_paket['quantity_paket'][$m])*$quantity;\n $tpaket_detail_paket['uom'] = $item_paket['uom'][$m];\n \t\t\t\t\t $this->m_tpaket->tpaket_detail_paket_insert($tpaket_detail_paket);\n }\n }\n \t\t\t\t }\n\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$this->db->trans_complete();\n\n\t\t\t$object['refresh'] = 1;\n\t\t\t$object['refresh_text'] = 'Data Transaksi Paket berhasil di-upload';\n\t\t\t$object['refresh_url'] = $this->session->userdata['PAGE']['tpaket_browse_result'];\n\t\t\t//redirect('member_browse');\n\n\t\t\t$this->template->write_view('content', 'refresh', $object);\n\t\t\t$this->template->render();\n\n\t\t} else {\n\n\t\t\t\t$object['refresh_text'] = 'File Excel yang Anda upload bukan file Paket atau file tersebut rusak. Umumnya karena di dalam file diberi warna baik pada teks maupun cell. Harap periksa kembali file Excel Anda.<br><br>SARAN: Coba pilih semua teks dan ubah warna menjadi \"Automatic\". Sebaiknya tidak ada warna pada teks, kolom dan baris dalam file Excel Anda.';\n\t\t\t\t$object['refresh_url'] = 'tpaket/browse_result/0/0/0/0/0/0/0/10';\n\t\t\t\t$object['jag_module'] = $this->jagmodule;\n\t\t\t\t$object['error_code'] = '011';\n\t\t\t\t$object['page_title'] = 'Error '.strtoupper($object['jag_module']['web_module']).': '.$object['jag_module']['web_trans'];\n\t\t\t\t$this->template->write_view('content', 'errorweb', $object);\n\t\t\t\t$this->template->render();\n\n\t\t}\n\n\t}", "public function insertData($upload_name)\n\t{\n\t\t$data = array(\n\t\t\t/* 'employee_id' yang dikiri harus sama seperti di table\n\t\t\t'employee_id' yang dikanan harus menurut name inputnya */\n\t\t\t'employee_id' => $this->input->post('employee_id'),\n\t\t\t'employee_firstname' => $this->input->post('employee_firstname'),\n\t\t\t'employee_lastname' => $this->input->post('employee_lastname'),\n\t\t\t'employee_address' => $this->input->post('employee_address'),\n\t\t\t'employee_telp' => $this->input->post('employee_telp'),\n\t\t\t'employee_email' => $this->input->post('employee_email'),\n\t\t\t'employee_password' => $this->input->post('employee_password')\n\t\t);\n\t\t/* jika semua sama sperti di table\n\t\tgunakan versi simple seprti berikut */\n\t\t$data = $this->input->post();\n\t\t$data['employee_image'] = $upload_name;\n\t\t/* eksekusi query insert into \"employee\" diisi dengan variable $data\n\t\tface2face ae lek bingung :| */\n\t\t$this->db->insert(\"employee\",$data);\n\t}", "protected function insert() {\n // get firat line and use it as title\n $this->title = $this->getFileTitle();\n\n $insertDoc = $this->dbConn->prepare(\"\n INSERT INTO docs(file_name, title, content, count_of_terms) \n VALUES (:fileName, :title, :content, :count_of_terms)\");\n $result = $insertDoc->execute(array(\n ':fileName' => $this->fileName,\n ':title' => $this->title,\n ':content' => $this->content,\n ':count_of_terms' => count($this->uniqueMatchesStatus)\n ));\n\n if ($result) {\n $this->id = $this->dbConn->lastInsertId();\n } else {\n throw new Exception('Error on insert document in database.', 500);\n }\n }", "public function upload_category_excel() {\n $data = array();\n $this->form_validation->set_rules('fileURL', 'Upload File', 'callback_checkFileValidation');\n if ($this->form_validation->run() == false) {\n \n } else {\n if (!empty($_FILES['fileURL']['name'])) {\n $extension = pathinfo($_FILES['fileURL']['name'], PATHINFO_EXTENSION);\n\n if ($extension == 'csv') {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();\n } elseif ($extension == 'xlsx') {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();\n } else {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xls();\n }\n\n $spreadsheet = $reader->load($_FILES['fileURL']['tmp_name']);\n $allDataInSheet = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);\n\n $arrayCount = count($allDataInSheet);\n $flag = 0;\n $createArray = array('ar_name', 'en_name', 'discount');\n $makeArray = array('ar_name' => 'ar_name', 'en_name' => 'en_name', 'discount' => 'discount');\n\n $SheetDataKey = array();\n $mydata = array();\n foreach ($allDataInSheet as $dataInSheet) {\n foreach ($dataInSheet as $key => $value) {\n if (in_array(trim($value), $createArray)) {\n $value = preg_replace('/\\s+/', '', $value);\n $SheetDataKey[trim($value)] = $key;\n }\n }\n }\n $dataDiff = array_diff_key($makeArray, $SheetDataKey);\n if (empty($dataDiff)) {\n $flag = 1;\n }\n if ($flag == 1) {\n for ($i = 2; $i <= $arrayCount; $i++) {\n $ar_name = $SheetDataKey['ar_name'];\n $en_name = $SheetDataKey['en_name'];\n $discount = $SheetDataKey['discount'];\n\n $ar_name = filter_var(trim($allDataInSheet[$i][$ar_name]), FILTER_SANITIZE_STRING);\n $en_name = filter_var(trim($allDataInSheet[$i][$en_name]), FILTER_SANITIZE_STRING);\n $discount = filter_var(trim($allDataInSheet[$i][$discount]), FILTER_SANITIZE_STRING);\n\n $fetchData = array('ar_name' => $ar_name, 'en_name' => $en_name, 'discount' => $discount);\n $data['dataInfo'] = $fetchData;\n array_push($mydata, $fetchData);\n }\n }\n $data['mydata'] = $mydata;\n $data['title'] = $this->lang->line('admin_category');\n $data['page'] = rest_path('category/display_category_excel');\n $data['get_printer'] = $this->get_printer();\n $data['category_branch_location'] = $this->get_branch_location();\n $this->load->view('index', $data);\n }\n }\n }", "function insert_csv($tabela, $data)\n {\n\n $data['token_id'] = $this->better_token();\n $data['token_company'] = $this->session->userdata('token_company');\n $data['dth_criacao'] = date('Y-m-d H:i:s');\n $data['id_usuario_criacao'] = $this->session->userdata('id_usuario');\n $data['dth_atualizacao'] = date('Y-m-d H:i:s');\n $data['id_usuario_atualizacao'] = $this->session->userdata('id_usuario');\n \n\n /**\n * Insere os dados na tabela \n * Inserts the data into the table\n */ \n $this->db->insert($tabela, $data); \n }", "function insertarExportaciondetalles($refexportacioncontenedores,$bulto,$bruto,$neto,$marca,$refmercaderias,$valorunitario) {\r\n$sql = \"insert into dbexportaciondetalles(idexportaciondetalle,refexportacioncontenedores,bulto,bruto,neto,marca,refmercaderias,valorunitario)\r\nvalues ('',\".$refexportacioncontenedores.\",\".($bulto == '' ? 0 : $bulto).\",\".($bruto == '' ? 0 : $bruto).\",\".($neto == '' ? 0 : $neto).\",'\".($marca).\"',\".$refmercaderias.\",\".($valorunitario == '' ? 0 : $valorunitario).\")\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}", "function company_insert($table, $data) {\n\n global $devel, $tablas, $I;\n\n if (!$data) {\n print_r(get_defined_vars());\n throw new Exception(\"ERROR: No existen parámetros para INSERT en $table\");\n }\n\n $VALUES = values($data);\n $FIELDS = fields($data);\n\n $query = \"INSERT INTO `$table` ($FIELDS) VALUES ($VALUES)\";\n sql($query, $table, 'INSERT');\n $I++;\n}", "function importData($tabName, $filePath) \n{\n\tglobal $mysqli;\n\tif (!file_exists($filePath)) {\n\t\tdie(\"Error: El archivo \".$filePath.\" No existe!\");\n\t}\n\t$data = array();\n\tif (($gestor = fopen($filePath, \"r\")) !== FALSE) {\n\t\twhile ($datos = fgetcsv($gestor, 1000, \";\")) {\n\t\t\t$data[]=$datos;\n\t\t}\n\t \n\t fclose($gestor);\n\t}\t\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\n\t `id` int(8) NOT NULL AUTO_INCREMENT,\n\t `name` varchar(100) NOT NULL,\n\t `author` varchar(30) NOT NULL,\n\t `isbn` varchar(30) NOT NULL,\n\t PRIMARY KEY (`id`)\n\t) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1\";\n\n\t$insert = \"INSERT INTO $tabName (\";\n\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\";\n\tfor ($i=0; $i < count($data[0]) ; $i++) { \n\t\tif ($i==count($data[0])-1) {\n\t\t\t$insert.=strtolower($data[0][$i].\" )\");\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200)\";\n\t\t}else{\n\t\t\t$insert.=strtolower($data[0][$i].\",\");\n\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200),\";\n\t\t}\n\t}\n\t$create.=\") ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;\";\n\n\t$insert.=\" VALUES \";\n\tfor ($j=1; $j < count($data); $j++) { \n\t\tif ($j != 1) {\n\t\t\t# code...\n\t\t\t$insert.=\", ( \";\n\n\t\t}else{\n\n\t\t\t$insert.=\" ( \";\n\t\t}\n\t\tfor ($i=0; $i < count($data[$j]) ; $i++) { \n\t\t\tif ($i==count($data[$j])-1) {\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"' )\");\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200)\";\n\t\t\t}else{\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"',\");\n\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200),\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (!$mysqli->query($create)) {\n\t\tshowErrors();\n\t}\n\n\n\t\n\tif (!($mysqli->query($insert))) {\n\t echo \"\\nQuery execute failed: ERRNO: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t die;\n\t};\n\n\treturn true;\n}", "public function add_file($map,$excel)\n\t{\n\t\t$id = $this->input->post('id');\n\t\t$this->db->select('project_id');\n\t\t$this->db->from('survey');\n\t\t$this->db->where('project_id', $id);\n\t\t$query = $this->db->get()->row();\n\t\t// pengecekan apakah project_id sudah dibuat atau belum. jika belumm maka\n \tif ($query == null) {\n \t\t$data = [\n\t\t\t\t\"project_id\" \t\t=> $this->input->post('id'),\n\t\t\t\t\"create_by\"\t\t\t=> $this->session->userdata('mitra_id'),\n\t\t\t\t\"file_map\"\t\t\t=> $map,\n\t\t\t\t\"file_excel\"\t\t=> $excel,\n\t\t\t\t\"create_on\" => date('Y-m-d'),\n\t\t\t\n\t\t\t\t\n\t\t\t];\n\t\t\t$this->db->insert('survey', $data);\n\t\t}\n\t}", "function saveInGoogleSheets($data) {\n $client = getGoogleClient();\n $sheets = new \\Google_Service_Sheets($client);\n\n // Create a new row value\n $valueRange = new \\Google_Service_Sheets_ValueRange();\n $valueRange->setValues(array(\n 'values' => array(date_format(date_create(), DATE_ISO8601), $data['name'], $data['email'], $data['contactno'])\n ));\n\n // Inset new row into Google Sheets\n $sheets->spreadsheets_values->append(SPREADSHEET_ID, SPREADSHEET_RANGE, $valueRange, array(\n 'valueInputOption' => 'USER_ENTERED'\n ));\n}", "public function insertRow($row);", "function import_data()\n {\n $config = array(\n 'upload_path' => FCPATH . 'uploads/subjectoptions',\n 'allowed_types' => 'xls|csv'\n );\n $this->load->library('upload', $config);\n if ($this->upload->do_upload('file')) {\n $data = $this->upload->data();\n @chmod($data['full_path'], 0777);\n\n $this->load->library('Spreadsheet_Excel_Reader');\n $this->spreadsheet_excel_reader->setOutputEncoding('CP1251');\n\n $this->spreadsheet_excel_reader->read($data['full_path']);\n $sheets = $this->spreadsheet_excel_reader->sheets[0];\n error_reporting(0);\n\n $data_excel = array();\n for ($i = 2; $i <= $sheets['numRows']; $i++) {\n if ($sheets['cells'][$i][1] == '') break;\n\n $data_excel[$i - 1]['student'] = $sheets['cells'][$i][1];\n $data_excel[$i - 1]['student_id'] = $sheets['cells'][$i][2];\n $data_excel[$i - 1]['theclass'] = $sheets['cells'][$i][3];\n $data_excel[$i - 1]['stream'] = $sheets['cells'][$i][4];\n $data_excel[$i - 1]['subject'] = $sheets['cells'][$i][5];\n $data_excel[$i - 1]['theyear'] = $sheets['cells'][$i][6];\n // $data_excel[$i - 1]['subjectcode'] = $sheets['cells'][$i][6];\n // $data_excel[$i - 1]['mark1'] = $sheets['cells'][$i][7];\n // $data_excel[$i - 1]['comment'] = $sheets['cells'][$i][8];\n // $data_excel[$i - 1]['term'] = $sheets['cells'][$i][10];\n }\n\n /* $params = $this->security->xss_clean($params);\n $student_id = $this->Student_model->add_student($params);\n if($student_id){\n $this->session->set_flashdata('msg', 'Student is Registered Successfully!');\n redirect('student/index');*/\n\n $this->db->insert_batch('subject_options', $data_excel);\n $this->session->set_flashdata('msg', 'Student Subject Options Registered Successfully!');\n // @unlink($data['full_path']);\n //redirect('excel_import');\n redirect('subjectoptions/index');\n }\n }", "public function upload() \n\t{\n if ($this->input->post('submit', TRUE) == 'upload')\n {\n $config['upload_path'] = './format/'; //siapkan path untuk upload file\n $config['allowed_types'] = 'xlsx|xls'; //siapkan format file\n $config['file_name'] = 'doc'; //rename file yang diupload\n \n $this->load->library('upload', $config);\n \n if ($this->upload->do_upload('file'))\n {\n //fetch data upload\n $filePath = $this->upload->data();\n \n //$reader = WriterEntityFactory::createXLSXWriter();\n $reader = ReaderFactory::create(Type::XLSX); //set Type file xlsx\n $reader->open('format/'.$filePath['file_name']); //open file xlsx\n \n //looping pembacaan row dalam sheet \n foreach ($reader->getSheetIterator() as $sheet)\n {\n $numRow = 1;\n \n //siapkan variabel array kosong untuk menampung variabel array data\n $data = array();\n \n //looping pembacaan row dalam sheet\n foreach ($sheet->getRowIterator() as $row)\n {\n if ($numRow > 1)\n {\n $data[] = array(\n 'nik' => $row->getCells(0),\n 'nama_dosen' => $row->getCells(1),\n 'username' => $row->getCells(2)\n );\n \n //tambahkan array $data ke $save\n //array_push($save, $data);\n }\n \n $numRow++;\n }\n \n //simpan data ke database\n $this->m_data->importDosen($save);\n \n //tutup spout reader\n $reader->close();\n \n //hapus file yang sudah diupload\n unlink('format/'.$file['file_name']);\n \n redirect('admin/v_import_dosen/?=success');\n }\n }\n else\n {\n echo \"Error :\".$this->upload->display_errors(); //tampilkan pesan error jika file gagal diupload\n }\n }\n \n redirect(base_url('import_dosen'));\n }", "public function set()\r\n\t{\r\n\t\t$config['upload_path'] = 'assets/excel';\r\n\t\t$config['allowed_types'] = 'xlsx';\r\n\t\t$config['max_size'] = '5120';\r\n\t\t\r\n\t\t$this->upload->initialize($config);\r\n\t\t\r\n\t\tif ( ! $this->upload->do_upload('file_excel')) \r\n\t\t{\r\n\t\t\t$output = array('status' => 'ERROR', 'message' => $this->upload->display_errors('<span>','</span>'));\r\n\t\t} else {\r\n\r\n\t\t\t$file_excel = \"./assets/excel/{$this->upload->file_name}\";\r\n\r\n\t\t\t// Identifikasi File Excel Reader\r\n\t\t\ttry {\r\n\r\n\t\t\t\t$excelReader = new PHPExcel_Reader_Excel2007();\r\n\r\n \t$loadExcel = $excelReader->load($file_excel);\t\r\n\r\n \t$sheet = $loadExcel->getActiveSheet()->toArray(null, true, true ,true);\r\n\t\t // Loops Excel data reader\r\n\r\n\t\t foreach ($sheet as $key => $value) \r\n\t\t {\r\n\t\t \t// Mulai Dari Baris ketiga\r\n\t\t \tif($key > 2)\r\n\t\t \t{\r\n\t\t \t\tif($this->cek_point($value['B'], $this->get_course_id($value['G']), $value['E'], $value['F']))\r\n\t\t \t\t\tcontinue;\r\n\r\n\t\t \t\tif($this->get_student_id($value['B']) == FALSE)\r\n\t\t \t\t\tcontinue;\r\n\r\n\t\t \t\tif($this->get_course_id($value['G']) == FALSE)\r\n\t\t \t\t\tcontinue;\r\n\r\n\t\t\t\t\t\tif(is_numeric($value['E']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$semester = (($value['E'] % 2) == 0 ) ? 'genap' : 'ganjil';\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$potong = substr($value['E'], 4, 8);\r\n\t\t\t\t\t\t\t$semester = (($potong % 2) == 0 ) ? 'genap' : 'ganjil';\r\n\t\t\t\t\t\t}\r\n\t\t \t\t$data_nilai = array(\r\n\t\t \t\t\t'student_id' => $this->get_student_id($value['B']), \r\n\t\t \t\t\t'course_id' => $this->get_course_id($value['G']),\r\n\t\t \t\t\t'lecturer_schedule_id' => 0,\r\n\t\t \t\t\t'absent' => $value['J'],\r\n\t\t \t\t\t'task' => $value['K'],\r\n\t\t \t\t\t'midterms' => $value['L'],\r\n\t\t \t\t\t'final' => $value['M'],\r\n\t\t \t\t\t'point' => $value['N'],\r\n\t\t \t\t\t'grade' => (!$value['O']) ? 'E' : $value['O'],\r\n\t\t \t\t\t'quality' => $value['P'],\r\n\t\t \t\t\t'years' => $value['F'],\r\n\t\t \t\t\t'semester' => strtolower($semester)\r\n\t\t \t\t);\r\n\r\n\t\t \t\t$this->db->insert('study_point', $data_nilai);\r\n\r\n\t\t \t// End Baris ketiga\r\n\t\t \t}\r\n\t\t // End Loop\r\n\t\t }\r\n\r\n\t\t unlink(\"./assets/excel/{$this->upload->file_name}\");\r\n\r\n\t\t\t\t$output = array(\r\n\t\t\t\t\t'status' => 'OK', \r\n\t\t\t\t\t'message' => ' Data Nilai berhasil diimport.'\r\n\t\t\t\t);\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\t$output = array(\r\n\t\t\t\t\t'status' => 'ERROR', \r\n\t\t\t\t\t'message' => 'Error loading file \"'.pathinfo($file_excel,PATHINFO_BASENAME).'\": '.$e->getMessage()\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\techo json_encode($output);\r\n\t}", "public function importSanepar(){\n if(Input::hasFile('import_file')){\n $path = Input::file('import_file')->getRealPath();\n //array para valores a ser gravado no banco de dados\n $dataCad = array();\n //cadastro com sucesso\n $dataStore = array();\n //registra linhas sem doador (nao foi encontrado)\n $dataError = array();\n $dataReturn = array();\n \n //ver a competencia\n $dataCom = Excel::selectSheetsByIndex(0)->load($path, function($reader){\n $reader->takeColumns(19); //limita a quantidade de colunas \n // $reader->skipRows(3); //pula a linha\n // $reader->ignoreEmpty(); //ignora os campos null\n // $reader->takeRows(6); //limita a quantidade de linha\n // $reader->noHeading(); //ignora os cabecalhos \n })->get();\n\n //cria dados para salvar na base de retorno sanepar\n if(!empty($dataCom) && $dataCom->count()){\n foreach($dataCom as $data){\n //pesquisa doadores\n $data['matricula'] = intval($data['matricula']);\n\n //verifica se linha nao esta vazia\n if($data['matricula'] != '' && $data['nome'] != ''){\n\n $ddr = $this->doador->findWhere('ddr_matricula',$data['matricula'])->get();\n //pesquisa doacao\n if(count($ddr) > 0){\n\n //verifica se tem doacao\n if(!$ddr[0]->doacao){\n $doa_id = '';\n } else {\n $doa_id = $ddr[0]->doacao->doa_id;\n }\n\n $ddr[0]->doacao;\n $dataCad[] = [\n 'rto_ddr_id' => $ddr[0]->ddr_id,\n 'rto_doa_id' => $doa_id,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr\n ];\n } else {\n $dataError[] = [\n 'error' => 'Matricula/Doador não encontrado!',\n 'rto_ddr_id' => 0,\n 'rto_doa_id' => 0,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr,\n 'msg_erro' => 'Não foi encontrado o doador no sistema, verifique a matricula!'\n ];\n }\n }\n }\n }\n\n if($dataCad || $dataError){\n $dataReturn = [\n 'sucesso' => $dataCad,\n 'error' => $dataError\n ];\n return $dataReturn;\n } else {\n return 'Error';\n }\n }\n // return back();\n }", "public function insert(){\n\t\tif(!mysql_query(\"INSERT INTO $this->tabla (nombre) VALUES ('$this->nombre')\")){\n\t\t\tthrow new Exception('Error insertando renglón');\n\t\t}\n\t}", "public function do_upload()\r\n\t{\r\n \t$config['upload_path'] = './temp_upload/';\r\n \t$config['allowed_types'] = 'xls';\r\n \r\n \t$this->load->library('upload', $config);\r\n\r\n \tif ( ! $this->upload->do_upload())\r\n \t{\r\n $data = array('error' => $this->upload->display_errors());\r\n $this->session->set_flashdata('info', '<div class=\"alert alert-success\"><strong>Insert failed. Please check your file, only .xls file allowed.</strong><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div>');\r\n \t}\r\n \telse\r\n \t{\r\n $data = array('error' => false);\r\n $upload_data = $this->upload->data();\r\n\r\n $this->load->library('excel_reader');\r\n $this->excel_reader->setOutputEncoding('CP1251');\r\n\r\n $file = $upload_data['full_path'];\r\n $this->excel_reader->read($file);\r\n error_reporting(E_ALL ^ E_NOTICE);\r\n\r\n // Sheet 1\r\n $data = $this->excel_reader->sheets[0];\r\n $dataexcel = Array();\r\n for ($i = 1; $i <= $data['numRows']; $i++) {\r\n \tif($data['cells'][$i][1] == '') break;\r\n \t$dataexcel[$i-1]['gsm_number'] = $data['cells'][$i][1];\r\n \t$dataexcel[$i-1]['gsm_imsi_number'] = $data['cells'][$i][2];\r\n \t$dataexcel[$i-1]['gsm_iccid_number'] = $data['cells'][$i][3];\r\n\r\n }\r\n \t//cek data\r\n \t$check= $this->GsmModel->search_excel($dataexcel);\r\n \tif (count($check) >= 0)\r\n \t{\r\n\t \t$this->GsmModel->import_excel($dataexcel);\r\n\t \t// set pesan\r\n\t \t$this->session->set_flashdata('info', '<div class=\"alert alert-success\"><strong>Importing Data Success</strong><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div>');\r\n\t \t\t}else{\r\n\t \t\t$this->session->set_flashdata('info', '<div class=\"alert alert-danger\"><strong>Importing Data Success</strong><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div>');\r\n\t \t\t\t\r\n\t \t\t}\r\n \t\t}\r\n \t\tredirect('gsm/gsm_list');\r\n \t}", "function inserir() {\n\t\t$this->sql = mysql_query(\"INSERT INTO suporte (user_cad, data_cad, id_regiao, exibicao, tipo, prioridade, assunto, mensagem, arquivo, status, status_reg,suporte_pagina)\n\t\t\t\t\t VALUES\t('$this->id_user_cad ','$this->data_cad','$this->id_regiao', '$this->exibicao', '$this->tipo','$this->prioridade', '$this->assunto', '$this->menssagem', '$this->tipo_arquivo','1','1','$this->pagina');\") or die(mysql_error());\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\n\t\t}", "public function insert()\n {\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $columlList = \" (\";\n $valuelList = \" (\";\n foreach ($this->attributes as $column => $value) {\n $columlList .= $column . \", \";\n $valuelList .= \":\".$column . \", \";\n }\n $columlList = str_last_replace(\", \", \")\", $columlList);\n $valuelList = str_last_replace(\", \", \")\", $valuelList);\n $sqlQuery = \"INSERT INTO \" . $this->table . $columlList . \" VALUES\" . $valuelList;\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n #println($sqlQuery, \"blue\");\n }\n }", "function insertDatatoBD($table, $data) {\n\t\tglobal $dbh;\n\t\t\n\t\ttry {\n\t\t\tgetDBConnection();\n\t\t\t\n\t\t\tif($data == null) {\n\t\t\t\tprint(\"Data failed: The insertion data is null <br/>\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif($table == null) {\n\t\t\t\tprint(\"Data failed: Missing table Name <br/>\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$values = $data -> getValues();\n\t\t\t\n\t\t\t$cols = implode(',', $data -> getColumnsName());\n\t\t\t\n\t\t\tforeach ($values as $value) {\n\t\t\t\tisset($vals) ? $vals .= ',' : $vals = '';\n\t\t\t\tprint \"<br/> $vals\";\n\t\t\t\t$vals .= '\\''. mysqli_real_escape_string($dbh, $value).'\\'';\n\t\t\t}\n\t\t\t\n\t\t\t$result = mysqli_real_query($dbh, 'INSERT INTO '.$table.' ('.$cols.') VALUES ('.$vals.')');\n\t\t\tif(!$result) {\n\t\t\t\tprint(\"Query failed: \" . mysqli_errno($dbh) . \"--\" . mysqli_error($dbh) . \"<br/>\");\n\t\t\t\texit();\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t} catch (Exception $e){\n\t\t\tprint \"<br/> $e\";\n\t\t} finally {\n\t\t\tcloseDBConnection();\n\t\t}\n\n\t}", "function addWorksheet($worksheet_details)\n\t {\n\t\t if($this->db->insert('pof_worksheet',$worksheet_details))\n\t\t {\n\t\t return TRUE;\n\t\t }\n\t\t else\n\t\t {\n\t\t return FALSE;\n\t\t }\n\t\t}", "function customer_export_excel(){\r\n\t\t//POST varibale here\r\n\t\t\t\t$cust_id=trim(@$_POST[\"cust_id\"]);\r\n\t\t$cust_no=trim(@$_POST[\"cust_no\"]);\r\n\t\t$cust_no=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_no);\r\n\t\t$cust_no=str_replace(\"'\", '\"',$cust_no);\r\n\t\t$cust_no_awal=trim(@$_POST[\"cust_no_awal\"]);\r\n\t\t$cust_no_awal=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_no_awal);\r\n\t\t$cust_no_awal=str_replace(\"'\", '\"',$cust_no_awal);\r\n\t\t$cust_no_akhir=trim(@$_POST[\"cust_no_akhir\"]);\r\n\t\t$cust_no_akhir=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_no_akhir);\r\n\t\t$cust_no_akhir=str_replace(\"'\", '\"',$cust_no_akhir);\r\n\t\t$cust_nama=trim(@$_POST[\"cust_nama\"]);\r\n\t\t$cust_nama=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_nama);\r\n\t\t$cust_nama=str_replace(\"'\", '\"',$cust_nama);\r\n\t\t$cust_panggilan=trim(@$_POST[\"cust_panggilan\"]);\r\n\t\t$cust_panggilan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_panggilan);\r\n\t\t$cust_panggilan=str_replace(\"'\", '\"',$cust_panggilan);\r\n\t\t$cust_foreigner=trim(@$_POST[\"cust_foreigner\"]);\r\n\t\t$cust_foreigner=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_foreigner);\r\n\t\t$cust_foreigner=str_replace(\"'\", '\"',$cust_foreigner);\r\n\t\t$cust_kelamin=trim(@$_POST[\"cust_kelamin\"]);\r\n\t\t$cust_kelamin=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_kelamin);\r\n\t\t$cust_kelamin=str_replace(\"'\", '\"',$cust_kelamin);\r\n\t\t$cust_alamat=trim(@$_POST[\"cust_alamat\"]);\r\n\t\t$cust_alamat=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_alamat);\r\n\t\t$cust_alamat=str_replace(\"'\", '\"',$cust_alamat);\r\n\t\t$cust_alamat2=trim(@$_POST[\"cust_alamat2\"]);\r\n\t\t$cust_alamat2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_alamat2);\r\n\t\t$cust_alamat2=str_replace(\"'\", '\"',$cust_alamat2);\r\n\t\t$cust_kota=trim(@$_POST[\"cust_kota\"]);\r\n\t\t$cust_kota=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_kota);\r\n\t\t$cust_kota=str_replace(\"'\", '\"',$cust_kota);\r\n\t\t$cust_kodepos=trim(@$_POST[\"cust_kodepos\"]);\r\n\t\t$cust_kodepos=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_kodepos);\r\n\t\t$cust_kodepos=str_replace(\"'\", '\"',$cust_kodepos);\r\n\t\t$cust_propinsi=trim(@$_POST[\"cust_propinsi\"]);\r\n\t\t$cust_propinsi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_propinsi);\r\n\t\t$cust_propinsi=str_replace(\"'\", '\"',$cust_propinsi);\r\n\t\t$cust_negara=trim(@$_POST[\"cust_negara\"]);\r\n\t\t$cust_negara=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_negara);\r\n\t\t$cust_negara=str_replace(\"'\", '\"',$cust_negara);\r\n\t\t$cust_telprumah=trim(@$_POST[\"cust_telprumah\"]);\r\n\t\t$cust_telprumah=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_telprumah);\r\n\t\t$cust_telprumah=str_replace(\"'\", '\"',$cust_telprumah);\r\n\t\t$cust_telprumah2=trim(@$_POST[\"cust_telprumah2\"]);\r\n\t\t$cust_telprumah2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_telprumah2);\r\n\t\t$cust_telprumah2=str_replace(\"'\", '\"',$cust_telprumah2);\r\n\t\t$cust_telpkantor=trim(@$_POST[\"cust_telpkantor\"]);\r\n\t\t$cust_telpkantor=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_telpkantor);\r\n\t\t$cust_telpkantor=str_replace(\"'\", '\"',$cust_telpkantor);\r\n\t\t$cust_hp=trim(@$_POST[\"cust_hp\"]);\r\n\t\t$cust_hp=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_hp);\r\n\t\t$cust_hp=str_replace(\"'\", '\"',$cust_hp);\r\n\t\t$cust_hp2=trim(@$_POST[\"cust_hp2\"]);\r\n\t\t$cust_hp2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_hp2);\r\n\t\t$cust_hp2=str_replace(\"'\", '\"',$cust_hp2);\r\n\t\t$cust_hp3=trim(@$_POST[\"cust_hp3\"]);\r\n\t\t$cust_hp3=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_hp3);\r\n\t\t$cust_hp3=str_replace(\"'\", '\"',$cust_hp3);\r\n\t\t$cust_email=trim(@$_POST[\"cust_email\"]);\r\n\t\t$cust_email=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_email);\r\n\t\t$cust_email=str_replace(\"'\", '\"',$cust_email);\r\n\t\t$cust_agama=trim(@$_POST[\"cust_agama\"]);\r\n\t\t$cust_agama=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_agama);\r\n\t\t$cust_agama=str_replace(\"'\", '\"',$cust_agama);\r\n\t\t$cust_pendidikan=trim(@$_POST[\"cust_pendidikan\"]);\r\n\t\t$cust_pendidikan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_pendidikan);\r\n\t\t$cust_pendidikan=str_replace(\"'\", '\"',$cust_pendidikan);\r\n\t\t$cust_profesi=trim(@$_POST[\"cust_profesi\"]);\r\n\t\t$cust_profesi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_profesi);\r\n\t\t$cust_profesi=str_replace(\"'\", '\"',$cust_profesi);\r\n\t\t$cust_tgllahir=trim(@$_POST[\"cust_tgllahir\"]);\r\n\t\t$cust_tgllahirend =(isset($_POST['cust_tgllahirend']) ? @$_POST['cust_tgllahirend'] : @$_GET['cust_tgllahirend']);\r\n\t\t$cust_tgllahirend=trim(@$_POST[\"cust_tgllahirend\"]);\r\n\t\t$cust_umur=trim(@$_POST[\"cust_umur\"]);\r\n\t\t\r\n\t\t$cust_hobi_baca=trim(@$_POST[\"cust_hobi_baca\"]);\r\n\t\t$cust_hobi_olah=trim(@$_POST[\"cust_hobi_olah\"]);\r\n\t\t$cust_hobi_masak=trim(@$_POST[\"cust_hobi_masak\"]);\r\n\t\t$cust_hobi_travel=trim(@$_POST[\"cust_hobi_travel\"]);\r\n\t\t$cust_hobi_foto=trim(@$_POST[\"cust_hobi_foto\"]);\r\n\t\t$cust_hobi_lukis=trim(@$_POST[\"cust_hobi_lukis\"]);\r\n\t\t$cust_hobi_nari=trim(@$_POST[\"cust_hobi_nari\"]);\r\n\t\t$cust_hobi_lain=trim(@$_POST[\"cust_hobi_lain\"]);\r\n\t\t$cust_referensi=trim(@$_POST[\"cust_referensi\"]);\r\n\t\t$cust_referensi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_referensi);\r\n\t\t$cust_referensi=str_replace(\"'\", '\"',$cust_referensi);\r\n\t\t$cust_referensilain=trim(@$_POST[\"cust_referensilain\"]);\r\n\t\t$cust_referensilain=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_referensilain);\r\n\t\t$cust_referensilain=str_replace(\"'\", '\"',$cust_referensilain);\r\n\t\t$cust_keterangan=trim(@$_POST[\"cust_keterangan\"]);\r\n\t\t$cust_keterangan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_keterangan);\r\n\t\t$cust_keterangan=str_replace(\"'\", '\"',$cust_keterangan);\r\n\t\t$cust_member=trim(@$_POST[\"cust_member\"]);\r\n\t\t$cust_member=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_member);\r\n\t\t$cust_member=str_replace(\"'\", '\"',$cust_member);\r\n\t\t$cust_member2=trim(@$_POST[\"cust_member2\"]);\r\n\t\t$cust_member2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_member2);\r\n\t\t$cust_member2=str_replace(\"'\", '\"',$cust_member2);\r\n\t\t$cust_statusnikah=trim(@$_POST[\"cust_statusnikah\"]);\r\n\t\t$cust_statusnikah=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_statusnikah);\r\n\t\t$cust_statusnikah=str_replace(\"'\", '\"',$cust_statusnikah);\r\n\t\t$cust_priority=trim(@$_POST[\"cust_priority\"]);\r\n\t\t$cust_priority=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_priority);\r\n\t\t$cust_priority=str_replace(\"'\", '\"',$cust_priority);\r\n\t\t$cust_jmlanak=trim(@$_POST[\"cust_jmlanak\"]);\r\n\t\t$cust_unit=trim(@$_POST[\"cust_unit\"]);\r\n\t\t$cust_unit=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_unit);\r\n\t\t$cust_unit=str_replace(\"'\", '\"',$cust_unit);\r\n\t\t$cust_aktif=trim(@$_POST[\"cust_aktif\"]);\r\n\t\t$cust_aktif=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_aktif);\r\n\t\t$cust_aktif=str_replace(\"'\", '\"',$cust_aktif);\r\n\t\t$sortby=trim(@$_POST[\"sortby\"]);\r\n\t\t$sortby=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$sortby);\r\n\t\t$sortby=str_replace(\"'\", '\"',$sortby);\r\n\t\t$cust_fretfulness=trim(@$_POST[\"cust_fretfulness\"]);\r\n\t\t$cust_fretfulness=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_fretfulness);\r\n\t\t$cust_fretfulness=str_replace(\"'\", '\"',$cust_fretfulness);\r\n\t\t$cust_creator=trim(@$_POST[\"cust_creator\"]);\r\n\t\t$cust_creator=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_creator);\r\n\t\t$cust_creator=str_replace(\"'\", '\"',$cust_creator);\r\n\t\t$cust_date_create=trim(@$_POST[\"cust_date_create\"]);\r\n\t\t$cust_update=trim(@$_POST[\"cust_update\"]);\r\n\t\t$cust_update=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_update);\r\n\t\t$cust_update=str_replace(\"'\", '\"',$cust_update);\r\n\t\t$cust_date_update=trim(@$_POST[\"cust_date_update\"]);\r\n\t\t$cust_revised=trim(@$_POST[\"cust_revised\"]);\r\n\t\t$cust_umurstart=trim(@$_POST[\"cust_umurstart\"]);\r\n\t\t$cust_umurstart=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_umurstart);\r\n\t\t$cust_umurstart=str_replace(\"'\", '\"',$cust_umurstart);\r\n\t\t$cust_umurend=trim(@$_POST[\"cust_umurend\"]);\r\n\t\t$cust_umurend=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_umurend);\r\n\t\t$cust_umurend=str_replace(\"'\", '\"',$cust_umurend);\r\n\t\t$cust_transaksi_start=trim(@$_POST[\"cust_transaksi_start\"]);\r\n\t\t$cust_transaksi_end=trim(@$_POST[\"cust_transaksi_end\"]);\r\n\t\t$cust_tidak_transaksi_start=trim(@$_POST[\"cust_tidak_transaksi_start\"]);\r\n\t\t$cust_tidak_transaksi_end=trim(@$_POST[\"cust_tidak_transaksi_end\"]);\r\n\t\t$cust_terdaftar=trim(@$_POST[\"cust_terdaftar\"]);\r\n\t\t$cust_tgldaftarend =(isset($_POST['cust_tgldaftarend']) ? @$_POST['cust_tgldaftarend'] : @$_GET['cust_tgldaftarend']);\r\n\t\t$cust_tgldaftarend=trim(@$_POST[\"cust_tgldaftarend\"]);\r\n\t\t$member_terdaftarstart=trim(@$_POST[\"member_terdaftarstart\"]);\r\n\t\t$member_terdaftarend=trim(@$_POST[\"member_terdaftarend\"]);\r\n\t\t$cust_tglawaltrans=trim(@$_POST[\"cust_tglawaltrans\"]);\r\n\t\t$cust_tglawaltransend=trim(@$_POST[\"cust_tglawaltrans_end\"]);\r\n\t\t$cust_tgl=trim(@$_POST[\"cust_tgl\"]);\r\n\t\t$cust_tgl=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_tgl);\r\n\t\t$cust_tgl=str_replace(\"'\", '\"',$cust_tgl);\r\n\t\t$cust_bulan=trim(@$_POST[\"cust_bulan\"]);\r\n\t\t$cust_bulan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_bulan);\r\n\t\t$cust_bulan=str_replace(\"'\", '\"',$cust_bulan);\r\n\t\t$cust_tglEnd=trim(@$_POST[\"cust_tglEnd\"]);\r\n\t\t$cust_tglEnd=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_tglEnd);\r\n\t\t$cust_tglEnd=str_replace(\"'\", '\"',$cust_tglEnd);\r\n\t\t$cust_bulanEnd=trim(@$_POST[\"cust_bulanEnd\"]);\r\n\t\t$cust_bulanEnd=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_bulanEnd);\r\n\t\t$cust_bulanEnd=str_replace(\"'\", '\"',$cust_bulanEnd);\r\n\t\t$cust_bb=trim(@$_POST[\"cust_bb\"]);\r\n\t\t$cust_bb=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_bb);\r\n\t\t$cust_bb=str_replace(\"'\", '\"',$cust_bb);\r\n\r\n\t\t$option=$_POST['currentlisting'];\r\n\t\t$filter=$_POST[\"query\"];\r\n\t\t\r\n\t\t$query = $this->m_customer->customer_export_excel($cust_id,$cust_no,$cust_no_awal ,$cust_no_akhir,$cust_nama, $cust_panggilan, $cust_foreigner,$cust_kelamin,$cust_alamat,$cust_kota,$cust_kodepos,$cust_propinsi,$cust_negara,$cust_telprumah,$cust_telprumah2,$cust_telpkantor,$cust_hp,$cust_hp2,$cust_hp3,$cust_email,$cust_agama,$cust_pendidikan,$cust_profesi,$cust_tgllahir,$cust_tgllahirend,$cust_referensi,$cust_referensilain,$cust_keterangan,$cust_member, $cust_member2, $cust_terdaftar,$cust_tgldaftarend, $member_terdaftarstart, $member_terdaftarend, $cust_tglawaltrans,$cust_tglawaltransend,$cust_statusnikah,$cust_priority,$cust_jmlanak,$cust_unit,$cust_aktif, $sortby, $cust_fretfulness,$cust_creator,$cust_date_create,$cust_update,$cust_date_update,$cust_revised, $cust_transaksi_start, $cust_transaksi_end, $cust_tidak_transaksi_start, $cust_tidak_transaksi_end, $cust_hobi_baca, $cust_hobi_olah, $cust_hobi_masak, $cust_hobi_travel, $cust_hobi_foto, $cust_hobi_lukis, $cust_hobi_nari, $cust_hobi_lain, $cust_umurstart, $cust_umurend, $cust_umur,$cust_tgl, $cust_bulan, $cust_tglEnd, $cust_bulanEnd,$cust_bb,$option,$filter);\r\n\t\t\r\n\t\tto_excel($query,\"customer\"); \r\n\t\techo '1';\r\n\t\t\t\r\n\t}", "public function insert($timesheet){\n\t\t$sql = 'INSERT INTO timesheet (EMP_ID, TS_RPT_DATE, WELL_ID, WRK_DESC, TIME_INT, TIMESTAMP) VALUES (?, ?, ?, ?, ?, ?)';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t\n\t\t$sqlQuery->setNumber($timesheet->eMPID);\n\t\t$sqlQuery->set($timesheet->tSRPTDATE);\n\t\t$sqlQuery->setNumber($timesheet->wELLID);\n\t\t$sqlQuery->set($timesheet->wRKDESC);\n\t\t$sqlQuery->set($timesheet->tIMEINT);\n\t\t$sqlQuery->set($timesheet->tIMESTAMP);\n\n\t\t$id = $this->executeInsert($sqlQuery);\t\n\t\t$timesheet->sHEETID = $id;\n\t\treturn $id;\n\t}", "public function importProductProcess(Request $request){\n\t\t$validation = Validator::make($request->all(), [ \n //'file' => 'required',\n 'file' => 'required|mimes:xls,xlsx', \n ]);\n\t\t$flag=true;\n\t\tif ($validation->fails()){ \n return redirect()->back()->withErrors($validation)->withInput($request->all()); \n }\n\t\t\n\t\t\tif($request->hasFile('file')){\n\t\t\t\t\\Excel::load($request->file('file')->getRealPath(), function ($reader) {\n\t\t\t\t\tforeach ($reader->toArray() as $key => $row) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor($i = 0;$i<count($row);$i++){\n\t\t\t\t\t\t\t$data['category_id'] = $row[$i]['category_id'];\n\t\t\t\t\t\t\t$data['name'] = $row[$i]['name'];\n\t\t\t\t\t\t\t$data['model'] = $row[$i]['model'];\n\t\t\t\t\t\t\t$data['sku'] = $row[$i]['sku'];\n\t\t\t\t\t\t\t$data['quantity'] = $row[$i]['quantity'];\n\t\t\t\t\t\t\t$data['image'] = $row[$i]['image'];\n\t\t\t\t\t\t\t$data['price'] = $row[$i]['price'];\n\t\t\t\t\t\t\t$data['size'] = $row[$i]['size'];\n\t\t\t\t\t\t\t$data['color'] = $row[$i]['color'];\n\t\t\t\t\t\t\t$data['points'] = $row[$i]['points'];\n\t\t\t\t\t\t\t$data['weight'] = $row[$i]['weight'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!empty($data)){\n\t\t\t\t\t\t\t\t$insertData = DB::table('sb_product')->insert($data);\n\t\t\t\t\t\t\t\tif ($insertData) {\n\t\t\t\t\t\t\t\t\t$flag=true;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else { \n\t\t\t\t\t\t\t\t\t$flag=false;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($flag){\n\t\t\t\t\t\treturn redirect()->back()->withsuccess('Product added successfully.');\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn redirect()->back()->witherror('Oops something went wrong.');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn back();\n\t\t\t\n\t\t}", "public function insertData($table, $data){// method inserData body start\n\t\t$fields \t\t\t= array_keys( $data );\n\t\t//$values \t\t\t= array_map( \"mysql_real_escape_string\", array_values( $data ) );\n\t\t$values \t\t\t= array_values( $data );\n\t\t$query \t\t\t\t= \"INSERT INTO $table(\".implode(\",\",$fields).\") VALUES ('\".implode(\"','\", $values ).\"');\";\n\t\t$execute \t\t\t= $this->query($query);\n\t\t\n\t}", "function absenrich_export_excel(){\r\n\t\t//POST varibale here\r\n\t\t$gudang_id=trim(@$_POST[\"gudang_id\"]);\r\n\t\t$gudang_nama=trim(@$_POST[\"gudang_nama\"]);\r\n\t\t$gudang_nama=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_nama);\r\n\t\t$gudang_nama=str_replace(\"'\", '\"',$gudang_nama);\r\n\t\t$gudang_lokasi=trim(@$_POST[\"gudang_lokasi\"]);\r\n\t\t$gudang_lokasi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_lokasi);\r\n\t\t$gudang_lokasi=str_replace(\"'\", '\"',$gudang_lokasi);\r\n\t\t$gudang_keterangan=trim(@$_POST[\"gudang_keterangan\"]);\r\n\t\t$gudang_keterangan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_keterangan);\r\n\t\t$gudang_keterangan=str_replace(\"'\", '\"',$gudang_keterangan);\r\n\t\t$gudang_aktif=trim(@$_POST[\"gudang_aktif\"]);\r\n\t\t$gudang_aktif=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_aktif);\r\n\t\t$gudang_aktif=str_replace(\"'\", '\"',$gudang_aktif);\r\n\t\t$gudang_creator=trim(@$_POST[\"gudang_creator\"]);\r\n\t\t$gudang_creator=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_creator);\r\n\t\t$gudang_creator=str_replace(\"'\", '\"',$gudang_creator);\r\n\t\t$gudang_date_create=trim(@$_POST[\"gudang_date_create\"]);\r\n\t\t$absenrich_updater=trim(@$_POST[\"absenrich_updater\"]);\r\n\t\t$absenrich_updater=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$absenrich_updater);\r\n\t\t$absenrich_updater=str_replace(\"'\", '\"',$absenrich_updater);\r\n\t\t$gudang_date_update=trim(@$_POST[\"gudang_date_update\"]);\r\n\t\t$gudang_revised=trim(@$_POST[\"gudang_revised\"]);\r\n\t\t$option=$_POST['currentlisting'];\r\n\t\t$filter=$_POST[\"query\"];\r\n\t\t\r\n\t\t$query = $this->m_absensi_enrichment->absenrich_export_excel($gudang_id ,$gudang_nama ,$gudang_lokasi ,$gudang_keterangan ,$gudang_aktif ,$gudang_creator ,$gudang_date_create ,$absenrich_updater ,$gudang_date_update ,$gudang_revised ,$option,$filter);\r\n\t\t\r\n\t\tto_excel($query,\"absensi_enrichment\"); \r\n\t\techo '1';\r\n\t\t\t\r\n\t}", "function studentLoader($conn,$filename){\n mysqli_set_charset($conn, \"utf8\");\n $sheet = basicExcelLoader($filename);\n $highestRow = $sheet->getHighestRow();\n\n $stmt_not_graduate = $conn->prepare(\"insert into student (student_id,student_name,total_credit,gpa,enroll_time,graduate_time) values (?,?,?,?,?,null)\");\n $stmt_graduated = $conn->prepare(\"insert into student (student_id,student_name,total_credit,gpa,enroll_time,graduate_time) values (?,?,?,?,?,?)\");\n\n $stmt_check = $conn->prepare(\"select * from student where student_id=?\");\n $stmt_update_not_graduate = $conn->prepare(\"update student set student_name=?,total_credit=?,gpa=?,enroll_time=?,graduate_time=null where student_id=?\");\n $stmt_update_graduated = $conn->prepare(\"update student set student_name=?,total_credit=?,gpa=?,enroll_time=?,graduate_time=? where student_id=?\");\n\n $sta = true;\n for($i = 2; $i <= $highestRow; $i++){\n $stu_id = $sheet->getCell(\"A\".$i)->getValue();\n $stu_name = $sheet->getCell(\"B\".$i)->getValue();\n $stu_credit = $sheet->getCell(\"C\".$i)->getValue();\n $stu_gpa = $sheet->getCell(\"D\".$i)->getValue();\n $stu_etime = $sheet->getCell(\"E\".$i)->getValue();\n $stu_gtime = $sheet->getCell(\"F\".$i)->getValue();\n if(empty($stu_credit)){\n $stu_credit = 0;\n }\n if(empty($stu_gpa)){\n $stu_gpa = 0;\n }\n $stu_etime = excelTime($stu_etime);\n if(!empty($stu_gtime)){\n $stu_gtime = excelTime($stu_gtime);\n }else{\n $stu_gtime = null;\n }\n //phpExcel有时会读入空行\n if(empty($stu_id))\n continue;\n\n //检查此学生数据是否已经存在及是否要更新\n $stmt_check->bind_param(\"s\",$stu_id);\n $stmt_check->execute();\n $check_result = $stmt_check->get_result();\n\n if($check_result->num_rows != 0){\n $row = $check_result->fetch_assoc();\n if($row['student_id'] == $stu_id && $row['student_name'] == $stu_name && $row['total_credit'] == $stu_credit && $row['gpa'] == $stu_gpa\n && $row['enroll_time'] == $stu_etime && $row['graduate_time'] == excelTime($stu_gtime)){\n //数据库内数据一样,不变\n $result = true;\n }else{\n //更新学生信息\n if(empty($stu_gtime)){\n $stmt_update_not_graduate->bind_param(\"sidss\",$stu_name,$stu_credit,$stu_gpa,$stu_etime,$stu_id);\n $result = $stmt_update_not_graduate->execute();\n }else{\n $stmt_update_graduated->bind_param(\"sidsss\",$stu_name,$stu_credit,$stu_gpa,$stu_etime,$stu_gtime,$stu_id);\n $result = $stmt_update_graduated->execute();\n }\n }\n }else{\n if(empty($stu_gtime)){\n //还没毕业\n $stmt_not_graduate->bind_param(\"ssids\",$stu_id,$stu_name,$stu_credit,$stu_gpa,$stu_etime);\n $result = $stmt_not_graduate->execute();\n }else{\n //已经毕业\n $stmt_graduated->bind_param(\"ssidss\",$stu_id,$stu_name,$stu_credit,$stu_gpa,$stu_etime,$stu_gtime);\n $result = $stmt_graduated->execute();\n }\n }\n\n if(!$result){\n $sta = false;\n echo \"<script>alert('请查看id:\".$stu_id.\",name:\".$stu_name.\" 的数据,出现错误')</script>\";\n }else{\n $stmt_not_graduate->free_result();\n $stmt_graduated->free_result();\n $stmt_check->free_result();\n $stmt_update_not_graduate->free_result();\n $stmt_update_graduated->free_result();\n }\n }\n\n if($sta){\n echo \"<script>alert('导入成功')</script>\";\n }\n\n}", "public function uploadExcel(Request $request){\n $this->validate($request, array(\n 'file' => 'required'\n ));\n \n if($request->hasFile('file')){\n $extension = File::extension($request->file->getClientOriginalName());\n if ($extension == \"xlsx\" || $extension == \"xls\" || $extension == \"csv\") {\n \n $path = $request->file->getRealPath();\n // $data = Excel::load($path, function($reader) {\n // })->get();\n $data = Excel::toCollection(new UsersImport, $request->file);\n foreach($data as $key => $value){\n foreach($value as $value2){\n if($value2['tanggal'] < 10){\n $tanggal = '0'.$value2['tanggal'];\n }else{\n $tanggal = $value2['tanggal'];\n }\n if($value2['bulan'] < 10){\n $bulan = '0'.$value2['bulan'];\n }else{\n $bulan = $value2['bulan'];\n }\n $password = trim($tanggal.'/'.$bulan.'/'.$value2['tahun']);\n \n $user = new User();\n $user->name = $value2['name'];\n $user->username = $value2['username'];\n $user->password = Hash::make($password);\n $user->save();\n \n $detailUser = new UsersDetail();\n $detailUser->tanggal_lahir = $value2['tahun'].'-'.$bulan.'-'.$tanggal;\n $detailUser->tempat_lahir = $value2['tempat_lahir'];\n $detailUser->alamat = $value2['alamat'];\n $detailUser->kelas = $value2['kelas'];\n $detailUser->angkatan = $value2['angkatan'];\n $detailUser->user_id = $user->id;\n $detailUser->save();\n \n if ($value2['roles']) {\n $user->syncRoles(explode(',', $value2['roles']));\n }\n }\n \n }\n return response()->json(['status'=>'success','msg'=> $user]);\n }else {\n return response()->json(['status'=>'error','msg'=>'Data siswa gagal ditambahkan']);\n }\n }\n }", "public function run()\n {\n DB::table('employees')->insert([\n 'emp_title' => 'employee',\n 'emp_name' => 'Jawad',\n 'emp_fname' => 'MJawad',\n 'emp_address' => 'mingora Swat',\n 'emp_contact' => '03420909974',\n 'emp_dob' => null,\n 'emp_email' => '[email protected]',\n 'emp_permanent_address' => 'mingora Swat',\n 'is_married' => 'single',\n 'emp_nationality' => 'pakistani',\n 'emp_gender' => 'male',\n 'is_employee' => 'employee',\n 'emp_religion' => 'islam',\n 'reason_of_resign' => null,\n 'emp_status' => 1,\n 'emp_experience' => '2 Yeaes',\n 'emp_profile_image' => 'no image',\n 'emp_file_attachment' => 'no files',\n 'resig_file' => null,\n ]);\n }", "protected function saveInsert()\n {\n }", "public function insert(array $data){\n //dynamically query generate as per your form data\n $query_key = \"INSERT INTO \".$this->table[0].\" (\";\n $query_value =null; \n $comma = \" \"; \n // loop the form data and assighn the key value in query\n foreach ($data as $key => $value) {\n \n $query_key .= $comma . $key ;\n $query_value .=$comma.\"'\".$value.\"'\";\n $comma = \", \";\n }\n //final sql query\n $sql= $query_key.=\" ) VALUES (\".$query_value.\")\";\n //echo $sql;\n return mysqli_query($this->conn,$sql);\n\n }", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "function insertar($bd);", "public function run()\n {\n $file_path = public_path('data/districts/districts.csv');\n $excel = new \\App\\Helper\\ExcelReader($file_path);\n $districtData = [];\n if($excel->fileExists()) {\n $districts = $excel->getData();\n foreach ($districts as $district) {\n $divisionData[] = [\n 'division_id' => $district['division_id'],\n 'districtName' => $district['name'],\n 'banglaName' => $district['bangla_name'],\n // 'districtLatitude' => $district['lat'],\n // 'districtLongitude' => $district['lon'],\n // 'website' => $district['url'],\n ];\n }\n }\n $districtInsert = District::insert($divisionData);\n }", "abstract protected function excel ();", "public function inserir()\n {\n }", "protected function insert()\n\t{\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tinsert into\n\t\t\t\tBooth (BoothNum)\n\t\t\t\tvalues (?)\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "public function insertDatabase();", "function loadAndInsert($filename,$dbObject,$extraData,$tag)\n{\n $db = $dbObject->getConnection();\n $row = 1;\n if (($handle = fopen($filename, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, 7000, \",\")) !== FALSE) {\n if ($row == 1) {\n $row++;\n } else {\n $input = [];\n $num = count($data);\n for ($c=0; $c < $num; $c++) {\n $temp = [];\n $temp['general'] = $data[$c];\n $input[] = $temp;\n }\n //add extra data\n foreach ($extraData as $temp) {\n $input[] = $temp;\n }\n // insert in DB\n doInsert($dbObject, $tag, $input,$db);\n }\n }\n }\n $db = null;\n fclose($handle);\n}", "public function insertMutile()\n\t{\n\t\t$this -> error();\n\t\tif(!is_array($this -> arrNewData) or count($this -> arrNewData) == 0)\n\t\tthrow new SystemException('Không tồn tại mảng dữ liệu để insert');\n\t\t$dbName = $this -> databaseName;\n\t\t$lasId = $dbName() -> insertMulti($this -> tableName, $this -> arrNewData);\n\t\treturn $lasId;\n\t}", "function s_m_put_txt_data_insert($rows, $columnames, $store_data){\r\n // only the data in $store_data\r\n // (not index by column name but column number!)\r\n $row_nr = count($rows);\r\n for($i = 0; $i < count($columnames); $i++){\r\n $this_value = \"\";\r\n if(isset($store_data[$i])){\r\n $this_value = $store_data[$i];\r\n }\r\n $rows[$row_nr][$columnames[$i]] = $this_value;\r\n }\r\n return $rows;\r\n}", "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_aroundus_POI_details($data)\n {\n $result = $this->db->insert('r_app_aroundus_gen_info',$data);\n return $this->db->insert_id();\n }", "public function insert($conn, $data){\n\t\t$sql_fields=\"\";\n\t\t$sql_vals=\"\";\n\t\t$id_included=false;\n\t\t\n\t\tforeach($data as $field => $val){\n\t\t\tif (!array_key_exists($field, $this->fields)){\n\t\t\t\tthrow new Exception(\"Field \" . $field . \" does not exists\");\n\t\t\t}\n\t\t\t\n\t\t\t$field_info=$this->fields[$field];\n\t\t\tif (!$id_included && $field_info[\"id\"]){\n\t\t\t\t$id_included=true;\n\t\t\t}\n\t\t\t\n\t\t\tif ($sql_fields!=\"\"){\n\t\t\t\t$sql_fields = $sql_fields . \", \";\n\t\t\t}\n\t\t\t$sql_fields = $sql_fields . \"`\" . $field . \"`\";\n\t\t\t\n\t\t\tif ($sql_vals!=\"\"){\n\t\t\t\t$sql_vals = $sql_vals . \", \";\n\t\t\t}\n\t\t\t\n\t\t\t$sql_vals = $sql_vals . $this->quote($conn, $val, $field_info[\"type\"]);\n\t\t}\n\t\t\n\t\t$sql=\"INSERT INTO `\" . $this->table_name . \"` (\" . $sql_fields . \") VALUES (\" . $sql_vals . \")\";\n\t\t\n\t\t$res=$conn->exec($sql);\n\t\tif ($res===FALSE){ \n\t\t\treturn $res;\n\t\t}\n\t\tif (!$id_included && $this->id!=\"\"){\n\t\t\tif ($this->fields[$this->id][\"auto\"]){\n\t\t\t\treturn $conn->lastInsertId();\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}", "public function import_file(){\n\t\t$this->load->model(\"payment/M_pa_payment\",\"payment\");\n\t\t\n\t\t$this->data[\"rs_year_exam\"] = $this->payment->get_year_exam();\n\t\t\n\t\t$this->output(\"Payment/v_import_excel\",$this->data);\n\t}", "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}", "public function run()\n {\n $param = [\n 'title' => 'はじめてのPHP',\n 'picture' => 'php1.jpg',\n ];\n DB::table('bookdata')->insert($param);\n\n $param = [\n 'title' => 'それなりのPHP',\n 'picture' => 'php2.jpg',\n ];\n DB::table('bookdata')->insert($param);\n\n $param = [\n 'title' => 'けっこう進んだのPHP',\n 'picture' => 'php3.jpg',\n ];\n DB::table('bookdata')->insert($param);\n\n $param = [\n 'title' => 'かなり進んだのPHP',\n 'picture' => 'php1.jpg',\n ];\n DB::table('bookdata')->insert($param);\n\n\n }", "public function insert($perifericos);", "public function processAction()\n {\n require_once 'PHPExcel/IOFactory.php';\n\n try {\n\n $upload = new Zend_File_Transfer_Adapter_Http();\n\n if (!$upload->receive()) {\n $this->_helper->getHelper('flashMessenger')->addMessage($this->showMessage('Error uploading file'));\n return false;\n }\n\n $objPHPExcel = PHPExcel_IOFactory::load($upload->getFileName());\n /** get all the worksheets from the excel file */\n foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {\n $highestRow = $worksheet->getHighestRow();\n $highestColumn = $worksheet->getHighestColumn();\n $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);\n /* leave out the heading i.e first row */\n for ($row = 1; $row <= $highestRow; ++$row) {\n $rowvalue = array();\n for ($col = 1; $col <= $highestColumnIndex; ++$col) {\n $cell = $worksheet->getCellByColumnAndRow($col, $row);\n $val = $cell->getValue();\n $rowvalue[] = $val;\n }\n if (count(array_filter($rowvalue)) != 0) {\n $this->processRow($rowvalue);\n }\n }\n }\n\n $this->_helper->getHelper('flashMessenger')->addMessage($this->showMessage('Import Finished.'));\n } catch (Zend_Db_Exception $e) {\n $this->_helper->getHelper('flashMessenger')->addMessage($this->showMessage('Problem inserting data in database' . '<br />' . $e->getMessage(), 'danger'));\n } catch (Exception $e) {\n $this->_helper->getHelper('flashMessenger')->addMessage($this->showMessage('Failed.' . $e->getMessage(), 'danger'));\n }\n //$this->_redirect('instalacja/cleanup');\n $this->_redirect('osoby');\n }" ]
[ "0.6961934", "0.6711542", "0.6689713", "0.6650267", "0.65594286", "0.65391743", "0.6417791", "0.6365089", "0.63600427", "0.6295671", "0.6284269", "0.62297964", "0.6218513", "0.6185614", "0.6175645", "0.6158023", "0.6072238", "0.6066109", "0.6037373", "0.60279614", "0.60137767", "0.6011119", "0.59895915", "0.5952017", "0.5910741", "0.5907955", "0.58924025", "0.5882196", "0.5863622", "0.5857784", "0.5844835", "0.58442265", "0.58416444", "0.583948", "0.5824534", "0.5815576", "0.5808201", "0.5805658", "0.57989466", "0.57972145", "0.5793472", "0.5789026", "0.5784784", "0.5770116", "0.57615405", "0.57517564", "0.57418525", "0.5740869", "0.57405245", "0.5738822", "0.5734245", "0.57262343", "0.572608", "0.5714572", "0.5704905", "0.5701535", "0.56998366", "0.5691375", "0.56862175", "0.5674933", "0.5671786", "0.56714207", "0.56678534", "0.5654771", "0.56481326", "0.5634575", "0.5633116", "0.56321603", "0.5629115", "0.56282324", "0.56093985", "0.55979806", "0.55903697", "0.55880404", "0.55841255", "0.5583255", "0.55701125", "0.55645865", "0.55630034", "0.555734", "0.5553144", "0.5549956", "0.55494446", "0.5548195", "0.55424005", "0.5541859", "0.55402875", "0.5536617", "0.5535838", "0.55177677", "0.5517368", "0.5510573", "0.55102813", "0.55096686", "0.5503469", "0.55022657", "0.5501115", "0.55009145", "0.55008113", "0.54990196", "0.54987055" ]
0.0
-1
sends a response to the user
function sendResponse($status, $text = '') { $response = array(); $response['status'] = $status; $response['text'] = $text; echo json_encode($response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sendResponse();", "protected function sendResponse() {}", "function send($response)\n {\n }", "public function reply()\n\t{\n\t\tif($this->return){\n\t\t\t$this->_reply(200, 'Ok', $this->return);\n\t\t}else{\n\t\t\t$this->_reply(200, 'Ok', $this->return);\n\t\t}\n\t\texit();\n\t}", "public function send_response() {\n\t\n\t\t$return = $this->get_response();\n\t\t\n\t\t/* send it and terminate this instance */\n\t\tif($this->get_errors()) {\n\t\t\twp_send_json_error($return);\t\t\t\t\t\t\n\t\t} else {\n \t\tif( null === $this->wp_query ) {\n \t\t\twp_send_json_success($return); \t\t \t\t\n \t\t} else {\n \t\t\n \t\t\t$data = array(\n \t\t\t'success' => true,\n \t\t\t'data' => $return,\n \t\t\t'query' => $this->parse_wp_query_object_2_js( $this->wp_query )\n \t\t\t);\n \t\t\twp_send_json($data); // build a custom wp_send_json_success with an extra property \n \t\t}\t\t\t\n\t\t}\n\t}", "function SendResponse($response) {\n echo json_encode($response);\n }", "private function __send_response(){\n http_response_code($this->response_code);\n if($this->_redirect) header(\"Location: \".Config::WEB_DIRECTORY.\"{$this->_redirect_location}\");\n elseif($this->_JSON){\n header('Content-Type: application/json; charset=UTF-8');\n print json_encode($this->_JSON_contents, JSON_PRETTY_PRINT);\n }elseif($this->_HTML){\n if($this->_HTML_load_view) $this->_template->render();\n } /** @noinspection PhpStatementHasEmptyBodyInspection */ else{\n // Do nothing\n }\n }", "public function send_response($response) {\n global $OUTPUT;\n\n if ($response instanceof response_interface) {\n $response->send();\n } else if (!empty($response)) {\n echo $OUTPUT->header();\n echo $response;\n echo $OUTPUT->footer();\n }\n }", "public function send()\n {\n http_response_code( $this->getResultCode() );\n echo $this->getBody();\n }", "public function sendResponse() {\n\n header('Content-Type: ' . SabreAMF_Const::MIMETYPE);\n $this->amfResponse->setEncoding($this->amfRequest->getEncoding());\n $this->amfResponse->serialize($this->amfOutputStream);\n echo($this->amfOutputStream->getRawData());\n\n }", "abstract public function response();", "public function respond()\n {\n }", "public function send()\r\n\t{\r\n\t\t$this->outputBody();\r\n\t\texit;\r\n\t}", "function send_response($message)\n{\n\techo json_encode($message);\n}", "public function respond()\n\t{\n\t\t$this->setTemplate();\n\t\t$this->template->setGuid( $this->request['guid'] );\n\t\t$this->template->setContent( $this->view->getContent() );\n\t\n\t\techo $this->template->request();\t\n\t}", "public function response ();", "public function response()\n {\n }", "public function sendResponse($message)\n {\n echo json_encode(array(\n 'message' => $message,\n ));\n }", "public function send(){\n\n\n\n $id = $_GET['id'];\n $msg = $_GET['msg'];\n $response = $this->sendMessage($id,$msg);\n $return[\"allresponses\"] = $response;\n $return = json_encode($return);\n $data = json_decode($response, true);\n\n echo $response;\n\n }", "public function respond();", "public function respond();", "public function response();", "public function sendResponse()\n {\n $this->sendHeaders();\n\n if ($this->isException() && $this->renderExceptions()) {\n $exceptions = '';\n foreach ($this->getException() as $e) {\n $exceptions .= $e->__toString() . \"\\n\";\n }\n echo $exceptions;\n return;\n }\n\n $this->outputBody();\n }", "private function sendResponse(){\n\t\tif(!isset($this->rpcRequest->id)){ return; } // never respond to Notifications\n\n\t\t$response = new stdClass();\n\t\t$response->jsonrpc = \"2.0\";\n\t\t$response->id = $this->rpcRequest->id;\n\n\t\tif($this->responseError){\n\t\t\t$response->error = $this->responseError; // error response\n\t\t}else{\n\t\t\t$response->result = $this->responseResult; // normal response\n\t\t}\n\n\t\tif($this->rpcDebugLevel != self::LOG_NONE){\n\t\t\t$response->log = array();\n\t\t\tforeach($this->log as $msg){\n\t\t\t\tif($msg[\"level\"] <= $this->rpcDebugLevel){\n\t\t\t\t\t$response->log[] = $msg[\"message\"];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo $this->toJson($response);\n\t}", "public static function sendOkResponse(){\n http_response_code(200);\n die();\n }", "public function send()\n {\n if (!is_null($this->lastResponse)) {\n $this->lastResponse->send();\n }\n }", "protected function sendResponse() {\n $this->eventManager->triggerEvent(self::EVENT_PRE_RESPONSE, array('web' => $this));\n\n $this->setSessionCookie();\n\n $this->renderView();\n\n // send the response\n if ($this->log) {\n $this->log->logDebug('Sending response', 'Status code ' . $this->response->getStatusCode(), System::LOG_SOURCE);\n\n $headers = $this->response->getHeaders();\n foreach ($headers as $header) {\n $this->log->logDebug('Sending header', $header, System::LOG_SOURCE);\n }\n\n $cookies = $this->response->getCookies();\n foreach ($cookies as $cookie) {\n $this->log->logDebug('Sending header', Header::HEADER_SET_COOKIE . ': ' . $cookie, System::LOG_SOURCE);\n }\n\n $view = $this->response->getView();\n if ($view) {\n $this->log->logDebug('Rendering and sending view', get_class($view), System::LOG_SOURCE);\n }\n }\n\n $this->response->send($this->request);\n\n $this->eventManager->triggerEvent(self::EVENT_POST_RESPONSE, array('web' => $this));\n\n $this->writeSession();\n }", "public function send() {\r\n\t\t\t$this->sent = true;\r\n\t\t}", "function sendResponse($response) {\n // maintaining a queue/ including any checks\n // Include support for JSONP requests\n if (!isset($_GET['callback'])) {\n echo json_encode($response);\n } else {\n echo $_GET['callback'] . '(' . json_encode($response) . ');';\n }\n}", "function sendResponse($response) {\n // maintaining a queue/ including any checks\n // Include support for JSONP requests\n if (!isset($_GET['callback'])) {\n echo json_encode($response);\n } else {\n echo $_GET['callback'] . '(' . json_encode($response) . ');';\n }\n}", "public function send()\n {\n http_response_code($this->statusCode);\n $this->sendContent();\n }", "private function responseHandle() {\n // call hook function\n is_callable(config('hooks.onResponse')) && call_user_func(config('hooks.onResponse'), $this);\n // response data\n $this->responder->output();\n }", "protected function response()\r\n {\r\n return true;\r\n }", "public function sendResponse()\n {\n $this->_response = Mage::app()->getResponse();\n\n //check redirect\n if ($this->_response->isRedirect()) {\n $headers = $this->_response->getHeaders();\n $redirect = '';\n foreach ($headers as $header) {\n if (\"Location\" == $header[\"name\"]) {\n $redirect = $header[\"value\"];\n break;\n }\n }\n if ($redirect) {\n $this->setRedirect($redirect);\n }\n }\n\n $this->_response->clearHeaders();\n $this->_response->setHeader('Content-Type', 'application/json');\n $this->_response->clearBody();\n $this->_response->setBody($this->toJson());\n $this->_response->sendResponse();\n exit;\n }", "public function response(){\n\t\t\t\n\t\t\t\tif( !empty($this->errores)){\n\t\t\t\t\techo '<u>Lista de errores:</u> <br />';\n\t\t\t\t\techo $this->errores;\n\t\t\t\t}else{\n\t\t\t\t\t//mail($destinatario1, $asunto, $msj);\n\t\t\t\t\t//mail($destinatario2, $asunto, $msj);\n\t\t\t\t\techo \"Mensaje enviado con exito\";\n\t\t\t\t\techo \"<script type='text/javascript'> parent.document.formu.reset(); </script>\"; \n\t\t\t\t}\n\t\t\t}", "public function sendResponse($response) {\n if (empty($this->_request['id'])) {\n return false;\n }\n\n echo json_encode(array(\n 'jsonrpc' => $this->version,\n 'id' => $this->_request['id'],\n 'result' => $response,\n ));\n return true;\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 }", "private function respond($response)\n\t{\n\t\tob_start();\n\t\tif ($response['template']) {\n\t\t\techo $this->view($response['template'], $response['content']);\n\t\t} else {\n\t\t\techo $response;\n\t\t}\n\t\tob_end_flush();\n\t}", "public function story_response()\n {\n $user_id = $this->_require_login();\n $this->_require_register();\n\n $post_data = $this->input->post(NULL, TRUE);\n $story_id = $post_data['story_id'];\n $story = $this->story_model->get($story_id);\n\n if($this->_is_user_bottle($story_id) == 0 && $story[0]['story_user_id'] != $user_id){\n redirect('/pick');\n }else{\n\n $reply_to_id = $story[0]['story_user_id'];\n\n $reply_data = array(\n 'reply_sender_id' => $user_id,\n 'reply_story_id' => $story_id,\n 'reply_to_id' => $post_data['reply_to_id'],\n 'reply_text' => $post_data['response_content'],\n 'reply_time' => date(\"Y-m-d H:i:s\")\n );\n\n $reply_id = $this->reply_model->insert($reply_data);\n redirect('/bottles/'.$story_id);\n }\n }", "public function renderResponse(): void\n {\n $methodName = $this->methodName;\n $this->$methodName()->send();\n\t}", "public function sendResult()\n\t{\n\t\theader('Content-Type: application/json');\n\t\tif ($this->responseDataType == 'json') {\n\t\t\techo json_encode($this->emojiArray);\n\t\t} else {\n\t\t\techo \"{$this->responseCallback}(\" . json_encode($this->emojiArray) . ')';\n\t\t}\n\t\texit;\n\t}", "public function respond() {\n\t\thttp_response_code($this->code);\n\n\t\t// Additional headers\n\t\tforeach ($this->head as $header) {\n\t\t\theader($header);\n\t\t}\n\n\t\t// Write the body\n\t\tforeach ($this->body as $toStringable) {\n\t\t\techo $toStringable;\n\t\t}\n\t}", "public function respond( /* variable length arguments */ ){\n\n $response = '';\n\n foreach ( func_get_args() as $argument )\n\n if ( ! is_subclass_of($argument,'\\\\Code_Alchemy\\\\Vendors\\\\Twilio\\\\Twilio_Response_Object')){\n\n \\FB::error(get_called_class().\": \".__FUNCTION__.\": Each argument must be a Twilio Response Object\");\n\n break;\n } else\n\n $response .= (string) $argument;\n\n header(\"content-type: text/xml\");\n\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\n\n echo (string) \"<Response>$response</Response>\";\n\n\n }", "public function responseAction()\n\t{\n\t\t$validated = true;\n\t\t$orderId = $_POST['orderNo'];// Generally sent by gateway\n\t\t\n\t\tif($validated) {\n\t\t\t// Payment was successful, so update the order's state, send order email and move to the success page\n\t\t\t$order = Mage::getModel('sales/order');\n\t\t\t$order->loadByIncrementId($orderId);\n\t\t\t$order->addStatusToHistory($order->getStatus(), Mage::helper('payza')->__('Customer successfully returned from Gateway'));\n\t\t\t$order->sendNewOrderEmail();\n\t\t\t$order->setEmailSent(true);\n\t\t\t$order->save();\n\t\t\tMage::getSingleton('checkout/session')->unsQuoteId();\n\t\t\t$this->_redirect('checkout/onepage/success', array('_secure'=>true));\n\t\t}\n\t\telse {\n\t\t\t// There is a problem in the response we got\n\t\t\t$this->_redirect('checkout/onepage/failure');\n\t\t}\n\t}", "public function postAction() {\n\t\t$this->sendMessage();\n\t}", "function respond() {\n\n $request = & $this->request;\n $response = false;\n\n // first check for page refresh or first load\n if ($this->request->source == REQ_INDEX) {\n $state = $request->to_state(true);\n $response = $this->_do_index($state);\n\n } else {\n\n // next try for action event\n if ( ! $response) {\n $response = $this->_do_action($request);\n }\n\n // then fall back to state event\n if ( ! $response) {\n $state = $request->to_state();\n $response = $this->_do_state($state);\n }\n }\n\n // send response content to browser\n if ($response !== false) {\n if ($request->source == REQ_AJAX) {\n header('Content-type: application/json', true, 200);\n // no caching for ajax responses\n header(\"Cache-Control: no-cache, must-revalidate\");\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n $response = json_encode($response);\n } else {\n header('Content-type: text/html; charset=utf-8');\n }\n echo $response;\n return true;\n } else {\n return false;\n }\n }", "public function send()\n\t{\n\t\tif(($this->xResponse))\n\t\t{\n\t\t\tforeach($this->aDebugMessages as $sMessage)\n\t\t\t{\n\t\t\t\t$this->xResponse->debug($sMessage);\n\t\t\t}\n\t\t\t$this->aDebugMessages = array();\n\t\t\t$this->xResponse->sendHeaders();\n\t\t\t$this->xResponse->printOutput();\n\t\t}\n\t}", "protected function send_response($msg, $data = '') {\r\n $response['message'] = $msg;\r\n \r\n if ($data) {\r\n $response['data'] = $data;\r\n }\r\n header('content-type: application/json; charset=utf-8');\r\n echo json_encode($response).\"\\n\";\r\n exit;\r\n }", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n global $textTpl;\n if (!empty($postStr))\n {\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $type = $postObj->MsgType;\n\n switch ($type)\n {\n case \"event\":\n $resultStr = GetEventMessage($postObj);\n break;\n case \"location\":\n $resultStr = GetLocationMessage($postObj);\n break;\n case \"text\":\n $resultStr = GetTextMessage($postObj);\n break;\n default:\n $resultStr = GetTextMessage($postObj);\n //$resultStr = GetDefaultMessage($postObj);\n break;\n }\n\n RecordInputContent($postObj); //保存用户输入的所有内容\n RefleshUserLoginTime($postObj); // 更新用户登录的最新时间\n\n echo $resultStr;\n }\n else\n {\n echo \"\";\n exit;\n }\n }", "public function respond(Response $response) {\n $this->cleanBuffer();\n\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n if ($response->getContent()) {\n echo $response->getContent();\n }\n }", "private function respond($data)\n\t\t{\n\t\t\t$type='json';\n\t\t\tif ($this->callback)\n\t\t\t{\n\t\t\t\t$data=json_encode($data);\n\t\t\t\t$data=$this->callback.'('.$data.');';\n\t\t\t\t$type.='p';\n\t\t\t}\n\t\t\t$this->plugin\t->Responder($type)\n\t\t\t\t\t\t\t->setData($data)\n\t\t\t\t\t\t\t->send();\n\t\t\texit;\n\t\t}", "public function respond($response = array('Nothing to show'), $status = 200, $format = 'json'){\n // My application needed only JSON support. You can use $format and extend support for XML etc.\n header('Content-Type: application/json');\n $message_body = array(\n \"status\" => $status,\n \"response\" => $response\n );\n echo json_encode($message_body);\n // I'm specifically using this as I do not want control transferred back to application.\n exit(0);\n }", "public function respond() {\n\t \n\t // Prevent duplicate responses\n\t if ($this->hasResponded) return;\n\t $this->hasResponded = true;\n\t \n\t // Set google as default for now\n\t $integrations = array(\n\t\t 'google' => array(\n\t\t\t 'expectUserResponse' => $this->expectUserResponse,\n\t\t\t 'richResponse' => array(\n\t\t\t\t 'items' => $this->items\n\t\t\t )\n\t\t )\n\t );\n\t \n\t $fulfillmentMessages = array();\n\t \n\t $response = array(\n\t\t 'fulfillmentText' => $this->speech,\t\t \n\t\t 'payload' => $integrations,\t\t \n\t );\n\t \n\t header(\"Content-type:application/json\");\n\t return json_encode($response);\n }", "protected abstract function sendResource(Response $response);", "public function testAction() {\n\t\t$reponse = new Reponse ();\n\t\t\n\t\t$reponse->data = $this->person->toArray (); // $input_arrays;\n\t\t // $this->societe->save();\n\t\t\n\t\t$reponse->message = \"TXT_PERSON_SENT\";\n\t\t$reponse->success = true;\n\t\t\n\t\t$this->render ( $reponse );\n\t}", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }", "public function sendResponse($response)\n\t{\n\t\t// Check if we need to send an error code.\n\t\tif (JError::isError($response)) {\n\t\t\t// Send the appropriate error code response.\n\t\t\tJResponse::setHeader('status', $response->getCode());\n\t\t\tJResponse::setHeader('Content-Type', 'application/json; charset=utf-8');\n\t\t\tJResponse::sendHeaders();\n\t\t}\n\n\t\t// Send the JSON response.\n\t\techo json_encode(new JInstallationJsonResponse($response));\n\n\t\t// Close the application.\n\t\t$app = JFactory::getApplication();\n\t\t$app->close();\n\t}", "public static function client_responce()\n {\n // Find out Request Type\n $req_type = self::client_request_type();\n\n // Fire Responce\n self::{$req_type}();\n\n // End..\n die();\n }", "public function callbackSuccess()\n {\n $this->di->get(\"response\")->redirect(\"question\")->send();\n }", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }", "public function actionSendMessage() {\n\n // get data, sent by client\n $data = Yii::app()->request->getPost('chat', array());\n\n // try to store message\n $model = new Chat();\n $result = $model->storeMessage($data);\n\n // prepare return array, set status\n $response = array(\n 'status' => (bool)$result\n );\n\n // encode return array\n echo json_encode($response);\n\n // force app to end\n Yii::app()->end();\n\t}", "public function send(): ResponseInterface;", "public function send(): ResponseInterface;", "public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n \t//extract post data\n\t\tif (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\"; \n\t\t\t\tif(!empty( $keyword ))\n {\n \t\t$msgType = \"text\";\n \t$contentStr = \"Welcome to wechat world!\";\n \t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n \techo $resultStr;\n }else{\n \techo \"Input something...\";\n }\n\n }else {\n \techo \"\";\n \texit;\n }\n }", "public function sendResponse($result, $exitWhenDone = false)\n {\n }", "public function send()\n {\n if (function_exists('http_response_code')) {\n http_response_code($this->code);\n } else {\n header(' ', true, $this->code);\n }\n\n foreach ($this->headers as $name => $value) {\n header($name . ': ' . $value);\n }\n\n if (!is_null($this->content)) {\n echo $this->content;\n }\n }", "public function send()\n {\n $this->sendHttpHeaders();\n $this->sendContent();\n\n if (function_exists('fastcgi_finish_request'))\n {\n $this->dispatcher->notify(new sfEvent($this, 'response.fastcgi_finish_request'));\n fastcgi_finish_request();\n }\n }", "function send_response()\n {\n \t// put all POST variables received from Paypal back into a URL encoded string\n foreach($this->paypal_post_vars AS $key => $value)\n {\n // if magic quotes gpc is on, PHP added slashes to the values so we need\n // to strip them before we send the data back to Paypal.\n if( @get_magic_quotes_gpc() )\n {\n $value = stripslashes($value);\n }\n\n // make an array of URL encoded values\n $values[] = \"$key\" . \"=\" . urlencode($value);\n }\n\n // join the values together into one url encoded string\n $this->url_string .= @implode(\"&\", $values);\n\n // add paypal cmd variable\n $this->url_string .= \"&cmd=_notify-validate\";\n\n\t\t $ch = curl_init();\n \t\tcurl_setopt ($ch, CURLOPT_URL, $this->url_string);\n\t \t\tcurl_setopt ($ch, CURLOPT_USERAGENT, \"Mozilla/4.0 (compatible; www.ScriptDevelopers.NET; PayPal IPN Class)\");\n \t\tcurl_setopt ($ch, CURLOPT_HEADER, 1);\n \t\tcurl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);\n \t\tcurl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);\n \t\tcurl_setopt ($ch, CURLOPT_TIMEOUT, $this->timeout);\n \t\t$this->paypal_response = curl_exec ($ch);\n\t\t\tcurl_close($ch);\n\n }", "public function post()\n\t{\n\t\t\n\t\t$this->plugin->setResponse( $result );\n\t}", "function deliver_response(){\n\n // --- Step 1: Initialize variables and functions\n //\n // Deliver HTTP Response\n // The desired HTTP response content type: [json, html, xml]\n // The desired HTTP response data\n\n\n header('HTTP/1.1 '.$this->response['status'] . // Set HTTP Response\n ' '.$this->http_response_code[$this->response['status'] ]);\n header('Content-Type: application/json; charset=utf-8'); // Set HTTP Response Content Type\n $json_response = json_encode($this->response['data']); // Format data into a JSON response\n echo $json_response; // Deliver formatted data\n }", "protected function _sendAjaxResponse()\n {\n\n $response = $this->getResponse();\n if (!isset($this->_responseArray['meta'])) {\n $this->_responseArray['meta'] = array(\n 'code' => $this->_responseCode,\n 'error' => $this->_responseErrorString ? $this->_responseErrorString : self::ERROR_NONE\n );\n }\n if ($this->_displayMessage) {\n $this->_responseArray['meta']['message'] = $this->_displayMessage;\n }\n $response->setHttpResponseCode($this->_responseCode)\n ->appendBody(Zend_Json::encode($this->_responseArray))\n ->sendResponse();\n exit(0);\n }", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)) {\n\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\";\n if (!empty($keyword)) {\n $msgType = \"text\";\n $contentStr = \"Welcome to wechat world!\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n } else {\n echo \"Input something...\";\n }\n\n } else {\n echo \"\";\n exit;\n }\n }", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function Response($response) {\n\t\t\n\t}", "public function sendRequest()\n {\n }", "public function responseAction() {\n\n if ($this->_user == 'user') {\n $this->_redirect('/');\n }\n\n $form = new Yourdelivery_Form_Testing_Response();\n $testCaseId = (integer) $this->getRequest()->getParam('id');\n $testCaseExpId = (integer) $this->getRequest()->getParam('eid');\n try {\n $testCase = new Yourdelivery_Model_Testing_TestCase($testCaseId);\n $testCaseExpectation = new Yourdelivery_Model_Testing_TestCaseExpectation($testCaseExpId);\n } catch (Yourdelivery_Exception_Database_Inconsistency $exc) {\n $this->error('Requested site does not exists.');\n $this->_redirect('/testing_cms/');\n return;\n }\n\n $this->view->title = $testCase->getTitle();\n $this->view->testCaseExp = $testCaseExpectation;\n $this->view->testCaseId = $testCaseId;\n $this->view->testCaseExpectationId = $testCaseExpId;\n $this->view->userName = $this->_user;\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n $values['testCaseId'] = $testCaseId;\n $values['testCaseExpectationId'] = $testCaseExpId;\n $testCaseExecutor = new Yourdelivery_Model_Testing_TestCaseExecutor();\n $testCaseExecutorsResponse = new Yourdelivery_Model_Testing_TestCaseExecutorsResponse();\n $testCaseExecutor->setData($values);\n $values['testCaseExecutorId'] = $testCaseExecutor->save();\n if (strlen($values['response']) > 0) {\n $values['additionalInfo'] = $_SERVER['HTTP_USER_AGENT'];\n $email = new Yourdelivery_Sender_Email_Template('testing_cms_response');\n $email->setSubject('Testing-CMS-Response');\n $email->assign('link', sprintf('/testing_cms/responsestats/id/%s/eid/%s', $values['testCaseId'], $values['testCaseExpectationId']));\n $email->assign('msg', $values['response']);\n $email->assign('tester', $values['executor']);\n $email->addTo('[email protected]');\n $email->addTo('[email protected]');\n $email->send();\n }\n $testCaseExecutorsResponse->setData($values);\n $testCaseExecutorsResponse->save();\n $nextId = $testCase->getNextId($testCaseExpId);\n $this->success('Saved response.');\n\n\n\n if (is_null($nextId)) {\n $this->_redirect(sprintf('testing_cms/overviewexecutor/id/%d', $testCaseId));\n }\n $this->_redirect(sprintf('testing_cms/response/id/%d/eid/%d', $testCaseId, $nextId['id']));\n } else {\n $this->error($form->getMessages());\n $this->_redirect(sprintf('testing_cms/response/id/%d/eid/%d', $testCaseId, $testCaseExpId));\n }\n }\n }", "static function send_request_response($email,$status,$created_at){\n $message = \"<p>Dear employee, <br> Your supervisor has {$status} your application submitted on {$created_at}.</p>\";\n $headers = 'From: [email protected]' . \"\\r\\n\" .\n 'Reply-To: [email protected]' . \"\\r\\n\" .\n 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\" .\n 'X-Mailer: PHP/' . phpversion();\n \n \t$success = mail($email,\"Your request has been {$status}\", $message, $headers);\n if (!$success) {\n echo $errorMessage = error_get_last()['message'];\n }\n }", "function yms_send_response($success_string, $result)\n{\n global $lang, $output;\n \n if ( $result === true )\n {\n if ( isset($_GET['ajax']) )\n {\n yms_json_response(array(\n 'mode' => 'success',\n 'message' => $lang->get($success_string)\n ));\n }\n else\n {\n $output->add_after_header(\n '<div class=\"info-box\">' . $lang->get($success_string) . '</div>'\n );\n }\n }\n else\n {\n if ( isset($_GET['ajax']) )\n {\n yms_json_response(array(\n 'mode' => 'error',\n 'error' => $lang->get($result)\n ));\n }\n else\n {\n $output->add_after_header(\n '<div class=\"error-box\">' . $lang->get($result) . '</div>'\n );\n }\n }\n}", "public function send()\n {\n return $this->getResponse()->init($this->_getClient()->request());\n }", "public function response() {\n\t\t$message = $this->returnMessages;\n\n if($this->checkIfLoggedIn()){\n\t\t\t$response = $this->generateLogoutButtonHTML($message);\n\t\t}\n else{\n\t\t\t$response = $this->generateLoginFormHTML($message);\n }\n\n\t\treturn $response;\n\t}", "public function send() {\r\n\t\t$this->resource->send();\r\n\t}", "public function send(){\n\t\t\n\t\texit($this->page->generate());\n\t}", "private function send_success() {\n header('Content-Type: application/json');\n echo json_encode(array('success' => true));\n return;\n }", "protected function responseMsg()\n {\n $postStr = file_get_contents('php://input', 'r');\n\n //extract post data\n if (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\";\n if(!empty( $keyword ))\n {\n $msgType = \"text\";\n $contentStr = \"Welcome to wechat world!\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else{\n echo \"Input something...\";\n }\n\n }else {\n echo \"\";\n exit;\n }\n }", "public function send() : void\n {\n \\http_response_code( $this->status );\n\n foreach ( $this->headers->all() as $name => $values ) {\n foreach ( $values as $index => $value ) {\n \\header( \"$name: $value\", $index === 0 );\n }\n }\n\n echo $this->content;\n }", "public function autosendAction() {\n $result = $this->_autoSend();\n echo json_encode($result);\n die();\n }", "private function sendResponseCode(): void\n {\n\n $http = sprintf(\n 'HTTP/%s %s %s',\n $this->versionProtocol,\n $this->responseCode,\n $this->httpCodeText[$this->responseCode]\n );\n\n header($http, true);\n http_response_code($this->responseCode);\n\n }", "function myServiceMethod ($request, $response)\n\t\t{\n $response->data['message'] = 'I received from you: ' . $request->data['message'];\n $response->data['success'] = 'true';\n\t\t}", "private function respond($str)\n {\n $this->_registry->getResponse()->appendContent($str);\n }", "public function submit() {\n\tparent::submit();\n\tif( $this->notify() ) {\n\t echo '<div class=\"alert alert-success\">' . $this->message_form_send . '</div>';\n\t}\n }", "public function sendResponse()\n {\n $dataTables = new DataTable();\n $dataTables->fromBuilder($this->getQuery())->sendResponse();\n }" ]
[ "0.801928", "0.7762375", "0.72961384", "0.7098009", "0.70235366", "0.6925314", "0.6902655", "0.6898702", "0.68928015", "0.6865996", "0.6865395", "0.6864558", "0.6844764", "0.6834358", "0.6816901", "0.6774408", "0.67732453", "0.6766407", "0.6739111", "0.67247", "0.67247", "0.66861475", "0.66765374", "0.6637557", "0.6632308", "0.6620711", "0.6601598", "0.65839535", "0.6572099", "0.6572099", "0.6552051", "0.65471345", "0.653246", "0.652688", "0.65031517", "0.65030855", "0.64986503", "0.648861", "0.6486423", "0.64781785", "0.6468411", "0.6460608", "0.6447029", "0.64452195", "0.6426858", "0.63981545", "0.6362721", "0.6348188", "0.63466084", "0.6292728", "0.62869674", "0.6286224", "0.6284707", "0.62620646", "0.6255359", "0.62455845", "0.62389416", "0.62388957", "0.62322116", "0.6220656", "0.6204124", "0.6204103", "0.6204103", "0.61758685", "0.6171902", "0.6170519", "0.61576307", "0.6152558", "0.61361134", "0.61327636", "0.6131793", "0.61232984", "0.61214423", "0.61214423", "0.61214423", "0.61214423", "0.61214423", "0.61214423", "0.61214423", "0.61214423", "0.61214423", "0.61214423", "0.61214423", "0.61210304", "0.61180973", "0.6115965", "0.61047333", "0.60806566", "0.607933", "0.6071698", "0.6065977", "0.6056524", "0.6049912", "0.60490155", "0.6047582", "0.6043067", "0.6042027", "0.6015111", "0.60118616", "0.5980918", "0.5973335" ]
0.0
-1
Determine whether the user can view any coupons.
public function viewAny(User $user) { return $user->isAdmin(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n $user = $this->user();\n if(!$user){\n return false;\n }\n\n return $user->can('create',Coupon::class);\n }", "public function authorize()\n\t{\n\t\treturn current_user()->hasValidCoffeeShop();\n\t}", "public function authorize()\n {\n $user = Auth::user();\n $vendor = $user->vendor->first();\n $isOwner = AvailableFacility::where(array(\n 'id' => $this->id,\n 'vendor_id' => $vendor->id\n ))->count();\n if ($isOwner) {\n return true;\n } else {\n return false;\n }\n }", "protected function canApplyCoupon()\n {\n if (!$this->coupon->exists) {\n return false;\n }\n\n if (!$this->isCouponUsableBySpace()) return false;\n\n if (!$this->isCouponUsableByCustomer()) return false;\n\n return true;\n }", "function canView($user) {\n if($this->isOwner()) {\n return true;\n } // if\n \n return in_array($this->getId(), $user->visibleCompanyIds());\n }", "public function canView()\n\t{\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( 'nexus' , 'transactions', 'transactions_manage' );\n\t}", "public function canView()\n {\n return !$this->is_private ||\n ( Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() ) );\n }", "public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-referral', 'manage-referral'], true);\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "protected function _isAllowed()\n\t{\n\t\treturn (Mage::getSingleton('admin/session')->isAllowed('dropship360/suppliers') || Mage::getSingleton('admin/session')->isAllowed('dropship360/vendor_ranking'));\n\t}", "public function canUserAssignUsage()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::usage', $user->alexf, true);\n }", "function customerHasAccess() {\n\t\tswitch ($this->_mode) {\n\t\t\tcase WECF_OFF:\n\t\t\t\treturn true;\n\t\t\tcase WECF_ALL:\n\t\t\t\treturn weAbstractCustomerFilter::customerIsLogedIn();\n\t\t\tcase WECF_SPECIFIC:\n\t\t\t\tif (!weAbstractCustomerFilter::customerIsLogedIn()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn in_array($_SESSION[\"webuser\"][\"ID\"], $this->_specificCustomers);\n\t\t\tcase WECF_FILTER:\n\t\t\t\tif (!( isset($_SESSION) && isset($_SESSION[\"webuser\"]) && isset($_SESSION[\"webuser\"][\"ID\"]) )) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn weAbstractCustomerFilter::customerHasFilterAccess();\n\t\t}\n\t\treturn false;\n\t}", "public static function canDisplayContractorsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_CONTRACTOR);\n\t}", "public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }", "public function hasAccess()\n\t{\n\t\t/* Check Permissions */\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( \"core\",\"members\" );\n\t}", "public function authorize()\n {\n return Auth::check() && Auth::user()->hasAnyRol([\n 'contractor-superadmin',\n 'contractor-manager',\n 'contractor-worker',\n 'contractor-admin',\n ]);\n }", "public function isAuthorize(){\n $userPlan = $this->request->session()->get('userPlan');\n return ($userPlan >= 1)? true : abort(404) ;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "protected function _isAllowed()\n {\n if ($this->_shipment) {\n return $this->_authorization->isAllowed('Temando_Temando::temando_shipments_view');\n } else {\n return $this->_authorization->isAllowed('Temando_Temando::temando_pickups_view');\n }\n }", "public function hasCoupon()\n {\n return (bool)$this->coupon_id;\n }", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_VendorsCommission::commission_configuration');\n }", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_VendorsCommission::commission_configuration');\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('drugento_countryorder/country');\n }", "public function checkOnAccess() : bool\r\n {\r\n if (empty($this->gates)){\r\n return true;\r\n }\r\n\r\n foreach ($this->gates as $gate) {\r\n\r\n if(Gate::allows($gate)){\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public function authorize()\n {\n return Cart::load()->getTotalQuantity() > 1;\n }", "public function authorize()\n {\n return auth()->user()->can('create-product-packages');\n }", "private function canView(): bool\n {\n return true;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function is_surveillant() {\n return $this->session->get(\"niveau_acces\") >= 1;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('AVATOR_ContactUs::contact');\n }", "public function hasAuthorized() {\n return $this->_has(1);\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 Auth::user()->data_confirmacao != null;\n }", "public function checkAccess()\n {\n $orders = $this->getOrders();\n\n return parent::checkAccess()\n && $orders\n && $orders[0]\n && $orders[0]->getProfile();\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Accept an OAuth callback?\n $p['callback'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing SalesforceSource?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing SalesforceSource?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing SalesforceSources?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View API limits?\n $p['limits'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing SalesforceSource?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }", "public function authorize()\n {\n $admin = Auth::user();\n\n if( $admin->isBranchAdmin() ){\n return false;\n }\n\n if( $admin->church_id != $this->church_id){\n return false;\n }\n\n return true;\n }", "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 if ($this->user()->parent_id == NULL) { //Solo si es Cacique puede agregar indios. Sino, 403!\n return true;\n } else {\n return false;\n }\n }", "public function canSubscribe()\n {\n if ($this->getDateLimitSigningUp() > date('Y-m-d H:i:s') && count($this->getParticipants())<$this->getNbSigningUpMax() && $this->getState()->getId() == 2)\n {\n return true;\n }\n return false;\n }", "public function viewAny(User $user)\n {\n return $user->can('view_any_customer');\n }", "function getSessionCoupons() {\r\n\t\t$coupons = $GLOBALS['TSFE']->fe_user->getKey('ses','coupons');\r\n\t\treturn is_array($coupons)?$coupons:array();\r\n\t}", "public function authorize()\n {\n return $this->user()->hasPermission('subscription-service-create-plan');\n }", "public function view(User $user, Coupon $coupon)\n {\n return $user->isAdmin();\n }", "public function viewAny(User $user)\n {\n if ($user->can('view any client payment detail')) {\n return true;\n }\n }", "public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }", "public function canAdminCharge()\n {\n $settings = json_decode($this->settings, TRUE);\n return ($settings['method'] === 'direct');\n }", "public function authorize()\n {\n return \\Auth::user()->canDo('ADD_PORTFOLIOS');\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n {\n $member = auth()->user()->member;\n return auth()->user()->can('pdg', $member) || auth()->user()->can('manager', $member);\n }", "public function authorize()\n {\n $contact = $this->route('contact');\n\n return $contact->user_id == auth()->id() || user()->acl < 9;\n }", "public function isViewable(): bool\n\t{\n\t\treturn self::STATUS_ACTIVE === $this->get('status') && self::USER_VISIBLE === $this->get('visible');\n\t}", "public function customer_can() {\n\t\t$return = true;\n\n\t\tif ( !is_user_logged_in() || !get_user_meta( $this->userId, 'billing_email', true ) && !empty( $this->cards ) ) {\n\t\t\t$return = false;\n\t\t}\n\n\t\treturn apply_filters( 'ebanx_customerCan', $return );\n\t}", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "private function isCoop() : bool\n {\n return $this->user->hasRole('coop');\n }", "public function isUsable(){\n return ($this->isValid() && $this->isEnabled() && !$this->isDeleted());\n }", "public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }", "public static function isActivated ()\r\n {\r\n return Session::exists('acl');\r\n }", "public function canShowTab()\n {\n $customer = Mage::registry('current_customer');\n return $customer->getId()&& Mage::helper('storecreditpro')->moduleEnabled();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function isIndependentCreditSupported();", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('HiPay_FullserviceMagento::hipay_split_payment');\n }", "public function canViewProfile() {\n\t\treturn (!$this->protectedProfile || WCF::getUser()->userID == $this->userID || UserProfile::isBuddy($this->userID) || WCF::getUser()->getPermission('admin.general.canViewPrivateUserOptions'));\n\t}", "public function isEnabled()\n\t{\n\t\t// note: don't use $this->_main->.. as it might not exist when this func is called.\n\t\treturn Mage::helper('shoptimally_upsalecoupons/main')->isEnabled();\n\t}", "public static function hasAccess(): bool\n {\n return in_array(Helper::getClientIP(), self::$ips);\n }", "public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }", "protected function _canBeShown()\n {\n if (!Mage::helper('factfinder_campaigns')->getIsResultListingPage()) {\n return false;\n }\n\n return (bool) Mage::helper('factfinder')->isEnabled('campaigns');\n }", "public function can_activate(): bool;", "function canViewUsers( $sessionID ){\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "public function canView()\n {\n return true;\n }", "private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }", "public function is_visible_to()\n\t{\n\t\tif(is_oid($this->id()) && strlen($this->prop(\"show_to_country\")) > 1)\n\t\t{\n\t\t\t$aproved_countries = explode(\",\" , $this->prop(\"show_to_country\"));\n\t\t\tif(!in_array(detect_country() , $aproved_countries))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function authorize()\n {\n if (Gate::allows('isVendor') or Gate::allows('isAdmin')){\n return true;\n }\n return false;\n }", "function can_view_report() {\n //make sure context libraries are loaded\n $this->require_dependencies();\n\n //make sure the current user can view reports in at least one course context\n $contexts = get_contexts_by_capability_for_user('cluster', $this->access_capability, $this->userid);\n return !$contexts->is_empty();\n }", "public function isAvailable()\n\t{\n\t\tif ($this->isLocked())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (BE_USER_LOGGED_IN !== true && !$this->isPublished())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Show to guests only\n\t\tif ($this->arrData['guests'] && FE_USER_LOGGED_IN === true && BE_USER_LOGGED_IN !== true && !$this->arrData['protected'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Protected product\n\t\tif (BE_USER_LOGGED_IN !== true && $this->arrData['protected'])\n\t\t{\n\t\t\tif (FE_USER_LOGGED_IN !== true)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$groups = deserialize($this->arrData['groups']);\n\n\t\t\tif (!is_array($groups) || empty($groups) || !count(array_intersect($groups, $this->User->groups)))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check if \"advanced price\" is available\n\t\tif ($this->arrData['price'] === null && (in_array('price', $this->arrAttributes) || in_array('price', $this->arrVariantAttributes)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "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 {\n if (Auth::user() && Auth::user()->hasPermissionTo('manage categories')) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-inventory', 'manage-inventory'], true);\n }", "function hasAllAffiliateAccess() {\n\t\treturn ($this->hasAccessAffiliateBitLevel(1) && $this->hasAccessAffiliateBitLevel(2) && $this->hasAccessAffiliateBitLevel(4));\t\t\n\t}", "public function showing_restricted_products() {\n\t\treturn ! $this->hiding_restricted_products();\n\t}", "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 viewAny(User $user)\n {\n if ($user->hasPermissionTo('view crm product categories')) {\n return true;\n }\n }", "public function has_access() { \n\n\t\tif (!Access::check('interface','25')) { \n\t\t\treturn false; \n\t\t} \n\t\tif ($this->user == $GLOBALS['user']->id) { \n\t\t\treturn true; \n\t\t} \n\t\telse {\n\t\t\treturn Access::check('interface','100'); \n\t\t} \t\n\n\t\treturn false; \n\n\t}", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Amasty_Acart::acart_reports');\n }", "public function authorize()\n {\n return $this->route('address')->userCanView($this->user());\n }", "public static function canDisplayContractorTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_CONTRACTOR_TYPE);\n\t}", "public static function canViewNewTickets()\n\t{\n\t\tif (!auth()->check()) return false;\n\t\t$member = \\PanicHDMember::find(auth()->user()->id);\n\n\t\tif ($member->isAdmin()){\n\t\t\treturn true;\n\t\t}elseif($member->isAgent() and $member->currentLevel() == 2){\n\t\t\tif(Setting::grab('agent_restrict')==1){\n\t\t\t\treturn $member->categories()->wherePivot('autoassign','1')->count()==0 ? false : true;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function viewAny(User $user)\n {\n return $user->hasPermissionTo('view campaign');\n }", "function isaccessible()\n\t\t{\n\t\t\t// If bank deposit is available for all countries then return true\n\t\t\t$available_countries = $this->GetValue(\"availablecountries\");\n\n\t\t\tif( (!is_array($available_countries) && $available_countries == \"all\") || (is_array($available_countries) && in_array(\"all\", $available_countries)) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse if(!isset($GLOBALS['ISC_CLASS_ACCOUNT'])) { // Always accessible to the Admin panel\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Load the pending order\n\t\t\t\t$pendingOrder = LoadPendingOrderByToken();\n\n\t\t\t\t// Check the country in the billing address. If it's not set then assume true\n\t\t\t\tif(isset($pendingOrder['ordbillcountryid'])) {\n\t\t\t\t\t$billing_country_id = $pendingOrder['ordbillcountryid'];\n\t\t\t\t\tif(is_array($available_countries)) {\n\t\t\t\t\t\tif(in_array($billing_country_id, $available_countries)) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn false;\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\tif($billing_country_id == $available_countries) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn false;\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\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function authorize()\n {\n $id = $this->route('auction_house');\n $user = \\Auth::user();\n $auctionHouse = \\App\\AuctionHouse::findOrFail($id);\n\n return $user\n && $auctionHouse->user_id !== $user->id;\n }", "protected function _isAllowed()\n {\n\t$session = Mage::getSingleton('admin/session');\n return ($session->isAllowed('iqnomy') || $session->isAllowed('system/iqnomy'));\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function hasAccess()\n\t{\n\t\t/* Check Permissions */\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( 'core', 'members', 'member_edit' );\n\t}", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public static function allowed_in_view(View $view) {\r\n return $view->get('owner') != null;\r\n }", "public static function allowed_in_view(View $view) {\r\n return $view->get('owner') != null;\r\n }" ]
[ "0.68489844", "0.6821446", "0.67878485", "0.6746491", "0.6685917", "0.6678283", "0.64696884", "0.646824", "0.6439463", "0.6407111", "0.6374908", "0.6371119", "0.63552856", "0.63419026", "0.63299155", "0.63220394", "0.6317187", "0.6310459", "0.6268794", "0.62676364", "0.6266669", "0.6266669", "0.625113", "0.6246423", "0.624137", "0.6232515", "0.62310785", "0.6229843", "0.62062347", "0.62042373", "0.6193967", "0.6174631", "0.6174631", "0.6169226", "0.6166353", "0.61500484", "0.61464477", "0.614319", "0.612732", "0.6121573", "0.6118565", "0.6118058", "0.60993195", "0.609095", "0.60841274", "0.60788065", "0.6078779", "0.60782146", "0.6077001", "0.60768086", "0.60748315", "0.6062089", "0.60559505", "0.6049859", "0.60467553", "0.602532", "0.60232484", "0.6016324", "0.6014346", "0.6007969", "0.59996325", "0.5998765", "0.599706", "0.5996035", "0.599575", "0.5990435", "0.5989217", "0.59882027", "0.597778", "0.59770215", "0.59745455", "0.59646976", "0.5964515", "0.59610206", "0.59553427", "0.5953135", "0.5952263", "0.59515274", "0.59470004", "0.5944875", "0.59433657", "0.59427947", "0.593263", "0.5926998", "0.59240174", "0.59218603", "0.59180886", "0.5916166", "0.59158546", "0.59158534", "0.59144217", "0.5907674", "0.59070563", "0.5905544", "0.5904299", "0.59014314", "0.58989376", "0.5898122", "0.5892469", "0.5883619", "0.5883619" ]
0.0
-1
Determine whether the user can view the coupon.
public function view(User $user, Coupon $coupon) { return $user->isAdmin(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n $user = $this->user();\n if(!$user){\n return false;\n }\n\n return $user->can('create',Coupon::class);\n }", "public function view(User $user, Coupon $coupon)\n {\n return $coupon->user_id == NULL || $coupon->user_id = auth()->id();\n }", "public function authorize()\n\t{\n\t\treturn current_user()->hasValidCoffeeShop();\n\t}", "protected function canApplyCoupon()\n {\n if (!$this->coupon->exists) {\n return false;\n }\n\n if (!$this->isCouponUsableBySpace()) return false;\n\n if (!$this->isCouponUsableByCustomer()) return false;\n\n return true;\n }", "function canView($user) {\n if($this->isOwner()) {\n return true;\n } // if\n \n return in_array($this->getId(), $user->visibleCompanyIds());\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "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 canView()\n\t{\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( 'nexus' , 'transactions', 'transactions_manage' );\n\t}", "public function hasCoupon()\n {\n return (bool)$this->coupon_id;\n }", "public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-referral', 'manage-referral'], true);\n }", "protected function _isAllowed()\n {\n if ($this->_shipment) {\n return $this->_authorization->isAllowed('Temando_Temando::temando_shipments_view');\n } else {\n return $this->_authorization->isAllowed('Temando_Temando::temando_pickups_view');\n }\n }", "public function authorize()\n {\n $user = Auth::user();\n $vendor = $user->vendor->first();\n $isOwner = AvailableFacility::where(array(\n 'id' => $this->id,\n 'vendor_id' => $vendor->id\n ))->count();\n if ($isOwner) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function customer_can() {\n\t\t$return = true;\n\n\t\tif ( !is_user_logged_in() || !get_user_meta( $this->userId, 'billing_email', true ) && !empty( $this->cards ) ) {\n\t\t\t$return = false;\n\t\t}\n\n\t\treturn apply_filters( 'ebanx_customerCan', $return );\n\t}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('drugento_countryorder/country');\n }", "public function isAuthorize(){\n $userPlan = $this->request->session()->get('userPlan');\n return ($userPlan >= 1)? true : abort(404) ;\n }", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "protected function _isAllowed()\n\t{\n\t\treturn (Mage::getSingleton('admin/session')->isAllowed('dropship360/suppliers') || Mage::getSingleton('admin/session')->isAllowed('dropship360/vendor_ranking'));\n\t}", "public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }", "public function authorize()\n {\n return $this->route('address')->userCanView($this->user());\n }", "public function authorize()\n {\n $admin = Auth::user();\n\n if( $admin->isBranchAdmin() ){\n return false;\n }\n\n if( $admin->church_id != $this->church_id){\n return false;\n }\n\n return true;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Accept an OAuth callback?\n $p['callback'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing SalesforceSource?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing SalesforceSource?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing SalesforceSources?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View API limits?\n $p['limits'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing SalesforceSource?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return($p[$this->action]);\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 return \\Auth::user()->iCan('donor', 'store');\n }", "public function authorize()\n {\n return Auth::user()->data_confirmacao != null;\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function delete(User $user, Coupon $coupon)\n {\n return $user->isAdmin();\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\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 request()->user() != null;\n }", "public function authorize()\n {\n return !empty(session(\"borrower_id\"));\n }", "function customerHasAccess() {\n\t\tswitch ($this->_mode) {\n\t\t\tcase WECF_OFF:\n\t\t\t\treturn true;\n\t\t\tcase WECF_ALL:\n\t\t\t\treturn weAbstractCustomerFilter::customerIsLogedIn();\n\t\t\tcase WECF_SPECIFIC:\n\t\t\t\tif (!weAbstractCustomerFilter::customerIsLogedIn()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn in_array($_SESSION[\"webuser\"][\"ID\"], $this->_specificCustomers);\n\t\t\tcase WECF_FILTER:\n\t\t\t\tif (!( isset($_SESSION) && isset($_SESSION[\"webuser\"]) && isset($_SESSION[\"webuser\"][\"ID\"]) )) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn weAbstractCustomerFilter::customerHasFilterAccess();\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // return $this->user('canvas')->isAdmin;\n if (auth()->guard('website')->user()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "private function isUsedCoupon(Request $request, Coupon $coupon)\n {\n $couponId = $coupon->id;\n $couponIds = $request->session()->get($this->couponIdsKey, '');\n $isUsed = false;\n \n foreach(explode(',', $couponIds) as $cid)\n {\n if($couponId == $cid)\n {\n $isUsed = true;\n break;\n }\n }\n\n return $isUsed;\n }", "public function authorize()\n {\n return Auth::user()->is_supplier;\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 if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }", "public function authorize()\n {\n //Get the 'mark' id\n switch ((int) request()->segment(6)) {\n case 0:\n return access()->allow('deactivate-users');\n break;\n\n case 1:\n return access()->allow('reactivate-users');\n break;\n }\n\n return false;\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('customer/manage');\n }", "public function view(User $user)\n {\n return $user->can('view_customer');\n }", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserSaveVersion();\n break;\n case 'delete':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion();\n break;\n case 'massDeleteRevisions':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteRevision();\n break;\n default:\n return Mage::getSingleton('admin/session')->isAllowed('cms/page');\n break;\n }\n }", "public function canShowTab()\n {\n $customer = Mage::registry('current_customer');\n return $customer->getId()&& Mage::helper('storecreditpro')->moduleEnabled();\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 }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(\\Eadesigndev\\Pdfgenerator\\Controller\\Adminhtml\\Templates::ADMIN_RESOURCE_VIEW);\n }", "public function authorize()\n {\n return !is_null($this->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 if (Gate::allows('isVendor') or Gate::allows('isAdmin')){\n return true;\n }\n return false;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('AVATOR_ContactUs::contact');\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 return $this->user()->can('create mindoro transaction');\n }", "public function canView()\n {\n return !$this->is_private ||\n ( Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() ) );\n }", "public function authorize()\n {\n $member = auth()->user()->member;\n return auth()->user()->can('pdg', $member) || auth()->user()->can('manager', $member);\n }", "public function view(User $user)\n {\n if(!$user->isAdmin()){\n return true;\n }\n\t return app(Gate::class)->authorize('financial.exchangeRate.view');\n }", "public function authorize()\n {\n $this->reusablePayment = FetchReusablePayment::run([\n 'encoded_id' => $this->encoded_id,\n ]);\n\n return $this->user()->can('delete', $this->reusablePayment);\n }", "public function authorize()\n {\n return auth()->user()->can('edit', $this->subscription);\n }", "public function authorize()\n {\n return $this->user()->hasPermission('subscription-service-create-plan');\n }", "public function authorize(): bool\n {\n return $this->user()->can('anyAction', ChessRule::class);\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n return (Auth::user()->type === User::VENDEDOR);\n }", "public function canViewProfile() {\n\t\treturn (!$this->protectedProfile || WCF::getUser()->userID == $this->userID || UserProfile::isBuddy($this->userID) || WCF::getUser()->getPermission('admin.general.canViewPrivateUserOptions'));\n\t}", "public function authorize()\n {\n return Cart::load()->getTotalQuantity() > 1;\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 if ($this->user()->parent_id == NULL) { //Solo si es Cacique puede agregar indios. Sino, 403!\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return $this->user()->can('anyAction', ChessRule::class);\n }", "public function update(User $user, Coupon $coupon)\n {\n return $user->isAdmin();\n }", "public function authorize()\n {\n return $this->user()->can('list', Card::class);\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Amasty_Acart::acart_reports');\n }", "public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }", "public function authorize()\n // can access chef member who is 'logined' and 'chefprofile null === false'\n {\n $loginedUser = Auth::user();\n\n return $loginedUser->user_type === 'chef' && (\n\n is_null($loginedUser->chef) === false\n );\n }", "public function authorize()\n {\n if (Auth::user() && Auth::user()->hasPermissionTo('manage categories')) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $id = $this->route('id');\n if ($id) {\n $giftList = GiftList::find($id);\n if (!$giftList || $giftList->user->id != Auth::user()->id) {\n return false;\n }\n }\n return true;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Firebear_CloudFlare::firebear_cloudflare_control');\n }", "public function canUserAssignUsage()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::usage', $user->alexf, true);\n }", "public function view(User $user, AreaPricing $area_pricing)\n {\n return $user->isAdmin() || $user->isSupervisor();\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->hasAnyRol([\n 'contractor-superadmin',\n 'contractor-manager',\n 'contractor-worker',\n 'contractor-admin',\n ]);\n }", "public function authorize()\n {\n $contact = $this->route('contact');\n\n return $contact->user_id == auth()->id() || user()->acl < 9;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "public function isAuthorized($user) {\n if (isset($user['role']) && $this->action == 'index') {\n return true;\n }\n \n // The owner of a whatever can view, edit and delete it\n $userAssignedId = $this->{$this->modelClass}->findById($this->request->params['pass'][0])['Branch']['user_id'];\n\n if( $user['id'] == $userAssignedId ){\n return true;\n }\n // Default deny\n return parent::isAuthorized($user); \n }", "private function canView(): bool\n {\n return true;\n }", "public function canDisplayAdminCards()\n {\n // Get the customer id\n $customerId = $this->adminQuote->getQuote()->getCustomer()->getId();\n\n // Return the check result\n return $this->config->getValue('saved_cards_enabled', 'checkoutcom_moto')\n && $this->config->getValue('active', 'checkoutcom_moto')\n && $this->vaultHandler->userHasCards($customerId);\n }", "public function authorize(): bool\n {\n return Auth::check() &&\n $this->user()->tokenCan('view:store');\n }", "public function canView()\n {\n return true;\n }", "public function authorize()\n {\n // todo: dominion selected, selected dominion in active round?\n return Auth::check();\n }", "public function isAllowed()\n {\n $result = new \\Magento\\FrameWork\\DataObject(['is_allowed' => true]);\n $this->_eventManager->dispatch(\n 'ves_vendor_menu_check_acl',\n [\n 'resource' => $this->_resource,\n 'result' => $result\n ]\n );\n $permission = new \\Vnecoms\\Vendors\\Model\\AclResult();\n $this->_eventManager->dispatch(\n 'ves_vendor_check_acl',\n [\n 'resource' => $this->_resource,\n 'permission' => $permission\n ]\n );\n return $result->getIsAllowed() && $permission->isAllowed();\n }", "public function authorize()\n {\n\n if (Gate::allows('change-order-status', $this->route('order'))) {\n return true;\n }\n\n return false;\n }", "public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n return \\Auth::user()->canDo('ADD_PORTFOLIOS');\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}", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_VendorsCommission::commission_configuration');\n }", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_VendorsCommission::commission_configuration');\n }", "public static function isAllowed() {\r\n\t\treturn TodoyuAuth::isAdmin();\r\n\t}", "private function isCoop() : bool\n {\n return $this->user->hasRole('coop');\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }", "public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }" ]
[ "0.7811253", "0.72118443", "0.71347106", "0.7120189", "0.6866632", "0.67625254", "0.67199266", "0.6715765", "0.6715103", "0.67113316", "0.67043763", "0.662617", "0.66183776", "0.66159093", "0.6594832", "0.6583766", "0.6575066", "0.6573211", "0.6538997", "0.6526429", "0.6523971", "0.648453", "0.64442885", "0.6443631", "0.64430696", "0.64419687", "0.6435286", "0.6433708", "0.6432427", "0.64251435", "0.64251435", "0.6402713", "0.63717455", "0.6365587", "0.63590515", "0.63588", "0.63471615", "0.63449377", "0.63444024", "0.634341", "0.63432175", "0.6341816", "0.6335347", "0.633002", "0.6326249", "0.6314274", "0.6311636", "0.63096213", "0.63035256", "0.630329", "0.6296389", "0.6284623", "0.6281689", "0.6280612", "0.6276713", "0.6266251", "0.6263714", "0.6262301", "0.62594014", "0.62593234", "0.6254985", "0.6254866", "0.62537426", "0.62526", "0.6249502", "0.6249154", "0.624598", "0.6245882", "0.62399656", "0.62338406", "0.62297547", "0.62271535", "0.6220064", "0.6217029", "0.6213412", "0.6211786", "0.6208854", "0.6206715", "0.6206394", "0.62057513", "0.6205656", "0.6195892", "0.61957645", "0.61906475", "0.6190222", "0.6187043", "0.61816025", "0.6177833", "0.6176041", "0.61673427", "0.6162298", "0.616152", "0.61610043", "0.61590225", "0.6148421", "0.6148421", "0.61481714", "0.6142798", "0.6140792", "0.61394274" ]
0.75364816
1
Determine whether the user can create coupons.
public function create(User $user) { return $user->isAdmin(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n $user = $this->user();\n if(!$user){\n return false;\n }\n\n return $user->can('create',Coupon::class);\n }", "protected function canApplyCoupon()\n {\n if (!$this->coupon->exists) {\n return false;\n }\n\n if (!$this->isCouponUsableBySpace()) return false;\n\n if (!$this->isCouponUsableByCustomer()) return false;\n\n return true;\n }", "public function canCreate();", "public function canCreate();", "public function authorize()\n {\n return auth()->user()->can('create', Pizza::class);\n }", "public function authorize()\n {\n return $this->user()->hasPermission('subscription-service-create-plan');\n }", "public function authorize()\n {\n return auth()->user()->can('create-product-packages');\n }", "public function create(): bool\n {\n return $this->isAllowed(self::CREATE);\n }", "public function authorize()\n {\n return $this->user()->can(\"Crear Nómina\");\n }", "public function authorize()\n {\n $user = Auth::user();\n\n $foodAddition = new FoodAddition();\n\n if((!$user->can('create', $foodAddition)) || (!$user->can('create-food-addition'))) {\n return false;\n }\n\n return true;\n }", "public function authorize(): bool\n {\n return $this->user()->can('create_contact');\n }", "protected function CanCreate()\n {\n return self::Guard()->Allow(BackendAction::Create(), new Container())\n && self::Guard()->Allow(BackendAction::UseIt(), new ContainerForm());\n }", "public function authorize()\n {\n return $this->user()->can('create mindoro transaction');\n }", "function canCreateAccounts() {\r\n\t\treturn true;\r\n\t}", "public static function userCreationAllowed(): bool\n {\n return self::isConfigured(self::ACTION_ADD_USER);\n }", "protected function canCreate(){\n return $this->canUserModify() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_CREATE, $this->getEmptyComment());\n }", "public function create(User $user)\n {\n return $user->can('create_customer');\n }", "public function authorize()\n {\n return $this->user()->can('user.create');\n }", "function canCreate(){\n\t\t\tif(!isset($_POST['action'])) return false;\n\t\t\tif($_POST['action'] !== 'create_profile') return false;\n\t\t\tif($_POST['profile_folder'] === '') return false;\n\t\t\tif($_POST['profile_name'] === '') return false;\n\t\t\treturn true;\n\t\t}", "public function create(User $user)\n {\n return $user->isAdmin() || $user->is($coupon->user);\n }", "public function create(User $user)\n {\n if($user->can('carts-create') || $user->can('cart-create')) {\n return true;\n }\n return false;\n }", "public function userHasCreatePermission(){\n//\t\tif(\\GO\\Base\\Model\\Acl::hasPermission($this->getPermissionLevel(),\\GO\\Base\\Model\\Acl::CREATE_PERMISSION)){\n//\t\t\treturn true;\n//\t\t}else \n\t\tif(\\GO::modules()->isInstalled('freebusypermissions')){\n\t\t\treturn \\GO\\Freebusypermissions\\FreebusypermissionsModule::hasFreebusyAccess(\\GO::user()->id, $this->user_id);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "protected function canCreate() {}", "public function canSubscribe()\n {\n if ($this->getDateLimitSigningUp() > date('Y-m-d H:i:s') && count($this->getParticipants())<$this->getNbSigningUpMax() && $this->getState()->getId() == 2)\n {\n return true;\n }\n return false;\n }", "public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function authorize()\n\t{\n\t\treturn current_user()->hasValidCoffeeShop();\n\t}", "private function canCreate()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "function canCreate() {\r\n\t\treturn !DataObject::get_one($this->class);\r\n\t}", "public function canCreate(): bool\n {\n if (!$this->hasData('can_create')) {\n $this->setData('can_create', $this->eraseCustomerChecker->canCreate((int) $this->session->getCustomerId()));\n }\n\n return (bool) $this->_getData('can_create');\n }", "public function authorize()\n {\n return Auth::user() && Auth::user()->hasPermissionTo('create-users');\n }", "public function create(User $user)\n {\n if ($user->can('create client payment detail')) {\n return true;\n }\n }", "public function authorize()\n {\n return $this->user()->can('Crear Departamentos');\n\n }", "public function authorize()\n {\n return \\Auth::user()->canDo('ADD_PORTFOLIOS');\n }", "public function create(User $user)\n {\n return $user->can('create user');\n }", "public function canCreateAccounts()\n {\n return false;\n }", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_VendorsProfileNotification::manage_process');\n }", "function userCanCreateUser( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "public function test_canCreate_Returns_True_If_Personnel_Have_Access() {\n\n\t\t$check_returns_true = $this->authorization_service3->canCreate(1,1);\n\n\t\t$this->assertTrue($check_returns_true);\n\t}", "protected function CanCreate()\n {\n return self::Guard()->Allow(BackendAction::Create(), new Site());\n }", "public function hasCoupon()\n {\n return (bool)$this->coupon_id;\n }", "public function authorize()\n {\n return auth()->user()->can('create-buildings');\n }", "public function authorize()\n {\n return auth()->user()->can('create', Task::class);\n }", "public function create(User $user)\n {\n if ($user->can('create_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function create(User $user)\n {\n $test = DB::table('permissions')->get()->first();\n if ($test->create_commande and $test->id_user == $user->id){\n return true;\n }else{\n return false;\n }\n }", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_VendorsCommission::commission_configuration');\n }", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_VendorsCommission::commission_configuration');\n }", "public function authorize()\n {\n $user = Auth::user();\n $vendor = $user->vendor->first();\n $isOwner = AvailableFacility::where(array(\n 'id' => $this->id,\n 'vendor_id' => $vendor->id\n ))->count();\n if ($isOwner) {\n return true;\n } else {\n return false;\n }\n }", "public function create(User $user)\n {\n if ($user->can('create plans')) {\n return true;\n }\n }", "public function authorize()\n {\n // to do update verification and rules on the rights to create a company\n return true;\n }", "public function create(User $user)\n {\n return $user->id>0; //aggiungere subscription al canale\n }", "public function authorize() : bool\n {\n return auth()->user()->can('create', GroupSetting::class);\n }", "public function canSetCreatable();", "public function authorize()\n {\n if ($this->user()->parent_id == NULL) { //Solo si es Cacique puede agregar indios. Sino, 403!\n return true;\n } else {\n return false;\n }\n }", "private function isCoop() : bool\n {\n return $this->user->hasRole('coop');\n }", "public function authorize(): bool\n {\n return auth()->user()->can('create academic year unit levels');\n }", "function canCreateAccounts() {\n return false;\n }", "public function canCreate(string $name) : bool;", "public function create(UserPolicy $user)\n {\n return $user->canDo('forum.category.create');\n }", "public function authorize()\n {\n return Gate::allows('add_to_dos') ? true : false;\n }", "protected function canCreateWishlists()\n {\n $customerId = $this->currentCustomer->getCustomerId();\n return !$this->wishlistHelper->isWishlistLimitReached($this->wishlistHelper->getCustomerWishlists())\n && $customerId;\n }", "public function create(User $user) {\n return $user->can('payments.create.*.*');\n }", "public function can_auto_create_users() {\n return (bool)$this->config['weautocreateusers'];\n }", "public function authorizePost()\n {\n return $this->user()->can('acme.create');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('AVATOR_ContactUs::contact');\n }", "public function create(User $user)\n {\n return $user->isCustomerServiceOfficer() || $user->isCustomerServiceManagement();\n }", "public function authorize()\n {\n return $this->permissionGuard()->allowsCreate($this->newModelInstance());\n }", "public function authorize()\n {\n\t\treturn $this->user()->can('create', Collection::class);\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Formax_FormCrud::formcrud_create') ||\n $this->_authorization->isAllowed('Formax_FormCrud::formcrud_update');\n }", "public function create(User $user)\n {\n return ($user->role instanceof Coach && $user->coach->verified) || ($user->isAdmin());\n }", "public function create(User $user)\n {\n return $user->hasPermission('create-organization-composition');\n }", "public function form_is_available_to_create_a_customer()\n {\n\n }", "function canCreatePage() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }", "public function can_activate(): bool;", "public function authorize()\n {\n // return auth()->user()->can('create user');\n return true;\n }", "public function create(User $user)\n {\n if ($user->hasPermissionTo('create crm product categories')) {\n return true;\n }\n }", "public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }", "private function canCreate(User $user, ?Place $place): bool\n {\n return true;\n }", "function get_can_create_user ()\r\n {\r\n return $_SESSION[\"can_create_user\"];\r\n }", "public function create(User $user)\n {\n return true; // TODO: Change as needed, but leave it true if no policy\n }", "public function create(User $user)\n {\n return ($user->tipousuario == 1 || $user->tipousuario == 2);\n }", "public function create()\n {\n return isAdmin();\n }", "public function create(User $user) : bool\n {\n return $user->isAdmin() || $user->hasPermission('create_user') || $user->hasPermission('create_all');\n }", "public function create(User $user)\n {\n return $user->hasPermissionTo('create campaign');\n }", "public function authorize(): bool\n {\n return $this->user()->can('create', Role::class);\n }", "public function test_canCreate_Returns_True_If_Personnel_Have_No_Access() {\n\n\t\t$check_returns_false = $this->authorization_service4->canCreate(2,2);\n\n\t\t$this->assertFalse($check_returns_false);\n\t}", "#[Pure]\n public function create(User $user): bool\n {\n return $user->noTokenOrTokenCan('create-oauth_clients');\n }", "public function authorize()\n {\n return request()->user()->tokenCan('user_create');\n }", "public function create(User $user)\n {\n return $this->userRoleCan($user, 'country-create');\n }", "public function create(User $user)\n {\n return $user->canDo('career.job.create');\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function create(User $user)\n {\n return $user->hasPermissionTo('create organisations');\n }", "public function create(User $user)\n {\n return $user->isSuper() || $user->isAdmin() || $this->isAllowedFor($user, 'create');\n }", "protected function creatingNewUser() {\n return ($this->request_exists('user_choice') && $this->request('user_choice') == 'new' );\n }", "public function canPayment()\n {\n return true;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return $this->user()->can('create', MarEntry::class);\n }", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function canSetCreatable()\n {\n return $this->canSetCreatable;\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 isUsable(){\n return ($this->isValid() && $this->isEnabled() && !$this->isDeleted());\n }", "public function create(User $user)\n {\n return $user->hasRole('editor') || $user->hasRole('admin') ||\n $user->canDo('UPDATE_POLLS');\n }" ]
[ "0.7549897", "0.6995758", "0.678811", "0.678811", "0.6764038", "0.6690486", "0.66859156", "0.6639538", "0.663423", "0.65637326", "0.65484416", "0.6534439", "0.65169156", "0.651376", "0.6509675", "0.6507278", "0.64910984", "0.6485681", "0.64788455", "0.6451078", "0.64419365", "0.6431003", "0.6412037", "0.64116657", "0.64109653", "0.6408569", "0.6377821", "0.6336537", "0.6318711", "0.63033134", "0.6298031", "0.62959754", "0.62874895", "0.62514585", "0.62421906", "0.6240774", "0.6228873", "0.62234783", "0.6221974", "0.62100255", "0.62037903", "0.61855143", "0.61726034", "0.6169268", "0.6137654", "0.6137654", "0.61349535", "0.6133738", "0.61182356", "0.61174", "0.61162794", "0.61143297", "0.61108136", "0.61015433", "0.61007226", "0.6091822", "0.60882753", "0.6081481", "0.6068425", "0.6067876", "0.6058582", "0.6056333", "0.60476387", "0.60463876", "0.60454285", "0.604056", "0.6033764", "0.60305166", "0.6024782", "0.60167605", "0.60089976", "0.60080624", "0.600458", "0.5999769", "0.5984633", "0.59810793", "0.5979143", "0.5973941", "0.5972454", "0.59648246", "0.5962545", "0.5962529", "0.5953313", "0.59447926", "0.5944059", "0.5939754", "0.59393346", "0.59322524", "0.5928162", "0.59278214", "0.59213746", "0.59178686", "0.59047323", "0.5903157", "0.5896926", "0.5892414", "0.5890021", "0.5882674", "0.58805", "0.5876179", "0.5870516" ]
0.0
-1
Determine whether the user can update the coupon.
public function update(User $user, Coupon $coupon) { return $user->isAdmin(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _isAllowed()\r\n {\r\n return $this->_authorization->isAllowed('AAllen_PriceUpdate::update');\r\n }", "public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }", "public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }", "protected function canApplyCoupon()\n {\n if (!$this->coupon->exists) {\n return false;\n }\n\n if (!$this->isCouponUsableBySpace()) return false;\n\n if (!$this->isCouponUsableByCustomer()) return false;\n\n return true;\n }", "public function authorize()\n {\n return $this->user()->canUpdateSecurity();\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }", "protected function canUpdate(){\n $emptyComment = $this->getEmptyComment();\n\n return $this->canUserModify() &&\n ($this->isActive() || $this->isPending() ||\n ($this->isSuspended() && parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $emptyComment))) &&\n !$this->isDeleted() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE, $emptyComment);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }", "public function authorize()\n {\n return $this->user()->can('update_users');\n }", "public function authorize(): bool\n {\n return Gate::allows('update', $this->product);\n }", "public function authorize()\n {\n $user = \\Auth::user();\n \n if($user->can('update', \\App\\Product::class)){\n return true;\n }\n \n return false;\n }", "public function authorizePatch()\n {\n return $this->user()->can('acme.update');\n }", "public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }", "public function update(User $user)\n {\n return $user->can('update_customer');\n }", "protected function canUpdate()\n {\n return $this->hasStrategy(self::STRATEGY_UPDATE);\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }", "public function authorize()\n {\n $user = $this->user();\n if(!$user){\n return false;\n }\n\n return $user->can('create',Coupon::class);\n }", "public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}", "public function authorize()\n {\n return $this->user()->can('update', \\App\\Models\\Member::withTrashed()->find($this->id));\n }", "protected function canUpdateStatus() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $this->getEmptyComment());\n }", "public function authorize(): bool\n {\n return $this->user()->can('update_contact');\n }", "function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}", "public function authorize()\n {\n return auth()->user()->can('update', [Category::class, request('category')]);\n }", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}", "public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function update(User $user)\n {\n //\n if(!$user->isAdmin()){\n return true;\n }\n\t return app(Gate::class)->authorize('financial.exchangeRate.setting');\n }", "function updatesAllowed() {\n\t\treturn $this->getupdatable() == 1 ? true : false;\n\t}", "public function update(User $user)\n {\n if($user->can('carts-update') || $user->can('cart-update')) {\n return true;\n }\n return false;\n }", "public function update(User $user, AreaPricing $area_pricing)\n {\n return $user->isAdmin() || $user->isSupervisor();\n }", "public function hasCoupon()\n {\n return (bool)$this->coupon_id;\n }", "public function isUpdateSecurityRelevant() {}", "public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }", "public function is_allowed_to_update_feedback($feedback);", "function canUpdateItem() {\n\n $ticket = new Ticket();\n if (!$ticket->getFromDB($this->fields['tickets_id'])) {\n return false;\n }\n\n // you can't change if your answer > 12h\n if (!is_null($this->fields['date_answered'])\n && ((strtotime(\"now\") - strtotime($this->fields['date_answered'])) > (12*HOUR_TIMESTAMP))) {\n return false;\n }\n\n if ($ticket->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || ($ticket->fields[\"users_id_recipient\"] === Session::getLoginUserID() && Session::haveRight('ticket', Ticket::SURVEY))\n || (isset($_SESSION[\"glpigroups\"])\n && $ticket->haveAGroup(CommonITILActor::REQUESTER, $_SESSION[\"glpigroups\"]))) {\n return true;\n }\n return false;\n }", "public function update(User $user, OrderProduct $orderProduct)\n {\n return $user->isAdmin() || $user->is($orderProduct->coupon->user);\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return Auth::check();\n }", "public function authorize()\n {\n return auth()->user()->can('update online assessment');\n }", "public function update(User $user, Coupon $coupon)\n {\n //\n }", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('catalog/productsupdater');\r\n }", "public function authorize()\n {\n $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }", "public function update(User $user)\n {\n\t\treturn in_array('update', $user->permissibles('vip'));\n }", "public function update(User $user)\n {\n if ($user->can('update_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n\t{\n\t\treturn current_user()->hasValidCoffeeShop();\n\t}", "public function update(User $user)\n {\n if ($user->can('update plans')) {\n return true;\n }\n }", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "public function isUpdateRequired();", "public function authorize(): bool\n {\n return Auth::check() && Auth::user()->can('web.user.transcripts.update');\n }", "public function is_user_usage_limit_valid( $is_valid = false, $coupon = null, $discounts = null ) {\n\n\t\t\tif ( is_admin() && ( ! defined( 'DOING_AJAX' ) || DOING_AJAX !== true ) ) {\n\t\t\t\treturn $is_valid;\n\t\t\t}\n\n\t\t\tif ( true !== $is_valid ) {\n\t\t\t\treturn $is_valid;\n\t\t\t}\n\n\t\t\tglobal $wpdb;\n\n\t\t\tif ( $this->is_wc_gte_30() ) {\n\t\t\t\t$coupon_id = ( is_object( $coupon ) && is_callable( array( $coupon, 'get_id' ) ) ) ? $coupon->get_id() : 0;\n\t\t\t} else {\n\t\t\t\t$coupon_id = ( ! empty( $coupon->id ) ) ? $coupon->id : 0;\n\t\t\t}\n\n\t\t\t$for_new_user = get_post_meta( $coupon_id, 'sc_restrict_to_new_user', true );\n\n\t\t\tif ( 'yes' === $for_new_user ) {\n\n\t\t\t\t$user_id_1 = 0;\n\t\t\t\t$user_id_2 = 0;\n\t\t\t\t$user_id_3 = 0;\n\n\t\t\t\t$current_user = wp_get_current_user();\n\n\t\t\t\t$email = ( ! empty( $current_user->data->user_email ) ) ? $current_user->data->user_email : '';\n\n\t\t\t\t$email = ( ! empty( $_REQUEST['billing_email'] ) ) ? sanitize_email( wp_unslash( $_REQUEST['billing_email'] ) ) : $email; // phpcs:ignore\n\n\t\t\t\tif ( ! empty( $email ) && is_email( $email ) ) {\n\n\t\t\t\t\t$user_id_1 = wp_cache_get( 'wc_sc_user_id_by_user_email_' . sanitize_key( $email ), 'woocommerce_smart_coupons' );\n\t\t\t\t\tif ( false === $user_id_1 ) {\n\t\t\t\t\t\t$user_id_1 = $wpdb->get_var( // phpcs:ignore\n\t\t\t\t\t\t\t$wpdb->prepare(\n\t\t\t\t\t\t\t\t\"SELECT ID\n\t\t\t\t\t\t\t\t\tFROM {$wpdb->prefix}users\n\t\t\t\t\t\t\t\t\tWHERE user_email = %s\",\n\t\t\t\t\t\t\t\t$email\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\twp_cache_set( 'wc_sc_user_id_by_user_email_' . sanitize_key( $email ), $user_id_1, 'woocommerce_smart_coupons' );\n\t\t\t\t\t\t$this->maybe_add_cache_key( 'wc_sc_user_id_by_user_email_' . sanitize_key( $email ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$user_id_2 = wp_cache_get( 'wc_sc_user_id_by_billing_email_' . sanitize_key( $email ), 'woocommerce_smart_coupons' );\n\t\t\t\t\tif ( false === $user_id_2 ) {\n\t\t\t\t\t\t$user_id_2 = $wpdb->get_var( // phpcs:ignore\n\t\t\t\t\t\t\t$wpdb->prepare(\n\t\t\t\t\t\t\t\t\"SELECT user_id\n\t\t\t\t\t\t\t\t\tFROM {$wpdb->prefix}usermeta\n\t\t\t\t\t\t\t\t\tWHERE meta_key = %s\n\t\t\t\t\t\t\t\t\t\tAND meta_value = %s\",\n\t\t\t\t\t\t\t\t'billing_email',\n\t\t\t\t\t\t\t\t$email\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\twp_cache_set( 'wc_sc_user_id_by_billing_email_' . sanitize_key( $email ), $user_id_2, 'woocommerce_smart_coupons' );\n\t\t\t\t\t\t$this->maybe_add_cache_key( 'wc_sc_user_id_by_billing_email_' . sanitize_key( $email ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$user_id_3 = get_current_user_id();\n\n\t\t\t\t$user_ids = array( $user_id_1, $user_id_2, $user_id_3 );\n\t\t\t\t$user_ids = array_unique( array_filter( $user_ids ) );\n\n\t\t\t\tif ( ! empty( $user_ids ) ) {\n\n\t\t\t\t\t$unique_user_ids = array_unique( $user_ids );\n\n\t\t\t\t\t$order_id = wp_cache_get( 'wc_sc_order_for_user_id_' . implode( '_', $unique_user_ids ), 'woocommerce_smart_coupons' );\n\n\t\t\t\t\tif ( false === $order_id ) {\n\t\t\t\t\t\t$query = $wpdb->prepare(\n\t\t\t\t\t\t\t\"SELECT ID\n\t\t\t\t\t\t\t\tFROM $wpdb->posts AS p\n\t\t\t\t\t\t\t\tLEFT JOIN $wpdb->postmeta AS pm\n\t\t\t\t\t\t\t\t\tON ( p.ID = pm.post_id AND pm.meta_key = %s )\n\t\t\t\t\t\t\t\tWHERE p.post_type = %s\n\t\t\t\t\t\t\t\t\tAND p.post_status IN ( %s, %s )\",\n\t\t\t\t\t\t\t'_customer_user',\n\t\t\t\t\t\t\t'shop_order',\n\t\t\t\t\t\t\t'wc-processing',\n\t\t\t\t\t\t\t'wc-completed'\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$how_many_user_ids = count( $user_ids );\n\t\t\t\t\t\t$id_placeholder = array_fill( 0, $how_many_user_ids, '%s' );\n\n\t\t\t\t\t\t// phpcs:disable\n\t\t\t\t\t\t$query .= $wpdb->prepare(\n\t\t\t\t\t\t\t' AND pm.meta_value IN (' . implode( ',', $id_placeholder ) . ')',\n\t\t\t\t\t\t\t$user_ids\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// phpcs:enable\n\n\t\t\t\t\t\t$order_id = $wpdb->get_var( $query ); // phpcs:ignore\n\n\t\t\t\t\t\twp_cache_set( 'wc_sc_order_for_user_id_' . implode( '_', $unique_user_ids ), $order_id, 'woocommerce_smart_coupons' );\n\t\t\t\t\t\t$this->maybe_add_cache_key( 'wc_sc_order_for_user_id_' . implode( '_', $unique_user_ids ) );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $order_id ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} elseif ( ! empty( $email ) ) {\n\n\t\t\t\t\t$order_id = wp_cache_get( 'wc_sc_order_id_by_billing_email_' . sanitize_key( $email ), 'woocommerce_smart_coupons' );\n\n\t\t\t\t\tif ( false === $order_id ) {\n\t\t\t\t\t\t$order_id = $wpdb->get_var( // phpcs:ignore\n\t\t\t\t\t\t\t$wpdb->prepare(\n\t\t\t\t\t\t\t\t\"SELECT ID\n\t\t\t\t\t\t\t\t\tFROM $wpdb->posts AS p\n\t\t\t\t\t\t\t\t\tLEFT JOIN $wpdb->postmeta AS pm\n\t\t\t\t\t\t\t\t\t\tON ( p.ID = pm.post_id AND pm.meta_key = %s )\n\t\t\t\t\t\t\t\t\tWHERE p.post_type = %s\n\t\t\t\t\t\t\t\t\t\tAND pm.meta_value = %s\",\n\t\t\t\t\t\t\t\t'_billing_email',\n\t\t\t\t\t\t\t\t'shop_order',\n\t\t\t\t\t\t\t\t$email\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\twp_cache_set( 'wc_sc_order_id_by_billing_email_' . sanitize_key( $email ), $order_id, 'woocommerce_smart_coupons' );\n\t\t\t\t\t\t$this->maybe_add_cache_key( 'wc_sc_order_id_by_billing_email_' . sanitize_key( $email ) );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $order_id ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $is_valid;\n\t\t}", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'coupon_type' => 'required',\n 'coupon_code' => 'required|between:4,20|alpha_num',\n 'coupon_value' => 'required',\n 'coupon_count' => 'required',\n 'start_date' => 'required',\n 'end_date' => 'required',\n ]);\n \n if(Auth::guard('restaurant')->id())\n {\n $res_id= Auth::guard('restaurant')->id();\n }\n else if(Auth::guard('manager')->id())\n {\n $manager = Auth::guard('manager')->user();\n $res_id=$manager->restaurant_id;\n $user_type=$manager->user_type;\n $perms=get_admin_module_permission($res_id,$user_type,'coupon');\n\n if(isset($perms))\n {\n if($perms->update)\n {}\n else{\n return view('admin.nopermission')->with('error', 'Permission Denied');\n } \n }\n }\n else{\n return redirect('admin');\n }\n\n\n // $res_id = Auth::guard('restaurant')->id();\n $request['restaurant_id']=$res_id;\n $check_title = Coupon::where([\n ['title', ucwords(strtolower($request->title))],\n ['restaurant_id', $res_id],\n ['id','!=',$id]\n ])->first();\n \n $check_code = Coupon::where([\n ['coupon_code',$request->coupon_code],\n ['restaurant_id', $res_id],\n ['id','!=',$id]\n ])->first();\n\n if ($check_title) {\n return redirect()->back()->withInput($request->input())->with('error', 'Title already exists');\n }\n\n if ($check_code) {\n return redirect()->back()->withInput($request->input())->with('error', 'Coupon Code already exists');\n }\n \n $enabled = $request->enabled == 'on' ? 1 : 0;\n $request['title']=ucwords(strtolower($request->title));\n $request['enabled'] = $enabled;\n $request['count'] = $request->coupon_count;\n Coupon::where('id',$id)->update($request->only('restaurant_id','title','description','coupon_code','coupon_value','coupon_type','count','max_discount','start_date','end_date','enabled'));\n\n return redirect()->back()->with('success', 'Updated Successfully');\n }", "function canUpdateUser($userid){\r\n\t\t$permissions = new dkpUserPermissions();\r\n\t\t$permissions->loadUserPermissions($userid);\r\n\r\n\t\t//make sure we are trying to edit a user who really belongs to our guild\r\n\t\tif($permissions->guildid != $this->guild->id || !$this->HasPermission(\"AccountSecondaryUsers\"))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }", "public function authorize()\n {\n return $this->user()->hasPermission('update-title');\n }", "public function view(User $user, Coupon $coupon)\n {\n return $coupon->user_id == NULL || $coupon->user_id = auth()->id();\n }", "public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }", "public function updatePolicy(User $user)\n {\n return $user->may(static::PERMISSION_UPDATE);\n }", "public function update(User $user)\n {\n return $user->hasPermissionTo('update campaign');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_MpAuction::auc_auto_bid_delete');\n }", "function validateCoupon()\n {\n if ($this->_couponCode != '') {\n $this->_coupon = $this->getDi()->couponTable->findFirstByCode($this->_couponCode);\n if (!$this->_coupon)\n return ___('No coupons found with such coupon code');\n $this->coupon_id = $this->_coupon->coupon_id;\n $this->coupon_code = $this->_coupon->code;\n }\n if (!empty($this->coupon_id)) {\n /* @var $variable Coupon */\n $coupon = $this->getCoupon();\n if ($error = $coupon->validate(@$this->user_id))\n return $error;\n\n $activeProductIds = $expiredProductIds = array();\n if ($this->_user) {\n $activeProductIds = $this->_user->getActiveProductIds();\n $expiredProductIds = $this->_user->getExpiredProductIds();\n }\n if ($error = $coupon->checkRequirements($this->getProducts(), $activeProductIds, $expiredProductIds))\n return current($error);\n }\n }", "public function canAdminCharge()\n\t{\n\t\t$settings = json_decode( $this->settings, TRUE );\n\t\treturn ( $settings['method'] === 'AIM' );\n\t}", "public function update(Request $request, Coupon $coupon)\n {\n //\n }", "public function update(Request $request, Coupon $coupon)\n {\n //\n }", "public function update(Request $request, Coupon $coupon)\n {\n //\n }", "public function update(Request $request, Coupon $coupon)\n {\n //\n }", "public function view(User $user, Coupon $coupon)\n {\n return $user->isAdmin();\n }", "private function _validateCoupon($validIfNotExists = true)\n\t{\n\t\tstatic $couponCode = null;\n\t\tstatic $valid = false;\n\t\tstatic $couponid = null;\n\n\t\t$state = $this->getStateVariables();\n\t\t$this->_coupon_id = null;\n\n\t\tif($state->coupon) {\n\t\t\tif($state->coupon == $couponCode) {\n\t\t\t\t$this->_coupon_id = $valid ? $couponid : null;\n\t\t\t\treturn $valid;\n\t\t\t}\n\t\t}\n\n\t\t$valid = $validIfNotExists;\n\t\tif($state->coupon) {\n\t\t\t$couponCode = $state->coupon;\n\t\t\t$valid = false;\n\n\t\t\t$coupon = FOFModel::getTmpInstance('Coupons','AkeebasubsModel')\n\t\t\t\t->coupon(strtoupper($state->coupon))\n\t\t\t\t->getFirstItem();\n\t\t\tif(empty($coupon->akeebasubs_coupon_id)) $coupon = null;\n\n\t\t\tif(is_object($coupon)) {\n\t\t\t\t$valid = false;\n\t\t\t\tif($coupon->enabled && (strtoupper($coupon->coupon) == strtoupper($couponCode)) ) {\n\t\t\t\t\t// Check validity period\n\t\t\t\t\tJLoader::import('joomla.utilities.date');\n\t\t\t\t\t$jFrom = new JDate($coupon->publish_up);\n\t\t\t\t\t$jTo = new JDate($coupon->publish_down);\n\t\t\t\t\t$jNow = new JDate();\n\n\t\t\t\t\t$valid = ($jNow->toUnix() >= $jFrom->toUnix()) && ($jNow->toUnix() <= $jTo->toUnix());\n\n\t\t\t\t\t// Check levels list\n\t\t\t\t\tif($valid && !empty($coupon->subscriptions)) {\n\t\t\t\t\t\t$levels = explode(',', $coupon->subscriptions);\n\t\t\t\t\t\t$valid = in_array($state->id, $levels);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check user\n\t\t\t\t\tif($valid && $coupon->user) {\n\t\t\t\t\t\t$user_id = JFactory::getUser()->id;\n\t\t\t\t\t\t$valid = $user_id == $coupon->user;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check user group levels\n\t\t\t\t\tif ($valid && !empty($coupon->usergroups)) {\n\t\t\t\t\t\t$groups = explode(',', $coupon->usergroups);\n\t\t\t\t\t\t$ugroups = JFactory::getUser()->getAuthorisedGroups();\n\t\t\t\t\t\t$valid = 0;\n\t\t\t\t\t\tforeach($ugroups as $ugroup) {\n\t\t\t\t\t\t\tif(in_array($ugroup, $groups)){\n\t\t\t\t\t\t\t\t$valid = 1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check hits limit\n\t\t\t\t\tif($valid && $coupon->hitslimit) {\n\t\t\t\t\t\t// Get the real coupon hits\n\t\t\t\t\t\t$hits = FOFModel::getTmpInstance('Subscriptions','AkeebasubsModel')\n\t\t\t\t\t\t\t->savestate(0)\n\t\t\t\t\t\t\t->coupon_id($coupon->akeebasubs_coupon_id)\n\t\t\t\t\t\t\t->paystate('C')\n\t\t\t\t\t\t\t->limit(0)\n\t\t\t\t\t\t\t->limitstart(0)\n\t\t\t\t\t\t\t->getTotal();\n\t\t\t\t\t\tif($coupon->hitslimit >= 0) {\n\t\t\t\t\t\t\t$valid = $hits < $coupon->hitslimit;\n\t\t\t\t\t\t\tif(($coupon->hits != $hits) || ($hits >= $coupon->hitslimit)) {\n\t\t\t\t\t\t\t\t$coupon->hits = $hits;\n\t\t\t\t\t\t\t\t$coupon->enabled = $hits < $coupon->hitslimit;\n\t\t\t\t\t\t\t\t$coupon->store();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check user hits limit\n\t\t\t\t\tif($valid && $coupon->userhits && !JFactory::getUser()->guest) {\n\t\t\t\t\t\t$user_id = JFactory::getUser()->id;\n\t\t\t\t\t\t// How many subscriptions with a paystate of C,P for this user\n\t\t\t\t\t\t// are using this coupon code?\n\t\t\t\t\t\t$hits = FOFModel::getTmpInstance('Subscriptions','AkeebasubsModel')\n\t\t\t\t\t\t\t->savestate(0)\n\t\t\t\t\t\t\t->coupon_id($coupon->akeebasubs_coupon_id)\n\t\t\t\t\t\t\t->paystate('C,P')\n\t\t\t\t\t\t\t->user_id($user_id)\n\t\t\t\t\t\t\t->limit(0)\n\t\t\t\t\t\t\t->limitstart(0)\n\t\t\t\t\t\t\t->getTotal();\n\t\t\t\t\t\t$valid = $hits < $coupon->userhits;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$valid = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->_coupon_id = $valid ? $couponid : null;\n\t\treturn $valid;\n\t}", "public function update(User $user, Taxon $taxon)\n {\n return $user->hasRole('admin') || $taxon->isCuratedBy($user);\n }", "protected function check_update_permission($post)\n {\n }", "protected function check_update_permission($post)\n {\n }", "public function authorize()\n {\n return (\\Auth::user()->hasRole('admin')) || (\\Auth::user()->hasRole('editor')) || \\Auth::user()->canDo('UPDATE_POLLS');\n }", "public function update(Request $request, Coupon $coupon)\n {\n if (Auth::user()->cant('update', $coupon)) {\n return redirect()->route('admin.home')->with(['message'=>'You don\\'t have permissions']);\n }\n $rules = [\n 'code' => 'required|unique:coupons,code,'.$coupon->id,\n 'value' => 'required|numeric|min:0.01',\n 'expire' => 'date_format:\"d.m.Y\"|nullable',\n 'min_order_price' => 'numeric|nullable|min:0.01',\n 'max_usages' => 'integer|nullable|min:0',\n ];\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return redirect()->route('coupons.edit', ['id'=>$coupon->id])->withErrors($validator)->withInput();\n }\n\n $coupon->code = $request->get('code');\n $coupon->value = $request->get('value');\n $coupon->type = $request->get('type');\n $coupon->expire = $request->get('expire');\n $coupon->min_order_price = $request->get('min_order_price');\n $coupon->max_usages = $request->get('max_usages');\n $coupon->save();\n return redirect()->route('coupons.edit', ['id'=>$coupon->id]);\n }", "public function canUpdateKount()\n {\n return !Mage::registry('kount_ens_update')\n && Mage::getStoreConfig('payment/gene_braintree_creditcard/kount_merchant_id')\n && Mage::getStoreConfig('payment/gene_braintree_creditcard/kount_api_key');\n }", "public function canBeUpdated()\n {\n return $this->isNotYetSubmitted();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_VendorsProfileNotification::manage_process');\n }", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserSaveVersion();\n break;\n case 'delete':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion();\n break;\n case 'massDeleteRevisions':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteRevision();\n break;\n default:\n return Mage::getSingleton('admin/session')->isAllowed('cms/page');\n break;\n }\n }", "function canEdit($user) {\n if($user->getId() == $this->getId()) {\n return true; // user can change his own account\n } // if\n\n return $user->isCompanyManager($this->getCompany());\n }", "public function form_is_available_to_update_customers()\n {\n\n }", "public function update(User $user): bool\n {\n return $user->can('Update Role');\n }", "public function update(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:update')\n );\n }", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('admin/session')->isAllowed('requestprice/manage/save');\n break;\n case 'delete':\n return Mage::getSingleton('admin/session')->isAllowed('requestprice/manage/delete');\n default:\n return Mage::getSingleton('admin/session')->isAllowed('requestprice/manage');\n }\n }", "public function canAdminCharge()\n {\n $settings = json_decode($this->settings, TRUE);\n return ($settings['method'] === 'direct');\n }", "#[Pure]\n public function update(User $user, Client $oAuthClient): bool\n {\n return $user->noTokenOrTokenCan('update-oauth_clients')\n && $oAuthClient->isOwner($user);\n }", "public function delete(User $user, Coupon $coupon)\n {\n return $user->isAdmin();\n }", "public function update(User $user, User $model)\n {\n $userAbility =\n auth()->user()->can(['user-update','user-manage'])&&\n auth()->user()->cannot(['user-manageBan']);\n\n return $userAbility;\n }", "public function updateCreditStatus()\n {\n $return = false;\n $updateQuery = \"update users set deposit_status='LIVE' where id='\" .\n $this->_user['id'] . \"' AND brand='\" . $this->_session['brand'] . \"'\";\n if(mysql_query($updateQuery)) {\n $return = true;\n }\n return $return;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(\n Templates::ADMIN_RESOURCE_SAVE\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 }" ]
[ "0.73519367", "0.7034736", "0.70057094", "0.69838256", "0.69304764", "0.6897762", "0.68903756", "0.6821744", "0.6800291", "0.6798615", "0.67777663", "0.6767162", "0.6725232", "0.6714436", "0.6696566", "0.6641731", "0.6591711", "0.65914595", "0.65504783", "0.6503364", "0.64990884", "0.64663094", "0.644995", "0.6404644", "0.6399986", "0.6386798", "0.6385501", "0.63779116", "0.6305623", "0.6296962", "0.62920046", "0.62809503", "0.6271443", "0.62164325", "0.621483", "0.6205919", "0.61982703", "0.61982703", "0.61982703", "0.61982703", "0.61982703", "0.61982703", "0.61982703", "0.61982703", "0.61982703", "0.6196828", "0.61953276", "0.61783063", "0.61664826", "0.6161267", "0.6153546", "0.61452466", "0.6134297", "0.61037236", "0.6092694", "0.6078576", "0.60687757", "0.6065527", "0.60191613", "0.6009961", "0.60070527", "0.60070527", "0.6000937", "0.5994888", "0.59887487", "0.5983079", "0.5968973", "0.5968346", "0.5961475", "0.5953283", "0.59223855", "0.5919542", "0.5919542", "0.5919542", "0.5919542", "0.5918049", "0.5911865", "0.5885454", "0.5881815", "0.5881815", "0.58772296", "0.5877206", "0.587711", "0.5868664", "0.5862279", "0.5862279", "0.5861401", "0.58576864", "0.5835346", "0.5829117", "0.58286536", "0.58269536", "0.5826831", "0.5825647", "0.58254486", "0.58245105", "0.5822334", "0.5819434", "0.5806006", "0.57991236" ]
0.75852114
0
Determine whether the user can delete the coupon.
public function delete(User $user, Coupon $coupon) { return $user->isAdmin(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canDelete()\n {\n $user = $this->getUser();\n\n if ($user->getData('role') == 'Admin' && $this->getData('status') != Service\\BalanceWithdrawals::STATUS_PENDING) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = $this->user();\n if(!$user){\n return false;\n }\n\n return $user->can('create',Coupon::class);\n }", "function canDelete(User $user) {\n return $user->isFinancialManager();\n }", "public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }", "function canDelete($user) {\n if($this->isOwner() || $user->getCompanyId() == $this->getId()) {\n return false; // Owner company cannot be deleted. Also, user cannot delete company he belongs to\n } // if\n return $user->isPeopleManager();\n }", "function canDelete() {\n return true;\n }", "public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }", "protected function canApplyCoupon()\n {\n if (!$this->coupon->exists) {\n return false;\n }\n\n if (!$this->isCouponUsableBySpace()) return false;\n\n if (!$this->isCouponUsableByCustomer()) return false;\n\n return true;\n }", "public function canDelete()\n {\n return 1;\n }", "public function authorize()\n {\n $this->reusablePayment = FetchReusablePayment::run([\n 'encoded_id' => $this->encoded_id,\n ]);\n\n return $this->user()->can('delete', $this->reusablePayment);\n }", "function canDelete(User $user) {\n return $user->canManageTrash();\n }", "public function canDelete()\n {\n return in_array('delete', $this->actions);\n }", "public function canDelete()\n {\n return Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() );\n }", "public function canDelete()\n {\n $exist = $this->getModelObj('permission')->where(['resource_code' => $this->code, 'app' => $this->app])->first();\n if ($exist) {\n return false;\n }\n return true;\n }", "public function canDelete()\n {\n return $this->canGet();\n }", "protected function canDelete() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS_DELETE, $this->getEmptyComment());\n }", "public function delete(User $user)\n {\n return $user->can('delete_customer');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webiators_DeleteOrdersFromAdmin::delete_order');\n }", "function canDelete($user) {\n if($this->getId() == $user->getId()) {\n return false; // user cannot delete himself\n } // if\n\n if($this->isAdministrator() && !$user->isAdministrator()) {\n return false; // only administrators can delete administrators\n } // if\n\n return $user->isPeopleManager();\n }", "function CanDelete()\n\t{\treturn !count($this->subpages) && $this->CanAdminUserDelete();\n\t}", "public function authorize()\n {\n return $this->can('delete');\n }", "public function authorize(): bool\n {\n return Gate::allows('admin.genero.delete', $this->genero);\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_MpAuction::auc_auto_bid_delete');\n }", "public function authorize()\n {\n// return Gate::allows('admin.discount.delete', $this->discount);\n return true;\n }", "public function hasCoupon()\n {\n return (bool)$this->coupon_id;\n }", "public function delete(User $user)\n {\n if($user->can('carts-delete') || $user->can('cart-delete')) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if (env('APP_ENV') == 'testing') {\n return true;\n }\n\n return tenant(auth()->user()->id)->hasPermissionTo('delete fixed asset');\n }", "public function delete(User $user, Coupon $coupon)\n {\n //\n }", "private function canDelete()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "function CanDelete()\n\t{\t\n\t\t\n\t\tif ($this->id && !$this->GetLocations() && $this->CanAdminUserDelete())\n\t\t{\n\t\t\t// courses\n\t\t\t$sql = \"SELECT cid FROM courses WHERE city=\" . (int)$this->id;\n\t\t\tif ($result = $this->db->Query($sql))\n\t\t\t{\tif ($this->db->NumRows($result))\n\t\t\t\t{\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "public function getCanDeleteProperty()\n {\n return $this->deleteConfirm === $this->staff->email;\n }", "public function isDeleteGranted($entity): bool;", "public function is_allowed_to_delete_feedback($feedback);", "public function delete(User $user, AreaPricing $area_pricing)\n {\n return $user->isAdmin() || $user->isSupervisor();\n }", "public function canDelete(ConclusionInterface $conclusion);", "public function delete(User $user)\n {\n if ($user->can('delete_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Training_Vendor::main_index_delete');\n }", "public function authorize()\n {\n $represent = $this->getRepresent();\n\n return $represent->can('delete')\n && $represent->exists($this->route('id'));\n }", "public function delete(User $user, OrderProduct $orderProduct)\n {\n return $user->isAdmin() || $user->is($orderProduct->coupon->user);\n }", "public function delete(User $user)\n {\n return $user->role->can_delete_post == 1;\n }", "public function allowDeletion()\n {\n return $this->allowDeletion;\n }", "public function authorize()\n\t{\n\t\treturn current_user()->hasValidCoffeeShop();\n\t}", "public function delete(User $user, Taxon $taxon)\n {\n return $user->hasRole('admin') || $taxon->isCuratedBy($user);\n }", "public function authorize()\n {\n abort_if(Gate::denies('comment_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n return false;\n }", "public function canCancel()\n {\n $user = $this->getUser();\n\n if (\n $user['id'] == $this->getData('user_id') &&\n $this->getData('status') == Service\\BalanceWithdrawals::STATUS_PENDING\n ) {\n if ($user->getData('role') == 'Admin' || $user['id'] == $this->getData('user_id')) {\n return true;\n }\n }\n\n return false;\n }", "public function delete(User $user)\n {\n $test = DB::table('permissions')->get()->first();\n if ($test->delete_commande and $test->id_user == $user->id){\n return true;\n }else{\n return false;\n }\n }", "public function canDelete($item)\n {\n return false;\n }", "public function canDelete($item)\n {\n return false;\n }", "public function canDelete($member = null) {\n\t\treturn ($this->Code == 'DEFAULT') ? false : Permission::check('Product_CANCRUD');\n\t}", "protected function hasActiveUserDeletePermissionForThisUser()\n {\n if (true === $this->bAllowEditByAll) {\n return true;\n }\n if (true === $this->IsOwner()) {\n return false;\n }\n /** @var SecurityHelperAccess $securityHelper */\n $securityHelper = ServiceLocator::get(SecurityHelperAccess::class);\n\n if (false === $securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_DELETE, $this->oTableConf->fieldName)) {\n return false;\n }\n\n if (true === $securityHelper->isGranted(CmsUserRoleConstants::CMS_ADMIN)) {\n return true;\n }\n\n if ($this->sId === $securityHelper->getUser()?->getId()) {\n // you cannot delete yourself.\n return false;\n }\n\n $oTargetUser = TdbCmsUser::GetNewInstance($this->sId);\n\n // Also, the user may only delete users that have at least one portal in common.\n $userPortals = $securityHelper->getUser()?->getPortals();\n if (null === $userPortals) {\n $userPortals = [];\n }\n $allowedPortals = array_keys($userPortals);\n $portalsOfTargetUser = $oTargetUser->GetFieldCmsPortalIdList();\n\n return 0 === \\count($portalsOfTargetUser) ||\n \\count(array_intersect($allowedPortals, $portalsOfTargetUser)) > 0;\n }", "private function can_remove() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'remove' &&\n $this->backupFileExists() &&\n current_user_can( 'manage_options' );\n\n }", "public function canDelete()\n {\n if ( !SimpleForumTools::checkAccess($this->forumNode(), 'topic', 'remove') )\n {\n \treturn false;\n }\n \t\n return true;\n }", "public function forceDelete(User $user, Coupon $coupon)\n {\n //\n }", "public function destroy(Coupon $coupon)\n {\n if (Auth::user()->cant('delete', $coupon)) {\n return redirect()->route('admin.home')->with(['message'=>'You don\\'t have permissions']);\n }\n Coupon::destroy($coupon->id);\n return redirect(url()->previous());\n }", "protected function canDelete()\n {\n if (!Validate::isLoadedObject($this)) {\n return true;\n }\n\n /** @var Gamifications $module */\n $module = Module::getInstanceByName('gamifications');\n $em = $module->getEntityManager();\n\n /** @var GamificationsRewardRepository $rewardRepository */\n $rewardRepository = $em->getRepository(__CLASS__);\n $isInUse = $rewardRepository->isRewardInUse($this->id);\n\n return !$isInUse;\n }", "protected function check_delete_permission($post)\n {\n }", "function userCanDeleteUser( $sessionID, $username ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "private function canDelete(Customer $customer, User $user)\n {\n return $user === $customer->getUser();\n }", "public function deleteAny(User $user)\n {\n return $user->can('delete_any_customer');\n }", "public function canDelete()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'delete' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function canDelete($member = null)\n {\n $MemberID = Member::currentUserID();\n\n return $this->CompanyAdminID == $MemberID || Permission::check(\"DELETE_COMPANY\") || $this->PermissionCheck(array(\"DELETE_COMPANY\"));\n }", "public function delete(User $user, Country $country)\n {\n return $this->userRoleCan($user, 'country-delete');\n }", "private function canDelete(Cinema $cinema, TokenInterface $token): bool\n {\n if (!$this->mayHallsBeDeleted($cinema, $token)) {\n return false;\n }\n\n return true;\n }", "protected function _can_delete($delete_id) {\r\n return true;\r\n }", "public function deleted(User $user)\n {\n\n return isAllowed($user, 'bankaccount-deleted');\n }", "private function canDelete(User $user, ?Place $place): bool\n {\n return $this->canEdit($user, $place);\n }", "public function delete(Authorizable $user, Withdraw $withdraw)\n {\n return true;\n }", "protected function _can_delete($delete_id) {\n\t\treturn TRUE;\n\t}", "protected function _can_delete($delete_id) {\n\t\treturn TRUE;\n\t}", "public function delete(User $user): bool\n {\n return $user->can('Delete Role');\n }", "public function delete(User $user)\n {\n if ($user->can('delete plans')) {\n return true;\n }\n }", "protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t\treturn Factory::getUser()->authorise(\"core.delete\", \"com_bookingmanager.customer.\" . $record->id);\n\t\t}\n\t}", "public function canDelete()\n {\n $translate = $this->getTranslate();\n\n if ($this->_usedInSales()) {\n return $translate->_('This store location cannot be removed because it is used in an invoice.');\n }\n\n return true;\n }", "public function canDelete(IdentityInterface $user, sketch $sketch)\n {\n return true;\n }", "public function deletePolicy(User $user)\n {\n return $user->may(static::PERMISSION_DELETE);\n }", "public function deletePolicy(User $user)\n {\n return $user->may(static::PERMISSION_DELETE);\n }", "function userCanDeleteContact( $sessionID, $contactID ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "function userCanDeleteInterim( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 8;\r\n\t}", "public function canDeleteAssociate()\n {\n return $this->settings->MODULES['REW_ISA_MODULE']\n && $this->auth->isSuperAdmin();\n }", "public function delete(User $user)\n {\n return $user->hasPermission('user-delete');\n }", "public function can_destroy() {\n $query = DB::connection()->prepare('SELECT * FROM Customervisit WHERE customer_id=:id LIMIT 1');\n $query->execute(array('id' => $this->id));\n $row = $query->fetch();\n //There should be no customervisits for customer.\n return empty($row);\n }", "public function getCanDeleteAttribute()\n {\n // Are you the owner if the note?\n return Auth::id() == $this->user_id;\n }", "protected function _can_delete($delete_id)\n\t{\n\t\treturn TRUE;\n\t}", "protected function _can_delete($delete_id)\n\t{\n\t\treturn TRUE;\n\t}", "function canDelete($member = NULL)\n\t{\n\t\treturn true;\n\t}", "public function isDelete(): bool {}", "public function delete()\n {\n // Check P_DELETE\n if (!wcmSession::getInstance()->isAllowed($this, wcmPermission::P_DELETE))\n {\n $this->lastErrorMsg = _INSUFFICIENT_PRIVILEGES;\n return false;\n }\n\n if (!parent::delete())\n return false;\n \n // Erase permissions\n $project = wcmProject::getInstance();\n $sql = 'DELETE FROM #__permission WHERE target=?';\n $params = array($this->getPermissionTarget());\n $project->database->executeStatement($sql, $params);\n \n return true;\n\n }", "public function canDelete($member = null) {\n\t\treturn Permission::check('CMS_ACCESS_CMSMain');\n\t}", "public function authorizedToDelete(Request $request)\n {\n return false;\n }", "public function delete(User $user, BankAccount $bankAccount)\n {\n return isAllowed($user, 'bankaccount-delete');\n }", "public function delete(User $user, Area $area, Governorate $governorate)\n {\n return $user->isAdmin() && $governorate->is($area->governorate);\n }", "public function delete(User $user)\n {\n if ($this->role($user)){\n return $user->hasDirectPermission($this->permission_list['delete']);\n }\n }", "protected function confirmDeleteUser(){\n\t\tif (!\\Settings::ALLOW_USER_DELETION) {\n\t\t\tnew Alert('error', 'La suppression des comptes utilisateurs est interdite !');\n\t\t\treturn false;\n\t\t}\n\t\tif (UsersManagement::deleteUser($this->user)){\n\t\t\tnew Alert('success', (($this->user->getId() == $GLOBALS['cUser']->getId()) ? 'Votre compte' : 'Le compte de '.$this->user->getName()).' a été supprimé !');\n\t\t\treturn true;\n\t\t}else{\n\t\t\tnew Alert('error', 'Impossible de supprimer le compte utilisateur !');\n\t\t\treturn false;\n\t\t}\n\t}", "public function canBeDeletedBy($user)\n {\n if ( ! ($user instanceof User)) {\n return false;\n }\n \n if ($this->isOwnedBy($user)) {\n \n // Allow a User to delete their own Key regardless of status.\n return true;\n \n } elseif ($user->isAdmin()) {\n \n /* Only allow someone else to delete a User's Key if they have the\n * appropriate authority and the Key has already been \"terminated\"\n * (for lack of a better word). */\n switch ($this->status) {\n case self::STATUS_DENIED:\n case self::STATUS_REVOKED:\n return true;\n\n default:\n return false;\n }\n }\n \n return false;\n }", "function delete(){\n if($this->session->userdata['brands_per']['delete']==1){ // check permission of current user for delete purchase decomposition\n if($this->input->post('guid')){ \n $this->load->model('items');\n $guid=$this->input->post('guid');\n $status=$this->items->check_approve($guid);// check if the purchase decomposition was already apparoved or what\n if($status!=FALSE){\n $this->posnic->posnic_delete($guid,'decomposition'); // delete the purchase decomposition\n echo 'TRUE';\n }else{\n echo 'Approved';\n }\n \n }\n }else{\n echo 'FALSE';\n }\n \n}", "#[Pure]\n public function delete(User $user, Client $oAuthClient): bool\n {\n return $user->noTokenOrTokenCan('delete-oauth_clients')\n && $oAuthClient->isOwner($user);\n }", "public function delete(User $user)\n {\n return $user->hasPermissionTo('delete campaign');\n }", "public function delete(User $user, User $model)\n {\n $userAbility =\n auth()->user()->can(['user-delete','user-manage'])&&\n auth()->user()->cannot(['user-manageBan']);\n\n return $userAbility;\n }", "public function delete(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:delete')\n );\n }", "public function isDelete();" ]
[ "0.739681", "0.70783633", "0.70067054", "0.6989163", "0.6944121", "0.692288", "0.6892897", "0.6835907", "0.6821034", "0.67946357", "0.6789956", "0.6734321", "0.6701368", "0.6701184", "0.6678834", "0.666716", "0.6650466", "0.66484255", "0.65794325", "0.65410525", "0.65371186", "0.6528863", "0.64862126", "0.6473659", "0.6456704", "0.6446138", "0.6430911", "0.6398448", "0.63782585", "0.6331577", "0.62979484", "0.6292112", "0.6264612", "0.6258836", "0.62458533", "0.6240472", "0.62337816", "0.61944246", "0.61758685", "0.61606234", "0.6157694", "0.6143536", "0.6140972", "0.6132917", "0.6109641", "0.6107209", "0.60893416", "0.60893416", "0.60694903", "0.6069384", "0.60537505", "0.60500973", "0.60414535", "0.6038508", "0.6028778", "0.6024517", "0.6021806", "0.6018411", "0.60115945", "0.5993184", "0.5990461", "0.5983366", "0.5977276", "0.5976942", "0.59722775", "0.5970261", "0.59520465", "0.5942207", "0.5942207", "0.5939662", "0.5939296", "0.5928504", "0.59132254", "0.5911477", "0.5911461", "0.5911461", "0.59097046", "0.59079355", "0.5898278", "0.5891842", "0.5891447", "0.5883072", "0.58772737", "0.58772737", "0.58474153", "0.58469784", "0.58449095", "0.5841831", "0.58399695", "0.5834016", "0.5831945", "0.58301455", "0.58230245", "0.5821858", "0.58129287", "0.5811458", "0.5810148", "0.58029944", "0.5797997", "0.5795326" ]
0.7517314
0
more quote request by client
public function moreQuoteClient(){ $this->addElement('text', 'more_quote_client_request', array ( "required" => TRUE, 'class' => 'form-control required', "label" => "How many more quote do you want?" , "maxlength"=>"2", "filters" => array("StringTrim","StripTags"), "validators" => array( array("NotEmpty",true,array("messages"=>"more quote number is required ")), ), )); $this->submitButton(); $this->bttnsubmit->setLabel("Request"); $this->bttnsubmit->setAttrib("class","site_button"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function quote()\n {\n $jiekou = Jiekou::where(['id'=>2])->first();\n while (1){\n $response = Curl::to($jiekou->url)\n ->get();\n $obj_xml = simplexml_load_string($response);\n $items = $obj_xml->Body->Deliver;\n if (!$obj_xml->Body->Deliver){\n break;\n } else {\n $jiekou->updated_at = \\Carbon\\Carbon::createFromTimeStamp(time(), 'Asia/Shanghai')->toDateTimeString();\n $jiekou->save();\n foreach($items as $item) {\n $sms = new Smss();\n $sms->jiekouid = $jiekou->id;\n $sms->caller = $item->Caller;\n $sms->msg = urldecode($item->Msg);\n $sms->deliverdate = str_replace(\"/\",\"-\",$item->DeliverDate);\n $sms->save();\n }\n }\n }\n }", "function fn_QuoteSubmission($quoteRequest){\n\t\t\t$params = $this->params;\n\t\t\t$wsdl \t= $this->wsdl;\n\t\t\t$responce = \"\";\n\t\t\ttry\t{\n\t\t\t\t$soap = new SoapClient($wsdl, $params);\n\t\t\t\t$args = array('token' => $this->token, 'quoteRequest' => $quoteRequest);\n\t\t\t\t$responce = $soap->QuoteSubmission($args);\n\t\t\t} \n\t\t\tcatch (SoapFault $e) {\n\t\t\t\t//$responce = \"\";\n\t\t\t \t//$responce = 'Caught exception:'.$e->getMessage().\"\\n\";\n\t\t\t \t\n\t\t\t \t$responce['faultcode'] \t\t= $e->faultcode;\n\t\t\t $responce['faultstring'] \t= $e->faultstring;\n\t\t\t $responce['faultactor'] \t= $e->faultactor;\n\t\t\t $responce['faultname'] \t\t= $e->faultname;\n\t\t\t $responce['headerfault'] \t= $e->headerfault;\n\t\t\t}\n\t\t\treturn $responce;\n\t\t}", "public function returnQuoteAction()\n {\n $this->_returnQuote();\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('success' => 1)));\n }", "function fn_QuoteGet($args){\n\t\t\t$params = $this->params;\n\t\t\t$wsdl \t= $this->wsdl;\n\t\t\t$responce = \"\";\n\t\t\ttry{\n\t\t\t\t$soap = new SoapClient($wsdl, $params);\n $args['token'] = $this->token;\n\t\t\t\t$responce = $soap->QuoteGet($args);\n\t\t\t} \n\t\t\tcatch (SoapFault $e){\n\t\t\t\t//$responce = \"\";\n\t\t\t \t//$responce = 'Caught exception:'.$e->getMessage().\"\\n\";\n\t\t\t \t\n\t\t\t \t$responce['faultcode'] \t\t= $e->faultcode;\n\t\t\t $responce['faultstring'] \t= $e->faultstring;\n\t\t\t $responce['faultactor'] \t= $e->faultactor;\n\t\t\t $responce['faultname'] \t\t= $e->faultname;\n\t\t\t $responce['headerfault'] \t= $e->headerfault;\n\t\t\t}\n\t\t\treturn $responce;\n\t\t}", "public function getQuote($request)\n {\n\n // $this->quoteAPIController->getQuote($request);\n // $this->quoteAPIController->getBoundaryQuotes($request);\n }", "public function quoteAction()\n {\n $result = array();\n \n try {\n \n //hash to get quote\n $hash = $this->getRequest()->getParam('hash');\n \n if (!$hash){\n //json post\n if ($postBody = file_get_contents('php://input')){\n \n $data = (array)json_decode($postBody);\n \n } else {\n \n $data = $this->getRequest()->getPost();\n }\n \n if (is_array($data) && count($data)>0){\n \n $model = $this->getModel();\n $productIdOrSku = $data['product'];\n $model->loadOptions($productIdOrSku);\n $result = $model->validateCartData($data);\n \n if (!$result['error']){\n \n $result = $model->addToCart($data);\n \n if (!$result['error']){\n \n $quoteUrl = Mage::getUrl('customconfigurable/index/quote/hash/'.$result['data']);\n $result = array('Location' => $quoteUrl);\n }\n }\n \n } else {\n \n $result['error'] = true;\n $result['data'] = 'No post data';\n }\n \n } else {\n \n $model = $this->getModel();\n $model->loadOptions();\n \n $result = $model->getQuote($hash);\n \n if (!$result['error']){ \n unset($result['error']);\n $result['hash'] = $hash;\n $result['quote'] = $result['data'];\n unset($result['data']);\n }\n \n }\n \n } catch (Exception $e) {\n \n $result['error'] = true;\n $result['data'] = $e->getMessage();\n }\n \n $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true)->setBody(Mage::helper('core')->jsonEncode($result));\n \n }", "public function quote($params)\n { \n return $this->request(Resource::RESOURCE_QUOTE,$params);\n }", "public function fetchRandomQuote()\n {\n try {\n $offset = rand(0, 5000);\n $endpoint = self::BASE_RANDOM_QUOTE_ENDPOINT . $offset;\n $apikey = strtr(\"Token apikey\", [\n 'apikey' => config('paper_quotes_api_key'),\n ]);\n\n $response = $this->client->get($endpoint, [\n 'headers' => [\n 'Authorization' => $apikey,\n ]\n ])->getBody();\n\n $data = json_decode($response);\n $message = strtr('_quote (by _author with _like like(s)).', [\n '_quote' => $data->results[0]->quote,\n '_author' => $data->results[0]->author === \"\" ? \"Anonymous\" : $data->results[0]->author,\n '_like' => $data->results[0]->likes,\n ]);\n\n return $message;\n } catch (Exception $exception) {\n return \"Error! Please try again\";\n }\n }", "abstract public function Quote($data);", "public function quote_request_new() {\n\t /*\t$step_one_sidebar = '<div class=\"col-md-2\">\n\t <div class=\"sidebar\">\n\t <h3>Talk TO A REPRESENTATIVE</h3>\n\t <div class=\"selection-container\">\n\t <ul>\n\t <li>1 (877) 589-2214 (US/Canada)<br/><a href=\"mailto:[email protected]\">[email protected]</a></li>\n\t </ul>\n\t \n\t </div>\n\t </div>\n\t </div>'; */ \n\t\t$step_four = 'test';\n\t //return $this->new_product_finder('quote_request', NULL, $step_four);\n\t\t$path = \\Drupal::request()->getpathInfo();\n $arg = explode('/', $path);\t\t\n $cur_page = $arg[1];\n\t\t\n\t\t$pid = $_GET['pid'];\n\t\t\n\t\t$newrfq = $fpage;\n\t\t//$newrfq = $step_four;\n\t\t\n\t\treturn array(\n\t '#theme' => 'quote_request',\n\t\t '#cur_page' => $cur_page,\n\t\t '#pid' => $pid,\n\t '#quote_related_products' => $step_four,\n\t );\n \t}", "public function getQuote();", "public function saveSendQuoteAction()\n\t{\n\t\tif($this->_request-> isPost() && $this->adminLogin->userId) \n {\n\t\t\t$final_parameters=$this->_request->getParams();\n\n\t\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\t\t//echo \"<pre>\";print_r($final_parameters);exit;\n\n\t\t\t//insert Quotes\n\t\t\t$quotes_data['title']=$this->quote_creation->create_mission['quote_title'];\n\t\t\t$quotes_data['client_id']=$this->quote_creation->create_step1['client_id'];\n\t\t\t$quotes_data['category']=$this->quote_creation->create_step1['category'];\n\t\t\tif($quotes_data['category']=='other')\n\t\t\t\t\t$quotes_data['category_other']=isodec($this->quote_creation->create_step1['category_other']);\n\t\t\tif($this->quote_creation->create_step1['client_websites'])\n\t\t\t$quotes_data['websites']=implode(\"|\",$this->quote_creation->create_step1['client_websites']);\n\t\t\t$quotes_data['quote_by']=$this->quote_creation->create_step1['quote_by'];\n\t\t\t$quotes_data['created_by']=$this->adminLogin->userId;\n\t\t\t$quotes_data['sales_suggested_price']=$this->quote_creation->select_missions['total_suggested_price'];\n\t\t\t$quotes_data['sales_suggested_currency']=$this->quote_creation->select_missions['currency'];\n\t\t\t$quotes_data['sales_comment']=$final_parameters['bo_comments'];\n\t\t\t$quotes_data['client_email_text']=$final_parameters['client_email'];\n\t\t\t//$quotes_data['documents_path']='path';\n\t\t\t$quotes_data['conversion']=$this->quote_creation->create_step1['conversion'];\n\n\t\t\t//$quotes_data['sales_delivery_time']=$final_parameters['delivery_time'];\n\t\t\t//$quotes_data['sales_delivery_time_option']=$final_parameters['delivery_option'];\n\t\t\t$quotes_data['client_know']=$final_parameters['client_know']? 'no':'yes';\n\t\t\t$quotes_data['urgent']=$final_parameters['urgent']? 'yes':'no';\n\t\t\t$quotes_data['urgent_comments']=$final_parameters['urgent_comments']?$final_parameters['urgent_comments']:NULL;\t\t\t\n\t\t\n\t\t\t/*$quotes_data['market_team_sent']=$final_parameters['market_team_sent'];\n\t\t\tif($quotes_data['market_team_sent']=='yes')\n\t\t\t\t$quotes_data['from_platform']=$final_parameters['from_platform'];*/\n\n\n\t\t\t//NEW QUOTE FILEDS \n\t\t\t$client_aims=$final_parameters['client_aims'];\n\t\t\t$quotes_data['client_aims']=implode(\",\",$client_aims);\n\n\t\t\tforeach($client_aims as $aim)\n\t\t\t{\n\t\t\t\t$client_prio[]=$final_parameters['priority_'.$aim];\n\t\t\t}\n\t\t\t$quotes_data['client_prio']=implode(\",\",$client_prio);\n\n\t\t\t$client_aims_comments=$final_parameters['client_aims_comments'];\n\t\t\t$quotes_data['client_aims_comments']=$client_aims_comments;\n\n\n\t\t\t$content_ordered_agency=$final_parameters['content_ordered_agency'];\n\t\t\t$quotes_data['content_ordered_agency']=$content_ordered_agency;\n\t\t\tif($content_ordered_agency=='yes')\n\t\t\t{\n\t\t\t\tif($final_parameters['agency']=='dont_know')\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['agency']=$final_parameters['agency'];\n\t\t\t\t\t$quotes_data['agency_name']='';\n\t\t\t\t}\n\t\t\t\telseif($final_parameters['agency_name'])\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['agency']='';\n\t\t\t\t\t$quotes_data['agency_name']=$final_parameters['agency_name'];\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse if($content_ordered_agency=='no')\n\t\t\t{\n\t\t\t\t$quotes_data['client_internal_team']=$final_parameters['client_internal_team'];\n\t\t\t}\n\n\t\t\t$quotes_data['client_know_writers']=$final_parameters['client_know_writers'];\n\n\t\t\t$volume_option=$final_parameters['volume_option'];\n\t\t\t$quotes_data['volume_option']=$volume_option;\n\t\t\tif($volume_option=='per')\n\t\t\t{\n\t\t\t\t$quotes_data['volume_option_multi']=$final_parameters['volume_option_multi'];\n\t\t\t}\n\t\t\telse if($volume_option=='every')\n\t\t\t{\n\t\t\t\t$quotes_data['volume_option_multi']=$final_parameters['volume_option_multi_every'];\n\t\t\t\t$quotes_data['volume_every']=$final_parameters['volume_every'];\n\t\t\t}\n\n\t\t\t$budget_marketing=$final_parameters['budget_marketing'];\n\t\t\tif($budget_marketing=='dont_know')\n\t\t\t{\n\t\t\t\t$quotes_data['budget_marketing']=$budget_marketing;\n\t\t\t\t$quotes_data['budget']='';\n\t\t\t\t$quotes_data['budget_currency']='';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$quotes_data['budget_marketing']='';\n\t\t\t\t$quotes_data['budget']=$final_parameters['budget'];\n\t\t\t\t$quotes_data['budget_currency']=$final_parameters['budget_currency'];\n\t\t\t}\n\n\n\t\t\t$quotes_data['estimate_sign_percentage']=$final_parameters['estimate_sign_percentage'];\n\t\t\t$quotes_data['estimate_sign_date']=$final_parameters['estimate_sign_date'];\n\t\t\t$quotes_data['estimate_sign_comments']=$final_parameters['estimate_sign_comments'];\n\n\t\t\t//echo \"<pre>\";print_r($quotes_data);exit;\n\n\t\t\t//Quote current version\n\t\t\tif($this->quote_creation->custom['version'])\n\t\t\t{\n\t\t\t\t$version=$this->quote_creation->custom['version'];\n\t\t\t}\n\t\t\telse\n\t\t\t\t$version=1;\n\t\t\t$quotes_data['version']=$version;\n\n\t\t\t//Getting Quote details if quote id available\n\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\tif($quoteIdentifier)\n\t\t\t{\n\t\t\t\t$quoteEditDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t$sales_review_staus=$quoteEditDetails[0]['sales_review'];\n\t\t\t}\n\t\t\t\n\n\t\t\t//check manager is on holiday or not\n\t\t\t$salesManager_holiday=$this->configval[\"sales_manager_holiday\"];\n\t\t\t$user_type=$this->adminLogin->type;\n\n\t\t\t\n\t\t\t//Staus of tech,seo,prod and sales\n\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')//new version quote\n\t\t\t{\n\t\t\t\tif(isset($final_parameters['send_low_quote']) OR isset($final_parameters['send_big_quote']) )\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['quote_send_team']=$final_parameters['quote_send_team'];\n\n\t\t\t\t\tif(($final_parameters['quote_send_team']=='send_sales_team'))\n\t\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t\t$quotes_data[\"sales_validation_expires\"]=time()+($this->configval['sales_validation_timeline']*60*60);\n\t\t\t\t\t\t$quotes_data['skip_prod_comments']=$final_parameters['skip_prod_comments'] ? $final_parameters['skip_prod_comments']:NULL;\n\t\t\t\t\t\t$prod_hours=$this->configval['sales_validation_timeline'];\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$onlySales=true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(($final_parameters['quote_send_team']=='send_tech_prod_team') || ($final_parameters['quote_send_team']=='send_tech_team'))\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\n\t\t\t\t\t\t\t$quotes_data['tech_timeline']=NULL;\n\t\t\t\t\t\t\t$quotes_data['tech_challenge_comments']='';\n\t\t\t\t\t\t\t$quotes_data['tech_challenge']='yes';\n\n\t\t\t\t\t\t\tif($final_parameters['quote_send_team']=='send_tech_prod_team')\n\t\t\t\t\t\t\t{//if tech & prod\n\t\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\t\n\t\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\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\telse if(($final_parameters['quote_send_team']=='send_seo_prod_team') || ($final_parameters['quote_send_team']=='send_seo_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\n\t\t\t\t\t\t\t$quotes_data['seo_timeline']=NULL;\n\t\t\t\t\t\t\t$quotes_data['seo_comments']='';\n\t\t\t\t\t\t\t$quotes_data['seo_challenge']='yes';\n\n\t\t\t\t\t\t\tif($final_parameters['quote_send_team']=='send_seo_prod_team')\n\t\t\t\t\t\t\t{//if seo & prod\n\t\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_tech_seo_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\n\t\t\t\t\t\t\t$quotes_data['seo_timeline']=NULL;\n\t\t\t\t\t\t\t$quotes_data['seo_comments']='';\n\t\t\t\t\t\t\t$quotes_data['seo_challenge']='yes';\n\n\t\t\t\t\t\t\t$quotes_data['tech_timeline']=NULL;\n\t\t\t\t\t\t\t$quotes_data['tech_challenge_comments']='';\n\t\t\t\t\t\t\t$quotes_data['tech_challenge']='yes';\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_prod_team'))\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\t\t\n\t\t\t\t\t\t\t$onlyProd=true;\n\t\t\t\t\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$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$quotes_data[\"response_time\"]=time()+($this->configval['quote_sent_timeline']*60*60);\n\t\t\t\t\t\t$prod_hours=($this->configval['prod_timeline']+$this->configval['sales_validation_timeline']);\n\t\t\t\t\t\t$quotes_data['skip_prod_comments']='';\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t$quote_end_hours=$this->configval['quote_end_time'];\n\t\t\t\t\t$quotes_data['quote_delivery_hours']=($prod_hours+$tech_seo_time+$quote_end_hours);\n\n\t\t\t\t\t//echo \"<pre>\";print_r($final_parameters);print_r($quotes_data);exit;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\telseif($this->quote_creation->custom['action']=='edit' && !$this->quote_creation->custom['create_new_version'] && $sales_review_staus!='to_be_approve') //quote edit\n\t\t\t{\n\t\t\t\tif(isset($final_parameters['send_low_quote']) OR isset($final_parameters['send_big_quote']) )\n\t\t\t\t{\n\t\t\t\t\t//$quotes_data['quote_send_team']=$final_parameters['quote_send_team'];\n\t\t\t\t\t\n\t\t\t\t\t$oldTechReview=$quoteEditDetails[0]['tec_review'];\n\t\t\t\t\t$oldSeoReview=$quoteEditDetails[0]['seo_review'];\n\t\t\t\t\t$oldProdReview=$quoteEditDetails[0]['prod_review'];\n\t\t\t\t\t$oldSalesReview=$quoteEditDetails[0]['sales_review'];\n\n\t\t\t\t\tif(($final_parameters['quote_send_team']=='send_sales_team'))\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$quotes_data[\"sales_validation_expires\"]=time()+($this->configval['sales_validation_timeline']*60*60);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(($final_parameters['quote_send_team']=='send_tech_prod_team') || ($final_parameters['quote_send_team']=='send_tech_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//restart tech review \n\t\t\t\t\t\t\tif($oldTechReview=='auto_skipped' || $oldTechReview=='skipped' || $oldTechReview=='not_done')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\n\t\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif($oldTechReview=='challenged' || $oldTechReview=='validated')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['tec_review']='challenged';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($final_parameters['quote_send_team']=='send_tech_prod_team')\n\t\t\t\t\t\t\t{//if tech & prod\n\t\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_seo_prod_team') || ($final_parameters['quote_send_team']=='send_seo_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//restart seo review \n\t\t\t\t\t\t\tif($oldSeoReview=='auto_skipped' || $oldSeoReview=='skipped' || $oldSeoReview=='not_done')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif($oldSeoReview=='challenged' || $oldSeoReview=='validated')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['seo_review']='challenged';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($final_parameters['quote_send_team']=='send_seo_prod_team')\n\t\t\t\t\t\t\t{//if seo & prod\n\t\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_tech_seo_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//restart seo/tech review\n\t\t\t\t\t\t\t//restart tech review \n\t\t\t\t\t\t\tif($oldTechReview=='auto_skipped' || $oldTechReview=='skipped' || $oldTechReview=='not_done')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\n\t\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif($oldTechReview=='challenged' || $oldTechReview=='validated')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['tec_review']='challenged';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//restart seo review \n\t\t\t\t\t\t\tif($oldSeoReview=='auto_skipped' || $oldSeoReview=='skipped' || $oldSeoReview=='not_done')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif($oldSeoReview=='challenged' || $oldSeoReview=='validated')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['seo_review']='challenged';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_prod_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//restart prod_review\n\t\t\t\t\t\t\tif($oldProdReview=='validated' || $oldProdReview=='auto_skipped' || $oldProdReview=='challenged' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_all_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//restart tech review \n\t\t\t\t\t\t\tif($oldTechReview=='auto_skipped' || $oldTechReview=='skipped' || $oldTechReview=='not_done')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\n\t\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif($oldTechReview=='challenged' || $oldTechReview=='validated')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['tec_review']='challenged';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//restart seo review \n\t\t\t\t\t\t\tif($oldSeoReview=='auto_skipped' || $oldSeoReview=='skipped' || $oldSeoReview=='not_done')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif($oldSeoReview=='challenged' || $oldSeoReview=='validated')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['seo_review']='challenged';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//restart prod_review\n\t\t\t\t\t\t\tif($oldProdReview=='validated' || $oldProdReview=='auto_skipped' || $oldProdReview=='challenged' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif($tech_seo_time)\n\t\t\t\t\t\t$quotes_data[\"response_time\"]=time()+($tech_seo_time*60*60);\n\t\t\t\t\t//echo \"<pre>\";print_r($quotes_data);exit;\n\t\t\t\t\t$edited=TRUE;\n\t\t\t\t}\t\n\t\t\t}\n\t\t\telse//quote creation v1\n\t\t\t{\n\t\t\t\tif(isset($final_parameters['send_low_quote']) OR isset($final_parameters['send_big_quote']) )\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['quote_send_team']=$final_parameters['quote_send_team'];\n\n\t\t\t\t\tif(($final_parameters['quote_send_team']=='send_sales_team')&&isset($final_parameters['send_low_quote']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='auto_skipped';\t\n\t\t\t\t\t\t$quotes_data['seo_review']='auto_skipped';\n\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t$onlySales=true;\n\t\t\t\t\t\t$quotes_data[\"sales_validation_expires\"]=time()+($this->configval['sales_validation_timeline']*60*60);\n\t\t\t\t\t\t$quotes_data['skip_prod_comments']=$final_parameters['skip_prod_comments']?$final_parameters['skip_prod_comments']:NULL;\n\t\t\t\t\t\t$prod_hours=$this->configval['sales_validation_timeline'];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\tif(($final_parameters['quote_send_team']=='send_tech_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='auto_skipped';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_seo_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='auto_skipped';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_tech_seo_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_tech_prod_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='auto_skipped';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_seo_prod_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='auto_skipped';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_prod_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='auto_skipped';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='auto_skipped';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\n\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\t\t\n\t\t\t\t\t\t\t$onlyProd=true;\n\t\t\t\t\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$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$quotes_data[\"response_time\"]=time()+($this->configval['quote_sent_timeline']*60*60);\n\t\t\t\t\t\t$prod_hours=($this->configval['prod_timeline']+$this->configval['sales_validation_timeline']);\n\t\t\t\t\t}\t\n\t\t\t\t\t$quote_end_hours=$this->configval['quote_end_time'];\n\t\t\t\t\t$quotes_data['quote_delivery_hours']=($prod_hours+$tech_seo_time+$quote_end_hours);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//quote to be approved if created by sales user when sales manager is available\n\t\t\t\tif(($salesManager_holiday=='no' && $user_type=='salesuser' && $quotes_data['sales_suggested_price']>=5000) || ($this->quote_creation->create_mission['producttypeautre']==TRUE && $user_type=='salesuser'))\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['sales_review']='to_be_approve';\n\t\t\t\t\t$send_manager_email=TRUE;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['sales_review']='not_done';\n\t\t\t\t\t$send_manager_email=FALSE;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t//echo \"<pre>\";print_r($quotes_data);exit;\n\n\n\t\t\t//versioning when edited validated quote\n\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')\n\t\t\t{\n\t\t\t\t//Insert this quote in to Quote version table\n\t\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\t\t\n\t\t\t\tif($quoteIdentifier)\n\t\t\t\t{\n\t\t\t\t\t$quote_obj->insertQuoteVersion($quoteIdentifier);\n\t\t\t\t\t\n\t\t\t\t\t//versioning Tech missions\n\t\t\t\t\t$techMissionObj=new Ep_Quote_TechMissions();\n\t\t\t\t\t$techParams['quote_id']=$quoteIdentifier;\n\t\t\t\t\t$techMissionsDetails=$techMissionObj->getTechMissionDetails($techParams);\n\t\t\t\t\tif($techMissionsDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($techMissionsDetails as $techMission)\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$techMissionId=$techMission['identifier'];\n\t\t\t\t\t\t\t$techMissionObj->insertMissionVersion($techMissionId);\n\n\t\t\t\t\t\t\t//update tech version\n\t\t\t\t\t\t\t$update_tech['version']=$version;\n\t\t\t\t\t\t\t$techMissionObj->updateTechMission($update_tech,$techMissionId);\n\t\t\t\t\t\t\t//if($quotes_data['tec_review']=='auto_skipped')\n\t\t\t\t\t\t\t\t//$techMissionObj->deleteTechMission($techMissionId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\n\t\t\t\t\t//versioning SEO missions\n\t\t\t\t\t$seoParameters['quote_id']=$quoteIdentifier;\n\t\t\t\t\t$seoParameters['misson_user_type']='seo';\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t$seoMissionDetails=$quoteMission_obj->getMissionDetails($seoParameters);\n\t\t\t\t\tif($seoMissionDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($seoMissionDetails as $seoMission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$seoMissionId=$seoMission['identifier'];\n\t\t\t\t\t\t\t$quoteMission_obj->insertMissionVersion($seoMissionId);\t\n\n\t\t\t\t\t\t\t//update seo mission version\n\t\t\t\t\t\t\t$update_seo['version']=$version;\n\t\t\t\t\t\t\t$quoteMission_obj->updateQuoteMission($update_seo,$seoMissionId);\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t//versioning Prod Missions\n\t\t\t\t\t\t\t$prodObj=new Ep_Quote_ProdMissions();\n\t\t\t\t\t\t\t$prodParams['quote_mission_id']=$seoMissionId;\n\t\t\t\t\t\t\t$prodMissionDetails=$prodObj->getProdMissionDetails($prodParams);\n\t\t\t\t\t\t\tif($prodMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach($prodMissionDetails as $prodMission)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prodMissionId=$prodMission['identifier'];\n\t\t\t\t\t\t\t\t\t$prodObj->insertMissionVersion($prodMissionId);\n\n\t\t\t\t\t\t\t\t\t//update prod mission version\n\t\t\t\t\t\t\t\t\t$update_prod['version']=$version;\n\t\t\t\t\t\t\t\t\t$prodObj->updateProdMission($update_prod,$prodMissionId);\n\n\t\t\t\t\t\t\t\t\t//deleting prod mission from Prodmissions after insert into prod versioning\n\t\t\t\t\t\t\t\t\t//$prodObj->deleteProdMission($prodMissionId);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//deleting seo mission from quote missions after insert into versioning\n\t\t\t\t\t\t\t//if($quotes_data['seo_review']=='auto_skipped')\n\t\t\t\t\t\t\t//\t$quoteMission_obj->deleteQuoteMission($seoMissionId);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t}\t\n\n\n\t\t\t\t$quotes_data['sales_review']='not_done';\t\t\t\t\n\t\t\t\t$quotes_data['sales_margin_percentage']=0;\t\t\t\t\n\t\t\t\t//$quotes_data['techmissions_assigned']='';\t\n\t\t\t\t$quotes_data['created_at']=date(\"Y-m-d H:i:s\");\t\n\t\t\t\t$quotes_data['updated_at']=NULL;\n\t\t\t\t\n\t\t\t\t$quotes_data['final_turnover']=0;\n\t\t\t\t$quotes_data['final_margin']=0;\n\t\t\t\t$quotes_data['final_mission_length']=0;\n\n\t\t\t\t$quotes_data['closed_comments']='';\n\t\t\t\t//$quotes_data['prod_timeline']=0;\n\t\t\t\t$quotes_data['signed_comments']=NULL;\n\t\t\t\t$quotes_data['signed_at']=NULL;\n\t\t\t\t$quotes_data['sign_expire_timeline']=NULL;\n\t\t\t\t$quotes_data['closed_reason']=NULL;\t\t\t\t\n\t\t\t\t$quotes_data['boot_customer']=NULL;\n\n\t\t\t}\n\t\t\n\t\t\t//echo \"<pre>\";;print_r($this->quote_creation->custom);print_r($quotes_data);exit;\n\t\t\t//echo \"<pre>\";print_r($this->quote_creation->create_mission['quote_missions']);print_r($quotes_data);exit;\n\n\t\t\ttry\n\t\t\t{ \t\n\t\t\t\tif($this->quote_creation->custom['quote_id'])\n\t\t\t\t{\t\n\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['updated_at']=date(\"Y-m-d H:i:s\");\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\t\t\t\n\t\t\t\t\t$quote_obj->updateQuote($quotes_data,$quoteIdentifier);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\n\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t\t$quotes_data['created_at']=date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\n\t\t\t\t\t$quote_obj->insertQuote($quotes_data);\n\t\t\t\t\t$quoteIdentifier=$quote_obj->getIdentifier();\t\n\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(count($_FILES['quote_documents']['name'])>0)\t\n\t\t\t\t{\n\t\t\t\t\t$update = false;\n\t\t\t\t\t$documents_path=array();\n\t\t\t\t\t$documents_name=array();\n\t\t\t\t\tforeach($_FILES['quote_documents']['name'] as $index=>$quote_files)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($_FILES['quote_documents']['name'][$index]):\n\t\t\t\t\t\t//upload quote documents\n\t\t\t\t\t\n\t\t\t\t\t\t$quoteDir=$this->quote_documents_path.$quoteIdentifier.\"/\";\n\t\t if(!is_dir($quoteDir))\n\t\t mkdir($quoteDir,TRUE);\n\t\t chmod($quoteDir,0777);\n\t\t $document_name=frenchCharsToEnglish($_FILES['quote_documents']['name'][$index]);\n\t\t\t\t\t\t$pathinfo = pathinfo($document_name);\n\t\t\t\t\t\t$document_name =$pathinfo['filename'].rand(100,1000).\".\".$pathinfo['extension'];\n\t\t $document_name=str_replace(' ','_',$document_name);\n\t\t $document_path=$quoteDir.$document_name;\n\t\t if (move_uploaded_file($_FILES['quote_documents']['tmp_name'][$index], $document_path))\n\t\t chmod($document_path,0777);\n\t\n\t\t\t\t\t\t\t$update = true;\n\t\t $documents_path[]=$quoteIdentifier.\"/\".$document_name;\n\t\t $documents_name[]= str_replace('|',\"_\",$final_parameters['document_name'][$index]);\n\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t}\n\t\t\t\t\tif($update)\n\t\t\t\t\t{\n\t\t\t\t\t\t $quotes_update_data = array();\n\t\t\t\t\t\t $quoteDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t\t\t $uploaded_documents1 = explode(\"|\",$quoteDetails[0]['documents_path']);\n\t\t\t\t\t\t $documents_path =array_merge($documents_path,$uploaded_documents1);\n\t\t\t\t\t\t $quotes_update_data['documents_path']=implode(\"|\",$documents_path);\n\t\t\t\t\t\t $document_names =explode(\"|\",$quoteDetails[0]['documents_name']);\n\t\t\t\t\t\t $documents_name =array_merge($documents_name,$document_names);\n\t\t\t\t\t\t $quotes_update_data['documents_name']=implode(\"|\",$documents_name);\n\t\t\t\t\t\t $quote_obj->updateQuote($quotes_update_data,$quoteIdentifier);\n\t\t\t\t\t}\n\t\t\t\t\t//echo \"<pre>\";print_r($quotes_update_data);print_r($documents_name);exit;\n\t \n\t }\n \n\t\t\t\t//Quote missions insertion\n\t\t\t\tif(count($this->quote_creation->create_mission['quote_missions'])>0)\n\t\t\t\t{\n\t\t\t\t\t$sales_margin_percentage=0;\n\t\t\t\t\t$margin=0;\n\t\t\t\t\t//echo \"<pre>\";print_r($this->quote_creation->create_mission['quote_missions']);exit;\n\t\t\t\t\tforeach($this->quote_creation->create_mission['quote_missions'] as $qkey=>$quoteMission)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$quoteMission_data['quote_id']=$quoteIdentifier;\n\t\t\t\t\t\t$quoteMission_data['product']=$quoteMission['product'];\n\t\t\t\t\t\t$quoteMission_data['product_type']=$quoteMission['producttype'];\n\t\t\t\t\t\tif($quoteMission['producttype']=='autre')\n\t\t\t\t\t\t\t$quoteMission_data['product_type_other']=$quoteMission['producttypeother'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$quoteMission_data['product_type_other']=NULL;\n\n\n\t\t\t\t\t\t$quoteMission_data['category']=$this->quote_creation->create_step1['category'];\n\t\t\t\t\t\tif($quoteMission['product']=='translation')\n\t\t\t\t\t\t\t$quoteMission_data['language_dest']=$quoteMission['languagedest'];\n\t\t\t\t\t\tif($quoteMission['product']!='auture')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quoteMission_data['language_source']=$quoteMission['language'];\n\t\t\t\t\t\t\t$quoteMission_data['nb_words']=$quoteMission['nb_words'];\n\t\t\t\t\t\t\t$quoteMission_data['volume']=$quoteMission['volume'];\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t$quoteMission_data['comments']=$quoteMission['comments'];\n\t\t\t\t\t\t$quoteMission_data['misson_user_type']='sales';\n\t\t\t\t\t\t$quoteMission_data['created_by']=$this->quote_creation->create_step1['quote_by'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*added w.r.t tempo*/\n\t\t\t\t\t\t$quoteMission_data['mission_length']=$quoteMission['mission_length'];\n\t\t\t\t\t\t$quoteMission_data['mission_length_option']=$quoteMission['mission_length_option'];\t\t\t\t\t\t\n\t\t\t\t\t\t$quoteMission_data['volume_max']=$quoteMission['volume_max'];\n\t\t\t\t\t\t$quoteMission_data['delivery_volume_option']=$quoteMission['delivery_volume_option'];\n\t\t\t\t\t\t$quoteMission_data['tempo']=$quoteMission['tempo'];\n\t\t\t\t\t\t$quoteMission_data['tempo_length']=$quoteMission['tempo_length'];\n\t\t\t\t\t\t$quoteMission_data['tempo_length_option']=$quoteMission['tempo_length_option'];\n\t\t\t\t\t\t$quoteMission_data['oneshot']=$quoteMission['oneshot'];\n\t\t\t\t\t\t$quoteMission_data['demande_client']=$quoteMission['demande_client'];\n\t\t\t\t\t\t$quoteMission_data['duration_dont_know']=$quoteMission['duration_dont_know'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$suggested_missions=array();\n\n\t\t\t\t\t\tif(count($quoteMission['missionDetails'])>0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach($quoteMission['missionDetails'] as $missions_archived)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//if(in_array($missions_archived['id'],$this->quote_creation->select_missions['missions_selected']))\n\t\t\t\t\t\t\t\tif($missions_archived['id']==$this->quote_creation->select_missions['missions_selected'][$qkey])\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$suggested_missions[]=$missions_archived['id'];\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\t$quoteMission_data['sales_suggested_missions']=implode(\",\",$suggested_missions);\n\n\t\t\t\t\t\t$archmission_obj=new Ep_Quote_Mission();\n\t\t\t\t\t\t$archParameters['mission_id']=$quoteMission_data['sales_suggested_missions'];\n\t\t\t\t\t\t$suggested_mission_details=$archmission_obj->getMissionDetails($archParameters);\n\n\t\t\t\t\t\t//echo $quoteMission_data['sales_suggested_missions'].\"<pre>\";print_r($suggested_mission_details);exit;\n\t\t\t\t\t\tif($suggested_mission_details)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t/* $quoteMission_data['mission_length']=$suggested_mission_details[0]['mission_length'];\n\t\t\t\t\t\t\t$quoteMission_data['mission_length_option']='days';\n\t\t\t\t\t\t\t$quoteMission_data['unit_price']=($suggested_mission_details[0]['selling_price']); */\n\t\t\t\t\t\t\t$quoteMission_data['unit_price']=$this->quote_creation->select_missions['single_article_price'][$qkey];\n\t\t\t\t\t\t\t$quoteMission_data['margin_percentage']=$suggested_mission_details[0]['margin_before_signature'];\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif($quotes_data['prod_review']=='auto_skipped' || $quotes_data['sales_suggested_price']<=5000) //added w.r.t low quote direct validation\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$nb_words=($quoteMission['nb_words']/$suggested_mission_details[0]['article_length']);\n\t\t\t\t\t\t\t\t$redactionCost=$nb_words*($suggested_mission_details[0]['writing_cost_before_signature']);\n\t\t\t\t\t\t\t\t$correctionCost=$nb_words*($suggested_mission_details[0]['correction_cost_before_signature']);\n\t\t\t\t\t\t\t\t$otherCost=$nb_words*($suggested_mission_details[0]['other_cost_before_signature']);\n\n\t\t\t\t\t\t\t\t$internalcost=($redactionCost+$correctionCost+$otherCost);\n\t\t\t\t\t\t\t\t$internalcost=number_format($internalcost,2,'.','');\n\n\t\t\t\t\t\t\t\t$quoteMission_data['internal_cost']=$internalcost;//$quoteMission_data['unit_price'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$quoteMission_data['version']=$version;\n\n\t\t\t\t\t\t//versioning quote missions\n\t\t\t\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t//Insert this mission in to QuoteMissionsversions table\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($quoteMission['identifier'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quoteMission_obj->insertMissionVersion($quoteMission['identifier']);\n\n\t\t\t\t\t\t\t\t//versioning Prod Missions\n\t\t\t\t\t\t\t\t$prodObj=new Ep_Quote_ProdMissions();\n\t\t\t\t\t\t\t\t$prodParams['quote_mission_id']=$quoteMission['identifier'];\n\t\t\t\t\t\t\t\t$prodMissionDetails=$prodObj->getProdMissionDetails($prodParams);\n\t\t\t\t\t\t\t\tif($prodMissionDetails)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach($prodMissionDetails as $prodMission)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$prodMissionId=$prodMission['identifier'];\n\t\t\t\t\t\t\t\t\t\t$prodObj->insertMissionVersion($prodMissionId);\n\n\t\t\t\t\t\t\t\t\t\t//deleting prod mission from Prodmissions after insert into prod versioning\n\t\t\t\t\t\t\t\t\t\t//$prodObj->deleteProdMission($prodMissionId);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$quoteMission_data['cost']=0;\n\t\t\t\t\t\t\t$quoteMission_data['created_at']=date(\"Y-m-d H:i:s\");\t\n\t\t\t\t\t\t\t$quoteMission_data['updated_at']=NULL;\t\n\t\t\t\t\t\t\t//if($quotes_data['prod_review']!='auto_skipped')\n\t\t\t\t\t\t\t\t//$quoteMission_data['internal_cost']=0;\t\n\t\t\t\t\t\t\t$quoteMission_data['turnover']=0;\n\t\t\t\t\t\t\t$quoteMission_data['include_final']='yes';\t\t\t\n\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\n\n\n\t\t\t\t\t\t//echo \"<pre>\";print_r($quoteMission_data);\n\t\t\t\t\t\tif($quoteMission['identifier'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t\t\t\t$quoteMission_data['updated_at']=date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\t\t$quoteMission_obj->updateQuoteMission($quoteMission_data,$quoteMission['identifier']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t\t\t\t$quoteMission_data['created_at']=date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\t\t$quoteMission_obj->insertQuoteMission($quoteMission_data);\n\n\t\t\t\t\t\t\t//updating prod status if new mission added in edit mode\n\t\t\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'] && $this->quote_creation->custom['action']=='edit')\n\t\t\t\t\t\t\t\t$newmissionAdded=TRUE;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t//quote sales margin;\n\t\t\t\t\t\t$sales_margin_percentage+=$quoteMission_data['margin_percentage'];\n\t\t\t\t\t\t$margin++;\n\t\t\t\t\t}\n\t\t\t\t\t//updating sales margin in Quote table\n\t\t\t\t\t$avg_sales_margin_percentage=($sales_margin_percentage/$margin);\n\t\t\t\t\t$margin_data['sales_margin_percentage']=round($avg_sales_margin_percentage,2);\t\t\t\t\t\n\t\t\t\t\t//echo $quoteIdentifier;echo \"<pre>\";print_r($margin_data);exit;\n\t\t\t\t\t$quote_obj->updateQuote($margin_data,$quoteIdentifier);\n\n\t\t\t\t}\n\t\t\t\t\t//Insert Quote log\n\n\t\t\t\t\t$log_params['quote_id']\t= $quoteIdentifier;\n\t\t\t\t\t$log_params['bo_user']\t= $this->adminLogin->userId;\n\t\t\t\t\t$log_params['quote_size']=$quotes_data['sales_suggested_price'] < 5000 ? \"small\" :\"big\";\n\t\t\t\t\t$log_params['urgent']\t= $final_parameters['urgent']? 'urgent':'';\n\t\t\t\t\t$log_params['version']\t= $version;\t\t\t\t\t\n\t\t\t\t\t$log_params['created_date']\t= date(\"Y-m-d H:i:s\");\n\n\t\t\t\t\t$log_obj=new Ep_Quote_QuotesLog();\n\t\t\t\t\tif($edited || $sales_review_staus=='to_be_approve')\n\t\t\t\t\t{\n\t\t\t\t\t\t$log_params['action']\t= 'quote_updated';\n\t\t\t\t\t\t$actionId=9;\n\n\t\t\t\t\t\tif($final_parameters['quote_updated_comments'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$log_params['comments']=$final_parameters['quote_updated_comments'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$log_params['action']\t= 'quote_created';\n\t\t\t\t\t\t$actionId=1;\t\n\n\t\t\t\t\t\tif($final_parameters['bo_comments'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$log_params['comments']=$final_parameters['bo_comments'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$log_obj->insertLog($actionId,$log_params);\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//echo \"<pre>\";print_r($log_params);exit;\n\n\t\t\t}\n\t\t\tcatch(Zend_Exception $e)\n {\n echo $e->getMessage();exit; \n\n }\n\n\n //sending intimation emails when quote edited\n $update_comments= $final_parameters['quote_updated_comments'];\n if($edited && $update_comments)\n\t\t\t{\n\t\t\t\t$bo_user_type='sales';\t\t\t\t\n\t\t\t\t$this->sendIntimationEmail($quoteIdentifier,$bo_user_type,$update_comments,$newmissionAdded);\n\t\t\t\t//exit;\n\t\t\t}\t\n\n\t\t\t //send email to impacted challengers when quote updated or new version created\n\t\t\t if($edited OR $this->quote_creation->custom['create_new_version'])\n\t\t\t {\t\t\t\t\n\t\t\t\tif($edited)\n\t\t\t\t{\n\t\t\t\t\t$iemail_id=172;\n\t\t\t\t\t$imail_parameters['followup_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.\"&submenuId=ML13-SL2\";\n\t\t\t\t}\n\t\t\t\telse if($this->quote_creation->custom['create_new_version'])\n\t\t\t\t{\n\t\t\t\t\t$iemail_id=173;\n\t\t\t\t\t$imail_parameters['followup_link']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\t\t\t\t}\n\n\t\t\t\t$challengers=$this->getImpactedChallengers($quoteIdentifier,$final_parameters['quote_send_team']);\n\t\t\t\tif(count($challengers)>0)\n\t\t\t\t{\n\t\t\t\t\tforeach($challengers as $impactUser)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($impactUser!=$this->adminLogin->userId)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$imail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t$receiver_id=$impactUser;\n\t\t\t\t\t\t\t$imail_parameters['bo_user']=$impactUser;\n\t\t\t\t\t\t\t$imail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t\t$imail_parameters['quote_title']=$quotes_data['title'];\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$imail_obj->sendQuotePersonalEmail($receiver_id,$iemail_id,$imail_parameters);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//echo $iemail_id.\"<pre>\";print_r($challengers);exit;\n\t\t\t\t//exit;\n\t\t\t}\t\n\n\t\t\t//When a quote has been closed and then reactivated, the reason why sales has closed the quote the first time should be communicated to the concerned BO users \n\t\t if($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes' && $sales_review_staus=='closed')\n\t\t {\n\t\t \t\t\n\t\t \t$challengers=$this->getImpactedChallengers($quoteIdentifier,$final_parameters['quote_send_team']);\n\t\t\t\tif(count($challengers)>0)\n\t\t\t\t{\n\t\t\t\t\tforeach($challengers as $impactUser)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($impactUser!=$this->adminLogin->userId)\n\t\t\t\t\t\t{\t\n\t\t\t\t \t\t$cmail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t$receiver_id=$impactUser;\n\t\t\t\t\t\t\t$cmail_parameters['bo_user']=$impactUser;\n\t\t\t\t\t\t\t$cmail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t\t$cmail_parameters['quote_title']=$quotes_data['title'];\t\n\t\t\t\t\t\t\t$cmail_parameters['client_name']=$this->quote_creation->create_mission['company_name'];\n\t\t\t\t\t\t\t$cmail_parameters['closed_reason']=$this->closedreason[$quoteEditDetails[0]['closed_reason']];\n\t\t\t\t\t\t\t$cmail_parameters['closed_comments']=$quoteEditDetails[0]['closed_comments'];\n\t\t\t\t\t\t\t$cmail_parameters['validate_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.'&submenuId=ML13-SL2';\n\t\t\t\t\t\t\t$cmail_obj->sendQuotePersonalEmail($receiver_id,180,$cmail_parameters);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t \t\n\t\t }\n\t\t //exit;\n\n\n\t\t\t//sending email to seo &tech OR Prod to challenge after creating the quote\n\t\t\tif(!$edited && !$onlySales && !$send_manager_email)\n\t\t\t{\n\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\n\t\t\t\tif($onlyProd)\n\t\t\t\t\t$email_users=$client_obj->getEPContacts('\"prodsubmanager\"');\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_tech_seo_team')\n\t\t\t\t\t$email_users=$client_obj->getEPContacts('\"techuser\",\"techmanager\",\"seouser\",\"seomanager\"');\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_tech_prod_team' || $final_parameters['quote_send_team']=='send_tech_team')\n\t\t\t\t\t$email_users=$client_obj->getEPContacts('\"techuser\",\"techmanager\"');\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_seo_prod_team' || $final_parameters['quote_send_team']=='send_seo_team')\t\n\t\t\t\t\t$email_users=$client_obj->getEPContacts('\"seouser\",\"seomanager\"');\t\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\t$email_users=$client_obj->getEPContacts('\"seouser\",\"seomanager\",\"techuser\",\"techmanager\"');\n\n\t\t\t\tif(count($email_users)>0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tforeach($email_users as $user=>$name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t$mail_parameters['bo_user']=$user;\n\t\t\t\t\t\t$mail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t$mail_parameters['quote_title']=$quotes_data['title'];\n\t\t\t\t\t\t$mail_parameters['sales_suggested_price']=$quotes_data['sales_suggested_price'].\" \".$quotes_data['sales_suggested_currency'].\"s\";\n\t\t\t\t\t\t$mail_parameters['challenge_link']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\n\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,142,$mail_parameters); \t\n\t\t \t}\n\t\t }\t\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($send_manager_email)//send email to sales manager to approve the quote \n\t\t\t{\n\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t$email_users=$get_head_prods=$client_obj->getEPContacts('\"salesmanager\"');\n\n\t\t\t\tif(count($email_users)>0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tforeach($email_users as $user=>$name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t$mail_parameters['bo_user']=$user;\n\t\t\t\t\t\t$mail_parameters['sales_user']=$this->adminLogin->userId;\t\t\t\t\t\t\n\t\t\t\t\t\t$mail_parameters['challenge_link']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\n\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,151,$mail_parameters); \t\n\t\t \t}\n\t\t }\n\t\t if(!$edited)\n\t\t {\n\t\t\t\t//if mission product value autre email send to sales manager need to add thaibault\n\t\t $email_usershead=array('139281941421499'=>'[email protected]');\n\t\t //array('141690656032222'=>'[email protected]');\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$quoteEditDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach($email_usershead as $userhead=>$emailshead){\n\t\t\t\t\t\t\t\t\t$receiverhead_id=$userhead;\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['sales_user']=$quoteEditDetails[0]['quote_by'];\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['bo_user']=$receiverhead_id;\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['quote_title']=$quotes_data['title'];\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['followup_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.\"&submenuId=ML13-SL2\";\n\t\t\t\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiverhead_id,198,$mailhead_parameters);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//intimation email to seb,alessia and yannick\n\t\t\tif(!$edited)\n\t\t\t{\n\t\t $client_obj=new Ep_Quote_Client();\n\t\t //$intimate_users=$client_obj->getEPContacts('\"facturation\"');\n\t\t //$intimate_users[$this->adminLogin->userId]=$this->adminLogin->userId;\n\t\t $intimate_users=array('138960180336581'=>'[email protected]',\n\t\t \t\t\t\t\t '139282188375889'=>'[email protected]',\n\t\t \t\t\t\t\t '141745044124851'=>'[email protected]'\n\t\t \t\t\t\t\t );//[email protected], [email protected] and [email protected]\n\t\t if(count($intimate_users)>0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tforeach($intimate_users as $user=>$name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t$mail_parameters['bo_user']=$user;\n\t\t\t\t\t\t$mail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t//$mail_parameters['quote_title']=$quotes_data['title'];\n\t\t\t\t\t\t//$mail_parameters['sales_suggested_price']=$quotes_data['sales_suggested_price'].\" \".$quotes_data['sales_suggested_currency'].\"s\";\n\t\t\t\t\t\t//$mail_parameters['followup_link_en']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\t\t\t\t\t\t$mail_parameters['validate_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.'&submenuId=ML13-SL2';\n\n\t\t\t\t\t\t$mail_parameters['client_name']=$this->quote_creation->create_mission['company_name'];\n\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,174,$mail_parameters); \t\n\t\t \t}\n\t\t } \n\t\t $newquote_head=array('139281941421499'=>'[email protected]','110823103540627'=>'[email protected]','139281996916804'=>'[email protected]');\n\t\t \n\t\t \n\t\t\t\t\n\t\t\t\t\t//new quote created send Email to head sales need to add Thaibault\n\t\t\t\t\t\n\t\t\t\t\t$quoteEditDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach($newquote_head as $userhead=>$emailshead){\n\t\t\t\t\t\t\t\t\t$receiverhead_id=$userhead;\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['sales_user']=$quoteEditDetails[0]['quote_by'];\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['bo_user']=$receiverhead_id;\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['turn_over']=$quoteEditDetails[0]['turnover'];\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['currency']=$this->quote_creation->create_step1['currency'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['challenge_link']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['client_name']=$this->quote_creation->create_mission['company_name'];\n\t\t\t\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiverhead_id,203,$mailhead_parameters);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t \n\t\t }\n\n\t\t //if new version created email send to sales manager\n\t\t $quoteEditDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t \n\t\t if($quoteEditDetails[0]['version']>1){\n\t\t \n\t\t\t\t$email_head_sale=array('139281941421499'=>'[email protected]'); // need to add thaibault\n\t\t\t\t\tif(count($email_head_sale)>0 ){\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tforeach($email_head_sale as $user=>$emails){\n\t\t\t\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t\t\t\t$headmail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t\t\t$headmail_parameters['bo_user']=$user;\n\t\t\t\t\t\t\t\t\t$headmail_parameters['sales_user']=$quoteEditDetails[0]['quote_by'];\n\t\t\t\t\t\t\t\t\t$headmail_parameters['turn_over']=$quoteEditDetails[0]['turnover'];\n\t\t\t\t\t\t\t\t\t$headmail_parameters['client_name']=$quoteEditDetails[0]['company_name'];\n\t\t\t\t\t\t\t\t\t$headmail_parameters['quote_version']=$quoteEditDetails[0]['version'];\t\n\t\t\t\t\t\t\t\t\t$headmail_parameters['followup_link']='/quote/quote-followup?quote_id='.$quoteEditDetails[0]['identifier'];\t\n\t\t\t\t\t\t\t\t\t$headmail_obj->sendQuotePersonalEmail($receiver_id,204,$headmail_parameters);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n unset($this->quote_creation->create_step1);\n unset($this->quote_creation->create_mission);\n unset($this->quote_creation->select_missions);\n unset($this->quote_creation->custom);\n\t\t\tunset($this->quote_creation->send_quote);\n\t\t\tif($edited)\n\t\t\t{\n \t$this->_helper->FlashMessenger('Devis updat&eacute; avec succ&egrave;s');\n\t\t\t}\n else\n {\n \tif(!$send_manager_email)\n \t\t$this->_helper->FlashMessenger('Devis cr&eacute;e avec succ&egrave;s');\n \t\n \tif($final_parameters['quote_send_team']=='send_tech_prod_team' || $final_parameters['quote_send_team']=='send_tech_team') \t\t\n \t\t$this->_helper->FlashMessenger('Onlytech');\n \telse if($final_parameters['quote_send_team']=='send_seo_prod_team' || $final_parameters['quote_send_team']=='send_seo_team')\t\n \t\t$this->_helper->FlashMessenger('Onlyseo');\n \telse if($onlySales)\n \t\t$this->_helper->FlashMessenger('Onlysales');\n \telse if($onlyProd)\n \t\t$this->_helper->FlashMessenger('Onlyprod');\n }\n\n $this->_redirect(\"/quote/sales-quotes-list?submenuId=ML13-SL2\");\t\n\n\t\t\t//echo \"<pre>\";print_r($quotes_data);//print_r($this->quote_creation->select_missions);print_r($this->quote_creation->create_mission['quote_missions']);\n\n\t\t}\t\n\t}", "protected function quote()\n {\n }", "private function getQuotes()\n {\n $requestString = $this->carrierCache->serialize($this->shipperRequest);\n $resultSet = $this->carrierCache->getCachedQuotes($requestString, $this->getCarrierCode());\n $timeout = $this->restHelper->getWebserviceTimeout();\n if (!$resultSet) {\n $initVal = microtime(true);\n $resultSet = $this->shipperWSClientFactory->create()->sendAndReceive(\n $this->shipperRequest,\n $this->restHelper->getRateGatewayUrl(),\n $timeout\n );\n $elapsed = microtime(true) - $initVal;\n $this->shipperLogger->postDebug('Shipperhq_Shipper', 'Short lapse', $elapsed);\n\n if (!$resultSet['result']) {\n $backupRates = $this->backupCarrier->getBackupCarrierRates(\n $this->rawRequest,\n $this->getConfigData(\"backup_carrier\")\n );\n if ($backupRates) {\n return $backupRates;\n }\n }\n $this->carrierCache->setCachedQuotes($requestString, $resultSet, $this->getCarrierCode());\n }\n $this->shipperLogger->postInfo('Shipperhq_Shipper', 'Rate request and result', $resultSet['debug']);\n return $this->parseShipperResponse($resultSet['result']);\n }", "public function getAllQuote($request)\n {\n // $request->attributes->set('creatorIDs', [1, 3 ,4 ,5 ,6]);\n\n // [example] filter by status\n // $request->attributes->set('status', ['rejected', 'pending']);\n\n // $this->quoteAPIController->getAllQuote($request);\n // $this->tagAPIController->getAllTag($request);\n // $this->contentCategoryAPIController->getAllContentCategory($request);\n }", "public function autoQuoteSession($quote_id,$action)\n\t{\n\t\tunset($this->quote_creation->create_mission);\n unset($this->quote_creation->select_missions);\n unset($this->quote_creation->custom);\n\t\tunset($this->quote_creation->send_quote);\n\n\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t$quoteDetails=$quoteObj->getQuoteDetails($quote_id);\n\n\t\tif($quoteDetails)\n\t\t{\n\t\t\tforeach($quoteDetails as $quote)\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->quote_creation->custom['action']=$action;\n\t\t\t\tif($action=='edit')\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$this->quote_creation->custom['quote_id']=$quote['identifier'];\n\t\t\t\t\tif($quote['sales_review']=='validated' || $quote['sales_review']=='closed')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->quote_creation->custom['create_new_version']='yes';\n\t\t\t\t\t\t$this->quote_creation->custom['version']=($quote['version']+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$this->quote_creation->custom['version']=($quote['version']);\n\t\t\t\t\t\tunset($this->quote_creation->custom['create_new_version']);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse if($action=='duplicate')\n\t\t\t\t{\n\t\t\t\t\tunset($this->quote_creation->custom['quote_id']);\n\t\t\t\t\tunset($this->quote_creation->custom['create_new_version']);\n\t\t\t\t\tunset($this->quote_creation->custom['version']);\n\t\t\t\t}\n\t\t\t\t//step1 session\n\t\t\t\t$this->quote_creation->create_step1['client_id']=$quote['client_id'];\n\t\t\t\t$this->quote_creation->create_step1['category']=$quote['category'];\n\t\t\t\tif($quote['category_other'])\n\t\t\t\t\t$this->quote_creation->create_step1['category_other']=$quote['category_other'];\n\n\t\t\t\tif($quote['websites'])\n\t\t\t\t\t$this->quote_creation->create_step1['client_websites']=explode(\"|\",$quote['websites']);\n\t\t\t\t$this->quote_creation->create_step1['quote_by']=$quote['quote_by'];\n\n\t\t\t\t$this->quote_creation->create_step1['currency']=$quote['sales_suggested_currency'];\n\t\t\t\t$this->quote_creation->create_step1['conversion']=$quote['conversion'];\n\t\t\t\t$this->quote_creation->create_step1['quote_type']=$quote['quote_type'];\n\n\t\t\t\t//step2 session\t\n\t\t\t\t$this->quote_creation->create_mission['quote_title']=$quote['title'];\t\t\t\n\t\t\t\t//getting mission details\n\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t$searchParameters['misson_user_type']='sales';\n\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t$missonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\n\t\t\t\tif($missonDetails)\n\t\t\t\t{\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($missonDetails as $quoteMmission)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->quote_creation->create_mission['product'][$i]=$quoteMmission['product'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['language'][$i]=$quoteMmission['language_source'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['languagedest'][$i]=$quoteMmission['language_dest'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['producttype'][$i]=$quoteMmission['product_type'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['producttypeother'][$i]=$quoteMmission['product_type_other'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['nb_words'][$i]=$quoteMmission['nb_words'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['volume'][$i]=$quoteMmission['volume'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['mission_length'][$i]=$quoteMmission['mission_length'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['mission_length_option'][$i]=$quoteMmission['mission_length_option'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['volume_max'][$i]=$quoteMmission['volume_max'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['delivery_volume_option'][$i]=$quoteMmission['delivery_volume_option'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['tempo'][$i]=$quoteMmission['tempo'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['tempo_length'][$i]=$quoteMmission['tempo_length'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['tempo_length_option'][$i]=$quoteMmission['tempo_length_option'];\n\t\t\t\t\t\tif(!$quoteMmission['oneshot'])\n\t\t\t\t\t\t\t$quoteMmission['oneshot']='yes';\n\t\t\t\t\t\t$this->quote_creation->create_mission['oneshot'][$i]=$quoteMmission['oneshot'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['demande_client'][$i]=$quoteMmission['demande_client'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['duration_dont_know'][$i]=$quoteMmission['duration_dont_know'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['comments'][$i]=$quoteMmission['comments'];\n\t\t\t\t\t\t$this->quote_creation->select_missions['missions_selected'][$i]=$quoteMmission['sales_suggested_missions'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t//step3 details\n\t\t\t\t\t\tif($action=='edit')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->quote_creation->create_mission['mission_identifier'][$i]=$quoteMmission['identifier'];\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if($action=='duplicate')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($this->quote_creation->create_mission['mission_identifier']);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t//final step details\n\t\t\t\t$this->quote_creation->send_quote['sales_comment']=$quote['sales_comment'];\n\t\t\t\t$this->quote_creation->send_quote['client_email_text']=$quote['client_email_text'];\t\n\t\t\t\t//$this->quote_creation->send_quote['sales_delivery_time']=$quote['sales_delivery_time'];\n\t\t\t\t//$this->quote_creation->send_quote['sales_delivery_time_option']=$quote['sales_delivery_time_option'];\n\t\t\t\t$this->quote_creation->send_quote['client_know']=$quote['client_know'];\n\t\t\t\t$this->quote_creation->send_quote['urgent']=$quote['urgent'];\n\t\t\t\t$this->quote_creation->send_quote['urgent_comments']=$quote['urgent_comments'];\n\t\t\t\t$this->quote_creation->send_quote['prod_review']=$quote['prod_review'];\n\t\t\t\t$this->quote_creation->send_quote['skip_prod_comments']=$quote['skip_prod_comments'];\n\t\t\t\t//$this->quote_creation->send_quote['market_team_sent']=$quote['market_team_sent'];\n\t\t\t\t//$this->quote_creation->send_quote['from_platform']=$quote['from_platform'];\n\t\t\t\t$this->quote_creation->send_quote['quote_send_team']=$quote['quote_send_team'];\n\t\t\t\t$this->quote_creation->send_quote['sales_review']=$quote['sales_review'];\n\n\t\t\t\t//NEW FIELDS\n\t\t\t\t$client_aims=explode(\",\",$quote['client_aims']);\n\t\t\t\t$this->quote_creation->send_quote['client_aims']=$client_aims;\n\n\t\t\t\t$client_prio=explode(\",\",$quote['client_prio']);\n\n\t\t\t\tif(count($client_aims)>0)\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tforeach($client_aims as $i=>$aim)\n\t\t\t\t\t{\n\t\t\t\t\t\t//echo 'priority_'.$aim;//.\"--\".$quote['client_prio'][$i];\n\t\t\t\t\t\t$this->quote_creation->send_quote['priority_'.$aim]=$client_prio[$i];\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t$this->quote_creation->send_quote['client_aims_comments']=$quote['client_aims_comments'];\n\t\t\t\t$this->quote_creation->send_quote['content_ordered_agency']=$quote['content_ordered_agency'];\n\t\t\t\t$this->quote_creation->send_quote['agency']=$quote['agency'];\n\t\t\t\t$this->quote_creation->send_quote['agency_name']=$quote['agency_name'];\n\t\t\t\t$this->quote_creation->send_quote['client_internal_team']=$quote['client_internal_team'];\n\t\t\t\t$this->quote_creation->send_quote['client_know_writers']=$quote['client_know_writers'];\t\t\t\t\n\t\t\t\t$this->quote_creation->send_quote['volume_option']=$quote['volume_option'];\n\t\t\t\t$this->quote_creation->send_quote['volume_option_multi']=$quote['volume_option_multi'];\n\t\t\t\t$this->quote_creation->send_quote['volume_every']=$quote['volume_every'];\n\t\t\t\t$this->quote_creation->send_quote['budget_marketing']=$quote['budget_marketing'];\n\t\t\t\t$this->quote_creation->send_quote['budget']=$quote['budget'];\n\t\t\t\t$this->quote_creation->send_quote['budget_currency']=$quote['budget_currency'];\n\n\t\t\t\t$this->quote_creation->send_quote['estimate_sign_percentage']=$quote['estimate_sign_percentage'];\n\t\t\t\t$this->quote_creation->send_quote['estimate_sign_date']=$quote['estimate_sign_date'];\n\t\t\t\t$this->quote_creation->send_quote['estimate_sign_comments']=$quote['estimate_sign_comments'];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Quote documents added to sesssion\n\t\t\t\t$files = \"\";\n\t\t\t\t$documents_path = explode(\"|\",$quote['documents_path']);\n\t\t\t\t$documents_name = explode(\"|\",$quote['documents_name']);\n\t\t\t\t$k =0;\n\t\t\t\tforeach($documents_path as $row)\n\t\t\t\t{\n\t\t\t\t\tif(file_exists($this->quote_documents_path.$documents_path[$k]) && !is_dir($this->quote_documents_path.$documents_path[$k]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$files .= '<div class=\"topset2\"><a href=\"/quote/download-document?type=quote&quote_id='.$quote_id.'&index='.$k.'\">'.$documents_name[$k].'</a><span class=\"delete\" rel=\"'.$k.'_'.$quote_id.'\"> <i class=\"splashy-error_x\"></i></span> \t\t\t\t\t\t</div>';\n\t\t\t\t\t}\n\t\t\t\t\t$k++;\n\t\t\t\t}\n\t\t\t\t$this->quote_creation->send_quote['documents'] = $files;\n\n\t\n\n\t\t\t\t//echo \"<pre>\";print_r($this->quote_creation->send_quote);exit;\n\t\t\t}\n\t\t}\n\n\t\t//echo \"<pre>\";print_r($this->quote_creation->create_step1);exit;\n\t}", "public function get_quote(){ return $this->_quote;}", "public function sendQuoteAction()\n\t{\n\t\tif(is_array($this->quote_creation->select_missions['missions_selected']))\n\t\t{\n\t\t\t//$this->quote_creation->custom['mission_added'];\n\t\t\t//getting Quote user details of selected Bo user\n\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t$quote_by=$this->quote_creation->create_step1['quote_by'];\n\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\tif($bo_user_details!='NO')\n\t\t\t{\n\t\t\t\t$this->quote_creation->create_mission['quote_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t$this->quote_creation->create_mission['email']=$bo_user_details[0]['email'];\n\t\t\t\t$this->quote_creation->create_mission['phone_number']=$bo_user_details[0]['phone_number'];\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t\t$this->_view->create_mission=$this->quote_creation->create_mission;\n\t\t\t$this->_view->create_step1=$this->quote_creation->create_step1;\n\t\t $this->_view->select_missions=$this->quote_creation->select_missions;\n\t\t $this->_view->custom=$this->quote_creation->custom;\n\t\t $this->_view->quote_missions=$this->quote_creation->create_mission['quote_missions'];\n\t\t $this->_view->sales_manager_holiday=$this->configval[\"sales_manager_holiday\"];\n\t\t\t$this->_view->user_type=$this->adminLogin->type;\n\t\t //Added w.r.t edit/duplicate\n\t\t $this->_view->send_quote=$this->quote_creation->send_quote;\n\n\t\t\t$this->render('send-quote');\n\t\t}\n\t\telse\n\t\t\t$this->_redirect(\"/quote/create-quote-step1?submenuId=ML13-SL2\");\t\n\t}", "function _canadapostGetQuote() {\r\n\t$strXML = \"<?xml version=\\\"1.0\\\" ?>\";\r\n\r\n\t// set package configuration.\r\n\t$strXML .= \"<eparcel>\\n\";\r\n\t$strXML .= \" <language>\" . $this->language . \"</language>\\n\";\r\n\t$strXML .= \" <ratesAndServicesRequest>\\n\";\r\n\t$strXML .= \" <merchantCPCID>\" . $this->CPCID . \"</merchantCPCID>\\n\";\r\n\t$strXML .= \" <fromPostalCode>\" . $this->_canadapostOriginPostalCode . \"</fromPostalCode>\\n\";\r\n\t$strXML .= \" <turnAroundTime>\" . $this->turnaround_time . \"</turnAroundTime>\\n\";\r\n\t$strXML .= \" <itemsPrice>\" . (string)$this->items_price . \"</itemsPrice>\\n\";\r\n\t\r\n\t// add items information.\r\n\t$strXML .= \" <lineItems>\\n\";\r\n\tfor ($i=0; $i < $this->items_qty; $i++) {\r\n\t $this->item_description[$i] = str_replace(\"&\", \"and\", $this->item_description[$i]);\r\n\t\t$strXML .= \"\t <item>\\n\";\r\n\t\t$strXML .= \" <quantity>\" . $this->item_quantity[$i] . \"</quantity>\\n\";\r\n\t\t$strXML .= \" <weight>\" . ($this->item_weight[$i]) . \"</weight>\\n\";\r\n\t\t$strXML .= \" <length>\" . $this->item_length[$i] . \"</length>\\n\";\r\n\t\t$strXML .= \" <width>\" . $this->item_width[$i] . \"</width>\\n\";\r\n\t\t$strXML .= \" <height>\" . $this->item_height[$i] . \"</height>\\n\";\r\n\t\t$strXML .= \" <description>\" . $this->item_description[$i] . \"</description>\\n\";\r\n\t\tif ($this->item_readytoship[$i]) $strXML .= \" <readyToShip/>\\n\";\r\n\t\t$strXML .= \"\t </item>\\n\";\r\n\t}\r\n\t$strXML .= \" </lineItems>\\n\";\r\n\t\r\n\t// add destination information.\r\n\t$strXML .= \" <city>\" . $this->dest_city . \"</city>\\n\";\r\n\t$strXML .= \" <provOrState>\" . $this->dest_province . \"</provOrState>\\n\";\r\n\t$strXML .= \" <country>\" . $this->dest_country . \"</country>\\n\";\r\n\t$strXML .= \" <postalCode>\" . $this->dest_zip . \"</postalCode>\\n\";\r\n\t$strXML .= \" </ratesAndServicesRequest>\\n\";\r\n\t$strXML .= \"</eparcel>\\n\";\r\n\t\r\n\t//print $strXML;\r\n\tif ($resultXML = $this->_sendToHost($this->server,$this->port,'POST','',$strXML)) {\r\n\t\treturn $this->_parserResult($resultXML);\r\n\t} else {\r\n\t return false;\r\n\t}\r\n }", "public function saveQuote()\n {\n $this->calculateSubscription();\n $this->calculateService();\n $this->calculateGoods();\n \n $return = array();\n $return['services'] = $this->services;\n $return['goods'] = $this->goods;\n $return['subscription'] = $this->subscription;\n $return['userEmail'] = $this->user->getEmail();\n $return['UUID'] = $this->generateQuoteUUID($return);\n $return['user'] = $this->user;\n $return['subtotal'] = $this->subtotal;\n return $return;\n\n }", "public function sendTeamQuoteAction()\n\t{\n\t\t//setlocale(LC_TIME, \"fr_FR\");\n\t\tif($this->quote_creation->create_step1['quote_type']=='only_tech' || $this->quote_creation->create_step1['quote_type']=='only_seo')\n\t\t{\t\t\t\n\t\t\t\n\t\t\t$client_id=$this->quote_creation->create_step1['client_id'];\n\t\t\t$client_obj=new Ep_Quote_Client();\t\t\n\t\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\t\t$this->quote_creation->custom['mission_added']='no';\n\n\t\t\t//getting Client details of selected client\n\t\t\t$client_details=$client_obj->getClientDetails($client_id);\n\t\t\tif($client_details!='NO')\n\t\t\t{\n\t\t\t\t$this->quote_creation->create_mission['company_name']=$client_details[0]['company_name'];\n\t\t\t\t$this->quote_creation->create_mission['ca_number']=$client_details[0]['ca_number'];\n\t\t\t\t$this->quote_creation->create_mission['client_id']=$client_details[0]['identifier'];\n\t\t\t}\t\n\n\t\t\t\n\n\t\t\t$quote_monthly_cnt=$quote_obj->getMonthlyCount($client_id);\n\t\t\t$quote_monthly_cnt+=1;\n\n\t\t\t//titel should be form DB in edit\n\t\t\tif($this->quote_creation->custom['action']!='edit' || !$this->quote_creation->create_mission['quote_title'] || ($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes'))\n\t\t\t{\n\t\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')\n\t\t\t\t{\n\t\t\t\t\t$old_version='v'.($this->quote_creation->custom['version']-1);\n\t\t\t\t\t$new_version='v'.($this->quote_creation->custom['version']);\n\t\t\t\t\t$old_title=$this->quote_creation->create_mission['quote_title'];\n\n\t\t\t\t\t$this->quote_creation->create_mission['quote_title']=str_replace($old_version, $new_version, $old_title);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$this->quote_creation->create_mission['quote_title']='Quote - '.$this->quote_creation->create_mission['company_name'].' - '.strftime(\"%B %Y\").' - '.$quote_monthly_cnt. \" - v1\";\t\n\t\t\t}\n\n\t\t\t//getting Quote user details of selected Bo user\t\t\t\n\t\t\t$quote_by=$this->quote_creation->create_step1['quote_by'];\n\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\tif($bo_user_details!='NO')\n\t\t\t{\n\t\t\t\t$this->quote_creation->create_mission['quote_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t$this->quote_creation->create_mission['email']=$bo_user_details[0]['email'];\n\t\t\t\t$this->quote_creation->create_mission['phone_number']=$bo_user_details[0]['phone_number'];\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\n\t\t\t$this->quote_creation->create_mission['category_name']=$this->getCategoryName($this->quote_creation->create_step1['category']);\n\t\t\t\n\n\t\t\t$this->_view->create_mission=$this->quote_creation->create_mission;\n\t\t\t$this->_view->create_step1=$this->quote_creation->create_step1;\n\t\t\t$this->_view->custom=$this->quote_creation->custom;\n\t\t //Added w.r.t edit/duplicate\n\t\t $this->_view->send_quote=$this->quote_creation->send_quote;\n\t\t \n\t\t //echo \"<pre>\";print_r($this->quote_creation->send_team_quote);exit;\n\n\t\t\t$this->render('send-team-quote');\n\t\t}\n\t\telse\n\t\t\t$this->_redirect(\"/quote/create-quote-step1?submenuId=ML13-SL2\");\t\n\t}", "public function ajax_read_quote()\r\n {\r\n try\r\n {\r\n $id = trim($this->input->post('i_id')); \r\n\t\t\t$arr['i_view'] = 1; \r\n $i_ret_ = $this->mod_rect->read_quote($arr,decrypt($id));\r\n if($i_ret_)\r\n {\r\n set_success_msg($this->cls_msg[\"marked_succ\"]);\r\n echo 'ok';\r\n }\r\n else\r\n {\r\n echo 'error';\r\n }\r\n \r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n }\r\n }", "public function techQuoteReviewAction()\n\t{\n\t\t$tech_parameters=$this->_request->getParams();\n\n\t\t$quote_id=$tech_parameters['quote_id'];\n\n\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\tif($quote_id)\n\t\t{\n\t\t\t$quoteDetails=$quote_obj->getQuoteDetails($quote_id);\n\t\t\tif($quoteDetails)\n\t\t\t{\n\t\t\t\t$q=0;\n\t\t\t\tforeach($quoteDetails as $quote)\n\t\t\t\t{\n\t\t\t\t\t$quoteDetails[$q]['category_name']=$this->getCategoryName($quote['category']);\n\t\t\t\t\t$quoteDetails[$q]['websites']=explode(\"|\",$quote['websites']);\n\t\t\t\t\t\n\t\t\t\t\tif($quote['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$files = array('documents_path'=>$quote['documents_path'],'documents_name'=>$quote['documents_name'],'quote_id'=>$quote_id,'delete'=>false);\n\t\t\t\t\t\t$related_files = $this->getQuoteFiles($files);\n\t\t\t\t\t}\n\n\t\t\t\t\t$quoteDetails[$q]['related_files']=$related_files;\n\n\t\t\t\t\t$quoteDetails[$q]['sales_suggested_price_format']=number_format($quote['sales_suggested_price'], 2, ',', ' ');\n\t\t\t\t\t$quoteDetails[$q]['comment_time']=time_ago($quote['created_at']);\n\n\t\t\t\t\tif($quote['tech_timeline'])\n\t\t\t\t\t\t$quoteDetails[$q]['tech_timeline_stamp']=strtotime($quote['tech_timeline']);\n\t\t\t\t\t\n\t\t\t\t\tif($quote['tech_timeline'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteDetails[$q]['tech_timeline_date']=date(\"d/m/Y\",strtotime($quote['tech_timeline']));\n\t\t\t\t\t\t$quoteDetails[$q]['tech_timeline_time']=date(\"H:i\",strtotime($quote['tech_timeline']));\n\t\t\t\t\t}\n\n\t\t\t\t\t//bo user details\n\t\t\t\t\t$quote_by=$quote['quote_by'];\n\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\t\t\tif($bo_user_details!='NO')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteDetails[$q]['quote_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t\t\t$quoteDetails[$q]['email']=$bo_user_details[0]['email'];\n\t\t\t\t\t\t$quoteDetails[$q]['phone_number']=$bo_user_details[0]['phone_number'];\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t//getting mission details\n\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\t$searchParameters['misson_user_type']='sales';\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t$missonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\t\t\tif($missonDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\t$m=0;\n\t\t\t\t\t\tforeach($missonDetails as $mission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$missonDetails[$m]['product_name']=$this->product_array[$mission['product']];\t\t\t\n\t\t\t\t\t\t\t$missonDetails[$m]['language_source_name']=$this->getLanguageName($mission['language_source']);\n\t\t\t\t\t\t\t$missonDetails[$m]['product_type_name']=$this->producttype_array[$mission['product_type']];\n\t\t\t\t\t\t\tif($mission['language_dest'])\n\t\t\t\t\t\t\t\t$missonDetails[$m]['language_dest_name']=$this->getLanguageName($mission['language_dest']);\n\n\t\t\t\t\t\t\t$missonDetails[$m]['comment_time']=time_ago($mission['created_at']);\n\n\n\t\t\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\n\t\t\t\t\t\t\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t\t\t$previousMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],$previousVersion,'sales');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach($previousMissionDetails as $key=>$vmission)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_name']=$this->seo_product_array[$vmission['product']];\t\t\t\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_source_name']=$this->getLanguageName($vmission['language_source']);\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_type_name']=$this->producttype_array[$vmission['product_type']];\n\t\t\t\t\t\t\t\t\t\tif($vmission['language_dest'])\n\t\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_dest_name']=$this->getLanguageName($vmission['language_dest']);\n\n\t\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$allVersionMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],NULL,'sales');\n\t\t\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t\t\t$table_end='</table>';\n\t\t\t\t\t\t\t\t\t\t$language_versions=$product_type_versions=$volume_versions=$nb_words_versions='';\n\t\t\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\n\t\t\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t \tif($versions['product']=='translation')\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']).\" > \".$this->getLanguageName($vmission['language_dest']);\n\t\t\t\t\t\t\t\t\t\t \telse\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']);\n\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\n\t\t\t\t\t\t\t\t\t\t \t$language_versions.=\"<tr><td>$language</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$product_type_versions.=\"<tr><td>\".$this->producttype_array[$versions['product_type']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$volume_versions.=\"<tr><td>\".$versions['volume'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$nb_words_versions.=\"<tr><td>\".$versions['nb_words'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['unit_price'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_option=$this->duration_array[$versions['mission_length_option']];//$versions['mission_length_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['mission_length'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\t\t\tif($mission['language_source'] !=$previousMissionDetails[0]['language_source'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['language_dest'] !=$previousMissionDetails[0]['language_dest'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['product_type'] !=$previousMissionDetails[0]['product_type'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_versions']=$table_start.$product_type_versions.$table_end;\n\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\t\t\tif($mission['volume'] !=$previousMissionDetails[0]['volume'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_versions']=$table_start.$volume_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($mission['nb_words'] !=$previousMissionDetails[0]['nb_words'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_versions']=$table_start.$nb_words_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($mission['unit_price'] !=$previousMissionDetails[0]['unit_price'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['unit_price_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$current_mission_lenght=$mission['mission_length_option']=='hours' ? ($mission['mission_length']/24) : $mission['mission_length'];\n\t\t\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['mission_length_option']=='hours' ? ($previousMissionDetails[0]['mission_length']/24) : $previousMissionDetails[0]['mission_length'];\n\t\t\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$m++;\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t$quoteDetails[$q]['mission_details']=$missonDetails;\n\n\t\t\t\t\t\t//Deleted mission version details\n\t\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\t\t\t\t\t\t\t$deletedMissionVersions=$this->deletedMissionVersions($quote['identifier'],$previousVersion,'sales');\n\t\t\t\t\t\t\tif($deletedMissionVersions)\n\t\t\t\t\t\t\t\t$quoteDetails[$q]['deletedMissionVersions']=$deletedMissionVersions;\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\n\n\t\t\t\t\t$q++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_view->quoteDetails=$quoteDetails;\n\n\t\t\t//getting tech mission details\n\t\t\t$tech_obj=new Ep_Quote_TechMissions();\n\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t$techMissionDetails=$tech_obj->getTechMissionDetails($searchParameters);\n\t\t\tif($techMissionDetails)\n\t\t\t{\n\t\t\t\t$t=0;\n\t\t\t\tforeach($techMissionDetails as $mission)\n\t\t\t\t{\n\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\tif($quoteDetails[0]['version']>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$previousVersion=($quoteDetails[0]['version']-1);\n\n\t\t\t\t\t\t$techMissionObj=new Ep_Quote_TechMissions();\n\t\t\t\t\t\t$previousMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier'],$previousVersion);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$allVersionMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier']);\n\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t$table_end='</table>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\t\t\t\t\t\t\t\t$title_versions='';\n\n\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$title_versions.=\"<tr><td>\".$versions['title'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['cost'],2).\" &\". $versions['currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$mission_length_option=$versions['delivery_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['delivery_time'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\tif($mission['title'] !=$previousMissionDetails[0]['title'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_difference']='yes';\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_versions']=$table_start.$title_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\tif($mission['cost'] !=$previousMissionDetails[0]['cost'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['cost_difference']='yes';\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current_mission_lenght=$mission['delivery_option']=='hours' ? ($mission['delivery_time']/24) : $mission['delivery_time'];\n\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['delivery_option']=='hours' ? ($previousMissionDetails[0]['delivery_time']/24) : $previousMissionDetails[0]['delivery_time'];\n\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t$techMissionDetails[$t]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t}\n\t\t\t\t\t$techMissionDetails[$t]['files'] = \"\";\n\t\t\t\t\tif($mission['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$filesarray = array('documents_path'=>$mission['documents_path'],'documents_name'=>$mission['documents_name'],'id'=>$mission['identifier'],'delete'=>true);\n\t\t\t\t\t\t$files = $this->getTechFiles($filesarray);\n\t\t\t\t\t\t$techMissionDetails[$t]['files'] = $files;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t$t++;\n\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t\t$this->_view->techMissionDetails=$techMissionDetails;\n\t\t\t}\n\t\t}\n\t\t//check manager is on holiday or not\n\t\t$techManager_holiday=$this->configval[\"tech_manager_holiday\"];\n\t\t$user_type=$this->adminLogin->type;\n\t\tif($techManager_holiday=='no' && $user_type=='techuser')\n\t\t\t$this->_view->show_validate='no';\n\t\telse\n\t\t\t$this->_view->show_validate='yes';\t\n\n\t\t//echo \"<pre>\";print_r($quoteDetails);exit;\n\n\t\t$this->render('tech-quote-review');\n\t}", "public function quote($status = null, $id = null) {\n if($status == 'create') {\n $ongoing = $this->CrmQuotation->find('first', array(\n 'conditions' => array( \n 'CrmQuotation.admin_id' => $this->Auth->user('id'),\n 'CrmQuotation.status' => 'ONGOING'\n )));\n \n \n if(count($ongoing)!=0){\n //meaning meron syang ongoing na ginagawang quotation\n $quote_data = $ongoing; //retrieved data from existing ongoing quotation\n }else{\n //walang existing so data magcreate na ng data \n $terms_information = '<h3>I. PAYMENT</h3>\n <ol>\n <li>\n <p>A<strong> FIFTY PERCENT (50%)</strong> downpayment shall be required unless Raeas Marketing and the Client shall otherwise agree, balance upon completion of delivery as per agreement.</p>\n </li>\n <li>\n <p>Payment will be accepted in Dated Company Check, Manager’s Check, thru Bank Transfer or Cash.</p>\n </li>\n <li>\n <p>All check is payable to Raeas Marketing.</p>\n </li>\n </ol>\n <h3>II. DELIVERY</h3>\n <ol>\n <li>\n <p>Delivery is FREE for purchases above Php3, 000.00 within Metro Manila. </p>\n </li>\n <li>\n <p>Delivery outside Metro Manila may be charged to client.</p>\n </li>\n </ol>\n <h3>III. Validity</h3> \n <ol>\n <li>\n <p>10 Days from the date of proposal.</p>\n </li>\n <li>\n <p>Prices may vary without prior notice and shall not be considered final unless and until this Quotation Proposal has been signed and accepted.</p>\n </li>\n </ol>\n <h3>IV. Warranty</h3> \n <ol>\n <li>\n <p>One (1) year warranty against factory defect upon normal operating condition.</p>\n </li>\n </ol>\n <h3>V. Cancellation of orders</h3> \n <ol>\n <li>\n <p>All cancellation of orders will be charged a cancellation fee of 30% of the order value.</p>\n </li>\n </ol>';\n $dateToday = date(\"Hymds\");\n $milliseconds = round(microtime(true) * 1000);\n $newstring = substr($milliseconds, -3);\n $quote_number = $newstring . '' . $dateToday;\n \n $quote_exist = $this->CrmQuotation->find('count', array(\n 'conditions' => array(\n 'CrmQuotation.quote_number' => $quote_number\n )));\n\n if ($quote_exist == 0) {\n $quote_no = $quote_number;\n } else {\n $news = substr($milliseconds, -4);\n $quote_no = $news . '' . $dateToday;\n }\n $this->CrmQuotation->create();\n $this->CrmQuotation->set(array(\n 'quote_number' => $quote_no,\n 'admin_id' => $this->Auth->user('id'),\n 'status' => 'ONGOING',\n 'terms' => $terms_information, \n ));\n $this->CrmQuotation->save();\n $id = $this->CrmQuotation->getLastInsertID(); \n $quote_data = $this->CrmQuotation->find('first', array(\n 'conditions' => array('CrmQuotation.admin_id' => $this->Auth->user('id'), 'CrmQuotation.status' => 'ONGOING')\n )); \n }\n } else{\n $quote_data = $this->CrmQuotation->findById($id); \n }\n \n $this->set(compact('quote_data'));\n \n \n $companies = $this->getCompanies();\n // pr($quote_data);\n $quote_prods = $this->getQuotationProducts($quote_data['CrmQuotation']['id']);\n \n $product_lists = $this->getProducts();\n \n $this->set(compact('status','companies', 'quote_prods', 'product_lists'));\n \n\n }", "public function quote_request_success(){\n \t\t$catrelatedproducts = $catrelatedproducts = '';\n \t\t$catid = $_GET['catid'];\n \t\t$pids = $_GET['pid'];\n \t\tif ($catid) {\n \t\t\t$catrelatedproducts = $this->getRelatedProducts( $catid);\n \t\t\t$quote_related_products['catrelatedproducts']['data'] = $catrelatedproducts;\n \t\t\t$selectedterm = \\Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($catid);\n \t\t\t$quote_related_products['catrelatedproducts']['selected_cat'] = $selectedterm->label();\n \t\t}\n \t\telseif($pids){\n\t\t\t$relatedproducts = $this->relatedproducts( $pids);\n\t\t\t$product_nodequery = \\Drupal::database()->select('node_field_data', 'nfd');\n\t\t\t$product_nodequery->fields('nfd', array('title'));\n\t\t\t$product_nodequery->condition('nfd.nid', $pids, 'IN');\n\t\t\t$product_nodequery->condition('nfd.status', 1);\n\t\t\t$product_nodequery->condition('nfd.type', 'products');\n\t\t\t$selected_productdata = $product_nodequery->execute()->fetchAll();\n\t\t\t$quote_related_products['relatedproducts']['selected_products'] = $selected_productdata;\n\t\t\t$quote_related_products['relatedproducts']['data'] = $relatedproducts;\n \t\t}\n \t\treturn array(\n\t '#theme' => 'thanks_template',//'quote_request_thanks',\n\t '#quote_related_products' => $quote_related_products,\n\t );\n\n \t}", "public function seoQuoteReviewAction()\n\t{\n\t\t$seo_parameters=$this->_request->getParams();\n\n\t\t$quote_id=$seo_parameters['quote_id'];\n\n\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\tif($quote_id)\n\t\t{\n\t\t\t$quoteDetails=$quote_obj->getQuoteDetails($quote_id);\n\t\t\tif($quoteDetails)\n\t\t\t{\n\t\t\t\t$q=0;\n\t\t\t\tforeach($quoteDetails as $quote)\n\t\t\t\t{\n\t\t\t\t\t$quoteDetails[$q]['category_name']=$this->getCategoryName($quote['category']);\n\t\t\t\t\t$quoteDetails[$q]['websites']=explode(\"|\",$quote['websites']);\n\t\t\t\t\t\n\t\t\t\t\tif($quote['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$related_files='';\n\t\t\t\t\t\t/* $documents_path=explode(\"|\",$quote['documents_path']);\n\t\t\t\t\t\t$documents_name=explode(\"|\",$quote['documents_name']);\n\n\t\t\t\t\t\tforeach($documents_path as $k=>$file)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(file_exists($this->quote_documents_path.$documents_path[$k]) && !is_dir($this->quote_documents_path.$documents_path[$k]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($documents_name[$k])\n\t\t\t\t\t\t\t\t\t$file_name=$documents_name[$k];\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$file_name=basename($file);\n\n\t\t\t\t\t\t\t\t$related_files.='\n\t\t\t\t\t\t\t\t<a href=\"/quote/download-document?type=quote&index='.$k.'&quote_id='.$quote_id.'\">'.$file_name.'</a><br>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} */\n\t\t\t\t\t\t$files = array('documents_path'=>$quote['documents_path'],'documents_name'=>$quote['documents_name'],'quote_id'=>$quote_id,'delete'=>false);\n\t\t\t\t\t\t$related_files = $this->getQuoteFiles($files);\n\t\t\t\t\t}\n\n\t\t\t\t\t$quoteDetails[$q]['related_files']=$related_files;\n\n\t\t\t\t\t$quoteDetails[$q]['sales_suggested_price_format']=number_format($quote['sales_suggested_price'], 2, ',', ' ');\n\t\t\t\t\t$quoteDetails[$q]['comment_time']=time_ago($quote['created_at']);\n\n\t\t\t\t\tif($quote['seo_timeline'])\n\t\t\t\t\t\t$quoteDetails[$q]['seo_timeline_stamp']=strtotime($quote['seo_timeline']);\n\n\t\t\t\t\tif($quote['seo_timeline'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteDetails[$q]['seo_timeline_date']=date(\"d/m/Y\",strtotime($quote['seo_timeline']));\n\t\t\t\t\t\t$quoteDetails[$q]['seo_timeline_time']=date(\"H:i\",strtotime($quote['seo_timeline']));\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\n\t\t\t\t\t//bo user details\n\t\t\t\t\t$quote_by=$quote['quote_by'];\n\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\t\t\tif($bo_user_details!='NO')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteDetails[$q]['quote_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t\t\t$quoteDetails[$q]['email']=$bo_user_details[0]['email'];\n\t\t\t\t\t\t$quoteDetails[$q]['phone_number']=$bo_user_details[0]['phone_number'];\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t//getting mission details\n\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\t$searchParameters['misson_user_type']='sales';\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t$missonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\t\t\tif($missonDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\t$m=0;\n\t\t\t\t\t\tforeach($missonDetails as $mission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$missonDetails[$m]['product_name']=$this->product_array[$mission['product']];\t\t\t\n\t\t\t\t\t\t\t$missonDetails[$m]['language_source_name']=$this->getLanguageName($mission['language_source']);\n\t\t\t\t\t\t\t$missonDetails[$m]['product_type_name']=$this->producttype_array[$mission['product_type']];\n\t\t\t\t\t\t\tif($mission['language_dest'])\n\t\t\t\t\t\t\t\t$missonDetails[$m]['language_dest_name']=$this->getLanguageName($mission['language_dest']);\n\n\t\t\t\t\t\t\t$quoteDetails[$q]['missions_list'][$mission['identifier']]='Mission '.($m+1).' - '.$missonDetails[$m]['product_name'];\n\n\t\t\t\t\t\t\t$missonDetails[$m]['comment_time']=time_ago($mission['created_at']);\n\n\t\t\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\n\t\t\t\t\t\t\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t\t\t$previousMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],$previousVersion,'sales');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach($previousMissionDetails as $key=>$vmission)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_name']=$this->seo_product_array[$vmission['product']];\t\t\t\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_source_name']=$this->getLanguageName($vmission['language_source']);\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_type_name']=$this->producttype_array[$vmission['product_type']];\n\t\t\t\t\t\t\t\t\t\tif($vmission['language_dest'])\n\t\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_dest_name']=$this->getLanguageName($vmission['language_dest']);\n\n\t\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$allVersionMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],NULL,'sales');\n\t\t\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t\t\t$table_end='</table>';\n\t\t\t\t\t\t\t\t\t\t$language_versions=$product_type_versions=$volume_versions=$nb_words_versions='';\n\t\t\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\n\t\t\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t \tif($versions['product']=='translation')\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']).\" > \".$this->getLanguageName($vmission['language_dest']);\n\t\t\t\t\t\t\t\t\t\t \telse\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']);\n\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\n\t\t\t\t\t\t\t\t\t\t \t$language_versions.=\"<tr><td>$language</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$product_type_versions.=\"<tr><td>\".$this->producttype_array[$versions['product_type']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$volume_versions.=\"<tr><td>\".$versions['volume'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$nb_words_versions.=\"<tr><td>\".$versions['nb_words'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['unit_price'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_option=$this->duration_array[$versions['mission_length_option']];//$versions['mission_length_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['mission_length'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\t\t\tif($mission['language_source'] !=$previousMissionDetails[0]['language_source'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['language_dest'] !=$previousMissionDetails[0]['language_dest'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['product_type'] !=$previousMissionDetails[0]['product_type'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_versions']=$table_start.$product_type_versions.$table_end;\n\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\t\t\tif($mission['volume'] !=$previousMissionDetails[0]['volume'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_versions']=$table_start.$volume_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($mission['nb_words'] !=$previousMissionDetails[0]['nb_words'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_versions']=$table_start.$nb_words_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($mission['unit_price'] !=$previousMissionDetails[0]['unit_price'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['unit_price_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$current_mission_lenght=$mission['mission_length_option']=='hours' ? ($mission['mission_length']/24) : $mission['mission_length'];\n\t\t\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['mission_length_option']=='hours' ? ($previousMissionDetails[0]['mission_length']/24) : $previousMissionDetails[0]['mission_length'];\n\t\t\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$m++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$quoteDetails[$q]['mission_details']=$missonDetails;\n\n\n\t\t\t\t\t\t//Deleted mission version details\n\t\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\t\t\t\t\t\t\t$deletedMissionVersions=$this->deletedMissionVersions($quote['identifier'],$previousVersion,'sales');\n\t\t\t\t\t\t\tif($deletedMissionVersions)\n\t\t\t\t\t\t\t\t$quoteDetails[$q]['deletedMissionVersions']=$deletedMissionVersions;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t}\t\n\n\t\t\t\t\t$q++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_view->quoteDetails=$quoteDetails;\t\t\t\n\n\t\t\t//getting tech mission details\n\t\t\t$tech_obj=new Ep_Quote_TechMissions();\n\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t$techMissionDetails=$tech_obj->getTechMissionDetails($searchParameters);\n\t\t\tif($techMissionDetails)\n\t\t\t{\n\t\t\t\t$t=0;\n\t\t\t\tforeach($techMissionDetails as $mission)\n\t\t\t\t{\n\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($mission['created_by']);\n\t\t\t\t\t$techMissionDetails[$t]['tech_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t\t$techMissionDetails[$t]['comment_time']=time_ago($mission['created_at']);\n\n\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\tif($quoteDetails[0]['version']>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$previousVersion=($quoteDetails[0]['version']-1);\n\n\t\t\t\t\t\t$techMissionObj=new Ep_Quote_TechMissions();\n\t\t\t\t\t\t$previousMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier'],$previousVersion);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$allVersionMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier']);\n\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t$table_end='</table>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\t\t\t\t\t\t\t\t$title_versions='';\n\n\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$title_versions.=\"<tr><td>\".$versions['title'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['cost'],2).\" &\". $versions['currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$mission_length_option=$versions['delivery_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['delivery_time'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\tif($mission['title'] !=$previousMissionDetails[0]['title'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_difference']='yes';\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_versions']=$table_start.$title_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif($mission['cost'] !=$previousMissionDetails[0]['cost'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['cost_difference']='yes';\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current_mission_lenght=$mission['delivery_option']=='hours' ? ($mission['delivery_time']/24) : $mission['delivery_time'];\n\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['delivery_option']=='hours' ? ($previousMissionDetails[0]['delivery_time']/24) : $previousMissionDetails[0]['delivery_time'];\n\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t$techMissionDetails[$t]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$techMissionDetails[$t]['files'] = \"\";\n\t\t\t\t\tif($mission['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t/* $exploded_file_paths = explode(\"|\",$mission['documents_path']);\n\t\t\t\t\t\t$exploded_file_names = explode(\"|\",$mission['documents_name']);\n\t\t\t\t\t\t$files = \"\";\n\t\t\t\t\t\t$k=0;\n\t\t\t\t\t\tforeach($exploded_file_paths as $row)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$file_path=$this->mission_documents_path.$row;\n\t\t\t\t\t\t\tif(file_exists($file_path) && !is_dir($file_path))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$fname = $exploded_file_names[$k];\n\t\t\t\t\t\t\t\t\tif($fname==\"\")\n\t\t\t\t\t\t\t\t\t\t$fname = basename($row);\n\t\t\t\t\t\t\t\t\t$files .= '<div class=\"topset2\"><a href=\"/quote/download-document?type=tech_mission&mission_id='.$mission['identifier'].'&index='.$k.'\">'.$fname.'</a></div>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$k++;\n\t\t\t\t\t\t} */\n\t\t\t\t\t\t$filesarray = array('documents_path'=>$mission['documents_path'],'documents_name'=>$mission['documents_name'],'id'=>$mission['identifier'],'delete'=>false);\n\t\t\t\t\t\t$files = $this->getTechFiles($filesarray);\n\t\t\t\t\t\t$techMissionDetails[$t]['files'] = $files;\n\t\t\t\t\t}\n\n\t\t\t\t\t$t++;\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->_view->techMissionDetails=$techMissionDetails;\n\t\t\t}\n\n\t\t\t//ALL language list\n\t\t\t$language_array=$this->_arrayDb->loadArrayv2(\"EP_LANGUAGES\", $this->_lang);\n\t\t\t//echo \"<pre>\";print_r($language_array);exit;\n \tnatsort($language_array);\n \t$this->_view->ep_language_list=$language_array;\n\n\t\t\t//getting seo mission details\t\t\t\n\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t$searchParameters['misson_user_type']='seo';\n\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t$seoMissionDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\tif($seoMissionDetails)\n\t\t\t{\n\t\t\t\t$s=0;\n\t\t\t\tforeach($seoMissionDetails as $mission)\n\t\t\t\t{\n\t\t\t\t\t$seoMissionDetails[$s]['files'] = '';\n\t\t\t\t\t$seoMissionDetails[$s]['filenames'] = array();\n\t\t\t\t\t\n\t\t\t\t\t$seoMissionDetails[$s]['product_name']=$this->seo_product_array[$mission['product']];\n\n\t\t\t\t\tif($mission['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$filesarray = array('documents_path'=>$mission['documents_path'],'documents_name'=>$mission['documents_name'],'id'=>$mission['identifier'],'delete'=>true);\n\t\t\t\t\t\t$files = $this->getSeoFiles($filesarray);\n\t\t\t\t\t\t$seoMissionDetails[$s]['files'] = $files;\n\t\t\t\t\t}\n\n\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\tif($quoteDetails[0]['version']>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$previousVersion=($quoteDetails[0]['version']-1);\n\n\t\t\t\t\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t$previousMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],$previousVersion,'seo');\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach($previousMissionDetails as $key=>$vmission)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_name']=$this->seo_product_array[$vmission['product']];\t\t\t\n\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_source_name']=$this->getLanguageName($vmission['language_source']);\n\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_type_name']=$this->producttype_array[$vmission['product_type']];\n\t\t\t\t\t\t\t\tif($vmission['language_dest'])\n\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_dest_name']=$this->getLanguageName($vmission['language_dest']);\n\n\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$allVersionMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],NULL,'seo');\n\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t$table_end='</table>';\n\t\t\t\t\t\t\t\t$product_versions=$language_versions=$product_type_versions=$volume_versions=$nb_words_versions='';\n\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\n\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t \tif($versions['product']=='translation')\n\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']).\" > \".$this->getLanguageName($vmission['language_dest']);\n\t\t\t\t\t\t\t\t \telse\n\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']);\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\n\t\t\t\t\t\t\t\t \t$language_versions.=\"<tr><td>$language</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$product_versions.=\"<tr><td>\".$this->seo_product_array[$versions['product']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$product_type_versions.=\"<tr><td>\".$this->producttype_array[$versions['product_type']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$volume_versions.=\"<tr><td>\".$versions['volume'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$nb_words_versions.=\"<tr><td>\".$versions['nb_words'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['cost'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$mission_length_option=$this->duration_array[$versions['mission_length_option']];//$versions['mission_length_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['mission_length'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\tif($mission['language_source'] !=$previousMissionDetails[0]['language_source'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($mission['language_dest'] !=$previousMissionDetails[0]['language_dest'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($mission['product'] !=$previousMissionDetails[0]['product'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_versions']=$table_start.$product_versions.$table_end;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($mission['product_type'] !=$previousMissionDetails[0]['product_type'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_type_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_type_versions']=$table_start.$product_type_versions.$table_end;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($mission['volume'] !=$previousMissionDetails[0]['volume'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['volume_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['volume_versions']=$table_start.$volume_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($mission['nb_words'] !=$previousMissionDetails[0]['nb_words'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['nb_words_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['nb_words_versions']=$table_start.$nb_words_versions.$table_end;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(number_format($mission['cost'],2) !=number_format($previousMissionDetails[0]['cost'],2))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['unit_price_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current_mission_lenght=$mission['mission_length_option']=='hours' ? ($mission['mission_length']/24) : $mission['mission_length'];\n\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['mission_length_option']=='hours' ? ($previousMissionDetails[0]['mission_length']/24) : $previousMissionDetails[0]['mission_length'];\n\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t$seoMissionDetails[$s]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$s++;\n\n\t\t\t\t}\t\n\t\t\t\t$this->_view->seoMissionDetails=$seoMissionDetails;\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t//check manager is on holiday or not\n\t\t$seoManager_holiday=$this->configval[\"seo_manager_holiday\"];\n\t\t$user_type=$this->adminLogin->type;\n\t\tif($seoManager_holiday=='no' && $user_type=='seouser')\n\t\t\t$this->_view->show_validate='no';\n\t\telse\n\t\t\t$this->_view->show_validate='yes';\n\n\t\t//echo \"<pre>\";print_r($quoteDetails);exit;\n\n\t\t$this->render('seo-quote-review');\n\t}", "public function fetchRandomQuote()\n {\n $idArray = $this->fetchQuoteId();\n // shuffle the array \n shuffle($idArray);\n $randomId = $idArray[0];\n return $this->fetchQuoteDetails($randomId);\n }", "public function getQuote()\n {\n try {\n //make Guzzle request to Nasa api\n $guzzleClient = new GuzzleClient;\n $response = $guzzleClient->get($this->url);\n $responseBody = $response->getBody();\n $result = json_decode($responseBody);\n } catch (GuzzleRequestException $e){\n $result = json_decode($e->getResponse()->getBody());\n }\n\n return $result;\n }", "public function createQuote()\n\t{\n\t\t$this->setType($_POST['frmquotetype']);\n\t\t$this->setDate($_POST['frmquotedate']);\n\t\t$this->setStatus('Open');\n\t\t$this->setJobName($_POST['frmjobname']);\n\t\t$this->setJobAddress($_POST['frmjobaddress']);\n\t\t$this->setJobCity($_POST['frmjobcity']);\n\t\t$this->setJobZipcode($_POST['frmjobzipcode']);\n\t\t$this->setAttention($_POST['frmattn']);\n\t\t// Here we are going to post the tax rate and turn it into a float.\n\t\t$unformatted_tax_rate = $_POST['frmtaxrate'];\n\t\t$this->setTaxRate((float)$unformatted_tax_rate);\n\t\t$this->setCostBeforeTax($_POST['cartBeforeTaxCost']);\n\t\t$this->setTotalCost($_POST['cartTotalCost']);\n\t\t$this->setSalesTax($_POST['cartTax']);\n\t\t$this->setMonthlyTotal($_POST['cartMonthlyTotal']);\n\t\t$this->setDeliveryTotal($_POST['cartDeliveryTotal']);\n\t\t$this->setHidden(null);\n\n\t\t// Need to insert the new order into the database.\n\t\t$this->getDB()->insert('quotes', [\n\t\t\t\t'quote_customer' \t\t=> $this->getCustomer(),\n\t\t\t\t'quote_customer_id' \t=> $this->getCustomerId(),\n\t\t\t\t'quote_date' \t\t\t=> $this->getDate(),\n\t\t\t\t'quote_status' \t\t\t=> $this->getStatus(),\n\t\t\t\t'quote_type' \t\t\t=> $this->getType(),\n\t\t\t\t'job_name' \t\t\t\t=> $this->getJobName(),\n\t\t\t\t'job_city' \t\t\t\t=> $this->getJobCity(),\n\t\t\t\t'job_address' \t\t\t=> $this->getJobAddress(),\n\t\t\t\t'job_zipcode' \t\t\t=> $this->getJobZipcode(),\n\t\t\t\t'attn' \t\t\t\t\t=> $this->getAttention(),\n\t\t\t\t'tax_rate' \t\t\t\t=> $this->getTaxRate(),\n\t\t\t\t'cost_before_tax' \t\t=> $this->getCostBeforeTax(),\n\t\t\t\t'total_cost' \t\t\t=> $this->getTotalCost(),\n\t\t\t\t'sales_tax' \t\t\t=> $this->getSalesTax(),\n\t\t\t\t'monthly_total' \t\t=> $this->getMonthlyTotal(),\n\t\t\t\t'delivery_total'\t\t=> $this->getDeliveryTotal(),\n\t\t\t\t'hidden'\t\t\t\t=> $this->getHidden()\n\t\t\t]);\n\n\t\t// If properly inserted, grab the ID, else throw error.\n\t\tif($this->getDB()->lastId() != null)\n\t\t{\n\t\t\t$this->id = $this->getDB()->lastId();\n\t\t} \n\t\telse \n\t\t{\n\t\t\tthrow new Exception(\"There was an error inserting the quote into the database.\");\n\t\t}\n\t\t\n\t}", "public function saveSendTeamQuoteAction()\n\t{\n\t\tif($this->_request-> isPost() && $this->adminLogin->userId) \n {\n\t\t\t$final_parameters=$this->_request->getParams();\n\n\t\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\t\t//echo \"<pre>\";print_r($final_parameters);exit;\n\n\t\t\t//insert Quotes\n\t\t\t$quotes_data['title']=$this->quote_creation->create_mission['quote_title'];\n\t\t\t$quotes_data['client_id']=$this->quote_creation->create_step1['client_id'];\n\t\t\t$quotes_data['category']=$this->quote_creation->create_step1['category'];\n\t\t\tif($quotes_data['category']=='other')\n\t\t\t\t\t$quotes_data['category_other']=isodec($this->quote_creation->create_step1['category_other']);\n\t\t\tif($this->quote_creation->create_step1['client_websites'])\n\t\t\t$quotes_data['websites']=implode(\"|\",$this->quote_creation->create_step1['client_websites']);\n\t\t\t$quotes_data['quote_by']=$this->quote_creation->create_step1['quote_by'];\n\t\t\t$quotes_data['created_by']=$this->adminLogin->userId;\n\t\t\t$quotes_data['sales_suggested_price']=0;\n\t\t\t$quotes_data['sales_suggested_currency']=$this->quote_creation->create_step1['currency'];\n\t\t\t$quotes_data['sales_comment']=$final_parameters['bo_comments'];\n\t\t\t$quotes_data['client_email_text']=$final_parameters['client_email'];\n\t\t\t$quotes_data['conversion']=$this->quote_creation->create_step1['conversion'];\n\n\t\t\t//$quotes_data['sales_delivery_time']=$final_parameters['delivery_time'];\n\t\t\t//$quotes_data['sales_delivery_time_option']=$final_parameters['delivery_option'];\n\t\t\t$quotes_data['client_know']=$final_parameters['client_know']? 'no':'yes';\n\t\t\t$quotes_data['urgent']=$final_parameters['urgent']? 'yes':'no';\n\t\t\t$quotes_data['urgent_comments']=$final_parameters['urgent_comments']?$final_parameters['urgent_comments']:NULL;\t\t\t\n\t\t\n\t\t\t/*$quotes_data['market_team_sent']=$final_parameters['market_team_sent'];\n\t\t\tif($quotes_data['market_team_sent']=='yes')\n\t\t\t\t$quotes_data['from_platform']=$final_parameters['from_platform']; */\n\t\t\t\t\n\t\t\t$quotes_data['quote_type']=$this->quote_creation->create_step1['quote_type'];\t\n\n\t\t\t\n\t\t\t//NEW QUOTE FILEDS \n\t\t\t$client_aims=$final_parameters['client_aims'];\n\t\t\t$quotes_data['client_aims']=implode(\",\",$client_aims);\n\n\t\t\tforeach($client_aims as $aim)\n\t\t\t{\n\t\t\t\t$client_prio[]=$final_parameters['priority_'.$aim];\n\t\t\t}\n\t\t\t$quotes_data['client_prio']=implode(\",\",$client_prio);\n\n\t\t\t$client_aims_comments=$final_parameters['client_aims_comments'];\n\t\t\t$quotes_data['client_aims_comments']=$client_aims_comments;\n\n\n\t\t\t$content_ordered_agency=$final_parameters['content_ordered_agency'];\n\t\t\t$quotes_data['content_ordered_agency']=$content_ordered_agency;\n\t\t\tif($content_ordered_agency=='yes')\n\t\t\t{\n\t\t\t\tif($final_parameters['agency']=='dont_know')\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['agency']=$final_parameters['agency'];\n\t\t\t\t\t$quotes_data['agency_name']='';\n\t\t\t\t}\n\t\t\t\telseif($final_parameters['agency_name'])\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['agency']='';\n\t\t\t\t\t$quotes_data['agency_name']=$final_parameters['agency_name'];\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse if($content_ordered_agency=='no')\n\t\t\t{\n\t\t\t\t$quotes_data['client_internal_team']=$final_parameters['client_internal_team'];\n\t\t\t}\n\n\t\t\t$quotes_data['client_know_writers']=$final_parameters['client_know_writers'];\n\n\t\t\t$volume_option=$final_parameters['volume_option'];\n\t\t\t$quotes_data['volume_option']=$volume_option;\n\t\t\tif($volume_option=='per')\n\t\t\t{\n\t\t\t\t$quotes_data['volume_option_multi']=$final_parameters['volume_option_multi'];\n\t\t\t}\n\t\t\telse if($volume_option=='every')\n\t\t\t{\n\t\t\t\t$quotes_data['volume_option_multi']=$final_parameters['volume_option_multi_every'];\n\t\t\t\t$quotes_data['volume_every']=$final_parameters['volume_every'];\n\t\t\t}\n\n\t\t\t$budget_marketing=$final_parameters['budget_marketing'];\n\t\t\tif($budget_marketing=='dont_know')\n\t\t\t{\n\t\t\t\t$quotes_data['budget_marketing']=$budget_marketing;\n\t\t\t\t$quotes_data['budget']='';\n\t\t\t\t$quotes_data['budget_currency']='';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$quotes_data['budget_marketing']='';\n\t\t\t\t$quotes_data['budget']=$final_parameters['budget'];\n\t\t\t\t$quotes_data['budget_currency']=$final_parameters['budget_currency'];\n\t\t\t}\t\n\n\t\t\t$quotes_data['estimate_sign_percentage']=$final_parameters['estimate_sign_percentage'];\n\t\t\t$quotes_data['estimate_sign_date']=$final_parameters['estimate_sign_date'];\n\t\t\t$quotes_data['estimate_sign_comments']=$final_parameters['estimate_sign_comments'];\n\n\n\t\t\t//Quote current version\n\t\t\tif($this->quote_creation->custom['version'])\n\t\t\t{\n\t\t\t\t$version=$this->quote_creation->custom['version'];\n\t\t\t}\n\t\t\telse\n\t\t\t\t$version=1;\n\t\t\t$quotes_data['version']=$version;\n\n\t\t\t//Getting Quote details if quote id available\n\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\tif($quoteIdentifier)\n\t\t\t{\n\t\t\t\t$quoteEditDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t$sales_review_staus=$quoteEditDetails[0]['sales_review'];\n\t\t\t}\t\t\n\n\t\t\t\n\t\t\t//Staus of tech,seo,prod and sales\n\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')//new version quote\n\t\t\t{\n\t\t\t\t$quotes_data['quote_send_team']=$final_parameters['quote_send_team'];\n\n\t\t\t\tif(($final_parameters['quote_send_team']=='send_sales_team'))\n\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t$quotes_data[\"sales_validation_expires\"]=time()+($this->configval['sales_validation_timeline']*60*60);\t\t\t\t\t\t\n\t\t\t\t\t$prod_hours=$this->configval['sales_validation_timeline'];\n\t\t\t\t\t$onlySales=true;\n\t\t\t\t}\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_tech_team')\n\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\t\t\t\t\t\t\n\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\n\t\t\t\t\t$quotes_data['tech_timeline']=NULL;\n\t\t\t\t\t$quotes_data['tech_challenge_comments']='';\n\t\t\t\t\t$quotes_data['tech_challenge']='yes';\n\t\t\t\t}\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_seo_team')\n\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t$quotes_data['seo_review']='not_done';\t\t\t\t\t\t\t\n\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\n\t\t\t\t\t$quotes_data['seo_timeline']=NULL;\n\t\t\t\t\t$quotes_data['seo_comments']='';\n\t\t\t\t\t$quotes_data['seo_challenge']='yes';\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\telseif($this->quote_creation->custom['action']=='edit' && !$this->quote_creation->custom['create_new_version']) //quote edit\n\t\t\t{\t\n\t\t\t\t\n\t\t\t\t$oldTechReview=$quoteEditDetails[0]['tec_review'];\n\t\t\t\t$oldSeoReview=$quoteEditDetails[0]['seo_review'];\n\n\t\t\t\tif(($final_parameters['quote_send_team']=='send_sales_team'))\n\t\t\t\t{\t\n\n\t\t\t\t\t$quotes_data[\"sales_validation_expires\"]=time()+($this->configval['sales_validation_timeline']*60*60);\n\t\t\t\t}\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_tech_team')\n\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t//restart tech review \n\t\t\t\t\tif($oldTechReview=='auto_skipped' || $oldTechReview=='skipped' || $oldTechReview=='not_done')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\n\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t}\n\t\t\t\t\telseif($oldTechReview=='challenged' || $oldTechReview=='validated')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='challenged';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_seo_team')\n\t\t\t\t{\n\t\t\t\t\t//restart seo review \n\t\t\t\t\tif($oldSeoReview=='auto_skipped' || $oldSeoReview=='skipped' || $oldSeoReview=='not_done')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t}\n\t\t\t\t\telseif($oldSeoReview=='challenged' || $oldSeoReview=='validated')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['seo_review']='challenged';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif($tech_seo_time)\n\t\t\t\t\t$quotes_data[\"response_time\"]=time()+($tech_seo_time*60*60);\n\t\t\t\t$edited=TRUE;\t\t\t\t\n\t\t\t}\n\t\t\telse//quote creation v1\n\t\t\t{\n\t\t\t\tif(isset($final_parameters['send_team_quote']))\n\t\t\t\t{\n\t\t\t\t\tif($quotes_data['quote_type']=='only_tech')\n\t\t\t\t\t\t$quotes_data['quote_send_team']='send_tech_team';\n\t\t\t\t\telseif($quotes_data['quote_type']=='only_seo')\n\t\t\t\t\t\t$quotes_data['quote_send_team']='send_seo_team';\n\n\t\t\t\t\tif($quotes_data['quote_type']=='only_tech')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t$quotes_data['seo_review']='auto_skipped';\n\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t}\n\t\t\t\t\telse if($quotes_data['quote_type']=='only_seo')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='auto_skipped';\t\n\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$quotes_data[\"response_time\"]=time()+($this->configval['quote_sent_timeline']*60*60);\n\t\t\t\t\t$quote_end_hours=$this->configval['quote_end_time'];\n\t\t\t\t\t\n\t\t\t\t\t$quotes_data['quote_delivery_hours']=($tech_seo_time+$quote_end_hours);\n\t\t\t\t}\n\t\t\t}\t\t\n\n\t\t\t//echo \"<pre>\";print_r($quotes_data);print_r($final_parameters);exit;\n\n\n\t\t\t//versioning when edited validated quote\n\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')\n\t\t\t{\n\t\t\t\t//Insert this quote in to Quote version table\n\t\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\t\tif($quoteIdentifier)\n\t\t\t\t{\n\t\t\t\t\t$quote_obj->insertQuoteVersion($quoteIdentifier);\n\n\t\t\t\t\t//versioning Tech missions\n\t\t\t\t\t$techMissionObj=new Ep_Quote_TechMissions();\n\t\t\t\t\t$techParams['quote_id']=$quoteIdentifier;\n\t\t\t\t\t$techMissionsDetails=$techMissionObj->getTechMissionDetails($techParams);\n\t\t\t\t\tif($techMissionsDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($techMissionsDetails as $techMission)\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$techMissionId=$techMission['identifier'];\n\t\t\t\t\t\t\t$techMissionObj->insertMissionVersion($techMissionId);\n\n\t\t\t\t\t\t\t//update tech version\n\t\t\t\t\t\t\t$update_tech['version']=$version;\n\t\t\t\t\t\t\t$techMissionObj->updateTechMission($update_tech,$techMissionId);\n\t\t\t\t\t\t\t//if($quotes_data['tec_review']=='auto_skipped')\n\t\t\t\t\t\t\t\t//$techMissionObj->deleteTechMission($techMissionId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\n\t\t\t\t\t//versioning SEO missions\n\t\t\t\t\t$seoParameters['quote_id']=$quoteIdentifier;\n\t\t\t\t\t$seoParameters['misson_user_type']='seo';\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t$seoMissionDetails=$quoteMission_obj->getMissionDetails($seoParameters);\n\t\t\t\t\tif($seoMissionDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($seoMissionDetails as $seoMission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$seoMissionId=$seoMission['identifier'];\n\t\t\t\t\t\t\t$quoteMission_obj->insertMissionVersion($seoMissionId);\t\n\n\t\t\t\t\t\t\t//update seo mission version\n\t\t\t\t\t\t\t$update_seo['version']=$version;\n\t\t\t\t\t\t\t$quoteMission_obj->updateQuoteMission($update_seo,$seoMissionId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\t\n\n\n\t\t\t\t$quotes_data['sales_review']='not_done';\t\t\t\t\n\t\t\t\t$quotes_data['sales_margin_percentage']=0;\t\t\t\t\n\t\t\t\t//$quotes_data['techmissions_assigned']='';\t\n\t\t\t\t$quotes_data['created_at']=date(\"Y-m-d H:i:s\");\t\n\t\t\t\t$quotes_data['updated_at']=NULL;\n\t\t\t\t\n\t\t\t\t$quotes_data['final_turnover']=0;\n\t\t\t\t$quotes_data['final_margin']=0;\n\t\t\t\t$quotes_data['final_mission_length']=0;\n\n\t\t\t\t$quotes_data['closed_comments']='';\n\t\t\t\t//$quotes_data['prod_timeline']=0;\n\t\t\t\t$quotes_data['signed_comments']=NULL;\n\t\t\t\t$quotes_data['signed_at']=NULL;\n\t\t\t\t$quotes_data['sign_expire_timeline']=NULL;\n\t\t\t\t$quotes_data['closed_reason']=NULL;\t\t\t\t\n\t\t\t\t$quotes_data['boot_customer']=NULL;\n\n\t\t\t}\n\t\t\n\t\t\t//echo \"<pre>\";;print_r($this->quote_creation->custom);print_r($quotes_data);exit;\n\t\t\t//echo \"<pre>\";print_r($this->quote_creation->create_mission['quote_missions']);print_r($quotes_data);exit;\n\n\t\t\ttry\n\t\t\t{ \t\n\t\t\t\tif($this->quote_creation->custom['quote_id'])\n\t\t\t\t{\t\n\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['updated_at']=date(\"Y-m-d H:i:s\");\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\t\t\t\n\t\t\t\t\t$quote_obj->updateQuote($quotes_data,$quoteIdentifier);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\n\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t\t$quotes_data['created_at']=date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\n\t\t\t\t\t$quote_obj->insertQuote($quotes_data);\n\t\t\t\t\t$quoteIdentifier=$quote_obj->getIdentifier();\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(count($_FILES['quote_documents']['name'])>0)\t\n\t\t\t\t{\n\t\t\t\t\t$update = false;\n\t\t\t\t\t$documents_path=array();\n\t\t\t\t\t$documents_name=array();\n\t\t\t\t\tforeach($_FILES['quote_documents']['name'] as $index=>$quote_files)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($_FILES['quote_documents']['name'][$index]):\n\t\t\t\t\t\t//upload quote documents\n\t\t\t\t\t\n\t\t\t\t\t\t$quoteDir=$this->quote_documents_path.$quoteIdentifier.\"/\";\n\t\t if(!is_dir($quoteDir))\n\t\t mkdir($quoteDir,TRUE);\n\t\t chmod($quoteDir,0777);\n\t\t $document_name=frenchCharsToEnglish($_FILES['quote_documents']['name'][$index]);\n\t\t\t\t\t\t$pathinfo = pathinfo($document_name);\n\t\t\t\t\t\t$document_name =$pathinfo['filename'].rand(100,1000).\".\".$pathinfo['extension'];\n\t\t $document_name=str_replace(' ','_',$document_name);\n\t\t $document_path=$quoteDir.$document_name;\n\t\t if (move_uploaded_file($_FILES['quote_documents']['tmp_name'][$index], $document_path))\n\t\t chmod($document_path,0777);\n\t\n\t\t\t\t\t\t\t$update = true;\n\t\t $documents_path[]=$quoteIdentifier.\"/\".$document_name;\n\t\t $documents_name[]= str_replace('|',\"_\",$final_parameters['document_name'][$index]);\n\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t}\n\t\t\t\t\tif($update)\n\t\t\t\t\t{\n\t\t\t\t\t\t $quotes_update_data = array();\n\t\t\t\t\t\t $quoteDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t\t\t $uploaded_documents1 = explode(\"|\",$quoteDetails[0]['documents_path']);\n\t\t\t\t\t\t $documents_path =array_merge($documents_path,$uploaded_documents1);\n\t\t\t\t\t\t $quotes_update_data['documents_path']=implode(\"|\",$documents_path);\n\t\t\t\t\t\t $document_names =explode(\"|\",$quoteDetails[0]['documents_name']);\n\t\t\t\t\t\t $documents_name =array_merge($documents_name,$document_names);\n\t\t\t\t\t\t $quotes_update_data['documents_name']=implode(\"|\",$documents_name);\n\t\t\t\t\t\t $quote_obj->updateQuote($quotes_update_data,$quoteIdentifier);\n\t\t\t\t\t}\n\t\t\t\t\t//echo \"<pre>\";print_r($quotes_update_data);print_r($documents_name);exit;\n\t \n\t } \n\t\t\t\t\n\t\t\t\t//Insert Quote log\n\n\t\t\t\t$log_params['quote_id']\t= $quoteIdentifier;\n\t\t\t\t$log_params['bo_user']\t= $this->adminLogin->userId;\n\t\t\t\t$log_params['quote_size']=$quotes_data['sales_suggested_price'] < 5000 ? \"small\" :\"big\";\n\t\t\t\t$log_params['urgent']\t= $final_parameters['urgent']? 'urgent':'';\n\t\t\t\t$log_params['version']\t= $version;\t\t\t\t\t\n\t\t\t\t$log_params['created_date']\t= date(\"Y-m-d H:i:s\");\n\n\t\t\t\t$log_obj=new Ep_Quote_QuotesLog();\n\t\t\t\tif($edited)\n\t\t\t\t{\n\t\t\t\t\t$log_params['action']\t= 'quote_updated';\n\t\t\t\t\t$actionId=9;\n\n\t\t\t\t\tif($final_parameters['quote_updated_comments'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$log_params['comments']=$final_parameters['quote_updated_comments'];\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$log_params['action']\t= 'quote_created';\n\t\t\t\t\t$actionId=1;\t\n\n\t\t\t\t\tif($final_parameters['bo_comments'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$log_params['comments']=$final_parameters['bo_comments'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$log_obj->insertLog($actionId,$log_params);\t\t\t\n\t\t\t\t\n\t\t\t\t//echo \"<pre>\";print_r($log_params);exit;\n\n\t\t\t}\n\t\t\tcatch(Zend_Exception $e)\n {\n echo $e->getMessage();exit; \n\n }\n\n\t\t\t//sending email to seo &tech OR Prod to challenge after creating the quote\n\t\t\tif(!$edited)\n\t\t\t{\n\t\t\t\t$client_obj=new Ep_Quote_Client();\t\n\t\t\t\t\n\t\t\t\tif($quotes_data['quote_type']=='only_tech')\n\t\t\t\t\t$email_users=$get_head_tech_seos=$client_obj->getEPContacts('\"techuser\",\"techmanager\"');\n\t\t\t\telseif($quotes_data['quote_type']=='only_seo')\t\n\t\t\t\t\t$email_users=$get_head_tech_seos=$client_obj->getEPContacts('\"seouser\",\"seomanager\"');\n\t\t\t\tif(count($email_users)>0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tforeach($email_users as $user=>$name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t$mail_parameters['bo_user']=$user;\n\t\t\t\t\t\t$mail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t$mail_parameters['quote_title']=$quotes_data['title'];\n\t\t\t\t\t\t$mail_parameters['sales_suggested_price']=$quotes_data['sales_suggested_price'].\" \".$quotes_data['sales_suggested_currency'].\"s\";\n\t\t\t\t\t\t$mail_parameters['challenge_link']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\n\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,142,$mail_parameters); \t\n\t\t \t}\n\t\t }\t\t\t\n\t\t\t\t\n\t\t\t}\n\n\n\n\t\t\t//intimation email to facturation and created user\n\t\t\tif(!$edited)\n\t\t\t{\n\t\t $client_obj=new Ep_Quote_Client();\n\t\t //$intimate_users=$client_obj->getEPContacts('\"facturation\"');\n\t\t //$intimate_users[$this->adminLogin->userId]=$this->adminLogin->userId;\n\t\t $intimate_users=array('138960180336581'=>'[email protected]',\n\t\t \t\t\t\t\t '139282188375889'=>'[email protected]',\n\t\t \t\t\t\t\t '141745044124851'=>'[email protected]'\n\t\t \t\t\t\t\t );//[email protected], [email protected] and [email protected]\n\t\t if(count($intimate_users)>0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tforeach($intimate_users as $user=>$name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t$mail_parameters['bo_user']=$user;\n\t\t\t\t\t\t$mail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t//$mail_parameters['quote_title']=$quotes_data['title'];\n\t\t\t\t\t\t//$mail_parameters['sales_suggested_price']=$quotes_data['sales_suggested_price'].\" \".$quotes_data['sales_suggested_currency'].\"s\";\n\t\t\t\t\t\t//$mail_parameters['followup_link_en']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\t\t\t\t\t\t$mail_parameters['validate_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.'&submenuId=ML13-SL2';\n\n\t\t\t\t\t\t$mail_parameters['client_name']=$this->quote_creation->create_mission['company_name'];\n\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,174,$mail_parameters); \t\n\t\t \t}\n\t\t } \n\t\t }\n\n\n\n\t\t //When a quote has been closed and then reactivated, the reason why sales has closed the quote the first time should be communicated to the concerned BO users \n\t\t if($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes' && $sales_review_staus=='closed')\n\t\t {\n\t\t \t\t\n\t\t \t$challengers=$this->getImpactedChallengers($quoteIdentifier,$final_parameters['quote_send_team']);\n\t\t\t\tif(count($challengers)>0)\n\t\t\t\t{\n\t\t\t\t\tforeach($challengers as $impactUser)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($impactUser!=$this->adminLogin->userId)\n\t\t\t\t\t\t{\t\n\t\t\t\t \t\t$cmail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t$receiver_id=$impactUser;\n\t\t\t\t\t\t\t$cmail_parameters['bo_user']=$impactUser;\n\t\t\t\t\t\t\t$cmail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t\t$cmail_parameters['quote_title']=$quotes_data['title'];\t\n\t\t\t\t\t\t\t$cmail_parameters['client_name']=$this->quote_creation->create_mission['company_name'];\n\t\t\t\t\t\t\t$cmail_parameters['closed_reason']=$this->closedreason[$quoteEditDetails[0]['closed_reason']];\n\t\t\t\t\t\t\t$cmail_parameters['closed_comments']=$quoteEditDetails[0]['closed_comments'];\n\t\t\t\t\t\t\t$cmail_parameters['validate_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.'&submenuId=ML13-SL2';\n\t\t\t\t\t\t\t$cmail_obj->sendQuotePersonalEmail($receiver_id,180,$cmail_parameters);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t \t\n\t\t }\n\t\t //exit;\n\n unset($this->quote_creation->create_step1);\n unset($this->quote_creation->create_mission);\n unset($this->quote_creation->select_missions);\n unset($this->quote_creation->custom);\n\t\t\tunset($this->quote_creation->send_quote);\n\t\t\tunset($this->quote_creation->send_team_quote);\n\t\t\tif($edited)\n\t\t\t{\n \t$this->_helper->FlashMessenger('Devis updat&eacute; avec succ&egrave;s');\n\t\t\t}\n else\n {\n \t$this->_helper->FlashMessenger('Devis cr&eacute;e avec succ&egrave;s');\n\n \tif($onlySales)\n \t\t$this->_helper->FlashMessenger('Onlysales');\n \telse if($quotes_data['quote_type']=='only_tech')\n\t\t\t\t\t$this->_helper->FlashMessenger('Onlytech');\n\t\t\t\telse if($quotes_data['quote_type']=='only_seo')\n\t\t\t\t\t$this->_helper->FlashMessenger('Onlyseo');\n }\n\t\t\t\n $this->_redirect(\"/quote/sales-quotes-list?submenuId=ML13-SL2\");\n\t\t}\t\n\t}", "function buy_sell($pairing_id,$amount,$rate,$type){\n\tif($ch = curl_init ()){\n\t\t$data['pairing'] = $pairing_id;//btc/thb\n\t\t$data['amount'] = $amount;\n\t\t$data['rate'] = $rate;\n\t\t$data['type'] = $type;\n\t\t$data['key'] = 'xxx';\n\t\t$mt = explode(' ', microtime());\n\t\t$nonce = $mt[1].substr($mt[0], 2, 6);\n\t\t$data['nonce'] = $nonce;\n\t\t$data['signature'] = hash('sha256', 'xxx'.$nonce.'xxx');\n\t\t// if($this->twofa != ''){\n\t\t\t// $data['twofa'] = $this->twofa;\n\t\t// }\n\t\t\n\t\tcurl_setopt ( $ch, CURLOPT_URL, 'https://bx.in.th/api/order/');\n\t\tcurl_setopt ( $ch, CURLOPT_FOLLOWLOCATION, false );\n\t\tcurl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 5 );\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, false );\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, false ); \n\t\tcurl_setopt ( $ch, CURLOPT_POST, count($data));\n\t\tcurl_setopt ( $ch, CURLOPT_POSTFIELDS,$data);\n\t\t\n\t\t$str = curl_exec ( $ch );\n\t\n\t\tcurl_close ( $ch );\n\t\t\n\t\t$str = json_decode($str);\n\t\n\t\treturn $str;\n\n\t}\n\n}", "function bunq_CreateRequest($amount, $description, $redirect, $user = 0, $account = 0) {\n\n\t$apiContext = ApiContext::restore(ApiContext::FILENAME_CONFIG_DEFAULT);\n\t$users = User::listing($apiContext)->getValue();\n\t//$user = $users[$user]->getUserPerson();\n\t$user = $users[$user]->getUserCompany();\n\t$userId = $user->getId();\n\t$monetaryAccounts = MonetaryAccount::listing($apiContext, $userId)->getValue();\n\t$monetaryAccount = $monetaryAccounts[$account]->getMonetaryAccountBank();\n\t$monetaryAccountId = $monetaryAccount->getId();\n\t$requestMap = [\n\t\tBunqMeTab::FIELD_BUNQME_TAB_ENTRY => [\n\t\t\tBunqMeTabEntry::FIELD_AMOUNT_INQUIRED => new Amount($amount, 'EUR'),\n\t\t\tBunqMeTabEntry::FIELD_REDIRECT_URL => $redirect,\n\t\t\tBunqMeTabEntry::FIELD_DESCRIPTION => $description\n\t\t]\n\t];\n\t$createBunqMeTab = BunqMeTab::create($apiContext, $requestMap, $userId, $monetaryAccountId)->getValue();\n\t$bunqMeRequest = BunqMeTab::get($apiContext, $userId, $monetaryAccountId, $createBunqMeTab)->getValue();\n\t$r[\"id\"] = $bunqMeRequest->getId();\n\t$r[\"uuid\"] = $bunqMeRequest->getBunqmeTabEntry()->getUuid();\n\t$r[\"amount\"] = $bunqMeRequest->getBunqmeTabEntry()->getAmountInquired()->getValue();\n\t$r[\"paymentlink\"] = $bunqMeRequest->getBunqmeTabShareUrl();\n\t$r[\"status\"] = $bunqMeRequest->getBunqmeTabEntry()->getStatus();\n\t$r[\"description\"] = $bunqMeRequest->getBunqmeTabEntry()->getDescription();\n\t$r[\"redirecturl\"] = $bunqMeRequest->getBunqmeTabEntry()->getRedirectUrl();\n\t$r[\"raw\"] = $bunqMeRequest;\n\treturn $r;\n\n}", "abstract public function request();", "public function delete_quote_get() {\n extract($_GET);\n $response = $this->QuotationForEnquiry_model->delete_quote($quotation_id);\n return $this->response($response);\n }", "public function needMoreInfoAction()\n\t{\n\n\t\tif($this->_request->isPost())\n\t\t{\n\n\t\t\t$info_parameters=$this->_request->getParams();\n\n\t\t\t$quote_id=$info_parameters['quote_id'];\n\t\t\t$comments=$info_parameters['more_info_comments'];\n\t\t\t$team=$info_parameters['team_review'];\n\n\t\t\t//echo \"<pre>\";print_r($info_parameters);exit;\n\n\t\t\t//quote details\n\t\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t\t$quoteDetails=$quoteObj->getQuoteDetails($quote_id);\n\t\t\t$version=$quoteDetails[0]['version'];\n\t\t\t$client_id=$quoteDetails[0]['client_id'];\n\n\t\t\t//client details\n\t\t\t$client_obj=new Ep_Quote_Client();\t\n\t\t\t$client_details=$client_obj->getClientDetails($client_id);\n\t\t\t$client_name=$client_details[0]['company_name'];\n\n\t\t\tif($quote_id && $comments)\n\t\t\t{\n\t\t\t\t//Insert Quote log\n\t\t\t\t$log_params['quote_id']\t= $quote_id;\n\t\t\t\t$log_params['bo_user']\t= $this->adminLogin->userId;\t\t\t\t\t\n\t\t\t\t$log_params['version']\t= $version;\n\t\t\t\t$log_params['action']\t= $team.'_need_more_info';\t\t\t\t\n\t\t\t\t$log_params['comments']=$comments;\n\t\t\t\t$log_obj=new Ep_Quote_QuotesLog();\n\t\t\t\t$quiteActionId=30;\n\t\t\t\t$log_obj->insertLog($quiteActionId,$log_params);\n\n\n\n\t\t\t\t//sending email to sales incharge\n\t\t\t\t$cmail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t$receiver_id=$quoteDetails[0]['created_by'];\n\t\t\t\t$cmail_parameters['bo_user']=$this->adminLogin->userId;\n\t\t\t\t$cmail_parameters['sales_user']=$receiver_id;\n\t\t\t\t$cmail_parameters['quote_title']=$quotes_data['title'];\t\n\t\t\t\t$cmail_parameters['client_name']=$client_name;\n\t\t\t\t$cmail_parameters['bo_user_comments']=$comments;\n\t\t\t\t$cmail_parameters['validate_link']='/quote/create-quote-step1?qaction=edit&quote_id='.$quote_id.'&submenuId=ML13-SL2';\n\t\t\t\t$cmail_obj->sendQuotePersonalEmail($receiver_id,181,$cmail_parameters);\n\n\n\t\t\t}\n\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($receiver_id);\t\t\t\n\t\t\t$sales_user_name=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\t\n\n\t\t\t$this->_helper->FlashMessenger('Votre commentaire a bien &eacute;t&eacute; envoy&eacute; &agrave; '.$sales_user_name);\n\n\t\t\tif($team=='tech')\n\t\t\t\t$this->_redirect(\"/quote/tech-quote-review?quote_id=$quote_id&submenuId=ML13-SL2\");\n\t\t\telse if($team=='seo')\n\t\t\t\t$this->_redirect(\"/quote/seo-quote-review?quote_id=$quote_id&submenuId=ML13-SL2\");\n\t\t\telse if($team=='prod')\n\t\t\t\t$this->_redirect(\"/quote/prod-quote-review?quote_id=$quote_id&submenuId=ML13-SL2\");\n\t\t}\t\n\t}", "public function query(QueryServiceQuotesRequest $request)\n {\n $payload = $request->input('payload');\n $currency = $request->input('currency');\n $facilitator = $request->input('facilitator');\n $scheduledAt = $request->input('scheduled_at');\n $service = $request->input('service', 'all'); // the specific service rate to query - defaults to `all`\n $serviceType = $request->input('service_type'); // the specific type of service rate to query\n $single = $request->boolean('single');\n $isRouteOptimized = $request->boolean('is_route_optimized', true);\n $requestId = ServiceQuote::generatePublicId('request');\n\n if (Utils::isPublicId($payload)) {\n $payload = Payload::with(['pickup', 'dropoff', 'waypoints', 'entities'])\n ->where('public_id', $payload)\n ->first();\n }\n\n if (!$payload instanceof Payload) {\n return $this->queryFromPreliminary($request);\n }\n\n // if facilitator is an integrated partner resolve service quotes from bridge\n if ($facilitator && Str::startsWith($facilitator, 'integrated_vendor')) {\n $integratedVendor = IntegratedVendor::where('public_id', $facilitator)->first();\n $serviceQuotes = [];\n\n if ($integratedVendor) {\n try {\n $serviceQuotes = $integratedVendor->api()->setRequestId($requestId)->getQuoteFromPayload($payload, $serviceType, $scheduledAt, $isRouteOptimized);\n } catch (\\Exception $e) {\n return response()->json([\n 'errors' => [$e->getMessage()]\n ], 400);\n }\n }\n\n // send single quote back\n if ($single) {\n return new ServiceQuoteResource($serviceQuotes);\n }\n\n if (!is_array($serviceQuotes)) {\n $serviceQuotes = [$serviceQuotes];\n }\n\n return ServiceQuoteResource::collection($serviceQuotes);\n }\n\n // get all waypoints\n $waypoints = $payload->getAllStops()->mapInto(Place::class);\n\n // if quote for single service\n if ($service && $service !== 'all') {\n $serviceRate = ServiceRate::where('uuid', $service)->where(function ($q) use ($currency) {\n if ($currency) {\n $q->where(DB::raw(\"lower(currency)\"), strtolower($currency));\n }\n })->first();\n $serviceQuotes = collect();\n\n if ($serviceRate) {\n [$subTotal, $lines] = $serviceRate->quote($payload);\n\n $quote = ServiceQuote::create([\n 'request_id' => $requestId,\n 'company_uuid' => $serviceRate->company_uuid,\n 'service_rate_uuid' => $serviceRate->uuid,\n 'amount' => $subTotal,\n 'currency' => $serviceRate->currency,\n ]);\n\n $items = $lines->map(function ($line) use ($quote) {\n return ServiceQuoteItem::create([\n 'service_quote_uuid' => $quote->uuid,\n 'amount' => $line['amount'],\n 'currency' => $line['currency'],\n 'details' => $line['details'],\n 'code' => $line['code'],\n ]);\n });\n\n $quote->setRelation('items', $items);\n $serviceQuotes->push($quote);\n\n // if single quotation requested\n if ($single) {\n return new ServiceQuoteResource($quote);\n }\n\n return ServiceQuoteResource::collection($serviceQuotes);\n }\n }\n\n // get all service rates\n $serviceRates = ServiceRate::getServicableForPlaces(\n $waypoints,\n $serviceType,\n $currency,\n function ($query) use ($request) {\n $query->where('company_uuid', $request->session()->get('company'));\n }\n );\n $serviceQuotes = collect();\n\n // calculate quotes\n foreach ($serviceRates as $serviceRate) {\n [$subTotal, $lines] = $serviceRate->quote($payload);\n\n $quote = ServiceQuote::create([\n 'request_id' => $requestId,\n 'company_uuid' => $serviceRate->company_uuid,\n 'service_rate_uuid' => $serviceRate->uuid,\n 'amount' => $subTotal,\n 'currency' => $serviceRate->currency,\n ]);\n\n $items = $lines->map(function ($line) use ($quote) {\n return ServiceQuoteItem::create([\n 'service_quote_uuid' => $quote->uuid,\n 'amount' => $line['amount'],\n 'currency' => $line['currency'],\n 'details' => $line['details'],\n 'code' => $line['code'],\n ]);\n });\n\n $quote->setRelation('items', $items);\n $serviceQuotes->push($quote);\n }\n\n // if single quotation requested\n if ($single) {\n // find the best quotation\n $bestQuote = $serviceQuotes->sortBy('amount')->first();\n\n return new ServiceQuoteResource($bestQuote);\n }\n\n return ServiceQuoteResource::collection($serviceQuotes);\n }", "function execute() {\n\t\t$guest = false;\n\t\t$this->defineProperties();\n\t\tif (!df_checkout_h()->canOnepageCheckout()) {\n\t\t\techo json_encode(['error' => 0, 'msg' => '', 'redirect' => $this->_url->getUrl('quotation/quote')]);\n\t\t\texit;\n\t\t}\n\t\t// Validate checkout\n\t\t$quote = $this->getOnepage()->getQuote();\n\t\tif (!$quote->hasItems() || $quote->getHasError() || !$quote->validateMinimumAmount()) {\n\t\t\techo json_encode(['error' => 0, 'msg' => '', 'redirect' => $this->_url->getUrl('quotation/quote')]);\n\t\t\texit;\n\t\t}\n\t\t$isLoggedIn = $this->_customerSession->isLoggedIn();\n\t\tif (!$isLoggedIn) {\n\t\t\tif (isset($_POST['register_new_account'])) {\n\t\t\t\t$isGuest = $this->getRequest()->getPost('register_new_account');\n\t\t\t\tif ($isGuest == '1' || $this->_dataHelper->haveProductDownloadable()) {\n\t\t\t\t\t// If checkbox register_new_account checked or exist downloadable product, create new account\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t\t$storeManager = $this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface');\n\t\t\t\t\t// Preparing data for new customer\n\t\t\t\t\t$customer = $this->_objectManager->get('Magento\\Customer\\Model\\CustomerFactory')->create();\n\t\t\t\t\t$customer->setWebsiteId($storeManager->getWebsite()->getId())\n\t\t\t\t\t\t->setEmail(isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '')\n\t\t\t\t\t\t->setPrefix(isset($_POST['billing']['prefix']) ? $_POST['billing']['prefix'] : '')\n\t\t\t\t\t\t->setFirstname(isset($_POST['billing']['firstname']) ? $_POST['billing']['firstname'] : '')\n\t\t\t\t\t\t->setLastname(isset($_POST['billing']['lastname']) ? $_POST['billing']['lastname'] : '')\n\t\t\t\t\t\t->setMiddlename(isset($_POST['billing']['middlename']) ? $_POST['billing']['middlename'] : '')\n\t\t\t\t\t\t->setSuffix(isset($_POST['billing']['suffix']) ? $_POST['billing']['suffix'] : '')\n\t\t\t\t\t\t->setDob(isset($_POST['dob']) ? $_POST['dob'] : '')\n\t\t\t\t\t\t->setTaxvat(isset($_POST['billing']['taxvat']) ? $_POST['billing']['taxvat'] : '')\n\t\t\t\t\t\t->setGender(isset($_POST['billing']['gender']) ? $_POST['billing']['gender'] : '')\n\t\t\t\t\t\t->setPassword(isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '');\n\t\t\t\t\t// Set customer information to quote\n\t\t\t\t\t$quote->setCustomer($customer->getDataModel())->setPasswordHash($customer->getPasswordHash());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Fix for persistent\n\t\t\t\tif (\n\t\t\t\t\t$this->getCheckout()->getPersistentRegister() && $this->getCheckout()->getPersistentRegister() == \"register\"\n\t\t\t\t) {\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!$this->_dataHelper->getStoreConfig('onestepcheckout/general/allowguestcheckout')\n\t\t\t\t\t\t|| !$this->_dataHelper->getStoreConfig('checkout/options/guest_checkout')\n\t\t\t\t\t\t|| $this->_dataHelper->haveProductDownloadable()\n\t\t\t\t\t) {\n\t\t\t\t\t\t$storeManager = $this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface');\n\t\t\t\t\t\t// Preparing data for new customer\n\t\t\t\t\t\t$customer = $this->_objectManager->get(\n\t\t\t\t\t\t\t'Magento\\Customer\\Model\\CustomerFactory'\n\t\t\t\t\t\t)->create();\n\t\t\t\t\t\t$guest = false;\n\t\t\t\t\t\t$email = isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '';\n\t\t\t\t\t\tif ($email) {\n\t\t\t\t\t\t\t$customer1 = $this->_objectManager->get(\n\t\t\t\t\t\t\t\t'Magento\\Customer\\Model\\CustomerFactory'\n\t\t\t\t\t\t\t)->create();\n\t\t\t\t\t\t\t$customer1->loadByEmail($email);\n\t\t\t\t\t\t\tif ($customer1->getId()) {\n\t\t\t\t\t\t\t\t$customer->setEntityId($customer1->getEntityId());\n\t\t\t\t\t\t\t\tif (!$customer1->getPasswordHash()) {\n\t\t\t\t\t\t\t\t\t$customer->setEntityId($customer1->getEntityId());\n\t\t\t\t\t\t\t\t\t$this->_customerSession->setCustomerId($customer1->getEntityId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$password = isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '';\n\t\t\t\t\t\t\t\t\t$accountManagement = $this->_objectManager->get('Magento\\Customer\\Api\\AccountManagementInterface');\n\t\t\t\t\t\t\t\t\t$accountManagement->authenticate($email, $password);\n\t\t\t\t\t\t\t\t\t$guest = true;\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 (!$guest) {\n\t\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$customer->setWebsiteId($storeManager->getWebsite()->getId())\n\t\t\t\t\t\t\t->setEmail(isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '')\n\t\t\t\t\t\t\t->setPrefix(isset($_POST['billing']['prefix']) ? $_POST['billing']['prefix'] : '')\n\t\t\t\t\t\t\t->setFirstname(isset($_POST['billing']['firstname']) ? $_POST['billing']['firstname'] : '')\n\t\t\t\t\t\t\t->setLastname(isset($_POST['billing']['lastname']) ? $_POST['billing']['lastname'] : '')\n\t\t\t\t\t\t\t->setMiddlename(isset($_POST['billing']['middlename']) ? $_POST['billing']['middlename'] : '')\n\t\t\t\t\t\t\t->setSuffix(isset($_POST['billing']['suffix']) ? $_POST['billing']['suffix'] : '')\n\t\t\t\t\t\t\t->setDob(isset($_POST['dob']) ? $_POST['dob'] : '')\n\t\t\t\t\t\t\t->setTaxvat(isset($_POST['billing']['taxvat']) ? $_POST['billing']['taxvat'] : '')\n\t\t\t\t\t\t\t->setGender(isset($_POST['billing']['gender']) ? $_POST['billing']['gender'] : '')\n# 2021-05-26 Dmitry Fedyuk https://www.upwork.com/fl/mage2pro\n# @todo \"«empty password in vendor/magento/framework/Encryption/Encryptor.php on line 591»\n# on a quotecheckout/index/updateordermethod request\": https://github.com/canadasatellite-ca/site/issues/127\n\t\t\t\t\t\t\t->setPassword(isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '');\n\t\t\t\t\t\t// Set customer information to quote\n\t\t\t\t\t\t$quote->setCustomer($customer->getDataModel())->setPasswordHash($customer->getPasswordHash());\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Save billing address\n\t\tif ($this->getRequest()->isPost()) {\n\t\t\t$billingData = $this->_dataHelper->filterdata(\n\t\t\t\t$this->getRequest()->getPost('billing', []),\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ($isLoggedIn) {\n\t\t\t\t$this->saveAddress('billing', $billingData);\n\t\t\t}\n\t\t\t$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);\n\t\t\tif ($this->getRequest()->getPost('billing_address_id') != \"\"\n\t\t\t\t&& (!isset($billingData['save_in_address_book'])\n\t\t\t\t\t|| (isset($billingData['save_in_address_book']) && $billingData['save_in_address_book']) == 0)\n\t\t\t) {\n\t\t\t\t$customerAddressId = \"\";\n\t\t\t}\n\t\t\tif ($isLoggedIn\n\t\t\t\t&& (isset($billingData['save_in_address_book']) && $billingData['save_in_address_book'] == 1)\n\t\t\t\t&& !$this->_dataHelper->getStoreConfig('onestepcheckout/addfield/addressbook')\n\t\t\t) {\n\t\t\t\t$customerAddressId = $this->getDefaultAddress('billing');\n\t\t\t}\n\t\t\tif (isset($billingData['email'])) {\n\t\t\t\t$billingData['email'] = trim($billingData['email']);\n\t\t\t\tif ($this->_dataHelper->isSubscriberByEmail($billingData['email'])) {\n\t\t\t\t\tif ($this->getRequest()->getParam('subscribe_newsletter') == '1') {\n\t\t\t\t\t\tif ($isLoggedIn) {\n\t\t\t\t\t\t\t$customer = $this->_customerSession->getCustomer();\n\t\t\t\t\t\t\t$this->_objectManager->get(\n\t\t\t\t\t\t\t\t'Magento\\Newsletter\\Model\\SubscriberFactory'\n\t\t\t\t\t\t\t)->create()->subscribeCustomerById($customer->getId());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->saveSubscriber($billingData['email']);\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$address = $this->_objectManager->get('Magento\\Quote\\Model\\Quote\\Address');\n\t\t\tif ($customerAddressId) {\n\t\t\t\t$addressData = $this->_objectManager->get('Magento\\Customer\\Api\\AddressRepositoryInterface')\n\t\t\t\t\t->getById($customerAddressId)\n\t\t\t\t\t->__toArray();\n\t\t\t\t$billingData = array_merge($billingData, $addressData);\n\t\t\t}\n\t\t\t$address->setData($billingData);\n\t\t\t$this->getOnepage()->getQuote()->setBillingAddress($address);\n\t\t\tif (isset($billingData['save_into_account'])\n\t\t\t\t&& intval($billingData['save_into_account']) == 1\n\t\t\t\t&& $isLoggedIn\n\t\t\t) {\n\t\t\t\t$this->setAccountInfoSession($billingData);\n\t\t\t}\n\t\t}\n\t\t// Save shipping address\n\t\t$isclick = $this->getRequest()->getPost('ship_to_same_address');\n\t\t$ship = \"billing\";\n\t\tif ($isclick != '1') {\n\t\t\t$ship = \"shipping\";\n\t\t}\n\t\tif ($this->getRequest()->getPost()) {\n\t\t\t$shippingData = $this->_dataHelper->filterdata($this->getRequest()->getPost($ship, []), false);\n\t\t\tif ($isLoggedIn && !$isclick) {\n\t\t\t\t$this->saveAddress('shipping', $shippingData);\n\t\t\t}\n\t\t\tif ($isclick == '1') {\n\t\t\t\t$shippingData['same_as_billing'] = 1;\n\t\t\t}\n\t\t\t// Change address if user change infomation\n\t\t\t// Reassign customeraddressid and save to shipping\n\t\t\t$customeraddressid = $this->getRequest()->getPost($ship . '_address_id', false);\n\t\t\t// If user chage shipping, billing infomation but not save to database\n\t\t\tif ($isclick || ($this->getRequest()->getPost('shipping_address_id') != \"\"\n\t\t\t\t\t&& (!isset($shippingData['save_in_address_book']) || (isset($shippingData['save_in_address_book']) && $shippingData['save_in_address_book'] == 0)))\n\t\t\t) {\n\t\t\t\t$customeraddressid = \"\";\n\t\t\t}\n\t\t\tif (!$isclick && $isLoggedIn\n\t\t\t\t&& (isset($shippingData['save_in_address_book']) && $shippingData['save_in_address_book'] == 1)\n\t\t\t\t&& !$this->_dataHelper->getStoreConfig('onestepcheckout/addfield/addressbook')\n\t\t\t) {\n\t\t\t\t$customeraddressid = $this->getDefaultAddress('shipping');\n\t\t\t}\n\t\t\t$this->getOnepage()->saveShipping($shippingData, $customeraddressid);\n\t\t}\n\t\tif ($customer_note = $this->getRequest()->getPost('onestepcheckout_comments')) {\n\t\t\t$quote->setCustomerNote($customer_note);\n\t\t}\n\t\tif ($this->getRequest()->isPost()) {\n\t\t\t$shippingMethodData = $this->getRequest()->getPost('shipping_method', '');\n\t\t\t$resultSaveShippingMethod = $this->getOnepage()->saveShippingMethod($shippingMethodData);\n\t\t\tif (!$resultSaveShippingMethod) {\n\t\t\t\t$eventManager = $this->_objectManager->get('Magento\\Framework\\Event\\ManagerInterface');\n\t\t\t\t$eventManager->dispatch('checkout_controller_onepage_save_shipping_method', [\n\t\t\t\t\t'request' => $this->getRequest(),\n\t\t\t\t\t'quote' => $this->getOnepage()->getQuote()\n\t\t\t\t]);\n\t\t\t}\n\t\t\t$this->getOnepage()->getQuote()->collectTotals();\n\t\t}\n\t\t$result = new \\Magento\\Framework\\DataObject();\n\t\ttry {\n\t\t\tif (!$quote->getCustomerId() && !$guest) {\n\t\t\t\tdf_quote_customer_m()->populateCustomerInfo($quote);\n\t\t\t}\n\t\t\t$quote->setIsActive(false);\n\t\t\t$cQuote = df_new_om(CQuote::class); /** @var CQuote $cQuote */\n\t\t\t$quotation = $cQuote->create($quote)->load($quote->getId());\n\t\t\t$cHelper = df_o(CHelper::class); /** @var CHelper $cHelper */\n\t\t\t$isAutoProposalEnabled = $cHelper->isAutoConfirmProposalEnabled();\n\t\t\t$qtyBreak = false;\n\t\t\t$price = true;\n\t\t\t$totalItems = 0;\n\t\t\tforeach ($quote->getAllItems() as $item) {\n\t\t\t\tif (!$item->getParentItemId()) {\n\t\t\t\t\t$totalItems++;\n\t\t\t\t\tif ($item->getQty() > 1) {\n\t\t\t\t\t\t$qtyBreak = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($item->getProduct()->getFinalPrice() == 0 || $item->getProduct()->getPrice() == 0) {\n\t\t\t\t\t\t$price = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($quote->getCustomerNote() || $qtyBreak || !$price || $totalItems > 1) {\n\t\t\t\t$isAutoProposalEnabled = false;\n\t\t\t}\n\t\t\tif ($isAutoProposalEnabled) {\n\t\t\t\t$quotation->setProposalSent((new \\DateTime())->getTimestamp());\n\t\t\t\t$quotation->setState(\\Cart2Quote\\Quotation\\Model\\Quote\\Status::STATE_PENDING)\n\t\t\t\t\t->setStatus(\\Cart2Quote\\Quotation\\Model\\Quote\\Status::STATUS_AUTO_PROPOSAL_SENT);\n\t\t\t\t$qProposalSender = df_o(QuoteProposalSender::class); /** @var QuoteProposalSender $qProposalSender */\n\t\t\t\t$qProposalSender->send($quotation);\n\t\t\t\t$quotation->save();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$qRequestSender = df_o(QuoteRequestSender::class); /** @var QuoteRequestSender $qRequestSender */\n\t\t\t\t$qRequestSender->send($quotation, false);\n\t\t\t}\n\t\t\tif (true || $this->getRequest()->getParam('clear_quote', false)) {\n\t\t\t\t$qs = df_o(CSession::class); /** @var CSession $qs */\n\t\t\t\t$qs->fullSessionClear();\n\t\t\t\t$qs->updateLastQuote($quotation);\n\t\t\t}\n\t\t\t$redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();\n\t\t\t$result->setData('success', true);\n\t\t\t$result->setData('error', false);\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\t$data = ['error' => 1, 'msg' => $e->getMessage(),];\n\t\t\t$reloadcheckoutpage = $quote->getData('reloadcheckoutpage');\n\t\t\tif ($reloadcheckoutpage) {\n\t\t\t\t$data['redirect'] = $this->_url->getUrl('checkout');\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t\texit;\n\t\t}\n\t\tif (isset($redirectUrl)) {\n\t\t\t$result->setData('redirect', $redirectUrl);\n\t\t}\n\t\t$this->_eventManager->dispatch('checkout_controller_onepage_saveOrder', ['result' => $result, 'action' => $this]);\n\t\tif (isset($redirectUrl)) {\n\t\t\techo json_encode([\n\t\t\t\t'error' => 0,\n\t\t\t\t'msg' => '',\n\t\t\t\t'redirect' => $redirectUrl\n\t\t\t]);\n\t\t\texit;\n\t\t}\n\t\techo json_encode([\n\t\t\t'error' => 0,\n\t\t\t'msg' => '',\n\t\t\t'redirect' => $this->_url->getUrl('quotation/quote/success', array('id' => $quote->getId()))\n\t\t]);\n\t\texit;\n\t\treturn;\n\t}", "function makeOffer()\r\n {\r\n \r\n }", "public function salesQuotesListAction()\n\t{\t\t\n\t\t$quote_obj=new Ep_Quote_Quotes();\n\t\t$listParams=$this->_request->getParams();\n\t\t$searchParams['client_id']=$listParams['client_id'];\n\n\t\t$quoteList=$quote_obj->getAllQuotesList($searchParams);\t\n\t\t\n\t\tif($quoteList)\n\t\t{\n\t\t\t$q=0;\n\t\t\t$total_turnover = $total_ongoing_turnover_euro = $total_ongoing_turnover_pound = $validated_turnover_euro = $validated_turnover_pound = $signed_turnover_euro = $signed_turnover_pound = 0;\n\t\t\t$ave_count=$relancer_turnover_pound=$relancer_turnover_euro=$in_day=0;\n\t\t\t$in_day=0;\n\t\t\tforeach ($quoteList as $quote) {\n\t\t\t\t\n\t\t\t\t$quoteList[$q]['tech_status']=$this->status_array[$quote['tec_review']];\n\t\t\t\t$quoteList[$q]['seo_status']=$this->status_array[$quote['seo_review']];\n\t\t\t\t$quoteList[$q]['prod_status']=$this->status_array[$quote['prod_review']];\n\t\t\t\t$quoteList[$q]['sales_status']=$this->status_array[$quote['sales_review']];\n\t\t\t\t$quoteList[$q]['category_name']=$this->getCategoryName($quote['category']);\n\t\t\t\t$quoteList[$q]['closed_reason_txt'] = $this->closedreason[$quote['closed_reason']];\n\t\t\t\tif($quote['tech_timeline'])\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$quoteList[$q]['tech_challenge_time']=strtotime($quote['tech_timeline']);\n\t\t\t\t}\t\n\t\t\t\tif($quote['seo_timeline'])\n\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['seo_challenge_time']=strtotime($quote['seo_timeline']);\n\t\t\t\t}\n\n\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote['quote_by']);\n\t\t\t\t\n\t\t\t\tif($quote['deleted_by'])\n\t\t\t\t{\n\t\t\t\t\t$deleted_user=$client_obj->getQuoteUserDetails($quote['deleted_by']);\n\t\t\t\t\t$quoteList[$q]['deleted_user'] = $deleted_user[0]['first_name'].' '.$deleted_user[0]['last_name'];\n\t\t\t\t}\n\n\t\t\t\t$quoteList[$q]['owner']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\n\t\t\t\t$prod_team=$quote['prod_review']!='auto_skipped' ? 'Prod ': '';\n\t\t\t\t$seo_team=$quote['seo_review']!='auto_skipped' ? 'Seo ': '';\n\t\t\t\t$tech_team=$quote['tec_review']!='auto_skipped' ? 'Tech ': '';\n\n\t\t\t\t$quoteList[$q]['team']=$prod_team.$seo_team.$tech_team;\n\n\t\t\t\tif(!$quoteList[$q]['team'])\n\t\t\t\t\t$quoteList[$q]['team']='only sales';\n\n\n\t\t\t\t//turnover calculations\n\t\t\t\t/*if($quote['sales_review']=='not_done' || $quote['sales_review']=='to_be_approve' )\n\t\t\t\t{\n\t\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t\t$total_ongoing_turnover_euro +=$quote['turnover'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$total_ongoing_turnover_pound +=$quote['turnover'];\n\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\tif($quote['sales_review']=='validated')\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$validated_turnover_euro += $quote['turnover']\t;\n\t\t\t\t\telse\n\t\t\t\t\t\t$validated_turnover_pound += $quote['turnover']\t;\n\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\tif($quote['sales_review']=='signed')\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$signed_turnover_euro += $quote['turnover'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$signed_turnover_pound += $quote['turnover'];\n\t\t\t\t}*/\n\t\t\t\t//turnover calculations\n\t\t\t\t\n\t\t\t\tif($quote['sales_review']=='not_done' || $quote['sales_review']=='to_be_approve' )\n\t\t\t\t{\n\t\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t\t$total_ongoing_turnover_euro +=$quote['turnover'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$total_ongoing_turnover_pound +=$quote['turnover'];\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\tif($quote['sales_review']=='signed')\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$signed_turnover_euro += $quote['turnover'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$signed_turnover_pound += $quote['turnover'];\n\n\t\t\t\t\t$existval= $quote_obj->checkcontractexist($quote['identifier']);\n\t\t\t\t\t\n\t\t\t\t\tif(count($existval[0]['quotecontractid'])>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteList[$q]['signed_exist']=1;\n\t\t\t\t\t\t$quoteList[$q]['signed_contract']=$existval[0]['contractname'];\n\t\t\t\t\t\t$quoteList[$q]['signed_contractid']=$existval[0]['quotecontractid'];\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$quoteList[$q]['signed_exist']=0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t \n\t\t\t\t//Mean Time Quotes signature \n\t\t\t\t\n\t\t\t\tif(($quote['sales_review']=='validated' || $quote['sales_review']=='signed') && $quote['signed_at']!='')\n\t\t\t\t{\n\t\t\t\t\t\t$quotes_log=new Ep_Quote_QuotesLog();\n\t\t\t\t\t\t$quotesAction=$quotes_log->getquoteslogvalid($quote['identifier'],'sales_validated_ontime');\n\t\t\t\t\t//print_r($quotesAction);\n\t\t\t\t\t\tif($quotesAction[0]['action_at']!=\"\"){\n\t\t\t\t\t\t\t$date_difference=strtotime($quote['signed_at'])-strtotime($quotesAction[0]['action_at']);\n\t\t\t\t\t\t\t$in_day+=$date_difference/(60 * 60 * 24);\n\t\t\t\t\t\t\t$ave_count++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\n } \n \n //relancer Section\n if($quote['releaceraction']!=''){\n\t\t\t\t\t $quoteList[$q]['relance_actiondate']=date(\"Y-m-d\", strtotime(\"+1 month\", strtotime($quote['releaceraction'])));\n\t\t\t\t\t} \n\t\t\t\t\t \n if($quote['quotesvalidated']!=''){\n\t\t\t\t\t $quoteList[$q]['relance_validated']=date(\"Y-m-d\", strtotime(\"+5 days\", strtotime($quote['quotesvalidated'])));\n\t\t\t\t\t} \n \n\t\t\t\t\t\n\t\t\t\tif($quoteList[$q]['version']>1)\n\t\t\t\t{\n\t\t\t\t\t$versions = $quote_obj->getQuoteVersionDetails($quote['identifier']);\n\t\t\t\t\t$quoteList[$q]['version_dates'] = \"<table class='table quote-history table-striped'>\";\n\t\t\t\t\tforeach($versions as $version):\n\t\t\t\t\t$quoteList[$q]['version_dates'] .= '<tr><td>v'.$version['version'].' - '.date('d/m/Y',strtotime($version['created_at'])).\"</td></tr>\";\n\n\t\t\t\t\tendforeach;\n\t\t\t\t\t$quoteList[$q]['version_dates'] .= '</table>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t$quoteList[$q]['version_dates'] = \"\";\n\t\t\t\t\n\t\t\t\t//relancer turnover and flag\n\t\t\t\t\tif( (($quote['sales_review']=='closed' && (date(\"Y-m-d\") > $quoteList[$q]['relance_actiondate'] || $quote['boot_customer']!=\"\") ) \n\t\t\t\t\t ||\t(time() > $quoteList[$q]['sign_expire_timeline'] && $quote['sales_review']=='validated'))\n\t\t\t\t\t && $quote['closed_reason']!= 'quote_permanently_lost')\n\t\t\t\t\t {\n\t\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$relancer_turnover_euro+=$quote['turnover'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t$relancer_turnover_pound+=$quote['turnover'];\n\t\t\t\t\t\t$quoteList[$q]['relancer_status']=1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$quoteList[$q]['relancer_status']=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t//closed quotes flag\n\t\t\t\tif( ($quote['sales_review']=='closed' && date(\"Y-m-d\") <= $quoteList[$q]['relance_actiondate'] && $quote['boot_customer']==\"\")\n\t\t\t\t || $quote['closed_reason']=='quote_permanently_lost') \n\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['closed_status']=1;\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['closed_status']=0;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//validated turnover\n\t\t\t\tif($quote['sales_review']=='validated' && time() <= $quoteList[$q]['sign_expire_timeline'])\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$validated_turnover_euro += $quote['turnover']\t;\n\t\t\t\t\telse\n\t\t\t\t\t\t$validated_turnover_pound += $quote['turnover']\t;\n\t\t\t\t\n\t\t\t\t$quoteList[$q]['validated_status']=1;\n\t\t\t\t\tif($quote['is_new_quote']==1)\n\t\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['new_quote']=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t$quoteList[$q]['new_quote']=0;\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$quoteList[$q]['validated_status']=0;\n\t\t\t\t\tif($quote['is_new_quote']==1)\n\t\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['new_quote']=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t$quoteList[$q]['new_quote']=0;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$q++;\n\t\t\t}\n\t\t\t$meantime_sign_days=round(abs($in_day)/$ave_count,0);\n\t\t\t//echo \"<pre>\";print_r($quoteList);exit;\n\t\t\t$this->_view->quote_list=$quoteList;\n\t\t\t$this->_view->total_ongoing_turnover_euro = $total_ongoing_turnover_euro;\n\t\t\t$this->_view->total_ongoing_turnover_pound = $total_ongoing_turnover_pound;\n\t\t\t$this->_view->validated_turnover_euro = $validated_turnover_euro;\n\t\t\t$this->_view->validated_turnover_pound = $validated_turnover_pound;\n\t\t\t$this->_view->signed_turnover_euro = $signed_turnover_euro;\n\t\t\t$this->_view->signed_turnover_pound = $signed_turnover_pound;\n\t\t\t$this->_view->relancer_turnover_euro=$relancer_turnover_euro;\n\t\t\t$this->_view->relancer_turnover_pound=$relancer_turnover_pound;\n\t\t\t$this->_view->day_difference=$meantime_sign_days;\n\n\t\t}\t\n\t\t$this->_view->quote_sent_timeline=$this->configval[\"quote_sent_timeline\"];\n\t\t$this->_view->prod_timeline=$this->configval[\"prod_timeline\"];\n\n\t\t$this->_view->techManager_holiday=$this->configval[\"tech_manager_holiday\"];\n\t\t$this->_view->seoManager_holiday=$this->configval[\"seo_manager_holiday\"];\n\n\t\t//echo \"<pre>\";print_r($quoteList);exit;\n\t\t$this->_view->closedreasons = $this->closedreason;\n\t\t$this->render('sales-quotes-list');\n\n\t\tif($listParams['file_download']=='yes' && $listParams['quote_id'])\n\t\t\theader( \"refresh:1;url=/quote/download-quote-xls?quote_id=\".$listParams['quote_id']);\n\t}", "public function getQuote()\n {\n return Mage::getSingleton('checkout/session')->getQuote();\n }", "public function getQuote()\n {\n return Mage::getSingleton('checkout/session')->getQuote();\n }", "private function send_products_to_quote(ck_quote $quote) {\n\t\tself::query_execute('INSERT INTO customer_quote_products (customer_quote_id, product_id, parent_products_id, option_type, price, quantity) SELECT :customer_quote_id, products_id, parent_products_id, option_type, IFNULL(quoted_price, unit_price), quantity FROM ck_cart_products WHERE cart_id = :cart_id', cardinality::NONE, [':customer_quote_id' => $quote->id(), ':cart_id' => $this->id()]);\n\t\tself::query_execute('DELETE FROM ck_cart_products WHERE cart_id = :cart_id', cardinality::NONE, [':cart_id' => $this->id()]);\n\t}", "function _getDmstcQuote($pkg, $method = '') {\r\n\t\tglobal $order;\r\n\t\tif (tep_not_null($method) && in_array($method, $this->dmstc_available)) {\r\n\t\t\t$request_types = array($method);\r\n\t\t} else {\r\n\t\t\t$request_types = $this->dmstc_available;\r\n\t\t}\r\n\t\t$shipping_weight = ($pkg['item_weight'] < 0.0625 ? 0.0625 : $pkg['item_weight']);\r\n\t\t$shipping_pounds = floor($shipping_weight);\r\n\t\t$shipping_ounces = ceil((16 * ($shipping_weight - $shipping_pounds)) * 100) / 100; // rounded to two decimal digits\r\n\t\t$ounces = $shipping_weight * 16.0;\r\n\t\t$pkgvalue = $pkg['item_price'];\r\n\t\tif ($pkgvalue > MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX) $pkgvalue = MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX;\r\n\t\tif ($pkgvalue <= 0) $pkgvalue = 0.01;\r\n\t\t$nonuspsinsurancecost = 0;\r\n\t\tif (MODULE_SHIPPING_USPS_NON_USPS_INSURE == 'True') {\r\n\t\t\tif ($pkg['item_price'] <= 50) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS1;\r\n\t\t\t} else if ($pkg['item_price'] <= 100) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS2;\r\n\t\t\t}\telse if ($pkg['item_price'] <= 200) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS3;\r\n\t\t\t} else if ($pkg['item_price'] <= 300) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4;\r\n\t\t\t} else {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4 + ((ceil($pkg['item_price']/100) - 3) * MODULE_SHIPPING_USPS_INS5);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sservs = array(); // any special services to request\r\n\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $sservs = array(1, 11); //request insurance, both regular & express mail\r\n\t\tif ((MODULE_SHIPPING_USPS_DMST_SIG_CONF == 'True') && ($order->info['subtotal'] >= MODULE_SHIPPING_USPS_SIG_THRESH)) {\r\n\t\t\t$sservs[] = 15;\r\n\t\t} elseif (MODULE_SHIPPING_USPS_DMST_DEL_CONF == 'True') {\r\n\t\t\t$sservs[] = 13;\r\n\t\t}\r\n\t\t$sservice = '';\r\n\t\tif (!empty($sservs)) {\r\n\t\t\tforeach ($sservs as $id) $sservice .= '<SpecialService>' . $id . '</SpecialService>';\r\n\t\t\t$sservice = '<SpecialServices>' . $sservice . '</SpecialServices>';\r\n\t\t}\r\n\t\t$box = array($pkg['item_length'], $pkg['item_width'], $pkg['item_height']);\r\n\t\trsort($box); // put package size in large to small order for purposes of checking dimensions\r\n\t\tlist($length, $width, $height) = $box;\r\n\t\t$id = 0;\r\n\t\t$quotes = $request_group = array();\r\n\t\t$group_count = 1;\r\n\t\t$type_count = 0;\r\n\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\tforeach ($request_types as $service) { // break the requested shipping methods into groups\r\n\t\t\tif (strpos($service, 'First') !== false) { // if first class mail service check if will fit type\r\n\t\t\t\t$fcmt = $this->first_class_to_mail_type[$service];\r\n\t\t\t\tif (($fcmt == 'LETTER') && (($length > $this->first_class_letter['length']) || ($width > $this->first_class_letter['width']) || ($height > $this->first_class_letter['height']) || ($ounces > $this->first_class_letter['ounces']))) continue; // don't check letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'FLAT') && (($length > $this->first_class_large_letter['length']) || ($width > $this->first_class_large_letter['width']) || ($height > $this->first_class_large_letter['height']) || ($ounces > $this->first_class_large_letter['ounces']))) continue; // don't check large letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'POSTCARD') && (($length > 6) || ($width > 4.25) || ($height > 0.016) || ($ounces > 3.5))) continue; // don't check postcard type if package doesn't fit\r\n\t\t\t\tif ($ounces > $this->first_class_parcel_max_ounces) continue; // don't check First Class if too heavy\r\n\t\t\t}\r\n\t\t\t$cont = $this->type_to_container[$service]; // begin checking for packages larger than USPS containers\r\n\t\t\t// if this service type specifies a container and this package won't fit then skip this service\r\n\t\t\tif (strpos($cont, 'Envelope') !== false) { // if service container is envelope\r\n\t\t\t\tif ($height > 1) continue; // anything thicker than one inch won't fit an envelope\r\n\t\t\t\tif ((strpos($cont, 'SM') !== false) && (($length > 10) || ($width > 6))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Window') !== false) && (($length > 10) || ($width > 5))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Gift') !== false) && (($length > 10) || ($width > 7))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Legal') !== false) && (($length > 15) || ($width > 9.5))) continue;\r\n\t\t\t\tif (($length > 12.5) || ($width > 9.5)) continue; // other envelopes\r\n\t\t\t}\r\n\t\t\tif (($cont == 'SM Flat Rate Box') && (($length > 8.625) || ($width > 5.375) || ($height > 1.625))) continue;\r\n\t\t\tif (($cont == 'MD Flat Rate Box') || ($cont == 'Flat Rate Box')) {\r\n\t\t\t\tif ($length > 13.625) continue; // too big for longest medium box\r\n\t\t\t\tif ($length > 11) { // check medium type 2 box\r\n\t\t\t\t\tif (($length > 13.625) || ($width > 11.875) || ($height > 3.375)) continue; // won't fit medium type 2 box\r\n\t\t\t\t} elseif (($length > 11) || ($width > 8.5) || ($height > 5.5)) continue; // won't fit either type medium box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'LG Flat Rate Box') && (($length > 12) || ($width > 12) || ($height > 5.5))) continue;\r\n\t\t\tif ($cont == 'Regional Rate Box A') {\r\n\t\t\t\tif ($length > 12.8125) continue; // too big for longest A box\r\n\t\t\t\tif ($length > 10) { // check A2 box\r\n\t\t\t\t\tif (($length > 12.8125) || ($width > 10.9375) || ($height > 2.375)) continue; // won't fit A2 box\r\n\t\t\t\t} elseif (($length > 10) || ($width > 7) || ($height > 4.75)) continue; // won't fit either type A box\r\n\t\t\t}\r\n\t\t\tif ($cont == 'Regional Rate Box B') {\r\n\t\t\t\tif ($length > 15.875) continue; // too big for longest B box\r\n\t\t\t\tif ($length > 12) { // check B2 box\r\n\t\t\t\t\tif (($length > 15.875) || ($width > 14.375) || ($height > 2.875)) continue; // won't fit B2 box\r\n\t\t\t\t} elseif (($length > 12) || ($width > 10.25) || ($height > 5)) continue; // won't fit either type B box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'Regional Rate Box C') && (($length > 14.75) || ($width > 11.75) || ($height > 11.5))) continue;\r\n\t\t\t// passed all size checks so build request\r\n\t\t\t$request = '<Package ID=\"'. $id . '\"><Service>' . $this->type_to_request[$service] . '</Service>';\r\n\t\t\tif (strpos($service, 'First') !== false) $request .= '<FirstClassMailType>' . $fcmt . '</FirstClassMailType>';\r\n\t\t\t$request .= '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' .\r\n\t\t\t\t\t'<ZipDestination>' . $this->dest_zip . '</ZipDestination>' .\r\n\t\t\t\t\t'<Pounds>' . $shipping_pounds . '</Pounds>' .\r\n\t \t\t'<Ounces>' . $shipping_ounces . '</Ounces>';\r\n\t\t\tif ((strpos($cont, 'Rate') === false) && (max($length, $width, $height) > 12)) {\r\n\t\t\t\t$request .= '<Container>RECTANGULAR</Container><Size>LARGE</Size>' .\r\n\t\t\t\t\t\t'<Width>' . $width . '</Width>' .\r\n\t\t\t\t\t\t'<Length>' . $length . '</Length>'.\r\n\t\t\t\t\t\t'<Height>' . $height . '</Height>';\r\n\t\t\t} else {\r\n\t\t\t\t$request .= '<Container>' . $cont . '</Container><Size>REGULAR</Size>';\r\n\t\t\t}\r\n\t\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $request .= '<Value>' . number_format($pkgvalue, 2, '.', '') . '</Value>';\r\n\t\t\t$request .= $sservice;\r\n\t\t\tif ((strpos($service, 'First') !== false) || (strpos($service, 'Post') !== false)) $request .= '<Machinable>true</Machinable>';\r\n\t\t\t$request .= '</Package>';\r\n\t\t\t$id++;\r\n\t\t\t$type_count++;\r\n\t\t\tif (($type_count > 25) || (($urllength + strlen(urlencode($request))) > 2000)) { // only 25 services allowed per request or 2000 characters per url\r\n\t\t\t\t$group_count++;\r\n\t\t\t\t$type_count = 1;\r\n\t\t\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\t\t}\r\n\t\t\t$urllength += strlen(urlencode($request));\r\n\t\t\t$request_group[$group_count][$type_count] = $request;\r\n\t\t} // end foreach request type as service\r\n\t\tif (empty($request_group)) return array('error' => MODULE_SHIPPING_USPS_ERROR_NO_SERVICES);\r\n\t\tif (!class_exists('httpClient')) {\r\n\t\t\tinclude(DIR_FS_CATALOG . DIR_WS_CLASSES .'http_client.php');\r\n\t\t} //print_r($request_group);\r\n\t\tforeach ($request_group as $service_group) {\r\n\t\t\t$request = '<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision>';\r\n\t\t\tforeach ($service_group as $service_request) {\r\n\t\t\t\t$request .= $service_request;\r\n\t\t\t}\r\n\t\t\t$request .= '</RateV4Request>';\r\n\t\t\t$request = \t'API=RateV4&XML=' . urlencode($request);\r\n\t\t\t$body = '';\r\n\t\t\t$http = new httpClient();\r\n\t\t\tif ($http->Connect('production.shippingapis.com', 80)) {\r\n\t\t\t\t$http->addHeader('Host', 'production.shippingapis.com');\r\n\t\t\t\t$http->addHeader('User-Agent', 'IntenseCart');\r\n\t\t\t\t$http->addHeader('Connection', 'Close');\r\n\t\t\t\tif ($http->Get('/shippingAPI.dll?' . $request)) $body = $http->getBody();\r\n\t\t\t\t$http->Disconnect();\r\n\t\t\t} else {\r\n\t\t\t\t$body = '<Error><Number></Number><Description>' . MODULE_SHIPPING_USPS_TEXT_CONNECTION_ERROR . '</Description></Error>';\r\n\t\t\t}\r\n\t\t\t$doc = XML_unserialize($body); //print_r($doc);\r\n\t\t\tif (isset($doc['Error'])) return array('error' => $doc['Error']['Number'] . ' ' . $doc['Error']['Description']);\r\n\t\t\tif (isset($doc['RateV4Response']['Package']['Postage'])) { // single mail service response\r\n\t\t\t\t$tmp = $this->_decode_domestic_response($doc['RateV4Response']['Package']['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t} elseif (isset($doc['RateV4Response']['Package'][0])) { // multiple mailing services returned\r\n\t\t\t\tforeach ($doc['RateV4Response']['Package'] as $mailsvc) {\r\n\t\t\t\t\tif (isset($mailsvc['Postage'])) {\r\n\t\t\t\t\t\t$tmp = $this->_decode_domestic_response($mailsvc['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} // end foreach $request_group\r\n\t\treturn $quotes;\r\n\t}", "public function expandQuote(\n RestSplittableCheckoutRequestTransfer $restSplittableCheckoutRequestTransfer,\n QuoteTransfer $quoteTransfer\n ): QuoteTransfer;", "protected function addQuotes()\n {\n foreach ($this->data->Quotes as &$quote) {\n foreach (['OutboundLeg', 'InboundLeg'] as $leg) {\n if (isset($quote->$leg)) {\n foreach ($quote->$leg->CarrierIds as $key => $carrierId) {\n $carrier = $this->arraySearch($carrierId, $this->data->Carriers, 'CarrierId');\n $quote->Carriers[] = $this->data->Carriers[$carrier];\n }\n if ($this->flattenSingleCarrier === true && \\count($quote->$leg->CarrierIds) === 1) {\n $quote->Carrier = $quote->Carriers[0];\n unset($quote->Carriers);\n }\n foreach (['Origin' => 'OriginId', 'Destination' => 'DestinationId'] as $variable => $search) {\n $place = $this->arraySearch($quote->$leg->$search, $this->data->Places, 'PlaceId');\n $quote->$variable = $this->data->Places[$place];\n }\n }\n if ($this->removeIds === true) {\n unset($quote->$leg->CarrierIds, $quote->$leg->OriginId, $quote->$leg->DestinationId);\n }\n }\n }\n return $this->data->Quotes;\n }", "function create() {\n\n if ( ! authCheck(['salesperson', 'manager']) ) {\n\n return json_encode(['success' => false, 'authorised' => false]);\n\n } else {\n\n $requestBody = file_get_contents('php://input');\n $data = json_decode($requestBody);\n\n // make quote\n $quote = new \\App\\Quote;\n $quote->owner = $_COOKIE['userid'];\n $quote->customer_name = getPropertySafely($data, 'customer_name');\n $quote->address = getPropertySafely($data, 'address');\n $quote->date = (getPropertySafely($data, 'date')) ? getPropertySafely($data, 'date') . ' 00:00:00': '1970-01-01 00:00:00';\n $quote->appointment_number = getPropertySafely($data, 'appointment_number');\n $quote->product_price = getPropertySafely($data, 'total_product_price');\n $quote->installation_price = getPropertySafely($data, 'total_installation_price');\n $quote->cost_price = getPropertySafely($data, 'total_price');\n $quote->save();\n $quoteId = $quote->id;\n\n foreach($data->products as $productName => $product) {\n\n foreach ($product as $rowId => $row) {\n\n // make quote product (\"Item\")\n $quoteProduct = new \\App\\QuoteProduct;\n $quoteProduct->quote_id = $quoteId;\n $quoteProduct->product = $productName;\n $quoteProduct->row = $rowId;\n $quoteProduct->save();\n $quoteProductId = $quoteProduct->id;\n\n foreach ($row as $settingName => $value) {\n\n // make quote product setting (could specify product to remove quote products table)\n $qpSetting = new \\App\\QuoteProductSetting;\n $qpSetting->quote_id = $quoteId;\n $qpSetting->quote_product_id = $quoteProductId;\n $qpSetting->setting = $settingName;\n if ($settingName == \"location\" || $settingName == \"description\" ) {\n $qpSetting->valueString = $value;\n } else {\n $qpSetting->value = $value;\n }\n $qpSetting->save();\n\n }\n }\n }\n\n //die();\n \n return json_encode(['success' => true, 'id' => $quoteId]);\n }\n }", "function btce_generic_read($key, $secret, $command) {\n $_mt = explode(' ', microtime());\n $_post = array(\n \"method\" => $command,\n \"nonce\" => $_mt[1],\n );\n\n $sign = hash_hmac('sha512', http_build_query($_post, '', '&'), $secret);\n $_headers = array (\n 'Sign: ' . $sign,\n 'Key: ' . $key,\n );\n\n $_o_url = new URLScrape(\"https://btc-e.com/tapi/\", $_post, $_headers);\n return json_decode($_o_url->response);\n}", "function fn_QuoteDocumentListGet($args)\n {\n $params = $this->params;\n $wsdl \t= $this->wsdl;\n $responce = \"\";\n try\n {\n $soap = new SoapClient($wsdl, $params);\n $args['token'] = $this->token;\n $responce = $soap->QuoteDocumentListGet($args);\n }\n catch (SoapFault $e)\n {\n //$responce = \"\";\n //$responce = 'Caught exception:'.$e->getMessage().\"\\n\";\n\n $responce['faultcode'] \t\t= $e->faultcode;\n $responce['faultstring'] \t= $e->faultstring;\n $responce['faultactor'] \t= $e->faultactor;\n $responce['faultname'] \t\t= $e->faultname;\n $responce['headerfault'] \t= $e->headerfault;\n }\n return $responce;\n }", "public function buy(){\n\n $id=89025555; //id di connessione\n $password=\"test\"; //password di connessione\n\n //è necessario foramttare il totale in NNNNNN.NN\n $importo= number_format(StadiumCart::total(),2,'.','');//importo da pagare\n\n $trackid=\"STDRX\".time(); //id transazione\n\n $urlpositivo=\"http://stadium.reexon.net/cart/receipt\";\n $urlnegativo=\"http://stadium.reexon.net/cart/error\";\n $codicemoneta=\"978\"; //euro\n //prelevo i dati inseriti durante la fase acquisto\n $user = (object)Session::get('user');\n\n $data=\"id=$id\n &password=$password\n &action=4\n &langid=ITA\n &currencycode=$codicemoneta\n &amt=$importo\n &responseURL=$urlpositivo\n &errorURL=$urlnegativo\n &trackid=$trackid\n &udf1=\".$user->email.\"\n &udf2=\".$user->mobile.\"\n &udf3=\".$user->firstname.\"\n &udf4=\".$user->lastname.\"\n &udf5=EE\";\n $curl_handle=curl_init();\n //curl_setopt($curl_handle,CURLOPT_URL,'https://www.constriv.com:443/cg/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle,CURLOPT_URL,'https://test4.constriv.com/cg301/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle, CURLOPT_VERBOSE, true);\n curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,5);\n curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);\n curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl_handle, CURLOPT_POST, 1);\n curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data);\n $buffer = curl_exec($curl_handle);\n\n if (empty($buffer))\n {\n return curl_error($curl_handle);\n }\n else\n {\n //print $buffer;\n $url=explode(\":\",$buffer);\n $transaction_id=$url[0];\n curl_close($curl_handle);\n //prepara il link per il pagamento\n if(strlen($transaction_id)>0){\n $redirectURL = $url[1].\":\".$url[2].\"?PaymentID=$transaction_id\";\n echo \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=$redirectURL\\\">\";\n }\n }\n\n }", "public function Get_quotationDetails_get(){\n extract($_GET);\n $club_id = $_GET['club_id'];\n $response = $this->QuotationForEnquiry_model->Get_quotationDetails($club_id);\n return $this->response($response);\n }", "protected function _getQuote()\n {\n return $this->_getCart()->getQuote();\n }", "function loadQuotationToWishlist($qid)\n {\n \t$result = $this->query(\"SELECT * FROM `\".$this->tblPrefix.$this->table.\"` WHERE client_id='\".$this->logUser.\"' and id='\".$qid.\"'\");\n\t$arr = $this->toArray($result[0]['content']) ;\n if($arr)\n {\n foreach ($arr as &$value) {\n $tostringarr[$n][0] = \t$value['id'];\n $tostringarr[$n][1] = \t$value['qty'];\n $n++;\n }\n $str = $this->toString($tostringarr);\n \n // Create the Quotation\n // Updated by Saliya Wijesinghe\n $thisTime=time();\n $thisQuoteId=\"RE:\".$result[0]['quotationid'];\n $this->query(\"INSERT INTO`\".$this->tblPrefix.$this->table.\"` (client_id,quotationid,title,content,amount,moddate,himage,cdetails,othertxt,status)\n VALUES ('\".$this->logUser.\"', '\".$thisQuoteId.\"', '\".$result[0]['title'].\"','\".$result[0]['content'].\"','\".$result[0]['amount'].\"',\n '\".$thisTime.\"','\".$result[0]['himage'].\"','\".$result[0]['cdetails'].\"','\".$result[0]['othertxt'].\"','open')\");\n\n // GetThe added record\n $newQuote = $this->query(\"SELECT id FROM `\".$this->tblPrefix.$this->table.\"` WHERE client_id='\".$this->logUser.\"' AND moddate='\".$thisTime.\"' AND content='\".$result[0]['content'].\"' AND quotationid='\".$thisQuoteId.\"'\");\n // Update the Wish list\n $result = $this->query(\"UPDATE `\".$this->tblPrefix.\"sys_support` SET content_wlist='\".$str.\"',wish_quote_link='\".$newQuote[0]['id'].\"' WHERE client_id='\".$this->logUser.\"'\");\n\n if($result) return $msg = array('SUC','QUOTE_RE_CREATED');\n \n }\n\t \t \n }", "public function getQuoteDetails()\n {\n $types = [\n ['value' => 'Full Kitchen', 'text' => 'Full Kitchen'],\n ['value' => 'Cabinet Only', 'text' => 'Cabinet Only'],\n ['value' => 'Cabinet Small Job', 'text' => 'Cabinet Small Job'],\n ['value' => 'Cabinet and Install', 'text' => 'Cabinet and Install'],\n ['value' => 'Granite Only', 'text' => 'Granite Only'],\n ];\n if (Auth::user()->id == 5 || Auth::user()->id == 1)\n {\n $types[] = ['value' => 'Builder', 'text' => 'Builder'];\n }\n $type = Editable::init()->id(\"quote_type\")->placement('right')->type('select')->title(\"Quote Type\")\n ->linkText($this->quote->type)\n ->source($types)->url(\"/quote/{$this->quote->id}/type/liveupdate\")->render();\n\n if (!$this->quote->title)\n {\n $this->quote->title = \"Main Quote\";\n }\n $title = Editable::init()->id(\"quote_title\")->placement('right')->type('text')->title(\"Title\")\n ->linkText($this->quote->title)\n ->url(\"/quote/{$this->quote->id}/title/liveupdate\")->render();\n $markup = Editable::init()->id(\"quote_markup\")->placement('right')->type('text')->title(\"Markup Percentage\")\n ->linkText($this->quote->markup)\n ->url(\"/quote/{$this->quote->id}/markup/liveupdate\")->render();\n\n $rows = [];\n $rows[] = ['Quote Type:', $type];\n $rows[] = ['Title (Description)', $title];\n if ($this->quote->type == 'Full Kitchen')\n {\n $rows[] = ['Customer Picking Slab:', $this->quote->picking_slab];\n }\n if ($this->quote->type == 'Builder')\n {\n $rows[] = ['Frugal Markup Percentage:', $markup];\n }\n if (isset($this->meta['finance']))\n {\n switch ($this->meta['finance']['type'])\n {\n case 'all':\n $type = \"100% Financing Option for \" . $this->meta['finance']['terms'] . \" months\";\n break;\n case 'partial':\n\n $type = \"Partial financing Option putting $\" . $this->meta['finance']['downpayment'] . \" down\n with \";\n if (isset($this->meta['finance']['down_cash']) && $this->meta['finance']['down_cash'] > 0)\n {\n $type .= '$' . $this->meta['finance']['down_cash'] . \" in cash, \";\n }\n if (isset($this->meta['finance']['down_credit']) && $this->meta['finance']['down_credit'] > 0)\n {\n $type .= '$' . $this->meta['finance']['down_credit'] . \" in cash, \";\n }\n $type = substr($type, 0, -2);\n $type .= \" and financing for \" . $this->meta['finance']['terms'] . \" months\";\n break;\n case 'none':\n $type = \"No financing paying \";\n if (isset($this->meta['finance']['method']) && $this->meta['finance']['method'] == 'split')\n {\n if (isset($this->meta['finance']['no_cash']) && $this->meta['finance']['no_cash'] > 0)\n {\n $type .= \"$\" . number_format($this->meta['finance']['no_cash'], 2) . \" in cash, \";\n }\n if (isset($this->meta['finance']['no_credit']) && $this->meta['finance']['no_credit'] > 0)\n {\n $type .= \"$\" . number_format($this->meta['finance']['no_credit'], 2) . \" in credit, \";\n }\n $type = substr($type, 0, -2);\n }\n else\n {\n $type = \"No finance using \" . $this->meta['finance']['method'] . \" for payment\";\n }\n break;\n default:\n $type = \"Financing Option Needed\";\n }\n $rows[] = ['Financing Options', $type];\n }\n\n $table = Table::init()->rows($rows)->render();\n $panel = Panel::init('primary')\n ->header(\"Quote Details <small style='color:#fff'>Quote Type and Cabinet Information</small>\")\n ->content($table)->render();\n return $panel;\n }", "private function getQuoteId()\n {\n $this->quoteId = $this->getRequest()->getParam('quoteId');\n if ($this->quoteId == '') {\n throw new \\Exception(self::CC_NO_QUOTE);\n }\n }", "public function getQuote() {\n return $this->quote;\n }", "public function request(){\n return \\Gaia\\ShortCircuit::request();\n }", "public function handle()\n {\n //\n\n //Read WishList and generate requests\n\n //By Card - By Trends , By Users\n //By Set By Rarity - By Trends, By Users\n\n }", "public static function simulate_new_request() {\n self::$now += 0.1;\n self::$purgetoken = null;\n }", "function msgsrv_request ($target, $cmd, $content, $link, $timeout = 30000) {}", "public function getQuotationInfo_get(){\n extract($_GET);\n $quotation_id = $_GET['quotation_id'];\n $response = $this->QuotationForEnquiry_model->getQuotationInfo($quotation_id);\n return $this->response($response);\n }", "private function callApi(){\n $endpoint = sprintf( self::$ENDPOINT, $this->category );\n\n // call URL and get contents\n $content = file_get_contents($endpoint);\n\n // Check if Backend API has failed to return a successul response\n if($content===FALSE){\n throw new Exception(\"Backend service failed to return a response. Possibly throttling our request.\");\n }\n\n // Parse JSON response\n $response = json_decode($content, true);\n\n // Return just the quote\n $quote = $response['contents']['quotes'][0];\n $quote['requested_category'] = $this->category;\n if(!$quote['id']){\n $quote['id'] = substr( md5($str), 0, 32); // just a unique id if missing\n }\n\n return $quote;\n }", "public function addProduct(Request $request)\n {\n $user = auth()->user();\n $returnResult = [];\n $success = false;\n $today = date(\"Y-m-d\");\n if ($request->place) {\n if (!$request->quoteId) {\n $quote_number = DB::table('quotes')->max('quote_number');\n if ($quote_number === 0) {\n $org = \\App\\Organization::find($user->organization_id);\n $quote_number = --$org->quote_number;\n }\n\n $accountData = DB::table('accounts')\n ->select('accounts.id as account_id',\n 'record_types.tax')\n ->join('document_types', 'document_types.id', '=', 'accounts.document_type_id')\n ->join('record_types', 'record_types.id', '=', 'document_types.record_type_id')\n ->join('locations', 'locations.id', '=', 'accounts.location_id')\n ->join('users', 'users.id', '=', 'accounts.created_by_id')\n ->where('users.organization_id', $user->organization_id)\n ->where('locations.id', $user->locationId)\n ->where('quotes.id', $id)->first();\n\n $locationId = $request->locationId;\n $quote = new \\App\\Quote;\n $quote->account_id=$accountData->account_id;\n $quote->location_id=$locationId;\n $quote->quote_number=++$quote_number;\n $quote->aditional_detail=$request->aditional_detail;\n $quote->quote_date=$request->quote_date;\n $quote->tax=$accountData->tax;\n $quote->created_by_id=$user->id;\n $quote->stage_id=2;\n $quote->save();\n }\n $quoteId = $request->quoteId ? $request->quoteId : $quote->id;\n if ($quoteId) {\n\n $quoteItem= new \\App\\QuoteItem;\n $quoteUser = \\App\\Quote::find($quoteId)->users;\n $quote = \\App\\Quote::find($quoteId);\n if ($user->organization_id == $quoteUser->organization_id) {\n $quoteItem->quote_id=$quoteId;\n $quoteItem->product_id=$request->id;\n $quoteItem->quantity=$request->quantity;\n $quoteItem->description=$request->description;\n $quoteItem->place_id=$request->place;\n $quoteItem->category_id=$request->category;\n if ($request->price){\n $quoteItem->price=$request->price;\n }\n $quoteItem->package=0;\n if ($request->package === \"true\"){\n $quoteItem->package=1;\n \n $itemPackage = DB::table('quote_item_packages')\n ->where('quote_id', $quoteId)\n ->where('place_id', $request->place)\n ->where('category_id', $request->category)\n ->first();\n if (!$itemPackage) {\n $itemPackage = new \\App\\QuoteItemPackage;\n $itemPackage->quote_id=$quoteId;\n $itemPackage->place_id=$request->place;\n $itemPackage->category_id=$request->category;\n // $itemPackage->created_at = date('Y-m-d H:i:s');\n // $itemPackage->updated_at = date('Y-m-d H:i:s');\n $itemPackage->value=0;\n $itemPackage->save();\n }\n } else {\n if ($request->optional === \"true\" || $request->offer === \"true\"){\n if ($request->other) {\n $quoteItem->other = 0;\n }\n } else {\n $quoteItem->other=$request->other !== null ? $request->other : 0;\n }\n if ($request->optional === \"true\"){\n $quoteItem->optional=1;\n } else {\n $quoteItem->optional=0;\n }\n if ($request->offer === \"true\"){\n $quoteItem->offer=1;\n } else {\n $quoteItem->offer=0;\n }\n }\n if ($quote->stage_id === 2 && $quoteItem->save()) {\n $quote->aditional_detail=$request->aditional_detail;\n $quote->quote_date=$request->quote_date;\n $quote->updated_at=date('Y-m-d H:i:s');\n $quote->save();\n\n // $product = DB::table('categories')\n // ->select('categories.id')\n // ->join('places',\n // 'places.category_id', '=', 'categories.id')\n // ->join('users', 'users.id', '=', 'categories.created_by_id')\n // ->limit(1)\n // ->where('places.id', $request->place)\n // ->where('users.organization_id', $user->organization_id)->get();\n \\App\\QuoteItemCategory::updateOrCreate(\n ['quote_id' => $quoteId, 'category_id' => $request->category],\n ['description' => $request->descripcionCat]\n );\n $returnResult = $this->QuoteDetail($quoteItem->quote_id);\n $returnResult['quoteId'] = $quoteId;\n $success = true;\n } else {\n $returnResult['message'] = 'Error while adding item, please contact your administrator';\n }\n } else {\n $returnResult['message'] = 'You have no permissions on this record';\n }\n } else {\n $returnResult['message'] = 'Error while saving record, please contact your administrator';\n }\n } else {\n $returnResult['message'] = 'Debe seleccionar un lugar';\n }\n return response()->json(array('success' => $success, 'data'=>$returnResult));\n }", "public function getQuote()\n\t{\n\t\treturn $this->quote;\n\t}", "public function getQuote()\n {\n if(Mage::app()->getStore()->isAdmin()){\n return Mage::getSingleton('adminhtml/session_quote')->getQuote();\n }\n else {\n return Mage::getSingleton('checkout/session')->getQuote();\n }\n }", "public function assignQuoteAction()\n\t{\n\t\tif($this->_request-> isPost() && $this->adminLogin->userId) \n {\n\t\t\t$assign_parameters=$this->_request->getParams();\n\n\t\t\t$ep_user_id=$assign_parameters['ep_user_id'];\n\t\t\t$quote_by=$this->quote_creation->create_step1['quote_by'];\n\t\t\tif($ep_user_id==$quote_by)\n\t\t\t{\n\t\t\t\techo json_encode(array('status'=>'same_user'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->quote_creation->create_step1['quote_by']=$ep_user_id;\n\t\t\t\techo json_encode(array('status'=>'success'));\n\t\t\t}\n\t\t\texit;\n\t\t}\t\n\n\t}", "public function getTransferwiseQuote(Request $request){\n $source = $request->get('source');\n $target = $request->get('target');\n $amount = $request->get('amount');\n\n // Call Transferwise API to get temporary quotes\n $result = Transferwise::temporaryQuotes($source, $target, $amount);\n\n // Return response\n if($result){\n // Success\n if(empty($result['errors'])){\n $response = [\n 'status' => [\n 'code' => 0,\n 'message' => 'OK'\n ],\n 'data' =>[\n 'fee' => $result['fee'],\n 'targetAmount' => $result['targetAmount'],\n 'sourceAmount' => $result['sourceAmount'],\n ]\n ];\n // Get error result from Transferwise API\n }else{\n $response = [\n 'status' => [\n 'code' => 1,\n 'message' => $result['errors'][0]['message']\n ]\n ];\n }\n // Cant get result from Transferwise\n }else{\n $response = [\n 'status' => [\n 'code' => 2,\n 'message' => \"Can't get result from Transferwise\"\n ]\n ];\n }\n\n return response()->json($response);\n }", "public function queryFromPreliminary(QueryServiceQuotesRequest $request)\n {\n $facilitator = $request->input('facilitator');\n $scheduledAt = $request->input('scheduled_at');\n $service = $request->input('service', 'all'); // the specific service rate to query - defaults to `all`\n $serviceType = $request->input('service_type'); // the specific type of service rate to query\n $isCashOnDelivery = $request->has('cod');\n $currency = $request->has('currency');\n $totalDistance = $request->input('distance');\n $totalTime = $request->input('time');\n $pickup = $request->or(['payload.pickup', 'pickup']);\n $dropoff = $request->or(['payload.dropoff', 'dropoff']);\n $return = $request->or(['payload.return', 'return']);\n $waypoints = $request->or(['payload.waypoints', 'waypoints'], []);\n $entities = $request->or(['payload.entities', 'entities']);\n $single = $request->boolean('single');\n $isRouteOptimized = $request->boolean('is_route_optimized', true);\n\n // store preliminary data in service quotes meta\n $preliminaryData = [\n 'pickup' => $pickup,\n 'dropoff' => $dropoff,\n 'return' => $return,\n 'waypoints' => $waypoints,\n 'entities' => $entities,\n 'cod' => $isCashOnDelivery,\n 'currency' => $currency\n ];\n\n $requestId = ServiceQuote::generatePublicId('request');\n $serviceQuotes = [];\n\n if (Utils::isNotScalar($pickup)) {\n $pickup = Place::createFromMixed($pickup);\n }\n\n if (Utils::isNotScalar($dropoff)) {\n $dropoff = Place::createFromMixed($dropoff);\n }\n\n if (Utils::isPublicId($pickup)) {\n $pickup = Place::where('public_id', $pickup)->first();\n }\n\n if (Utils::isPublicId($dropoff)) {\n $dropoff = Place::where('public_id', $dropoff)->first();\n }\n\n // convert waypoints to place instances\n $waypoints = collect($waypoints)->mapInto(Place::class);\n $entities = collect($entities)->mapInto(Entity::class);\n\n // should all be Place like\n $waypoints = collect([$pickup, ...$waypoints, $dropoff])->filter();\n\n // if facilitator is an integrated partner resolve service quotes from bridge\n if ($facilitator && Utils::isIntegratedVendorId($facilitator)) {\n $integratedVendor = IntegratedVendor::where('company_uuid', session('company'))->where(function ($q) use ($facilitator) {\n $q->where('public_id', $facilitator);\n $q->orWhere('provider', $facilitator);\n })->first();\n\n if ($integratedVendor) {\n try {\n /** @var \\Fleetbase\\Models\\ServiceQuote $serviceQuote */\n $serviceQuote = $integratedVendor->api()->setRequestId($requestId)->getQuoteFromPreliminaryPayload($waypoints, $entities, $serviceType, $scheduledAt, $isRouteOptimized);\n } catch (\\Exception $e) {\n return response()->json([\n 'errors' => [$e->getMessage()]\n ], 400);\n }\n }\n\n // set preliminary data to meta\n $serviceQuote->updateMeta('preliminary_data', $preliminaryData);\n\n // send single quote back\n if ($single) {\n return new ServiceQuoteResource($serviceQuote);\n }\n\n if (!is_array($serviceQuote)) {\n $serviceQuote = [$serviceQuote];\n }\n\n return ServiceQuoteResource::collection($serviceQuote);\n }\n\n // if no total distance recalculate totalDistance and totalTime based on waypoints collected\n if (!$totalDistance) {\n $matrix = Utils::distanceMatrix([$waypoints->first()], $waypoints->skip(1));\n\n // set totalDistance and totalTime\n $totalDistance = $matrix->distance ?? 0;\n $totalTime = $matrix->time ?? 0;\n }\n\n // if quote for single service\n if ($service !== 'all') {\n $serviceRate = ServiceRate::where('uuid', $service)->first();\n $serviceQuotes = collect();\n\n if ($serviceRate) {\n [$subTotal, $lines] = $serviceRate->quoteFromPreliminaryData($entities, $waypoints, $totalDistance, $totalTime, $isCashOnDelivery);\n\n $quote = ServiceQuote::create([\n 'request_id' => $requestId,\n 'company_uuid' => $serviceRate->company_uuid,\n 'service_rate_uuid' => $serviceRate->uuid,\n 'amount' => $subTotal,\n 'currency' => $serviceRate->currency,\n ]);\n\n // set preliminary data to meta\n $quote->updateMeta('preliminary_data', $preliminaryData);\n\n $items = $lines->map(function ($line) use ($quote) {\n return ServiceQuoteItem::create([\n 'service_quote_uuid' => $quote->uuid,\n 'amount' => $line['amount'],\n 'currency' => $line['currency'],\n 'details' => $line['details'],\n 'code' => $line['code'],\n ]);\n });\n\n $quote->setRelation('items', $items);\n $serviceQuotes->push($quote);\n\n if ($single) {\n return new ServiceQuoteResource($quote);\n }\n\n return ServiceQuoteResource::collection($serviceQuotes);\n }\n }\n\n // get all service rates\n $serviceRates = ServiceRate::getServicableForPlaces(\n $waypoints,\n $serviceType,\n $currency,\n function ($query) use ($request) {\n $query->where('company_uuid', $request->session()->get('company'));\n }\n );\n $serviceQuotes = collect();\n\n // calculate quotes\n foreach ($serviceRates as $serviceRate) {\n [$subTotal, $lines] = $serviceRate->quoteFromPreliminaryData($entities, $waypoints, $totalDistance, $totalTime, $isCashOnDelivery);\n\n $quote = ServiceQuote::create([\n 'request_id' => $requestId,\n 'company_uuid' => $serviceRate->company_uuid,\n 'service_rate_uuid' => $serviceRate->uuid,\n 'amount' => $subTotal,\n 'currency' => $serviceRate->currency,\n ]);\n\n // set preliminary data to meta\n $quote->updateMeta('preliminary_data', $preliminaryData);\n\n $items = $lines->map(function ($line) use ($quote) {\n return ServiceQuoteItem::create([\n 'service_quote_uuid' => $quote->uuid,\n 'amount' => $line['amount'],\n 'currency' => $line['currency'],\n 'details' => $line['details'],\n 'code' => $line['code'],\n ]);\n });\n\n $quote->setRelation('items', $items);\n $serviceQuotes->push($quote);\n }\n\n // if single quotation requested\n if ($single) {\n // find the best quotation\n $bestQuote = $serviceQuotes->sortBy('amount')->first();\n\n return new ServiceQuoteResource($bestQuote);\n }\n\n return ServiceQuoteResource::collection($serviceQuotes);\n }", "public function query_quote_info(){\n\t\t$this->db->select('quote_id,quote_status,quote_num,quote_cre_date,quote_amount,cus_name,us_fname,us_lname');\n\t\t$this->db->from('tb_quote');\n\t\t$this->db->join('tb_user','tb_quote.quote_by=tb_user.us_id');\n\t\t$this->db->join('tb_customer','tb_quote.quote_cus=tb_customer.cus_id');\n\t\treturn $this->db->get();\n\t}", "public function getQuote(): ?string\n {\n try {\n $request = $this->api->get(env('QUOTE_URL'));\n $response = $request->getBody()->getContents();\n\n return $response;\n } catch (ClientException $e) {\n $response = $e->getResponse();\n Log::error('Error getting quotes.'.$response->getBody->getContents());\n }\n }", "public function getQuoteUpload($request)\n {\n // $this->tagAPIController->getAllTag($request);\n // $this->contentCategoryAPIController->getAllContentCategory($request);\n }", "function buyPostage()\n {\n\n $this->PartnerTransactionID = substr(uniqid(rand(), true), 0, 10);\n\n $xml = '<RecreditRequest>\n <RequesterID>'. $this->RequesterID.'</RequesterID>\n <RequestID>' . $this->PartnerTransactionID . '</RequestID>\n <CertifiedIntermediary>\n <AccountID>'.$this->AccountID.'</AccountID>\n <PassPhrase>'. $this->PassPhrase.'</PassPhrase>\n </CertifiedIntermediary>\n <RecreditAmount>500</RecreditAmount>\n </RecreditRequest>';\n\n\n $data = array(\"RecreditRequestXML\" => $xml);\n $request = $this->client->post('/LabelService/EwsLabelService.asmx/BuyPostageXML', array(), $data);\n $this->send_request($request);\n\n\n }", "public function sendTo_WO_get() {\n $quotation_id = $_GET['quotation_id'];\n $branch_name = $_GET['branch_name'];\n $response = $this->QuotationForEnquiry_model->sendTo_WO($quotation_id,$branch_name);\n return $this->response($response);\n }", "public function sendRequest( ) {\n\n }", "public function sendRequest()\n {\n }", "function ywraq_get_message_after_request_quote_sending( $new_order ) {\n\n\t\tif ( get_option( 'ywraq_activate_thank_you_page' ) == 'yes' ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$ywraq_message_after_sent_the_request = get_option( 'ywraq_message_after_sent_the_request' );\n\t\t$ywraq_message_to_view_details = get_option( 'ywraq_message_to_view_details' );\n\n\t\t$quote_number = apply_filters( 'ywraq_quote_number', $new_order );\n\t\tif ( is_user_logged_in() && ( get_option( 'ywraq_enable_link_details' ) == \"yes\" && get_option( 'ywraq_enable_order_creation', 'yes' ) == 'yes' ) ) {\n\t\t\t$message = sprintf( __( '%s %s <a href=\"%s\">#%s</a>', 'yith-woocommerce-request-a-quote' ), $ywraq_message_after_sent_the_request, $ywraq_message_to_view_details, YITH_YWRAQ_Order_Request()->get_view_order_url( $new_order ), $quote_number );\n\t\t} else {\n\t\t\t$message = $ywraq_message_after_sent_the_request;\n\t\t}\n\n\t\treturn $message;\n\t}", "private function querry( $question, $more = null ){\n if ($more == null){\n $more = '';\n } else {\n //$more = htmlentities($more);\n }\n ini_set('max_execution_time', 0);\n $url = $this->urlData . $question . '?api_key=' . $this->authKeyV3 . $more;\n $result = file_get_contents( $url );\n return $result == NULL ? 'Can not find a url: ' . $url : $result ;\n }", "public function processToken(Mage_Sales_Model_Quote $quote)\r\n {\r\n try {\r\n $billing = $quote->getBillingAddress();\r\n $payment = $quote->getPayment();\r\n\r\n /** @var Eway_Rapid31_Model_Method_Saved $ewaySave */\r\n $ewaySave = Mage::getModel('ewayrapid/method_saved');\r\n $ewaySave->setData('info_instance', $payment);\r\n\r\n /** @var Mage_Sales_Model_Order $order */\r\n $order = Mage::getModel('sales/order');\r\n /*$order->setBillingAddress($billing);*/\r\n\r\n /** @var Mage_Sales_Model_Order_Payment $paymentObj */\r\n $paymentObj = Mage::getModel('sales/order_payment');\r\n $paymentObj->setOrder($order);\r\n\r\n $request = Mage::getModel('ewayrapid/request_token');\r\n\r\n $ewaySave->_setBilling($billing);\r\n $ewaySave->_shouldCreateOrUpdateToken($paymentObj, $request);\r\n return $payment->getAdditionalData();\r\n } catch (Exception $e) {\r\n throw $e;\r\n }\r\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 }", "private function sellTrasactionPendingAddsMoney(){\n\n }", "protected function _request() {}", "public function getQuote() {\n return $this->quote;\n }", "public function getQuoteId();", "public function getQtos();", "function request()\n {\n }", "public function makeQuoteOrder(Request $request, Quote $quote)\n {\n \\DB::beginTransaction();\n try {\n $order = $this->craeteQuoteOrder(\n $request,\n $this->quoteShippingAddress($request, $quote),\n $this->quotePickupAddress($request, $quote),\n $quote\n );\n\n \\DB::commit();\n return response()->json([\n \"message\" => \"Order Added Successfully.\",\n \"data\" => $order\n ]);\n } catch (\\Exception $e) {\n \\DB::rollBack();\n return response([\"message\" => $e->getMessage()], 500);\n }\n }", "public function suggestPurchaseRequest()\n {\n return Product::select(DB::raw('id, productName as prDescription, reorderAmount - amount as prQty,reorderAmount, \"Write a descriptive Purpose for this request\" as prPurpose'))\n ->whereRaw('amount < reorderAmount and amount > 0')->limit(env('PURCHASE_ORDER_LIMIT'))->get();\n }", "function on_buy()\r\n\t{\r\n\t}", "public function getQuoteStateToAccepted();", "public function request();", "function fastQuote_info() {\n global $lang;\n\n $lang->load('fastQuote');\n $lang->fastQuoteDesc = '<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" style=\"float:right;\">' .\n '<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">' . \n '<input type=\"hidden\" name=\"hosted_button_id\" value=\"3BTVZBUG6TMFQ\">' .\n '<input type=\"image\" src=\"https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">' .\n '<img alt=\"\" border=\"0\" src=\"https://www.paypalobjects.com/pl_PL/i/scr/pixel.gif\" width=\"1\" height=\"1\">' .\n '</form>' . $lang->fastQuoteDesc;\n\n return Array(\n 'name' => $lang->fastQuoteName,\n 'description' => $lang->fastQuoteDesc,\n 'website' => 'https://lukasztkacz.com',\n 'author' => 'Lukasz \"LukasAMD\" Tkacz',\n 'authorsite' => 'https://lukasztkacz.com',\n 'version' => '1.2.0',\n 'compatibility' => '18*',\n 'codename' => 'fast_quote'\n );\n}", "function quotes($side = 1) # Browse quote library. MODAL\n\t{\n\t\t# \n\t\t# Get recommended quotes for product.\n\t\t$pid = $this->Session->read(\"Design.Product.product_type_id\");\n\n\t\tif(!empty($pid))\n\t\t{\n\t\t\t$productQuotes = $this->ProductQuote->find('all', array(\n\t\t\t\t'conditions'=>array('ProductQuote.product_type_id'=>$pid)\n\t\t\t));\n\t\t\t#echo \"PC($pid)=\".print_r($productQuotes,true);\n\t\t\t$this->set(\"productQuotes\", $productQuotes);\n\t\t}\n\n\t\t# Otherwise, get quote categories for browsing.\n\t\t$categories = $this->GalleryCategory->find('list', array(\n\t\t\t'conditions'=>\"GalleryCategory.parent_node = 1\",\n\t\t\t'fields'=>array('GalleryCategory.browse_node_id','GalleryCategory.browse_name'),\n\t\t\t'order'=>\"GalleryCategory.browse_name\")\n\t\t);\n\t\t$this->set(\"categories\", $categories);\n\n\t\t$maxLength = $this->Session->read(\"Design.Product.quote_limit\");\n\n\t\tif(!empty($this->data['Quote']['browse_node_id'])) # Browse cat.\n\t\t{\n\t\t\t# For now, make all one page, just make them scroll down...\n\n\t\t\t$category = $this->GalleryCategory->read(null, $this->data['Quote']['browse_node_id']);\n\n\t\t\t$kw = $category['GalleryCategory']['browse_name'];\n\n\t\t\t$browseQuotes = $this->Quote->findAll(array(\" (subjects LIKE '%$kw%') \" . ($maxLength > 0 ? \" AND (LENGTH(text)+LENGTH(attribution)) <= '$maxLength' \" : \"\")));\n\n\t\t\t$this->set(\"browseQuotes\", $browseQuotes);\n\t\t}\n\t\telse if(!empty($this->data['Quote']['keywords'])) # Search\n\t\t{\n\t\t\t# For now, make all one page, just make them scroll down...\n\n\t\t\t$keywords = split(\" \", mysql_escape_string($this->data['Quote']['keywords']));\n\n\t\t\t$keywhere = array();\n\t\t\tforeach($keywords as $kw)\n\t\t\t{\n\t\t\t\t$keywhere[] = \"CONCAT(text,attribution,subjects) LIKE '%$kw%'\";\n\t\t\t}\n\t\t\t$keyword_where = join(\" AND \", $keywhere);\n\t\t\t$searchQuotes = $this->paginate('Quote', array( \" ($keyword_where) \" . ($maxLength > 0 ? \" AND (LENGTH(text)+LENGTH(attribution)) <= '$maxLength' \" : \"\")) );\n\n\t\t\t$this->set(\"searchQuotes\", $searchQuotes);\n\n\t\t}\n\n\t\t$this->set(\"side\", $side); # So we know where to inject results.\n\n\t}", "public function request(){\n\n $url = 'https://www.amazon.com/ap/oa?client_id=' . \n urlencode($this->strategy['client_id']) . \n '&scope=' . urlencode($this->strategy['scope']) . \n '&response_type=code&redirect_uri=' . \n urlencode($this->strategy['redirect_uri']);\n\n header('Location: ' . $url);\n\t}", "public function buy_dish() {\n\t\t\t$res = $this->Restaurant_model->dish_buy();\n\t\t\techo $res;\n\t\t}", "public function getCustomer_quotations_get() {\n $customer_id = $_GET['cust_id'];\n $result = $this->Enquiry_model->getQuotations($customer_id);\n return $this->response($result);\n }", "public function loadMoreOrderAction() {\n $block = Mage::getBlockSingleton('webpos/orderlist');\n $this->getResponse()->setBody(json_encode($block->toHtml()));\n }", "public function fetchQuotes()\n {\n $quotesArray = [];\n // fetch all quotes id\n $idArray = $this->fetchQuoteId();\n // shuffle the id array\n shuffle($idArray);\n // loop and get the details of quotes\n foreach ($idArray as $quoteId) {\n array_push($quotesArray, $this->fetchQuoteDetails($quoteId));\n }\n // return the array that has the shuffled quotes\n return $quotesArray;\n }", "public function execute()\n {\n try {\n $this->cart->removeAllFailed();\n } catch (\\Exception $e) {\n $this->logger->critical($e);\n $this->messageManager->addError(__('Exception occurred during update quote'));\n }\n $data = [];\n $response = $this->resultRawFactory->create();\n $response->setHeader('Content-type', 'text/json');\n $response->setContents($this->jsonEncoder->encode($data));\n return $response;\n }", "private function repect_ech_m1(){\t\n\t\t\t\n\t\t\tif($this->get_request_method() != \"GET\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\t\n\t\t\t$result=repect_ech_m1();\n\t\t\t$this->response($this->json($result), 200);\n\t\t\t$this->response('',204);\t\n\t\t}", "function getAllOrders() {\n\techo \"Getting All Order </br>\";\n\t$response = getRequest('/api/order');\n\tprintInfo($response);\n}", "function default_quote_content( $content, $post )\n {\n\n if ($post->post_type !== 'lh_quotes')\n {\n return $content;\n }\n\n if(!isset($_GET['client_id']) )\n {\n return $content;\n }\n\n $client_id = $_GET['client_id'];\n\n $client_name = get_the_title($client_id);\n $arr = explode(' ',trim($client_name));\n $first_name = $arr[0]; // get the first name\n\n $content = 'Dear '.$first_name.',<br/>';\n $content.= 'Thanks for your interest in Little House. Please find your quote broken down for the playhouse / play decks as discussed.<br/><br/>';\n $content.= 'This price is only for the timber and labour and so does not include accessories such as the climbing wall holds or slide etc. We can help you to source these, as required.<br/><br/>';\n $content.= '[lh_image]<br/>';\n $content.= '[lh_quote]<br/><br/>';\n\n $content.='This quote is provided on the basis of the following assumptions:';\n $content.='<ul>';\n $content.='<li>Date of build will be agreed upon commission but is subject to the availability of timber</li>';\n $content.='<li>Timber can transported to the build site (e.g. 3m lengths can fit through a side access or direct route through the house)</li>';\n $content.='<li>Timber will be delivered to your home/build site on the day in advance of the build, usually the day prior to the build and will be stored in a safe, secure location. Timber that is damaged after delivery but prior to build will require replacement at an additional cost.</li>';\n $content.='<li><Water and electricity will be available for the duration of the build /li>';\n $content.='<li>You will receive formal approval for the build from your immediate neighbours. </li>';\n $content.='</ul>';\n\n $content.= '<br/>If you would like to proceed and commission your Little House, a deposit of £500 is required, made payable to Barrington Innovation, sort code 309034 account number 32156268, paid a minimum of '.DEPOSIT_DAY_LIMIT.' days prior to build date. The deposit will be deducted from your invoice upon completion of the build.<br/><br/>';\n $content.='To accept this quote and kick start your Little House build, please click on the link below.<br/><br/>';\n $content.= '[lh_accept_link]<br/><br/>';\n\n $content.='If you have any queries or would like to discuss any aspect of the design, please contact Little House’s Client Liaison Ailsa Peron (contact details below), who will help answer any questions relating to your quote and who will help coordinate your build, if commissioned.<br/>';\n $content.='Thank you again for your interest, and we hope to have the opportunity to bring your Little House to life soon!<br/><br/>';\n $content.='Kind regards,<br/>';\n $content.= 'Alex Furr';\n\n return $content;\n }" ]
[ "0.62255466", "0.615382", "0.6087315", "0.60296965", "0.59515095", "0.59364206", "0.5917992", "0.5917291", "0.5839777", "0.58035094", "0.5787025", "0.5772414", "0.571023", "0.5674282", "0.5634628", "0.5588553", "0.5572788", "0.5562482", "0.5532545", "0.5514442", "0.5513982", "0.54971886", "0.54842997", "0.5473209", "0.5380899", "0.5370224", "0.535238", "0.530002", "0.5277634", "0.5261147", "0.5236822", "0.5218103", "0.5204545", "0.5203455", "0.519997", "0.51872903", "0.51749724", "0.51726836", "0.51705724", "0.5147203", "0.5147203", "0.51458585", "0.5145407", "0.51374215", "0.51120615", "0.5108751", "0.50922513", "0.5087266", "0.508134", "0.50682425", "0.506023", "0.5059034", "0.50581086", "0.50427985", "0.50334144", "0.5032294", "0.5031242", "0.5029146", "0.5019067", "0.5008637", "0.5007794", "0.5002102", "0.4996683", "0.4993819", "0.49892914", "0.49887547", "0.49781045", "0.49682555", "0.49599648", "0.4956395", "0.49552563", "0.49440506", "0.49369276", "0.4928346", "0.49209687", "0.49206594", "0.4919839", "0.49134853", "0.49133497", "0.4911527", "0.49093145", "0.49071708", "0.49046224", "0.4902347", "0.49000603", "0.48975942", "0.48936307", "0.48933274", "0.487882", "0.48713145", "0.48697948", "0.4869218", "0.4868214", "0.4861247", "0.48546687", "0.4845831", "0.48429704", "0.48363683", "0.48293227", "0.4826514" ]
0.5991907
4
more quote request by Admin
public function moreQuoteAdmin(){ $this->addElement('text', 'more_quote_admin_allowed', array ( "required" => TRUE, 'class' => 'form-control required', "label" => "How many more quote do you allow?" , "maxlength"=>"2", "filters" => array("StringTrim","StripTags"), "validators" => array( array("NotEmpty",true,array("messages"=>"more quote number is required ")), ), )); $this->submitButton(); $this->bttnsubmit->setLabel("Allow"); $this->bttnsubmit->setAttrib("class","site_button"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function returnQuoteAction()\n {\n $this->_returnQuote();\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('success' => 1)));\n }", "public function quote($status = null, $id = null) {\n if($status == 'create') {\n $ongoing = $this->CrmQuotation->find('first', array(\n 'conditions' => array( \n 'CrmQuotation.admin_id' => $this->Auth->user('id'),\n 'CrmQuotation.status' => 'ONGOING'\n )));\n \n \n if(count($ongoing)!=0){\n //meaning meron syang ongoing na ginagawang quotation\n $quote_data = $ongoing; //retrieved data from existing ongoing quotation\n }else{\n //walang existing so data magcreate na ng data \n $terms_information = '<h3>I. PAYMENT</h3>\n <ol>\n <li>\n <p>A<strong> FIFTY PERCENT (50%)</strong> downpayment shall be required unless Raeas Marketing and the Client shall otherwise agree, balance upon completion of delivery as per agreement.</p>\n </li>\n <li>\n <p>Payment will be accepted in Dated Company Check, Manager’s Check, thru Bank Transfer or Cash.</p>\n </li>\n <li>\n <p>All check is payable to Raeas Marketing.</p>\n </li>\n </ol>\n <h3>II. DELIVERY</h3>\n <ol>\n <li>\n <p>Delivery is FREE for purchases above Php3, 000.00 within Metro Manila. </p>\n </li>\n <li>\n <p>Delivery outside Metro Manila may be charged to client.</p>\n </li>\n </ol>\n <h3>III. Validity</h3> \n <ol>\n <li>\n <p>10 Days from the date of proposal.</p>\n </li>\n <li>\n <p>Prices may vary without prior notice and shall not be considered final unless and until this Quotation Proposal has been signed and accepted.</p>\n </li>\n </ol>\n <h3>IV. Warranty</h3> \n <ol>\n <li>\n <p>One (1) year warranty against factory defect upon normal operating condition.</p>\n </li>\n </ol>\n <h3>V. Cancellation of orders</h3> \n <ol>\n <li>\n <p>All cancellation of orders will be charged a cancellation fee of 30% of the order value.</p>\n </li>\n </ol>';\n $dateToday = date(\"Hymds\");\n $milliseconds = round(microtime(true) * 1000);\n $newstring = substr($milliseconds, -3);\n $quote_number = $newstring . '' . $dateToday;\n \n $quote_exist = $this->CrmQuotation->find('count', array(\n 'conditions' => array(\n 'CrmQuotation.quote_number' => $quote_number\n )));\n\n if ($quote_exist == 0) {\n $quote_no = $quote_number;\n } else {\n $news = substr($milliseconds, -4);\n $quote_no = $news . '' . $dateToday;\n }\n $this->CrmQuotation->create();\n $this->CrmQuotation->set(array(\n 'quote_number' => $quote_no,\n 'admin_id' => $this->Auth->user('id'),\n 'status' => 'ONGOING',\n 'terms' => $terms_information, \n ));\n $this->CrmQuotation->save();\n $id = $this->CrmQuotation->getLastInsertID(); \n $quote_data = $this->CrmQuotation->find('first', array(\n 'conditions' => array('CrmQuotation.admin_id' => $this->Auth->user('id'), 'CrmQuotation.status' => 'ONGOING')\n )); \n }\n } else{\n $quote_data = $this->CrmQuotation->findById($id); \n }\n \n $this->set(compact('quote_data'));\n \n \n $companies = $this->getCompanies();\n // pr($quote_data);\n $quote_prods = $this->getQuotationProducts($quote_data['CrmQuotation']['id']);\n \n $product_lists = $this->getProducts();\n \n $this->set(compact('status','companies', 'quote_prods', 'product_lists'));\n \n\n }", "public function saveSendQuoteAction()\n\t{\n\t\tif($this->_request-> isPost() && $this->adminLogin->userId) \n {\n\t\t\t$final_parameters=$this->_request->getParams();\n\n\t\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\t\t//echo \"<pre>\";print_r($final_parameters);exit;\n\n\t\t\t//insert Quotes\n\t\t\t$quotes_data['title']=$this->quote_creation->create_mission['quote_title'];\n\t\t\t$quotes_data['client_id']=$this->quote_creation->create_step1['client_id'];\n\t\t\t$quotes_data['category']=$this->quote_creation->create_step1['category'];\n\t\t\tif($quotes_data['category']=='other')\n\t\t\t\t\t$quotes_data['category_other']=isodec($this->quote_creation->create_step1['category_other']);\n\t\t\tif($this->quote_creation->create_step1['client_websites'])\n\t\t\t$quotes_data['websites']=implode(\"|\",$this->quote_creation->create_step1['client_websites']);\n\t\t\t$quotes_data['quote_by']=$this->quote_creation->create_step1['quote_by'];\n\t\t\t$quotes_data['created_by']=$this->adminLogin->userId;\n\t\t\t$quotes_data['sales_suggested_price']=$this->quote_creation->select_missions['total_suggested_price'];\n\t\t\t$quotes_data['sales_suggested_currency']=$this->quote_creation->select_missions['currency'];\n\t\t\t$quotes_data['sales_comment']=$final_parameters['bo_comments'];\n\t\t\t$quotes_data['client_email_text']=$final_parameters['client_email'];\n\t\t\t//$quotes_data['documents_path']='path';\n\t\t\t$quotes_data['conversion']=$this->quote_creation->create_step1['conversion'];\n\n\t\t\t//$quotes_data['sales_delivery_time']=$final_parameters['delivery_time'];\n\t\t\t//$quotes_data['sales_delivery_time_option']=$final_parameters['delivery_option'];\n\t\t\t$quotes_data['client_know']=$final_parameters['client_know']? 'no':'yes';\n\t\t\t$quotes_data['urgent']=$final_parameters['urgent']? 'yes':'no';\n\t\t\t$quotes_data['urgent_comments']=$final_parameters['urgent_comments']?$final_parameters['urgent_comments']:NULL;\t\t\t\n\t\t\n\t\t\t/*$quotes_data['market_team_sent']=$final_parameters['market_team_sent'];\n\t\t\tif($quotes_data['market_team_sent']=='yes')\n\t\t\t\t$quotes_data['from_platform']=$final_parameters['from_platform'];*/\n\n\n\t\t\t//NEW QUOTE FILEDS \n\t\t\t$client_aims=$final_parameters['client_aims'];\n\t\t\t$quotes_data['client_aims']=implode(\",\",$client_aims);\n\n\t\t\tforeach($client_aims as $aim)\n\t\t\t{\n\t\t\t\t$client_prio[]=$final_parameters['priority_'.$aim];\n\t\t\t}\n\t\t\t$quotes_data['client_prio']=implode(\",\",$client_prio);\n\n\t\t\t$client_aims_comments=$final_parameters['client_aims_comments'];\n\t\t\t$quotes_data['client_aims_comments']=$client_aims_comments;\n\n\n\t\t\t$content_ordered_agency=$final_parameters['content_ordered_agency'];\n\t\t\t$quotes_data['content_ordered_agency']=$content_ordered_agency;\n\t\t\tif($content_ordered_agency=='yes')\n\t\t\t{\n\t\t\t\tif($final_parameters['agency']=='dont_know')\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['agency']=$final_parameters['agency'];\n\t\t\t\t\t$quotes_data['agency_name']='';\n\t\t\t\t}\n\t\t\t\telseif($final_parameters['agency_name'])\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['agency']='';\n\t\t\t\t\t$quotes_data['agency_name']=$final_parameters['agency_name'];\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse if($content_ordered_agency=='no')\n\t\t\t{\n\t\t\t\t$quotes_data['client_internal_team']=$final_parameters['client_internal_team'];\n\t\t\t}\n\n\t\t\t$quotes_data['client_know_writers']=$final_parameters['client_know_writers'];\n\n\t\t\t$volume_option=$final_parameters['volume_option'];\n\t\t\t$quotes_data['volume_option']=$volume_option;\n\t\t\tif($volume_option=='per')\n\t\t\t{\n\t\t\t\t$quotes_data['volume_option_multi']=$final_parameters['volume_option_multi'];\n\t\t\t}\n\t\t\telse if($volume_option=='every')\n\t\t\t{\n\t\t\t\t$quotes_data['volume_option_multi']=$final_parameters['volume_option_multi_every'];\n\t\t\t\t$quotes_data['volume_every']=$final_parameters['volume_every'];\n\t\t\t}\n\n\t\t\t$budget_marketing=$final_parameters['budget_marketing'];\n\t\t\tif($budget_marketing=='dont_know')\n\t\t\t{\n\t\t\t\t$quotes_data['budget_marketing']=$budget_marketing;\n\t\t\t\t$quotes_data['budget']='';\n\t\t\t\t$quotes_data['budget_currency']='';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$quotes_data['budget_marketing']='';\n\t\t\t\t$quotes_data['budget']=$final_parameters['budget'];\n\t\t\t\t$quotes_data['budget_currency']=$final_parameters['budget_currency'];\n\t\t\t}\n\n\n\t\t\t$quotes_data['estimate_sign_percentage']=$final_parameters['estimate_sign_percentage'];\n\t\t\t$quotes_data['estimate_sign_date']=$final_parameters['estimate_sign_date'];\n\t\t\t$quotes_data['estimate_sign_comments']=$final_parameters['estimate_sign_comments'];\n\n\t\t\t//echo \"<pre>\";print_r($quotes_data);exit;\n\n\t\t\t//Quote current version\n\t\t\tif($this->quote_creation->custom['version'])\n\t\t\t{\n\t\t\t\t$version=$this->quote_creation->custom['version'];\n\t\t\t}\n\t\t\telse\n\t\t\t\t$version=1;\n\t\t\t$quotes_data['version']=$version;\n\n\t\t\t//Getting Quote details if quote id available\n\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\tif($quoteIdentifier)\n\t\t\t{\n\t\t\t\t$quoteEditDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t$sales_review_staus=$quoteEditDetails[0]['sales_review'];\n\t\t\t}\n\t\t\t\n\n\t\t\t//check manager is on holiday or not\n\t\t\t$salesManager_holiday=$this->configval[\"sales_manager_holiday\"];\n\t\t\t$user_type=$this->adminLogin->type;\n\n\t\t\t\n\t\t\t//Staus of tech,seo,prod and sales\n\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')//new version quote\n\t\t\t{\n\t\t\t\tif(isset($final_parameters['send_low_quote']) OR isset($final_parameters['send_big_quote']) )\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['quote_send_team']=$final_parameters['quote_send_team'];\n\n\t\t\t\t\tif(($final_parameters['quote_send_team']=='send_sales_team'))\n\t\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t\t$quotes_data[\"sales_validation_expires\"]=time()+($this->configval['sales_validation_timeline']*60*60);\n\t\t\t\t\t\t$quotes_data['skip_prod_comments']=$final_parameters['skip_prod_comments'] ? $final_parameters['skip_prod_comments']:NULL;\n\t\t\t\t\t\t$prod_hours=$this->configval['sales_validation_timeline'];\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$onlySales=true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(($final_parameters['quote_send_team']=='send_tech_prod_team') || ($final_parameters['quote_send_team']=='send_tech_team'))\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\n\t\t\t\t\t\t\t$quotes_data['tech_timeline']=NULL;\n\t\t\t\t\t\t\t$quotes_data['tech_challenge_comments']='';\n\t\t\t\t\t\t\t$quotes_data['tech_challenge']='yes';\n\n\t\t\t\t\t\t\tif($final_parameters['quote_send_team']=='send_tech_prod_team')\n\t\t\t\t\t\t\t{//if tech & prod\n\t\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\t\n\t\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\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\telse if(($final_parameters['quote_send_team']=='send_seo_prod_team') || ($final_parameters['quote_send_team']=='send_seo_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\n\t\t\t\t\t\t\t$quotes_data['seo_timeline']=NULL;\n\t\t\t\t\t\t\t$quotes_data['seo_comments']='';\n\t\t\t\t\t\t\t$quotes_data['seo_challenge']='yes';\n\n\t\t\t\t\t\t\tif($final_parameters['quote_send_team']=='send_seo_prod_team')\n\t\t\t\t\t\t\t{//if seo & prod\n\t\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_tech_seo_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\n\t\t\t\t\t\t\t$quotes_data['seo_timeline']=NULL;\n\t\t\t\t\t\t\t$quotes_data['seo_comments']='';\n\t\t\t\t\t\t\t$quotes_data['seo_challenge']='yes';\n\n\t\t\t\t\t\t\t$quotes_data['tech_timeline']=NULL;\n\t\t\t\t\t\t\t$quotes_data['tech_challenge_comments']='';\n\t\t\t\t\t\t\t$quotes_data['tech_challenge']='yes';\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_prod_team'))\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\t\t\n\t\t\t\t\t\t\t$onlyProd=true;\n\t\t\t\t\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$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$quotes_data[\"response_time\"]=time()+($this->configval['quote_sent_timeline']*60*60);\n\t\t\t\t\t\t$prod_hours=($this->configval['prod_timeline']+$this->configval['sales_validation_timeline']);\n\t\t\t\t\t\t$quotes_data['skip_prod_comments']='';\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t$quote_end_hours=$this->configval['quote_end_time'];\n\t\t\t\t\t$quotes_data['quote_delivery_hours']=($prod_hours+$tech_seo_time+$quote_end_hours);\n\n\t\t\t\t\t//echo \"<pre>\";print_r($final_parameters);print_r($quotes_data);exit;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\telseif($this->quote_creation->custom['action']=='edit' && !$this->quote_creation->custom['create_new_version'] && $sales_review_staus!='to_be_approve') //quote edit\n\t\t\t{\n\t\t\t\tif(isset($final_parameters['send_low_quote']) OR isset($final_parameters['send_big_quote']) )\n\t\t\t\t{\n\t\t\t\t\t//$quotes_data['quote_send_team']=$final_parameters['quote_send_team'];\n\t\t\t\t\t\n\t\t\t\t\t$oldTechReview=$quoteEditDetails[0]['tec_review'];\n\t\t\t\t\t$oldSeoReview=$quoteEditDetails[0]['seo_review'];\n\t\t\t\t\t$oldProdReview=$quoteEditDetails[0]['prod_review'];\n\t\t\t\t\t$oldSalesReview=$quoteEditDetails[0]['sales_review'];\n\n\t\t\t\t\tif(($final_parameters['quote_send_team']=='send_sales_team'))\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$quotes_data[\"sales_validation_expires\"]=time()+($this->configval['sales_validation_timeline']*60*60);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(($final_parameters['quote_send_team']=='send_tech_prod_team') || ($final_parameters['quote_send_team']=='send_tech_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//restart tech review \n\t\t\t\t\t\t\tif($oldTechReview=='auto_skipped' || $oldTechReview=='skipped' || $oldTechReview=='not_done')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\n\t\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif($oldTechReview=='challenged' || $oldTechReview=='validated')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['tec_review']='challenged';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($final_parameters['quote_send_team']=='send_tech_prod_team')\n\t\t\t\t\t\t\t{//if tech & prod\n\t\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_seo_prod_team') || ($final_parameters['quote_send_team']=='send_seo_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//restart seo review \n\t\t\t\t\t\t\tif($oldSeoReview=='auto_skipped' || $oldSeoReview=='skipped' || $oldSeoReview=='not_done')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif($oldSeoReview=='challenged' || $oldSeoReview=='validated')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['seo_review']='challenged';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($final_parameters['quote_send_team']=='send_seo_prod_team')\n\t\t\t\t\t\t\t{//if seo & prod\n\t\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_tech_seo_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//restart seo/tech review\n\t\t\t\t\t\t\t//restart tech review \n\t\t\t\t\t\t\tif($oldTechReview=='auto_skipped' || $oldTechReview=='skipped' || $oldTechReview=='not_done')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\n\t\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif($oldTechReview=='challenged' || $oldTechReview=='validated')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['tec_review']='challenged';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//restart seo review \n\t\t\t\t\t\t\tif($oldSeoReview=='auto_skipped' || $oldSeoReview=='skipped' || $oldSeoReview=='not_done')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif($oldSeoReview=='challenged' || $oldSeoReview=='validated')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['seo_review']='challenged';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_prod_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//restart prod_review\n\t\t\t\t\t\t\tif($oldProdReview=='validated' || $oldProdReview=='auto_skipped' || $oldProdReview=='challenged' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_all_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//restart tech review \n\t\t\t\t\t\t\tif($oldTechReview=='auto_skipped' || $oldTechReview=='skipped' || $oldTechReview=='not_done')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\n\t\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif($oldTechReview=='challenged' || $oldTechReview=='validated')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['tec_review']='challenged';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//restart seo review \n\t\t\t\t\t\t\tif($oldSeoReview=='auto_skipped' || $oldSeoReview=='skipped' || $oldSeoReview=='not_done')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif($oldSeoReview=='challenged' || $oldSeoReview=='validated')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['seo_review']='challenged';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//restart prod_review\n\t\t\t\t\t\t\tif($oldProdReview=='validated' || $oldProdReview=='auto_skipped' || $oldProdReview=='challenged' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif($tech_seo_time)\n\t\t\t\t\t\t$quotes_data[\"response_time\"]=time()+($tech_seo_time*60*60);\n\t\t\t\t\t//echo \"<pre>\";print_r($quotes_data);exit;\n\t\t\t\t\t$edited=TRUE;\n\t\t\t\t}\t\n\t\t\t}\n\t\t\telse//quote creation v1\n\t\t\t{\n\t\t\t\tif(isset($final_parameters['send_low_quote']) OR isset($final_parameters['send_big_quote']) )\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['quote_send_team']=$final_parameters['quote_send_team'];\n\n\t\t\t\t\tif(($final_parameters['quote_send_team']=='send_sales_team')&&isset($final_parameters['send_low_quote']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='auto_skipped';\t\n\t\t\t\t\t\t$quotes_data['seo_review']='auto_skipped';\n\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t$onlySales=true;\n\t\t\t\t\t\t$quotes_data[\"sales_validation_expires\"]=time()+($this->configval['sales_validation_timeline']*60*60);\n\t\t\t\t\t\t$quotes_data['skip_prod_comments']=$final_parameters['skip_prod_comments']?$final_parameters['skip_prod_comments']:NULL;\n\t\t\t\t\t\t$prod_hours=$this->configval['sales_validation_timeline'];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\tif(($final_parameters['quote_send_team']=='send_tech_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='auto_skipped';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_seo_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='auto_skipped';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_tech_seo_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_tech_prod_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='auto_skipped';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_seo_prod_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='auto_skipped';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(($final_parameters['quote_send_team']=='send_prod_team'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quotes_data['tec_review']='auto_skipped';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='auto_skipped';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\n\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\t\t\n\t\t\t\t\t\t\t$onlyProd=true;\n\t\t\t\t\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$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t\t$quotes_data['prod_review']='challenged';\n\t\t\t\t\t\t\t$quotes_data[\"prod_timeline\"]=time()+($this->configval['prod_timeline']*60*60);\t\t\n\t\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$quotes_data[\"response_time\"]=time()+($this->configval['quote_sent_timeline']*60*60);\n\t\t\t\t\t\t$prod_hours=($this->configval['prod_timeline']+$this->configval['sales_validation_timeline']);\n\t\t\t\t\t}\t\n\t\t\t\t\t$quote_end_hours=$this->configval['quote_end_time'];\n\t\t\t\t\t$quotes_data['quote_delivery_hours']=($prod_hours+$tech_seo_time+$quote_end_hours);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//quote to be approved if created by sales user when sales manager is available\n\t\t\t\tif(($salesManager_holiday=='no' && $user_type=='salesuser' && $quotes_data['sales_suggested_price']>=5000) || ($this->quote_creation->create_mission['producttypeautre']==TRUE && $user_type=='salesuser'))\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['sales_review']='to_be_approve';\n\t\t\t\t\t$send_manager_email=TRUE;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['sales_review']='not_done';\n\t\t\t\t\t$send_manager_email=FALSE;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t//echo \"<pre>\";print_r($quotes_data);exit;\n\n\n\t\t\t//versioning when edited validated quote\n\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')\n\t\t\t{\n\t\t\t\t//Insert this quote in to Quote version table\n\t\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\t\t\n\t\t\t\tif($quoteIdentifier)\n\t\t\t\t{\n\t\t\t\t\t$quote_obj->insertQuoteVersion($quoteIdentifier);\n\t\t\t\t\t\n\t\t\t\t\t//versioning Tech missions\n\t\t\t\t\t$techMissionObj=new Ep_Quote_TechMissions();\n\t\t\t\t\t$techParams['quote_id']=$quoteIdentifier;\n\t\t\t\t\t$techMissionsDetails=$techMissionObj->getTechMissionDetails($techParams);\n\t\t\t\t\tif($techMissionsDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($techMissionsDetails as $techMission)\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$techMissionId=$techMission['identifier'];\n\t\t\t\t\t\t\t$techMissionObj->insertMissionVersion($techMissionId);\n\n\t\t\t\t\t\t\t//update tech version\n\t\t\t\t\t\t\t$update_tech['version']=$version;\n\t\t\t\t\t\t\t$techMissionObj->updateTechMission($update_tech,$techMissionId);\n\t\t\t\t\t\t\t//if($quotes_data['tec_review']=='auto_skipped')\n\t\t\t\t\t\t\t\t//$techMissionObj->deleteTechMission($techMissionId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\n\t\t\t\t\t//versioning SEO missions\n\t\t\t\t\t$seoParameters['quote_id']=$quoteIdentifier;\n\t\t\t\t\t$seoParameters['misson_user_type']='seo';\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t$seoMissionDetails=$quoteMission_obj->getMissionDetails($seoParameters);\n\t\t\t\t\tif($seoMissionDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($seoMissionDetails as $seoMission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$seoMissionId=$seoMission['identifier'];\n\t\t\t\t\t\t\t$quoteMission_obj->insertMissionVersion($seoMissionId);\t\n\n\t\t\t\t\t\t\t//update seo mission version\n\t\t\t\t\t\t\t$update_seo['version']=$version;\n\t\t\t\t\t\t\t$quoteMission_obj->updateQuoteMission($update_seo,$seoMissionId);\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t//versioning Prod Missions\n\t\t\t\t\t\t\t$prodObj=new Ep_Quote_ProdMissions();\n\t\t\t\t\t\t\t$prodParams['quote_mission_id']=$seoMissionId;\n\t\t\t\t\t\t\t$prodMissionDetails=$prodObj->getProdMissionDetails($prodParams);\n\t\t\t\t\t\t\tif($prodMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach($prodMissionDetails as $prodMission)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prodMissionId=$prodMission['identifier'];\n\t\t\t\t\t\t\t\t\t$prodObj->insertMissionVersion($prodMissionId);\n\n\t\t\t\t\t\t\t\t\t//update prod mission version\n\t\t\t\t\t\t\t\t\t$update_prod['version']=$version;\n\t\t\t\t\t\t\t\t\t$prodObj->updateProdMission($update_prod,$prodMissionId);\n\n\t\t\t\t\t\t\t\t\t//deleting prod mission from Prodmissions after insert into prod versioning\n\t\t\t\t\t\t\t\t\t//$prodObj->deleteProdMission($prodMissionId);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//deleting seo mission from quote missions after insert into versioning\n\t\t\t\t\t\t\t//if($quotes_data['seo_review']=='auto_skipped')\n\t\t\t\t\t\t\t//\t$quoteMission_obj->deleteQuoteMission($seoMissionId);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t}\t\n\n\n\t\t\t\t$quotes_data['sales_review']='not_done';\t\t\t\t\n\t\t\t\t$quotes_data['sales_margin_percentage']=0;\t\t\t\t\n\t\t\t\t//$quotes_data['techmissions_assigned']='';\t\n\t\t\t\t$quotes_data['created_at']=date(\"Y-m-d H:i:s\");\t\n\t\t\t\t$quotes_data['updated_at']=NULL;\n\t\t\t\t\n\t\t\t\t$quotes_data['final_turnover']=0;\n\t\t\t\t$quotes_data['final_margin']=0;\n\t\t\t\t$quotes_data['final_mission_length']=0;\n\n\t\t\t\t$quotes_data['closed_comments']='';\n\t\t\t\t//$quotes_data['prod_timeline']=0;\n\t\t\t\t$quotes_data['signed_comments']=NULL;\n\t\t\t\t$quotes_data['signed_at']=NULL;\n\t\t\t\t$quotes_data['sign_expire_timeline']=NULL;\n\t\t\t\t$quotes_data['closed_reason']=NULL;\t\t\t\t\n\t\t\t\t$quotes_data['boot_customer']=NULL;\n\n\t\t\t}\n\t\t\n\t\t\t//echo \"<pre>\";;print_r($this->quote_creation->custom);print_r($quotes_data);exit;\n\t\t\t//echo \"<pre>\";print_r($this->quote_creation->create_mission['quote_missions']);print_r($quotes_data);exit;\n\n\t\t\ttry\n\t\t\t{ \t\n\t\t\t\tif($this->quote_creation->custom['quote_id'])\n\t\t\t\t{\t\n\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['updated_at']=date(\"Y-m-d H:i:s\");\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\t\t\t\n\t\t\t\t\t$quote_obj->updateQuote($quotes_data,$quoteIdentifier);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\n\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t\t$quotes_data['created_at']=date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\n\t\t\t\t\t$quote_obj->insertQuote($quotes_data);\n\t\t\t\t\t$quoteIdentifier=$quote_obj->getIdentifier();\t\n\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(count($_FILES['quote_documents']['name'])>0)\t\n\t\t\t\t{\n\t\t\t\t\t$update = false;\n\t\t\t\t\t$documents_path=array();\n\t\t\t\t\t$documents_name=array();\n\t\t\t\t\tforeach($_FILES['quote_documents']['name'] as $index=>$quote_files)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($_FILES['quote_documents']['name'][$index]):\n\t\t\t\t\t\t//upload quote documents\n\t\t\t\t\t\n\t\t\t\t\t\t$quoteDir=$this->quote_documents_path.$quoteIdentifier.\"/\";\n\t\t if(!is_dir($quoteDir))\n\t\t mkdir($quoteDir,TRUE);\n\t\t chmod($quoteDir,0777);\n\t\t $document_name=frenchCharsToEnglish($_FILES['quote_documents']['name'][$index]);\n\t\t\t\t\t\t$pathinfo = pathinfo($document_name);\n\t\t\t\t\t\t$document_name =$pathinfo['filename'].rand(100,1000).\".\".$pathinfo['extension'];\n\t\t $document_name=str_replace(' ','_',$document_name);\n\t\t $document_path=$quoteDir.$document_name;\n\t\t if (move_uploaded_file($_FILES['quote_documents']['tmp_name'][$index], $document_path))\n\t\t chmod($document_path,0777);\n\t\n\t\t\t\t\t\t\t$update = true;\n\t\t $documents_path[]=$quoteIdentifier.\"/\".$document_name;\n\t\t $documents_name[]= str_replace('|',\"_\",$final_parameters['document_name'][$index]);\n\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t}\n\t\t\t\t\tif($update)\n\t\t\t\t\t{\n\t\t\t\t\t\t $quotes_update_data = array();\n\t\t\t\t\t\t $quoteDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t\t\t $uploaded_documents1 = explode(\"|\",$quoteDetails[0]['documents_path']);\n\t\t\t\t\t\t $documents_path =array_merge($documents_path,$uploaded_documents1);\n\t\t\t\t\t\t $quotes_update_data['documents_path']=implode(\"|\",$documents_path);\n\t\t\t\t\t\t $document_names =explode(\"|\",$quoteDetails[0]['documents_name']);\n\t\t\t\t\t\t $documents_name =array_merge($documents_name,$document_names);\n\t\t\t\t\t\t $quotes_update_data['documents_name']=implode(\"|\",$documents_name);\n\t\t\t\t\t\t $quote_obj->updateQuote($quotes_update_data,$quoteIdentifier);\n\t\t\t\t\t}\n\t\t\t\t\t//echo \"<pre>\";print_r($quotes_update_data);print_r($documents_name);exit;\n\t \n\t }\n \n\t\t\t\t//Quote missions insertion\n\t\t\t\tif(count($this->quote_creation->create_mission['quote_missions'])>0)\n\t\t\t\t{\n\t\t\t\t\t$sales_margin_percentage=0;\n\t\t\t\t\t$margin=0;\n\t\t\t\t\t//echo \"<pre>\";print_r($this->quote_creation->create_mission['quote_missions']);exit;\n\t\t\t\t\tforeach($this->quote_creation->create_mission['quote_missions'] as $qkey=>$quoteMission)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$quoteMission_data['quote_id']=$quoteIdentifier;\n\t\t\t\t\t\t$quoteMission_data['product']=$quoteMission['product'];\n\t\t\t\t\t\t$quoteMission_data['product_type']=$quoteMission['producttype'];\n\t\t\t\t\t\tif($quoteMission['producttype']=='autre')\n\t\t\t\t\t\t\t$quoteMission_data['product_type_other']=$quoteMission['producttypeother'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$quoteMission_data['product_type_other']=NULL;\n\n\n\t\t\t\t\t\t$quoteMission_data['category']=$this->quote_creation->create_step1['category'];\n\t\t\t\t\t\tif($quoteMission['product']=='translation')\n\t\t\t\t\t\t\t$quoteMission_data['language_dest']=$quoteMission['languagedest'];\n\t\t\t\t\t\tif($quoteMission['product']!='auture')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quoteMission_data['language_source']=$quoteMission['language'];\n\t\t\t\t\t\t\t$quoteMission_data['nb_words']=$quoteMission['nb_words'];\n\t\t\t\t\t\t\t$quoteMission_data['volume']=$quoteMission['volume'];\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t$quoteMission_data['comments']=$quoteMission['comments'];\n\t\t\t\t\t\t$quoteMission_data['misson_user_type']='sales';\n\t\t\t\t\t\t$quoteMission_data['created_by']=$this->quote_creation->create_step1['quote_by'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*added w.r.t tempo*/\n\t\t\t\t\t\t$quoteMission_data['mission_length']=$quoteMission['mission_length'];\n\t\t\t\t\t\t$quoteMission_data['mission_length_option']=$quoteMission['mission_length_option'];\t\t\t\t\t\t\n\t\t\t\t\t\t$quoteMission_data['volume_max']=$quoteMission['volume_max'];\n\t\t\t\t\t\t$quoteMission_data['delivery_volume_option']=$quoteMission['delivery_volume_option'];\n\t\t\t\t\t\t$quoteMission_data['tempo']=$quoteMission['tempo'];\n\t\t\t\t\t\t$quoteMission_data['tempo_length']=$quoteMission['tempo_length'];\n\t\t\t\t\t\t$quoteMission_data['tempo_length_option']=$quoteMission['tempo_length_option'];\n\t\t\t\t\t\t$quoteMission_data['oneshot']=$quoteMission['oneshot'];\n\t\t\t\t\t\t$quoteMission_data['demande_client']=$quoteMission['demande_client'];\n\t\t\t\t\t\t$quoteMission_data['duration_dont_know']=$quoteMission['duration_dont_know'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$suggested_missions=array();\n\n\t\t\t\t\t\tif(count($quoteMission['missionDetails'])>0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach($quoteMission['missionDetails'] as $missions_archived)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//if(in_array($missions_archived['id'],$this->quote_creation->select_missions['missions_selected']))\n\t\t\t\t\t\t\t\tif($missions_archived['id']==$this->quote_creation->select_missions['missions_selected'][$qkey])\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$suggested_missions[]=$missions_archived['id'];\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\t$quoteMission_data['sales_suggested_missions']=implode(\",\",$suggested_missions);\n\n\t\t\t\t\t\t$archmission_obj=new Ep_Quote_Mission();\n\t\t\t\t\t\t$archParameters['mission_id']=$quoteMission_data['sales_suggested_missions'];\n\t\t\t\t\t\t$suggested_mission_details=$archmission_obj->getMissionDetails($archParameters);\n\n\t\t\t\t\t\t//echo $quoteMission_data['sales_suggested_missions'].\"<pre>\";print_r($suggested_mission_details);exit;\n\t\t\t\t\t\tif($suggested_mission_details)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t/* $quoteMission_data['mission_length']=$suggested_mission_details[0]['mission_length'];\n\t\t\t\t\t\t\t$quoteMission_data['mission_length_option']='days';\n\t\t\t\t\t\t\t$quoteMission_data['unit_price']=($suggested_mission_details[0]['selling_price']); */\n\t\t\t\t\t\t\t$quoteMission_data['unit_price']=$this->quote_creation->select_missions['single_article_price'][$qkey];\n\t\t\t\t\t\t\t$quoteMission_data['margin_percentage']=$suggested_mission_details[0]['margin_before_signature'];\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif($quotes_data['prod_review']=='auto_skipped' || $quotes_data['sales_suggested_price']<=5000) //added w.r.t low quote direct validation\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$nb_words=($quoteMission['nb_words']/$suggested_mission_details[0]['article_length']);\n\t\t\t\t\t\t\t\t$redactionCost=$nb_words*($suggested_mission_details[0]['writing_cost_before_signature']);\n\t\t\t\t\t\t\t\t$correctionCost=$nb_words*($suggested_mission_details[0]['correction_cost_before_signature']);\n\t\t\t\t\t\t\t\t$otherCost=$nb_words*($suggested_mission_details[0]['other_cost_before_signature']);\n\n\t\t\t\t\t\t\t\t$internalcost=($redactionCost+$correctionCost+$otherCost);\n\t\t\t\t\t\t\t\t$internalcost=number_format($internalcost,2,'.','');\n\n\t\t\t\t\t\t\t\t$quoteMission_data['internal_cost']=$internalcost;//$quoteMission_data['unit_price'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$quoteMission_data['version']=$version;\n\n\t\t\t\t\t\t//versioning quote missions\n\t\t\t\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t//Insert this mission in to QuoteMissionsversions table\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($quoteMission['identifier'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quoteMission_obj->insertMissionVersion($quoteMission['identifier']);\n\n\t\t\t\t\t\t\t\t//versioning Prod Missions\n\t\t\t\t\t\t\t\t$prodObj=new Ep_Quote_ProdMissions();\n\t\t\t\t\t\t\t\t$prodParams['quote_mission_id']=$quoteMission['identifier'];\n\t\t\t\t\t\t\t\t$prodMissionDetails=$prodObj->getProdMissionDetails($prodParams);\n\t\t\t\t\t\t\t\tif($prodMissionDetails)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach($prodMissionDetails as $prodMission)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$prodMissionId=$prodMission['identifier'];\n\t\t\t\t\t\t\t\t\t\t$prodObj->insertMissionVersion($prodMissionId);\n\n\t\t\t\t\t\t\t\t\t\t//deleting prod mission from Prodmissions after insert into prod versioning\n\t\t\t\t\t\t\t\t\t\t//$prodObj->deleteProdMission($prodMissionId);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$quoteMission_data['cost']=0;\n\t\t\t\t\t\t\t$quoteMission_data['created_at']=date(\"Y-m-d H:i:s\");\t\n\t\t\t\t\t\t\t$quoteMission_data['updated_at']=NULL;\t\n\t\t\t\t\t\t\t//if($quotes_data['prod_review']!='auto_skipped')\n\t\t\t\t\t\t\t\t//$quoteMission_data['internal_cost']=0;\t\n\t\t\t\t\t\t\t$quoteMission_data['turnover']=0;\n\t\t\t\t\t\t\t$quoteMission_data['include_final']='yes';\t\t\t\n\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\n\n\n\t\t\t\t\t\t//echo \"<pre>\";print_r($quoteMission_data);\n\t\t\t\t\t\tif($quoteMission['identifier'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t\t\t\t$quoteMission_data['updated_at']=date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\t\t$quoteMission_obj->updateQuoteMission($quoteMission_data,$quoteMission['identifier']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t\t\t\t$quoteMission_data['created_at']=date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\t\t$quoteMission_obj->insertQuoteMission($quoteMission_data);\n\n\t\t\t\t\t\t\t//updating prod status if new mission added in edit mode\n\t\t\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'] && $this->quote_creation->custom['action']=='edit')\n\t\t\t\t\t\t\t\t$newmissionAdded=TRUE;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t//quote sales margin;\n\t\t\t\t\t\t$sales_margin_percentage+=$quoteMission_data['margin_percentage'];\n\t\t\t\t\t\t$margin++;\n\t\t\t\t\t}\n\t\t\t\t\t//updating sales margin in Quote table\n\t\t\t\t\t$avg_sales_margin_percentage=($sales_margin_percentage/$margin);\n\t\t\t\t\t$margin_data['sales_margin_percentage']=round($avg_sales_margin_percentage,2);\t\t\t\t\t\n\t\t\t\t\t//echo $quoteIdentifier;echo \"<pre>\";print_r($margin_data);exit;\n\t\t\t\t\t$quote_obj->updateQuote($margin_data,$quoteIdentifier);\n\n\t\t\t\t}\n\t\t\t\t\t//Insert Quote log\n\n\t\t\t\t\t$log_params['quote_id']\t= $quoteIdentifier;\n\t\t\t\t\t$log_params['bo_user']\t= $this->adminLogin->userId;\n\t\t\t\t\t$log_params['quote_size']=$quotes_data['sales_suggested_price'] < 5000 ? \"small\" :\"big\";\n\t\t\t\t\t$log_params['urgent']\t= $final_parameters['urgent']? 'urgent':'';\n\t\t\t\t\t$log_params['version']\t= $version;\t\t\t\t\t\n\t\t\t\t\t$log_params['created_date']\t= date(\"Y-m-d H:i:s\");\n\n\t\t\t\t\t$log_obj=new Ep_Quote_QuotesLog();\n\t\t\t\t\tif($edited || $sales_review_staus=='to_be_approve')\n\t\t\t\t\t{\n\t\t\t\t\t\t$log_params['action']\t= 'quote_updated';\n\t\t\t\t\t\t$actionId=9;\n\n\t\t\t\t\t\tif($final_parameters['quote_updated_comments'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$log_params['comments']=$final_parameters['quote_updated_comments'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$log_params['action']\t= 'quote_created';\n\t\t\t\t\t\t$actionId=1;\t\n\n\t\t\t\t\t\tif($final_parameters['bo_comments'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$log_params['comments']=$final_parameters['bo_comments'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$log_obj->insertLog($actionId,$log_params);\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//echo \"<pre>\";print_r($log_params);exit;\n\n\t\t\t}\n\t\t\tcatch(Zend_Exception $e)\n {\n echo $e->getMessage();exit; \n\n }\n\n\n //sending intimation emails when quote edited\n $update_comments= $final_parameters['quote_updated_comments'];\n if($edited && $update_comments)\n\t\t\t{\n\t\t\t\t$bo_user_type='sales';\t\t\t\t\n\t\t\t\t$this->sendIntimationEmail($quoteIdentifier,$bo_user_type,$update_comments,$newmissionAdded);\n\t\t\t\t//exit;\n\t\t\t}\t\n\n\t\t\t //send email to impacted challengers when quote updated or new version created\n\t\t\t if($edited OR $this->quote_creation->custom['create_new_version'])\n\t\t\t {\t\t\t\t\n\t\t\t\tif($edited)\n\t\t\t\t{\n\t\t\t\t\t$iemail_id=172;\n\t\t\t\t\t$imail_parameters['followup_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.\"&submenuId=ML13-SL2\";\n\t\t\t\t}\n\t\t\t\telse if($this->quote_creation->custom['create_new_version'])\n\t\t\t\t{\n\t\t\t\t\t$iemail_id=173;\n\t\t\t\t\t$imail_parameters['followup_link']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\t\t\t\t}\n\n\t\t\t\t$challengers=$this->getImpactedChallengers($quoteIdentifier,$final_parameters['quote_send_team']);\n\t\t\t\tif(count($challengers)>0)\n\t\t\t\t{\n\t\t\t\t\tforeach($challengers as $impactUser)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($impactUser!=$this->adminLogin->userId)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$imail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t$receiver_id=$impactUser;\n\t\t\t\t\t\t\t$imail_parameters['bo_user']=$impactUser;\n\t\t\t\t\t\t\t$imail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t\t$imail_parameters['quote_title']=$quotes_data['title'];\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$imail_obj->sendQuotePersonalEmail($receiver_id,$iemail_id,$imail_parameters);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//echo $iemail_id.\"<pre>\";print_r($challengers);exit;\n\t\t\t\t//exit;\n\t\t\t}\t\n\n\t\t\t//When a quote has been closed and then reactivated, the reason why sales has closed the quote the first time should be communicated to the concerned BO users \n\t\t if($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes' && $sales_review_staus=='closed')\n\t\t {\n\t\t \t\t\n\t\t \t$challengers=$this->getImpactedChallengers($quoteIdentifier,$final_parameters['quote_send_team']);\n\t\t\t\tif(count($challengers)>0)\n\t\t\t\t{\n\t\t\t\t\tforeach($challengers as $impactUser)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($impactUser!=$this->adminLogin->userId)\n\t\t\t\t\t\t{\t\n\t\t\t\t \t\t$cmail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t$receiver_id=$impactUser;\n\t\t\t\t\t\t\t$cmail_parameters['bo_user']=$impactUser;\n\t\t\t\t\t\t\t$cmail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t\t$cmail_parameters['quote_title']=$quotes_data['title'];\t\n\t\t\t\t\t\t\t$cmail_parameters['client_name']=$this->quote_creation->create_mission['company_name'];\n\t\t\t\t\t\t\t$cmail_parameters['closed_reason']=$this->closedreason[$quoteEditDetails[0]['closed_reason']];\n\t\t\t\t\t\t\t$cmail_parameters['closed_comments']=$quoteEditDetails[0]['closed_comments'];\n\t\t\t\t\t\t\t$cmail_parameters['validate_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.'&submenuId=ML13-SL2';\n\t\t\t\t\t\t\t$cmail_obj->sendQuotePersonalEmail($receiver_id,180,$cmail_parameters);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t \t\n\t\t }\n\t\t //exit;\n\n\n\t\t\t//sending email to seo &tech OR Prod to challenge after creating the quote\n\t\t\tif(!$edited && !$onlySales && !$send_manager_email)\n\t\t\t{\n\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\n\t\t\t\tif($onlyProd)\n\t\t\t\t\t$email_users=$client_obj->getEPContacts('\"prodsubmanager\"');\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_tech_seo_team')\n\t\t\t\t\t$email_users=$client_obj->getEPContacts('\"techuser\",\"techmanager\",\"seouser\",\"seomanager\"');\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_tech_prod_team' || $final_parameters['quote_send_team']=='send_tech_team')\n\t\t\t\t\t$email_users=$client_obj->getEPContacts('\"techuser\",\"techmanager\"');\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_seo_prod_team' || $final_parameters['quote_send_team']=='send_seo_team')\t\n\t\t\t\t\t$email_users=$client_obj->getEPContacts('\"seouser\",\"seomanager\"');\t\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\t$email_users=$client_obj->getEPContacts('\"seouser\",\"seomanager\",\"techuser\",\"techmanager\"');\n\n\t\t\t\tif(count($email_users)>0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tforeach($email_users as $user=>$name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t$mail_parameters['bo_user']=$user;\n\t\t\t\t\t\t$mail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t$mail_parameters['quote_title']=$quotes_data['title'];\n\t\t\t\t\t\t$mail_parameters['sales_suggested_price']=$quotes_data['sales_suggested_price'].\" \".$quotes_data['sales_suggested_currency'].\"s\";\n\t\t\t\t\t\t$mail_parameters['challenge_link']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\n\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,142,$mail_parameters); \t\n\t\t \t}\n\t\t }\t\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($send_manager_email)//send email to sales manager to approve the quote \n\t\t\t{\n\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t$email_users=$get_head_prods=$client_obj->getEPContacts('\"salesmanager\"');\n\n\t\t\t\tif(count($email_users)>0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tforeach($email_users as $user=>$name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t$mail_parameters['bo_user']=$user;\n\t\t\t\t\t\t$mail_parameters['sales_user']=$this->adminLogin->userId;\t\t\t\t\t\t\n\t\t\t\t\t\t$mail_parameters['challenge_link']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\n\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,151,$mail_parameters); \t\n\t\t \t}\n\t\t }\n\t\t if(!$edited)\n\t\t {\n\t\t\t\t//if mission product value autre email send to sales manager need to add thaibault\n\t\t $email_usershead=array('139281941421499'=>'[email protected]');\n\t\t //array('141690656032222'=>'[email protected]');\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$quoteEditDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach($email_usershead as $userhead=>$emailshead){\n\t\t\t\t\t\t\t\t\t$receiverhead_id=$userhead;\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['sales_user']=$quoteEditDetails[0]['quote_by'];\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['bo_user']=$receiverhead_id;\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['quote_title']=$quotes_data['title'];\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['followup_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.\"&submenuId=ML13-SL2\";\n\t\t\t\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiverhead_id,198,$mailhead_parameters);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//intimation email to seb,alessia and yannick\n\t\t\tif(!$edited)\n\t\t\t{\n\t\t $client_obj=new Ep_Quote_Client();\n\t\t //$intimate_users=$client_obj->getEPContacts('\"facturation\"');\n\t\t //$intimate_users[$this->adminLogin->userId]=$this->adminLogin->userId;\n\t\t $intimate_users=array('138960180336581'=>'[email protected]',\n\t\t \t\t\t\t\t '139282188375889'=>'[email protected]',\n\t\t \t\t\t\t\t '141745044124851'=>'[email protected]'\n\t\t \t\t\t\t\t );//[email protected], [email protected] and [email protected]\n\t\t if(count($intimate_users)>0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tforeach($intimate_users as $user=>$name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t$mail_parameters['bo_user']=$user;\n\t\t\t\t\t\t$mail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t//$mail_parameters['quote_title']=$quotes_data['title'];\n\t\t\t\t\t\t//$mail_parameters['sales_suggested_price']=$quotes_data['sales_suggested_price'].\" \".$quotes_data['sales_suggested_currency'].\"s\";\n\t\t\t\t\t\t//$mail_parameters['followup_link_en']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\t\t\t\t\t\t$mail_parameters['validate_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.'&submenuId=ML13-SL2';\n\n\t\t\t\t\t\t$mail_parameters['client_name']=$this->quote_creation->create_mission['company_name'];\n\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,174,$mail_parameters); \t\n\t\t \t}\n\t\t } \n\t\t $newquote_head=array('139281941421499'=>'[email protected]','110823103540627'=>'[email protected]','139281996916804'=>'[email protected]');\n\t\t \n\t\t \n\t\t\t\t\n\t\t\t\t\t//new quote created send Email to head sales need to add Thaibault\n\t\t\t\t\t\n\t\t\t\t\t$quoteEditDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach($newquote_head as $userhead=>$emailshead){\n\t\t\t\t\t\t\t\t\t$receiverhead_id=$userhead;\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['sales_user']=$quoteEditDetails[0]['quote_by'];\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['bo_user']=$receiverhead_id;\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['turn_over']=$quoteEditDetails[0]['turnover'];\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['currency']=$this->quote_creation->create_step1['currency'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['challenge_link']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\t\t\t\t\t\t\t\t\t$mailhead_parameters['client_name']=$this->quote_creation->create_mission['company_name'];\n\t\t\t\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiverhead_id,203,$mailhead_parameters);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t \n\t\t }\n\n\t\t //if new version created email send to sales manager\n\t\t $quoteEditDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t \n\t\t if($quoteEditDetails[0]['version']>1){\n\t\t \n\t\t\t\t$email_head_sale=array('139281941421499'=>'[email protected]'); // need to add thaibault\n\t\t\t\t\tif(count($email_head_sale)>0 ){\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tforeach($email_head_sale as $user=>$emails){\n\t\t\t\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t\t\t\t$headmail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t\t\t$headmail_parameters['bo_user']=$user;\n\t\t\t\t\t\t\t\t\t$headmail_parameters['sales_user']=$quoteEditDetails[0]['quote_by'];\n\t\t\t\t\t\t\t\t\t$headmail_parameters['turn_over']=$quoteEditDetails[0]['turnover'];\n\t\t\t\t\t\t\t\t\t$headmail_parameters['client_name']=$quoteEditDetails[0]['company_name'];\n\t\t\t\t\t\t\t\t\t$headmail_parameters['quote_version']=$quoteEditDetails[0]['version'];\t\n\t\t\t\t\t\t\t\t\t$headmail_parameters['followup_link']='/quote/quote-followup?quote_id='.$quoteEditDetails[0]['identifier'];\t\n\t\t\t\t\t\t\t\t\t$headmail_obj->sendQuotePersonalEmail($receiver_id,204,$headmail_parameters);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n unset($this->quote_creation->create_step1);\n unset($this->quote_creation->create_mission);\n unset($this->quote_creation->select_missions);\n unset($this->quote_creation->custom);\n\t\t\tunset($this->quote_creation->send_quote);\n\t\t\tif($edited)\n\t\t\t{\n \t$this->_helper->FlashMessenger('Devis updat&eacute; avec succ&egrave;s');\n\t\t\t}\n else\n {\n \tif(!$send_manager_email)\n \t\t$this->_helper->FlashMessenger('Devis cr&eacute;e avec succ&egrave;s');\n \t\n \tif($final_parameters['quote_send_team']=='send_tech_prod_team' || $final_parameters['quote_send_team']=='send_tech_team') \t\t\n \t\t$this->_helper->FlashMessenger('Onlytech');\n \telse if($final_parameters['quote_send_team']=='send_seo_prod_team' || $final_parameters['quote_send_team']=='send_seo_team')\t\n \t\t$this->_helper->FlashMessenger('Onlyseo');\n \telse if($onlySales)\n \t\t$this->_helper->FlashMessenger('Onlysales');\n \telse if($onlyProd)\n \t\t$this->_helper->FlashMessenger('Onlyprod');\n }\n\n $this->_redirect(\"/quote/sales-quotes-list?submenuId=ML13-SL2\");\t\n\n\t\t\t//echo \"<pre>\";print_r($quotes_data);//print_r($this->quote_creation->select_missions);print_r($this->quote_creation->create_mission['quote_missions']);\n\n\t\t}\t\n\t}", "public function getQuote();", "public function getQuoteDetails()\n {\n $types = [\n ['value' => 'Full Kitchen', 'text' => 'Full Kitchen'],\n ['value' => 'Cabinet Only', 'text' => 'Cabinet Only'],\n ['value' => 'Cabinet Small Job', 'text' => 'Cabinet Small Job'],\n ['value' => 'Cabinet and Install', 'text' => 'Cabinet and Install'],\n ['value' => 'Granite Only', 'text' => 'Granite Only'],\n ];\n if (Auth::user()->id == 5 || Auth::user()->id == 1)\n {\n $types[] = ['value' => 'Builder', 'text' => 'Builder'];\n }\n $type = Editable::init()->id(\"quote_type\")->placement('right')->type('select')->title(\"Quote Type\")\n ->linkText($this->quote->type)\n ->source($types)->url(\"/quote/{$this->quote->id}/type/liveupdate\")->render();\n\n if (!$this->quote->title)\n {\n $this->quote->title = \"Main Quote\";\n }\n $title = Editable::init()->id(\"quote_title\")->placement('right')->type('text')->title(\"Title\")\n ->linkText($this->quote->title)\n ->url(\"/quote/{$this->quote->id}/title/liveupdate\")->render();\n $markup = Editable::init()->id(\"quote_markup\")->placement('right')->type('text')->title(\"Markup Percentage\")\n ->linkText($this->quote->markup)\n ->url(\"/quote/{$this->quote->id}/markup/liveupdate\")->render();\n\n $rows = [];\n $rows[] = ['Quote Type:', $type];\n $rows[] = ['Title (Description)', $title];\n if ($this->quote->type == 'Full Kitchen')\n {\n $rows[] = ['Customer Picking Slab:', $this->quote->picking_slab];\n }\n if ($this->quote->type == 'Builder')\n {\n $rows[] = ['Frugal Markup Percentage:', $markup];\n }\n if (isset($this->meta['finance']))\n {\n switch ($this->meta['finance']['type'])\n {\n case 'all':\n $type = \"100% Financing Option for \" . $this->meta['finance']['terms'] . \" months\";\n break;\n case 'partial':\n\n $type = \"Partial financing Option putting $\" . $this->meta['finance']['downpayment'] . \" down\n with \";\n if (isset($this->meta['finance']['down_cash']) && $this->meta['finance']['down_cash'] > 0)\n {\n $type .= '$' . $this->meta['finance']['down_cash'] . \" in cash, \";\n }\n if (isset($this->meta['finance']['down_credit']) && $this->meta['finance']['down_credit'] > 0)\n {\n $type .= '$' . $this->meta['finance']['down_credit'] . \" in cash, \";\n }\n $type = substr($type, 0, -2);\n $type .= \" and financing for \" . $this->meta['finance']['terms'] . \" months\";\n break;\n case 'none':\n $type = \"No financing paying \";\n if (isset($this->meta['finance']['method']) && $this->meta['finance']['method'] == 'split')\n {\n if (isset($this->meta['finance']['no_cash']) && $this->meta['finance']['no_cash'] > 0)\n {\n $type .= \"$\" . number_format($this->meta['finance']['no_cash'], 2) . \" in cash, \";\n }\n if (isset($this->meta['finance']['no_credit']) && $this->meta['finance']['no_credit'] > 0)\n {\n $type .= \"$\" . number_format($this->meta['finance']['no_credit'], 2) . \" in credit, \";\n }\n $type = substr($type, 0, -2);\n }\n else\n {\n $type = \"No finance using \" . $this->meta['finance']['method'] . \" for payment\";\n }\n break;\n default:\n $type = \"Financing Option Needed\";\n }\n $rows[] = ['Financing Options', $type];\n }\n\n $table = Table::init()->rows($rows)->render();\n $panel = Panel::init('primary')\n ->header(\"Quote Details <small style='color:#fff'>Quote Type and Cabinet Information</small>\")\n ->content($table)->render();\n return $panel;\n }", "public function get_quote(){ return $this->_quote;}", "public function sendQuoteAction()\n\t{\n\t\tif(is_array($this->quote_creation->select_missions['missions_selected']))\n\t\t{\n\t\t\t//$this->quote_creation->custom['mission_added'];\n\t\t\t//getting Quote user details of selected Bo user\n\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t$quote_by=$this->quote_creation->create_step1['quote_by'];\n\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\tif($bo_user_details!='NO')\n\t\t\t{\n\t\t\t\t$this->quote_creation->create_mission['quote_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t$this->quote_creation->create_mission['email']=$bo_user_details[0]['email'];\n\t\t\t\t$this->quote_creation->create_mission['phone_number']=$bo_user_details[0]['phone_number'];\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t\t$this->_view->create_mission=$this->quote_creation->create_mission;\n\t\t\t$this->_view->create_step1=$this->quote_creation->create_step1;\n\t\t $this->_view->select_missions=$this->quote_creation->select_missions;\n\t\t $this->_view->custom=$this->quote_creation->custom;\n\t\t $this->_view->quote_missions=$this->quote_creation->create_mission['quote_missions'];\n\t\t $this->_view->sales_manager_holiday=$this->configval[\"sales_manager_holiday\"];\n\t\t\t$this->_view->user_type=$this->adminLogin->type;\n\t\t //Added w.r.t edit/duplicate\n\t\t $this->_view->send_quote=$this->quote_creation->send_quote;\n\n\t\t\t$this->render('send-quote');\n\t\t}\n\t\telse\n\t\t\t$this->_redirect(\"/quote/create-quote-step1?submenuId=ML13-SL2\");\t\n\t}", "public function quoteAction()\n {\n $result = array();\n \n try {\n \n //hash to get quote\n $hash = $this->getRequest()->getParam('hash');\n \n if (!$hash){\n //json post\n if ($postBody = file_get_contents('php://input')){\n \n $data = (array)json_decode($postBody);\n \n } else {\n \n $data = $this->getRequest()->getPost();\n }\n \n if (is_array($data) && count($data)>0){\n \n $model = $this->getModel();\n $productIdOrSku = $data['product'];\n $model->loadOptions($productIdOrSku);\n $result = $model->validateCartData($data);\n \n if (!$result['error']){\n \n $result = $model->addToCart($data);\n \n if (!$result['error']){\n \n $quoteUrl = Mage::getUrl('customconfigurable/index/quote/hash/'.$result['data']);\n $result = array('Location' => $quoteUrl);\n }\n }\n \n } else {\n \n $result['error'] = true;\n $result['data'] = 'No post data';\n }\n \n } else {\n \n $model = $this->getModel();\n $model->loadOptions();\n \n $result = $model->getQuote($hash);\n \n if (!$result['error']){ \n unset($result['error']);\n $result['hash'] = $hash;\n $result['quote'] = $result['data'];\n unset($result['data']);\n }\n \n }\n \n } catch (Exception $e) {\n \n $result['error'] = true;\n $result['data'] = $e->getMessage();\n }\n \n $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true)->setBody(Mage::helper('core')->jsonEncode($result));\n \n }", "protected function quote()\n {\n }", "public function techQuoteReviewAction()\n\t{\n\t\t$tech_parameters=$this->_request->getParams();\n\n\t\t$quote_id=$tech_parameters['quote_id'];\n\n\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\tif($quote_id)\n\t\t{\n\t\t\t$quoteDetails=$quote_obj->getQuoteDetails($quote_id);\n\t\t\tif($quoteDetails)\n\t\t\t{\n\t\t\t\t$q=0;\n\t\t\t\tforeach($quoteDetails as $quote)\n\t\t\t\t{\n\t\t\t\t\t$quoteDetails[$q]['category_name']=$this->getCategoryName($quote['category']);\n\t\t\t\t\t$quoteDetails[$q]['websites']=explode(\"|\",$quote['websites']);\n\t\t\t\t\t\n\t\t\t\t\tif($quote['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$files = array('documents_path'=>$quote['documents_path'],'documents_name'=>$quote['documents_name'],'quote_id'=>$quote_id,'delete'=>false);\n\t\t\t\t\t\t$related_files = $this->getQuoteFiles($files);\n\t\t\t\t\t}\n\n\t\t\t\t\t$quoteDetails[$q]['related_files']=$related_files;\n\n\t\t\t\t\t$quoteDetails[$q]['sales_suggested_price_format']=number_format($quote['sales_suggested_price'], 2, ',', ' ');\n\t\t\t\t\t$quoteDetails[$q]['comment_time']=time_ago($quote['created_at']);\n\n\t\t\t\t\tif($quote['tech_timeline'])\n\t\t\t\t\t\t$quoteDetails[$q]['tech_timeline_stamp']=strtotime($quote['tech_timeline']);\n\t\t\t\t\t\n\t\t\t\t\tif($quote['tech_timeline'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteDetails[$q]['tech_timeline_date']=date(\"d/m/Y\",strtotime($quote['tech_timeline']));\n\t\t\t\t\t\t$quoteDetails[$q]['tech_timeline_time']=date(\"H:i\",strtotime($quote['tech_timeline']));\n\t\t\t\t\t}\n\n\t\t\t\t\t//bo user details\n\t\t\t\t\t$quote_by=$quote['quote_by'];\n\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\t\t\tif($bo_user_details!='NO')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteDetails[$q]['quote_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t\t\t$quoteDetails[$q]['email']=$bo_user_details[0]['email'];\n\t\t\t\t\t\t$quoteDetails[$q]['phone_number']=$bo_user_details[0]['phone_number'];\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t//getting mission details\n\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\t$searchParameters['misson_user_type']='sales';\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t$missonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\t\t\tif($missonDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\t$m=0;\n\t\t\t\t\t\tforeach($missonDetails as $mission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$missonDetails[$m]['product_name']=$this->product_array[$mission['product']];\t\t\t\n\t\t\t\t\t\t\t$missonDetails[$m]['language_source_name']=$this->getLanguageName($mission['language_source']);\n\t\t\t\t\t\t\t$missonDetails[$m]['product_type_name']=$this->producttype_array[$mission['product_type']];\n\t\t\t\t\t\t\tif($mission['language_dest'])\n\t\t\t\t\t\t\t\t$missonDetails[$m]['language_dest_name']=$this->getLanguageName($mission['language_dest']);\n\n\t\t\t\t\t\t\t$missonDetails[$m]['comment_time']=time_ago($mission['created_at']);\n\n\n\t\t\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\n\t\t\t\t\t\t\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t\t\t$previousMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],$previousVersion,'sales');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach($previousMissionDetails as $key=>$vmission)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_name']=$this->seo_product_array[$vmission['product']];\t\t\t\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_source_name']=$this->getLanguageName($vmission['language_source']);\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_type_name']=$this->producttype_array[$vmission['product_type']];\n\t\t\t\t\t\t\t\t\t\tif($vmission['language_dest'])\n\t\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_dest_name']=$this->getLanguageName($vmission['language_dest']);\n\n\t\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$allVersionMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],NULL,'sales');\n\t\t\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t\t\t$table_end='</table>';\n\t\t\t\t\t\t\t\t\t\t$language_versions=$product_type_versions=$volume_versions=$nb_words_versions='';\n\t\t\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\n\t\t\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t \tif($versions['product']=='translation')\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']).\" > \".$this->getLanguageName($vmission['language_dest']);\n\t\t\t\t\t\t\t\t\t\t \telse\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']);\n\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\n\t\t\t\t\t\t\t\t\t\t \t$language_versions.=\"<tr><td>$language</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$product_type_versions.=\"<tr><td>\".$this->producttype_array[$versions['product_type']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$volume_versions.=\"<tr><td>\".$versions['volume'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$nb_words_versions.=\"<tr><td>\".$versions['nb_words'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['unit_price'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_option=$this->duration_array[$versions['mission_length_option']];//$versions['mission_length_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['mission_length'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\t\t\tif($mission['language_source'] !=$previousMissionDetails[0]['language_source'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['language_dest'] !=$previousMissionDetails[0]['language_dest'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['product_type'] !=$previousMissionDetails[0]['product_type'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_versions']=$table_start.$product_type_versions.$table_end;\n\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\t\t\tif($mission['volume'] !=$previousMissionDetails[0]['volume'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_versions']=$table_start.$volume_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($mission['nb_words'] !=$previousMissionDetails[0]['nb_words'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_versions']=$table_start.$nb_words_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($mission['unit_price'] !=$previousMissionDetails[0]['unit_price'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['unit_price_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$current_mission_lenght=$mission['mission_length_option']=='hours' ? ($mission['mission_length']/24) : $mission['mission_length'];\n\t\t\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['mission_length_option']=='hours' ? ($previousMissionDetails[0]['mission_length']/24) : $previousMissionDetails[0]['mission_length'];\n\t\t\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$m++;\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t$quoteDetails[$q]['mission_details']=$missonDetails;\n\n\t\t\t\t\t\t//Deleted mission version details\n\t\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\t\t\t\t\t\t\t$deletedMissionVersions=$this->deletedMissionVersions($quote['identifier'],$previousVersion,'sales');\n\t\t\t\t\t\t\tif($deletedMissionVersions)\n\t\t\t\t\t\t\t\t$quoteDetails[$q]['deletedMissionVersions']=$deletedMissionVersions;\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\n\n\t\t\t\t\t$q++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_view->quoteDetails=$quoteDetails;\n\n\t\t\t//getting tech mission details\n\t\t\t$tech_obj=new Ep_Quote_TechMissions();\n\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t$techMissionDetails=$tech_obj->getTechMissionDetails($searchParameters);\n\t\t\tif($techMissionDetails)\n\t\t\t{\n\t\t\t\t$t=0;\n\t\t\t\tforeach($techMissionDetails as $mission)\n\t\t\t\t{\n\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\tif($quoteDetails[0]['version']>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$previousVersion=($quoteDetails[0]['version']-1);\n\n\t\t\t\t\t\t$techMissionObj=new Ep_Quote_TechMissions();\n\t\t\t\t\t\t$previousMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier'],$previousVersion);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$allVersionMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier']);\n\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t$table_end='</table>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\t\t\t\t\t\t\t\t$title_versions='';\n\n\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$title_versions.=\"<tr><td>\".$versions['title'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['cost'],2).\" &\". $versions['currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$mission_length_option=$versions['delivery_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['delivery_time'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\tif($mission['title'] !=$previousMissionDetails[0]['title'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_difference']='yes';\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_versions']=$table_start.$title_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\tif($mission['cost'] !=$previousMissionDetails[0]['cost'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['cost_difference']='yes';\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current_mission_lenght=$mission['delivery_option']=='hours' ? ($mission['delivery_time']/24) : $mission['delivery_time'];\n\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['delivery_option']=='hours' ? ($previousMissionDetails[0]['delivery_time']/24) : $previousMissionDetails[0]['delivery_time'];\n\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t$techMissionDetails[$t]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t}\n\t\t\t\t\t$techMissionDetails[$t]['files'] = \"\";\n\t\t\t\t\tif($mission['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$filesarray = array('documents_path'=>$mission['documents_path'],'documents_name'=>$mission['documents_name'],'id'=>$mission['identifier'],'delete'=>true);\n\t\t\t\t\t\t$files = $this->getTechFiles($filesarray);\n\t\t\t\t\t\t$techMissionDetails[$t]['files'] = $files;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t$t++;\n\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t\t$this->_view->techMissionDetails=$techMissionDetails;\n\t\t\t}\n\t\t}\n\t\t//check manager is on holiday or not\n\t\t$techManager_holiday=$this->configval[\"tech_manager_holiday\"];\n\t\t$user_type=$this->adminLogin->type;\n\t\tif($techManager_holiday=='no' && $user_type=='techuser')\n\t\t\t$this->_view->show_validate='no';\n\t\telse\n\t\t\t$this->_view->show_validate='yes';\t\n\n\t\t//echo \"<pre>\";print_r($quoteDetails);exit;\n\n\t\t$this->render('tech-quote-review');\n\t}", "public function moreQuoteClient(){\n\t\t\t$this->addElement('text', 'more_quote_client_request', array (\n\t\t\t\t\"required\" => TRUE,\n\t\t\t\t'class' => 'form-control required',\n\t\t\t\t\"label\" => \"How many more quote do you want?\" ,\n\t\t\t\t\"maxlength\"=>\"2\",\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"more quote number is required \")),\n\t\t\t\t\t\t\t\t),\n\t\t\t));\n\t\t\t\n\t\t\t$this->submitButton();\n\t\t\t$this->bttnsubmit->setLabel(\"Request\");\n\t\t\t$this->bttnsubmit->setAttrib(\"class\",\"site_button\");\n\t\t}", "public function getQuote()\n {\n if(Mage::app()->getStore()->isAdmin()){\n return Mage::getSingleton('adminhtml/session_quote')->getQuote();\n }\n else {\n return Mage::getSingleton('checkout/session')->getQuote();\n }\n }", "public function seoQuoteReviewAction()\n\t{\n\t\t$seo_parameters=$this->_request->getParams();\n\n\t\t$quote_id=$seo_parameters['quote_id'];\n\n\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\tif($quote_id)\n\t\t{\n\t\t\t$quoteDetails=$quote_obj->getQuoteDetails($quote_id);\n\t\t\tif($quoteDetails)\n\t\t\t{\n\t\t\t\t$q=0;\n\t\t\t\tforeach($quoteDetails as $quote)\n\t\t\t\t{\n\t\t\t\t\t$quoteDetails[$q]['category_name']=$this->getCategoryName($quote['category']);\n\t\t\t\t\t$quoteDetails[$q]['websites']=explode(\"|\",$quote['websites']);\n\t\t\t\t\t\n\t\t\t\t\tif($quote['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$related_files='';\n\t\t\t\t\t\t/* $documents_path=explode(\"|\",$quote['documents_path']);\n\t\t\t\t\t\t$documents_name=explode(\"|\",$quote['documents_name']);\n\n\t\t\t\t\t\tforeach($documents_path as $k=>$file)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(file_exists($this->quote_documents_path.$documents_path[$k]) && !is_dir($this->quote_documents_path.$documents_path[$k]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($documents_name[$k])\n\t\t\t\t\t\t\t\t\t$file_name=$documents_name[$k];\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$file_name=basename($file);\n\n\t\t\t\t\t\t\t\t$related_files.='\n\t\t\t\t\t\t\t\t<a href=\"/quote/download-document?type=quote&index='.$k.'&quote_id='.$quote_id.'\">'.$file_name.'</a><br>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} */\n\t\t\t\t\t\t$files = array('documents_path'=>$quote['documents_path'],'documents_name'=>$quote['documents_name'],'quote_id'=>$quote_id,'delete'=>false);\n\t\t\t\t\t\t$related_files = $this->getQuoteFiles($files);\n\t\t\t\t\t}\n\n\t\t\t\t\t$quoteDetails[$q]['related_files']=$related_files;\n\n\t\t\t\t\t$quoteDetails[$q]['sales_suggested_price_format']=number_format($quote['sales_suggested_price'], 2, ',', ' ');\n\t\t\t\t\t$quoteDetails[$q]['comment_time']=time_ago($quote['created_at']);\n\n\t\t\t\t\tif($quote['seo_timeline'])\n\t\t\t\t\t\t$quoteDetails[$q]['seo_timeline_stamp']=strtotime($quote['seo_timeline']);\n\n\t\t\t\t\tif($quote['seo_timeline'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteDetails[$q]['seo_timeline_date']=date(\"d/m/Y\",strtotime($quote['seo_timeline']));\n\t\t\t\t\t\t$quoteDetails[$q]['seo_timeline_time']=date(\"H:i\",strtotime($quote['seo_timeline']));\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\n\t\t\t\t\t//bo user details\n\t\t\t\t\t$quote_by=$quote['quote_by'];\n\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\t\t\tif($bo_user_details!='NO')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteDetails[$q]['quote_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t\t\t$quoteDetails[$q]['email']=$bo_user_details[0]['email'];\n\t\t\t\t\t\t$quoteDetails[$q]['phone_number']=$bo_user_details[0]['phone_number'];\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t//getting mission details\n\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\t$searchParameters['misson_user_type']='sales';\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t$missonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\t\t\tif($missonDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\t$m=0;\n\t\t\t\t\t\tforeach($missonDetails as $mission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$missonDetails[$m]['product_name']=$this->product_array[$mission['product']];\t\t\t\n\t\t\t\t\t\t\t$missonDetails[$m]['language_source_name']=$this->getLanguageName($mission['language_source']);\n\t\t\t\t\t\t\t$missonDetails[$m]['product_type_name']=$this->producttype_array[$mission['product_type']];\n\t\t\t\t\t\t\tif($mission['language_dest'])\n\t\t\t\t\t\t\t\t$missonDetails[$m]['language_dest_name']=$this->getLanguageName($mission['language_dest']);\n\n\t\t\t\t\t\t\t$quoteDetails[$q]['missions_list'][$mission['identifier']]='Mission '.($m+1).' - '.$missonDetails[$m]['product_name'];\n\n\t\t\t\t\t\t\t$missonDetails[$m]['comment_time']=time_ago($mission['created_at']);\n\n\t\t\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\n\t\t\t\t\t\t\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t\t\t$previousMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],$previousVersion,'sales');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach($previousMissionDetails as $key=>$vmission)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_name']=$this->seo_product_array[$vmission['product']];\t\t\t\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_source_name']=$this->getLanguageName($vmission['language_source']);\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_type_name']=$this->producttype_array[$vmission['product_type']];\n\t\t\t\t\t\t\t\t\t\tif($vmission['language_dest'])\n\t\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_dest_name']=$this->getLanguageName($vmission['language_dest']);\n\n\t\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$allVersionMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],NULL,'sales');\n\t\t\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t\t\t$table_end='</table>';\n\t\t\t\t\t\t\t\t\t\t$language_versions=$product_type_versions=$volume_versions=$nb_words_versions='';\n\t\t\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\n\t\t\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t \tif($versions['product']=='translation')\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']).\" > \".$this->getLanguageName($vmission['language_dest']);\n\t\t\t\t\t\t\t\t\t\t \telse\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']);\n\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\n\t\t\t\t\t\t\t\t\t\t \t$language_versions.=\"<tr><td>$language</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$product_type_versions.=\"<tr><td>\".$this->producttype_array[$versions['product_type']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$volume_versions.=\"<tr><td>\".$versions['volume'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$nb_words_versions.=\"<tr><td>\".$versions['nb_words'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['unit_price'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_option=$this->duration_array[$versions['mission_length_option']];//$versions['mission_length_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['mission_length'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\t\t\tif($mission['language_source'] !=$previousMissionDetails[0]['language_source'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['language_dest'] !=$previousMissionDetails[0]['language_dest'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['product_type'] !=$previousMissionDetails[0]['product_type'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_versions']=$table_start.$product_type_versions.$table_end;\n\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\t\t\tif($mission['volume'] !=$previousMissionDetails[0]['volume'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_versions']=$table_start.$volume_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($mission['nb_words'] !=$previousMissionDetails[0]['nb_words'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_versions']=$table_start.$nb_words_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($mission['unit_price'] !=$previousMissionDetails[0]['unit_price'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['unit_price_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$current_mission_lenght=$mission['mission_length_option']=='hours' ? ($mission['mission_length']/24) : $mission['mission_length'];\n\t\t\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['mission_length_option']=='hours' ? ($previousMissionDetails[0]['mission_length']/24) : $previousMissionDetails[0]['mission_length'];\n\t\t\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$m++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$quoteDetails[$q]['mission_details']=$missonDetails;\n\n\n\t\t\t\t\t\t//Deleted mission version details\n\t\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\t\t\t\t\t\t\t$deletedMissionVersions=$this->deletedMissionVersions($quote['identifier'],$previousVersion,'sales');\n\t\t\t\t\t\t\tif($deletedMissionVersions)\n\t\t\t\t\t\t\t\t$quoteDetails[$q]['deletedMissionVersions']=$deletedMissionVersions;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t}\t\n\n\t\t\t\t\t$q++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_view->quoteDetails=$quoteDetails;\t\t\t\n\n\t\t\t//getting tech mission details\n\t\t\t$tech_obj=new Ep_Quote_TechMissions();\n\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t$techMissionDetails=$tech_obj->getTechMissionDetails($searchParameters);\n\t\t\tif($techMissionDetails)\n\t\t\t{\n\t\t\t\t$t=0;\n\t\t\t\tforeach($techMissionDetails as $mission)\n\t\t\t\t{\n\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($mission['created_by']);\n\t\t\t\t\t$techMissionDetails[$t]['tech_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t\t$techMissionDetails[$t]['comment_time']=time_ago($mission['created_at']);\n\n\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\tif($quoteDetails[0]['version']>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$previousVersion=($quoteDetails[0]['version']-1);\n\n\t\t\t\t\t\t$techMissionObj=new Ep_Quote_TechMissions();\n\t\t\t\t\t\t$previousMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier'],$previousVersion);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$allVersionMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier']);\n\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t$table_end='</table>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\t\t\t\t\t\t\t\t$title_versions='';\n\n\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$title_versions.=\"<tr><td>\".$versions['title'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['cost'],2).\" &\". $versions['currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$mission_length_option=$versions['delivery_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['delivery_time'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\tif($mission['title'] !=$previousMissionDetails[0]['title'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_difference']='yes';\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_versions']=$table_start.$title_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif($mission['cost'] !=$previousMissionDetails[0]['cost'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['cost_difference']='yes';\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current_mission_lenght=$mission['delivery_option']=='hours' ? ($mission['delivery_time']/24) : $mission['delivery_time'];\n\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['delivery_option']=='hours' ? ($previousMissionDetails[0]['delivery_time']/24) : $previousMissionDetails[0]['delivery_time'];\n\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t$techMissionDetails[$t]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$techMissionDetails[$t]['files'] = \"\";\n\t\t\t\t\tif($mission['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t/* $exploded_file_paths = explode(\"|\",$mission['documents_path']);\n\t\t\t\t\t\t$exploded_file_names = explode(\"|\",$mission['documents_name']);\n\t\t\t\t\t\t$files = \"\";\n\t\t\t\t\t\t$k=0;\n\t\t\t\t\t\tforeach($exploded_file_paths as $row)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$file_path=$this->mission_documents_path.$row;\n\t\t\t\t\t\t\tif(file_exists($file_path) && !is_dir($file_path))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$fname = $exploded_file_names[$k];\n\t\t\t\t\t\t\t\t\tif($fname==\"\")\n\t\t\t\t\t\t\t\t\t\t$fname = basename($row);\n\t\t\t\t\t\t\t\t\t$files .= '<div class=\"topset2\"><a href=\"/quote/download-document?type=tech_mission&mission_id='.$mission['identifier'].'&index='.$k.'\">'.$fname.'</a></div>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$k++;\n\t\t\t\t\t\t} */\n\t\t\t\t\t\t$filesarray = array('documents_path'=>$mission['documents_path'],'documents_name'=>$mission['documents_name'],'id'=>$mission['identifier'],'delete'=>false);\n\t\t\t\t\t\t$files = $this->getTechFiles($filesarray);\n\t\t\t\t\t\t$techMissionDetails[$t]['files'] = $files;\n\t\t\t\t\t}\n\n\t\t\t\t\t$t++;\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->_view->techMissionDetails=$techMissionDetails;\n\t\t\t}\n\n\t\t\t//ALL language list\n\t\t\t$language_array=$this->_arrayDb->loadArrayv2(\"EP_LANGUAGES\", $this->_lang);\n\t\t\t//echo \"<pre>\";print_r($language_array);exit;\n \tnatsort($language_array);\n \t$this->_view->ep_language_list=$language_array;\n\n\t\t\t//getting seo mission details\t\t\t\n\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t$searchParameters['misson_user_type']='seo';\n\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t$seoMissionDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\tif($seoMissionDetails)\n\t\t\t{\n\t\t\t\t$s=0;\n\t\t\t\tforeach($seoMissionDetails as $mission)\n\t\t\t\t{\n\t\t\t\t\t$seoMissionDetails[$s]['files'] = '';\n\t\t\t\t\t$seoMissionDetails[$s]['filenames'] = array();\n\t\t\t\t\t\n\t\t\t\t\t$seoMissionDetails[$s]['product_name']=$this->seo_product_array[$mission['product']];\n\n\t\t\t\t\tif($mission['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$filesarray = array('documents_path'=>$mission['documents_path'],'documents_name'=>$mission['documents_name'],'id'=>$mission['identifier'],'delete'=>true);\n\t\t\t\t\t\t$files = $this->getSeoFiles($filesarray);\n\t\t\t\t\t\t$seoMissionDetails[$s]['files'] = $files;\n\t\t\t\t\t}\n\n\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\tif($quoteDetails[0]['version']>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$previousVersion=($quoteDetails[0]['version']-1);\n\n\t\t\t\t\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t$previousMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],$previousVersion,'seo');\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach($previousMissionDetails as $key=>$vmission)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_name']=$this->seo_product_array[$vmission['product']];\t\t\t\n\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_source_name']=$this->getLanguageName($vmission['language_source']);\n\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_type_name']=$this->producttype_array[$vmission['product_type']];\n\t\t\t\t\t\t\t\tif($vmission['language_dest'])\n\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_dest_name']=$this->getLanguageName($vmission['language_dest']);\n\n\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$allVersionMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],NULL,'seo');\n\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t$table_end='</table>';\n\t\t\t\t\t\t\t\t$product_versions=$language_versions=$product_type_versions=$volume_versions=$nb_words_versions='';\n\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\n\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t \tif($versions['product']=='translation')\n\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']).\" > \".$this->getLanguageName($vmission['language_dest']);\n\t\t\t\t\t\t\t\t \telse\n\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']);\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\n\t\t\t\t\t\t\t\t \t$language_versions.=\"<tr><td>$language</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$product_versions.=\"<tr><td>\".$this->seo_product_array[$versions['product']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$product_type_versions.=\"<tr><td>\".$this->producttype_array[$versions['product_type']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$volume_versions.=\"<tr><td>\".$versions['volume'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$nb_words_versions.=\"<tr><td>\".$versions['nb_words'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['cost'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$mission_length_option=$this->duration_array[$versions['mission_length_option']];//$versions['mission_length_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['mission_length'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\tif($mission['language_source'] !=$previousMissionDetails[0]['language_source'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($mission['language_dest'] !=$previousMissionDetails[0]['language_dest'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($mission['product'] !=$previousMissionDetails[0]['product'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_versions']=$table_start.$product_versions.$table_end;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($mission['product_type'] !=$previousMissionDetails[0]['product_type'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_type_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_type_versions']=$table_start.$product_type_versions.$table_end;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($mission['volume'] !=$previousMissionDetails[0]['volume'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['volume_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['volume_versions']=$table_start.$volume_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($mission['nb_words'] !=$previousMissionDetails[0]['nb_words'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['nb_words_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['nb_words_versions']=$table_start.$nb_words_versions.$table_end;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(number_format($mission['cost'],2) !=number_format($previousMissionDetails[0]['cost'],2))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['unit_price_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current_mission_lenght=$mission['mission_length_option']=='hours' ? ($mission['mission_length']/24) : $mission['mission_length'];\n\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['mission_length_option']=='hours' ? ($previousMissionDetails[0]['mission_length']/24) : $previousMissionDetails[0]['mission_length'];\n\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t$seoMissionDetails[$s]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$s++;\n\n\t\t\t\t}\t\n\t\t\t\t$this->_view->seoMissionDetails=$seoMissionDetails;\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t//check manager is on holiday or not\n\t\t$seoManager_holiday=$this->configval[\"seo_manager_holiday\"];\n\t\t$user_type=$this->adminLogin->type;\n\t\tif($seoManager_holiday=='no' && $user_type=='seouser')\n\t\t\t$this->_view->show_validate='no';\n\t\telse\n\t\t\t$this->_view->show_validate='yes';\n\n\t\t//echo \"<pre>\";print_r($quoteDetails);exit;\n\n\t\t$this->render('seo-quote-review');\n\t}", "public function saveQuote()\n {\n $this->calculateSubscription();\n $this->calculateService();\n $this->calculateGoods();\n \n $return = array();\n $return['services'] = $this->services;\n $return['goods'] = $this->goods;\n $return['subscription'] = $this->subscription;\n $return['userEmail'] = $this->user->getEmail();\n $return['UUID'] = $this->generateQuoteUUID($return);\n $return['user'] = $this->user;\n $return['subtotal'] = $this->subtotal;\n return $return;\n\n }", "public function saveSendTeamQuoteAction()\n\t{\n\t\tif($this->_request-> isPost() && $this->adminLogin->userId) \n {\n\t\t\t$final_parameters=$this->_request->getParams();\n\n\t\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\t\t//echo \"<pre>\";print_r($final_parameters);exit;\n\n\t\t\t//insert Quotes\n\t\t\t$quotes_data['title']=$this->quote_creation->create_mission['quote_title'];\n\t\t\t$quotes_data['client_id']=$this->quote_creation->create_step1['client_id'];\n\t\t\t$quotes_data['category']=$this->quote_creation->create_step1['category'];\n\t\t\tif($quotes_data['category']=='other')\n\t\t\t\t\t$quotes_data['category_other']=isodec($this->quote_creation->create_step1['category_other']);\n\t\t\tif($this->quote_creation->create_step1['client_websites'])\n\t\t\t$quotes_data['websites']=implode(\"|\",$this->quote_creation->create_step1['client_websites']);\n\t\t\t$quotes_data['quote_by']=$this->quote_creation->create_step1['quote_by'];\n\t\t\t$quotes_data['created_by']=$this->adminLogin->userId;\n\t\t\t$quotes_data['sales_suggested_price']=0;\n\t\t\t$quotes_data['sales_suggested_currency']=$this->quote_creation->create_step1['currency'];\n\t\t\t$quotes_data['sales_comment']=$final_parameters['bo_comments'];\n\t\t\t$quotes_data['client_email_text']=$final_parameters['client_email'];\n\t\t\t$quotes_data['conversion']=$this->quote_creation->create_step1['conversion'];\n\n\t\t\t//$quotes_data['sales_delivery_time']=$final_parameters['delivery_time'];\n\t\t\t//$quotes_data['sales_delivery_time_option']=$final_parameters['delivery_option'];\n\t\t\t$quotes_data['client_know']=$final_parameters['client_know']? 'no':'yes';\n\t\t\t$quotes_data['urgent']=$final_parameters['urgent']? 'yes':'no';\n\t\t\t$quotes_data['urgent_comments']=$final_parameters['urgent_comments']?$final_parameters['urgent_comments']:NULL;\t\t\t\n\t\t\n\t\t\t/*$quotes_data['market_team_sent']=$final_parameters['market_team_sent'];\n\t\t\tif($quotes_data['market_team_sent']=='yes')\n\t\t\t\t$quotes_data['from_platform']=$final_parameters['from_platform']; */\n\t\t\t\t\n\t\t\t$quotes_data['quote_type']=$this->quote_creation->create_step1['quote_type'];\t\n\n\t\t\t\n\t\t\t//NEW QUOTE FILEDS \n\t\t\t$client_aims=$final_parameters['client_aims'];\n\t\t\t$quotes_data['client_aims']=implode(\",\",$client_aims);\n\n\t\t\tforeach($client_aims as $aim)\n\t\t\t{\n\t\t\t\t$client_prio[]=$final_parameters['priority_'.$aim];\n\t\t\t}\n\t\t\t$quotes_data['client_prio']=implode(\",\",$client_prio);\n\n\t\t\t$client_aims_comments=$final_parameters['client_aims_comments'];\n\t\t\t$quotes_data['client_aims_comments']=$client_aims_comments;\n\n\n\t\t\t$content_ordered_agency=$final_parameters['content_ordered_agency'];\n\t\t\t$quotes_data['content_ordered_agency']=$content_ordered_agency;\n\t\t\tif($content_ordered_agency=='yes')\n\t\t\t{\n\t\t\t\tif($final_parameters['agency']=='dont_know')\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['agency']=$final_parameters['agency'];\n\t\t\t\t\t$quotes_data['agency_name']='';\n\t\t\t\t}\n\t\t\t\telseif($final_parameters['agency_name'])\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['agency']='';\n\t\t\t\t\t$quotes_data['agency_name']=$final_parameters['agency_name'];\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse if($content_ordered_agency=='no')\n\t\t\t{\n\t\t\t\t$quotes_data['client_internal_team']=$final_parameters['client_internal_team'];\n\t\t\t}\n\n\t\t\t$quotes_data['client_know_writers']=$final_parameters['client_know_writers'];\n\n\t\t\t$volume_option=$final_parameters['volume_option'];\n\t\t\t$quotes_data['volume_option']=$volume_option;\n\t\t\tif($volume_option=='per')\n\t\t\t{\n\t\t\t\t$quotes_data['volume_option_multi']=$final_parameters['volume_option_multi'];\n\t\t\t}\n\t\t\telse if($volume_option=='every')\n\t\t\t{\n\t\t\t\t$quotes_data['volume_option_multi']=$final_parameters['volume_option_multi_every'];\n\t\t\t\t$quotes_data['volume_every']=$final_parameters['volume_every'];\n\t\t\t}\n\n\t\t\t$budget_marketing=$final_parameters['budget_marketing'];\n\t\t\tif($budget_marketing=='dont_know')\n\t\t\t{\n\t\t\t\t$quotes_data['budget_marketing']=$budget_marketing;\n\t\t\t\t$quotes_data['budget']='';\n\t\t\t\t$quotes_data['budget_currency']='';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$quotes_data['budget_marketing']='';\n\t\t\t\t$quotes_data['budget']=$final_parameters['budget'];\n\t\t\t\t$quotes_data['budget_currency']=$final_parameters['budget_currency'];\n\t\t\t}\t\n\n\t\t\t$quotes_data['estimate_sign_percentage']=$final_parameters['estimate_sign_percentage'];\n\t\t\t$quotes_data['estimate_sign_date']=$final_parameters['estimate_sign_date'];\n\t\t\t$quotes_data['estimate_sign_comments']=$final_parameters['estimate_sign_comments'];\n\n\n\t\t\t//Quote current version\n\t\t\tif($this->quote_creation->custom['version'])\n\t\t\t{\n\t\t\t\t$version=$this->quote_creation->custom['version'];\n\t\t\t}\n\t\t\telse\n\t\t\t\t$version=1;\n\t\t\t$quotes_data['version']=$version;\n\n\t\t\t//Getting Quote details if quote id available\n\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\tif($quoteIdentifier)\n\t\t\t{\n\t\t\t\t$quoteEditDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t$sales_review_staus=$quoteEditDetails[0]['sales_review'];\n\t\t\t}\t\t\n\n\t\t\t\n\t\t\t//Staus of tech,seo,prod and sales\n\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')//new version quote\n\t\t\t{\n\t\t\t\t$quotes_data['quote_send_team']=$final_parameters['quote_send_team'];\n\n\t\t\t\tif(($final_parameters['quote_send_team']=='send_sales_team'))\n\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t$quotes_data[\"sales_validation_expires\"]=time()+($this->configval['sales_validation_timeline']*60*60);\t\t\t\t\t\t\n\t\t\t\t\t$prod_hours=$this->configval['sales_validation_timeline'];\n\t\t\t\t\t$onlySales=true;\n\t\t\t\t}\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_tech_team')\n\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\t\t\t\t\t\t\n\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\n\t\t\t\t\t$quotes_data['tech_timeline']=NULL;\n\t\t\t\t\t$quotes_data['tech_challenge_comments']='';\n\t\t\t\t\t$quotes_data['tech_challenge']='yes';\n\t\t\t\t}\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_seo_team')\n\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t$quotes_data['seo_review']='not_done';\t\t\t\t\t\t\t\n\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\n\t\t\t\t\t$quotes_data['seo_timeline']=NULL;\n\t\t\t\t\t$quotes_data['seo_comments']='';\n\t\t\t\t\t$quotes_data['seo_challenge']='yes';\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\telseif($this->quote_creation->custom['action']=='edit' && !$this->quote_creation->custom['create_new_version']) //quote edit\n\t\t\t{\t\n\t\t\t\t\n\t\t\t\t$oldTechReview=$quoteEditDetails[0]['tec_review'];\n\t\t\t\t$oldSeoReview=$quoteEditDetails[0]['seo_review'];\n\n\t\t\t\tif(($final_parameters['quote_send_team']=='send_sales_team'))\n\t\t\t\t{\t\n\n\t\t\t\t\t$quotes_data[\"sales_validation_expires\"]=time()+($this->configval['sales_validation_timeline']*60*60);\n\t\t\t\t}\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_tech_team')\n\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t//restart tech review \n\t\t\t\t\tif($oldTechReview=='auto_skipped' || $oldTechReview=='skipped' || $oldTechReview=='not_done')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\n\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t}\n\t\t\t\t\telseif($oldTechReview=='challenged' || $oldTechReview=='validated')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='challenged';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_seo_team')\n\t\t\t\t{\n\t\t\t\t\t//restart seo review \n\t\t\t\t\tif($oldSeoReview=='auto_skipped' || $oldSeoReview=='skipped' || $oldSeoReview=='not_done')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t}\n\t\t\t\t\telseif($oldSeoReview=='challenged' || $oldSeoReview=='validated')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['seo_review']='challenged';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif($tech_seo_time)\n\t\t\t\t\t$quotes_data[\"response_time\"]=time()+($tech_seo_time*60*60);\n\t\t\t\t$edited=TRUE;\t\t\t\t\n\t\t\t}\n\t\t\telse//quote creation v1\n\t\t\t{\n\t\t\t\tif(isset($final_parameters['send_team_quote']))\n\t\t\t\t{\n\t\t\t\t\tif($quotes_data['quote_type']=='only_tech')\n\t\t\t\t\t\t$quotes_data['quote_send_team']='send_tech_team';\n\t\t\t\t\telseif($quotes_data['quote_type']=='only_seo')\n\t\t\t\t\t\t$quotes_data['quote_send_team']='send_seo_team';\n\n\t\t\t\t\tif($quotes_data['quote_type']=='only_tech')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t$quotes_data['seo_review']='auto_skipped';\n\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t}\n\t\t\t\t\telse if($quotes_data['quote_type']=='only_seo')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='auto_skipped';\t\n\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$quotes_data[\"response_time\"]=time()+($this->configval['quote_sent_timeline']*60*60);\n\t\t\t\t\t$quote_end_hours=$this->configval['quote_end_time'];\n\t\t\t\t\t\n\t\t\t\t\t$quotes_data['quote_delivery_hours']=($tech_seo_time+$quote_end_hours);\n\t\t\t\t}\n\t\t\t}\t\t\n\n\t\t\t//echo \"<pre>\";print_r($quotes_data);print_r($final_parameters);exit;\n\n\n\t\t\t//versioning when edited validated quote\n\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')\n\t\t\t{\n\t\t\t\t//Insert this quote in to Quote version table\n\t\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\t\tif($quoteIdentifier)\n\t\t\t\t{\n\t\t\t\t\t$quote_obj->insertQuoteVersion($quoteIdentifier);\n\n\t\t\t\t\t//versioning Tech missions\n\t\t\t\t\t$techMissionObj=new Ep_Quote_TechMissions();\n\t\t\t\t\t$techParams['quote_id']=$quoteIdentifier;\n\t\t\t\t\t$techMissionsDetails=$techMissionObj->getTechMissionDetails($techParams);\n\t\t\t\t\tif($techMissionsDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($techMissionsDetails as $techMission)\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$techMissionId=$techMission['identifier'];\n\t\t\t\t\t\t\t$techMissionObj->insertMissionVersion($techMissionId);\n\n\t\t\t\t\t\t\t//update tech version\n\t\t\t\t\t\t\t$update_tech['version']=$version;\n\t\t\t\t\t\t\t$techMissionObj->updateTechMission($update_tech,$techMissionId);\n\t\t\t\t\t\t\t//if($quotes_data['tec_review']=='auto_skipped')\n\t\t\t\t\t\t\t\t//$techMissionObj->deleteTechMission($techMissionId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\n\t\t\t\t\t//versioning SEO missions\n\t\t\t\t\t$seoParameters['quote_id']=$quoteIdentifier;\n\t\t\t\t\t$seoParameters['misson_user_type']='seo';\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t$seoMissionDetails=$quoteMission_obj->getMissionDetails($seoParameters);\n\t\t\t\t\tif($seoMissionDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($seoMissionDetails as $seoMission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$seoMissionId=$seoMission['identifier'];\n\t\t\t\t\t\t\t$quoteMission_obj->insertMissionVersion($seoMissionId);\t\n\n\t\t\t\t\t\t\t//update seo mission version\n\t\t\t\t\t\t\t$update_seo['version']=$version;\n\t\t\t\t\t\t\t$quoteMission_obj->updateQuoteMission($update_seo,$seoMissionId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\t\n\n\n\t\t\t\t$quotes_data['sales_review']='not_done';\t\t\t\t\n\t\t\t\t$quotes_data['sales_margin_percentage']=0;\t\t\t\t\n\t\t\t\t//$quotes_data['techmissions_assigned']='';\t\n\t\t\t\t$quotes_data['created_at']=date(\"Y-m-d H:i:s\");\t\n\t\t\t\t$quotes_data['updated_at']=NULL;\n\t\t\t\t\n\t\t\t\t$quotes_data['final_turnover']=0;\n\t\t\t\t$quotes_data['final_margin']=0;\n\t\t\t\t$quotes_data['final_mission_length']=0;\n\n\t\t\t\t$quotes_data['closed_comments']='';\n\t\t\t\t//$quotes_data['prod_timeline']=0;\n\t\t\t\t$quotes_data['signed_comments']=NULL;\n\t\t\t\t$quotes_data['signed_at']=NULL;\n\t\t\t\t$quotes_data['sign_expire_timeline']=NULL;\n\t\t\t\t$quotes_data['closed_reason']=NULL;\t\t\t\t\n\t\t\t\t$quotes_data['boot_customer']=NULL;\n\n\t\t\t}\n\t\t\n\t\t\t//echo \"<pre>\";;print_r($this->quote_creation->custom);print_r($quotes_data);exit;\n\t\t\t//echo \"<pre>\";print_r($this->quote_creation->create_mission['quote_missions']);print_r($quotes_data);exit;\n\n\t\t\ttry\n\t\t\t{ \t\n\t\t\t\tif($this->quote_creation->custom['quote_id'])\n\t\t\t\t{\t\n\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['updated_at']=date(\"Y-m-d H:i:s\");\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\t\t\t\n\t\t\t\t\t$quote_obj->updateQuote($quotes_data,$quoteIdentifier);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\n\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t\t$quotes_data['created_at']=date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\n\t\t\t\t\t$quote_obj->insertQuote($quotes_data);\n\t\t\t\t\t$quoteIdentifier=$quote_obj->getIdentifier();\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(count($_FILES['quote_documents']['name'])>0)\t\n\t\t\t\t{\n\t\t\t\t\t$update = false;\n\t\t\t\t\t$documents_path=array();\n\t\t\t\t\t$documents_name=array();\n\t\t\t\t\tforeach($_FILES['quote_documents']['name'] as $index=>$quote_files)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($_FILES['quote_documents']['name'][$index]):\n\t\t\t\t\t\t//upload quote documents\n\t\t\t\t\t\n\t\t\t\t\t\t$quoteDir=$this->quote_documents_path.$quoteIdentifier.\"/\";\n\t\t if(!is_dir($quoteDir))\n\t\t mkdir($quoteDir,TRUE);\n\t\t chmod($quoteDir,0777);\n\t\t $document_name=frenchCharsToEnglish($_FILES['quote_documents']['name'][$index]);\n\t\t\t\t\t\t$pathinfo = pathinfo($document_name);\n\t\t\t\t\t\t$document_name =$pathinfo['filename'].rand(100,1000).\".\".$pathinfo['extension'];\n\t\t $document_name=str_replace(' ','_',$document_name);\n\t\t $document_path=$quoteDir.$document_name;\n\t\t if (move_uploaded_file($_FILES['quote_documents']['tmp_name'][$index], $document_path))\n\t\t chmod($document_path,0777);\n\t\n\t\t\t\t\t\t\t$update = true;\n\t\t $documents_path[]=$quoteIdentifier.\"/\".$document_name;\n\t\t $documents_name[]= str_replace('|',\"_\",$final_parameters['document_name'][$index]);\n\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t}\n\t\t\t\t\tif($update)\n\t\t\t\t\t{\n\t\t\t\t\t\t $quotes_update_data = array();\n\t\t\t\t\t\t $quoteDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t\t\t $uploaded_documents1 = explode(\"|\",$quoteDetails[0]['documents_path']);\n\t\t\t\t\t\t $documents_path =array_merge($documents_path,$uploaded_documents1);\n\t\t\t\t\t\t $quotes_update_data['documents_path']=implode(\"|\",$documents_path);\n\t\t\t\t\t\t $document_names =explode(\"|\",$quoteDetails[0]['documents_name']);\n\t\t\t\t\t\t $documents_name =array_merge($documents_name,$document_names);\n\t\t\t\t\t\t $quotes_update_data['documents_name']=implode(\"|\",$documents_name);\n\t\t\t\t\t\t $quote_obj->updateQuote($quotes_update_data,$quoteIdentifier);\n\t\t\t\t\t}\n\t\t\t\t\t//echo \"<pre>\";print_r($quotes_update_data);print_r($documents_name);exit;\n\t \n\t } \n\t\t\t\t\n\t\t\t\t//Insert Quote log\n\n\t\t\t\t$log_params['quote_id']\t= $quoteIdentifier;\n\t\t\t\t$log_params['bo_user']\t= $this->adminLogin->userId;\n\t\t\t\t$log_params['quote_size']=$quotes_data['sales_suggested_price'] < 5000 ? \"small\" :\"big\";\n\t\t\t\t$log_params['urgent']\t= $final_parameters['urgent']? 'urgent':'';\n\t\t\t\t$log_params['version']\t= $version;\t\t\t\t\t\n\t\t\t\t$log_params['created_date']\t= date(\"Y-m-d H:i:s\");\n\n\t\t\t\t$log_obj=new Ep_Quote_QuotesLog();\n\t\t\t\tif($edited)\n\t\t\t\t{\n\t\t\t\t\t$log_params['action']\t= 'quote_updated';\n\t\t\t\t\t$actionId=9;\n\n\t\t\t\t\tif($final_parameters['quote_updated_comments'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$log_params['comments']=$final_parameters['quote_updated_comments'];\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$log_params['action']\t= 'quote_created';\n\t\t\t\t\t$actionId=1;\t\n\n\t\t\t\t\tif($final_parameters['bo_comments'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$log_params['comments']=$final_parameters['bo_comments'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$log_obj->insertLog($actionId,$log_params);\t\t\t\n\t\t\t\t\n\t\t\t\t//echo \"<pre>\";print_r($log_params);exit;\n\n\t\t\t}\n\t\t\tcatch(Zend_Exception $e)\n {\n echo $e->getMessage();exit; \n\n }\n\n\t\t\t//sending email to seo &tech OR Prod to challenge after creating the quote\n\t\t\tif(!$edited)\n\t\t\t{\n\t\t\t\t$client_obj=new Ep_Quote_Client();\t\n\t\t\t\t\n\t\t\t\tif($quotes_data['quote_type']=='only_tech')\n\t\t\t\t\t$email_users=$get_head_tech_seos=$client_obj->getEPContacts('\"techuser\",\"techmanager\"');\n\t\t\t\telseif($quotes_data['quote_type']=='only_seo')\t\n\t\t\t\t\t$email_users=$get_head_tech_seos=$client_obj->getEPContacts('\"seouser\",\"seomanager\"');\n\t\t\t\tif(count($email_users)>0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tforeach($email_users as $user=>$name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t$mail_parameters['bo_user']=$user;\n\t\t\t\t\t\t$mail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t$mail_parameters['quote_title']=$quotes_data['title'];\n\t\t\t\t\t\t$mail_parameters['sales_suggested_price']=$quotes_data['sales_suggested_price'].\" \".$quotes_data['sales_suggested_currency'].\"s\";\n\t\t\t\t\t\t$mail_parameters['challenge_link']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\n\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,142,$mail_parameters); \t\n\t\t \t}\n\t\t }\t\t\t\n\t\t\t\t\n\t\t\t}\n\n\n\n\t\t\t//intimation email to facturation and created user\n\t\t\tif(!$edited)\n\t\t\t{\n\t\t $client_obj=new Ep_Quote_Client();\n\t\t //$intimate_users=$client_obj->getEPContacts('\"facturation\"');\n\t\t //$intimate_users[$this->adminLogin->userId]=$this->adminLogin->userId;\n\t\t $intimate_users=array('138960180336581'=>'[email protected]',\n\t\t \t\t\t\t\t '139282188375889'=>'[email protected]',\n\t\t \t\t\t\t\t '141745044124851'=>'[email protected]'\n\t\t \t\t\t\t\t );//[email protected], [email protected] and [email protected]\n\t\t if(count($intimate_users)>0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tforeach($intimate_users as $user=>$name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t$mail_parameters['bo_user']=$user;\n\t\t\t\t\t\t$mail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t//$mail_parameters['quote_title']=$quotes_data['title'];\n\t\t\t\t\t\t//$mail_parameters['sales_suggested_price']=$quotes_data['sales_suggested_price'].\" \".$quotes_data['sales_suggested_currency'].\"s\";\n\t\t\t\t\t\t//$mail_parameters['followup_link_en']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\t\t\t\t\t\t$mail_parameters['validate_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.'&submenuId=ML13-SL2';\n\n\t\t\t\t\t\t$mail_parameters['client_name']=$this->quote_creation->create_mission['company_name'];\n\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,174,$mail_parameters); \t\n\t\t \t}\n\t\t } \n\t\t }\n\n\n\n\t\t //When a quote has been closed and then reactivated, the reason why sales has closed the quote the first time should be communicated to the concerned BO users \n\t\t if($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes' && $sales_review_staus=='closed')\n\t\t {\n\t\t \t\t\n\t\t \t$challengers=$this->getImpactedChallengers($quoteIdentifier,$final_parameters['quote_send_team']);\n\t\t\t\tif(count($challengers)>0)\n\t\t\t\t{\n\t\t\t\t\tforeach($challengers as $impactUser)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($impactUser!=$this->adminLogin->userId)\n\t\t\t\t\t\t{\t\n\t\t\t\t \t\t$cmail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t$receiver_id=$impactUser;\n\t\t\t\t\t\t\t$cmail_parameters['bo_user']=$impactUser;\n\t\t\t\t\t\t\t$cmail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t\t$cmail_parameters['quote_title']=$quotes_data['title'];\t\n\t\t\t\t\t\t\t$cmail_parameters['client_name']=$this->quote_creation->create_mission['company_name'];\n\t\t\t\t\t\t\t$cmail_parameters['closed_reason']=$this->closedreason[$quoteEditDetails[0]['closed_reason']];\n\t\t\t\t\t\t\t$cmail_parameters['closed_comments']=$quoteEditDetails[0]['closed_comments'];\n\t\t\t\t\t\t\t$cmail_parameters['validate_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.'&submenuId=ML13-SL2';\n\t\t\t\t\t\t\t$cmail_obj->sendQuotePersonalEmail($receiver_id,180,$cmail_parameters);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t \t\n\t\t }\n\t\t //exit;\n\n unset($this->quote_creation->create_step1);\n unset($this->quote_creation->create_mission);\n unset($this->quote_creation->select_missions);\n unset($this->quote_creation->custom);\n\t\t\tunset($this->quote_creation->send_quote);\n\t\t\tunset($this->quote_creation->send_team_quote);\n\t\t\tif($edited)\n\t\t\t{\n \t$this->_helper->FlashMessenger('Devis updat&eacute; avec succ&egrave;s');\n\t\t\t}\n else\n {\n \t$this->_helper->FlashMessenger('Devis cr&eacute;e avec succ&egrave;s');\n\n \tif($onlySales)\n \t\t$this->_helper->FlashMessenger('Onlysales');\n \telse if($quotes_data['quote_type']=='only_tech')\n\t\t\t\t\t$this->_helper->FlashMessenger('Onlytech');\n\t\t\t\telse if($quotes_data['quote_type']=='only_seo')\n\t\t\t\t\t$this->_helper->FlashMessenger('Onlyseo');\n }\n\t\t\t\n $this->_redirect(\"/quote/sales-quotes-list?submenuId=ML13-SL2\");\n\t\t}\t\n\t}", "public function assignQuoteAction()\n\t{\n\t\tif($this->_request-> isPost() && $this->adminLogin->userId) \n {\n\t\t\t$assign_parameters=$this->_request->getParams();\n\n\t\t\t$ep_user_id=$assign_parameters['ep_user_id'];\n\t\t\t$quote_by=$this->quote_creation->create_step1['quote_by'];\n\t\t\tif($ep_user_id==$quote_by)\n\t\t\t{\n\t\t\t\techo json_encode(array('status'=>'same_user'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->quote_creation->create_step1['quote_by']=$ep_user_id;\n\t\t\t\techo json_encode(array('status'=>'success'));\n\t\t\t}\n\t\t\texit;\n\t\t}\t\n\n\t}", "abstract public function Quote($data);", "public function quote_request_new() {\n\t /*\t$step_one_sidebar = '<div class=\"col-md-2\">\n\t <div class=\"sidebar\">\n\t <h3>Talk TO A REPRESENTATIVE</h3>\n\t <div class=\"selection-container\">\n\t <ul>\n\t <li>1 (877) 589-2214 (US/Canada)<br/><a href=\"mailto:[email protected]\">[email protected]</a></li>\n\t </ul>\n\t \n\t </div>\n\t </div>\n\t </div>'; */ \n\t\t$step_four = 'test';\n\t //return $this->new_product_finder('quote_request', NULL, $step_four);\n\t\t$path = \\Drupal::request()->getpathInfo();\n $arg = explode('/', $path);\t\t\n $cur_page = $arg[1];\n\t\t\n\t\t$pid = $_GET['pid'];\n\t\t\n\t\t$newrfq = $fpage;\n\t\t//$newrfq = $step_four;\n\t\t\n\t\treturn array(\n\t '#theme' => 'quote_request',\n\t\t '#cur_page' => $cur_page,\n\t\t '#pid' => $pid,\n\t '#quote_related_products' => $step_four,\n\t );\n \t}", "public function autoQuoteSession($quote_id,$action)\n\t{\n\t\tunset($this->quote_creation->create_mission);\n unset($this->quote_creation->select_missions);\n unset($this->quote_creation->custom);\n\t\tunset($this->quote_creation->send_quote);\n\n\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t$quoteDetails=$quoteObj->getQuoteDetails($quote_id);\n\n\t\tif($quoteDetails)\n\t\t{\n\t\t\tforeach($quoteDetails as $quote)\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->quote_creation->custom['action']=$action;\n\t\t\t\tif($action=='edit')\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$this->quote_creation->custom['quote_id']=$quote['identifier'];\n\t\t\t\t\tif($quote['sales_review']=='validated' || $quote['sales_review']=='closed')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->quote_creation->custom['create_new_version']='yes';\n\t\t\t\t\t\t$this->quote_creation->custom['version']=($quote['version']+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$this->quote_creation->custom['version']=($quote['version']);\n\t\t\t\t\t\tunset($this->quote_creation->custom['create_new_version']);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse if($action=='duplicate')\n\t\t\t\t{\n\t\t\t\t\tunset($this->quote_creation->custom['quote_id']);\n\t\t\t\t\tunset($this->quote_creation->custom['create_new_version']);\n\t\t\t\t\tunset($this->quote_creation->custom['version']);\n\t\t\t\t}\n\t\t\t\t//step1 session\n\t\t\t\t$this->quote_creation->create_step1['client_id']=$quote['client_id'];\n\t\t\t\t$this->quote_creation->create_step1['category']=$quote['category'];\n\t\t\t\tif($quote['category_other'])\n\t\t\t\t\t$this->quote_creation->create_step1['category_other']=$quote['category_other'];\n\n\t\t\t\tif($quote['websites'])\n\t\t\t\t\t$this->quote_creation->create_step1['client_websites']=explode(\"|\",$quote['websites']);\n\t\t\t\t$this->quote_creation->create_step1['quote_by']=$quote['quote_by'];\n\n\t\t\t\t$this->quote_creation->create_step1['currency']=$quote['sales_suggested_currency'];\n\t\t\t\t$this->quote_creation->create_step1['conversion']=$quote['conversion'];\n\t\t\t\t$this->quote_creation->create_step1['quote_type']=$quote['quote_type'];\n\n\t\t\t\t//step2 session\t\n\t\t\t\t$this->quote_creation->create_mission['quote_title']=$quote['title'];\t\t\t\n\t\t\t\t//getting mission details\n\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t$searchParameters['misson_user_type']='sales';\n\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t$missonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\n\t\t\t\tif($missonDetails)\n\t\t\t\t{\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($missonDetails as $quoteMmission)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->quote_creation->create_mission['product'][$i]=$quoteMmission['product'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['language'][$i]=$quoteMmission['language_source'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['languagedest'][$i]=$quoteMmission['language_dest'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['producttype'][$i]=$quoteMmission['product_type'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['producttypeother'][$i]=$quoteMmission['product_type_other'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['nb_words'][$i]=$quoteMmission['nb_words'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['volume'][$i]=$quoteMmission['volume'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['mission_length'][$i]=$quoteMmission['mission_length'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['mission_length_option'][$i]=$quoteMmission['mission_length_option'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['volume_max'][$i]=$quoteMmission['volume_max'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['delivery_volume_option'][$i]=$quoteMmission['delivery_volume_option'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['tempo'][$i]=$quoteMmission['tempo'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['tempo_length'][$i]=$quoteMmission['tempo_length'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['tempo_length_option'][$i]=$quoteMmission['tempo_length_option'];\n\t\t\t\t\t\tif(!$quoteMmission['oneshot'])\n\t\t\t\t\t\t\t$quoteMmission['oneshot']='yes';\n\t\t\t\t\t\t$this->quote_creation->create_mission['oneshot'][$i]=$quoteMmission['oneshot'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['demande_client'][$i]=$quoteMmission['demande_client'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['duration_dont_know'][$i]=$quoteMmission['duration_dont_know'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['comments'][$i]=$quoteMmission['comments'];\n\t\t\t\t\t\t$this->quote_creation->select_missions['missions_selected'][$i]=$quoteMmission['sales_suggested_missions'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t//step3 details\n\t\t\t\t\t\tif($action=='edit')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->quote_creation->create_mission['mission_identifier'][$i]=$quoteMmission['identifier'];\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if($action=='duplicate')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($this->quote_creation->create_mission['mission_identifier']);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t//final step details\n\t\t\t\t$this->quote_creation->send_quote['sales_comment']=$quote['sales_comment'];\n\t\t\t\t$this->quote_creation->send_quote['client_email_text']=$quote['client_email_text'];\t\n\t\t\t\t//$this->quote_creation->send_quote['sales_delivery_time']=$quote['sales_delivery_time'];\n\t\t\t\t//$this->quote_creation->send_quote['sales_delivery_time_option']=$quote['sales_delivery_time_option'];\n\t\t\t\t$this->quote_creation->send_quote['client_know']=$quote['client_know'];\n\t\t\t\t$this->quote_creation->send_quote['urgent']=$quote['urgent'];\n\t\t\t\t$this->quote_creation->send_quote['urgent_comments']=$quote['urgent_comments'];\n\t\t\t\t$this->quote_creation->send_quote['prod_review']=$quote['prod_review'];\n\t\t\t\t$this->quote_creation->send_quote['skip_prod_comments']=$quote['skip_prod_comments'];\n\t\t\t\t//$this->quote_creation->send_quote['market_team_sent']=$quote['market_team_sent'];\n\t\t\t\t//$this->quote_creation->send_quote['from_platform']=$quote['from_platform'];\n\t\t\t\t$this->quote_creation->send_quote['quote_send_team']=$quote['quote_send_team'];\n\t\t\t\t$this->quote_creation->send_quote['sales_review']=$quote['sales_review'];\n\n\t\t\t\t//NEW FIELDS\n\t\t\t\t$client_aims=explode(\",\",$quote['client_aims']);\n\t\t\t\t$this->quote_creation->send_quote['client_aims']=$client_aims;\n\n\t\t\t\t$client_prio=explode(\",\",$quote['client_prio']);\n\n\t\t\t\tif(count($client_aims)>0)\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tforeach($client_aims as $i=>$aim)\n\t\t\t\t\t{\n\t\t\t\t\t\t//echo 'priority_'.$aim;//.\"--\".$quote['client_prio'][$i];\n\t\t\t\t\t\t$this->quote_creation->send_quote['priority_'.$aim]=$client_prio[$i];\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t$this->quote_creation->send_quote['client_aims_comments']=$quote['client_aims_comments'];\n\t\t\t\t$this->quote_creation->send_quote['content_ordered_agency']=$quote['content_ordered_agency'];\n\t\t\t\t$this->quote_creation->send_quote['agency']=$quote['agency'];\n\t\t\t\t$this->quote_creation->send_quote['agency_name']=$quote['agency_name'];\n\t\t\t\t$this->quote_creation->send_quote['client_internal_team']=$quote['client_internal_team'];\n\t\t\t\t$this->quote_creation->send_quote['client_know_writers']=$quote['client_know_writers'];\t\t\t\t\n\t\t\t\t$this->quote_creation->send_quote['volume_option']=$quote['volume_option'];\n\t\t\t\t$this->quote_creation->send_quote['volume_option_multi']=$quote['volume_option_multi'];\n\t\t\t\t$this->quote_creation->send_quote['volume_every']=$quote['volume_every'];\n\t\t\t\t$this->quote_creation->send_quote['budget_marketing']=$quote['budget_marketing'];\n\t\t\t\t$this->quote_creation->send_quote['budget']=$quote['budget'];\n\t\t\t\t$this->quote_creation->send_quote['budget_currency']=$quote['budget_currency'];\n\n\t\t\t\t$this->quote_creation->send_quote['estimate_sign_percentage']=$quote['estimate_sign_percentage'];\n\t\t\t\t$this->quote_creation->send_quote['estimate_sign_date']=$quote['estimate_sign_date'];\n\t\t\t\t$this->quote_creation->send_quote['estimate_sign_comments']=$quote['estimate_sign_comments'];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Quote documents added to sesssion\n\t\t\t\t$files = \"\";\n\t\t\t\t$documents_path = explode(\"|\",$quote['documents_path']);\n\t\t\t\t$documents_name = explode(\"|\",$quote['documents_name']);\n\t\t\t\t$k =0;\n\t\t\t\tforeach($documents_path as $row)\n\t\t\t\t{\n\t\t\t\t\tif(file_exists($this->quote_documents_path.$documents_path[$k]) && !is_dir($this->quote_documents_path.$documents_path[$k]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$files .= '<div class=\"topset2\"><a href=\"/quote/download-document?type=quote&quote_id='.$quote_id.'&index='.$k.'\">'.$documents_name[$k].'</a><span class=\"delete\" rel=\"'.$k.'_'.$quote_id.'\"> <i class=\"splashy-error_x\"></i></span> \t\t\t\t\t\t</div>';\n\t\t\t\t\t}\n\t\t\t\t\t$k++;\n\t\t\t\t}\n\t\t\t\t$this->quote_creation->send_quote['documents'] = $files;\n\n\t\n\n\t\t\t\t//echo \"<pre>\";print_r($this->quote_creation->send_quote);exit;\n\t\t\t}\n\t\t}\n\n\t\t//echo \"<pre>\";print_r($this->quote_creation->create_step1);exit;\n\t}", "public function sendTeamQuoteAction()\n\t{\n\t\t//setlocale(LC_TIME, \"fr_FR\");\n\t\tif($this->quote_creation->create_step1['quote_type']=='only_tech' || $this->quote_creation->create_step1['quote_type']=='only_seo')\n\t\t{\t\t\t\n\t\t\t\n\t\t\t$client_id=$this->quote_creation->create_step1['client_id'];\n\t\t\t$client_obj=new Ep_Quote_Client();\t\t\n\t\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\t\t$this->quote_creation->custom['mission_added']='no';\n\n\t\t\t//getting Client details of selected client\n\t\t\t$client_details=$client_obj->getClientDetails($client_id);\n\t\t\tif($client_details!='NO')\n\t\t\t{\n\t\t\t\t$this->quote_creation->create_mission['company_name']=$client_details[0]['company_name'];\n\t\t\t\t$this->quote_creation->create_mission['ca_number']=$client_details[0]['ca_number'];\n\t\t\t\t$this->quote_creation->create_mission['client_id']=$client_details[0]['identifier'];\n\t\t\t}\t\n\n\t\t\t\n\n\t\t\t$quote_monthly_cnt=$quote_obj->getMonthlyCount($client_id);\n\t\t\t$quote_monthly_cnt+=1;\n\n\t\t\t//titel should be form DB in edit\n\t\t\tif($this->quote_creation->custom['action']!='edit' || !$this->quote_creation->create_mission['quote_title'] || ($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes'))\n\t\t\t{\n\t\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')\n\t\t\t\t{\n\t\t\t\t\t$old_version='v'.($this->quote_creation->custom['version']-1);\n\t\t\t\t\t$new_version='v'.($this->quote_creation->custom['version']);\n\t\t\t\t\t$old_title=$this->quote_creation->create_mission['quote_title'];\n\n\t\t\t\t\t$this->quote_creation->create_mission['quote_title']=str_replace($old_version, $new_version, $old_title);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$this->quote_creation->create_mission['quote_title']='Quote - '.$this->quote_creation->create_mission['company_name'].' - '.strftime(\"%B %Y\").' - '.$quote_monthly_cnt. \" - v1\";\t\n\t\t\t}\n\n\t\t\t//getting Quote user details of selected Bo user\t\t\t\n\t\t\t$quote_by=$this->quote_creation->create_step1['quote_by'];\n\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\tif($bo_user_details!='NO')\n\t\t\t{\n\t\t\t\t$this->quote_creation->create_mission['quote_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t$this->quote_creation->create_mission['email']=$bo_user_details[0]['email'];\n\t\t\t\t$this->quote_creation->create_mission['phone_number']=$bo_user_details[0]['phone_number'];\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\n\t\t\t$this->quote_creation->create_mission['category_name']=$this->getCategoryName($this->quote_creation->create_step1['category']);\n\t\t\t\n\n\t\t\t$this->_view->create_mission=$this->quote_creation->create_mission;\n\t\t\t$this->_view->create_step1=$this->quote_creation->create_step1;\n\t\t\t$this->_view->custom=$this->quote_creation->custom;\n\t\t //Added w.r.t edit/duplicate\n\t\t $this->_view->send_quote=$this->quote_creation->send_quote;\n\t\t \n\t\t //echo \"<pre>\";print_r($this->quote_creation->send_team_quote);exit;\n\n\t\t\t$this->render('send-team-quote');\n\t\t}\n\t\telse\n\t\t\t$this->_redirect(\"/quote/create-quote-step1?submenuId=ML13-SL2\");\t\n\t}", "public function query_quote_info(){\n\t\t$this->db->select('quote_id,quote_status,quote_num,quote_cre_date,quote_amount,cus_name,us_fname,us_lname');\n\t\t$this->db->from('tb_quote');\n\t\t$this->db->join('tb_user','tb_quote.quote_by=tb_user.us_id');\n\t\t$this->db->join('tb_customer','tb_quote.quote_cus=tb_customer.cus_id');\n\t\treturn $this->db->get();\n\t}", "public function getQuote($request)\n {\n\n // $this->quoteAPIController->getQuote($request);\n // $this->quoteAPIController->getBoundaryQuotes($request);\n }", "public function getQuote()\n {\n return Mage::getSingleton('checkout/session')->getQuote();\n }", "public function getQuote()\n {\n return Mage::getSingleton('checkout/session')->getQuote();\n }", "public function getAllQuote($request)\n {\n // $request->attributes->set('creatorIDs', [1, 3 ,4 ,5 ,6]);\n\n // [example] filter by status\n // $request->attributes->set('status', ['rejected', 'pending']);\n\n // $this->quoteAPIController->getAllQuote($request);\n // $this->tagAPIController->getAllTag($request);\n // $this->contentCategoryAPIController->getAllContentCategory($request);\n }", "public function needMoreInfoAction()\n\t{\n\n\t\tif($this->_request->isPost())\n\t\t{\n\n\t\t\t$info_parameters=$this->_request->getParams();\n\n\t\t\t$quote_id=$info_parameters['quote_id'];\n\t\t\t$comments=$info_parameters['more_info_comments'];\n\t\t\t$team=$info_parameters['team_review'];\n\n\t\t\t//echo \"<pre>\";print_r($info_parameters);exit;\n\n\t\t\t//quote details\n\t\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t\t$quoteDetails=$quoteObj->getQuoteDetails($quote_id);\n\t\t\t$version=$quoteDetails[0]['version'];\n\t\t\t$client_id=$quoteDetails[0]['client_id'];\n\n\t\t\t//client details\n\t\t\t$client_obj=new Ep_Quote_Client();\t\n\t\t\t$client_details=$client_obj->getClientDetails($client_id);\n\t\t\t$client_name=$client_details[0]['company_name'];\n\n\t\t\tif($quote_id && $comments)\n\t\t\t{\n\t\t\t\t//Insert Quote log\n\t\t\t\t$log_params['quote_id']\t= $quote_id;\n\t\t\t\t$log_params['bo_user']\t= $this->adminLogin->userId;\t\t\t\t\t\n\t\t\t\t$log_params['version']\t= $version;\n\t\t\t\t$log_params['action']\t= $team.'_need_more_info';\t\t\t\t\n\t\t\t\t$log_params['comments']=$comments;\n\t\t\t\t$log_obj=new Ep_Quote_QuotesLog();\n\t\t\t\t$quiteActionId=30;\n\t\t\t\t$log_obj->insertLog($quiteActionId,$log_params);\n\n\n\n\t\t\t\t//sending email to sales incharge\n\t\t\t\t$cmail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t$receiver_id=$quoteDetails[0]['created_by'];\n\t\t\t\t$cmail_parameters['bo_user']=$this->adminLogin->userId;\n\t\t\t\t$cmail_parameters['sales_user']=$receiver_id;\n\t\t\t\t$cmail_parameters['quote_title']=$quotes_data['title'];\t\n\t\t\t\t$cmail_parameters['client_name']=$client_name;\n\t\t\t\t$cmail_parameters['bo_user_comments']=$comments;\n\t\t\t\t$cmail_parameters['validate_link']='/quote/create-quote-step1?qaction=edit&quote_id='.$quote_id.'&submenuId=ML13-SL2';\n\t\t\t\t$cmail_obj->sendQuotePersonalEmail($receiver_id,181,$cmail_parameters);\n\n\n\t\t\t}\n\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($receiver_id);\t\t\t\n\t\t\t$sales_user_name=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\t\n\n\t\t\t$this->_helper->FlashMessenger('Votre commentaire a bien &eacute;t&eacute; envoy&eacute; &agrave; '.$sales_user_name);\n\n\t\t\tif($team=='tech')\n\t\t\t\t$this->_redirect(\"/quote/tech-quote-review?quote_id=$quote_id&submenuId=ML13-SL2\");\n\t\t\telse if($team=='seo')\n\t\t\t\t$this->_redirect(\"/quote/seo-quote-review?quote_id=$quote_id&submenuId=ML13-SL2\");\n\t\t\telse if($team=='prod')\n\t\t\t\t$this->_redirect(\"/quote/prod-quote-review?quote_id=$quote_id&submenuId=ML13-SL2\");\n\t\t}\t\n\t}", "public function travel_quote() {\n\t\tCheckAdminLoginSession();\n\t\t$per_page = 20;\n if($this->uri->segment(4)) {\n \t$page = ($this->uri->segment(4)) ;\n }\n else {\n \t$page = 1;\n }\n $start = ($page-1)*$per_page;\n $limit = $per_page;\n $totalCount = $this->admin_model->totalRecord($this->travel_quote);\n\t\t$data[\"dataCollection\"] = $this->admin_model->getDataCollection($this->travel_quote,$limit,$start);\n $totalResult = count($data['dataCollection']);\n\t\t$data[\"pagination\"] = Jpagination($totalCount,$limit,$start);\n\t\t$this->load->view('admin/include/head');\n\t\t$this->load->view('admin/include/header');\n\t\t$this->load->view('admin/include/sidebar');\n\t\t$this->load->view('admin/travel/travel_quote',$data);\n\t\t$this->load->view('admin/include/footer');\n\t\t$this->load->view('admin/include/foot');\n\t}", "function fn_QuoteSubmission($quoteRequest){\n\t\t\t$params = $this->params;\n\t\t\t$wsdl \t= $this->wsdl;\n\t\t\t$responce = \"\";\n\t\t\ttry\t{\n\t\t\t\t$soap = new SoapClient($wsdl, $params);\n\t\t\t\t$args = array('token' => $this->token, 'quoteRequest' => $quoteRequest);\n\t\t\t\t$responce = $soap->QuoteSubmission($args);\n\t\t\t} \n\t\t\tcatch (SoapFault $e) {\n\t\t\t\t//$responce = \"\";\n\t\t\t \t//$responce = 'Caught exception:'.$e->getMessage().\"\\n\";\n\t\t\t \t\n\t\t\t \t$responce['faultcode'] \t\t= $e->faultcode;\n\t\t\t $responce['faultstring'] \t= $e->faultstring;\n\t\t\t $responce['faultactor'] \t= $e->faultactor;\n\t\t\t $responce['faultname'] \t\t= $e->faultname;\n\t\t\t $responce['headerfault'] \t= $e->headerfault;\n\t\t\t}\n\t\t\treturn $responce;\n\t\t}", "public function salesQuotesListAction()\n\t{\t\t\n\t\t$quote_obj=new Ep_Quote_Quotes();\n\t\t$listParams=$this->_request->getParams();\n\t\t$searchParams['client_id']=$listParams['client_id'];\n\n\t\t$quoteList=$quote_obj->getAllQuotesList($searchParams);\t\n\t\t\n\t\tif($quoteList)\n\t\t{\n\t\t\t$q=0;\n\t\t\t$total_turnover = $total_ongoing_turnover_euro = $total_ongoing_turnover_pound = $validated_turnover_euro = $validated_turnover_pound = $signed_turnover_euro = $signed_turnover_pound = 0;\n\t\t\t$ave_count=$relancer_turnover_pound=$relancer_turnover_euro=$in_day=0;\n\t\t\t$in_day=0;\n\t\t\tforeach ($quoteList as $quote) {\n\t\t\t\t\n\t\t\t\t$quoteList[$q]['tech_status']=$this->status_array[$quote['tec_review']];\n\t\t\t\t$quoteList[$q]['seo_status']=$this->status_array[$quote['seo_review']];\n\t\t\t\t$quoteList[$q]['prod_status']=$this->status_array[$quote['prod_review']];\n\t\t\t\t$quoteList[$q]['sales_status']=$this->status_array[$quote['sales_review']];\n\t\t\t\t$quoteList[$q]['category_name']=$this->getCategoryName($quote['category']);\n\t\t\t\t$quoteList[$q]['closed_reason_txt'] = $this->closedreason[$quote['closed_reason']];\n\t\t\t\tif($quote['tech_timeline'])\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$quoteList[$q]['tech_challenge_time']=strtotime($quote['tech_timeline']);\n\t\t\t\t}\t\n\t\t\t\tif($quote['seo_timeline'])\n\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['seo_challenge_time']=strtotime($quote['seo_timeline']);\n\t\t\t\t}\n\n\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote['quote_by']);\n\t\t\t\t\n\t\t\t\tif($quote['deleted_by'])\n\t\t\t\t{\n\t\t\t\t\t$deleted_user=$client_obj->getQuoteUserDetails($quote['deleted_by']);\n\t\t\t\t\t$quoteList[$q]['deleted_user'] = $deleted_user[0]['first_name'].' '.$deleted_user[0]['last_name'];\n\t\t\t\t}\n\n\t\t\t\t$quoteList[$q]['owner']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\n\t\t\t\t$prod_team=$quote['prod_review']!='auto_skipped' ? 'Prod ': '';\n\t\t\t\t$seo_team=$quote['seo_review']!='auto_skipped' ? 'Seo ': '';\n\t\t\t\t$tech_team=$quote['tec_review']!='auto_skipped' ? 'Tech ': '';\n\n\t\t\t\t$quoteList[$q]['team']=$prod_team.$seo_team.$tech_team;\n\n\t\t\t\tif(!$quoteList[$q]['team'])\n\t\t\t\t\t$quoteList[$q]['team']='only sales';\n\n\n\t\t\t\t//turnover calculations\n\t\t\t\t/*if($quote['sales_review']=='not_done' || $quote['sales_review']=='to_be_approve' )\n\t\t\t\t{\n\t\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t\t$total_ongoing_turnover_euro +=$quote['turnover'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$total_ongoing_turnover_pound +=$quote['turnover'];\n\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\tif($quote['sales_review']=='validated')\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$validated_turnover_euro += $quote['turnover']\t;\n\t\t\t\t\telse\n\t\t\t\t\t\t$validated_turnover_pound += $quote['turnover']\t;\n\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\tif($quote['sales_review']=='signed')\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$signed_turnover_euro += $quote['turnover'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$signed_turnover_pound += $quote['turnover'];\n\t\t\t\t}*/\n\t\t\t\t//turnover calculations\n\t\t\t\t\n\t\t\t\tif($quote['sales_review']=='not_done' || $quote['sales_review']=='to_be_approve' )\n\t\t\t\t{\n\t\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t\t$total_ongoing_turnover_euro +=$quote['turnover'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$total_ongoing_turnover_pound +=$quote['turnover'];\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\tif($quote['sales_review']=='signed')\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$signed_turnover_euro += $quote['turnover'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$signed_turnover_pound += $quote['turnover'];\n\n\t\t\t\t\t$existval= $quote_obj->checkcontractexist($quote['identifier']);\n\t\t\t\t\t\n\t\t\t\t\tif(count($existval[0]['quotecontractid'])>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteList[$q]['signed_exist']=1;\n\t\t\t\t\t\t$quoteList[$q]['signed_contract']=$existval[0]['contractname'];\n\t\t\t\t\t\t$quoteList[$q]['signed_contractid']=$existval[0]['quotecontractid'];\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$quoteList[$q]['signed_exist']=0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t \n\t\t\t\t//Mean Time Quotes signature \n\t\t\t\t\n\t\t\t\tif(($quote['sales_review']=='validated' || $quote['sales_review']=='signed') && $quote['signed_at']!='')\n\t\t\t\t{\n\t\t\t\t\t\t$quotes_log=new Ep_Quote_QuotesLog();\n\t\t\t\t\t\t$quotesAction=$quotes_log->getquoteslogvalid($quote['identifier'],'sales_validated_ontime');\n\t\t\t\t\t//print_r($quotesAction);\n\t\t\t\t\t\tif($quotesAction[0]['action_at']!=\"\"){\n\t\t\t\t\t\t\t$date_difference=strtotime($quote['signed_at'])-strtotime($quotesAction[0]['action_at']);\n\t\t\t\t\t\t\t$in_day+=$date_difference/(60 * 60 * 24);\n\t\t\t\t\t\t\t$ave_count++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\n } \n \n //relancer Section\n if($quote['releaceraction']!=''){\n\t\t\t\t\t $quoteList[$q]['relance_actiondate']=date(\"Y-m-d\", strtotime(\"+1 month\", strtotime($quote['releaceraction'])));\n\t\t\t\t\t} \n\t\t\t\t\t \n if($quote['quotesvalidated']!=''){\n\t\t\t\t\t $quoteList[$q]['relance_validated']=date(\"Y-m-d\", strtotime(\"+5 days\", strtotime($quote['quotesvalidated'])));\n\t\t\t\t\t} \n \n\t\t\t\t\t\n\t\t\t\tif($quoteList[$q]['version']>1)\n\t\t\t\t{\n\t\t\t\t\t$versions = $quote_obj->getQuoteVersionDetails($quote['identifier']);\n\t\t\t\t\t$quoteList[$q]['version_dates'] = \"<table class='table quote-history table-striped'>\";\n\t\t\t\t\tforeach($versions as $version):\n\t\t\t\t\t$quoteList[$q]['version_dates'] .= '<tr><td>v'.$version['version'].' - '.date('d/m/Y',strtotime($version['created_at'])).\"</td></tr>\";\n\n\t\t\t\t\tendforeach;\n\t\t\t\t\t$quoteList[$q]['version_dates'] .= '</table>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t$quoteList[$q]['version_dates'] = \"\";\n\t\t\t\t\n\t\t\t\t//relancer turnover and flag\n\t\t\t\t\tif( (($quote['sales_review']=='closed' && (date(\"Y-m-d\") > $quoteList[$q]['relance_actiondate'] || $quote['boot_customer']!=\"\") ) \n\t\t\t\t\t ||\t(time() > $quoteList[$q]['sign_expire_timeline'] && $quote['sales_review']=='validated'))\n\t\t\t\t\t && $quote['closed_reason']!= 'quote_permanently_lost')\n\t\t\t\t\t {\n\t\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$relancer_turnover_euro+=$quote['turnover'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t$relancer_turnover_pound+=$quote['turnover'];\n\t\t\t\t\t\t$quoteList[$q]['relancer_status']=1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$quoteList[$q]['relancer_status']=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t//closed quotes flag\n\t\t\t\tif( ($quote['sales_review']=='closed' && date(\"Y-m-d\") <= $quoteList[$q]['relance_actiondate'] && $quote['boot_customer']==\"\")\n\t\t\t\t || $quote['closed_reason']=='quote_permanently_lost') \n\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['closed_status']=1;\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['closed_status']=0;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//validated turnover\n\t\t\t\tif($quote['sales_review']=='validated' && time() <= $quoteList[$q]['sign_expire_timeline'])\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$validated_turnover_euro += $quote['turnover']\t;\n\t\t\t\t\telse\n\t\t\t\t\t\t$validated_turnover_pound += $quote['turnover']\t;\n\t\t\t\t\n\t\t\t\t$quoteList[$q]['validated_status']=1;\n\t\t\t\t\tif($quote['is_new_quote']==1)\n\t\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['new_quote']=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t$quoteList[$q]['new_quote']=0;\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$quoteList[$q]['validated_status']=0;\n\t\t\t\t\tif($quote['is_new_quote']==1)\n\t\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['new_quote']=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t$quoteList[$q]['new_quote']=0;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$q++;\n\t\t\t}\n\t\t\t$meantime_sign_days=round(abs($in_day)/$ave_count,0);\n\t\t\t//echo \"<pre>\";print_r($quoteList);exit;\n\t\t\t$this->_view->quote_list=$quoteList;\n\t\t\t$this->_view->total_ongoing_turnover_euro = $total_ongoing_turnover_euro;\n\t\t\t$this->_view->total_ongoing_turnover_pound = $total_ongoing_turnover_pound;\n\t\t\t$this->_view->validated_turnover_euro = $validated_turnover_euro;\n\t\t\t$this->_view->validated_turnover_pound = $validated_turnover_pound;\n\t\t\t$this->_view->signed_turnover_euro = $signed_turnover_euro;\n\t\t\t$this->_view->signed_turnover_pound = $signed_turnover_pound;\n\t\t\t$this->_view->relancer_turnover_euro=$relancer_turnover_euro;\n\t\t\t$this->_view->relancer_turnover_pound=$relancer_turnover_pound;\n\t\t\t$this->_view->day_difference=$meantime_sign_days;\n\n\t\t}\t\n\t\t$this->_view->quote_sent_timeline=$this->configval[\"quote_sent_timeline\"];\n\t\t$this->_view->prod_timeline=$this->configval[\"prod_timeline\"];\n\n\t\t$this->_view->techManager_holiday=$this->configval[\"tech_manager_holiday\"];\n\t\t$this->_view->seoManager_holiday=$this->configval[\"seo_manager_holiday\"];\n\n\t\t//echo \"<pre>\";print_r($quoteList);exit;\n\t\t$this->_view->closedreasons = $this->closedreason;\n\t\t$this->render('sales-quotes-list');\n\n\t\tif($listParams['file_download']=='yes' && $listParams['quote_id'])\n\t\t\theader( \"refresh:1;url=/quote/download-quote-xls?quote_id=\".$listParams['quote_id']);\n\t}", "protected function _getQuote()\n {\n return $this->_getCart()->getQuote();\n }", "public function createQuote()\n\t{\n\t\t$this->setType($_POST['frmquotetype']);\n\t\t$this->setDate($_POST['frmquotedate']);\n\t\t$this->setStatus('Open');\n\t\t$this->setJobName($_POST['frmjobname']);\n\t\t$this->setJobAddress($_POST['frmjobaddress']);\n\t\t$this->setJobCity($_POST['frmjobcity']);\n\t\t$this->setJobZipcode($_POST['frmjobzipcode']);\n\t\t$this->setAttention($_POST['frmattn']);\n\t\t// Here we are going to post the tax rate and turn it into a float.\n\t\t$unformatted_tax_rate = $_POST['frmtaxrate'];\n\t\t$this->setTaxRate((float)$unformatted_tax_rate);\n\t\t$this->setCostBeforeTax($_POST['cartBeforeTaxCost']);\n\t\t$this->setTotalCost($_POST['cartTotalCost']);\n\t\t$this->setSalesTax($_POST['cartTax']);\n\t\t$this->setMonthlyTotal($_POST['cartMonthlyTotal']);\n\t\t$this->setDeliveryTotal($_POST['cartDeliveryTotal']);\n\t\t$this->setHidden(null);\n\n\t\t// Need to insert the new order into the database.\n\t\t$this->getDB()->insert('quotes', [\n\t\t\t\t'quote_customer' \t\t=> $this->getCustomer(),\n\t\t\t\t'quote_customer_id' \t=> $this->getCustomerId(),\n\t\t\t\t'quote_date' \t\t\t=> $this->getDate(),\n\t\t\t\t'quote_status' \t\t\t=> $this->getStatus(),\n\t\t\t\t'quote_type' \t\t\t=> $this->getType(),\n\t\t\t\t'job_name' \t\t\t\t=> $this->getJobName(),\n\t\t\t\t'job_city' \t\t\t\t=> $this->getJobCity(),\n\t\t\t\t'job_address' \t\t\t=> $this->getJobAddress(),\n\t\t\t\t'job_zipcode' \t\t\t=> $this->getJobZipcode(),\n\t\t\t\t'attn' \t\t\t\t\t=> $this->getAttention(),\n\t\t\t\t'tax_rate' \t\t\t\t=> $this->getTaxRate(),\n\t\t\t\t'cost_before_tax' \t\t=> $this->getCostBeforeTax(),\n\t\t\t\t'total_cost' \t\t\t=> $this->getTotalCost(),\n\t\t\t\t'sales_tax' \t\t\t=> $this->getSalesTax(),\n\t\t\t\t'monthly_total' \t\t=> $this->getMonthlyTotal(),\n\t\t\t\t'delivery_total'\t\t=> $this->getDeliveryTotal(),\n\t\t\t\t'hidden'\t\t\t\t=> $this->getHidden()\n\t\t\t]);\n\n\t\t// If properly inserted, grab the ID, else throw error.\n\t\tif($this->getDB()->lastId() != null)\n\t\t{\n\t\t\t$this->id = $this->getDB()->lastId();\n\t\t} \n\t\telse \n\t\t{\n\t\t\tthrow new Exception(\"There was an error inserting the quote into the database.\");\n\t\t}\n\t\t\n\t}", "public function ajax_read_quote()\r\n {\r\n try\r\n {\r\n $id = trim($this->input->post('i_id')); \r\n\t\t\t$arr['i_view'] = 1; \r\n $i_ret_ = $this->mod_rect->read_quote($arr,decrypt($id));\r\n if($i_ret_)\r\n {\r\n set_success_msg($this->cls_msg[\"marked_succ\"]);\r\n echo 'ok';\r\n }\r\n else\r\n {\r\n echo 'error';\r\n }\r\n \r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n }\r\n }", "public function prodViewDetails($quote_id)\n\t{\n\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\tif($quote_id)\n\t\t{\n\t\t\t$quoteDetails=$quote_obj->getQuoteDetails($quote_id);\n\t\t\tif($quoteDetails)\n\t\t\t{\n\t\t\t\t$q=0;\n\t\t\t\tforeach($quoteDetails as $quote)\n\t\t\t\t{\n\t\t\t\t\t$quoteDetails[$q]['category_name']=$this->getCategoryName($quote['category']);\n\t\t\t\t\t$quoteDetails[$q]['websites']=explode(\"|\",$quote['websites']);\n\t\t\t\t\t\n\t\t\t\t\tif($quote['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t/* $related_files='';\n\t\t\t\t\t\t$documents_path=explode(\"|\",$quote['documents_path']);\n\t\t\t\t\t\t$documents_name=explode(\"|\",$quote['documents_name']);\n\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($documents_path as $k=>$file)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(file_exists($this->quote_documents_path.$documents_path[$k]) && !is_dir($this->quote_documents_path.$documents_path[$k]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($documents_name[$k])\n\t\t\t\t\t\t\t\t$file_name=$documents_name[$k];\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$file_name=basename($file);\n\n\t\t\t\t\t\t\t$related_files.='\n\t\t\t\t\t\t\t<a href=\"/quote/download-document?type=quote&index='.$k.'&quote_id='.$quote_id.'\">'.$file_name.'</a><br>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} */\n\t\t\t\t\t\t$files = array('documents_path'=>$quote['documents_path'],'documents_name'=>$quote['documents_name'],'quote_id'=>$quote_id,'delete'=>false);\n\t\t\t\t\t\t$related_files = $this->getQuoteFiles($files);\n\t\t\t\t\t}\n\n\t\t\t\t\t$quoteDetails[$q]['related_files']=$related_files;\n\n\t\t\t\t\t$quoteDetails[$q]['sales_suggested_price_format']=number_format($quote['sales_suggested_price'], 2, ',', ' ');\n\t\t\t\t\t$quoteDetails[$q]['comment_time']=time_ago($quote['created_at']);\n\t\t\t\t\t\n\n\t\t\t\t\t//bo user details\n\t\t\t\t\t$quote_by=$quote['quote_by'];\n\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\t\t\tif($bo_user_details!='NO')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteDetails[$q]['quote_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t\t\t$quoteDetails[$q]['email']=$bo_user_details[0]['email'];\n\t\t\t\t\t\t$quoteDetails[$q]['phone_number']=$bo_user_details[0]['phone_number'];\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t//getting mission details\n\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\t$searchParameters['misson_user_type']='sales';\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t$missonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\t\t\tif($missonDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\t$m=0;\n\t\t\t\t\t\tforeach($missonDetails as $mission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$missonDetails[$m]['product_name']=$this->product_array[$mission['product']];\t\t\t\n\t\t\t\t\t\t\t$missonDetails[$m]['language_source_name']=$this->getLanguageName($mission['language_source']);\n\t\t\t\t\t\t\t$missonDetails[$m]['product_type_name']=$this->producttype_array[$mission['product_type']];\n\t\t\t\t\t\t\tif($mission['language_dest'])\n\t\t\t\t\t\t\t\t$missonDetails[$m]['language_dest_name']=$this->getLanguageName($mission['language_dest']);\n\n\t\t\t\t\t\t\t$quoteDetails[$q]['missions_list'][$mission['identifier']]='Mission '.($m+1).' - '.$missonDetails[$m]['product_name'];\n\n\t\t\t\t\t\t\t$missonDetails[$m]['comment_time']=time_ago($mission['created_at']);\n\t\t\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\n\t\t\t\t\t\t\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t\t\t$previousMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],$previousVersion,'sales');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach($previousMissionDetails as $key=>$vmission)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_name']=$this->seo_product_array[$vmission['product']];\t\t\t\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_source_name']=$this->getLanguageName($vmission['language_source']);\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_type_name']=$this->producttype_array[$vmission['product_type']];\n\t\t\t\t\t\t\t\t\t\tif($vmission['language_dest'])\n\t\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_dest_name']=$this->getLanguageName($vmission['language_dest']);\n\n\t\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$allVersionMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],NULL,'sales');\n\t\t\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t\t\t$table_end='</table>';\n\t\t\t\t\t\t\t\t\t\t$language_versions=$product_type_versions=$volume_versions=$nb_words_versions='';\n\t\t\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\n\t\t\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t \tif($versions['product']=='translation')\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']).\" > \".$this->getLanguageName($vmission['language_dest']);\n\t\t\t\t\t\t\t\t\t\t \telse\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']);\n\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\n\t\t\t\t\t\t\t\t\t\t \t$language_versions.=\"<tr><td>$language</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$product_type_versions.=\"<tr><td>\".$this->producttype_array[$versions['product_type']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$volume_versions.=\"<tr><td>\".$versions['volume'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$nb_words_versions.=\"<tr><td>\".$versions['nb_words'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['unit_price'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_option=$this->duration_array[$versions['mission_length_option']];//$versions['mission_length_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['mission_length'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\t\t\tif($mission['language_source'] !=$previousMissionDetails[0]['language_source'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['language_dest'] !=$previousMissionDetails[0]['language_dest'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['product_type'] !=$previousMissionDetails[0]['product_type'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_versions']=$table_start.$product_type_versions.$table_end;\n\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\t\t\tif($mission['volume'] !=$previousMissionDetails[0]['volume'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_versions']=$table_start.$volume_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($mission['nb_words'] !=$previousMissionDetails[0]['nb_words'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_versions']=$table_start.$nb_words_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($mission['unit_price'] !=$previousMissionDetails[0]['unit_price'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['unit_price_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$current_mission_lenght=$mission['mission_length_option']=='hours' ? ($mission['mission_length']/24) : $mission['mission_length'];\n\t\t\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['mission_length_option']=='hours' ? ($previousMissionDetails[0]['mission_length']/24) : $previousMissionDetails[0]['mission_length'];\n\t\t\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t//Get seo missions related to a mission\n\t\t\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\t\t\t$searchParameters['misson_user_type']='seo';\n\t\t\t\t\t\t\t$searchParameters['related_to']=$mission['identifier'];\n\t\t\t\t\t\t\t$searchParameters['product']=$mission['product'];\n\t\t\t\t\t\t\t//echo \"<pre>\";print_r($searchParameters);\n\t\t\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t\t$seoMissonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\t\t\t\t\t//echo \"<pre>\";print_r($seoMissonDetails);exit;\n\t\t\t\t\t\t\tif($seoMissonDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$s=0;\n\t\t\t\t\t\t\t\tforeach($seoMissonDetails as $smission)\n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($smission['created_by']);\n\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['seo_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\n\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['comment_time']=time_ago($smission['created_at']);\n\n\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['product_type_name']=$this->producttype_array[$smission['product_type']];\n\n\t\t\t\t\t\t\t\t\t$prodMissionObj=new Ep_Quote_ProdMissions();\n\n\t\t\t\t\t\t\t\t\t$searchParameters['quote_mission_id']=$smission['identifier'];\n\t\t\t\t\t\t\t\t\t$prodMissionDetails=$prodMissionObj->getProdMissionDetails($searchParameters);\n\t\t\t\t\t\t\t\t\t//echo \"<pre>\";print_r($prodMissionDetails);exit;\n\n\t\t\t\t\t\t\t\t\tif($prodMissionDetails)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['prod_mission_details']=$prodMissionDetails;\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t\t//getting suggested mission Details for seo missions\n\t\t\t\t\t\t\t\t\t\tif($smission['sales_suggested_missions'])\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$archmission_obj=new Ep_Quote_Mission();\n\t\t\t\t\t\t\t\t\t\t\t$archParameters['mission_id']=$smission['sales_suggested_missions'];\n\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details=$archmission_obj->getMissionDetails($archParameters);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif($suggested_mission_details)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforeach($suggested_mission_details as $key=>$suggested_mission)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$sug_mission_length=$smission['volume']*($smission['nb_words']/$suggested_mission['article_length']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_mission_length=round($suggested_mission['mission_length']*($sug_mission_length/$suggested_mission['num_of_articles']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['mission_length']=$prod_mission_length;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['mission_length']=round(($smission['mission_length']*90)/100);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$staff_setup_length=ceil(($smission['mission_length']*10)/100);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$staff_setup_length=$staff_setup_length ? $staff_setup_length :1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$staff_setup_length=$staff_setup_length < 10 ? $staff_setup_length :10;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['staff_setup_length']=$staff_setup_length < 10 ? $staff_setup_length :10;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//pre-fill staff calculations\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//total mission words\n\t\t\t\t\t\t\t\t\t\t\t\t\t$mission_volume=$smission['volume'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$mission_nb_words=$smission['nb_words'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$total_mission_words=($mission_volume*$mission_nb_words);\n\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//words that can write per writer with in delivery weeks\n\t\t\t\t\t\t\t\t\t\t\t\t\t$sales_delivery_time=$smission['mission_length_option']=='hours' ? ($smission['mission_length']/24) : $smission['mission_length'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$sales_delivery_week=ceil($sales_delivery_time/7);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$mission_product=$smission['product_type'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$articles_perweek=$this->configval['max_writer_'.$mission_product];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$words_perweek_peruser=$articles_perweek*250;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$words_peruser_perdelivery=$sales_delivery_week*$words_perweek_peruser;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//wrting and proofreading staff calculations\n\t\t\t\t\t\t\t\t\t\t\t\t\t$writing_staff=round($total_mission_words/$words_peruser_perdelivery);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(!$writing_staff || $writing_staff <1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$writing_staff=1;\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['writing_staff']=$writing_staff;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['suggested_mission_details']=$suggested_mission_details;\t\n\t\t\t\t\t\t\t\t\t\t\t\t//staff time details\n\t\t\t\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['staff_time']=$staff_setup_length;\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//echo \"<pre>\";print_r($seoMissonDetails);exit;\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\t\t$s++;\t\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$missonDetails[$m]['seoMissions']=$seoMissonDetails;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//echo \"<pre>\";print_r($missonDetails);exit;\n\n\t\t\t\t\t\t\t$prodMissionObj=new Ep_Quote_ProdMissions();\n\n\t\t\t\t\t\t\t$searchParameters['quote_mission_id']=$mission['identifier'];\n\t\t\t\t\t\t\t$prodMissionDetails=$prodMissionObj->getProdMissionDetails($searchParameters);\n\t\t\t\t\t\t\t//echo \"<pre>\";print_r($prodMissionDetails);exit;\n\n\t\t\t\t\t\t\tif($prodMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$p=0;\n\t\t\t\t\t\t\t\tforeach($prodMissionDetails as $mission)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\n\t\t\t\t\t\t\t\t\t\t$prodMissionObj=new Ep_Quote_ProdMissions();\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails=$prodMissionObj->getMissionVersionDetails($mission['identifier'],$previousVersion);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$allVersionMissionDetails=$prodMissionObj->getMissionVersionDetails($mission['identifier']);\n\n\t\t\t\t\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t\t\t\t\t$table_end='</table>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\t\t\t\t\t\t\t\t\t\t\t\t$staff_versions=$staff_length_versions='';\n\n\t\t\t\t\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t \t\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$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\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\t\t\t\t\t\t\t\t\t \t$staff_versions.=\"<tr><td>\".$versions['staff'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['cost'],2).\" &\". $versions['currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t\t\t \t$staff_length_option=$versions['staff_time_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t\t\t\t\t \t$staff_length_versions.=\"<tr><td>\".$versions['staff_time'].\" $staff_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t\t\t \t$mission_length_option=$versions['delivery_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['delivery_time'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t//checking the version differences\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\tif($mission['cost'] !=$previousMissionDetails[0]['cost'])\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['cost_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif($mission['staff'] !=$previousMissionDetails[0]['staff'])\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['staff_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['staff_versions']=$table_start.$staff_versions.$table_end;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$current_mission_lenght=$mission['delivery_option']=='hours' ? ($mission['delivery_time']/24) : $mission['delivery_time'];\n\t\t\t\t\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['delivery_option']=='hours' ? ($previousMissionDetails[0]['delivery_time']/24) : $previousMissionDetails[0]['delivery_time'];\n\t\t\t\t\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$current_staff_lenght=$mission['staff_time_option']=='hours' ? ($mission['staff_time']/24) : $mission['staff_time'];\n\t\t\t\t\t\t\t\t\t\t\t$previous_staff_lenght=$previousMissionDetails[0]['staff_time_option']=='hours' ? ($previousMissionDetails[0]['staff_time']/24) : $previousMissionDetails[0]['staff_time'];\n\t\t\t\t\t\t\t\t\t\t\tif($current_staff_lenght !=$previous_staff_lenght)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['staff_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['staff_length_versions']=$table_start.$staff_length_versions.$table_end;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$p++;\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t$missonDetails[$m]['prod_mission_details']=$prodMissionDetails;\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//getting suggested mission Details for quote missions\n\t\t\t\t\t\t\t\tif($mission['sales_suggested_missions'])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$archmission_obj=new Ep_Quote_Mission();\n\t\t\t\t\t\t\t\t\t$archParameters['mission_id']=$mission['sales_suggested_missions'];\n\t\t\t\t\t\t\t\t\t$suggested_mission_details=$archmission_obj->getMissionDetails($archParameters);\n\t\t\t\t\t\t\t\t\tif($suggested_mission_details)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach($suggested_mission_details as $key=>$suggested_mission)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif($suggested_mission['writing_cost_before_signature_currency']!=$quote['sales_suggested_currency'])\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$conversion=$quote['conversion'];\n\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['writing_cost_before_signature']=($suggested_mission['writing_cost_before_signature']*$conversion);\n\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['correction_cost_before_signature']=($suggested_mission['correction_cost_before_signature']*$conversion);\n\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['other_cost_before_signature']=($suggested_mission['other_cost_before_signature']*$conversion);\n\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['unit_price']=($suggested_mission['selling_price']*$conversion);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['unit_price']=($suggested_mission['selling_price']);\n\n\n\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['mission_length']=round(($mission['mission_length']*90)/100);\n\t\t\t\t\t\t\t\t\t\t\t$staff_setup_length=ceil(($mission['mission_length']*10)/100);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$staff_setup_length=$staff_setup_length ? $staff_setup_length :1;\n\t\t\t\t\t\t\t\t\t\t\t$staff_setup_length=$staff_setup_length < 10 ? $staff_setup_length :10;\n\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['staff_setup_length']=$staff_setup_length < 10 ? $staff_setup_length :10;\n\n\t\t\t\t\t\t\t\t\t\t\t//pre-fill staff calculations\n\n\t\t\t\t\t\t\t\t\t\t\t//total mission words\n\t\t\t\t\t\t\t\t\t\t\t$mission_volume=$mission['volume'];\n\t\t\t\t\t\t\t\t\t\t\t$mission_nb_words=$mission['nb_words'];\n\t\t\t\t\t\t\t\t\t\t\t$total_mission_words=($mission_volume*$mission_nb_words);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t//words that can write per writer with in delivery weeks\n\t\t\t\t\t\t\t\t\t\t\t$sales_delivery_time=$mission['mission_length_option']=='hours' ? ($mission['mission_length']/24) : $mission['mission_length'];\n\t\t\t\t\t\t\t\t\t\t\t$sales_delivery_week=ceil($sales_delivery_time/7);\n\n\t\t\t\t\t\t\t\t\t\t\t$mission_product=$mission['product_type'];\n\t\t\t\t\t\t\t\t\t\t\tif($mission['product_type']=='autre')\n\t\t\t\t\t\t\t\t\t\t\t\t$mission_product='article_seo';\n\n\t\t\t\t\t\t\t\t\t\t\t$articles_perweek=$this->configval['max_writer_'.$mission_product];\n\t\t\t\t\t\t\t\t\t\t\t$words_perweek_peruser=$articles_perweek*250;\n\t\t\t\t\t\t\t\t\t\t\t$words_peruser_perdelivery=$sales_delivery_week*$words_perweek_peruser;\n\n\t\t\t\t\t\t\t\t\t\t\t//wrting and proofreading staff calculations\n\t\t\t\t\t\t\t\t\t\t\t$writing_staff=round($total_mission_words/$words_peruser_perdelivery);\n\t\t\t\t\t\t\t\t\t\t\tif(!$writing_staff || $writing_staff <1)\n\t\t\t\t\t\t\t\t\t\t\t\t$writing_staff=1;\n\n\t\t\t\t\t\t\t\t\t\t\t$proofreading_staff=round($total_mission_words/($words_peruser_perdelivery*5));\n\t\t\t\t\t\t\t\t\t\t\tif(!$proofreading_staff || $proofreading_staff <1)\n\t\t\t\t\t\t\t\t\t\t\t\t$proofreading_staff=1;\n\n\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['writing_staff']=$writing_staff;\n\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['proofreading_staff']=$proofreading_staff;\n\n\t\t\t\t\t\t\t\t\t\t\t//ENDED\n\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['suggested_mission_details']=$suggested_mission_details;\t\n\t\t\t\t\t\t\t\t\t\t//staff time details\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['staff_time']=$staff_setup_length;\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t$m++;\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t//echo \"<pre>\";print_r($missonDetails);exit;\n\t\t\t\t\t\t$quoteDetails[$q]['mission_details']=$missonDetails;\n\t\t\t\t\t}\n\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\t\t\t\t\t\t$deletedMissionVersions=$this->deletedMissionVersions($quote['identifier'],$previousVersion,'sales');\n\t\t\t\t\t\tif($deletedMissionVersions)\n\t\t\t\t\t\t\t$quoteDetails[$q]['deletedMissionVersions']=$deletedMissionVersions;\n\t\t\t\t\t}\n\n\t\t\t\t\t//client aims\n\t\t\t\t\t\t$client_aims=explode(\",\",$quote['client_aims']);\n\t\t\t\t\t\t$client_prio=explode(\",\",$quote['client_prio']);\n\t\t\t\t\t\t$client_aims_text='';\n\t\t\t\t\t\tif(count($client_aims)>0 && is_array($client_aims))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach($client_aims as $i=>$aim)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$client_aims_text.='<b>'.ucfirst($aim).'</b> - Prio '.$client_prio[$i].'<br>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$quoteDetails[$q]['client_aims_text']=$client_aims_text;\t\t\n\n\t\t\t\t\t$q++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_view->quoteDetails=$quoteDetails;\n\n\t\t\t//echo \"<pre>\";print_r($quoteDetails);exit;\t\t\t\n\n\t\t\t//getting tech mission details\n\t\t\t$tech_obj=new Ep_Quote_TechMissions();\n\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t$techMissionDetails=$tech_obj->getTechMissionDetails($searchParameters);\n\t\t\t//echo \"<pre>\";print_r($techMissionDetails);exit;\n\t\t\tif($techMissionDetails)\n\t\t\t{\n\t\t\t\t$t=0;\n\t\t\t\tforeach($techMissionDetails as $mission)\n\t\t\t\t{\n\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($mission['created_by']);\n\t\t\t\t\t$techMissionDetails[$t]['tech_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t\t$techMissionDetails[$t]['comment_time']=time_ago($mission['created_at']);\n\n\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\tif($quoteDetails[0]['version']>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$previousVersion=($quoteDetails[0]['version']-1);\n\n\t\t\t\t\t\t$techMissionObj=new Ep_Quote_TechMissions();\n\t\t\t\t\t\t$previousMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier'],$previousVersion);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$allVersionMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier']);\n\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t$table_end='</table>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\t\t\t\t\t\t\t\t$title_versions='';\n\n\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$title_versions.=\"<tr><td>\".$versions['title'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['cost'],2).\" &\". $versions['currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$mission_length_option=$versions['delivery_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['delivery_time'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\tif($mission['title'] !=$previousMissionDetails[0]['title'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_difference']='yes';\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_versions']=$table_start.$title_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif($mission['cost'] !=$previousMissionDetails[0]['cost'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['cost_difference']='yes';\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current_mission_lenght=$mission['delivery_option']=='hours' ? ($mission['delivery_time']/24) : $mission['delivery_time'];\n\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['delivery_option']=='hours' ? ($previousMissionDetails[0]['delivery_time']/24) : $previousMissionDetails[0]['delivery_time'];\n\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t$techMissionDetails[$t]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$techMissionDetails[$t]['files'] = \"\";\n\t\t\t\t\tif($mission['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$filesarray = array('documents_path'=>$mission['documents_path'],'documents_name'=>$mission['documents_name'],'id'=>$mission['identifier'],'delete'=>false);\n\t\t\t\t\t\t$files = $this->getTechFiles($filesarray);\n\t\t\t\t\t\t$techMissionDetails[$t]['files'] = $files;\n\t\t\t\t\t}\n\n\t\t\t\t\t$t++;\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->_view->techMissionDetails=$techMissionDetails;\n\t\t\t}\n\n\t\t\t//ALL language list\n\t\t\t$language_array=$this->_arrayDb->loadArrayv2(\"EP_LANGUAGES\", $this->_lang);\n \tnatsort($language_array);\n \t$this->_view->ep_language_list=$language_array;\n\n\t\t\t//getting seo mission details\n\t\t\t//getting mission details\n\t\t\tunset($searchParameters);\n\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t$searchParameters['misson_user_type']='seo';\n\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t$seoMissionDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\tif($seoMissionDetails)\n\t\t\t{\n\t\t\t\t$s=0;\n\t\t\t\tforeach($seoMissionDetails as $mission)\n\t\t\t\t{\n\t\t\t\t\tif($mission['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$filesarray = array('documents_path'=>$mission['documents_path'],'documents_name'=>$mission['documents_name'],'id'=>$mission['identifier'],'delete'=>false);\n\t\t\t\t\t\t$files = $this->getSeoFiles($filesarray);\n\t\t\t\t\t\t$seoMissionDetails[$s]['files'] = $files;\n\t\t\t\t\t}\n\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($mission['created_by']);\n\t\t\t\t\t$seoMissionDetails[$s]['seo_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\n\t\t\t\t\t$seoMissionDetails[$s]['comment_time']=time_ago($mission['created_at']);\n\n\t\t\t\t\t$seoMissionDetails[$s]['product_name']=$this->seo_product_array[$mission['product']];\n\n\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\tif($quoteDetails[0]['version']>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$previousVersion=($quoteDetails[0]['version']-1);\n\n\t\t\t\t\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t$previousMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],$previousVersion,'seo');\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach($previousMissionDetails as $key=>$vmission)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_name']=$this->seo_product_array[$vmission['product']];\t\t\t\n\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_source_name']=$this->getLanguageName($vmission['language_source']);\n\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_type_name']=$this->producttype_array[$vmission['product_type']];\n\t\t\t\t\t\t\t\tif($vmission['language_dest'])\n\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_dest_name']=$this->getLanguageName($vmission['language_dest']);\n\n\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$allVersionMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],NULL,'seo');\n\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t$table_end='</table>';\n\t\t\t\t\t\t\t\t$product_versions=$language_versions=$product_type_versions=$volume_versions=$nb_words_versions='';\n\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\n\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t \tif($versions['product']=='translation')\n\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']).\" > \".$this->getLanguageName($vmission['language_dest']);\n\t\t\t\t\t\t\t\t \telse\n\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']);\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\n\t\t\t\t\t\t\t\t \t$language_versions.=\"<tr><td>$language</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$product_versions.=\"<tr><td>\".$this->seo_product_array[$versions['product']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$product_type_versions.=\"<tr><td>\".$this->producttype_array[$versions['product_type']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$volume_versions.=\"<tr><td>\".$versions['volume'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$nb_words_versions.=\"<tr><td>\".$versions['nb_words'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['cost'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$mission_length_option=$this->duration_array[$versions['mission_length_option']];//$versions['mission_length_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['mission_length'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\tif($mission['language_source'] !=$previousMissionDetails[0]['language_source'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($mission['language_dest'] !=$previousMissionDetails[0]['language_dest'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($mission['product'] !=$previousMissionDetails[0]['product'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_versions']=$table_start.$product_versions.$table_end;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\tif($mission['product_type'] !=$previousMissionDetails[0]['product_type'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_type_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_type_versions']=$table_start.$product_type_versions.$table_end;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($mission['volume'] !=$previousMissionDetails[0]['volume'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['volume_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['volume_versions']=$table_start.$volume_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($mission['nb_words'] !=$previousMissionDetails[0]['nb_words'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['nb_words_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['nb_words_versions']=$table_start.$nb_words_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($mission['cost'] !=$previousMissionDetails[0]['cost'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['unit_price_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current_mission_lenght=$mission['mission_length_option']=='hours' ? ($mission['mission_length']/24) : $mission['mission_length'];\n\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['mission_length_option']=='hours' ? ($previousMissionDetails[0]['mission_length']/24) : $previousMissionDetails[0]['mission_length'];\n\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t$seoMissionDetails[$s]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$s++;\n\t\t\t\t}\t\n\t\t\t\t$this->_view->seoMissionDetails=$seoMissionDetails;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t//echo \"<pre>\";print_r($seoMissionDetails);exit;\n\n\t\treturn $html=$this->_view->renderHtml('prod-quote-view-details'); \n\n\t\t\n\t}", "public function getQuote() {\n return $this->quote;\n }", "function execute() {\n\t\t$guest = false;\n\t\t$this->defineProperties();\n\t\tif (!df_checkout_h()->canOnepageCheckout()) {\n\t\t\techo json_encode(['error' => 0, 'msg' => '', 'redirect' => $this->_url->getUrl('quotation/quote')]);\n\t\t\texit;\n\t\t}\n\t\t// Validate checkout\n\t\t$quote = $this->getOnepage()->getQuote();\n\t\tif (!$quote->hasItems() || $quote->getHasError() || !$quote->validateMinimumAmount()) {\n\t\t\techo json_encode(['error' => 0, 'msg' => '', 'redirect' => $this->_url->getUrl('quotation/quote')]);\n\t\t\texit;\n\t\t}\n\t\t$isLoggedIn = $this->_customerSession->isLoggedIn();\n\t\tif (!$isLoggedIn) {\n\t\t\tif (isset($_POST['register_new_account'])) {\n\t\t\t\t$isGuest = $this->getRequest()->getPost('register_new_account');\n\t\t\t\tif ($isGuest == '1' || $this->_dataHelper->haveProductDownloadable()) {\n\t\t\t\t\t// If checkbox register_new_account checked or exist downloadable product, create new account\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t\t$storeManager = $this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface');\n\t\t\t\t\t// Preparing data for new customer\n\t\t\t\t\t$customer = $this->_objectManager->get('Magento\\Customer\\Model\\CustomerFactory')->create();\n\t\t\t\t\t$customer->setWebsiteId($storeManager->getWebsite()->getId())\n\t\t\t\t\t\t->setEmail(isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '')\n\t\t\t\t\t\t->setPrefix(isset($_POST['billing']['prefix']) ? $_POST['billing']['prefix'] : '')\n\t\t\t\t\t\t->setFirstname(isset($_POST['billing']['firstname']) ? $_POST['billing']['firstname'] : '')\n\t\t\t\t\t\t->setLastname(isset($_POST['billing']['lastname']) ? $_POST['billing']['lastname'] : '')\n\t\t\t\t\t\t->setMiddlename(isset($_POST['billing']['middlename']) ? $_POST['billing']['middlename'] : '')\n\t\t\t\t\t\t->setSuffix(isset($_POST['billing']['suffix']) ? $_POST['billing']['suffix'] : '')\n\t\t\t\t\t\t->setDob(isset($_POST['dob']) ? $_POST['dob'] : '')\n\t\t\t\t\t\t->setTaxvat(isset($_POST['billing']['taxvat']) ? $_POST['billing']['taxvat'] : '')\n\t\t\t\t\t\t->setGender(isset($_POST['billing']['gender']) ? $_POST['billing']['gender'] : '')\n\t\t\t\t\t\t->setPassword(isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '');\n\t\t\t\t\t// Set customer information to quote\n\t\t\t\t\t$quote->setCustomer($customer->getDataModel())->setPasswordHash($customer->getPasswordHash());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Fix for persistent\n\t\t\t\tif (\n\t\t\t\t\t$this->getCheckout()->getPersistentRegister() && $this->getCheckout()->getPersistentRegister() == \"register\"\n\t\t\t\t) {\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!$this->_dataHelper->getStoreConfig('onestepcheckout/general/allowguestcheckout')\n\t\t\t\t\t\t|| !$this->_dataHelper->getStoreConfig('checkout/options/guest_checkout')\n\t\t\t\t\t\t|| $this->_dataHelper->haveProductDownloadable()\n\t\t\t\t\t) {\n\t\t\t\t\t\t$storeManager = $this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface');\n\t\t\t\t\t\t// Preparing data for new customer\n\t\t\t\t\t\t$customer = $this->_objectManager->get(\n\t\t\t\t\t\t\t'Magento\\Customer\\Model\\CustomerFactory'\n\t\t\t\t\t\t)->create();\n\t\t\t\t\t\t$guest = false;\n\t\t\t\t\t\t$email = isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '';\n\t\t\t\t\t\tif ($email) {\n\t\t\t\t\t\t\t$customer1 = $this->_objectManager->get(\n\t\t\t\t\t\t\t\t'Magento\\Customer\\Model\\CustomerFactory'\n\t\t\t\t\t\t\t)->create();\n\t\t\t\t\t\t\t$customer1->loadByEmail($email);\n\t\t\t\t\t\t\tif ($customer1->getId()) {\n\t\t\t\t\t\t\t\t$customer->setEntityId($customer1->getEntityId());\n\t\t\t\t\t\t\t\tif (!$customer1->getPasswordHash()) {\n\t\t\t\t\t\t\t\t\t$customer->setEntityId($customer1->getEntityId());\n\t\t\t\t\t\t\t\t\t$this->_customerSession->setCustomerId($customer1->getEntityId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$password = isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '';\n\t\t\t\t\t\t\t\t\t$accountManagement = $this->_objectManager->get('Magento\\Customer\\Api\\AccountManagementInterface');\n\t\t\t\t\t\t\t\t\t$accountManagement->authenticate($email, $password);\n\t\t\t\t\t\t\t\t\t$guest = true;\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 (!$guest) {\n\t\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$customer->setWebsiteId($storeManager->getWebsite()->getId())\n\t\t\t\t\t\t\t->setEmail(isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '')\n\t\t\t\t\t\t\t->setPrefix(isset($_POST['billing']['prefix']) ? $_POST['billing']['prefix'] : '')\n\t\t\t\t\t\t\t->setFirstname(isset($_POST['billing']['firstname']) ? $_POST['billing']['firstname'] : '')\n\t\t\t\t\t\t\t->setLastname(isset($_POST['billing']['lastname']) ? $_POST['billing']['lastname'] : '')\n\t\t\t\t\t\t\t->setMiddlename(isset($_POST['billing']['middlename']) ? $_POST['billing']['middlename'] : '')\n\t\t\t\t\t\t\t->setSuffix(isset($_POST['billing']['suffix']) ? $_POST['billing']['suffix'] : '')\n\t\t\t\t\t\t\t->setDob(isset($_POST['dob']) ? $_POST['dob'] : '')\n\t\t\t\t\t\t\t->setTaxvat(isset($_POST['billing']['taxvat']) ? $_POST['billing']['taxvat'] : '')\n\t\t\t\t\t\t\t->setGender(isset($_POST['billing']['gender']) ? $_POST['billing']['gender'] : '')\n# 2021-05-26 Dmitry Fedyuk https://www.upwork.com/fl/mage2pro\n# @todo \"«empty password in vendor/magento/framework/Encryption/Encryptor.php on line 591»\n# on a quotecheckout/index/updateordermethod request\": https://github.com/canadasatellite-ca/site/issues/127\n\t\t\t\t\t\t\t->setPassword(isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '');\n\t\t\t\t\t\t// Set customer information to quote\n\t\t\t\t\t\t$quote->setCustomer($customer->getDataModel())->setPasswordHash($customer->getPasswordHash());\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Save billing address\n\t\tif ($this->getRequest()->isPost()) {\n\t\t\t$billingData = $this->_dataHelper->filterdata(\n\t\t\t\t$this->getRequest()->getPost('billing', []),\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ($isLoggedIn) {\n\t\t\t\t$this->saveAddress('billing', $billingData);\n\t\t\t}\n\t\t\t$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);\n\t\t\tif ($this->getRequest()->getPost('billing_address_id') != \"\"\n\t\t\t\t&& (!isset($billingData['save_in_address_book'])\n\t\t\t\t\t|| (isset($billingData['save_in_address_book']) && $billingData['save_in_address_book']) == 0)\n\t\t\t) {\n\t\t\t\t$customerAddressId = \"\";\n\t\t\t}\n\t\t\tif ($isLoggedIn\n\t\t\t\t&& (isset($billingData['save_in_address_book']) && $billingData['save_in_address_book'] == 1)\n\t\t\t\t&& !$this->_dataHelper->getStoreConfig('onestepcheckout/addfield/addressbook')\n\t\t\t) {\n\t\t\t\t$customerAddressId = $this->getDefaultAddress('billing');\n\t\t\t}\n\t\t\tif (isset($billingData['email'])) {\n\t\t\t\t$billingData['email'] = trim($billingData['email']);\n\t\t\t\tif ($this->_dataHelper->isSubscriberByEmail($billingData['email'])) {\n\t\t\t\t\tif ($this->getRequest()->getParam('subscribe_newsletter') == '1') {\n\t\t\t\t\t\tif ($isLoggedIn) {\n\t\t\t\t\t\t\t$customer = $this->_customerSession->getCustomer();\n\t\t\t\t\t\t\t$this->_objectManager->get(\n\t\t\t\t\t\t\t\t'Magento\\Newsletter\\Model\\SubscriberFactory'\n\t\t\t\t\t\t\t)->create()->subscribeCustomerById($customer->getId());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->saveSubscriber($billingData['email']);\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$address = $this->_objectManager->get('Magento\\Quote\\Model\\Quote\\Address');\n\t\t\tif ($customerAddressId) {\n\t\t\t\t$addressData = $this->_objectManager->get('Magento\\Customer\\Api\\AddressRepositoryInterface')\n\t\t\t\t\t->getById($customerAddressId)\n\t\t\t\t\t->__toArray();\n\t\t\t\t$billingData = array_merge($billingData, $addressData);\n\t\t\t}\n\t\t\t$address->setData($billingData);\n\t\t\t$this->getOnepage()->getQuote()->setBillingAddress($address);\n\t\t\tif (isset($billingData['save_into_account'])\n\t\t\t\t&& intval($billingData['save_into_account']) == 1\n\t\t\t\t&& $isLoggedIn\n\t\t\t) {\n\t\t\t\t$this->setAccountInfoSession($billingData);\n\t\t\t}\n\t\t}\n\t\t// Save shipping address\n\t\t$isclick = $this->getRequest()->getPost('ship_to_same_address');\n\t\t$ship = \"billing\";\n\t\tif ($isclick != '1') {\n\t\t\t$ship = \"shipping\";\n\t\t}\n\t\tif ($this->getRequest()->getPost()) {\n\t\t\t$shippingData = $this->_dataHelper->filterdata($this->getRequest()->getPost($ship, []), false);\n\t\t\tif ($isLoggedIn && !$isclick) {\n\t\t\t\t$this->saveAddress('shipping', $shippingData);\n\t\t\t}\n\t\t\tif ($isclick == '1') {\n\t\t\t\t$shippingData['same_as_billing'] = 1;\n\t\t\t}\n\t\t\t// Change address if user change infomation\n\t\t\t// Reassign customeraddressid and save to shipping\n\t\t\t$customeraddressid = $this->getRequest()->getPost($ship . '_address_id', false);\n\t\t\t// If user chage shipping, billing infomation but not save to database\n\t\t\tif ($isclick || ($this->getRequest()->getPost('shipping_address_id') != \"\"\n\t\t\t\t\t&& (!isset($shippingData['save_in_address_book']) || (isset($shippingData['save_in_address_book']) && $shippingData['save_in_address_book'] == 0)))\n\t\t\t) {\n\t\t\t\t$customeraddressid = \"\";\n\t\t\t}\n\t\t\tif (!$isclick && $isLoggedIn\n\t\t\t\t&& (isset($shippingData['save_in_address_book']) && $shippingData['save_in_address_book'] == 1)\n\t\t\t\t&& !$this->_dataHelper->getStoreConfig('onestepcheckout/addfield/addressbook')\n\t\t\t) {\n\t\t\t\t$customeraddressid = $this->getDefaultAddress('shipping');\n\t\t\t}\n\t\t\t$this->getOnepage()->saveShipping($shippingData, $customeraddressid);\n\t\t}\n\t\tif ($customer_note = $this->getRequest()->getPost('onestepcheckout_comments')) {\n\t\t\t$quote->setCustomerNote($customer_note);\n\t\t}\n\t\tif ($this->getRequest()->isPost()) {\n\t\t\t$shippingMethodData = $this->getRequest()->getPost('shipping_method', '');\n\t\t\t$resultSaveShippingMethod = $this->getOnepage()->saveShippingMethod($shippingMethodData);\n\t\t\tif (!$resultSaveShippingMethod) {\n\t\t\t\t$eventManager = $this->_objectManager->get('Magento\\Framework\\Event\\ManagerInterface');\n\t\t\t\t$eventManager->dispatch('checkout_controller_onepage_save_shipping_method', [\n\t\t\t\t\t'request' => $this->getRequest(),\n\t\t\t\t\t'quote' => $this->getOnepage()->getQuote()\n\t\t\t\t]);\n\t\t\t}\n\t\t\t$this->getOnepage()->getQuote()->collectTotals();\n\t\t}\n\t\t$result = new \\Magento\\Framework\\DataObject();\n\t\ttry {\n\t\t\tif (!$quote->getCustomerId() && !$guest) {\n\t\t\t\tdf_quote_customer_m()->populateCustomerInfo($quote);\n\t\t\t}\n\t\t\t$quote->setIsActive(false);\n\t\t\t$cQuote = df_new_om(CQuote::class); /** @var CQuote $cQuote */\n\t\t\t$quotation = $cQuote->create($quote)->load($quote->getId());\n\t\t\t$cHelper = df_o(CHelper::class); /** @var CHelper $cHelper */\n\t\t\t$isAutoProposalEnabled = $cHelper->isAutoConfirmProposalEnabled();\n\t\t\t$qtyBreak = false;\n\t\t\t$price = true;\n\t\t\t$totalItems = 0;\n\t\t\tforeach ($quote->getAllItems() as $item) {\n\t\t\t\tif (!$item->getParentItemId()) {\n\t\t\t\t\t$totalItems++;\n\t\t\t\t\tif ($item->getQty() > 1) {\n\t\t\t\t\t\t$qtyBreak = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($item->getProduct()->getFinalPrice() == 0 || $item->getProduct()->getPrice() == 0) {\n\t\t\t\t\t\t$price = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($quote->getCustomerNote() || $qtyBreak || !$price || $totalItems > 1) {\n\t\t\t\t$isAutoProposalEnabled = false;\n\t\t\t}\n\t\t\tif ($isAutoProposalEnabled) {\n\t\t\t\t$quotation->setProposalSent((new \\DateTime())->getTimestamp());\n\t\t\t\t$quotation->setState(\\Cart2Quote\\Quotation\\Model\\Quote\\Status::STATE_PENDING)\n\t\t\t\t\t->setStatus(\\Cart2Quote\\Quotation\\Model\\Quote\\Status::STATUS_AUTO_PROPOSAL_SENT);\n\t\t\t\t$qProposalSender = df_o(QuoteProposalSender::class); /** @var QuoteProposalSender $qProposalSender */\n\t\t\t\t$qProposalSender->send($quotation);\n\t\t\t\t$quotation->save();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$qRequestSender = df_o(QuoteRequestSender::class); /** @var QuoteRequestSender $qRequestSender */\n\t\t\t\t$qRequestSender->send($quotation, false);\n\t\t\t}\n\t\t\tif (true || $this->getRequest()->getParam('clear_quote', false)) {\n\t\t\t\t$qs = df_o(CSession::class); /** @var CSession $qs */\n\t\t\t\t$qs->fullSessionClear();\n\t\t\t\t$qs->updateLastQuote($quotation);\n\t\t\t}\n\t\t\t$redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();\n\t\t\t$result->setData('success', true);\n\t\t\t$result->setData('error', false);\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\t$data = ['error' => 1, 'msg' => $e->getMessage(),];\n\t\t\t$reloadcheckoutpage = $quote->getData('reloadcheckoutpage');\n\t\t\tif ($reloadcheckoutpage) {\n\t\t\t\t$data['redirect'] = $this->_url->getUrl('checkout');\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t\texit;\n\t\t}\n\t\tif (isset($redirectUrl)) {\n\t\t\t$result->setData('redirect', $redirectUrl);\n\t\t}\n\t\t$this->_eventManager->dispatch('checkout_controller_onepage_saveOrder', ['result' => $result, 'action' => $this]);\n\t\tif (isset($redirectUrl)) {\n\t\t\techo json_encode([\n\t\t\t\t'error' => 0,\n\t\t\t\t'msg' => '',\n\t\t\t\t'redirect' => $redirectUrl\n\t\t\t]);\n\t\t\texit;\n\t\t}\n\t\techo json_encode([\n\t\t\t'error' => 0,\n\t\t\t'msg' => '',\n\t\t\t'redirect' => $this->_url->getUrl('quotation/quote/success', array('id' => $quote->getId()))\n\t\t]);\n\t\texit;\n\t\treturn;\n\t}", "public function edit(Quote $quote)\n {\n //\n }", "public function edit(Quote $quote)\n {\n //\n }", "public function editQuote($quoteId){\n $sql = \"SELECT quotes.id, quotes.dt, quotes.content, users.firstname, users.lastname, author.author, genre1.genre1, genre2.genre2, genre3.genre3\n FROM quotes\n INNER JOIN users ON quotes.user=users.id\n INNER JOIN author ON quotes.author= author.id\n INNER JOIN genre1 ON quotes.genre1=genre1.id\n INNER JOIN genre2 ON quotes.genre2=genre2.id\n INNER JOIN genre3 ON quotes.genre3=genre3.id\n WHERE quotes.id = '$quoteId'\";\n\n $query = mysqli_query($this->con, $sql);\n $query = mysqli_fetch_array($query);\n return $query;\n }", "public function isToQuoteAllowed($quote)\n {\n $showMessageNotLoggedIn = $this->showMessageNotLoggedIn();\n if ($showMessageNotLoggedIn && ($quote->getCustomerGroupId() == GroupInterface::NOT_LOGGED_IN_ID)) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __('Login to request a Quote')\n );\n }\n\n foreach ($quote->getAllVisibleItems() as $item) {\n //if dynamic add buttons enabled and product type is configurable, check the child item\n if ($this->isDynamicAddButtonsEnabled()\n && $item->getProductType() == \\Magento\\ConfigurableProduct\\Model\\Product\\Type\\Configurable::TYPE_CODE) {\n $children = $item->getChildren();\n if (!empty($children) && is_array($children) && isset($children[0])) {\n $childItem = $children[0];\n if ($childItem instanceof \\Magento\\Quote\\Model\\Quote\\Item) {\n //overwrite the configurable item with the child item\n $item = $childItem;\n }\n }\n }\n\n if (!$this->isQuotable($item->getProduct(), $quote->getCustomerGroupId())) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __(\n 'Quotes are not available for %1. Please remove item from your cart and try again.',\n $item->getName()\n )\n );\n }\n }\n\n return true;\n }", "public function fetchRandomQuote()\n {\n try {\n $offset = rand(0, 5000);\n $endpoint = self::BASE_RANDOM_QUOTE_ENDPOINT . $offset;\n $apikey = strtr(\"Token apikey\", [\n 'apikey' => config('paper_quotes_api_key'),\n ]);\n\n $response = $this->client->get($endpoint, [\n 'headers' => [\n 'Authorization' => $apikey,\n ]\n ])->getBody();\n\n $data = json_decode($response);\n $message = strtr('_quote (by _author with _like like(s)).', [\n '_quote' => $data->results[0]->quote,\n '_author' => $data->results[0]->author === \"\" ? \"Anonymous\" : $data->results[0]->author,\n '_like' => $data->results[0]->likes,\n ]);\n\n return $message;\n } catch (Exception $exception) {\n return \"Error! Please try again\";\n }\n }", "function weeklyQuotesAction(){\n\t\t\n\t\t\n\t\t$request=$this->_request->getParams();\n\t\t\n\t\t\n\t\t\t $quotecron_obj = new Ep_Quote_Cron();\n\t\t\t $quotes=$quotecron_obj->getweeklyquotes();\n\t\t\t $quoteDetails=array();\n\t\t\t $quoteslern=array();\n\t\t\t $quotesusertotal=array();\n\t\t\t $date7day = date('Y-m-d H:i:s',time()-(7*86400));\n\t\t\t\t\t\t$html=\"<table class='table-bordered table-hover'>\";\n\t\t\t\t\t\tif(count($quotes)>0){\n\t\t\t\t\t\t\t\t\t\t $quotetotal=0;\n\t\t\t\t\t\t\t\t\t\t $turnover=0;\n\t\t\t\t\t\t\t\t\t\t $signature=0;\n\t\t\t\t\t\t\t\t\t\t $i=0;\n\t\t\t\t\t\t\t\t\t\t $usertotal=1;\n\t\t\t\t\t\t\t\tforeach($quotes as $quotescheck){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(($quotescheck['created_at']>=$date7day && $quotescheck['created_at']<=date('Y-m-d') )&& ($quotescheck['sales_review']=='not_done' || $quotescheck['sales_review']=='challenged' || $quotescheck['sales_review']=='to_be_approve') ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quotetotal++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$turnover+=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$signature+=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['identifier']=$quotescheck['identifier'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$mrgin=explode('.',$quotescheck['sales_margin_percentage']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['company_name']=$quotescheck['company_name'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['bosalesuser']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\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\t\t$quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['status']='Ongoing';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($quotescheck['seo_timeline']<time() && $quotescheck['seo_timeline']!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team= 'Seo ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telseif($quotescheck['tech_timeline']<time() && $quotescheck['tech_timeline']!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team= 'Tech ';\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telseif($quotescheck['prod_timeline']<time() && $quotescheck['prod_timeline']!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team= 'Prod ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['team']=$team;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($quotescheck['response_time']>time()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['notiontime']='Late No';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['notiontime']='Late Yes';\n\t\t\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\t\t $quoteslern[$i]['quote_by']=$quotescheck['quote_by'];\n\t\t\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\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif($quotescheck['sales_review']=='closed' && $quotescheck['closed_reason']!='quote_permanently_lost' && $quotescheck['releaceraction']!=''){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quotetotal++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$turnover+=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$signature+=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['identifier']=$quotescheck['identifier'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$mrgin=explode('.',$quotescheck['sales_margin_percentage']);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['company_name']=utf8_decode($quotescheck['company_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['status']='A relancer';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['team']='Relanc&#233;';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*$validate_date= new DateTime($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days= $validate_date->diff(new DateTime(date(\"Y-m-d H:i:s\")));*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days=dateDiff($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at'],date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['notiontime']='Quote sent '.$sent_days.' on days ago';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['comments']='closed on '.$quotescheck['releaceraction'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['quote_by']=$quotescheck['quote_by'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif($quotescheck['sales_review'] == 'validated' && $quotescheck['validateaction']!=\"\" ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quotetotal++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $turnover+=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $signature+=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['identifier']=$quotescheck['identifier'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $mrgin=explode('.',$quotescheck['sales_margin_percentage']);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['company_name']=utf8_decode($quotescheck['company_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['quote_by']=$quotescheck['quote_by'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['status']='Sent';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t /*$sent_days= $validate_date->diff(new DateTime(date(\"Y-m-d H:i:s\")));*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days=dateDiff($quotescheck['validateaction'], date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['notiontime']='Quote sent '.$sent_days.' on days ago';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['comments']='closed on '.$quotescheck['validateaction'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['team']='/';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif($quotescheck['sales_review'] == 'closed' && ($quotescheck['closed_reason']=='quote_permanently_lost' || $quotescheck['closeaction']!=\"\" || $quotescheck['close5dayaction']!=\"\" || $quotescheck['close20dayaction']!=\"\" || $quotescheck['close30dayaction']!=\"\") ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $mrgin=explode('.',$quotescheck['sales_margin_percentage']);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['identifier']=$quotescheck['identifier'];\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['company_name']=utf8_decode($quotescheck['company_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['status']='Closed';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* $validate_date= new DateTime($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days= $validate_date->diff(new DateTime(date(\"Y-m-d H:i:s\")));*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days=dateDiff($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at'],date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['notiontime']='Quote sent '.$sent_days.' on days ago';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['comments']= $quotescheck['closed_comments'].'<br> closed on '.$quotescheck['closeaction'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['team']=$this->closedreason[$quotescheck['closed_reason']];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\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\t\t\t\t\t\n\t\t\t\t\t\t\t\t} // end foreach\n\t\t\t\t\t\t\t\t$quoteDetails['quotetotal']=$quotetotal;\n\t\t\t\t\t\t\t\t$quoteDetails['turnover']=$turnover;\n\t\t\t\t\t\t\t\t$quoteDetails['signature']=round($signature/$quotetotal);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $startdate = date('d',time()-(7*86400));\n\t\t\t\t\t\t\t\t\t $enddate= date('d-M-Y',strtotime(date('Y-m-d')));\n\t\t\t\t\t\t\t\t\t$statusdir =$_SERVER['DOCUMENT_ROOT'].\"/BO/quotes_weekly_report/\";\n\t\t\t\t\t\t\t\t\tif(!is_dir($statusdir))\n\t\t\t\t\t\t\t\t\tmkdir($statusdir,TRUE);\n\t\t\t\t\t\t\t\t\tchmod($statusdir,0777);\n\t\t\t\t\t\t\t\t\t$filename = $_SERVER['DOCUMENT_ROOT'].\"/BO/quotes_weekly_report/weekly-report-$startdate-to-$enddate.xlsx\";\n\t\t\t\t\t\t\t\t\t$htmltable = $this->QuotesTable($quoteDetails,$quoteslern);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//save excel file \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tchmod($filename,0777);\t\n\t\t\t\t\t\t\t\t\t$quoteDetails['startdate']=$startdate;\n\t\t\t\t\t\t\t\t\t$quoteDetails['enddate']=$enddate;\n\t\t\t\t\t\t\t\t\t$this->_view->weely_table_details=$quoteDetails;\n\t\t\t\t\t\t\t\t\t$this->_view->weely_table_quote=$quotes;\n\t\t\t\t\t\t\t\t\t$this->_view->filepath=$filename;\n\t\t\t\t\t\t\t\t\t$this->render('weekly-quotes');\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\tif($request['download']=='report'){\n\t\t\t\t\t\t\t\t\t$this->convertHtmltableToXlsx($htmltable,$filename,True);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->_redirect(\"/quote/download-document?type=weekly&filename=weekly-report-$startdate-to-$enddate.xlsx\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t } //end id\n\t\t\t\t\t\t\n\t\t\t \n\t\t\t}", "public function show(Quote $quote)\n {\n //\n }", "public function show(Quote $quote)\n {\n //\n }", "public function show(Quote $quote)\n {\n //\n }", "public function show(Quote $quote)\n {\n //\n }", "function deleteQuoteAction()\n\t{\n\t\t//if($this->_view->user_type == 'superadmin')\n\t\t//{\n\t\t\t$request = $this->_request->getParams();\n\t\t\t$quote_id = $request['quote_id'];\n\t\t\t$quote_obj = new Ep_Quote_Quotes();\n\t\t\t$update = array('sales_review'=>'deleted','deleted_at'=>date('Y-m-d H:i:s'),'deleted_by'=>$this->_view->userId);\n\t\t\t$quote_obj->updateQuote($update,$quote_id);\n\t\t\t$this->_redirect('/quote/sales-quotes-list?submenuId=ML13-SL2&active=deleted');\n\t\t//}\n\t\t//else\n\t\t//$this->_redirect('/quote/sales-quotes-list?submenuId=ML13-SL2');\n\t}", "public function suggestPurchaseRequest()\n {\n return Product::select(DB::raw('id, productName as prDescription, reorderAmount - amount as prQty,reorderAmount, \"Write a descriptive Purpose for this request\" as prPurpose'))\n ->whereRaw('amount < reorderAmount and amount > 0')->limit(env('PURCHASE_ORDER_LIMIT'))->get();\n }", "public function getQuote()\n\t{\n\t\treturn $this->quote;\n\t}", "function fastQuote_info() {\n global $lang;\n\n $lang->load('fastQuote');\n $lang->fastQuoteDesc = '<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" style=\"float:right;\">' .\n '<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">' . \n '<input type=\"hidden\" name=\"hosted_button_id\" value=\"3BTVZBUG6TMFQ\">' .\n '<input type=\"image\" src=\"https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">' .\n '<img alt=\"\" border=\"0\" src=\"https://www.paypalobjects.com/pl_PL/i/scr/pixel.gif\" width=\"1\" height=\"1\">' .\n '</form>' . $lang->fastQuoteDesc;\n\n return Array(\n 'name' => $lang->fastQuoteName,\n 'description' => $lang->fastQuoteDesc,\n 'website' => 'https://lukasztkacz.com',\n 'author' => 'Lukasz \"LukasAMD\" Tkacz',\n 'authorsite' => 'https://lukasztkacz.com',\n 'version' => '1.2.0',\n 'compatibility' => '18*',\n 'codename' => 'fast_quote'\n );\n}", "public function quote_request_success(){\n \t\t$catrelatedproducts = $catrelatedproducts = '';\n \t\t$catid = $_GET['catid'];\n \t\t$pids = $_GET['pid'];\n \t\tif ($catid) {\n \t\t\t$catrelatedproducts = $this->getRelatedProducts( $catid);\n \t\t\t$quote_related_products['catrelatedproducts']['data'] = $catrelatedproducts;\n \t\t\t$selectedterm = \\Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($catid);\n \t\t\t$quote_related_products['catrelatedproducts']['selected_cat'] = $selectedterm->label();\n \t\t}\n \t\telseif($pids){\n\t\t\t$relatedproducts = $this->relatedproducts( $pids);\n\t\t\t$product_nodequery = \\Drupal::database()->select('node_field_data', 'nfd');\n\t\t\t$product_nodequery->fields('nfd', array('title'));\n\t\t\t$product_nodequery->condition('nfd.nid', $pids, 'IN');\n\t\t\t$product_nodequery->condition('nfd.status', 1);\n\t\t\t$product_nodequery->condition('nfd.type', 'products');\n\t\t\t$selected_productdata = $product_nodequery->execute()->fetchAll();\n\t\t\t$quote_related_products['relatedproducts']['selected_products'] = $selected_productdata;\n\t\t\t$quote_related_products['relatedproducts']['data'] = $relatedproducts;\n \t\t}\n \t\treturn array(\n\t '#theme' => 'thanks_template',//'quote_request_thanks',\n\t '#quote_related_products' => $quote_related_products,\n\t );\n\n \t}", "public function quote($params)\n { \n return $this->request(Resource::RESOURCE_QUOTE,$params);\n }", "public function getQuote() {\n return $this->quote;\n }", "static public function quote()\n {\n $jiekou = Jiekou::where(['id'=>2])->first();\n while (1){\n $response = Curl::to($jiekou->url)\n ->get();\n $obj_xml = simplexml_load_string($response);\n $items = $obj_xml->Body->Deliver;\n if (!$obj_xml->Body->Deliver){\n break;\n } else {\n $jiekou->updated_at = \\Carbon\\Carbon::createFromTimeStamp(time(), 'Asia/Shanghai')->toDateTimeString();\n $jiekou->save();\n foreach($items as $item) {\n $sms = new Smss();\n $sms->jiekouid = $jiekou->id;\n $sms->caller = $item->Caller;\n $sms->msg = urldecode($item->Msg);\n $sms->deliverdate = str_replace(\"/\",\"-\",$item->DeliverDate);\n $sms->save();\n }\n }\n }\n }", "private function send_products_to_quote(ck_quote $quote) {\n\t\tself::query_execute('INSERT INTO customer_quote_products (customer_quote_id, product_id, parent_products_id, option_type, price, quantity) SELECT :customer_quote_id, products_id, parent_products_id, option_type, IFNULL(quoted_price, unit_price), quantity FROM ck_cart_products WHERE cart_id = :cart_id', cardinality::NONE, [':customer_quote_id' => $quote->id(), ':cart_id' => $this->id()]);\n\t\tself::query_execute('DELETE FROM ck_cart_products WHERE cart_id = :cart_id', cardinality::NONE, [':cart_id' => $this->id()]);\n\t}", "function checkEditQuoteAction()\n\t{\t\n\t\tif($this->_request->isPost() && $_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest')\n\t\t{\n\t\t\t$request = $this->_request->getParams();\n\t\t\t$quote_id = $request['qid'];\n\t\t\t\n\t\t\tif($this->quote_creation->custom['quote_id']==\"\" || $quote_id==$this->quote_creation->custom['quote_id'])\n\t\t\techo false;\n\t\t\telse\n\t\t\techo true;\n\t\t}\n\t}", "public function addProduct(Request $request)\n {\n $user = auth()->user();\n $returnResult = [];\n $success = false;\n $today = date(\"Y-m-d\");\n if ($request->place) {\n if (!$request->quoteId) {\n $quote_number = DB::table('quotes')->max('quote_number');\n if ($quote_number === 0) {\n $org = \\App\\Organization::find($user->organization_id);\n $quote_number = --$org->quote_number;\n }\n\n $accountData = DB::table('accounts')\n ->select('accounts.id as account_id',\n 'record_types.tax')\n ->join('document_types', 'document_types.id', '=', 'accounts.document_type_id')\n ->join('record_types', 'record_types.id', '=', 'document_types.record_type_id')\n ->join('locations', 'locations.id', '=', 'accounts.location_id')\n ->join('users', 'users.id', '=', 'accounts.created_by_id')\n ->where('users.organization_id', $user->organization_id)\n ->where('locations.id', $user->locationId)\n ->where('quotes.id', $id)->first();\n\n $locationId = $request->locationId;\n $quote = new \\App\\Quote;\n $quote->account_id=$accountData->account_id;\n $quote->location_id=$locationId;\n $quote->quote_number=++$quote_number;\n $quote->aditional_detail=$request->aditional_detail;\n $quote->quote_date=$request->quote_date;\n $quote->tax=$accountData->tax;\n $quote->created_by_id=$user->id;\n $quote->stage_id=2;\n $quote->save();\n }\n $quoteId = $request->quoteId ? $request->quoteId : $quote->id;\n if ($quoteId) {\n\n $quoteItem= new \\App\\QuoteItem;\n $quoteUser = \\App\\Quote::find($quoteId)->users;\n $quote = \\App\\Quote::find($quoteId);\n if ($user->organization_id == $quoteUser->organization_id) {\n $quoteItem->quote_id=$quoteId;\n $quoteItem->product_id=$request->id;\n $quoteItem->quantity=$request->quantity;\n $quoteItem->description=$request->description;\n $quoteItem->place_id=$request->place;\n $quoteItem->category_id=$request->category;\n if ($request->price){\n $quoteItem->price=$request->price;\n }\n $quoteItem->package=0;\n if ($request->package === \"true\"){\n $quoteItem->package=1;\n \n $itemPackage = DB::table('quote_item_packages')\n ->where('quote_id', $quoteId)\n ->where('place_id', $request->place)\n ->where('category_id', $request->category)\n ->first();\n if (!$itemPackage) {\n $itemPackage = new \\App\\QuoteItemPackage;\n $itemPackage->quote_id=$quoteId;\n $itemPackage->place_id=$request->place;\n $itemPackage->category_id=$request->category;\n // $itemPackage->created_at = date('Y-m-d H:i:s');\n // $itemPackage->updated_at = date('Y-m-d H:i:s');\n $itemPackage->value=0;\n $itemPackage->save();\n }\n } else {\n if ($request->optional === \"true\" || $request->offer === \"true\"){\n if ($request->other) {\n $quoteItem->other = 0;\n }\n } else {\n $quoteItem->other=$request->other !== null ? $request->other : 0;\n }\n if ($request->optional === \"true\"){\n $quoteItem->optional=1;\n } else {\n $quoteItem->optional=0;\n }\n if ($request->offer === \"true\"){\n $quoteItem->offer=1;\n } else {\n $quoteItem->offer=0;\n }\n }\n if ($quote->stage_id === 2 && $quoteItem->save()) {\n $quote->aditional_detail=$request->aditional_detail;\n $quote->quote_date=$request->quote_date;\n $quote->updated_at=date('Y-m-d H:i:s');\n $quote->save();\n\n // $product = DB::table('categories')\n // ->select('categories.id')\n // ->join('places',\n // 'places.category_id', '=', 'categories.id')\n // ->join('users', 'users.id', '=', 'categories.created_by_id')\n // ->limit(1)\n // ->where('places.id', $request->place)\n // ->where('users.organization_id', $user->organization_id)->get();\n \\App\\QuoteItemCategory::updateOrCreate(\n ['quote_id' => $quoteId, 'category_id' => $request->category],\n ['description' => $request->descripcionCat]\n );\n $returnResult = $this->QuoteDetail($quoteItem->quote_id);\n $returnResult['quoteId'] = $quoteId;\n $success = true;\n } else {\n $returnResult['message'] = 'Error while adding item, please contact your administrator';\n }\n } else {\n $returnResult['message'] = 'You have no permissions on this record';\n }\n } else {\n $returnResult['message'] = 'Error while saving record, please contact your administrator';\n }\n } else {\n $returnResult['message'] = 'Debe seleccionar un lugar';\n }\n return response()->json(array('success' => $success, 'data'=>$returnResult));\n }", "function deleteQuotePermenentAction()\n\t{\n\t\t\t$request = $this->_request->getParams();\n\t\t\t$quote_id = $request['quote_id'];\n\t\t\t$quote_obj = new Ep_Quote_Quotes();\n\t\t\t\n\t\t\t$quote_obj->deleteQuote($quote_id);\n\t\t\t$this->_redirect('/quote/sales-quotes-list?submenuId=ML13-SL2&active=deleted');\n\t}", "protected function getStatusQuote()\n {\n //based on the status of the user return a quote\n switch ($this->status) {\n case 'Junior Evangelist':\n return \"Junior Evangelist: Real knowledge is to know the extent of one's ignorance\";\n case 'Associate Evangelist':\n return 'Associate Evangelist: You have come far, but your journey is not yet near end, fight harder';\n case 'Senior Evangelist':\n return 'Senior Evangelist: Coffee price increased because of you, mighty and powerful :(';\n default:\n return 'You have no place yet on the aisle where Legends of debugging stand, fight brave and harder';\n }\n }", "function loadQuotationToWishlist($qid)\n {\n \t$result = $this->query(\"SELECT * FROM `\".$this->tblPrefix.$this->table.\"` WHERE client_id='\".$this->logUser.\"' and id='\".$qid.\"'\");\n\t$arr = $this->toArray($result[0]['content']) ;\n if($arr)\n {\n foreach ($arr as &$value) {\n $tostringarr[$n][0] = \t$value['id'];\n $tostringarr[$n][1] = \t$value['qty'];\n $n++;\n }\n $str = $this->toString($tostringarr);\n \n // Create the Quotation\n // Updated by Saliya Wijesinghe\n $thisTime=time();\n $thisQuoteId=\"RE:\".$result[0]['quotationid'];\n $this->query(\"INSERT INTO`\".$this->tblPrefix.$this->table.\"` (client_id,quotationid,title,content,amount,moddate,himage,cdetails,othertxt,status)\n VALUES ('\".$this->logUser.\"', '\".$thisQuoteId.\"', '\".$result[0]['title'].\"','\".$result[0]['content'].\"','\".$result[0]['amount'].\"',\n '\".$thisTime.\"','\".$result[0]['himage'].\"','\".$result[0]['cdetails'].\"','\".$result[0]['othertxt'].\"','open')\");\n\n // GetThe added record\n $newQuote = $this->query(\"SELECT id FROM `\".$this->tblPrefix.$this->table.\"` WHERE client_id='\".$this->logUser.\"' AND moddate='\".$thisTime.\"' AND content='\".$result[0]['content'].\"' AND quotationid='\".$thisQuoteId.\"'\");\n // Update the Wish list\n $result = $this->query(\"UPDATE `\".$this->tblPrefix.\"sys_support` SET content_wlist='\".$str.\"',wish_quote_link='\".$newQuote[0]['id'].\"' WHERE client_id='\".$this->logUser.\"'\");\n\n if($result) return $msg = array('SUC','QUOTE_RE_CREATED');\n \n }\n\t \t \n }", "public function getQuoteId();", "private function getQuoteId()\n {\n $this->quoteId = $this->getRequest()->getParam('quoteId');\n if ($this->quoteId == '') {\n throw new \\Exception(self::CC_NO_QUOTE);\n }\n }", "protected function addQuotes()\n {\n foreach ($this->data->Quotes as &$quote) {\n foreach (['OutboundLeg', 'InboundLeg'] as $leg) {\n if (isset($quote->$leg)) {\n foreach ($quote->$leg->CarrierIds as $key => $carrierId) {\n $carrier = $this->arraySearch($carrierId, $this->data->Carriers, 'CarrierId');\n $quote->Carriers[] = $this->data->Carriers[$carrier];\n }\n if ($this->flattenSingleCarrier === true && \\count($quote->$leg->CarrierIds) === 1) {\n $quote->Carrier = $quote->Carriers[0];\n unset($quote->Carriers);\n }\n foreach (['Origin' => 'OriginId', 'Destination' => 'DestinationId'] as $variable => $search) {\n $place = $this->arraySearch($quote->$leg->$search, $this->data->Places, 'PlaceId');\n $quote->$variable = $this->data->Places[$place];\n }\n }\n if ($this->removeIds === true) {\n unset($quote->$leg->CarrierIds, $quote->$leg->OriginId, $quote->$leg->DestinationId);\n }\n }\n }\n return $this->data->Quotes;\n }", "function editQuoteFinalStepAction()\n\t{\n\t\tif($_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest')\n\t\t{\n\t\t\t$quote_id=$this->_request->getParam('quote_id');\n\n\t\t\tif($quote_id)\n\t\t\t{\n\t\t\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t\t\t$quoteDetails=$quoteObj->getQuoteDetails($quote_id);\n\t\t\t\tif($quoteDetails)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t//Quote documents added to sesssion\n\t\t\t\t\t$files = \"\";\n\t\t\t\t\t$documents_path = explode(\"|\",$quoteDetails[0]['documents_path']);\n\t\t\t\t\t$documents_name = explode(\"|\",$quoteDetails[0]['documents_name']);\n\t\t\t\t\t$k =0;\n\t\t\t\t\tforeach($documents_path as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(file_exists($this->quote_documents_path.$documents_path[$k]) && !is_dir($this->quote_documents_path.$documents_path[$k]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$files .= '<div class=\"topset2\"><a href=\"/quote/download-document?type=quote&quote_id='.$quote_id.'&index='.$k.'\">'.utf8_encode($documents_name[$k]).'</a><span class=\"delete\" rel=\"'.$k.'_'.$quote_id.'\"> <i class=\"splashy-error_x\"></i></span> </div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\t\t\t\t\t$quoteDetails[0]['documents'] = $files;\n\n\n\t\t\t\t\t$this->_view->send_quote=$quoteDetails[0];\n\t\t\t\t\t$this->render(\"popup-edit-finalstep-details\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function request_quote()\n {\n if (Auth::guest()) {\n return redirect('/');\n }\n\n $vendorDetail = DB::table('vendors as vend')\n ->join('vendor_approvals as vap','vend.id','=','vap.vendor_id')\n ->where('vap.vendor_status','1')\n ->pluck('vend.name_of_firm', 'vend.id')\n ->toArray();\n\n $data['vendorDetail'] = $vendorDetail;\n return view('purchaseorder.request_quote', $data);\n }", "public function get_quotes() \n\t{\n\t\treturn $this->db->select('price')\n\t\t->from('investroom_system_quotes')\n\t\t->limit(6)\n\t\t->order_by('id', 'DESC')\t\n\t\t->get()->result();\n\t}", "public function setQuoteId($id);", "function get_quotes($id, $cur_tab_id, $rel_tab_id, $actions=false) {\n\t\tglobal $log, $singlepane_view,$currentModule,$current_user;\n\t\t$log->debug(\"Entering get_quotes(\".$id.\") method ...\");\n\t\t$this_module = $currentModule;\n\n $related_module = vtlib_getModuleNameById($rel_tab_id);\n\t\trequire_once(\"modules/$related_module/$related_module.php\");\n\t\t$other = new $related_module();\n vtlib_setup_modulevars($related_module, $other);\n\t\t$singular_modname = vtlib_toSingular($related_module);\n\n\t\t$parenttab = getParentTab();\n\n\t\tif($singlepane_view == 'true')\n\t\t\t$returnset = '&return_module='.$this_module.'&return_action=DetailView&return_id='.$id;\n\t\telse\n\t\t\t$returnset = '&return_module='.$this_module.'&return_action=CallRelatedList&return_id='.$id;\n\n\t\t$button = '';\n\n\t\tif($actions && getFieldVisibilityPermission($related_module, $current_user->id, 'contact_id', 'readwrite') == '0') {\n\t\t\tif(is_string($actions)) $actions = explode(',', strtoupper($actions));\n\t\t\tif(in_array('SELECT', $actions) && isPermitted($related_module,4, '') == 'yes') {\n\t\t\t\t$button .= \"<input title='\".getTranslatedString('LBL_SELECT').\" \". getTranslatedString($related_module). \"' class='crmbutton small edit' type='button' onclick=\\\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id&parenttab=$parenttab','test','width=640,height=602,resizable=0,scrollbars=0');\\\" value='\". getTranslatedString('LBL_SELECT'). \" \" . getTranslatedString($related_module) .\"'>&nbsp;\";\n\t\t\t}\n\t\t\tif(in_array('ADD', $actions) && isPermitted($related_module,1, '') == 'yes') {\n\t\t\t\t$button .= \"<input title='\".getTranslatedString('LBL_ADD_NEW'). \" \". getTranslatedString($singular_modname) .\"' class='crmbutton small create'\" .\n\t\t\t\t\t\" onclick='this.form.action.value=\\\"EditView\\\";this.form.module.value=\\\"$related_module\\\"' type='submit' name='button'\" .\n\t\t\t\t\t\" value='\". getTranslatedString('LBL_ADD_NEW'). \" \" . getTranslatedString($singular_modname) .\"'>&nbsp;\";\n\t\t\t}\n\t\t}\n\n\t\t$userNameSql = getSqlForNameInDisplayFormat(array('first_name'=>\n\t\t\t\t\t\t\t'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');\n\t\t$query = \"select case when (vtiger_users.user_name not like '') then $userNameSql else vtiger_groups.groupname end as user_name,vtiger_crmentity.*, vtiger_quotes.*,vtiger_potential.potentialname,vtiger_contactdetails.lastname,vtiger_account.accountname from vtiger_quotes inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_quotes.contactid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_quotes.potentialid left join vtiger_account on vtiger_account.accountid = vtiger_quotes.accountid LEFT JOIN vtiger_quotescf ON vtiger_quotescf.quoteid = vtiger_quotes.quoteid LEFT JOIN vtiger_quotesbillads ON vtiger_quotesbillads.quotebilladdressid = vtiger_quotes.quoteid LEFT JOIN vtiger_quotesshipads ON vtiger_quotesshipads.quoteshipaddressid = vtiger_quotes.quoteid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 and vtiger_contactdetails.contactid=\".$id;\n\n\t\t$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);\n\n\t\tif($return_value == null) $return_value = Array();\n\t\t$return_value['CUSTOM_BUTTON'] = $button;\n\n\t\t$log->debug(\"Exiting get_quotes method ...\");\n\t\treturn $return_value;\n\t }", "public function fetchRandomQuote()\n {\n $idArray = $this->fetchQuoteId();\n // shuffle the array \n shuffle($idArray);\n $randomId = $idArray[0];\n return $this->fetchQuoteDetails($randomId);\n }", "public function quotes()\n {\n $user = auth()->user();\n $quotes = DB::table('quotes')\n ->select('quotes.account_id', 'quotes.created_by_id', 'quotes.id as quoteId', 'quotes.quote_date',\n 'accounts.name as accountName','users.name as userName','stages.name as stageName',\n 'locations.city','locations.address','quotes.stage_id',\n DB::raw(\"upper(quotes.quote_number) AS quote_number\"),\n 'accounts.document_number','document_types.name as documenttype')\n ->join('accounts', 'accounts.id', '=', 'quotes.account_id')\n ->join('document_types', 'document_types.id', '=', 'accounts.document_type_id')\n ->join('locations', 'locations.id', '=', 'quotes.location_id')\n ->join('stages', 'stages.id', '=', 'quotes.stage_id')\n ->join('users', 'users.id', '=', 'quotes.created_by_id')\n ->orderByRaw('quotes.updated_at DESC')\n ->where('users.organization_id', $user->organization_id)\n ->paginate(10);\n return view('quote.quotes',compact('quotes'));\n }", "public function canQuote(KCommandContext $context)\n\t{\n\t // Cloned so that the item we get doesn't get passed elsewhere\n\t $quoting = $this->getModel()->getState()->quote;\n\t if(!$quoting) return;\n\n $model = clone $this->getModel();\n\t $quote = $model->id($quoting)->getItem();\n\n\t // Set the text on our item\n\t $this->getModel()->getItem()->set('text', '[quote=\"'.htmlspecialchars($quote->display_name).'\"]'.$quote->text.'[/quote]');\n\t}", "function quotes($side = 1) # Browse quote library. MODAL\n\t{\n\t\t# \n\t\t# Get recommended quotes for product.\n\t\t$pid = $this->Session->read(\"Design.Product.product_type_id\");\n\n\t\tif(!empty($pid))\n\t\t{\n\t\t\t$productQuotes = $this->ProductQuote->find('all', array(\n\t\t\t\t'conditions'=>array('ProductQuote.product_type_id'=>$pid)\n\t\t\t));\n\t\t\t#echo \"PC($pid)=\".print_r($productQuotes,true);\n\t\t\t$this->set(\"productQuotes\", $productQuotes);\n\t\t}\n\n\t\t# Otherwise, get quote categories for browsing.\n\t\t$categories = $this->GalleryCategory->find('list', array(\n\t\t\t'conditions'=>\"GalleryCategory.parent_node = 1\",\n\t\t\t'fields'=>array('GalleryCategory.browse_node_id','GalleryCategory.browse_name'),\n\t\t\t'order'=>\"GalleryCategory.browse_name\")\n\t\t);\n\t\t$this->set(\"categories\", $categories);\n\n\t\t$maxLength = $this->Session->read(\"Design.Product.quote_limit\");\n\n\t\tif(!empty($this->data['Quote']['browse_node_id'])) # Browse cat.\n\t\t{\n\t\t\t# For now, make all one page, just make them scroll down...\n\n\t\t\t$category = $this->GalleryCategory->read(null, $this->data['Quote']['browse_node_id']);\n\n\t\t\t$kw = $category['GalleryCategory']['browse_name'];\n\n\t\t\t$browseQuotes = $this->Quote->findAll(array(\" (subjects LIKE '%$kw%') \" . ($maxLength > 0 ? \" AND (LENGTH(text)+LENGTH(attribution)) <= '$maxLength' \" : \"\")));\n\n\t\t\t$this->set(\"browseQuotes\", $browseQuotes);\n\t\t}\n\t\telse if(!empty($this->data['Quote']['keywords'])) # Search\n\t\t{\n\t\t\t# For now, make all one page, just make them scroll down...\n\n\t\t\t$keywords = split(\" \", mysql_escape_string($this->data['Quote']['keywords']));\n\n\t\t\t$keywhere = array();\n\t\t\tforeach($keywords as $kw)\n\t\t\t{\n\t\t\t\t$keywhere[] = \"CONCAT(text,attribution,subjects) LIKE '%$kw%'\";\n\t\t\t}\n\t\t\t$keyword_where = join(\" AND \", $keywhere);\n\t\t\t$searchQuotes = $this->paginate('Quote', array( \" ($keyword_where) \" . ($maxLength > 0 ? \" AND (LENGTH(text)+LENGTH(attribution)) <= '$maxLength' \" : \"\")) );\n\n\t\t\t$this->set(\"searchQuotes\", $searchQuotes);\n\n\t\t}\n\n\t\t$this->set(\"side\", $side); # So we know where to inject results.\n\n\t}", "public function quotationDetails_get() {\n $sub_quotationID = $_GET['sub_quotationID'];\n $result = $this->Enquiry_model->getQuotation_details($sub_quotationID);\n return $this->response($result);\n }", "private function sellTrasactionAddsMoney(){\n\n }", "public function quoteAddEquipmentAction()\n {\n \t$this->_helper->layout()->disableLayout();\n \t\n \t$quoteId = $this->_request->getParam('quoteId', null);\n \t\n \tif (empty($quoteId)) {\n \t\techo 'Invalid request: no quote selected'; exit;\n \t}\n \t\n \t$db = Zend_Registry::get('db');\n \t\n \tif ($this->_request->isPost()) {\n \t\t$params = $this->_request->getParams();\n \t\tif (!empty($params['type'])) {\n \t\t\tif (!in_array($params['type'], array('table', 'service'))) {\n \t\t\t\techo 'Invalid equipment type';\n \t\t\t\texit;\n \t\t\t}\n \t\t\t\n \t\t\t$dbData = array();\n \t\t\t// same fields for both types\n \t\t\tif (empty($params['quantity'])) { echo 'You must enter the quantity'; exit; }\n \t\t\telseif (!preg_match('/^[0-9]+$/', $params['quantity'])) { echo 'Invalid quantity. Only numbers allowed'; exit; }\n \t\t\t$dbData['quantity'] = $params['quantity'];\n \t\t\t\n \t\t\tif ('table' == $params['type']) {\n \t\t\t\tif (empty($params['w_dealer'])) { echo 'You must choose with/without dealer'; exit; }\n \t\t\t\telseif (!in_array($params['w_dealer'], array('yes', 'no'))) { echo 'Invalid dealer option. Only \"yes\" or \"no\" allowed'; exit; }\n \t\t\t\t$dbData['extra'] = $params['w_dealer'];\n \t\t\t\t\n \t\t\t\tif (empty($params['pricet'])) { echo 'You must enter the table price'; exit; }\n\t \t\t\telse if (!preg_match('/^[0-9.]+$/', $params['pricet'])) { echo 'Invalid price. Only numbers and . separator allowed'; exit; }\n\t \t\t\t$dbData['price'] = MyLibs_Quote::myRound($params['pricet'], 2);\n\t \t\t\t\n\t \t\t\tif (empty($params['extra_hour_price'])) { $params['extra_hour_price'] = 0; }\n\t \t\t\telseif (!preg_match('/[0-9.]+/', $params['extra_hour_price'])) { echo 'Invalid extra hour price. Only numbers and . separator allowed'; exit; }\n\t \t\t\t$dbData['extra_hour_price'] = MyLibs_Quote::myRound($params['extra_hour_price'], 2);\n \t\t\t}\n \t\t\tif ('service' == $params['type']) {\n\t \t\t\tif (empty($params['hours'])) { $params['hours'] = 0; }\n\t \t\t\tif (!preg_match('/^[0-9.]+$/', $params['hours'])) { echo 'Invalid additional hours value. Only numbers allowed'; exit; }\n\t \t\t\t$dbData['extra'] = $params['hours'];\n\t \t\t\t\n\t \t\t\tif (empty($params['prices'])) { echo 'You must enter the service price'; exit; }\n\t \t\t\telse if (!preg_match('/^[0-9.]+$/', $params['prices'])) { echo 'Invalid price. Only numbers and . separator allowed'; exit; }\n\t \t\t\t$dbData['price'] = MyLibs_Quote::myRound($params['prices'], 2);\n \t\t\t}\n \t\t\t\n \t\t\tif (empty($params['id'])) { echo 'Invalid equipment item selected'; exit; }\n \t\t\t$dbData['equipment_id'] = $params['id'];\n \t\t\t\n \t\t\t// fetch the old equipments\n \t\t\t$currEquip = $db->fetchOne(\"SELECT equipment FROM quotes WHERE id = {$quoteId}\");\n \t\t\tif (empty($currEquip)) {\n \t\t\t\t$currEquipArr = array();\n \t\t\t} else {\n \t\t\t\t$currEquipArr = Zend_Json::decode($currEquip, true);\n \t\t\t}\n \t\t\t$currEquipArr[] = $dbData;\n \t\t\t$currEquipArr = array_values($currEquipArr);\n \t\t\t$newEquip = Zend_Json::encode($currEquipArr);\n \t\t\t$insertData = array('equipment' => $newEquip);\n \t\t\t\n \t\t\tif (!$db->update('quotes', $insertData, \"id = {$quoteId}\")) {\n \t\t\t\techo 'Could not add the equipment'; exit;\n \t\t\t}\n \t\t\techo 'OK'; exit;\n \t\t} else {\n \t\t\techo 'Invalid equipment type';\n \t\t\texit;\n \t\t}\n \t}\n \t\n \t// get the market id from the quote info\n \t$sql = \"SELECT details FROM quotes WHERE id = {$quoteId}\";\n \t$details = $db->fetchOne($sql);\n \tif (empty($details)) {\n \t\techo 'Invalid request: no quote info'; exit;\n \t}\n \t$detailsArr = Zend_Json::decode($details, true);\n \tif (!count($detailsArr)) {\n \t\techo 'Invalid request: no quote info'; exit;\n \t}\n \t$campusId = $detailsArr['campus_id'];\n \t\tif (empty($campusId)) {\n \t\techo 'Invalid request: no quote info'; exit;\n \t}\n \t// fetch tables\n \t$sql = \"SELECT id, name FROM equipments WHERE type='table' AND id IN (SELECT equipment_id FROM `campus-equipment` WHERE campus_id = {$campusId})\";\n \t$this->view->tables = $db->fetchPairs($sql);\n \t// fetch services\n \t$sql = \"SELECT id, name FROM equipments WHERE type='service' AND id IN (SELECT equipment_id FROM `campus-equipment` WHERE campus_id = {$campusId})\";\n \t$this->view->services = $db->fetchPairs($sql);\n \t\n \t$this->view->quoteId = $quoteId;\n }", "public function Get_quotationDetails_get(){\n extract($_GET);\n $club_id = $_GET['club_id'];\n $response = $this->QuotationForEnquiry_model->Get_quotationDetails($club_id);\n return $this->response($response);\n }", "public function getQuotationInfo_get(){\n extract($_GET);\n $quotation_id = $_GET['quotation_id'];\n $response = $this->QuotationForEnquiry_model->getQuotationInfo($quotation_id);\n return $this->response($response);\n }", "public function missionFollowupDetailsAction()\n\t{\n\t\tif($_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest')\n\t\t{\n\t\t\t$missionParams=$this->_request->getParams();\n\t\t\t$quote_id=$missionParams['quote_id'];\n\t\t\t$mission_type=$missionParams['type'];\n\t\t\t$request_verion = $missionParams['version'];\n\t\t\t\n\t\t\t$quote_obj = new Ep_Quote_Quotes();\n\t\t\t$res = $quote_obj->getQuoteDetails($quote_id);\n\t\t\t$current_version = $res[0]['version'];\n\t\t\t\n\t\t\tif($quote_id && $mission_type)\n\t\t\t{\n\t\t\t\tif($mission_type=='seo')\n\t\t\t\t{\n\t\t\t\t\t//getting seo mission details\t\t\t\n\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\t$searchParameters['misson_user_type']='seo';\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\tif($current_version==$request_verion)\n\t\t\t\t\t$seoMissionDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\t\t\telse\n\t\t\t\t\t$seoMissionDetails=$quoteMission_obj->getQuoteMissionVersionDetails($quote_id,$request_verion,'seo');\n\t\t\t\t\tif($seoMissionDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\t$s=0;\n\t\t\t\t\t\tforeach($seoMissionDetails as $mission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_name'] = $this->seo_product_array[$mission['product']];\n\n\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_source_name'] = $this->getLanguageName($mission['language_source']);\n\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_dest_name'] = $this->getLanguageName($mission['language_dest']);\n\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_type_name']=$this->producttype_array[$mission['product_type']];\n\n\t\t\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($mission['created_by']);\n\t\t\t\t\t\t\t$seoMissionDetails[$s]['seo_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\n\t\t\t\t\t\t\t$seoMissionDetails[$s]['comment_time']=time_ago($mission['created_at']);\n\n\n\t\t\t\t\t\t\t$seoMissionDetails[$s]['files'] = array();\n\t\t\t\t\t\t\t$seoMissionDetails[$s]['filenames'] = array();\n\t\t\t\t\t\t\tif($mission['documents_path'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* $exploded_file_paths = explode(\"|\",$mission['documents_path']);\n\t\t\t\t\t\t\t\t$exploded_file_names = explode(\"|\",$mission['documents_name']);\n\t\t\t\t\t\t\t\t$fccount = 0;\n\t\t\t\t\t\t\t\tforeach($exploded_file_paths as $row):\n\t\t\t\t\t\t\t\t\t$file_path=$this->mission_documents_path.$row;\n\t\t\t\t\t\t\t\t\tif(file_exists($file_path) && !is_dir($file_path))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['files'][]=$row;\n\t\t\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['files_base'][]=basename($row);\n\t\t\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['filenames'][]=$exploded_file_names[$fccount];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$fccount++;\n\t\t\t\t\t\t\t\tendforeach; */\n\t\t\t\t\t\t\t\t$filesarray = array('documents_path'=>$mission['documents_path'],'documents_name'=>$mission['documents_name'],'id'=>$mission['identifier'],'delete'=>false);\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['files'] = $this->getSeoFiles($filesarray);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$s++;\n\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t$this->_view->seoMissionDetails=$seoMissionDetails;\n\t\t\t\t\t\t$this->_view->mission_type='seo';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($mission_type=='tech')\n\t\t\t\t{\n\t\t\t\t\t//getting tech mission details\n\t\t\t\t\t$tech_obj=new Ep_Quote_TechMissions();\n\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\tif($current_version==$request_verion)\n\t\t\t\t\t$techMissionDetails=$tech_obj->getTechMissionDetails($searchParameters);\n\t\t\t\t\telse\n\t\t\t\t\t$techMissionDetails=$tech_obj->getQuoteVersionDetails($quote_id,$request_verion);\n\t\t\t\t\tif($techMissionDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\t$t=0;\n\t\t\t\t\t\tforeach($techMissionDetails as $mission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($mission['created_by']);\n\t\t\t\t\t\t\t$techMissionDetails[$t]['tech_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\n\t\t\t\t\t\t\t$techMissionDetails[$t]['comment_time']=time_ago($mission['created_at']);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$techMissionDetails[$t]['files'] = \"\";\n\t\t\t\t\t\t\tif($mission['documents_path'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* $exploded_file_paths = explode(\"|\",$mission['documents_path']);\n\t\t\t\t\t\t\t\t$exploded_file_names = explode(\"|\",$mission['documents_name']);\n\t\t\t\t\t\t\t\t$files = \"\";\n\t\t\t\t\t\t\t\t$k=0;\n\t\t\t\t\t\t\t\tforeach($exploded_file_paths as $row)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$file_path=$this->mission_documents_path.$row;\n\t\t\t\t\t\t\t\t\tif(file_exists($file_path) && !is_dir($file_path))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$fname = $exploded_file_names[$k];\n\t\t\t\t\t\t\t\t\t\t\tif($fname==\"\")\n\t\t\t\t\t\t\t\t\t\t\t\t$fname = basename($row);\n\t\t\t\t\t\t\t\t\t\t\t$files .= '<div class=\"topset2\"><a href=\"/quote/download-document?type=tech_mission&mission_id='.$mission['identifier'].'&index='.$k.'\">'.$fname.'</a></div>';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$k++;\n\t\t\t\t\t\t\t\t} */\n\t\t\t\t\t\t\t\t$filesarray = array('documents_path'=>$mission['documents_path'],'documents_name'=>$mission['documents_name'],'id'=>$mission['identifier'],'delete'=>false);\n\t\t\t\t\t\t\t\t$files = $this->getTechFiles($filesarray);\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['files'] = $files;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$t++;\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->_view->techMissionDetails=$techMissionDetails;\n\t\t\t\t\t\t$this->_view->mission_type='tech';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($mission_type=='prod')\n\t\t\t\t{\n\t\t\t\t\t//getting mission details\n\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\t$searchParameters['misson_user_type']='sales';\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\tif($current_version==$request_verion)\n\t\t\t\t\t$missonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\t\t\telse\n\t\t\t\t\t$missonDetails=$quoteMission_obj->getQuoteMissionVersionDetails($quote_id,$request_verion,'sales');\n\t\t\t\t\tif($missonDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\t$m=0;\n\t\t\t\t\t\tforeach($missonDetails as $mission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$missonDetails[$m]['product_name']=$this->product_array[$mission['product']];\t\t\t\n\t\t\t\t\t\t\t$missonDetails[$m]['language_source_name']=$this->getLanguageName($mission['language_source']);\n\t\t\t\t\t\t\t$missonDetails[$m]['product_type_name']=$this->producttype_array[$mission['product_type']];\n\t\t\t\t\t\t\tif($mission['language_dest'])\n\t\t\t\t\t\t\t\t$missonDetails[$m]['language_dest_name']=$this->getLanguageName($mission['language_dest']);\n\n\t\t\t\t\t\t\t$quoteDetails[$q]['missions_list'][$mission['identifier']]='Mission '.($m+1).' - '.$missonDetails[$m]['product_name'];\n\n\t\t\t\t\t\t\t$missonDetails[$m]['comment_time']=time_ago($mission['created_at']);\n\n\n\t\t\t\t\t\t\t//Get seo missions related to a mission\n\t\t\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\t\t\t$searchParameters['misson_user_type']='seo';\n\t\t\t\t\t\t\t$searchParameters['related_to']=$mission['identifier'];\n\t\t\t\t\t\t\t$searchParameters['product']=$mission['product'];\n\t\t\t\t\t\t\t//echo \"<pre>\";print_r($searchParameters);\n\t\t\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($current_version==$request_verion)\n\t\t\t\t\t\t\t\t$seoMissonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$seoMissonDetails=$quoteMission_obj->getQuoteMissionVersionDetails($quote_id,$request_verion,'seo',true);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//echo \"<pre>\";print_r($seoMissonDetails);exit;\n\t\t\t\t\t\t\tif($seoMissonDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$s=0;\n\t\t\t\t\t\t\t\tforeach($seoMissonDetails as $smission)\n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($smission['created_by']);\n\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['seo_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\n\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['comment_time']=time_ago($smission['created_at']);\n\n\t\t\t\t\t\t\t\t\t$prodMissionObj=new Ep_Quote_ProdMissions();\n\n\t\t\t\t\t\t\t\t\t$searchParameters['quote_mission_id']=$smission['identifier'];\n\t\t\t\t\t\t\t\t\tif($current_version==$request_verion)\n\t\t\t\t\t\t\t\t\t$prodMissionDetails=$prodMissionObj->getProdMissionDetails($searchParameters);\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$prodMissionDetails=$prodMissionObj->getMissionVersionDetails($smission['identifier'],$request_verion);\n\t\t\t\t\t\t\t\t\t//echo \"<pre>\";print_r($prodMissionDetails);exit;\n\n\t\t\t\t\t\t\t\t\tif($prodMissionDetails)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif($prodMissionDetails)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tforeach($prodMissionDetails as $key=>$details)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t\t\t\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($details['created_by']);\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$key]['prod_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$key]['comment_time']=time_ago($details['created_at']);\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['prod_mission_details']=$prodMissionDetails;\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t$s++;\t\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$missonDetails[$m]['seoMissions']=$seoMissonDetails;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//echo \"<pre>\";print_r($missonDetails);exit;\n\n\t\t\t\t\t\t\t$prodMissionObj=new Ep_Quote_ProdMissions();\n\n\t\t\t\t\t\t\t$searchParameters['quote_mission_id']=$mission['identifier'];\n\t\t\t\t\t\t\tif($current_version==$request_verion)\n\t\t\t\t\t\t\t$prodMissionDetails=$prodMissionObj->getProdMissionDetails($searchParameters);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$prodMissionDetails=$prodMissionObj->getProdVersionCostDetails($mission['identifier'],$request_verion);\n\t\t\t\t\t\t\t//$prodMissionDetails=$prodMissionObj->getProdMissionDetails($searchParameters);\n\t\t\t\t\t\t\t//echo \"<pre>\";print_r($prodMissionDetails);exit;\n\n\t\t\t\t\t\t\tif($prodMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach($prodMissionDetails as $key=>$details)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($details['created_by']);\n\t\t\t\t\t\t\t\t\t$prodMissionDetails[$key]['prod_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\n\t\t\t\t\t\t\t\t\t$prodMissionDetails[$key]['comment_time']=time_ago($details['created_at']);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$missonDetails[$m]['prod_mission_details']=$prodMissionDetails;\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$m++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->_view->prodMissionDetails=$missonDetails;\n\t\t\t\t\t\t$this->_view->mission_type='prod';\n\t\t\t\t\t\t//echo \"<pre>\";print_r($this->_view->prodMissionDetails);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t//echo \"<pre>\";print_r($missonDetails);exit;\t\t\n\n\t\t\t\t$this->render(\"mission-followup-details\");\t\t\t\t\n\t\t\t}\n\t\t}\t\n\t}", "public function selectQuoteMissionAction()\n\t{\n\t\t$quote_missions=array();\n\n\t\tif(!is_array($this->quote_creation->select_missions['missions_selected']))\n\t\t\t$this->quote_creation->select_missions['missions_selected']=array();\n\n\t\t//echo \"<pre>\";print_r($this->quote_creation->select_missions['missions_selected']);\n\n\t\tif(is_array($this->quote_creation->create_mission['product']) && count($this->quote_creation->create_mission['product'])>0)\n\t\t{\n\t\t\t$i=0;\n\t\t\tforeach($this->quote_creation->create_mission['product'] as $mission)\n\t\t\t{\n\t\t\t\t/*Added w.r.t Autre mission*/\n\t\t\t\tif($this->quote_creation->create_mission['product'][$i]=='autre')\n\t\t\t\t{\n\t\t\t\t\t$this->quote_creation->create_mission['language'][$i]='fr';\n\t\t\t\t\t$this->quote_creation->create_mission['volume'][$i]=1;\n\t\t\t\t\t$this->quote_creation->create_mission['nb_words'][$i]=1;\n\t\t\t\t\t$this->quote_creation->create_mission['producttype'][$i]='autre';\n\t\t\t\t}\n\n\n\t\t\t\t$quote_missions[$i]['product']=$this->quote_creation->create_mission['product'][$i];\n\t\t\t\t$quote_missions[$i]['product_name']=$this->product_array[$this->quote_creation->create_mission['product'][$i]];\n\t\t\t\t$quote_missions[$i]['language']=$this->quote_creation->create_mission['language'][$i];\n\t\t\t\t$quote_missions[$i]['language_name']=$this->getLanguageName($this->quote_creation->create_mission['language'][$i]);\n\t\t\t\t$quote_missions[$i]['languagedest']=$this->quote_creation->create_mission['languagedest'][$i];\n\t\t\t\t$quote_missions[$i]['languagedest_name']=$this->getLanguageName($this->quote_creation->create_mission['languagedest'][$i]);\n\n\t\t\t\t$quote_missions[$i]['producttype']=$this->quote_creation->create_mission['producttype'][$i];\n\t\t\t\t$quote_missions[$i]['producttypeother']=$this->quote_creation->create_mission['producttypeother'][$i];\n\t\t\t\t$quote_missions[$i]['producttype_name']=$this->producttype_array[$this->quote_creation->create_mission['producttype'][$i]];\n\t\t\t\t$quote_missions[$i]['nb_words']=$this->quote_creation->create_mission['nb_words'][$i];\n\t\t\t\t$quote_missions[$i]['volume']=$this->quote_creation->create_mission['volume'][$i];\n\t\t\t\t/*added w.r.t Tempo*/\n\t\t\t\t$quote_missions[$i]['volume_max']=$this->quote_creation->create_mission['volume_max'][$i];\n\t\t\t\t$quote_missions[$i]['mission_length']=$this->quote_creation->create_mission['mission_length'][$i];\n\t\t\t\t$quote_missions[$i]['mission_length_option']=$this->quote_creation->create_mission['mission_length_option'][$i];\n\t\t\t\t$quote_missions[$i]['delivery_volume_option']=$this->quote_creation->create_mission['delivery_volume_option'][$i];\n\t\t\t\t$quote_missions[$i]['tempo']=$this->quote_creation->create_mission['tempo'][$i];\n\t\t\t\t$quote_missions[$i]['tempo_length']=$this->quote_creation->create_mission['tempo_length'][$i];\n\t\t\t\t$quote_missions[$i]['tempo_length_option']=$this->quote_creation->create_mission['tempo_length_option'][$i];\n\t\t\t\t$quote_missions[$i]['oneshot']=$this->quote_creation->create_mission['oneshot'][$i];\n\t\t\t\t$quote_missions[$i]['demande_client']=$this->quote_creation->create_mission['demande_client'][$i];\n\t\t\t\t$quote_missions[$i]['duration_dont_know']=$this->quote_creation->create_mission['duration_dont_know'][$i];\n\t\t\t\t//flag retrive\n\t\t\t\t$quote_missions[$i]['producttypeautre']=$this->quote_creation->create_mission['producttypeautre'][$i];\n\t\t\t\t$quote_missions[$i]['comments']=$this->quote_creation->create_mission['comments'][$i];\n\n\t\t\t\t$quote_missions[$i]['identifier']=$this->quote_creation->create_mission['identifier'][$i];\t\t\t\t\n\n\t\t\t\t//mission object\n\t\t\t\t$mission_obj=new Ep_Quote_Mission();\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t/*dont change the order of this array*/\n\t\t\t\t$searchParameters['product']=$this->quote_creation->create_mission['product'][$i];\n\t\t\t\t$searchParameters['language']=$this->quote_creation->create_mission['language'][$i];\n\t\t\t\t$searchParameters['languagedest']=$this->quote_creation->create_mission['languagedest'][$i];\n\t\t\t\t$searchParameters['producttype']=$this->quote_creation->create_mission['producttype'][$i];\n\t\t\t\t$searchParameters['volume']=$this->quote_creation->create_mission['volume'][$i];\n\t\t\t\t$searchParameters['nb_words']=$this->quote_creation->create_mission['nb_words'][$i];\n\t\t\t\t\n\n\t\t\t\t$missionDetails=$mission_obj->getMissionDetails($searchParameters,3);\n\t\t\t\tif($missionDetails)\n\t\t\t\t{\n\t\t\t\t\t$m=0;\n\t\t\t\t\tforeach($missionDetails as $misson)\n\t\t\t\t\t{\n\t\t\t\t\t\t$missionDetails[$m]['category_name']=$this->getCategoryName($misson['category']);\n\t\t\t\t\t\t$missionDetails[$m]['product']=$this->product_array[$misson['type']];\n\t\t\t\t\t\t$missionDetails[$m]['language1_name']=$this->getLanguageName($misson['language1']);\n\t\t\t\t\t\t$missionDetails[$m]['producttype']=$this->producttype_array[$misson['type_of_article']];\n\n\t\t\t\t\t\t//Added w.r.t conversion\t\t\t\t\t\t\n\t\t\t\t\t\tif($misson['writing_cost_before_signature_currency']!=$this->quote_creation->create_step1['currency'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$missionDetails[$m]['writing_cost_before_signature']=($misson['writing_cost_before_signature']*$this->quote_creation->create_step1['conversion']);\n\t\t\t\t\t\t\t$missionDetails[$m]['correction_cost_before_signature']=($misson['correction_cost_before_signature']*$this->quote_creation->create_step1['conversion']);\n\t\t\t\t\t\t\t$missionDetails[$m]['other_cost_before_signature']=($misson['other_cost_before_signature']*$this->quote_creation->create_step1['conversion']);\n\t\t\t\t\t\t\t$missionDetails[$m]['unit_price']=($misson['selling_price']*$this->quote_creation->create_step1['conversion']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$missionDetails[$m]['unit_price']=$misson['selling_price'];\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t$missionDetails[$m]['mission_turnover']=($misson['num_of_articles']*$missionDetails[$m]['unit_price'])/1000;\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t$m++;\n\t\t\t\t\t}\n\n\t\t\t\t\t$quote_missions[$i]['missionDetails']=$missionDetails;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$i++;\n\t\t\t}\t\t\t\n\n \t\t\t//echo \"<pre>\";print_r($quote_missions);exit;\n \t\t\t$this->quote_creation->create_mission['quote_missions']=$quote_missions;\n\n\t\t\t$this->_view->quote_missions=$quote_missions;\n\t\t\t$this->_view->create_mission=$this->quote_creation->create_mission;\n\t $this->_view->create_step1=$this->quote_creation->create_step1;\n\t $this->_view->select_missions=$this->quote_creation->select_missions;\n\n\t\t\t$this->render('select-quote-mission');\n\n\t\t}\n\t\telse\n\t\t\t$this->_redirect(\"/quote/create-quote-step1?submenuId=ML13-SL2\");\t\t\n\n\n\n\t}", "public function getQuoteData()\n {\n $quote= Mage::getSingleton('checkout/session')->getQuote();\n $data = array();\n if ($quote) {\n $data['checkoutId'] = $quote->getId();\n $data['currency'] = $quote->getQuoteCurrencyCode();\n $data['total'] = Mage::helper('affirm/util')->formatCents($quote->getGrandTotal());\n }\n return $data;\n\n }", "function _buyquota()\n\t{\n\t\tif (get_option('is_on_pop3_buy')=='0') return new ocp_tempcode();\n\n\t\t$title=get_page_title('TITLE_QUOTA');\n\n\t\t$member_id=get_member();\n\t\t$pointsleft=available_points($member_id);\n\t\t$price=intval(get_option('quota'));\n\t\t$quota=post_param_integer('quota');\n\n\t\t$details=$GLOBALS['SITE_DB']->query_select('sales',array('details','details2'),array('memberid'=>$member_id,'purchasetype'=>'pop3'),'',1);\n\t\t$prefix=$details[0]['details'];\n\t\t$suffix=$details[0]['details2'];\n\n\t\t// If we don't own a POP3 account, stop right here.\n\t\tif (!array_key_exists(0,$details))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('NO_POP3'));\n\t\t}\n\n\t\t// Stop if we can't afford this much quota\n\t\tif ((($quota*$price)>$pointsleft) && (!has_specific_permission(get_member(),'give_points_self')))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('CANT_AFFORD'));\n\t\t}\n\n\t\t// Mail off the order form\n\t\t$quota_url=get_option('quota_url');\n\t\t$_price=$quota*$price;\n\t\t$encoded_reason=do_lang('TITLE_QUOTA');\n\t\t$message_raw=do_template('POINTSTORE_QUOTA_MAIL',array('_GUID'=>'5a4e0bb5e53e6ccf8e57581c377557f4','ENCODED_REASON'=>$encoded_reason,'QUOTA'=>integer_format($quota),'EMAIL'=>$prefix.$suffix,'QUOTA_URL'=>$quota_url,'PRICE'=>integer_format($_price)));\n\t\trequire_code('notifications');\n\t\tdispatch_notification('pointstore_request_quota','quota_'.uniqid('',true),do_lang('MAIL_REQUEST_QUOTA',NULL,NULL,NULL,get_site_default_lang()),$message_raw->evaluate(get_site_default_lang(),false),NULL,NULL,3,true);\n\n\t\t$url=build_url(array('page'=>'_SELF','type'=>'misc'),'_SELF');\n\t\treturn redirect_screen($title,$url,do_lang_tempcode('ORDER_QUOTA_DONE'));\n\t}", "function create() {\n\n if ( ! authCheck(['salesperson', 'manager']) ) {\n\n return json_encode(['success' => false, 'authorised' => false]);\n\n } else {\n\n $requestBody = file_get_contents('php://input');\n $data = json_decode($requestBody);\n\n // make quote\n $quote = new \\App\\Quote;\n $quote->owner = $_COOKIE['userid'];\n $quote->customer_name = getPropertySafely($data, 'customer_name');\n $quote->address = getPropertySafely($data, 'address');\n $quote->date = (getPropertySafely($data, 'date')) ? getPropertySafely($data, 'date') . ' 00:00:00': '1970-01-01 00:00:00';\n $quote->appointment_number = getPropertySafely($data, 'appointment_number');\n $quote->product_price = getPropertySafely($data, 'total_product_price');\n $quote->installation_price = getPropertySafely($data, 'total_installation_price');\n $quote->cost_price = getPropertySafely($data, 'total_price');\n $quote->save();\n $quoteId = $quote->id;\n\n foreach($data->products as $productName => $product) {\n\n foreach ($product as $rowId => $row) {\n\n // make quote product (\"Item\")\n $quoteProduct = new \\App\\QuoteProduct;\n $quoteProduct->quote_id = $quoteId;\n $quoteProduct->product = $productName;\n $quoteProduct->row = $rowId;\n $quoteProduct->save();\n $quoteProductId = $quoteProduct->id;\n\n foreach ($row as $settingName => $value) {\n\n // make quote product setting (could specify product to remove quote products table)\n $qpSetting = new \\App\\QuoteProductSetting;\n $qpSetting->quote_id = $quoteId;\n $qpSetting->quote_product_id = $quoteProductId;\n $qpSetting->setting = $settingName;\n if ($settingName == \"location\" || $settingName == \"description\" ) {\n $qpSetting->valueString = $value;\n } else {\n $qpSetting->value = $value;\n }\n $qpSetting->save();\n\n }\n }\n }\n\n //die();\n \n return json_encode(['success' => true, 'id' => $quoteId]);\n }\n }", "function _canadapostGetQuote() {\r\n\t$strXML = \"<?xml version=\\\"1.0\\\" ?>\";\r\n\r\n\t// set package configuration.\r\n\t$strXML .= \"<eparcel>\\n\";\r\n\t$strXML .= \" <language>\" . $this->language . \"</language>\\n\";\r\n\t$strXML .= \" <ratesAndServicesRequest>\\n\";\r\n\t$strXML .= \" <merchantCPCID>\" . $this->CPCID . \"</merchantCPCID>\\n\";\r\n\t$strXML .= \" <fromPostalCode>\" . $this->_canadapostOriginPostalCode . \"</fromPostalCode>\\n\";\r\n\t$strXML .= \" <turnAroundTime>\" . $this->turnaround_time . \"</turnAroundTime>\\n\";\r\n\t$strXML .= \" <itemsPrice>\" . (string)$this->items_price . \"</itemsPrice>\\n\";\r\n\t\r\n\t// add items information.\r\n\t$strXML .= \" <lineItems>\\n\";\r\n\tfor ($i=0; $i < $this->items_qty; $i++) {\r\n\t $this->item_description[$i] = str_replace(\"&\", \"and\", $this->item_description[$i]);\r\n\t\t$strXML .= \"\t <item>\\n\";\r\n\t\t$strXML .= \" <quantity>\" . $this->item_quantity[$i] . \"</quantity>\\n\";\r\n\t\t$strXML .= \" <weight>\" . ($this->item_weight[$i]) . \"</weight>\\n\";\r\n\t\t$strXML .= \" <length>\" . $this->item_length[$i] . \"</length>\\n\";\r\n\t\t$strXML .= \" <width>\" . $this->item_width[$i] . \"</width>\\n\";\r\n\t\t$strXML .= \" <height>\" . $this->item_height[$i] . \"</height>\\n\";\r\n\t\t$strXML .= \" <description>\" . $this->item_description[$i] . \"</description>\\n\";\r\n\t\tif ($this->item_readytoship[$i]) $strXML .= \" <readyToShip/>\\n\";\r\n\t\t$strXML .= \"\t </item>\\n\";\r\n\t}\r\n\t$strXML .= \" </lineItems>\\n\";\r\n\t\r\n\t// add destination information.\r\n\t$strXML .= \" <city>\" . $this->dest_city . \"</city>\\n\";\r\n\t$strXML .= \" <provOrState>\" . $this->dest_province . \"</provOrState>\\n\";\r\n\t$strXML .= \" <country>\" . $this->dest_country . \"</country>\\n\";\r\n\t$strXML .= \" <postalCode>\" . $this->dest_zip . \"</postalCode>\\n\";\r\n\t$strXML .= \" </ratesAndServicesRequest>\\n\";\r\n\t$strXML .= \"</eparcel>\\n\";\r\n\t\r\n\t//print $strXML;\r\n\tif ($resultXML = $this->_sendToHost($this->server,$this->port,'POST','',$strXML)) {\r\n\t\treturn $this->_parserResult($resultXML);\r\n\t} else {\r\n\t return false;\r\n\t}\r\n }", "public function editQuoteDetail(Request $request)\n {\n $user = auth()->user();\n $returnResult = [];\n $success = false;\n\n $quoteDetail = DB::table('quote_items')\n ->select('places.id as place', 'categories.id as category',\n 'products.name','products.code','products.price','products.priceusd',\n 'quote_item_categories.description as categoryDescription',\n 'quote_items.quantity','quote_items.other','quote_items.product_id',\n 'quote_items.description','quote_items.offer','quote_items.optional',\n 'quote_items.package','countries.currency','countries.currency_abbreviation',\n 'quote_item_categories.id as itemCategory')\n ->join('quotes', 'quotes.id', '=', 'quote_items.quote_id')\n ->join('places', 'places.id', '=', 'quote_items.place_id')\n ->join('categories', 'categories.id', '=', 'quote_items.category_id')\n ->join('quote_item_categories', function ($join) {\n $join->on('quote_item_categories.category_id', '=', 'categories.id')\n ->on('quote_item_categories.quote_id', '=', 'quotes.id');\n })\n ->join('products', 'products.id', '=', 'quote_items.product_id')\n ->join('locations', 'locations.id', '=', 'quotes.location_id')\n ->join('countries', 'countries.id', '=', 'locations.country_id')\n ->join('users', 'users.id', '=', 'quotes.created_by_id')\n ->where('users.organization_id', $user->organization_id)\n ->where('quote_items.id', $request->id)->first();\n\n if ($quoteDetail) {\n if ($quoteDetail->currency_abbreviation === 'EUR') {\n $quoteDetail->price = $quoteDetail->price;\n } elseif ($quoteDetail->currency_abbreviation === 'USD') {\n $quoteDetail->price = $quoteDetail->preciousd;\n }\n $success = true;\n $returnResult['message'] = 'Success';\n $returnResult['info'] = $quoteDetail;\n } else {\n $returnResult['message'] = 'An internal server error has ocurred, please contact your administrator';\n }\n return response()->json(array('success' => $success, 'data'=>$returnResult));\n }", "public function actionModify()\n {\n $customerEntity = $this->_getCustomerEntity();\n \n if (!$customerEntity) {\n return false;\n }\n\n $quote = Mage::getModel('sales/quote')->loadByIdWithoutStore($this->_getEntityId());\n \n $request = Mage::helper('marketingsoftware/rest_request');\n $request->prepare();\n\n if (Mage::helper('marketingsoftware/config')->getRemoveFinishedQuoteItem()) {\n $quoteItemCollection = Mage::helper('marketingsoftware/config')->getQuoteItemCollectionId();\n\n if ($quoteItemCollection) {\n $response = $request->get(\n '/profile/'.$customerEntity->getProfileId().'/subprofiles/'.$quoteItemCollection, array( \n 'fields' => array('quote_id=='.$this->_getEntityId())\n )\n );\n }\n\n foreach ($response['data'] as $subprofile) {\n $request->delete('/subprofile/'.$subprofile['ID']); \n }\n } else {\n foreach ($quote->getAllItems() as $quoteItem) {\n $quoteItemEntity = Mage::getModel('marketingsoftware/copernica_entity_quote_item');\n $quoteItemEntity->setQuoteItem($quoteItem);\n \n $restQuoteItem = $quoteItemEntity->getRestQuoteItem();\n $restQuoteItem->syncWithQuote($customerEntity, $quote->getId());\n }\n }\n\n $request->commit();\n\n return true;\n }", "function fn_QuoteGet($args){\n\t\t\t$params = $this->params;\n\t\t\t$wsdl \t= $this->wsdl;\n\t\t\t$responce = \"\";\n\t\t\ttry{\n\t\t\t\t$soap = new SoapClient($wsdl, $params);\n $args['token'] = $this->token;\n\t\t\t\t$responce = $soap->QuoteGet($args);\n\t\t\t} \n\t\t\tcatch (SoapFault $e){\n\t\t\t\t//$responce = \"\";\n\t\t\t \t//$responce = 'Caught exception:'.$e->getMessage().\"\\n\";\n\t\t\t \t\n\t\t\t \t$responce['faultcode'] \t\t= $e->faultcode;\n\t\t\t $responce['faultstring'] \t= $e->faultstring;\n\t\t\t $responce['faultactor'] \t= $e->faultactor;\n\t\t\t $responce['faultname'] \t\t= $e->faultname;\n\t\t\t $responce['headerfault'] \t= $e->headerfault;\n\t\t\t}\n\t\t\treturn $responce;\n\t\t}", "private function sellTrasactionPendingAddsMoney(){\n\n }", "public function actionrequestingEscrow(){\n \n \n \n \n $model = new Escrow;\n \n $member_id = Yii::app()->user->id;\n \n if(isset($_POST['quoted_id'])){\n $model->quote_id = $_POST['quote_id'];\n }else{\n $model->quote_id = 0;\n }\n \n $model->product_id = $_POST['product_id'];\n $model->escrow_number = $model->generateTheEscrowNumberForThisTransaction($model->quote_id,$model->product_id);\n if(isset($_POST['is_quotable'])){\n if($_POST['is_quotable'] == true){\n $model->is_quoted =1;\n }else{\n $model->is_quoted =0;\n }\n \n }else{\n $model->is_quoted = 0;\n }\n if(isset($_POST['future_trading'])){\n $model->is_futuristic = $_POST['future_trading'];\n }else{\n $model->is_futuristic = 0;\n \n }\n \n \n $model->minimum_number_of_product_to_buy = $_POST['minimum_number_of_product_to_buy_for_computation'];\n $model->whats_product_per_item = $_POST['whats_represents_an_item'];\n $model->status = strtolower('live');\n $model->escrow_operation_for = $_POST['escrow_request_from'];\n if($_POST['subscription_type'] == strtolower('post')){\n $model->quantity = $_POST['subscription_quantity'];\n }else{\n $model->quantity = $_POST['quantity_of_purchase'];\n }\n \n $model->price_per_item = $_POST['prevailing_retail_selling_price'];\n $model->total_amount_purchased=$_POST['amount_to_be_paid'];\n $model->escrow_initiation_date = new CDbExpression('NOW()');\n $model->escrow_initiated_by = Yii::app()->user->id;\n $model->direction = strtolower('initiation');\n \n $is_escrowed = 1;\n $is_escrow_accepted = 0;\n $start_price_validity_period = date(\"Y-m-d H:i:s\", strtotime($_POST['start_price_validity_period'])); \n $end_price_validity_period = date(\"Y-m-d H:i:s\", strtotime($_POST['end_price_validity_period'])); \n $cobuy_member_selling_price = 0;\n $amount_saved_on_purchase = 0;\n if($this->isMemberWithOpenOrder($member_id)){\n $order_id = $this->getTheOpenOrderInitiatedByMember($member_id);\n }else{\n $order_id = $this->createNewOrderForThisMember($member_id);\n }\n \n $escrow_file_error = 0;\n \n if($_FILES['escrow_agreement_file']['name'] != \"\"){\n if($_FILES['escrow_agreement_file']['type'] == 'application/pdf'){\n $escrow_filename = $_FILES['escrow_agreement_file']['name'];\n $escrow_filesize = $_FILES['escrow_agreement_file']['size'];\n }else{\n $escrow_file_error = $escrow_file_error + 1;\n \n }\n \n if($escrow_file_error == 0){\n if($model->validate()) {\n \n //move the escrow agreement file to the escrow directory \n $model->escrow_agreement_file = $model->moveTheEscrowAgreementToItsPathAndReturnItsFileName($escrow_filename);\n if($model->escrow_operation_for ==strtolower('noncart')){\n if($model->save()) {\n // if($this->isProductSubscriptionUpdatedSuccessfully($member_id,$model->product_id)){\n $msg = \"product escrow was initiated successful. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n /** }else{\n $msg = \"product escrow was initiated successful. However, the product subscription information were not updated. Please Visit the Escrow module in 'My Oneroof' section to consummate this transaction\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n } \n * \n */ \n \n \n \n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"There was an issue initiating this escrow. Possibly field validation error\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }else{\n if($model->hasTheEscrowOfThisSubscriptionAlreadyInitiated($member_id,$model->status,$model->product_id,$model->escrow_operation_for)==false){\n if($model->save()) {\n if($this->isProductSubscriptionUpdatedSuccessfully($model->id,$member_id,$model->product_id)){\n $msg = \"product escrow was initiated successful. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n \n }else{\n if($model->escrow_operation_for == 'pre'){\n $msg = \"This pre-subscribed product had been sent to the escrow administrator. If the escrow is accepted, the product will be added to your cart so as to effect payment. However, you may visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n }else{\n $msg = \"product escrow was initiated successful. However, the product subscription information were not updated. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n }\n \n \n } \n \n \n }else{\n \n $msg = \"There was an issue initiating this escrow. Possibly field validation error\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }else{\n $msg = \"You already have an escrow on this product subscription waiting for acceptance.You may need to wait for the escrow to be accepted before initiating a new one\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }\n \n \n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"Validaion Error: Check the forms fields for correctness\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg\n )\n );\n \n }\n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"File Format Error: There was an error in the uploaded escrow agreement document. Please check the uploaded file and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n }else{\n \n if($model->escrow_operation_for ==strtolower('noncart')){\n $msg = \"The Escrow Agreement document was not uploaded. Please upload it and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n }else{\n if($this->isProductEscrowable($model->product_id )){\n $msg = \"The Escrow Agreement document was not uploaded. Please upload it and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n }else{\n $msg = \"This product is not escrowable. Please choose another product and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n )\n );\n }\n }\n \n } \n \n \n }", "public function update(Request $request, Quote $quote)\n {\n //\n }", "function zed_getquoteforbookshelf()\n{\n $someObj = new stdClass;\n $zedPage = get_page_by_path('zed-book-club');\n $someObj->quotation = get_field('quotation', $zedPage->ID);\n $someObj->quotation_attribution = get_field('quotation_attribution', $zedPage->ID);\n return $someObj;\n}", "public function delete_quote_get() {\n extract($_GET);\n $response = $this->QuotationForEnquiry_model->delete_quote($quotation_id);\n return $this->response($response);\n }", "function QuoteWidget() {\n\t\tparent::__construct( false, 'Online Quote Button' );\n\t}", "function display_quote( $quote_object ) \n {\n $quote = $quote_object;\n $html = '';\n if( is_object($quote) ) {\n $source_url = get_post_meta($quote->ID, 'bbquotations-source-url', true);\n // add the source url if available\n // or else link to the author of the quote \n error_log($source_url);\n if( empty($source_url) ) {\n $url = get_author_posts_url($quote->post_author);\n $link = \"<a href='$url'>$quote->post_title</a>\"; \n } else {\n $url = $source_url;\n $link = \"<a href='$url'>$quote->post_title</a>\"; \n }\n $html .= \"<blockquote class='bbquotations' cite='$url'>\";\n $html .= \"<p>\";\n $html .= $quote->post_content;\n $html .= \"</p>\";\n \n $html .= \"<cite>$link</cite>\";\n $html .= \"</blockquote>\"; \n }\n return $html;\n }", "public function index($quote=null){\n\t\tif(!empty($this->group_permissions) && in_array(1,$this->group_permissions)){\n\t\t\t$quoteInfo\t= !empty($quote) ? base64_decode($quote) : '';\n\t\t\t$quoteInfo\t= !empty($quoteInfo) ? explode('##',$quoteInfo) : '';\n\t\t\t$quoteId\t= !empty($quoteInfo[0]) ? $quoteInfo[0] : '';\n\t\t\t$proposal\t= !empty($quoteInfo[1]) ? $quoteInfo[1] : '';\n\t\t\t$contactEmail\t\t= !empty($quoteInfo[2]) ? $quoteInfo[2] : '';\n\t\t\t$salespersonEmail\t= !empty($quoteInfo[3]) ? $quoteInfo[3] : '';\n\t\t\t$salesAssistantContact\t= !empty($quoteInfo[4]) ? $quoteInfo[4] : '';\n\t\t\tif(empty($quote) || empty($quoteId) || empty($proposal)){\n\t\t\t\tredirect('managequote');\n\t\t\t}\n\t\t\t$data['js']\t\t= array('jquery-min','jquery-ui','jquery.mCustomScrollbar','jquery.selectBoxIt','parsley.min','bootstrap','multiselect'); \n\t\t\t$data['css']\t= array('common','index','jquery-ui','jquery.mCustomScrollbar','font-awesome.min','bootstrap','mutiselectcheck');\n\t\t\t$data['title']\t= 'Send';\n\t\t\t$data['quoteId']\t= $quoteId;\n\t\t\t$data['proposal']\t= $proposal;\n\t\t\t$data['mailDetail']\t= array('contactEmail'=>$contactEmail,'salespersonEmail'=>$salespersonEmail,'salesAssistantContact'=>$salesAssistantContact);\n\t\t\t$this->load->view('frontend/send_mail', $data);\n\t\t}else{\n\t\t\t$message='<div class=\"alert alert-block alert-danger\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\"><i class=\"ace-icon fa fa-times\"></i></button><p>'.$this->NotAuthorizedMsg.'</p></div>';\n\t\t\t$this->session->set_flashdata('message',$message);\n\t\t\tredirect('dashboard');\n\t\t}\n\t}", "private function getQuotes()\n {\n $requestString = $this->carrierCache->serialize($this->shipperRequest);\n $resultSet = $this->carrierCache->getCachedQuotes($requestString, $this->getCarrierCode());\n $timeout = $this->restHelper->getWebserviceTimeout();\n if (!$resultSet) {\n $initVal = microtime(true);\n $resultSet = $this->shipperWSClientFactory->create()->sendAndReceive(\n $this->shipperRequest,\n $this->restHelper->getRateGatewayUrl(),\n $timeout\n );\n $elapsed = microtime(true) - $initVal;\n $this->shipperLogger->postDebug('Shipperhq_Shipper', 'Short lapse', $elapsed);\n\n if (!$resultSet['result']) {\n $backupRates = $this->backupCarrier->getBackupCarrierRates(\n $this->rawRequest,\n $this->getConfigData(\"backup_carrier\")\n );\n if ($backupRates) {\n return $backupRates;\n }\n }\n $this->carrierCache->setCachedQuotes($requestString, $resultSet, $this->getCarrierCode());\n }\n $this->shipperLogger->postInfo('Shipperhq_Shipper', 'Rate request and result', $resultSet['debug']);\n return $this->parseShipperResponse($resultSet['result']);\n }", "public function get($quoteId);", "function fastQuote_activate() {\n require_once('fastQuote.tpl.php');\n fastQuoteActivator::activate();\n}", "function cs_pb_quote($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$quote_element_size = '25';\n\t\t$quote_text_color = '';\n\t\t$quote_align = '';\n\t\t$quote_content = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$quote_element_size = $cs_node->quote_element_size;\n\t\t\t$quote_text_color = $cs_node->quote_text_color;\n\t\t\t$quote_align = $cs_node->quote_align;\n\t\t\t$quote_content = $cs_node->quote_content;\n\t\t\t\t$counter = $post->ID.$count_node;\n}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $quote_element_size?>\" item=\"quote\" data=\"<?php echo element_size_data_array_index($quote_element_size)?>\" >\n \t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"quote_element_size[]\" class=\"item\" value=\"<?php echo $quote_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> &nbsp; \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp; \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n \t<div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Quote Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n <div class=\"opt-conts\">\n \t<ul class=\"form-elements\">\n <li class=\"to-label\"><label>Text Color</label></li>\n <li class=\"to-field\">\n \t<input type=\"text\" name=\"quote_text_color[]\" class=\"txtfield\" value=\"<?php echo $quote_text_color?>\" />\n <p>Enter the color code like #000000</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Align</label></li>\n <li class=\"to-field\">\n <select name=\"quote_align[]\" class=\"dropdown\" >\n <option <?php if($quote_align==\"left\")echo \"selected\";?> >left</option>\n <option <?php if($quote_align==\"right\")echo \"selected\";?> >right</option>\n <option <?php if($quote_align==\"center\")echo \"selected\";?> >center</option>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Quote Content</label></li>\n <li class=\"to-field\"><textarea name=\"quote_content[]\"><?php echo $quote_content?></textarea></li>\n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"quote\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "function default_quote_content( $content, $post )\n {\n\n if ($post->post_type !== 'lh_quotes')\n {\n return $content;\n }\n\n if(!isset($_GET['client_id']) )\n {\n return $content;\n }\n\n $client_id = $_GET['client_id'];\n\n $client_name = get_the_title($client_id);\n $arr = explode(' ',trim($client_name));\n $first_name = $arr[0]; // get the first name\n\n $content = 'Dear '.$first_name.',<br/>';\n $content.= 'Thanks for your interest in Little House. Please find your quote broken down for the playhouse / play decks as discussed.<br/><br/>';\n $content.= 'This price is only for the timber and labour and so does not include accessories such as the climbing wall holds or slide etc. We can help you to source these, as required.<br/><br/>';\n $content.= '[lh_image]<br/>';\n $content.= '[lh_quote]<br/><br/>';\n\n $content.='This quote is provided on the basis of the following assumptions:';\n $content.='<ul>';\n $content.='<li>Date of build will be agreed upon commission but is subject to the availability of timber</li>';\n $content.='<li>Timber can transported to the build site (e.g. 3m lengths can fit through a side access or direct route through the house)</li>';\n $content.='<li>Timber will be delivered to your home/build site on the day in advance of the build, usually the day prior to the build and will be stored in a safe, secure location. Timber that is damaged after delivery but prior to build will require replacement at an additional cost.</li>';\n $content.='<li><Water and electricity will be available for the duration of the build /li>';\n $content.='<li>You will receive formal approval for the build from your immediate neighbours. </li>';\n $content.='</ul>';\n\n $content.= '<br/>If you would like to proceed and commission your Little House, a deposit of £500 is required, made payable to Barrington Innovation, sort code 309034 account number 32156268, paid a minimum of '.DEPOSIT_DAY_LIMIT.' days prior to build date. The deposit will be deducted from your invoice upon completion of the build.<br/><br/>';\n $content.='To accept this quote and kick start your Little House build, please click on the link below.<br/><br/>';\n $content.= '[lh_accept_link]<br/><br/>';\n\n $content.='If you have any queries or would like to discuss any aspect of the design, please contact Little House’s Client Liaison Ailsa Peron (contact details below), who will help answer any questions relating to your quote and who will help coordinate your build, if commissioned.<br/>';\n $content.='Thank you again for your interest, and we hope to have the opportunity to bring your Little House to life soon!<br/><br/>';\n $content.='Kind regards,<br/>';\n $content.= 'Alex Furr';\n\n return $content;\n }", "public function mainform_get_quotes()\n\t{\n\t\t$quotes = $this->get_quotes();\n\t// process the quotes\n\t\tforeach($quotes as $key => &$value)\n\t\t{\n\t\t $tmp = (array) $value;\n\t\t $quotes[$key] = $tmp['price'];\n\t\t} \n\t\tksort($quotes);\n\t\t$data['quotes'] = $quotes;\n\t\treturn $quotes;\n\t}", "public function massQuoteIdAction()\n {\n $offerIds = $this->getRequest()->getParam('offer');\n if (!is_array($offerIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('mfb_myflyingbox')->__('Please select offers.')\n );\n } else {\n try {\n foreach ($offerIds as $offerId) {\n $offer = Mage::getSingleton('mfb_myflyingbox/offer')->load($offerId)\n ->setQuoteId($this->getRequest()->getParam('flag_quote_id'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d offers were successfully updated.', count($offerIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('mfb_myflyingbox')->__('There was an error updating offers.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }" ]
[ "0.663314", "0.6624041", "0.6571595", "0.65572137", "0.65311736", "0.64576644", "0.6404816", "0.6375539", "0.6355895", "0.6277825", "0.6239178", "0.6185064", "0.6140349", "0.61013275", "0.60703766", "0.60651785", "0.6051109", "0.60501903", "0.60097164", "0.598306", "0.5970907", "0.5969995", "0.59639424", "0.59639424", "0.59578896", "0.5945624", "0.59450185", "0.593166", "0.59069175", "0.58866185", "0.58806896", "0.5859809", "0.5843827", "0.5822336", "0.5807251", "0.5795801", "0.5795801", "0.579362", "0.57876486", "0.57863736", "0.5746501", "0.5745272", "0.5745272", "0.5745272", "0.5745272", "0.573829", "0.57294965", "0.57288796", "0.57194525", "0.5702718", "0.5686738", "0.5676986", "0.56686187", "0.56481516", "0.56239426", "0.56159246", "0.5604353", "0.5602444", "0.5599008", "0.5588816", "0.5573738", "0.55697703", "0.5549231", "0.5518961", "0.5514453", "0.5513173", "0.5511024", "0.5503627", "0.5491953", "0.54738474", "0.5470745", "0.5470699", "0.54634637", "0.54633236", "0.5454471", "0.5453436", "0.54484296", "0.54480857", "0.5440257", "0.5429286", "0.54202515", "0.5415297", "0.54110503", "0.53895205", "0.53723764", "0.53680885", "0.5360926", "0.5345042", "0.5342854", "0.53192437", "0.53175104", "0.52915317", "0.5290432", "0.5288305", "0.52872044", "0.52831244", "0.528218", "0.5281651", "0.5261404", "0.5252217" ]
0.60962725
14
/$modelproject = new Application_Model_Project(); $zipcodelist = $modelproject>zipcodelist();
public function postnewjob(){ global $job_deadline; $this->addElement('select', 'job_deadline', array ( 'class' => 'form-control required' , "required"=>true, 'id' => 'job_deadline', "multioptions"=>$job_deadline, // 'onchange' => 'Checkoption(this)', "label" => "When do you need the work to start", "filters" => array("StringTrim","StripTags","HtmlEntities"), )); /*$this->addElement('textarea', 'job_deadline_other_option', array ( 'class' => 'form-control p_0 ', "required"=>true, 'id' => 'job_deadline_other_option', "rows"=>5, 'Placeholder'=> 'When would you like to schedule this for?', //"label" => "When do you need the work to start", "filters" => array("StringTrim","StripTags","HtmlEntities"), "validators" => array( array("NotEmpty",true,array("messages"=>"Business description is required ")), ), ));*/ $this->addElement('text', 'job_deadline_date', array ( 'class' => 'form-control', "placeholder" => "Select Date", "readonly"=>"readonly", "filters" => array("StringTrim","StripTags","HtmlEntities"), )); $this->addElement('text', 'job_phone_client', array ( 'class' => 'form-control required text-center User_job_Post_Form', "required"=>true, 'label' => 'Phone Number', 'Placeholder'=> 'Phone Number with valid code (+1)', "filters" => array("StringTrim","StripTags","HtmlEntities"), "validators" => array( array("NotEmpty",true,array("messages"=>"Business description is required ")), ), )); // zip code textbox $this->addElement('radio', 'job_anything_else_know', array ( 'class' => 'required RedioCheckboxStyle User_job_Post_Form', "required"=>true, 'id' => 'job_anything_else_know', //"onclick"=>"isElse()", 'multiOptions'=>array( '0' => 'Yes', '1' => 'No', ), "label" => "Anything else service provider should know? ", "validators" => array( array("NotEmpty",true,array("messages"=>"Please select.")), ), )); $this->addElement('textarea', 'yes_else_know', array ( 'class' => 'form-control text-left p_0', "required"=>true, "rows"=>2, 'id' => 'yes_else_know', 'Placeholder'=> 'Write here...', //"label" => "When do you need the work to start", "filters" => array("StringTrim","StripTags","HtmlEntities"), "validators" => array( array("NotEmpty",true,array("messages"=>"Business description is required ")), ), )); $this->addElement('radio', 'how_receive_quote', array ( 'class' => 'required RedioCheckboxStyle User_job_Post_Form', "required"=>true, 'multiOptions'=>array( '0' => 'By email only', '1' => 'By email and text message', ), "label" => "How would you like to receive quotes? ", "validators" => array( array("NotEmpty",true,array("messages"=>"Please select.")), ), )); //$this->how_receive_quote->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('Wrapper'); $this->addElement('text', 'client_zip_code', array ( 'class' => 'form-control required text-center User_job_Post_Form', "label" => "Please confirm where you need the job to be done. " , 'Placeholder'=> 'Zip Code', /*'onchange'=> 'checkzipcode(this.value)',*/ "filters" => array("StringTrim","StripTags"), "validators" => array( array("NotEmpty",true,array("messages"=>"zip code is required ")), ), )); $job_budget=array( '1' => '0-100', '2' => '100-200', '3' => '200-500', '4' => '500-700', '5' => '700-1000', '6' => '1000-1500', '7' => '1500-2000', '8' => '2000-5000', '9' => '5000-7000', '10' => 'more than 7000', ); $this->addElement('select', 'posted_job_budget', array ( 'class' => 'form-control', "multioptions"=>$job_budget, 'label' => 'Job Budget', "filters" => array("StringTrim","StripTags","HtmlEntities"), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function list_coo_approval1($emp_code)\n{\n\t\n\t$this->load->database(); \n $this->load->model('purchase/qcs_model'); \t\n\t$data['approval1_list']=$this->qcs_model->list_coo_approval1($emp_code); \t\t \t\t\n\treturn $data['approval1_list'];\n\t\t \n}", "function list_cfo_approval1($emp_code)\n{\n\t\n\t$this->load->database(); \n $this->load->model('purchase/qcs_model'); \t\n\t$data['approval1_list']=$this->qcs_model->list_cfo_approval1($emp_code); \t\t \t\t\n\treturn $data['approval1_list'];\n\t\t \n}", "function fcollab_project_list(){\r\n\t$output = 'list project';\r\n\t\r\n\treturn $output;\r\n}", "function VM_projects() { return bList::getListInstance(myOrg_ID,'bList_vm_projects'); }", "function list_sourcing_head_approval2($emp_code)\n{\n\t\n\t$this->load->database(); \n $this->load->model('purchase/qcs_model'); \t\n\t$data['approval2_list']=$this->qcs_model->list_sourcing_head_approval2($emp_code); \t\t \t\t\n\treturn $data['approval2_list'];\n\t\t \n}", "public function get_project_all(){\n }", "public function branch() {\r\nreturn $this->db->get('branch')->result();\r\n}", "function get_project()\n {\n return $this->find('all');\n }", "public function getAddressByZipCode($zip_code)\r\n\t{\r\n\t\t//echo \"Obtener direccion a partir del CP Model\"; exit;\r\n\r\n\t\t$sql = new Sql($this->dbAdapter);\r\n\t\t$select = $sql->select();\r\n\t\t$select->from(array('n' => 'neighborhood'));\r\n\t\t$select->columns(array('id_neighborhood' => 'id','colony','postal_code', 'district_id', 'state_id'));\r\n\t\r\n\t\t//$select->join(array('i_u'=>'users_details'),'users.id = i_u.id_user',array('id_user','name','surname', 'campus', 'phone', 'addres','image','pin','key_inventory'), 'Left');\r\n\t\t\r\n\t\t$select->where(array('n.postal_code' => $zip_code ));\r\n\r\n\t\t$selectString = $sql->getSqlStringForSqlObject($select);\r\n $execute = $this->dbAdapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n $result=$execute->toArray(); \r\n\r\n\t\t//echo \"<pre>\";print_r($result);exit;\r\n\t\treturn $result;\r\n\t}", "public function Query() {\n return FactoryService::ProjectService()->GetList()->ToList();\n }", "public function get_list()\n {\n \n $this->db->select('l.id,l.name');\n $this->db->from('libraries l');\n $this->db->where('l.active',1);\n $this->db->order_by('l.name','ASC');\n \n return $this->db->get()->result();\n }", "public function get_project_list_get()\n {\n \t$result = $this->Post_project_model->get_project_list();\n \treturn $this->response($result);\n }", "function getParameterListByCode($code){\r\n $ci =& get_instance();\r\n $ci->load->model('helper/helper');\r\n $result = $ci->helper->getDataParamByCode($code);\r\n echo \"<select>\";\r\n foreach ($result as $value) {\r\n echo \"<option value=\" . $value['id'] . \">\" . strtoupper($value['name']) . \"</option>\";\r\n }\r\n echo \"</select>\";\r\n}", "public function zipcodes()\n {\n // App\\Models\\CityComposite::where('state','CA')->where('name', 'Los Angeles')->first()->zipcodes\n return $this->hasMany(City::class, ['city', 'state_code'], ['name', 'state']);\n }", "public function getProjects()\n {\n }", "Public Function ListarImovel(){\n $ImovelModel = new ImovelModel();\n echo $ImovelModel->ListarImovel();\n }", "public function listar(){\n $rol= $this->db->select('*')->from('versions')->join('plans', 'plans.PLAN_PK = versions.VRSN_FK_plans');\n return $rol->get();\n }", "public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }", "public function lead_source_list()\n {\n \n $result = $this->db->query(\"call lead_source_list()\")->result();\n save_query_in_log();\n \n return $result;\n }", "public function getZip() {}", "function getdepartments() {\n\t\t// import department db\n\t\tApp::import('Model','Department');\n\t\t$this->Department = & new Department();\n\t\t# fetch list of active departments \n\t\t$departments_list = $this->Department->find('list',array('conditions'=>array('Department.status'=>'1'),'fields'=>array('id','name'),'limit'=>10,'order'=>array('Department.id')));\n\t\treturn $departments_list;\n\t}", "function profile($id)\n{\n $profile=new Appointment_Model();\n $profiles=$profile->select_profile($id);\n //print_r($profiles);\n return $profiles;\n}", "public function getZipCode($vzipcode) {\n\n $this->db->select('id, street, complement, district, city, state');\n $this->db->from('state_sp');\n $this->db->where('postalcode =', $vzipcode);\n $query = $this->db->get();\n\n if ($query->result()) {\n $row = $query->result()[0];\n } else {\n $row = FALSE;\n }\n\n /* print \"<pre>\";\n print_r($row);\n print \"</pre>\";\n exit(); */\n //\n return $row;\n }", "public function index(){\n /* return $this->fetch(\"sms_template_list\");*/\n\n $args = M('store_arg')->select();\n //var_dump($args);\n $this->assign('args',$args);\n return $this->fetch(\"args\");\n }", "function provincelist(){\t\t\n\t\t$provlist = $this->travel_model->get_provlist();\n\t\t$this->_json_output($provlist);\n\t}", "function getAllData(){\n $query = $this->db->query('SELECT *FROM project');\n return $query->result();\n }", "public function fetchPlaylist(){\nreturn $this->db->find();\n}", "public function models();", "public function index()\n\t{\n\t\t$db = DB::getInstance();\n\t\t$stmt = $db->prepare(\"SELECT * FROM project \");\n\t\t$stmt->execute();\n\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\n\t}", "public function getDataList(){\n return $this->_get(1);\n }", "public function getTaskListList(){\n return $this->_get(2);\n }", "public function index()\n {\n $result['result'] = $this->zipcode->findAll();\n $result['page'] = 'zipcode';\n $result['page_number'] = (isset($_GET['page']) && $_GET['page']) ? $_GET['page'] : 0;\n if (RequestFacade::ajax()) {\n return view('admin.zip_code_table', $result);\n }\n return view('admin.zipcode', $result);\n }", "public function get_projects()\n {\n\n $this->db->select(\"*\");\n $this->db->from('pr_projects');\n $this->db->where('approved', 1);\n $this->db->order_by(\"id\", \"desc\");\n\n $query = $this->db->get();\n $result = $query->result();\n return $result;\n\n }", "public function getProjectList() { \n $q = Doctrine_Query::create()->from('Project')\n ->orderBy('id');\n \n return $q->execute(); \n }", "function outputCitiesList() {\r\n\t$cities = new CityCollection();\r\n\t$cities->loadCollection();\r\n \r\n\t$result = $cities->getArray();\r\n \r\n\tfor($i=0;$i<$cities->getCount();$i++){\r\n\t\techo '<option value=\"'. $result[$i]->getCityCode(). '\">' . $result[$i]->getAsciiName() . '</option>';\r\n\t}\r\n}", "public function getItemsList(){\n return $this->_get(4);\n }", "function copylist()\n\t{\n\t\t$companydetails=\"SELECT * from company\";\n\t\t$getcompanydetails=$this->get_results( $companydetails );\n\t\treturn $getcompanydetails;\n\t}", "public function getProjects();", "public function getBranchInfo()\n {\n $this->db->select('*');\n $this->db->where('komoku_id', KOMOKU_SHOUSHA);\n $result = $this->db->get('m_komoku');\n return $result->result_array();\n }", "public function get() {\n $model = $this->model;\n $model = $this->preList($model);\n\n return $model->get();\n\t}", "public function get_postal_code_list()\n {\n return $this -> generate_postal_code_list();\n }", "public function Allplanlist($model);", "function portfolio_view()\n {\n $ob = new model();\n $show_port=$ob->portfolio_view_sql();\n return $show_port;\n }", "function get_hasillitbang()\n {\n \n $list = $this->db->from('hasillitbang')->get()->result();\n return $list;\n }", "public function index()\n\t{\n\t\t$this->data['bmjc_list'] = $this->bmjc_mdl->getbmjclist(); \n\t\t$this->load->view('bmjc_list',$this->data);\n\t}", "public function list();", "public function list();", "public function list();", "function GetProjectList()\n\t{\n\t\t$qry=$this->db->query(\"select DISTINCT rp_projects.projectKey,rp_projects.projectID,rp_projects.projectAddedDate,rp_projects.projectStatus,rp_user_plan_details.planTitle,rp_projects.projectKey,rp_project_details.projectName,rp_users.userEmail,rp_user_details.userFirstName,rp_user_types.userTypeStatus,rp_user_type_details.userTypeName from rp_dbho_user_plans_subdetail,rp_dbho_plan_mapping,rp_projects,rp_project_details,rp_users,rp_user_plan_details,rp_user_details,rp_user_to_type,rp_user_types,rp_user_type_details where rp_projects.projectID=rp_project_details.projectID and rp_projects.projectID=rp_dbho_plan_mapping.objectID and rp_dbho_plan_mapping.objectType='project' and rp_dbho_plan_mapping.planID=rp_dbho_user_plans_subdetail.planID and rp_dbho_user_plans_subdetail.listingType='Project' and rp_user_plan_details.planID=rp_dbho_plan_mapping.planID and rp_projects.userID=rp_users.userID and rp_users.userID=rp_user_details.userID and rp_projects.userID=rp_user_to_type.userID and rp_user_to_type.userTypeID =rp_user_types.userTypeID and rp_user_types.userTypeStatus='Active' and rp_user_types.userTypeID=rp_user_type_details.userTypeID and rp_projects.projectStatus!='Deleted' and rp_user_type_details.languageID=1 and rp_project_details.languageID=1 and rp_project_details.versionID=0 and rp_user_details.languageID=1 ORDER BY rp_projects.projectID DESC \"); \n\t\treturn $qry->result(); \n\t}", "function getProjectList()\n\t{\n\t\t//Update Project List\n\t\t$this->Project_List = null;\n\t\t$assigned_projects_rows = returnRowsDeveloperAssignments($this->getUsername(), 'Project');\n\t\tforeach($assigned_projects_rows as $assigned_project)\n\t\t\t$this->Project_List[] = new Projects( $assigned_project['ClientProjectTask'] );\n\t\treturn $this->Project_List;\n\t}", "public function liste()\n {\n $this->load->database();\n\n // Exécute la requête (toujours avec $this->db)\n $results = $this->db->query(\"SELECT * FROM produits\"); \n \n // Récupération des résultats grâce à la methode \"result()\" qui fait un tableau d'objet (chaque ligne de la db est un objet) \n $aProduits = $results->result(); \n return $aProduits;\n }", "function dev_list() {\r\n\tglobal $gResult;\r\n\t$dev_controller = new Developer_Controller(new Developer);\r\n\t$msg = $dev_controller->getAllDevelopers();\r\n\t$gResult = $gResult.$msg;\r\n\treturn cCmdStatus_OK; \r\n}", "public function getPost() {\n //get json post list\n echo $this->model->getPost();\n }", "public function retrieve_class_list()\n\t{\n\t\n\t\t$this->db->select('*');\n\t\t$this->db->from('class_add');\n\t\t$this->db->where('status',1); \n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\treturn false;\n\t}", "function get_companies_list() {\n return get_view_data('org_list');\n}", "function getList() {\n $query = $this->db->query('SELECT * FROM `all_list`');\n return $query->result_array();\n //return $query->result();\n }", "public function getProgramsInsideGroup()\n {\n $groupId = $this->input->post(\"groupId\");\n $programs = $this->Group_Model->getProgramsInsideGroup($groupId);\n echo json_encode($programs);\n }", "function get_all_pinjam()\n {\n $this->db->order_by('no_po', 'desc');\n return $this->db->get('pinjam')->result_array();\n }", "public function list1(){\n $school_name = $this->session->userdata('school_name');\n\t\t$q = $this->db\n\t\t\t\t\t\t->from('userinfo')\n\t\t\t\t\t\t->where('role', 8)\n\t\t\t\t\t\t->where('school_name',$school_name)\n\t\t\t\t\t\t->get();\n\n\t\t//print_r($q);\n\n\t\t$result = $q->result();\n\n\t\t$this->load->view('list_operator',['dblist'=>$result]);\n\t}", "function viewCustomerFullAddress(){\n $customer = new customerModel();\n $customer->cust_id = $_SESSION['userid'];\n return $customer->viewCustomerFullAddress();\n //retrieve data from customerModel\n }", "public function retrieve_class_list()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('class_add');\n\t\t$this->db->where('status',1); \n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\treturn false;\n\t}", "public function getDivision(){\r\n\t$division=$this->db->get('division_tab')->result_array();\r\n\treturn $division;\r\n}", "public function get_data()\n {\n\n\n }", "function fetch_all_workshop($code = 'ak', $is_published = '-1')\n {\n // if($model) $this->db->where_in('id_type',array($model));\n $this->db->order_by('sort', 'asc');\n if ($is_published != -1) {\n $this->db->where('is_published', $is_published);\n }\n $location = $this->db->where('company_code', $code)->get('ref_location');\n // echo last_query();\n if ($location->num_rows() > 0) {\n $location = $location->result_array();\n } else {\n $location = false;\n }\n return $location;\n }", "public function index()\n {\n //\n // return 'test';\n return $this->model->all();\n }", "function listaMarcas()\n{\n include_once \"../model/MARCA.php\";\n $obj_listmarca = new MARCA();\n $result = $obj_listmarca->querylistMarcas();\n return json_encode($result);\n}", "public function getZipCode(){\r\n\t\treturn $this->zipCode;\r\n\t}", "public function pincode_list(){\n $area_id = $_REQUEST['area_id'];\n $pincode_list = $this->User_Model->get_list_by_id2('tahsil_pincode_area as pincode_area , tahsil_pincode_no as pincode_no','tahsil_id',$area_id,'tahsil_pincode');\n if($pincode_list) {\n $response[\"status\"] = TRUE;\n $response[\"pincode_list\"] = $pincode_list;\n } else {\n $response[\"status\"] = FALSE;\n $response[\"pincode_list\"] = $pincode_list;\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public function index(){\n return $this->model->all();\n }", "protected function generate_postal_code_list()\n {\n $sql = \"SELECT PostalCode FROM zip_list\";\n $conn = $this -> connect();\n $stmt = $this -> query($conn, $sql);\n $this -> disconnect($conn);\n\n $list = [];\n while($row = $stmt -> fetch()): $list[] = $row['PostalCode']; endwhile;\n return $list;\n }", "function getBuildingList() {\n return getAll(\"SELECT * FROM building\");\n}", "public function listar(){\r\n }", "public function index()\n\t{\n\t\treturn $this->repo->loadRecord();\n\t}", "public function get_city(){\n $statid = $this->input->post('sid');\n $this->depmodel->get_citylist($statid);\n }", "public function lst()\n\t{\n\t\t$list = AdminModel::paginate(3);\n\t\t$this->assign('list',$list);\n\t\treturn $this->fetch();\n\t}", "public function getShippingList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_shipping');\r\n\t\t$this->db->where('shipping_status', '1');\t\t\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "public function actionList() {\n $criteria = new CDbCriteria();\n //$criteria->index = \"id\";\n $criteria->order = \"id desc\";\n $count = EpcModelTemp::model()->count($criteria);\n $pages = new CPagination($count);\n $pages->pageSize = $_GET['rows'];\n $pages->applyLimit($criteria);\n //EpcModelTemp::model()->scenario='list';\n $models = EpcModelTemp::model()->findAll($criteria);\n // 转换成数组\n $rows = array();\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n }\n $rs = array('total' => $count, 'rows' => $rows);\n echo CJSON::encode($rs);\n }", "public function getList()\n {\n }", "public function get_json_map_data(){\n\t\t//$this->load->model('county_model');\n\t\techo $this->county_model->home_map_data($this->get_filter_start_date(),$this->get_filter_stop_date());\n\t}", "public function index()\n {\n //$array = [];\n //$priorities = priorities::find(1);\n //foreach($priorities->projects as $project){\n // array_push($array,$project);\n //} \n //return $array;\n\n //$priorities=DB::table('priorities')->pluck('projects_id');\n\n //$priorities=priorities::all();\n //$array=[];\n //foreach ($priorities as $project){\n // array_push($array,$project->projects);\n //}\n //return $priorities;\n\n $priorities=DB::table('priorities_projects')->where('priorities_id','1')->orWhere('priorities_id','2')->orWhere('priorities_id','3')->orWhere('priorities_id','4')->get();\n return $priorities;\n }", "function client2021Listing()\n {\n $this->db->select('BaseTbl.name ,BaseTbl.mobile');\n $this->db->from('client2021 as BaseTbl');\n $query = $this->db->get();\n \n $result = $query->result(); \n return $result;\n }", "public function get_personas(){\n $consulta=$this->db->query(\"select * from personas;\");\n while($filas=$consulta->fetch_assoc()){\n $this->personas[]=$filas;\n }\n return $this->personas;\n}", "public function getList()\n {\n return $this->model->getList();\n }", "public function get_allproject_details_post()\n {\n $data = $_POST;\n $result = $this->Post_project_model->get_allproject_details($data);\n return $this->response($result); \n }", "public function getList();", "public function getList();", "function get_cabang_list(){\r\n\t\t//$query = isset($_POST['query']) ? $_POST['query'] : \"\";\r\n\t\t//$tgl_app = isset($_POST['tgl_app']) ? $_POST['tgl_app'] : \"\";\r\n\t\t$result=$this->m_public_function->get_cabang_list();\r\n\t\techo $result;\r\n\t}", "function get_kb_groups()\n{\n $CI =& get_instance();\n\n return $CI->db->get('tblknowledgebasegroups')->result_array();\n}", "function get_model_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"make_model\",\"id,name,del_status\",$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "function getdegreebybranchAction(){\r\n \tif($this->getRequest()->isPost()){\r\n \t\t$data=$this->getRequest()->getPost();\r\n \t\t\r\n \t\t$_db = new RsvAcl_Model_DbTable_DbBranch();\r\n \t\t$row = $_db->getBranchById($data['branch_id']);//get branch info\r\n \t\t$schoolOption = $row['schooloptionlist'];\r\n \t\t\r\n \t\t$db = new Application_Model_DbTable_DbGlobal();\r\n \t\t$group = $db->getAllItems(1,null,$schoolOption);\r\n \t\tarray_unshift($group, array ( 'id' =>'','name' =>$this->tr->translate(\"SELECT_DEGREE\")));\r\n \t\tprint_r(Zend_Json::encode($group));\r\n \t\texit();\r\n \t}\r\n }", "public function actionIndex()\n {\n $records = Codes::find()->asArray()->all();\n foreach ($records as $record){\n// echo $record['code'] . PHP_EOL;\n $this->check_code($record);\n }\n\n return ExitCode::OK;\n }", "public function get_directmanagerporj() {\n $project_id = $this->input->post('project_id');\n header('Content-Type: application/x-json; charset=utf-8');\n echo (json_encode($this->Account_model->get_directmanagerasper_proj($project_id)));\n }", "public function getZipEntries(): array;", "function tampillistbuku(){\n\t\t$buku = $this->db->get('buku');\n\t\t//$buku = $this->db->query('select * from buku');\n\n\t\treturn $buku;\n\t}", "public function get_all ();", "public function getFirList(){\r\n $result = $this->db->query(\"SELECT * FROM FIR ORDER BY FIR_no DESC\")->result();\r\n return $result;\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "function getHomePageData() {\n//\t\t$data = $this->db->from('some_table')->getObjects(); // returns array of objects\n\n//\t\tSimple regular call to database:\n//\t\t$data = $this->db->setQuery($sql)->getObjects(); // returns array of objects\n\n\t\treturn array();\n\t}", "public function getZipcode()\n {\n return $this->zipcode;\n }", "public function getZipcode()\n {\n return $this->zipcode;\n }", "public function getZipcode()\n {\n return $this->zipcode;\n }" ]
[ "0.60770637", "0.60148877", "0.5972543", "0.59200054", "0.58738333", "0.5860076", "0.5809836", "0.5748475", "0.571598", "0.56751126", "0.55535996", "0.54852986", "0.54803294", "0.54545736", "0.5418441", "0.5405388", "0.53860366", "0.53449565", "0.5342703", "0.531764", "0.52803534", "0.5279947", "0.5277076", "0.5272548", "0.5265638", "0.5262435", "0.52568704", "0.52562714", "0.52539325", "0.52383846", "0.52304673", "0.52233976", "0.52087754", "0.5202931", "0.5192618", "0.518712", "0.5179237", "0.5177225", "0.516778", "0.515764", "0.5157178", "0.5154452", "0.5148433", "0.5130302", "0.5116859", "0.51143324", "0.51143324", "0.51143324", "0.51115566", "0.5106552", "0.50856423", "0.5085611", "0.5079848", "0.5074735", "0.5067365", "0.50636923", "0.50514716", "0.5049937", "0.5043801", "0.50386333", "0.50334525", "0.5030803", "0.502076", "0.5012575", "0.5012527", "0.5010696", "0.5000993", "0.4994879", "0.4991385", "0.4981174", "0.4978609", "0.49761128", "0.49697313", "0.4966034", "0.4962292", "0.49526158", "0.49507117", "0.49478543", "0.49439806", "0.49266276", "0.49249843", "0.49232614", "0.49208468", "0.49198717", "0.49190345", "0.49190345", "0.4917359", "0.49139655", "0.491093", "0.49087748", "0.49084654", "0.49075636", "0.49055243", "0.4897994", "0.48975912", "0.48967928", "0.48908788", "0.48908383", "0.4890788", "0.4890788", "0.4890788" ]
0.0
-1
end add project form......................... comment form
public function communication() { $this->addElement('textarea','c_massage',array( 'class' => 'form-control required user_text userChatMsgInput' , "required"=>true, "rows"=>3, "label"=>"Write Message...", "placeholder"=>"Enter your Message.....", "filter"=> array("StringTrim","StripTags","HtmlEntities"), "validators"=> array( array("NotEmpty",true,array("messages"=>"Enter comment ")) ), )); // save btn $this->addElement('button', 'savebtn', array ( 'class' => 'btn-lg blue site_button ', 'ignore'=>true, 'type'=>'button', 'label'=>'Send', 'escape'=>false )); $this->savebtn->setDecorators(array('ViewHelper',array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' =>'form-actions text-right')) )); //cancel btn $this->addElement('button','cancelbtn',array( 'class'=> 'btn sign_inn login_btnn', 'type' => 'reset', 'ignore'=>true, 'label'=>'Cancel', 'escape'=>false )); $this->cancelbtn->setDecorators(array('ViewHelper',array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-actions')) )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit()\n\t{\n\t//mnot finished\n\t\techo '<div id=\"content\">';\n\t\t$this->par->load(\"form2\",\"fb\");\n\t\t$fb = $this->par->fb;\n\t\t$fb->_init(false,\" id=\\\"forms\\\"\",false,true);//autofill=false, validate = true\n\t\t\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'label' => 'Project Name:',\n\t\t\t\t'name' => 'name',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'User ID',\n\t\t\t\t'name' => 'userID',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'Start Month',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'name' => 'start_month',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'Start Day(e.g., 01)',\n\t\t\t\t'name' => 'start_day',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'Start Year',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'name' => 'start_year',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'End Month',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'name' => 'End_month',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'End Day(e.g., 01)',\n\t\t\t\t'name' => 'End_day',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'End Year',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'name' => 'End_year',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'Possible Domain:',\n\t\t\t\t'name' => 'domain'\n\t\t\t),array(\n\t\t\t\t'label' => 'Possible Host:',\n\t\t\t\t'name' => 'host'\n\t\t\t)\n\t\t);\n\t\t\n\t\t$fb->set_select(\"start_month\",array(\"Jan\"=>1,\"Feb\"=>2,\"Mar\"=>3,\"Apr\"=>4,\"May\"=>5,\"Jun\"=>6,\"Jul\"=>7,\"Aug\"=>8,\"Sep\"=>9,\"Oct\"=>10,\"Nov\"=>11,\"Dec\"=>12));\n\t\t$year= date('Y');\n\t\t$fb->set_select(\"start_year\",array(($year-1)=>$year-1,($year)=>$year,($year+1)=>$year+1,($year+2)=>$year+2,($year+3)=>$year+3,($year+4)=>$year+4));\n\t\t$fb->set_select(\"End_month\",array(\"Jan\"=>1,\"Feb\"=>2,\"Mar\"=>3,\"Apr\"=>4,\"May\"=>5,\"Jun\"=>6,\"Jul\"=>7,\"Aug\"=>8,\"Sep\"=>9,\"Oct\"=>10,\"Nov\"=>11,\"Dec\"=>12));\n\t\t$year= date('Y');\n\t\t$fb->set_select(\"End_year\",array(($year-1)=>$year-1,($year)=>$year,($year+1)=>$year+1,($year+2)=>$year+2,($year+3)=>$year+3,($year+4)=>$year+4));\n\t\t\n\t\t$fb->set_inputs($params);\n\t\tif($fb->error == TRUE)\n\t\t{\n\t\t\t$fb->display();\n\t\t}\n\t\telse\n\t\t{\t\n $inputs = $fb->get_inputs();\n var_dump($inputs);\n\t\t\t$this->par->DB->update_projects($inputs);\n\t\t\t$this->view();\n\t\t}\t\n\t\techo '</div>';\n\t}", "function mft_form_comment_form_alter(&$form, &$form_state) {\n $form['author']['homepage']['#access'] = FALSE;\n $form['actions']['submit']['#value'] = t('Post');\n}", "function add_project(){\n\n\tif(isset($_SESSION['username'])){\t\n\tif($_GET['action']==='add' && $_GET['type']==='project'){\n\t\t$project_name = strtolower(trim(mysql_prep($_POST['project_name'])));\n\t\t$content = trim(mysql_prep($_POST['content']));\n\t\t$parent = trim(mysql_prep($_POST['parent']));\n\t\t$parent_id = trim(mysql_prep($_POST['parent_id']));\n\t\t$path = ADDONS_PATH.\"project_manager/?action=show&project_name={$project_name}\";\n\t\t$author = $_SESSION['username'];\n\t\t$editor = '';\n\t\t$created = date('c');\n\t\t$last_update ='';\n\t\t$status = 'pending';\n\n\t\tif($_POST['submit'] ==='Add project') {\n\t\t\t$query = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"INSERT INTO `project_manager_project`\n\t\t\t(`id`, `project_name`, `content`, `author`, `project_manager`, `path`, `editor`, `created`, `last_updated`, `status`, `parent`, `parent_id`) \n\t\t\tVALUES ('0','{$project_name}', '{$content}', '{$author}', '{$author}', '{$path}', '{$editor}','{$created}','{$last_updated}','{$status}','{$parent}','{$parent_id}')\") \n\t\t\tor die (\"Error inserting project \". ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n\t\t\tif($query){ \n\t\t\t\tactivity_record(\n\t\t\t\t\t$parent_id = $result['id'],\n\t\t\t\t\t$actor=$author,\n\t\t\t\t\t$action=' created the project ',\n\t\t\t\t\t$subject_name = $project_name,\n\t\t\t\t\t$actor_path = BASE_PATH.'user/?user='.$author,\n\t\t\t\t\t$subject_path= ADDONS_PATH.'project_manager/?action=show&project_name='.$project_name,\n\t\t\t\t\t$date = $created,\n\t\t\t\t\t$parent='project_manager'\n\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\tsession_message(\"success\", \"project saved successfully!\"); \n\t\t\t\tredirect_to($_SESSION['prev_url']);\n\t\t\t}\n\t\t}\n\n\t\tif(isset($_GET['parent'])){\n\t\t\t$parent = $_GET['parent'];\n\t\t\t}\n\t\tif(isset($_GET['tid'])){\n\t\t\t$parent_id = $_GET['tid'];\n\t\t\t}\n\t\techo '<h2 align=\"center\">Add Project</h2><hr><form method=\"post\" action=\"'.$_SESSION['current_url'].'\">\n\t\tName :<br><input type=\"text\" name=\"project_name\" value=\"\" placeholder=\"Project name\"><br>\n\t\t<input type=\"hidden\" name=\"parent\" value=\"'.$parent.'\"> \n\t\t<input type=\"hidden\" name=\"parent_id\" value=\"'.$parent_id.'\"> \n\t\tDescription: <br><textarea name=\"content\" size=\"5\"> What is this project about ?</textarea>\n\t\t<input type=\"submit\" name=\"submit\" value=\"Add project\" class=\"button-primary\">\n\t\t</form>\t';\n\t\t}\n\t}\n}", "function register_block_core_post_comments_form()\n {\n }", "public function addQuestionAction()\n {\n\n if($this->UserauthenticationController->isAuthenticated()) {\n \n $form = new \\Mos\\HTMLForm\\CForm(array(), array(\n 'title' => array(\n 'type' => 'text',\n 'label' => 'Rubrik:',\n 'required' => true,\n 'validation' => array('not_empty'),\n ), \n 'text' => array(\n 'type' => 'textarea',\n 'label' => 'Text:',\n 'required' => true,\n 'validation' => array('not_empty'),\n ), \n 'tags' => array(\n 'type' => 'text',\n 'label' => 'Taggar (separeras med kommatecken):',\n 'required' => true,\n 'validation' => array('not_empty'),\n ), \n 'submit' => array(\n 'type' => 'submit',\n 'value' => 'Publicera fråga',\n 'callback' => function($form) {\n return true;\n }\n ),\n )\n );\n \n // Check the status of the form\n $status = $form->Check();\n \n // What to do if the form was submitted\n if($status === true) {\n \n $now = gmdate('Y-m-d H:i:s');\n \n $sql = \"INSERT INTO mvc_comments (commentTypeId, userId, userAcronym, userEmail, title, text, created) VALUES ('1', '\" . $_SESSION['user']->id . \"', '\" . $_SESSION['user']->acronym . \"', '\" . $_SESSION['user']->email . \"', '\" . $form->Value('title') . \"', '\" . $form->Value('text') . \"', '\" . $now . \"')\";\n $res = $this->db->executeFetchAll($sql);\n $qid = $this->db->lastInsertId();\n \n // Separate the defined tags for this question.\n $tagsSep = explode(\",\", strtolower($form->Value('tags')));\n foreach ($tagsSep as $key => $val) {\n if (!$this->tagExistAction($val)) {\n $trimmed = trim($val);\n $sql = \"INSERT INTO mvc_tag (name) VALUES (?)\";\n $res = $this->db->executeFetchAll($sql,array($trimmed));\n $tagId = $this->db->lastInsertId();\n }\n else {\n $tagId = $this->getTagIdAction($val);\n }\n $sql = \"INSERT INTO mvc_tag2question (idQuestion, idTag) VALUES (?, ?)\";\n $res = $this->db->executeFetchAll($sql,array($qid, $tagId));\n }\n \n $url = $this->url->create('') . '/question/view/' . $qid;\n $this->response->redirect($url);\n }\n \n // What to do when form could not be processed\n else if($status === false){\n header(\"Location: \" . $_SERVER['PHP_SELF']);\n }\n \n $this->theme->setTitle(\"Skapa en ny fråga\");\n \n $this->views->add('comment/form', [\n 'title' => \"Skapa en ny fråga\",\n 'content' => $form->getHTML()\n ]);\n \n }\n }", "public function edit(Projcomment $projcomment)\n {\n //\n }", "public function addproject() {\n\t\t\t\n\t\t\t\n\t\t}", "function warquest_home_comment_edit_do() {\r\n\r\n\t/* input */\r\n\tglobal $mid;\r\n\tglobal $sid;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\t\t \r\n\t/* output */\r\n\tglobal $page;\r\n\t\t\t\r\n\tif ($uid!=0) {\r\n\t\t$query = 'select comment from comment where id='.$uid;\r\n\t\t$result = warquest_db_query($query);\r\n\t\t$data = warquest_db_fetch_object($result);\r\n\t\t\r\n\t\t$comment = $data->comment;\r\n\t\t\r\n\t} else {\r\n\t\r\n\t\t/* Clear input parameters */\r\n\t\t$comment = \"\";\r\n\t}\r\n\t\r\n\t$page .= \"<script language=\\\"JavaScript\\\" type=\\\"text/javascript\\\">function limitText(limitField, limitNum) { if (limitField.value.length >= limitNum) { limitField.value = limitField.value.substring(0, limitNum); } } </script>\";\r\n\t\t\r\n\t$page .= '<div class=\"box\">';\t\r\n\t\r\n\t$page .= '<table>';\r\n\t$page .= '<tr>';\r\n\t$page .= '<td width=\"500\">';\r\n\r\n\tif (isset($other->pid)) {\r\n\t\t$tmp = player_format($other->pid, $other->name, $other->country);\r\n\t} else {\r\n\t\t$tmp = t('GENERAL_ALL');\r\n\t}\r\n\t$page .= t('ALLIANCE_COMMENT_TEXT2', $tmp).'<br/>'; \r\n\t\r\n\t$page .= '<textarea style=\"width:100%\" id=\"comment\" name=\"comment\" rows=\"5\" ';\r\n\t$page .= 'onKeyDown=\"limitText(this,400)\">'.$comment.'</textarea><br/>';\r\n\t$page .= warquest_show_smilies();\r\n\t$page .= '<br/><br/>';\r\n\t\r\n\tif (isset($other->pid)) {\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_SAVE.'&oid='.$other->pid.'&uid='.$uid, t('LINK_SAVE'), 'save').' ';\r\n\t} else {\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_SAVE.'&uid='.$uid, t('LINK_SAVE'), 'save').' ';\r\n\t}\r\n\t\r\n\tif ($uid!=0) {\r\n\t\t$page .= ' ';\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_DELETE.'&uid='.$uid, t('LINK_DELETE'), 'delete');\r\n\t}\r\n\t\r\n\t$page .= '</td>';\r\n\t$page .= '</tr>';\r\n\t$page .= '</table>';\r\n\r\n\t$page .= '</div>';\t\r\n}", "public function displayBeforeForm(){\n if(get_post_type() != WPLMS_ASSIGNMENTS_CPT)\n return;\n if(empty($this->plupload_assignment_e_d))\n echo '</form><form action=\"'.site_url( '/wp-comments-post.php' ).'\" method=\"post\" enctype=\"multipart/form-data\" id=\"attachmentForm\" class=\"comment-form\" novalidate>';\n }", "public function commenting() {\n if(strlen($this->request->getParameter(\"content\")) > 10)\n {\n $postId = $this->request->getParameter(\"id\");\n $author = $this->request->getParameter(\"author\");\n $content = $this->request->getParameter(\"content\");\n \n $this->comment->addComment($author, $content, $postId);\n $this->redirect('Post','index/'.$postId);\n }\n else {\n echo \"Commentaire trop court\";\n }\n \n // Execute the default action to reload and display the Posts list\n $this->executeAction(\"index\");\n\n }", "public function add_project() \n\t{\n\t\t//form validation rules\n\t\t$this->form_validation->set_rules('project_instructions', 'project Instructions', 'required|xss_clean');\n\t\t$this->form_validation->set_rules('project_start_date', 'Project Start Date', 'required|xss_clean');\n\t\t$this->form_validation->set_rules('project_end_date', 'Project End Date', 'required|xss_clean');\n\t\t\n\t\t//if form has been submitted\n\t\tif ($this->form_validation->run())\n\t\t{\n\t\t\tif($this->projects_model->add_project())\n\t\t\t{\n\t\t\t\t$this->session->set_userdata('success_message', 'Youhave successfully added a project');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->session->set_userdata('error_message', 'Could not update project. Please try again');\n\t\t\t}\n\t\t\tredirect('tree-planting/projects');\n\t\t}\n\t\t\n\t\t//open the add new project\n\t\t$data['title'] = 'Add project';\n\t\t$v_data['title'] = 'Add project';\n\t\t$v_data['project_status_query'] = $this->projects_model->get_project_status();\n\n\t\t$data['content'] = $this->load->view('projects/projects/add_project', $v_data, true);\n\t\t\n\t\t$this->load->view('admin/templates/general_page', $data);\n\t}", "public function newProjectAction()\n\t\t{\n\n\t\t\tif(!empty($_POST))\n\t\t\t{\n\t\t\t\t$project=new Projects($_POST);\n\n\t\t\t\t$user=Auth::getUser();\n\n\t\t\t\tif($project->save($user->id))\n\t\t\t\t{\n\t\t\t\t\t$id=$project->returnLastID()[0];\n\n\t\t\t\t\tforeach($project->tasks as $task)\n\t\t\t\t\t{\n\t\t\t\t\t\tTasks::save($task, $id);\n\t\t\t\t\t}\n\n\t\t\t\t\tImages::save($project->imagepath, $id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function addCommentAction($parent=null)\n {\n\n if($this->UserauthenticationController->isAuthenticated()) {\n \n $post = $this->getQuestionById($parent);\n \n if($post[0]['commentTypeId'] == 1){\n $qid = $post[0]['id'];\n }\n else {\n $qid = $post[0]['questionId'];\n }\n \n $qt = $post[0]['title'];\n \n $form = new \\Mos\\HTMLForm\\CForm(array(), array(\n 'text' => array(\n 'type' => 'textarea',\n 'label' => 'Text:',\n 'required' => true,\n 'validation' => array('not_empty'),\n ), \n 'submit' => array(\n 'type' => 'submit',\n 'value' => 'Publicera kommentar',\n 'callback' => function($form) {\n return true;\n }\n ),\n )\n );\n \n // Check the status of the form\n $status = $form->Check();\n \n // What to do if the form was submitted\n if($status === true) {\n \n $now = gmdate('Y-m-d H:i:s');\n \n $sql = \"INSERT INTO mvc_comments (commentTypeId, questionId, parentId, userId, userAcronym, userEmail, title, text, created) VALUES ('3', '\" . $qid . \"','\" . $parent . \"','\" . $_SESSION['user']->id . \"', '\" . $_SESSION['user']->acronym . \"', '\" . $_SESSION['user']->email . \"', '\" . $qt . \"', '\" . $form->Value('text') . \"', '\" . $now . \"')\";\n $res = $this->db->executeFetchAll($sql);\n $qw = '/question/view/' . $qid;\n $url = $this->url->create('') . $qw;\n $this->response->redirect($url);\n }\n \n // What to do when form could not be processed\n else if($status === false){\n header(\"Location: \" . $_SERVER['PHP_SELF']);\n }\n\n $this->views->add('comment/view_single_post', [\n 'presentation' => $post\n ]);\n \n $this->theme->setTitle(\"Skriv en kommentar\");\n \n $this->views->add('comment/form', [\n 'title' => \"Skriv en kommentar\",\n 'content' => $form->getHTML()\n ]);\n }\n }", "function getButton_addComment() {\r\r\n\t$PView = new PView;\r\r\n\t// PERMISSION!!!\r\r\n\tif ($PView -> getPermission(\"config\",\"permComment\",\"\")) {\r\r\n\t\tif (!$_GET['comment'] && !$_POST['submit']) {\r\r\n\t\t\t$btn = \"<a href='javascript:pv_CommentAdd();'><img src='\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/comment_add.png' border='0px'alt='\".LAN_IMAGE_18.\"' title='\".LAN_IMAGE_18.\"'></a>\";\r\r\n\t\t}\r\r\n\t}\r\r\n\treturn $btn;\r\r\n}", "function siemens_lendingform_edit_form_wrapper($lendingform) { \r\n ctools_include('modal');\r\n ctools_include('ajax');\r\n\r\n $form_state = array(\r\n 'title' => t('Edit Project'),\r\n 'ajax' => TRUE,\r\n );\r\n $output = ctools_modal_form_wrapper('siemens_lendingform_delete_confirm', $form_state);\r\n\r\n if ($form_state['executed']) {\r\n $returnback = drupal_get_query_parameters();\r\n if (isset($returnback['returnback'])) {\r\n drupal_goto($returnback['returnback'], array('query' => array('tab' => 2)));\r\n } else {\r\n\r\n $commands = array();\r\n $commands[] = ctools_modal_command_dismiss(); \r\n \r\n $citation_list = siemens_citations_get_citations($lendingform->entity_id);\r\n $commands[] = ajax_command_html('#siemens-existing-references', $citation_list);\r\n\r\n print ajax_render($commands);\r\n exit();\r\n }\r\n }\r\n\r\n print ajax_render($output);\r\n exit();\r\n}", "function deleteProjectComments()\n\t\t{\n\t\t\t$this->load->model('User_model');\n\t\t\t$commentID = $_POST[\"commentID\"];\n\t\t\t\n\t\t\t$query = $this->User_model->DeleteProjectCommentModel($commentID);\n\t\t\tif($query)\n\t\t\t{\n\t\t\t\techo 'deleted';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 'not deleted';\n\t\t\t}\n\t\t}", "public function addComment()\n {\n session_start();\n $superglobalsPost = $this->getSuperglobals()->get_POST();\n $newComment = new CommentManager;\n $superglobalsPost['status'] = \"waiting\";\n $newComment->createComment($superglobalsPost);\n if (isset($superglobalsPost['post_id'])) {\n $post_id = $superglobalsPost['post_id'];\n }\n $titleAction = \"Confirmation d'enregistrement\"; //confirmation message\n $actionConfirmation = \"/post?id=\" . $post_id;\n $textConfirmation = \"Votre commentaire a bien été enregistré\";\n echo $this->getRender()->render('confirmationTemplate.twig', [\n 'titleAction' => $titleAction,\n 'actionConfirmation' => $actionConfirmation,\n 'textConfirmation' => $textConfirmation,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function MetadataEntryForm()\n {\n // NIWA are worried about parameter case and would like it case insensitive so convert all get vars to lower\n // I think this is because they are not 100% what case the parameters from oracle will be in.\n $params = array_change_key_case($this->getRequest()->getVars(), CASE_LOWER);\n\n // Check in the parameters sent to this page if there are certian fields needed to power the\n // functionality which emails project coordinators and if so get them as we will need to add\n // them to the bottom of the form as hidden fields, this way we can access them in the form\n // processing and send the email.\n $hiddenFields = array();\n\n // These 2 fields can be populated either by Project_Coordinator or Project_Administrator as Oracle actually\n // sends Project_Administrator. NIWA want to keep the field here called coordinator.\n if (!empty($params['project_coordinator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_coordinator'];\n } else if (!empty($params['project_administrator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_administrator'];\n }\n\n if (!empty($params['project_coordinator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_coordinator_email'];\n } else if (!empty($params['project_administrator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_administrator_email'];\n }\n\n if (!empty($params['project_manager'])) {\n $hiddenFields['_Project_Manager'] = $params['project_manager'];\n }\n\n if (!empty($params['project_code'])) {\n $hiddenFields['_Project_Code'] = $params['project_code'];\n }\n\n // Get the fields defined for this page, exclude the placeholder fields as they are not displayed to the user.\n $metadataFields = $this->Fields()->where(\"FieldType != 'PLACEHOLDER'\")->Sort('SortOrder', 'asc');\n\n // Create fieldfield for the form fields.\n $formFields = FieldList::create();\n $actions = FieldList::create();\n $requiredFields = array();\n\n // Push the required fields message as a literal field at the top.\n $formFields->push(\n LiteralField::create('required', '<p>* Required fields</p>')\n );\n\n if ($metadataFields->count()) {\n foreach($metadataFields as $field) {\n // Create a version of the label with spaces replaced with underscores as that is how\n // any paraemters in the URL will come (plus we can use it for the field name)\n $fieldName = str_replace(' ', '_', $field->Label);\n $fieldLabel = $field->Label;\n\n // If the field is required then add it to the required fields and also add an\n // asterix to the end of the field label.\n if ($field->Required) {\n $requiredFields[] = $fieldName;\n $fieldLabel .= ' *';\n }\n\n // Check if there is a parameter in the GET vars with the corresponding name.\n $fieldValue = null;\n\n if (isset($params[strtolower($fieldName)])) {\n $fieldValue = $params[strtolower($fieldName)];\n }\n\n // Define a var for the new field, means no matter the type created\n // later on in the code we can apply common things like the value.\n $newField = null;\n\n // Single line text field creation.\n if ($field->FieldType == 'TEXTBOX') {\n $formFields->push($newField = TextField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'TEXTAREA') {\n $formFields->push($newField = TextareaField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'KEYWORDS') {\n // If keywords then output 2 fields the textbox for the keywords and then also a\n // literal read only list of those already specified by the admin below.\n $formFields->push($newField = TextAreaField::create($fieldName, $fieldLabel));\n $formFields->push(LiteralField::create(\n $fieldName . '_adminKeywords',\n \"<div class='control-group' style='margin-top: -12px'>Already specified : \" . $field->KeywordsValue . \"</div>\"\n ));\n } else if ($field->FieldType == 'DROPDOWN') {\n // Some dropdowns have an 'other' option so must add the 'other' to the entries\n // and also have a conditionally displayed text field for when other is chosen.\n $entries = $field->DropdownEntries()->sort('SortOrder', 'Asc')->map('Key', 'Label');\n\n if ($field->DropdownOtherOption == true) {\n $entries->push('other', 'Other');\n }\n\n $formFields->push(\n $newField = DropdownField::create(\n $fieldName,\n $fieldLabel,\n $entries\n )->setEmptyString('Select')\n );\n\n if ($field->DropdownOtherOption == true) {\n $formFields->push(\n TextField::create(\n \"${fieldName}_other\",\n \"Please specify the 'other'\"\n )->hideUnless($fieldName)->isEqualTo(\"other\")->end()\n );\n\n //++ @TODO\n // Ideally if the dropdown is required then if other is selected the other field\n // should also be required. Unfortunatley the conditional validation logic of ZEN\n // does not work in the front end - so need to figure out how to do this.\n }\n }\n\n // If a new field was created then set some things on it which are common no matter the type.\n if ($newField) {\n // Set help text for the field if defined.\n if (!empty($field->HelpText)) {\n $newField->setRightTitle($field->HelpText);\n }\n\n // Field must only be made readonly if the admin specified that they should be\n // provided that a value was specified in the URL for it.\n if ($field->Readonly && $fieldValue) {\n $newField->setReadonly(true);\n }\n\n // Set the value of the field one was plucked from the URL params.\n if ($fieldValue) {\n $newField->setValue($fieldValue);\n }\n }\n }\n\n // Add fields to the bottom of the form for the user to include a message in the email sent to curators\n // this is entirely optional and will not be used in most cases so is hidden until a checkbox is ticked.\n $formFields->push(\n CheckboxField::create('AdditionalMessage', 'Include a message from me to the curators')\n );\n\n // For the email address, because its project managers filling out the form, check if the Project_Manager_email\n // has been specified in the URL params and if so pre-populate the field with that value.\n $formFields->push(\n $emailField = EmailField::create('AdditionalMessageEmail', 'My email address')\n ->setRightTitle('Please enter your email address so the curator knows who the message below is from.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n if (isset($params['project_manager_email'])) {\n $emailField->setValue($params['project_manager_email']);\n }\n\n $formFields->push(\n TextareaField::create('AdditionalMessageText', 'My message')\n ->setRightTitle('You can enter a message here which is appended to the email sent the curator after the record has successfully been pushed to the catalogue.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n // If there are any hidden fields then loop though and add them as hidden fields to the bottom of the form.\n if ($hiddenFields) {\n foreach($hiddenFields as $key => $val) {\n $formFields->push(\n HiddenField::create($key, '', $val)\n );\n }\n }\n\n // We have at least one field so set the action for the form to submit the entry to the catalogue.\n $actions = FieldList::create(FormAction::create('sendMetadataForm', 'Send'));\n } else {\n $formFields->push(\n ErrorMessage::create('No metadata entry fields have been specified for this page.')\n );\n }\n\n // Set up the required fields validation.\n $validator = ZenValidator::create();\n $validator->addRequiredFields($requiredFields);\n\n // Create form.\n $form = Form::create($this, 'MetadataEntryForm', $formFields, $actions, $validator);\n\n // Check if the data for the form has been saved in the session, if so then populate\n // the form with this data, if not then just return the default form.\n $data = Session::get(\"FormData.{$form->getName()}.data\");\n\n return $data ? $form->loadDataFrom($data) : $form;\n }", "private function add_project()\n {\n \t$helperPluginManager = $this->getServiceLocator();\n \t$serviceManager = $helperPluginManager->getServiceLocator();\n \t$projects = $serviceManager->get('PM/Model/Projects');\n \t$result = $projects->getProjectById($this->pk);\t\n \t\n \tif($result)\n \t{\n \t\t$company_url = $this->view->url('companies/view', array('company_id' => $result['company_id']));\n \t\t$project_url = $this->view->url('projects/view', array('company_id' => FALSE, 'project_id' => $result['id']));\n \t\t\n \t\t$this->add_breadcrumb($company_url, $result['company_name']);\n \t\t$this->add_breadcrumb($project_url, $result['name'], TRUE);\n \t}\n }", "protected function formCreate() {\n\t\t$this->pxyLink = new \\QCubed\\Control\\Proxy($this);\n\t\t$this->pxyLink->AddAction(new \\QCubed\\Event\\MouseOver(), new \\QCubed\\Action\\Ajax('mouseOver'));\n\n\t\t// Define the DataGrid\n\t\t$this->tblProjects = new \\QCubed\\Project\\Control\\Table($this);\n\n\t\t// This css class is used to style alternate rows and the header, all in css\n\t\t$this->tblProjects->CssClass = 'simple_table';\n\n\t\t// Define Columns\n\n\t\t// Create a link column that shows the name of the project, and when clicked, calls back to this page with an id\n\t\t// of the item clicked on\n\t\t$this->tblProjects->CreateLinkColumn('Project', '->Name', \\QCubed\\Project\\Application::instance()->context()->scriptName(), ['intId'=>'->Id']);\n\n\t\t// Create a link column using a proxy\n\t\t$col = $this->tblProjects->CreateLinkColumn('Status', '->ProjectStatusType', $this->pxyLink, '->Id');\n\n\t\t$this->tblProjects->SetDataBinder('tblProjects_Bind');\n\n\t\t$this->pnlClick = new \\QCubed\\Control\\Panel($this);\n\n\t\tif (($intId = \\QCubed\\Project\\Application::instance()->context()->queryStringItem('intId')) && ($objProject = Project::Load($intId))) {\n\t\t\t$this->pnlClick->Text = 'You clicked on ' . $objProject->Name;\n\t\t}\n\n\t}", "public function comments()\n\t{\n\t\t$this->_crud->set_table('ent_cr_comments');\n\t\t$this->_crud->set_subject('Comment');\n\t\t$this->_crud->set_relation('ent_cr_recipes_id','ent_cr_recepies','title');\n\t\t$this->_crud->display_as('ent_cr_recepies_id', 'Recipe');\n\t\t$this->_crud->required_fields('name', 'email', 'comments', 'ent_cr_recipes_id');\n\t\tstatic::$data['name'] = 'crud';\n\t\tstatic::$data['content_replace'] = $this->_crud->render();\n\n\t\t$this->_crud_output('main', static::$data);\n\t}", "public function addComment(): void{\n Quizzes::addComment($_SESSION[\"quizID\"], $_SESSION[\"email\"], $_POST[\"commentText\"]);\n\n $qfa = new QuizFinishUser($_SESSION[\"q\"], $_SESSION[\"ua\"], $_SESSION[\"aa\"]);\n $qfa->generateHTML();\n }", "public function chooseProjectAction() { \n\n //ONLY LOGGED IN USER CAN EDIT THE STYLE\n if (!$this->_helper->requireUser()->isValid())\n return; \n $this->view->TabActive = 'projects';\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer(); \n //GET LISTING ID AND OBJECT\n $listing_id = $this->_getParam('listing_id');\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n $this->view->parent_id = $sitereview->getIdentity();\n $this->view->parent_type = $sitereview->getType();\n $listingtype_id = $sitereview->listingtype_id; \n\n //IF ADMIN HAVE SELECTED ANY PROJECT FOR LISTING PROFILE THAN DO NOT SHOW THE PROJECTS TAB OF DASHBAORD\n $adminSelectedProject = Engine_Api::_()->sitecrowdfunding()->adminSelectedProject(\"sitereview_index_view_listtype_\".$listingtype_id);\n if(!empty($adminSelectedProject)) {\n return;\n }\n //SET sitereview SUBJECT\n Engine_Api::_()->core()->setSubject($sitereview);\n if (!$sitereview->authorization()->isAllowed($viewer, \"edit_listtype_$listingtype_id\")) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n } \n //CAN EDIT OR NOT\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, $viewer, \"edit_listtype_$listingtype_id\")->isValid()) {\n return;\n } \n $this->view->form = $form = new Sitecrowdfunding_Form_ChooseProjectContentModule(array('item' => $sitereview));\n\n //CHECK METHOD\n if (!$this->getRequest()->isPost()) {\n return;\n } \n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n $values = $form->getValues();\n foreach ($values as $key => $value) {\n if (Engine_Api::_()->getApi('settings', 'core')->hasSetting($key)) {\n Engine_Api::_()->getApi('settings', 'core')->removeSetting($key);\n }\n if (is_null($value)) {\n $value = \"\";\n }\n Engine_Api::_()->getApi('settings', 'core')->setSetting($key, $value);\n }\n $form->addNotice($this->view->translate('Your changes have been saved successfully.'));\n }", "private function addEditFormAfterContent() {\n\t\t// this div is opened when encapsulating the default editor in addEditFormBeforeContent.\n\t\treturn '</div><div style=\"clear: both\"></div>';\n\t}", "function storyForm($op) {\n // Generate new form object based on operation.\n if ($op == 'add') {\n $this->form = new HTML_QuickForm('add_story', 'POST', '/story/add');\n $btnLabel = 'Add';\n }\n elseif ($op == 'edit') {\n $this->form = new HTML_QuickForm('edit_story', 'POST', $this->f3->get('PATH'));\n $btnLabel = 'Save';\n }\n elseif ($op == 'delete') {\n $this->form = new HTML_QuickForm('deleteStory', 'POST', $this->f3->get('PATH'));\n $btnLabel = 'Delete';\n }\n\n // These fields only apply to add and edit operations.\n if ($op == 'add' || $op == 'edit') {\n // Add form elements\n $this->form->addElement('text', 'title', 'Title', ['class' => 'form-control']);\n $this->form->addElement('text', 'authors', 'Author(s)', ['class' => 'form-control']);\n $this->form->addElement('text', 'shortTitle', 'URL Friendly Title', ['class' => 'form-control']);\n\n // Set max size for file upload\n $this->form->setMaxFileSize($this->f3->get('maxFileSize'));\n $this->form->addElement('file', 'titlePage', 'Title Page', ['class' => 'form-control']);\n $this->form->addElement('radio', 'publish', 'Publish', 'Now', true, ['class' => 'form-check-input', 'id' => 'publish1']);\n $this->form->addElement('radio', 'publish', null, 'Later', false, ['class' => 'form-check-input', 'id' => 'publish2']);\n $this->form->addElement('text', 'date', 'Publish Date', ['class' => 'form-control', 'id' => 'datepicker']);\n }\n\n // Display buttons for all operations.\n $this->form->addElement('submit', 'btnSubmit', $btnLabel, ['class' => 'btn btn-primary']);\n $this->form->addElement('button','btnCancel','Cancel',['onClick' => \"window.location.href='/stories'\", 'class' => 'btn btn-outline-primary']);\n\n // Rules only apply for add and edit operations.\n if ($op == 'add' || $op == 'edit') {\n // Add validation.\n $this->form->addRule('title', 'Title is required', 'required');\n $this->form->addRule('shortTitle', 'Require field', 'required');\n\n // Only require a file upload on the add form.\n if ($op == 'add') {\n $this->form->addRule('titlePage', 'File is required', 'uploadedfile');\n }\n\n // Add custom validation rules found in \\Validation.\n $this->form->registerRule('uniqueShortTitle', 'function', 'validateShortTitle', $this->validation);\n $this->form->addRule('shortTitle', 'Short Title already exists', 'uniqueShortTitle', $this->identifier);\n // Picture dimensions must be specific size before upload\n $this->form->registerRule('pictureDimensions', 'function', 'validatePictureDimensions', $this->validation);\n $ruleMsg = 'Picture Dimensions are too small! Min Width: ' . $this->f3->get('imgLarge') . ' Min Height: ' . $this->f3->get('imgMinHeight');\n $this->form->addRule('titlePage', $ruleMsg, 'pictureDimensions');\n\n // Picture Mime Type must be of type jpg.\n $this->form->registerRule('pictureMimeType', 'function', 'validateMimeType', $this->validation);\n $this->form->addRule('titlePage', 'Picture file type not supported', 'pictureMimeType');\n\n }\n }", "function displayForm() {\n $output = '<form action=\"\" method=\"post\" name=\"commentForm\">' . \"\\n\";\n\n if ( $this->allow ) {\n $pos = strpos(\n strtoupper( addslashes( $this->allow ) ),\n strtoupper( addslashes( $this->getUser()->getName() ) )\n );\n }\n\n // 'comment' user right is required to add new comments\n if ( !$this->getUser()->isAllowed( 'comment' ) ) {\n $output .= wfMessage( 'comments-not-allowed' )->parse();\n } else {\n // Blocked users can't add new comments under any conditions...\n // and maybe there's a list of users who should be allowed to post\n // comments\n if ( $this->getUser()->isBlocked() == false && ( $this->allow == '' || $pos !== false ) ) {\n $output .= '<div class=\"c-form-title\">' . wfMessage( 'comments-submit' )->plain() . '</div>' . \"\\n\";\n $output .= '<div id=\"replyto\" class=\"c-form-reply-to\"></div>' . \"\\n\";\n // Show a message to anons, prompting them to register or log in\n if ( !$this->getUser()->isLoggedIn() ) {\n $login_title = SpecialPage::getTitleFor( 'Userlogin' );\n $register_title = SpecialPage::getTitleFor( 'Userlogin', 'signup' );\n $output .= '<div class=\"c-form-message\">' . wfMessage(\n 'comments-anon-message',\n htmlspecialchars( $register_title->getFullURL() ),\n htmlspecialchars( $login_title->getFullURL() )\n )->text() . '</div>' . \"\\n\";\n }\n\n $output .= '<textarea name=\"commentText\" id=\"comment\" rows=\"5\" cols=\"64\"></textarea>' . \"\\n\";\n $output .= '<div class=\"c-form-button\"><input type=\"button\" value=\"' .\n wfMessage( 'comments-post' )->plain() . '\" class=\"site-button\" /></div>' . \"\\n\";\n }\n $output .= '<input type=\"hidden\" name=\"action\" value=\"purge\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"pageId\" value=\"' . $this->id . '\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"commentid\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"lastCommentId\" value=\"' . $this->getLatestCommentID() . '\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"commentParentId\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"' . $this->pageQuery . '\" value=\"' . $this->getCurrentPagerPage() . '\" />' . \"\\n\";\n $output .= Html::hidden( 'token', $this->getUser()->getEditToken() );\n }\n $output .= '</form>' . \"\\n\";\n return $output;\n }", "function dispEapprvDeleteComment(){\n\t\t$comment_srl = Context::get('comment_srl');\n\n\t\t// if the comment exists, then get the comment information\n\t\tif($comment_srl)\n\t\t{\n\t\t\t$oCommentModel = getModel('comment');\n\t\t\t$oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager);\n\t\t}\n\t\t\n\t\t\t\t// if the comment is not granted, then back to the password input form\n\t\tif(!$oComment->isGranted())\n\t\t{\n\t\t\treturn $this->setTemplateFile('input_password_form');\n\t\t}\n\n\t\tContext::set('oComment',$oComment);\n\t\t/**\n\t\t * add JS filters\n\t\t **/\n\t\tContext::addJsFilter($this->module_path.'tpl/filter', 'delete_comment.xml');\n\t\t$this->setTemplateFile('delete_comment_form');\n\t}", "public function run()\n {\n //\n \t$comment = new FormSubmission();\n \t$comment->name ='Trinh Viet Hung';\n \t$comment->email ='[email protected]';\n \t$comment->phone ='01242972979';\n \t$comment->type ='comment';\n \t$comment->metadata ='{\"comment\":\"tour guide nhu cut vote 1*\",\"status\":\"pending\" ,\"tourguide_id\":1,\"name\":\"Trinh Viet Hung\",\"email\":\"[email protected]\",\"phone\":\"01242972979\",\"id\":1}';\n \t$comment->save();\n\n \t$comment = new FormSubmission();\n \t$comment->name ='Trinh Viet Hoang';\n \t$comment->email ='[email protected]';\n \t$comment->phone ='01242972979';\n \t$comment->type ='comment';\n \t$comment->metadata ='{\"comment\":\"tour guide nhu cut vote 1*\",\"status\":\"pending\" ,\"tourguide_id\":1,\"name\":\"Trinh Viet Hoang\",\"email\":\"[email protected]\",\"phone\":\"01242972979\",\"id\":2}';\n \t$comment->save();\n\n\n \t$comment = new FormSubmission();\n \t$comment->name ='Trinh Viet Tuan';\n \t$comment->email ='[email protected]';\n \t$comment->phone ='01242972979';\n \t$comment->type ='comment';\n \t$comment->metadata ='{\"comment\":\"tour guide nhu cut vote 1*\",\"status\":\"pending\" ,\"tourguide_id\":2,\"name\":\"Trinh Viet Tuan\",\"email\":\"[email protected]\",\"phone\":\"01242972979\",\"id\":3}';\n \t$comment->save();\n\n \t$comment = new FormSubmission();\n \t$comment->name ='Trinh Viet Tan';\n \t$comment->email ='[email protected]';\n \t$comment->phone ='01242972979';\n \t$comment->type ='comment';\n \t$comment->metadata ='{\"comment\":\"tour guide nhu cut vote 1*\",\"status\":\"pending\" ,\"tourguide_id\":2,\"name\":\"Trinh Viet Tan\",\"email\":\"[email protected]\",\"phone\":\"01242972979\",\"id\":4}';\n \t$comment->save();\n \n\n $faqs = new FormSubmission();\n $faqs->name ='Trinh Viet a';\n $faqs->email ='[email protected]';\n $faqs->phone ='01242972979';\n $faqs->type ='faqs';\n $faqs->metadata ='{\"question\":\"1+1=\",\"status\":\"pending\" ,\"answer\":\"\",\"name\":\"Trinh Viet a\",\"email\":\"[email protected]\",\"phone\":\"01242972979\"}';\n $faqs->save();\n\n $faqs = new FormSubmission();\n $faqs->name ='Trinh Viet b';\n $faqs->email ='[email protected]';\n $faqs->phone ='01242972979';\n $faqs->type ='faqs';\n $faqs->metadata ='{\"question\":\"2x2=\",\"status\":\"pending\" ,\"answer\":\"\",\"name\":\"Trinh Viet b\",\"email\":\"[email protected]\",\"phone\":\"01242972979\"}';\n $faqs->save();\n\n\n\n $faqs = new FormSubmission();\n $faqs->name ='Trinh Viet c';\n $faqs->email ='[email protected]';\n $faqs->phone ='01242972979';\n $faqs->type ='faqs';\n $faqs->metadata ='{\"question\":\"2x2=\",\"status\":\"pending\" ,\"answer\":\"\",\"name\":\"Trinh Viet c\",\"email\":\"[email protected]\",\"phone\":\"01242972979\"}';\n $faqs->save();\n }", "public function add(){\n\t\t\tif(!empty($data['Project']['project_file'])) {\n\t\t\t$attached_files = json_decode($data['Project']['project_file'], true);\n\t\t\t$this->set('attached_files', $attached_files);\n\n\t\t\t}\n\t\t\t\n\t\t\tif($this->request->is(array('post', 'put'))) {\n\t\t\t\n\t\t\tif(!empty($this->request->data['Project']['project_file'])) {\n\t\t\t\t$this->request->data['Project']['project_file'] = json_encode($this->request->data['Project']['project_file']);\n\t\t\t\t}\n\t\t\t// store project owner name instead of id if selected in form\t\t\t\n\t\t\tif(!empty($this->request->data['Project']['owner'])){\n\t\t\t\t$this->User->id = $this->request->data['Project']['owner'];\n\t\t\t\t\n\t\t\t\t$this->request->data['Project']['owner']=$this->User->field('name');\n\t\t\t}\n\t\t\t\n\t\t\t// set project start date and store in sql format\n\t\t\tif(!empty($this->request->data['Project']['project_start'])){\n\t\t\t\t$this->request->data['Project']['project_start'] = sqlFormatDate($this->request->data['Project']['project_start']);\t\n\t\t\t}else{\n\t\t\t\t$this->request->data['Project']['project_start'] = gmdate('Y-m-d');\n\t\t\t}\n\t\t\t// set project deadline\n\t\t\tif(!empty($this->request->data['Project']['deadline'])){\n\t\t\t\t$this->request->data['Project']['deadline'] = sqlFormatDate($this->request->data['Project']['deadline']);\t\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t\tif(empty($this->request->data['Deliverable']['project_id'])){\n\t\t\t\t\techo 'no project selected';\n\t\t\t\t\t$this->Session->setFlash(__('No project selected!'));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\tif( $this->Project->saveAll($this->request->data)){\n\t\t\t\t\t\t$this->Session->setFlash('Project Created!');\n\t\t\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t \n\t\t}", "public function add() {\n $this->_setModalLayout();\n //List Label\n $list_lb = $this->Label->find('all', array(\n 'conditions' => array('type' => 'TeamModel')\n ));\n $list_lb = $this->Label->removeArrayWrapper('Label', $list_lb, 'id');\n $list_lb = $this->Label->makeNestedLabels($this->Label->getLabelHierarchy($list_lb));\n\n // List Plan\n $listPlan = $this->Plan->find('list', array(\n 'fields' => array('id', 'type')\n ));\n\n $this->set(array(\n 'list_lb' => $list_lb,\n 'listPlan' => $listPlan\n ));\n\n if ($this->request->is('post') || $this->request->is('put')) {\n\n // Add project\n if (isset($this->request->data['Team'])) {\n $rq_data = $this->request->data['Team'];\n // Upload image\n if (is_uploaded_file($rq_data['splash']['tmp_name'])) {\n if (($rq_data['splash']['type'] == 'image/jpg') || ($rq_data['splash']['type'] == 'image/jpeg') || ($rq_data['splash']['type'] == 'image/png') || ($rq_data['splash']['type'] == 'image/gif')) {\n $imginfo = pathinfo($rq_data['splash']['name']);\n $filename = $imginfo['filename'] . '_' . md5(time()) . '.' . $imginfo['extension'];\n move_uploaded_file(\n $rq_data['splash']['tmp_name'], WWW_ROOT . 'upload' . DS . 'splash' . DS . $filename\n );\n // store the filename in the array to be saved to the db\n $rq_data['splash'] = $filename;\n } else {\n $this->Session->setFlash(__('有効なイメージを提供してください。'), 'alert-box', array('class' => 'alert-danger'));\n $this->redirect(array('action' => 'index'));\n }\n } else {\n $rq_data['splash'] = '';\n }\n $rq_data['management_id'] = $this->Auth->user('id');\n $dup = $this->Team->find('all', array('conditions' => array(\n 'name' => $rq_data['name']\n )));\n if (empty($dup)) {\n $rq_data['cdate'] = date('Y-m-d H:i:s');\n if ($this->Team->save($rq_data,false)) {\n $new_team_id = $this->Team->getLastInsertId();\n // Add Label \n if (isset($this->request->data['Label'])) {\n $rq_label = $this->request->data['Label'];\n $rq_label['type'] = 'TeamModel';\n $rq_label['label'] = $rq_label['add_new_text'];\n $rq_label['team_id'] = Configure::read('teamId');\n $rq_label['cdate'] = date('Y-m-d H:i:s');\n if (isset($rq_label['add_new_text'])) {\n $existing = $this->Label->find('all', array('conditions' => array(\n 'label' => $rq_label['add_new_text'],\n 'team_id' => $rq_label['team_id'],\n 'type' => $rq_label['type'],\n )));\n } else {\n $existing = '';\n }\n if ($rq_label['new_label'] != null) {\n if (isset($rq_label['add_new_text']) && $rq_label['add_new_text'] != null) {\n $rq_label['parent_id'] = $rq_label['new_label'];\n if (empty($existing)) {\n if ($this->Label->save($rq_label)) {\n // Get new ID record\n $new_id = $this->Label->getLastInsertId();\n } else {\n $this->Session->setFlash(__('Can not create new label'), 'alert-box', array('class' => 'alert-danger'));\n $this->redirect(array('action' => 'index'));\n }\n } else {\n $this->Session->setFlash(__('このラベルは既に存在します。'), 'alert-box', array('class' => 'alert-danger'));\n return $this->redirect($this->referer());\n }\n } else {\n $lb_id = $rq_label['new_label'];\n }\n } else {\n if (isset($rq_label['add_new_text']) && $rq_label['add_new_text'] != null) {\n $rq_label['parent_id'] = 0;\n if (empty($existing)) {\n if ($this->Label->save($rq_label)) {\n // Get new ID record\n $new_id = $this->Label->getLastInsertId();\n } else {\n $this->Session->setFlash(__('Can not create new label'), 'alert-box', array('class' => 'alert-danger'));\n $this->redirect(array('action' => 'index'));\n }\n } else {\n $this->Session->setFlash(__('このラベルは既に存在します。'), 'alert-box', array('class' => 'alert-danger'));\n return $this->redirect($this->referer());\n }\n }\n }\n }\n /* Save record to label_datas table */\n $this->request->data['LabelDatas']['target_id'] = $new_team_id;\n $this->request->data['LabelDatas']['cdate'] = date('Y-m-d H:i:s');\n if ($rq_label['new_label'] != null) {\n if ($rq_label['add_new_text'] != null) {\n $this->request->data['LabelDatas']['label_id'] = $new_id;\n } else {\n $this->request->data['LabelDatas']['label_id'] = $lb_id;\n }\n $this->Label->LabelData->save($this->request->data['LabelDatas']);\n } else {\n if ($rq_label['add_new_text'] != null) {\n $this->request->data['LabelDatas']['label_id'] = $new_id;\n $this->Label->LabelData->save($this->request->data['LabelDatas']);\n }\n }\n /* End save */\n $this->Session->setFlash(__('プロジェクトのアップデートに成功しました。'), 'alert-box', array('class' => 'alert-success'));\n return $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('新規プロジェクトを登録することはできません。'), 'alert-box', array('class' => 'alert-danger'));\n return $this->redirect(array('action' => 'index'));\n }\n } else {\n $this->Session->setFlash(__('このプロジェクトは既に存在します。'), 'alert-box', array('class' => 'alert-danger'));\n return $this->redirect($this->referer());\n }\n }\n }\n $this->render('edit');\n }", "public function addComment()\n {\n $this->isConnect();\n\n $post = $this->token->check($_POST);\n\n $formMessage = $this->commentsValidationForm->checkForm($post);\n\n if(!$formMessage)\n {\n $post['user_id'] = $_SESSION['id'];\n $post['validated'] = ($_SESSION['statut'] === 'admin') ? 1 : null;\n $this->comments->add($post);\n header('Location: index.php?route=front.postById&id=' . $_POST['post_id'] . '&success=' . $_SESSION['statut'] . '#comments');\n exit;\n }\n else\n {\n $postAddUnvalid = $post;\n $post = $this->posts->postById($_GET['id']);\n $comments = $this->comments->commentsById($_GET['id']);\n $this->render('postById', compact('formMessage', 'postAddUnvalid', 'post', 'comments'));\n }\n }", "private function comment_edit_submit( ) {\n\n if ( ! ( in('post_ID') || in('comment_ID') || in('comment_parent') ) ) ferror(-500481, \"None of post_ID, comment_ID, comment_parent has provided.\");\n $comment_ID = in( 'comment_ID' );\n $update = $comment_ID ? true : false;\n \n \n if ( $update ) {\n $comment = get_comment( $comment_ID );\n $post_ID = $comment->comment_post_ID;\n }\n else {\n $post_ID = in('post_ID');\n if ( empty( $post_ID ) ) {\n $comment = get_comment(in('comment_parent'));\n $post_ID = $comment->comment_post_ID;\n }\n }\n forum()->setCategoryByPostID($post_ID);\n\n\n\n //\n if ( $update ) { // update\n $this->endIfNotMyComment( $comment_ID );\n remove_filter( 'pre_comment_content', 'wp_filter_kses' );\n $re = wp_update_comment([\n 'comment_ID' => $comment_ID,\n 'comment_content' => in('comment_content')\n ]);\n add_filter( 'pre_comment_content', 'wp_filter_kses' );\n\n if ( ! $re ) {\n // error or content has not changed.\n }\n }\n else { // new\n $user_ID = $this->get_post_author();\n $user = get_user_by( 'id', $user_ID );\n $comment_ID = wp_insert_comment([\n 'comment_post_ID' => $post_ID,\n 'comment_parent' => in('comment_parent'),\n 'comment_author' => $user->user_login,\n 'user_id' => $user_ID,\n 'comment_content' => in('comment_content'),\n 'comment_approved' => 1,\n ]);\n if ( ! $comment_ID ) {\n $this->errorResponse(-50302, \"Comment was not created\");\n }\n }\n\n //$this->updateFileWithPost( FORUM_COMMENT_POST_NUMBER + $comment_ID );\n\n // $url = get_permalink( $post_ID ) . '#comment-' . $comment_ID ; // this is not used.\n\n //\n $files = in('files');\n if ( $files ) {\n $arr = explode('| |', $files);\n $files = array_filter( $arr );\n comment()->meta( $comment_ID, 'files', $files );\n }\n\n\n\n // Save All extra input into post meta.\n comment()->saveAllMeta( $comment_ID );\n\n\n $o = [ 'post_ID' => $post_ID, 'comment_ID' => $comment_ID ];\n // if ( in('response') == 'ajax' ) $o['comment'] = comment()->get_comment_with_meta( $comment_ID );\n $this->response( $o );\n }", "function em_form_comment_form_alter(&$form, FormStateInterface $form_state, $form_id) {\n $form['actions']['preview']['#access'] = FALSE;\n}", "public function add_comment() {\n\t if($this->input->post('submit_reg')){\n\t\t //validamos usando la libreria form_validation\n\t\t //asignamos un rol (set_rules, uso(name,title,required[|...])\n\t\t //trim = limpia los espacios en blanco\n\t\t //callback_ = para llamar un método\n\t\t $this->form_validation->set_rules('com','com', 'required');\n\t\t //mensaje de error de validacion\n\t\t $this->un_movil_model->add_comment();\n\t\t \n\t\t /*$id_movil =$this->input->post('id');\n\t\t $datos = array('moviles' => $this->un_movil_model->get_movil($id_movil),\n\t\t\t'precio' => $this->un_movil_model->get_precio($id_movil),\n\t\t\t'comentario' => $this->un_movil_model->get_comentario($id_movil)\n\t \t\t);*/\n\n\t\t//$this->load->view('un_movil_view',$datos);\n\t\t $this->mov($this->input->post('id_movil',TRUE));\n\t\t}\n\t}", "function buildForm(){\n\t\t# menampilkan form\n\t}", "private function fronteEnd() {\n\n //project resource\n if (request('commentresource_type') == 'project') {\n if ($project = \\App\\Models\\Project::Where('project_id', request('commentresource_id'))->first()) {\n //add some form fields data\n request()->merge([\n 'comment_clientid' => $project->project_clientid,\n ]);\n } else {\n //error not found\n Log::error(\"the resource project could not be found\", ['process' => '[permissions][comments][create]', 'ref' => config('app.debug_ref'), 'function' => __function__, 'comment' => basename(__FILE__), 'line' => __line__, 'path' => __file__]);\n abort(404);\n }\n }\n\n //lead resource\n if (request('commentresource_type') == 'task') {\n if ($task = \\App\\Models\\Task::Where('task_id', request('commentresource_id'))->first()) {\n //add some form fields data\n request()->merge([\n 'comment_clientid' => $lead->task_clientid,\n ]);\n } else {\n //error not found\n Log::error(\"the resource project could not be found\", ['process' => '[permissions][comments][create]', 'ref' => config('app.debug_ref'), 'function' => __function__, 'comment' => basename(__FILE__), 'line' => __line__, 'path' => __file__]);\n abort(404);\n }\n }\n\n }", "public function run()\n {\n //\n $projecta=new Project();\n $projecta->id=4;\n $projecta->title=\"CASI - Centralized Admission System of IOE >> काजी\";\n $projecta->summary=\"Automation of admission process for all of our campuses/colleges\";\n $projecta->projectData=\"<h1 style='text-align:center'>CASI - Centralized Admission System of IOE &gt;&gt; काजी</h1><p>Continuous improvement in the academic environment and achieving excellence in producing quality engineers is the main motto of IOE. After automating the BE &amp; M.Sc. entrance system, IOE is proceeding towards the automation of admission process for all of its campuses/colleges where the research study carried out in 2016 thoroughly investigated the existing system and recommend reform in admission process of IOE. We, the member of that research team reviewed the study documents and propose the suitable administrative and technical framework for the automation of IOE admission system.&nbsp;CASI&nbsp;is a research based projects implemented for the uniformity in admission process at all constituent campuses and the affialiated colleges of Institute of Engineering towards excellency by enrolling meritorious best students every year at its engineering education.&nbsp;<br />\n The enrollment software systems developed is running from&nbsp;<a href='http://admission.ioe.edu.np/' target='_blank'>http://admission.ioe.edu.np</a>&nbsp;and is contineous progress in optimum implementation</p>\";\n $projecta->save();\n $projecta=new Project();\n $projecta->id=5;\n $projecta->title=\"Real Time Intranet based Entrance ExamiNAtion System (RETIENAS) रेटिनाज\";\n $projecta->summary=\"The fully managed and hassle free application processing system of IOE entrance examination allows applicants to simply apply and receive admit card with specified time slot.\";\n $projecta->projectData=\"<h1 style='text-align:center'>Real Time Intranet based Entrance ExamiNAtion System (RETIENAS) रेटिनाज</h1>\n\n <p>RETIENAS is a research and development project initiated by Prof. Dr. Bharat Raj Pahari, formar Dean of Institute of Engineering (IOE), Tribhuvan University (TU) on 2012 with the objective to select highly qualified candidates by having sohpisticated computer based entrance examination system for bachelor/master level engineering study at the institute. IOE is the government owned oldest institution in Nepal providing quality education in the engineering domain since 1972. However in the recent decade, other several universities are established in the country, IOE hasn&#39;t lost its popularity with its major features to have dedication on quality education to fulfill the world class standards in education. As a public institution, it provides equal opportunities for all qualified citizens to enter into the university education. There are generally more than 11,000 competitive applicants in the entrance exam of bachelors program. Hence less than 32% students were selected for the admission.&nbsp;<br />\n As being the technical institute, historically IOE is always ahead in the use of technology. The increasing burden in the manual processing of the entrance exam enforces IOE to step into the automatic exam oepration and result processing system. In 2004, IOE developed automatic answer sheet scanning and processing system and started online based application since 2009. From the year 2014, IOE has started fully computer based entrance examination at its resourceful centers (ICTC) at Pulchowk. The fully managed and hassle free application processing system of IOE entrance examination (<a href='http://entrance.ioe.edu.np/' target='_blank'>&nbsp;http://entrance.ioe.edu.np</a>) allows applicants to simply apply and receive admit card with specified time slot from online registration system.&nbsp;<br />\n Project RETIENAS had been executed since 2012 and is currently led by dean of Institute of Engineering Prof. Dr. Triratna Bajracharya including highly qualified research oriented faculties of IOE. RETIENAS has the following features:&nbsp;</p>\n \n <ul>\n <li>It is an automated system for Application Registration, Processing, Verification and Admit Card Generation for BE/BArch as well as M.Sc. Entrance Examination</li>\n <li>The system also reserved the exam date and time slot for every applicants.</li>\n <li>Highly secured intrancet system is available at Information and Communication Technology Center at IOE Pulchowk. Students appear in the center and give exam from specified LAB and the computer.</li>\n <li>The redundant entrance examination servers (WEB,DB) are maintained and more than 240 client computers are dedicately placed at ICTC. Hence 240 examinees can appear at a time for the examination</li>\n <li>The Entrance Examination Board of IOE massively conducts yearly entrance exam by planning four slots in a day and one slot consists of 240 examinees. Hence, it takes almost 10 to 12 days to conduct exam for about 11,000 applicants.</li>\n </ul>\n \n <p>The deveoped package to conduct entrance examination is fully interactive client server based system in which the time between server and client is well synchronized. We implemented lamports timestamp with the cristian&#39;s clock synchronization algorithm to distribute updated timestamp from server. Since the system is on the single LAN (Intranet), hence the propagation delay between client and server for timestamp distribution is very little (in micro-second) that does not considerably affect examinees during examination.&nbsp;<br />\n LICT team is continuing the research and development (upgrade) of the system to make it fully distributed and run on multiple LAN with the introdcution of CACHE servers to balance the load and increase the concurrent access during examination so that we can increase the number of examinees in a slot.</p>\n \n <h3><strong>Glimpse of ICTC Computer Labs:</strong></h3>\n \n <p><strong><img alt='' src='../../project/project5-1.jpg' style='height:50%; width:100%' /></strong></p>\n \n <p><strong><img alt='' src='../../project/project5-2.jpg' style='height:50%; width:100%' /></strong></p>\";\n $projecta->save();\n $projecta=new Project();\n $projecta->id=6;\n $projecta->title=\"Semester Exam AuTomation System of IOE (SETISI) सेटिसी\";\n $projecta->summary=\"Inhouse ICT Research and Development Project initiated to automate the Semester Exam activities of IOE.\";\n $projecta->projectData=\"<h1 style='text-align:center'>&nbsp; &nbsp;&nbsp;Semester Exam AuTomation System of IOE (SETISI) सेटिसी</h1>\n\n <p>SETISI is an inhouse ICT Research and Development Project initiated to automate the Semester Exam activities of IOE. Examination Control Division (ECD) of Institute of Engineering, Tribhuvan University is the one prominent and most busy organization where it conducts several examinations throughout the year. ECD conducts bi-annual semester exams for regular and back exam of bachelor of engineering students having 10 streams in its four constituent campuses and ten affiliated colleges. Similarly, ECD also conducts bi-annual exams for masters of engineering programs having seven streams and 21 sub-streams. Hence tentatively, there are more than 16000 examinees in an exam including regular and back. Additionally, successful conduction of BE/BArch entrance examination as well as M.Sc. entrance examination is the part of examination to be conducted by ECD.<br />\n Examination registrations of all programs, exam center management, examinees detail verifications, exam roll number and admit card generations, collections of internal, projects, survey marks and its processing/verifications, coding/decoding of the answer sheets, packaging, expert assignments, air and ground transportations and delivery of packets/question, tracking of packets, secure result processing and result publications, question setting arrangement, re-totaling managements, error correction and verification and many more are the quite challenging events continuously to be handled by ECD of IOE requiring more human resources and time critical management of all activities to adapt with the pre-defined IOE calendar.&nbsp;<br />\n The increase of streams and examinees demand more on all other relevant resources making the system more complex for operation and management within the existing non-automated manual system environment. Hence, to consider the efficient, reliable, secure and transparent operation and management of the system, a research towards the automation process of ECD has been initiated with the development of the software and its implementation in a planned way. The whole system development at a time shall be complicated and costly too. We are developing the automated system and implementing by developing it in modules with the principle of rapid application development so that while implementing one module encourages for analysis and design of other relevant modules.&nbsp;<br />\n ECD already has secure result processing system for BE/BArch programs. While online based exam registrarion, procfessing and admit card generation as well as M.Sc. result processing and publications modules are under development</p>\";\n $projecta->save();\n $projecta=new Project();\n $projecta->id=7;\n $projecta->title=\"Transformation to Future Networking with Broadband and IoT Implementations: Status of Nepal and the Steps Ahead (TraFNet)\";\n $projecta->summary=\"Transformation to Future Networking with Broadband and IoT Implementations\";\n $projecta->projectData=\"<h1 style='text-align:center'>T<strong>ra</strong><strong>nsformation to</strong><strong>&nbsp;F</strong><strong>uture&nbsp;</strong><strong>Net</strong><strong>working with Broadband and IoT Implementations: Status of Nepal and the Steps Ahead (TraFNet)</strong></h1>\n\n <p>&nbsp;</p>\n \n <h2>Research Motivation</h2>\n \n <p>We, the research team members include professionals of networking and telecommunications as well as university professors. Our main motto is to have localized ICT research for our country that contributes towards speedy implementation of new technologies in the field of information and communication technology for social transformation. At the different time frame, we members were involved in real time network configuration of telecom networks, ICT policy formulation including IPv6 migration, broadband communication, latest network deployment et cetera. It was also the major concern of Nepal Telecommunications Authority (NTA) to formulate suitable policies and regulatory guidelines to transform the current network into new networking paradigms. The important part for our country is the identification of proper cost of broadband deployment as well as network migration for ISP and Telecom equipment upgrades towards IPv6 and Software Defined Network (SDN), Implementation for Internet of Things (IoT), network operation &amp; maintenance and upgrade as well. Another major concern is the amount of energy consumed by networks. The increasing network size and continuous operation increase the energy consumption by the network devices. Because of this, the companies pay a significant percentage of their revenue to power their network infrastructures. With the rapid growth of smart users, IoT implementation and the Wireless Sensor Network (WSN) deployment becomes major concern for the service providers as their sustainable business solutions. Considering the global pace of technology transformations, we need to take steps for our country&rsquo;s network to identify its current status and apply suitable measures towards future smart life.&nbsp;<br />\n This seismic shift in the technological paradigm has encouraged the team to carry out practical research on the field of smart cities and the related infrastructure including IoT, carrier network and data analytics infrastructure along with evolutionary enablers such as IPv6, Software Defined Networks (SDN), cloud computing infrastructure and virtualization technologies. These technological enablers are critical in realizing a functional high-tech society that can lead to efficient service delivery, better communication and improved quality of life in the smart communities.&nbsp;</p>\n \n <h2>Background</h2>\n \n <p>Internet and related technologies have transformed the way humans communicate. Rapid technological advancement, service proliferation and integration of innumerable services have made the Internet an indispensable part of our lives. Traditionally, Internet has been a means of communication between people. The technology and network enabled people to quickly communicate with each other irrespective of geographical distance. This network then led to the evolution of network based services in trade, finance, education, social networking, and public services delivery. Even conventional communication media such as voice telephony and short messaging services are becoming Internet-borne.&nbsp;<br />\n Lately, Internet and IP technology have taken another very transformative turn. Machines have started to get more autonomous as connected entities that can create and consume data. This traditionally human activity (of creating and consuming data) has started being done by machines in what is known as M2M (Machine to Machine) network. This phenomena combined with the Internet technology is also called the Internet of Things (IoT). This has created an unprecedented avenue of technological evolution and business opportunity. Concepts such as remote surveillance, smart cities, smart homes, societal automation are becoming a reality. This, combined with advanced data analytics technologies, artificial intelligence, cloud platforms, rapid expansion of next generation broadband networks (wired and wireless) for seamless communication and future-proof technologies such as IPv6 has made the dream of smart communities, industrial automation and automated public service delivery a reality.<br />\n According to the gadget survey within the last 20 years, the number of Internet users reached more than 3 billion. The number of connected devices is more than 7.2 billion mobile gadgets which is even bigger than world&#39;s population in 2015. The rapid growth of Internet users and ICT business in the world led to the exhaustion of IPv4 address space and forced the industry to standardize new addressing scheme having 128 bits, called Internet Protocol version 6 (IPv6). In the next generation networking infrastructure, every connected device shall have one or more unique IPv6 addresses. The vast size of the IPv6 address space has enough addresses to allocate to every such device coming up in the foreseeable future. IPv6 on the one hand improves the efficiency of internet protocol as a whole including routing, while on the other hand Software Defined Networks (SDN) improves the controllability of networking equipment with an approach to using open protocols, such as Open-Flow, to apply globally aware software control at the edges of the network to access network devices that typically would use closed and vendor specific firmware. The invention of these new concepts and development creates bigger challenges in networking for service providers to migrate their existing legacy networks into the software defined and IPv6 enabled network and the implementation of those technologies in broadband communications.&nbsp;<br />\n With the rapid growth of internet users, increased Internet of Things (IoT), smart devices and the trend of world moving to converged network environment into the mode of computer networks (IP based network), the researchers, developers and the networking enterprises worldwide are obliged to enhance the intelligence in networking technologies. For the realization of the dream of smart cities and smart communities it is imperative to move towards next generation networking paradigm like IPv6 addressing mechanism, Software Defined Network as well as implementing the IoT &amp; Wireless Sensor Network and addressing the increased user&rsquo;s demand by having high speed broadband communications.&nbsp;<br />\n Being the developing country, Nepal is a net consumer of Internet services and technologies. ISPs of Nepal are the distributors of technologies and services. However, the rapid changes in technology worldwide has raised the challenges and issues for the developing country like Nepal towards the early implementation of evolving and new services. The major hurdles are limited skilled human resources, limited purchasing capacity and lack of proper planning. There is also a need for proper and timely government initiatives to formulate the policies, laws and regulation as well as their proper enforcement to usher in desired change in relevant sectors of society.</p>\n \n <p>Nepal has six licensed telecom operators and more than 60 ISPs. Recently promulgated broadband policy of Nepal is still in the initial stage of implementation while the sufficient study on technology migration, migration policy and strategy have not been set by the government. The change in technologies encourages and prompts the service providers to introduce new technologies and provide efficient services to the customers via technology migration. The migration is a gradual process for which proper strategy has to be developed by the service providers considering the technology needs, customer demand, Capital Expenditure (CapEX), Operational Expenditure (OpEX) and traffic engineering perspectives towards smooth transitioning. The transition period spans longer during when the service providers should have to move forward with proper migration planning with optimum cost. On the other hand the geographical distribution of Nepal is unique in the world having highest peak, mostly covered by Himalayan, hilly diverse terrain and a small part of plain area. Difficult geographical terrain and scattered inhabitation makes it difficult to build communication infrastructure and distribute the technologies and services. Core network migration to IPv6 and SDN, broadband infrastructure deployment with proper policy to suit of those migrated new technologies and the IoT implementations are the major concerns for the service providers of developing countries like Nepal. Looking into the Nepalese context, the technology migration is in the early stage. Similarly the broadband deployment, cloud computing, IoT implementations together with the necessary policy and implementation guideline formulation are in the early stages. This encouraged us to undertake this localized ICT research for our country so that we find the current status of technology implementation and recommend for the future that helps the country towards smart life and reduce the digital divide. We also expect the research to provide important insight to help innovate and introduce new services with right technologies in an effective and economical manner.</p>\n \n <h2>Justification of the Study</h2>\n \n <p>This research performs the technical and economic analysis of the legacy network migration to Software Defined IPv6 Network with broadband deployment challenges for Nepal including IoT implementation and the security measure that the service providers should consider. It will focus to identify networking equipment status for their upgradability towards future networking, optimum estimate to migrate the service provider network with cost of migration and broadband network deployment and identify the IoT implementation plan with better security.&nbsp;<br />\n <strong>Technological Impact:</strong>&nbsp;This research is highly assistive to the service providers of Nepal to efficiently migrate their current network into next generation networking paradigm like SDN &amp; IPv6 as well as it comes up with proper plan and strategies for broadband deployment and IoT implementations.<br />\n <strong>Socio economic impact:</strong>&nbsp;organizations and the citizens are directly benefited with the use of low cost and affordable new ICT services.&nbsp;<br />\n This research would also be helpful to the government agencies/regulators for proper regulation, development of regulatory guidelines/rules and future planning.</p>\n \n <h2>Objective(s)</h2>\n \n <p>The major objective(s) of this faculty research shall be as follows</p>\n \n <ol start='1' style='list-style-type:decimal'>\n <li>Study the current trend of networking technologies migrations including broadband deployment and the IoT implementation for future smart life</li>\n <li>Find the position of Nepal regarding Broadband deployment, SDN/IPv6 migration &amp; IoT implementation.</li>\n <li>Analyze the future network transformation challenges and recommend the solution for Nepal.</li>\n </ol>\n \n <p><strong>Reserach Duration: 2 Years</strong></p>\n \n <p><strong>This research is</strong></p>\n \n <ul>\n <li>Academically supported by Center for Applied Research and Development, Institute of Engineering in collaboration with NTNU (Norwegian University of Science and Technology) under Sustainable Engineering Education Project (SEEP) and financed by the Energy and Petroleum Program (EnPe) in NORAD (Norwegian Agency for Development Cooperation) and Nepal Academy of Science and Technology</li>\n <li>Requested to University Grant Commission Nepal (UGC-Nepal) for funding support of up to 4 Lakhs under faculty research grant.</li>\n </ul>\";\n $projecta->save();\n }", "public function addForm() {\n $this->view->displayForm();\n }", "public function returnForm() {\r\n global $db;\r\n\r\n $this->status = PRESUBMITTED;\r\n\r\n $deanComments =\"\"; // we save the dean's comments before deleting the approval\r\n\r\n // delete all approvals from database.\r\n foreach($this->approvals AS $approval) {\r\n if($approval->type == COMMITMENTS || $approval->type == DEAN_REVIEW) {\r\n $deanComments = $approval->comments;\r\n }\r\n $approval->delete();\r\n }\r\n\r\n if(strlen($deanComments) > 0) {\r\n $sql = \"UPDATE forms_tracking SET `dean_comments`= '\" . $deanComments . \"' WHERE `form_tracking_id` = \" . $this->trackingFormId;\r\n $db->Execute($sql);\r\n }\r\n\r\n require_once('classes/tracking/notifications/Notifications.php');\r\n require_once('classes/tracking/notifications/ResearcherNotification.php');\r\n\r\n $subject = sprintf('[TID-%s] Tracking form returned for modifications', $this->trackingFormId);\r\n $emailBody = sprintf('A tracking form was returned for modifications from your Dean :\r\n\r\nTracking ID : %s\r\nTitle : \"%s\"\r\nComments : %s\r\n\r\nPlease make any required modifications and re-submit the form.\r\n\r\n', $this->trackingFormId, $this->projectTitle, html_entity_decode(strip_tags($deanComments)));\r\n\r\n $ResearcherNotification = new ResearcherNotification($subject, $emailBody, $this->submitter);\r\n try {\r\n $ResearcherNotification->send();\r\n } catch(Exception $e) {\r\n printf('Error: Unable to send email notification to Researcher : '. $e);\r\n }\r\n\r\n $this->saveMe();\r\n }", "function createProjectActivity()\n\t\t{\n\t\t\t$pID = $_POST[\"pID\"];\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t$pID;\n\t\t\techo $this->postProjectActivity($pID, $description, $link);\n\t\t}", "function tp_comm_comments_enable() {\r\n\tglobal $tp_comm_comments_form;\r\n\t$tp_comm_comments_form = true;\r\n}", "public function doDefine(Form $form)\n\t{\n\t\t$langPrefix = \\Lyrasoft\\Luna\\Helper\\LunaHelper::getLangPrefix();\n\n\t\t// Basic fieldset\n\t\t$this->wrap('basic', null, function(Form $form) use ($langPrefix)\n\t\t{\n\t\t\t// ID\n\t\t\t$this->add('id', new Field\\HiddenField);\n\n\t\t\t// Title\n//\t\t\t$this->add('title', new Field\\TextField)\n//\t\t\t\t->label(Translator::translate($langPrefix . 'comment.field.title'))\n//\t\t\t\t->setFilter('trim')\n//\t\t\t\t->required(true);\n\n\t\t\t// Type\n\t\t\t$this->add('type', new Field\\HiddenField)\n\t\t\t\t->label(Translator::translate($langPrefix . 'comment.field.type'));\n\n\t\t\t// Target ID\n\t\t\t$this->add('target_id', new Field\\TextField)\n\t\t\t\t->label(Translator::translate($langPrefix . 'comment.field.target.id'));\n\t\t});\n\n\t\t// Text Fieldset\n\t\t$this->wrap('text', null, function(Form $form) use ($langPrefix)\n\t\t{\n\t\t\tif (\\Lyrasoft\\Warder\\Helper\\WarderHelper::tableExists('users'))\n\t\t\t{\n\t\t\t\t$this->add('user_id', new UserModalField)\n\t\t\t\t\t->label(Translator::translate($langPrefix . 'comment.field.author'));\n\t\t\t}\n\n\t\t\t// Content\n\t\t\t$this->add('content', new Field\\TextareaField)\n\t\t\t\t->label(Translator::translate($langPrefix . 'comment.field.introtext'))\n\t\t\t\t->set('rows', 10);\n\n\t\t\tif (\\Lyrasoft\\Warder\\Helper\\WarderHelper::tableExists('users'))\n\t\t\t{\n\t\t\t\t$this->add('reply_user_id', new UserModalField)\n\t\t\t\t\t->label(Translator::translate($langPrefix . 'comment.field.replyer'));\n\t\t\t}\n\n\t\t\t// Reply\n\t\t\t$this->add('reply', new Field\\TextareaField)\n\t\t\t\t->label(Translator::translate($langPrefix . 'comment.field.fulltext'))\n\t\t\t\t->set('rows', 10);\n\t\t});\n\n\t\t// Created fieldset\n\t\t$this->wrap('created', null, function(Form $form) use ($langPrefix)\n\t\t{\n\t\t\t// State\n\t\t\t$this->add('state', new Field\\RadioField)\n\t\t\t\t->label(Translator::translate($langPrefix . 'comment.field.state'))\n\t\t\t\t->set('class', 'btn-group')\n\t\t\t\t->set('default', 1)\n\t\t\t\t->option(Translator::translate('phoenix.grid.state.published'), '1')\n\t\t\t\t->option(Translator::translate('phoenix.grid.state.unpublished'), '0');\n\t\t});\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 edit()\n\t {\n\t\t $app = JFactory::getApplication();\n \n\t\t // Get the previous edit id (if any) and the current edit id.\n\t\t $previousId = (int) $app->getUserState('com_gm_ceiling.edit.project.id');\n\t\t $editId = $app->input->getInt('id', 0);\n \n\t\t // Set the user id for the user to edit in the session.\n\t\t $app->setUserState('com_gm_ceiling.edit.project.id', $editId);\n \n\t\t // Get the model.\n\t\t $model = $this->getModel('Project', 'Gm_ceilingModel');\n \n\t\t /*// Check out the item\n\t\t if ($editId)\n\t\t {\n\t\t\t $model->checkout($editId);\n\t\t }\n \n\t\t // Check in the previous user.\n\t\t if ($previousId && $previousId !== $editId)\n\t\t {\n\t\t\t $model->checkin($previousId);\n\t\t }*/\n \n\t\t // Redirect to the edit screen.\n\t\t $this->setRedirect(JRoute::_('index.php?option=com_gm_ceiling&view=projectform&layout=edit', false));\n\t }", "public function addproject(){\n\t\t\t\n\t\t$this->form_validation->set_error_delimiters('<label class=\"error\">', '</label>');\n\t\n\t $this->form_validation->set_rules('project_name', 'Project name already exit. Please try another project', 'required|trim|callback_exists_projects');\n\t\t\n\t\t //$this->form_validation->set_rules('task_name', 'Task name already exit. Please try another task name', 'required|trim|callback_exists_tasks');\n\t\t\n\t\tif ($this->form_validation->run() == FALSE) {\n\t\n\t\t\t$this->load->view('projects/add_project');\n\t\t\t\n\t }else{\n\t\t\t\t\t\t\n\t\t\t$data = array(\n\t\t\t'client_Id' \t\t\t\t => $this->input->post('client_Id'),\n\t\t\t'empId'\t\t\t\t\t\t => $this->session->userdata['logged_in_timesheet']['empId'],\n\t\t\t'project_name' \t\t\t\t => $this->input->post('project_name'),\n\t\t\t'project_desc' \t\t\t\t => $this->input->post('project_desc'),\n\t\t\t'project_cost' \t\t\t\t => $this->input->post('project_cost'),\n\t\t\t'project_start_date' \t\t => $this->input->post('project_start_date'),\n\t\t\t'project_end_date'\t\t\t => $this->input->post('project_end_date'),\n\t\t\t'status'\t\t\t\t \t => $this->input->post('status'),\n\t\t\t'created_at' \t\t\t => date('Y-m-d H:i:s'),\n\t\t\t'updated_at' \t\t \t\t => date('Y-m-d H:i:s')\n\t\t\t);\t\t\n\t\n\t $this->project_model->add_project($data);\n\t\t\n\t\t redirect('projects');\n\t\t\n\t }\n\t\n\t}", "public function update()\n {\n if (!isset($_GET['id']) || !isset($_POST['name']) || !isset($_POST['creator'])) {\n call('pages', 'error');\n return;\n }\n Project::update($_GET['id'], $_POST['name'], $_POST['creator']);\n\n $project = Project::find($_GET['id']);\n $tasks = Task::getAllForProject($_GET['id']);\n require_once('views/projects/show.php');\n }", "function addComment(){\n\t\t$this->Article->Comment->create();\n\t\tif ($this->Article->Comment->save($this->data)) {\n\t\t\techo __('Your comment has been added successfully, and will be viewed soon after approving.', true);\n\t\t} else {\n\t\t\techo __('Your comment could not be added.', true);\n\t\t\techo '<br />';\n\t\t\tforeach($this->Article->Comment->validationErrors as $key=>$val){\n\t\t\t\techo $val.',<br />';\n\t\t\t}\n\t\t\techo 'and try again.';\n\t\t}\n\t\t$this->autoRender = false;\n\t}", "function perform()\r\n {\r\n // init variables (see private function below)\r\n $this->initVars();\r\n\r\n // Should we show and allow article comments and show the comment form\r\n //\r\n // $this->config->getModuleVar('article', 'use_comment') == 1\r\n // --------------------------------------------\r\n // global enables comments for all articles\r\n //\r\n // $this->config->getModuleVar('article', 'allow_comment') == 1\r\n // ----------------------------------------------\r\n // Allow comments for just this article\r\n //\r\n //\r\n // Do we show comments but not the add comment form?\r\n // Means: Visitors cant add no more comments\r\n //\r\n if($this->viewVar['article']['close_comment'] == 0)\r\n {\r\n $this->viewVar['showCommentForm'] = true;\r\n\r\n // add or preview comment\r\n if(!empty($this->previewComment))\r\n {\r\n $this->previewComment();\r\n }\r\n else\r\n {\r\n if(false !== ($num = $this->model->session->get('c_submit_number')))\r\n {\r\n $addComment = $this->httpRequest->getParameter( 'addComment'.$num, 'post', 'alnum' );\r\n if(false !== $addComment)\r\n {\r\n $this->addComment();\r\n }\r\n }\r\n else\r\n {\r\n \t// simple anti spam methode\r\n \t//\r\n $trial = $this->httpRequest->getParameter( 'trial', 'post', 'alnum' );\r\n if(false !== $trial)\r\n {\r\n $_txt = \"\\n################# Blog ####################\\n\";\r\n $_txt .= \"Date: \".date('Y-m-d H:i:s').\"\\n\";\r\n $_txt .= \"IP: \".$_SERVER[\"REMOTE_ADDR\"].\"\\n\";\r\n $_txt .= \"Agent: \".$_SERVER[\"HTTP_USER_AGENT\"].\"\\n\";\r\n $_txt .= \"Name: \".JapaCommonUtil::stripSlashes(trim($this->httpRequest->getParameter( 'cauthor', 'post', 'raw' )));\r\n $_txt .= \"\\nEmail: \".JapaCommonUtil::stripSlashes(trim($this->httpRequest->getParameter( 'cemail', 'post', 'raw' )));\r\n $_txt .= \"\\nBody: \".JapaCommonUtil::stripSlashes(trim($this->httpRequest->getParameter( 'cbody', 'post', 'raw' )));\r\n\r\n @error_log($_txt, 3, JAPA_APPLICATION_DIR . \"logs/wrong_button.log\");\r\n }\r\n }\r\n }\r\n\r\n $this->viewVar['c_submit_number'] = rand(1,19);\r\n $this->model->session->set('c_submit_number', $this->viewVar['c_submit_number']);\r\n\r\n // get article comments\r\n $this->model->action('article','comments',\r\n array('result' => & $this->viewVar['articleComments'],\r\n 'id_article' => (int)$this->viewVar['article']['id_article'],\r\n 'status' => array('=', 2),\r\n 'fields' => array('id_comment','pubdate',\r\n 'body','id_user',\r\n 'author','email','url') ));\r\n\r\n // add html code to comments\r\n foreach($this->viewVar['articleComments'] as & $comment)\r\n {\r\n $comment['body'] = $this->addHtmlToComments( $comment['body'] );\r\n }\r\n }\r\n }", "function crunchify_move_comment_form_below( $fields ) { \n $comment_field = $fields['comment']; \n unset( $fields['comment'] ); \n $fields['comment'] = $comment_field; \n return $fields; \n}", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function add_project()\n {\n if($this->session->has_userdata('admin_email'))\n {\n $data['msg']=$this->session->flashdata('msg');\n $this->load->model('Rhizome_model');\n $data['result']=$this->Rhizome_model->get_types();\n $this->load->view('includes/header');\n $this->load->view('includes/sidebar');\n $this->load->view('projects/add_project_form',$data);\n $this->load->view('includes/footer');\n }else{\n redirect('Rhizome/');\n }\n }", "function affiche_form_edition($content,$idCom,$idPost)\r\n{\r\n\tif(isset($_SESSION['id']))\r\n\t{\r\n\t\tif(isadmin($_SESSION['id']))\r\n\t\t{\r\n\t\t\techo \"<form name='edit_com' action='controller/actions.php' method='post'>\";\r\n\t\t\t\techo \"<textarea name='commentaire' cols='50' row='30'>\".$content.\"</textarea></br>\";\r\n\t\t\t\techo \"<input name='id_com' type='hidden' value='\".$idCom.\"'/>\";\r\n\t\t\t\techo \"<input name='action' value='Editer com' type='submit'/>\";\r\n\t\t\t\techo \"<input type='hidden' name='url' value='?page=article&POST_ID=\".$idPost.\"'/>\";\r\n\t\t\techo \"</form>\";\r\n\t\t}\r\n\t}\r\n}", "public function ajaxNewCommentAction() {\n if ($this->request->hasArgument('blogid')) {\n $blogid = $this->request->getArgument('blogid');\n }\n if ($this->request->hasArgument('postid')) {\n $postid = $this->request->getArgument('postid');\n }\n if ($this->request->hasArgument('name')) {\n $name = $this->request->getArgument('name');\n }\n if ($this->request->hasArgument('email')) {\n $email = $this->request->getArgument('email');\n }\n if ($this->request->hasArgument('text')) {\n $text = $this->request->getArgument('text');\n }\n \n $commentRepository = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Repository\\\\CommentRepository');\n \n $newComment = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Model\\\\Comment'); \n $newComment->setBlogid($blogid);\n $newComment->setPostid($postid);\n $newComment->setCommentname($name);\n $newComment->setCommentmail($email);\n $newComment->setCommenttext($text);\n $newComment->setCommentdate(time());\n \n $commentRepository->add($newComment);\n $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\PersistenceManager')->persistAll();\n \n exit;\n }", "public function edit(Project $project)\n {\n //\n }", "public function edit(Project $project)\n {\n //\n }", "public function edit(Project $project)\n {\n //\n }", "public function edit(Project $project)\n {\n //\n }", "public function edit(Project $project)\n {\n //\n }", "public function edit(Project $project)\n {\n //\n }", "public function edit(Project $project)\n {\n //\n }", "public function edit(Project $project)\n {\n //\n }", "public function edit(Project $project)\n {\n //\n }", "public function edit(Project $project)\n {\n //\n }", "public function edit(Project $project)\n {\n //\n }", "public function edit(Project $project)\n {\n //\n }", "public function create()\n {\n $post_comment = null;\n if (isset($_REQUEST['post_comment'])) {\n $post_comment = $_REQUEST['post_comment'];\n }\n $posts = Post::groupBy('date_publication')->get();\n return view('backend.post_comments.form', [\n 'nameAction' => 'Новый комментарий',\n 'controllerPathList' => self::$path,\n 'controllerAction' => 'add',\n 'controllerEntity' => new PostComment(),\n 'posts'=>$posts,\n 'parent_comment'=>$post_comment,\n\n 'scripts'=> [\n '/js/lib/moment.js',\n '/js/lib/loc/ru.js',\n '/js/lib/bootstrap-datetimepicker.min.js'\n ],\n 'styles' => [\n '/css/bootstrap-datetimepicker.min.css'\n ]\n ]);\n }", "public function processForm($task, $ecr_project, $type, $action, $hasName = false, $isNew = false)\n {\n $input = JFactory::getApplication()->input;\n\n $baseLink = 'index.php?option=com_easycreator';\n\n $hrefLink = $baseLink;\n $hrefLink .= '&ecr_project='.$input->get('ecr_project');\n $hrefLink .= '&task='.$input->get('old_task', 'stuffer');\n $hrefLink .= '&controller='.$input->get('old_controller', 'stuffer');\n\n $ajaxLink = $baseLink.'&tmpl=component&controller=ajax&format=raw';\n $ajaxLink .= '&task='.$task.'&do_action='.$task;\n ?>\n\n<script type=\"text/javascript\">\n var FBPresent = true;\n if(window.console == undefined)\n {\n if(window.parent.console != undefined)\n {\n console = window.parent.console;\n }\n else\n {\n FBPresent = false;\n }\n }\n frm = window.parent.document.adminForm;\n path = frm.act_folder.value;\n act_file = frm.act_file.value;\n\n if(FBPresent) console.log(path);\n if(FBPresent)console.log('act_file '+act_file);\n\n //-- No dot found in filename - must be a folder @todo\n if( act_file.indexOf('.') === -1 )\n {\n path += '/' + act_file;\n\n if(FBPresent) console.log('no dot found - append filename to path - '.path);\n }\n\n subPath = path.split('/');\n folderName = subPath[subPath.length-1];\n\n display = path;\n<?php\n switch($type)\n {\n case 'folder':\n switch($action)\n {\n case 'delete':\n echo \"display = path.replace(folderName, \"\n .\"'<strong style=\\\"color: red;\\\">'+folderName+'</strong>');\".NL;\n echo \"$('act_name').value = act_file\".NL;\n break;\n\n case 'rename':\n echo \"path = path.replace(folderName, '');\".NL;\n echo \"display = path;\".NL;\n echo \"$('act_name').value = act_file\".NL;\n break;\n\n default:\n break;\n }\n break;\n\n case 'file':\n switch($action)\n {\n case 'delete':\n echo \"display = path+'\".DS.\"<strong style=\\\"color: red;\\\">'+act_file+'</strong>';\".NL;\n echo \"$('act_name').value = act_file;\".NL;\n break;\n\n case 'rename':\n echo \"$('act_name').value = act_file;\".NL;\n break;\n\n default:\n break;\n }\n break;\n\n default:\n break;\n }\n ?>\n /*\n * Javascript again..\n */\n\n document.id('displ_folder').innerHTML = display;\n document.id('act_folder').value = path;\n\n function processForm()\n {\n post = '';\n post += '&act_path=' + document.id('act_folder').value;\n post += '&ecr_project=<?php echo $ecr_project; ?>';\n\n act_name = document.id('act_name').value;\n post += '&act_name='+act_name;\n\n <?php\n if($action == 'rename')\n {\n echo \"post += '&old_name='+window.parent.document.adminForm.act_file.value;\";\n }\n\n if($hasName)\n {\n ?>\n uri = '<?php echo $ajaxLink; ?>'+post;\n\n if( ! act_name)\n {\n document.id('act_name').setStyle('background-color', 'red');\n\n return false;\n }\n <?php\n }\n ?>\n\n new Request({\n url: uri,\n 'postBody': post,\n 'onComplete': function(result)\n {\n if(result == '*OK*')\n {\n window.parent.location = '<?php echo $hrefLink; ?>';\n }\n else\n {\n document.id('log').innerHTML = result;\n }\n }\n }).send();\n }\n </script>\n\n <?php\n }", "public function add() {\n // Load add template\n $add = new Views('templates/add.tpl.php');\n // Add header and footer template\n $add->set('header', $add->addHeader());\n $add->set('footer', $add->addFooter());\n $add->set('error', '');\n $add->set('success', '');\n\n //Check if user posted form\n if (isset($_POST['name'])) {\n $name = htmlspecialchars($_POST['name'], ENT_QUOTES);\n $file = new Files($_FILES['file']);\n //Manage uploaded file. If is something wrong with file return error\n if ($destination = $file->manageUploadedFile()) {\n $this->db->addProject($name, $destination);\n $add->set('success', ' <span class=\"button\">Your project has been created, go to project list page and start your scan!</span>');\n }\n else {\n $add->set('error', ' <span class=\"button error_button\">File error: Cannot extract file. Check archive or directory permissions.</span>');\n }\n }\n return $add->render();\n }", "function closeForm()\r\n\t\t{\r\n\t\t\t# Open form and configure\r\n\t\t\techo \"</form>\";\r\n\t\t}", "function replace_edit_comment( $arg = '' ){\n\t\t\tglobal $wpdb,$menu,$submenu,$comment,$soc_com;\n\t\t\tinclude('soc-edit-comments.php');\n\t\t\texit;\n\t\t}", "function add() {\n if (isset($_POST) && count($_POST) > 0) {\n $params = array(\n 'workname' => $this->input->post('workname'),\n 'description' => $this->input->post('description'),\n );\n\n $jcline_id = $this->Jcline_model->add_jcline($params);\n redirect('jcline/index');\n } else {\n $data['_view'] = 'jcline/add';\n $this->load->view('layouts/main', $data);\n }\n }", "public function editPrivacyAction()\n {\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n $this->view->project_id = $project_id = $this->_getParam('project_id');\n //GET PROJECT ITEM\n $this->view->project = $project = Engine_Api::_()->getItem('sitecrowdfunding_project', $project_id);\n //SHOW THE TAB ACTIVE IN DASHBOARD\n $this->view->activeItem = 'sitecrowdfunding_dashboard_editprivacy';\n //IF THERE IS NO PROJECT.\n if (empty($project)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n if (!$project->isOpen()) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n Engine_Api::_()->core()->setSubject($project);\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n $this->view->form = $form = new Sitecrowdfunding_Form_Project_Privacy();\n $form->removeDecorator('title');\n $form->removeDecorator('description');\n\n $tableProjects = Engine_Api::_()->getDbTable('projects', 'sitecrowdfunding');\n\n $leaderList = $project->getLeaderList();\n //SAVE PROJECT ENTRY\n if (!$this->getRequest()->isPost()) {\n\n //prepare tags\n $projectTags = $project->tags()->getTagMaps();\n $tagString = '';\n\n foreach ($projectTags as $tagmap) {\n $temp = $tagmap->getTag();\n if (!empty($temp)) {\n if ($tagString != '')\n $tagString .= ', ';\n $tagString .= $tagmap->getTag()->getTitle();\n }\n }\n\n $this->view->tagNamePrepared = $tagString;\n if (isset($form->tags))\n $form->tags->setValue($tagString);\n\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('leader', 'parent_member', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n foreach ($roles as $roleString) {\n\n $role = $roleString;\n if ($role === 'leader') {\n $role = $leaderList;\n }\n\n if ($form->auth_view) {\n if (1 == $auth->isAllowed($project, $role, \"view\")) {\n $form->auth_view->setValue($roleString);\n }\n }\n\n if ($form->auth_comment) {\n if (1 == $auth->isAllowed($project, $role, \"comment\")) {\n $form->auth_comment->setValue($roleString);\n }\n }\n }\n $ownerList = '';\n $roles_photo = array('leader', 'parent_member', 'owner_member', 'owner_member_member', 'owner_network', 'registered');\n\n foreach ($roles_photo as $roleString) {\n\n $role = $roleString;\n if ($role === 'leader') {\n $role = $leaderList;\n }\n\n //Here we change isAllowed function for like privacy work only for populate.\n $sitecrowdfundingAllow = Engine_Api::_()->getApi('allow', 'sitecrowdfunding');\n if ($form->auth_topic && 1 == $sitecrowdfundingAllow->isAllowed($project, $role, 'topic')) {\n $form->auth_topic->setValue($roleString);\n }\n\n if (isset($form->auth_post) && $form->auth_post && 1 == $sitecrowdfundingAllow->isAllowed($project, $role, 'post')) {\n $form->auth_post->setValue($roleString);\n }\n }\n if (Engine_Api::_()->sitecrowdfunding()->listBaseNetworkEnable()) {\n if (empty($project->networks_privacy)) {\n $form->networks_privacy->setValue(array(0));\n } else {\n $form->networks_privacy->setValue(explode(\",\", $project->networks_privacy));\n }\n }\n\n // Set the member_invite, member_approval options\n $form->member_invite->setValue($tableProjects->getColumnValue($project_id, 'member_invite'));\n $form->member_approval->setValue($tableProjects->getColumnValue($project_id, 'member_approval'));\n\n // $form->payment_action_label->setValue($tableProjects->getColumnValue($project_id, 'payment_action_label'));\n\n\n $notify_project_comment = $tableProjects->getColumnValue($project_id, 'notify_project_comment');\n $notify_project_donate = $tableProjects->getColumnValue($project_id, 'notify_project_donate');\n $is_user_followed_after_comment_yn = $tableProjects->getColumnValue($project_id, 'is_user_followed_after_comment_yn');\n $is_user_followed_after_donate_yn = $tableProjects->getColumnValue($project_id, 'is_user_followed_after_donate_yn');\n\n $form->notify_project_comment->setValue((explode(\",\",$notify_project_comment)));\n $form->notify_project_donate->setValue((explode(\",\",$notify_project_donate)));\n $form->is_user_followed_after_comment_yn->setValue($is_user_followed_after_comment_yn);\n $form->is_user_followed_after_donate_yn->setValue($is_user_followed_after_donate_yn);\n\n return;\n }\n\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n\n $values = $form->getValues();\n\n $notifyProjectCommentIdAsStr = null;\n $notifyProjectDonateIdAsStr = null;\n\n // check if user selected anyone in notification\n if(isset($values['notify_project_comment'])){\n $notifyProjectCommentIdAsArray = array();\n $notifyProjectCommentIdAsArray = $values['notify_project_comment'];\n $notifyProjectCommentIdAsStr = implode(\",\",$notifyProjectCommentIdAsArray);\n }\n\n // check if user selected anyone in notification\n if(isset($values['notify_project_donate'])){\n $notifyProjectDonateAsArray = array();\n $notifyProjectDonateAsArray = $values['notify_project_donate'];\n $notifyProjectDonateIdAsStr = implode(\",\",$notifyProjectDonateAsArray);\n }\n\n if (empty($values))\n return;\n\n $projectModel = $project;\n\n // Update the member_invite, member_approval options\n $tableProjects->update(array(\n // 'payment_action_label' => $values['payment_action_label'],\n 'member_invite' => $values['member_invite'],\n 'member_approval' => $values['member_approval'],\n 'is_privacy_edited_yn' => 1,\n 'notify_project_donate' => $notifyProjectDonateIdAsStr,\n 'notify_project_comment' => $notifyProjectCommentIdAsStr,\n 'is_user_followed_after_comment_yn' => $values['is_user_followed_after_comment_yn'],\n 'is_user_followed_after_donate_yn' => $values['is_user_followed_after_donate_yn']\n ), array('project_id = ?' => $project_id));\n\n //PRIVACY WORK\n $auth = Engine_Api::_()->authorization()->context;\n\n $roles = array('leader', 'parent_member', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n $leaderList = $projectModel->getLeaderList();\n\n if (empty($values['auth_view'])) {\n $values['auth_view'] = \"everyone\";\n }\n\n if (empty($values['auth_comment'])) {\n $values['auth_comment'] = \"registered\";\n }\n\n $viewMax = array_search($values['auth_view'], $roles);\n $commentMax = array_search($values['auth_comment'], $roles);\n\n foreach ($roles as $i => $role) {\n\n if ($role === 'leader') {\n $role = $leaderList;\n }\n\n $auth->setAllowed($projectModel, $role, \"view\", ($i <= $viewMax));\n $auth->setAllowed($projectModel, $role, \"comment\", ($i <= $commentMax));\n }\n $ownerList = '';\n $roles = array('leader', 'parent_member', 'owner_member', 'owner_member_member', 'owner_network', 'registered');\n if (empty($values['auth_topic'])) {\n $values['auth_topic'] = \"registered\";\n }\n if (isset($values['auth_post']) && empty($values['auth_post'])) {\n $values['auth_post'] = \"registered\";\n }\n\n $topicMax = array_search($values['auth_topic'], $roles);\n $postMax = '';\n if (isset($values['auth_post']) && !empty($values['auth_post']))\n $postMax = array_search($values['auth_post'], $roles);\n\n foreach ($roles as $i => $role) {\n\n if ($role === 'leader') {\n $role = $leaderList;\n }\n $auth->setAllowed($projectModel, $role, \"topic\", ($i <= $topicMax));\n if (!is_null( $postMax ) ) {\n $auth->setAllowed($projectModel, $role, \"post\", ($i <= $postMax));\n }\n }\n // Create some auth stuff for all leaders\n $auth->setAllowed($projectModel, $leaderList, 'topic.edit', 1);\n $auth->setAllowed($projectModel, $leaderList, 'edit', 1);\n $auth->setAllowed($projectModel, $leaderList, 'delete', 1);\n //UPDATE KEYWORDS IN SEARCH TABLE\n if (!empty($keywords)) {\n Engine_Api::_()->getDbTable('search', 'core')->update(array('keywords' => $keywords), array('type = ?' => 'sitecrowdfunding_project', 'id = ?' => $projectModel->project_id));\n }\n if (!empty($project_id)) {\n $projectModel->setLocation();\n }\n $actionTable = Engine_Api::_()->getDbtable('actions', 'activity');\n foreach ($actionTable->getActionsByObject($projectModel) as $action) {\n $actionTable->resetActivityBindings($action);\n }\n }\n\n }", "public function addform()\n {\n \n //$this->session_manager->validateFashion(__METHOD__);\n \n $data['cate'] = $this->promo->promoSliderOptionCuisine($by_id=null,$platform=1);\n $data['promo_duration'] = $this->promo->promoDurationOption();\n $data['admin_info'] = $this->promo->adminInfo();\n \n $data['title_type']= 'New Promo Form';\n $data ['content_file']= 'promo_new';\n $data['pageheader'] = \"Add Promo\";\n $data['breadCrumbs'] = '<li class=\"breadcrumb-item\"><a href=\"'.site_url(\"jollofadmin/promos\").'\">Promos</a></li> <li class=\"breadcrumb-item active\">Add Promo</li>';\n $data['mainmenu'] = \"promos\";\n $this->load->view('jollof_admin/layout', $data);\n }", "public function addnew(){\n\t\t\tif($this->session->userdata('loggedIn_adminInfo')=='')redirect('admincp');\n\t\t\t$data['title'] \t\t\t= 'Projects 100K';\n\t\t\t$postedValue_fname \t\t= array();\n\t\t\tif($this->session->userdata('post_promotionData'))\n\t\t\t$data['postedValue'] \t\t= \t$this->session->userdata('post_promotionData');\n\t\t\t$data['hdnPromotionID']\t\t=\t'';\t\n\t\t\t$data['promotionInfo']\t\t=\tarray();\n\t\t\t$data['catg_uri_string']\t=\t'';\n\t\t\t$this->load->view('templates/admincp/header', $data);\n\t\t\t$this->load->view('admincp/promotion/form', $data);\n\t\t}", "function rmmfNew(){\n\tglobal $db, $mc;\n\t\n\tlist($num) = $db->fetchRow($db->query(\"SELECT COUNT(*) FROM \".$db->prefix(\"rmmf_categos\")));\n\tif ($num<=0){\n\t\tredirect_header('categos.php?op=new', 1, _MA_RMMF_CATEGOFIRST);\n\t\tdie();\n\t}\n\t\n\tdefine('_RMMF_LOCATION','NEWWORK');\n\txoops_cp_header();\n\trmmf_make_adminnav();\n\t\n\tinclude_once '../common/form.class.php';\n\t$form = new RMForm(_MA_RMMF_NEWWORK, 'frmNew', 'index.php?op=save');\n\t$form->setExtra(\"enctype='multipart/form-data'\");\n\t$form->addElement(new RMText(_MA_RMMF_TITLE, 'titulo', 50, 150));\n\t$result = array();\n\t$select = \"<select name='catego'>\n\t\t\t\t<option value='0'>\"._MA_RMMF_SELECT.\"</option>\";\n\trmmf_get_categos($result);\n\tforeach ($result as $k => $v){\n\t\t$select .= \"<option value='$v[id_cat]'>\".str_repeat('-', $v['saltos']).\" $v[nombre]</option>\";\n\t}\n\t$select .= \"</select>\";\n\t$form->addElement(new RMLabel(_MA_RMMF_CATEGO, $select));\n\t$form->addElement(new RMText(_MA_RMMF_CLIENT, 'cliente', 50, 255));\n\t$form->addElement(new RMText(_MA_RMMF_URL, 'url', 50, 255, 'http://'));\n\t$form->addElement(new RMTextArea(_MA_RMMF_SHORT, 'short', 4, 45));\n\t$form->addElement(new RMLabel(_MA_RMMF_DESC, rmmf_select_editor('desc',$mc['editor'],'','100%','250px')));\n\t$form->addElement(new RMTextArea(_MA_RMMF_COMMENT, 'comentario', 4, 45));\n\t$form->addElement(new RMFile(_MA_RMMF_IMG, 'imagen', 45));\n\t$form->addElement(new RMYesNo(_MA_RMMF_FEATURED, 'resaltado', 0));\n\t$form->addElement(new RMButton('sbt',_MA_RMMF_SEND));\n\t$form->display();\n\trmmf_make_footer();\n\txoops_cp_footer();\n}", "public function create()\n {\n if (!isset($_POST['name']) || !isset($_POST['creator'])) {\n call('pages', 'error');\n return;\n }\n $id = Project::insert($_POST['name'], $_POST['creator']);\n\n $project = Project::find($id);\n $tasks = Task::getAllForProject($_GET['id']);\n require_once('views/projects/show.php');\n }", "public function postNew()\n\t{\n\t\t$project = new Project(Input::except('technology', 'screenshot'));\n\n\n\t\t// Check for errrors\n\t\tif(!$project->validate(Input::all()))\n\t\t{\n\t\t\t// Errors occured\n\t\t\treturn Redirect::to('/projects/new')->withInput()->withErrors($project->errors());\n\t\t}\n\n\t\t// Validation passed save the new project\n\t\t$project->save();\n\n\t\tforeach(Input::get('screenshot') as $screenshot)\n\t\t{\n\t\t\t// Add filled inputs\n\t\t\tif($screenshot !== '')\n\t\t\t{\n\t\t\t\t$project->screenshots()->save(new ProjectScreenshot(['url' => $screenshot]));\n\t\t\t}\n\t\t}\n\n\t\tforeach(Input::get('technology') as $technology)\n\t\t{\n\t\t\t// Add filled inputs\n\t\t\tif($technology !== '')\n\t\t\t{\n\t\t\t\t$project->technologies()->save(new ProjectTechnology(['content' => $technology]));\n\t\t\t}\n\t\t}\n\n\t\t// Redirect to new project page\n\t\treturn Redirect::to('/projects/' . Input::get('name'));\n\n\t}", "public function index() {\n $content = $this->lcopun->copun_add_form();\n $this->template->full_admin_html_view($content);\n }", "private function add_comment()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif(empty($_POST['body']))\n\t\t\treturn 'Reply cannot be empty.';\n\t\t\n\t\t$post_id = $this->filter;\n\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t$new_comment->forum_cat_post_id = $post_id;\n\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t$new_comment->body\t\t\t= $_POST['body'];\n\t\t$new_comment->save();\n\t\treturn 'Thank you, your comment has been added!';\t\t\n\t}", "protected function Form_Run() {}", "function cosmetics_comment_form() {\n\n if ( comments_open() || get_comments_number() ) :\n?>\n\n <div class=\"site-comments\">\n <?php comments_template( '', true ); ?>\n </div>\n\n<?php\n endif;\n}", "public function savesubmit(){\n\t\t$this->autoRender = false;\n\t\t if($this->request->is('POST')){ \n\t\t\t //\n\t\t \n\t\t\t$this->Session->write('project.aftersave', 'sent');\n//\t\t\t$this->Session->write('brief.type', $this->name);\n\t\t\t$this->Session->write('brief.type', $this->params['controller']);\n\t\t\t$this->Session->write('brief.id', $this->Email->id);\n\t\t\t \n\t\t\t \n\t\t\t//echo 'aftersave';\t\n\t\t\t //$this->redirect(array('controller'=>'projects', 'action' => 'view', $this->Session->read('project.id') ));\n\n\t\t }\t\t\n\t}", "public function addform() {\n require_once 'modeles/etudiant_modele.php';\n require_once 'vues/etudiants/etudiants_addform_vue.php';\n }", "function gk_comment_form( $fields ) {\n ob_start();\n wp_editor( '', 'comment', array( 'teeny' => true ));\n $fields['comment_field'] = ob_get_clean();\n return $fields;\n}", "public function edit(project $project)\n {\n //\n }", "protected function form()\n {\n $form = new Form(new $this->currentModel);\n\n $form->tab('基本信息', function ($form) {\n\n //$form->display('id', 'ID');\n //$form->text('keyword', '关键词');\n $form->text('static_url', '静态地址')->help(\"如果输入:New-York-Downtown.html,则访问地址为:http://www.yinjispace.com/article/<span style='color:#F00;'>New-York-Downtown.html</span>\");\n $form->radio('article_status', '状态')->options(['0' => '草稿', '1' => '审核中', '2' => '已发布'])->default('0');\n $form->radio('display', '公开度')->options(['0' => '公开', '-1' => '保密'])->default('0');\n $form->datetime('release_time', '发布时间')->format('YYYY-MM-DD HH:mm:ss');\n // $form->datetime('created_at','发布时间')->format('YYYY-MM-DD HH:mm:ss');\n $form->multipleSelect('category_ids', '分类')->options(ArticleCategory::getSelectOptions());\n $form->multipleSelect('topic_ids', '专题')->options(Topic::getSelectOptions());\n $form->text('tag_ids', '标签(逗号分隔)');\n $form->text('view_num', '浏览数')->default(0);\n $form->text('like_num', '点赞数')->default(0);\n $form->text('favorite_num', '收藏数')->default(0);\n $form->text('vip_download', '下载地址');\n //$form->multipleSelect('designer_id', '设计师ID')->options(Designer::getSelectOptions());\n $form->multipleSelect('designer_id', '设计师')->options(function ($ids) {\n $designer = Designer::find($ids);\n if ($designer) {\n return $designer->pluck('title_cn', 'id');\n }\n\n })->ajax('/admin/article/get_designer_select_options');\n $form->text('article_source', '文章来源');\n $form->text('article_source_url', '文章来源URL');\n $form->image('custom_thum', '自定义封面')\n ->uniqueName()\n ->widen(880)\n ->move('public/photo/images/custom_thum/');\n $form->image('special_photo', '特色照片')\n ->uniqueName()\n ->widen(1920)\n ->move('public/photo/images/special_photo/');\n $form->text('seo_title', 'SEO标题');\n $form->text('seo_keyword', 'SEO关键词');\n $form->text('seo_desc', 'SEO描述');\n })->tab('中文', function ($form) {\n\n $form->text('title_designer_cn', '标题(设计师)');\n $form->text('title_name_cn', '标题(项目名称)');\n $form->text('title_intro_cn', '标题(项目介绍)');\n $form->text('description_cn', '自定义描述(中)');\n $form->text('location_cn', '地域(中)');\n $form->ckeditor('detail.content_cn', '正文(中)');\n\n })->tab('English', function ($form) {\n\n $form->text('title_designer_en', '标题(设计师)');\n $form->text('title_name_en', '标题(项目名称)');\n $form->text('title_intro_en', '标题(项目介绍)');\n $form->text('description_en', '自定义描述(英)');\n $form->text('location_en', '地域(英)');\n $form->ckeditor('detail.content_en', '正文(英)');\n\n });\n\n //保存前回调\n $form->saving(function (Form $form) {\n if (empty($form->model()->release_time)) {\n $form->release_time = date('Y-m-d H:i:s');\n }\n });\n\n $form->saved(function (Form $form) {\n $tags = explode(',', $form->tag_ids);\n foreach ($tags as $tag) {\n echo $tag;\n $ret = ArticleTag::firstOrCreate(['name_cn' => trim($tag)]);\n }\n\n });\n\n\n return $form;\n }", "public function addAction()\n {\n $isPosted = $this->request->getPost('doCreate');\n if (!$isPosted) {\n $this->response->redirect($this->request->getPost('redirect'));\n }\n $comment = $this->getCommentSessionValuesFromForm();\n $comments = new \\Anax\\Comment\\CommentsInSession();\n $comments->setDI($this->di);\n $comments->add($comment);\n $this->response->redirect($this->request->getPost('redirect'));\n }", "function createForm(){\n\t\t$this->createFormBase();\n\t\t$this->addElement('reset','reset','Reset');\t\t\t\n\t\t$tab['seeker_0'] = '0';\n\t\t$this->setDefaults($tab);\n\t\t$this->addElement('submit','bouton_add_pi','Add a contact',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_contact'\"));\n\t\t$this->createVaFormResolution();\n\t\t$this->createFormGeoCoverage();\n\t\t$this->createFormGrid();\t\n\t\t//Required format\n\t\t$dformat = new data_format;\n\t\t$dformat_select = $dformat->chargeFormDestFormat($this,'required_data_format','Required data format','NetCDF');\n\t\t$this->addElement($dformat_select);\n\t\t$this->getElement('organism_0')->setLabel(\"Organism short name\");\n\t\t$this->getElement('project_0')->setLabel(\"Useful in the framework of\");\n\t\t$this->getElement('dats_abstract')->setLabel(\"Abstract \");\n\t\t$this->getElement('dats_purpose')->setLabel(\"Purpose\");\n\t\t$this->getElement('database')->setLabel(\"Data center\");\n\t\t$this->getElement('new_db_url')->setLabel(\"Data center url\");\n\t\t$this->getElement('dats_use_constraints')->setLabel(\"Access and use constraints\");\t\t\t\n\t\t$this->getElement('sensor_resol_tmp')->setLabel('Temporal (hh:mm:ss)');\t\t\t\n\t\t$this->getElement('place_alt_min_0')->setLabel(\"Altitude min\");\n\t\t$this->getElement('place_alt_max_0')->setLabel(\"Altitude max\");\n\t\t$this->getElement('data_format_0')->setLabel(\"Original data format\");\n\t\t$this->addElement('file','upload_doc','Attached document');\n\t\t$this->addElement('submit','upload','Upload');\n\t\t$this->addElement('submit','delete','Delete');\n\t\t\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->getElement('methode_acq_'.$i)->setLabel(\"Parameter processing related information\");\n\t\t}\n\t\t$this->addElement('submit','bouton_add_variable','Add a parameter',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_param'\"));\n\t\t\n\t\t$this->addElement('submit','bouton_add_projet','Add a project',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_general'\"));\n\t\t$option = array();\n\t\t$option['default'] = \"\";\n\t\t$option['model'] = \"Model\";\n\t\t$option['instrument'] = \"Instrument\";\n\t\t$option['satellite'] = \"Satellite\";\n\t\t$this->addElement('select','source_type','source type :',$option,array('onchange' => \"DeactivateButtonAddSource()\",'onclick' => \"DeactivateButtonAddSource();\",'onmouseover' => 'DeactivateButtonAddSource();' ));\n\t\t$this->addElement('submit','bouton_add_source','Add a source',array('disabled' => 'true','onclick' => \"document.getElementById('frmvadataset').action += '#a_source'\",'onmouseout' => 'DeactivateButtonAddSource();'));\n\t\t\n\t\tif (isset ( $this->dataset->dats_sensors ) && ! empty ( $this->dataset->dats_sensors )) {\n\t\t\t$this->dats_sensors = array();\n\t\t\t$this->dats_sensors = $this->dataset->dats_sensors ;\n\t\t}\n\t\tif (isset ( $this->dataset->sites ) && ! empty ( $this->dataset->sites )) {\n\t\t\t$this->sites = array();\n\t\t\t$this->sites = $this->dataset->sites;\n\t\t}\n\t\t\n\t\tif ( isset ( $this->dataset->dats_id ) && $this->dataset->dats_id > 0) {\n\t\t\tif (isset ( $this->dataset->nbModFormSensor )){\n\t\t\t\tif($this->dataset->nbModForm <= $this->dataset->nbModFormSensor ){\n\t\t\t\t\t$this->dataset->nbModForm = $this->dataset->nbModFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbSatFormSensor )){\n\t\t\t\t//$this->dataset->nbSatFormSensor = $this->dataset->nbSatFormSensor - 1;\n\t\t\t\tif($this->dataset->nbSatForm <= $this->dataset->nbSatFormSensor){\n\t\t\t\t\t$this->dataset->nbSatForm = $this->dataset->nbSatFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbInstruFormSensor )){\n\t\t\t\tif($this->dataset->nbInstruForm <= $this->dataset->nbInstruFormSensor){\n\t\t\t\t\t$this->dataset->nbInstruForm = $this->dataset->nbInstruFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->dataset->nbModForm > 0)\n\t\t\t$this->addMod();\n\t\tif($this->dataset->nbInstruForm > 0)\n\t\t\t$this->addInstru();\t\n\t\tif($this->dataset->nbSatForm > 0)\n\t\t\t$this->addSat();\n\t\t\n\t\t$this->dataset->dats_sensors = null ;\n\t\t$this->dataset->sites = null;\n\t}", "function action_form_comment($form)\n {\n $user = User::identify();\n if ($user->loggedin) {\n return;\n }\n\n $this->load_options();\n if (!$this->ready) {\n return;\n }\n\n // If the commenter has been approved as valid before, don't show the captcha\n if (isset($_SESSION['recaptchaV2_commenter_validated'])\n && $_SESSION['recaptchaV2_commenter_validated'] == true) {\n $form->insert('cf_submit', 'static', 'recaptcha', '');\n } // If the commenter has been checked and not approved, show the captcha and add validation\n else if (isset($_SESSION['recaptchaV2_commenter_validated'])) {\n $html\n = '<script>\n window.onload = function() { \n document.getElementById(\"cf_submit\").style.display=\"none\";\n document.getElementById(\"g-recaptcha\").style.display=\"block\";\n }\n\t\t function YourOnSubmitFn(token) {\n\t\t document.getElementById(\"comment-public\").submit();\n\t\t }\n\t\t </script>';\n $html\n .= '<button class=\"g-recaptcha\" id=\"g-recaptcha\" data-sitekey=\"'.$this->options['public_key'].'\"\n\t\t\t\tdata-callback=\"YourOnSubmitFn\" style=\"display: none\">Senden</button>';\n\n $recaptcha = $form->insert('cf_submit', 'static', 'recaptcha', $html);\n $recaptcha->add_validator([$this, 'validate']);\n } // If the commenter has not yet been checked, don't show the captcha, but add validation for the commenter\n else {\n $form->cf_commenter->add_validator([$this, 'validate_commenter']);\n $form->insert('cf_submit', 'static', 'recaptcha', '');\n }\n }", "protected function onAfterAddProjectAndStatus()\n\t{\n\t\t\n\t\t$this->setRedirect(\\JRoute::_('index.php?option=com_hshrndreview&view=Projects'),\"Thank you for submitting your new development project. A confirmation email has been send to you...\");\n\n\t\treturn true;\n\t}", "public function leaveCommentBtn($id){\n $this->validate([\n 'id'=>'required',\n 'comment'=>'required'\n ]);\n $com = new PostComment;\n $com->user_id = Auth::user()->id;\n $com->post_id = $id;\n $com->comment = $this->comment;\n $com->tenant_id = Auth::user()->tenant_id;\n $com->save();\n $this->comment = '';\n $this->getContent();\n }", "public function run(){\n\t\tYii::app()->clientScript->registerScript('enterComment',\"\n\t\t\t$('#Comment_content').live('keypress', function(e){\n\t\t\t if(e.keyCode == 13){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t//jQuery.ajax({'type':'POST','url':'/comment/comment','cache':false,'data':jQuery(this).parents(\\\"form\\\").serialize(),'success':function(html){jQuery(\\\"#comment-page\\\").html(html)}});$('#Comment_content').attr('disabled', 'disabled');\n\t\t\t\t $('#comment').trigger('click'); \n\t\t\t\t\treturn false;\n\t\t\t\t }\n \t});\", CClientScript::POS_END);\n\t\t\n\t\tYii::app()->clientScript->registerScript('deleteComment',\"\n\t\t\t$('.close > a').live('click', function(e){jQuery.ajax({'type':'GET','success':$('#comment'+$(this).attr('id').substring(1)).hide('slow'),'data':{'id':$(this).attr('id').substring(1)},'url':'\".CHtml::normalizeUrl(array('/comment/deleteComment')).\"','cache':false});return false;\n\t\t});\", CClientScript::POS_END);\n\t\t\n\t\t$this->render('commenting',array(\n\t\t\t'model'=>$this->model,\n\t\t\t'comments'=>$this->comments,\n\t\t));\n }", "public function showCommentForm($blog_id)\n {\n $errors = false;\n $classC = \"\";\n $classE = \"\";\n $classN = \"\";\n if(isset($_SESSION['error'])) {\n switch ($_SESSION['error']) {\n case 1 :\n $errors = 'Something went wrong while saving your comment. Please try again!';\n break;\n case 2 :\n $errors = 'Please provide a valid email address!';\n $classE = 'errorborder';\n break;\n case 3 :\n $errors = 'Please answer the anti-spam question correctly!';\n break;\n case 4 :\n $errors = 'Please enter your name!';\n $classN = 'errorborder';\n break;\n case 5 :\n $errors = 'Please fill out the comment field!';\n $classC = 'errorborder';\n break;\n case 12 :\n $errors = 'Please provide a valid name, email and comment!';\n $classE = 'errorborder';\n $classN = 'errorborder';\n $classC = 'errorborder';\n break;\n case 13 :\n $errors = 'Please provide a valid name and email!';\n $classN = 'errorborder';\n $classE = 'errorborder';\n break;\n case 14 :\n $errors = 'Please provide a valid email and comment!';\n $classE = 'errorborder';\n $classC = 'errorborder';\n break;\n case 15 :\n $errors = 'Please provide a valid name and comment!';\n $classN = 'errorborder';\n $classC = 'errorborder';\n break;\n default :\n $errors = false;\n $classC = \"\";\n $classE = \"\";\n $classN = \"\";\n break;\n }\n }\n\n if(isset($_SESSION['error'])) {\n $error = \"<p class='error'>$errors</p>\";\n } else {\n $error = NULL;\n }\n //check if session variable exist\n if(isset($_SESSION['c_name'])) {\n $n = $_SESSION['c_name'];\n } else {\n $n = NULL;\n }\n if(isset($_SESSION['c_email'])) {\n $e = $_SESSION['c_email'];\n } else {\n $e = NULL;\n }\n if(isset($_SESSION['c_comment'])) {\n $c = $_SESSION['c_comment'];\n } else {\n $c = NULL;\n }\n //generate a challenge question\n $challenge = $this->generateChallenge();\n if($errors == false) {\n $scroll = \"\";\n } else {\n $scroll = \"#comment-form\";\n }\n\n return <<<FORM\n <form action=\"/inc/update.inc.php\" method=\"post\" id=\"comment-form\">\n \n <fieldset>\n <legend>Post a Comment</legend>$error\n <label>Name\n <input class=\"$classN\" type=\"text\" name=\"name\" maxlength=\"75\" value=\"$n\"/>\n </label>\n <label>Email\n <input class=\"$classE\" type=\"text\" name=\"email\" maxlength=\"150\" value=\"$e\"/>\n </label>\n <label>Comment\n <textarea class=\"$classC\" rows=\"10\" cols=\"45\" name=\"comment\">$c</textarea>\n </label>$challenge\n <input type=\"hidden\" name=\"blog_id\" value=\"$blog_id\"/>\n <input type=\"submit\" name=\"submit\" value=\"Post comment\"/>\n <input type=\"submit\" name=\"submit\" value=\"Cancel\"/>\n </fieldset>\n </form>\nFORM;\n }", "function add_surat_keputusan_pemutih_penyalur_form() {\n//\t\tif (! $this->get_permission('fill_this')) return $this->intruder();\n\t\tglobal ${$GLOBALS['session_vars']}, ${$GLOBALS['get_vars']};\n\t\t$field_arr = surat_keputusan_pemutih_penyalur::get_field_set();\n\n//\t\t$value_arr = array ();\n\t\t$label_arr = $this->surat_keputusan_pemutih_penyalur_label;\n\t\t$optional_arr = $this->optional_arr;\n\t\t$optional_arr['keputusan_pemutih_penyalur'] = 'user_defined';\n\t\t$value_arr['keputusan_pemutih_penyalur']= '<textarea rows=\"100\" cols=\"75\" name=\"keputusan_pemutih_penyalur\" class=\"text\"></textarea>';\n\n\t\teval($this->save_config);\n\t\t$this->id_cek_pemutih_form($config);\n\t\t\n\n\n//\t\t$label_arr['submit_val'] = 'Submit';\n\t\t$label_arr['form_extra'] = '<input type=hidden name=action value=\"postadd\">'; // default null\n\t\t$label_arr['form_extra'] .= '<input type=hidden name=opener value=\"'.$GLOBALS[$GLOBALS['get_vars']]['opener'].'\">'; // default null\n\t\t$label_arr['form_extra'] .= '<input type=hidden name=opener_sql value=\"'.$GLOBALS[$GLOBALS['get_vars']]['opener_sql'].'\">'; // default null\n\t\t$label_id_cek_pemutiharr['form_extra'] .= '<input type=hidden name=opener_var value=\"'.$GLOBALS[$GLOBALS['get_vars']]['opener_var'].'\">'; // default null\n\t\t$label_arr['form_title'] = __('Form').' '.__('Add').' Surat Keputusan Pemutihan Izin Penyalur'; // default null\n\t\t$label_arr['form_width'] = '100%'; // default 100%\n\t\t$label_arr['form_name'] = 'theform'; // default form\n\n\t\t$_form = new form();\n\t\t$_form->set_config(\n\t\t\tarray (\n\t\t\t\t'field_arr'\t=> $field_arr,\n\t\t\t\t'label_arr'\t=> $label_arr,\n\t\t\t\t'value_arr'\t=> $value_arr,\n\t\t\t\t'optional_arr'\t=> $optional_arr\n\t\t\t)\n\t\t);\n\t\treturn $_form->parse_field();\n\t}", "protected function display_form_body ($action)\n\t{\n\t\t//Project Title\n\t\tInput::display_input\n\t\t(\n\t\t\t\"text\",\n\t\t\t\"Title\",\n\t\t\t$this->fields['Title'],\n\t\t\t\"Title\",\n\t\t\t$this->msgs\n\t\t);\n\n\t\t//Category\n\t\t$categories = Input::get_dropdown_options\n\t\t(\n\t\t\t$this->connection,\n\t\t\t\"select CategoryID as ID, CategoryName as Name from Category\"\n\t\t);\n\n\t\tInput::display_dropdown\n\t\t(\n\t\t\t\"CategoryID\",\n\t\t\t$this->fields['CategoryID'],\n\t\t\t\"Category\",\n\t\t\t$categories,\n\t\t\t$this->msgs\n\t\t);\n\n\t\t//ProjectNum\n\t\tInput::display_input\n\t\t(\n\t\t\t\"number\",\n\t\t\t\"ProjectNum\",\n\t\t\t$this->fields['ProjectNum'],\n\t\t\t\"Project Number\",\n\t\t\t$this->msgs\n\t\t);\n\t\tprint (\"Leave this field blank to auto-generate a new project number.<br>\");\n\n\t\t//Booth\n\t\t$booth_msg = \"\";\n\t\t$booth_query =\n\t\t\"\n\t\t\tselect\n\t\t\t\tBoothID as ID,\n\t\t\t\tconcat ('Booth ', BoothNum) as Name\n\t\t\tfrom Booth\n\t\t\";\n\n\t\tif ($action == \"edit\")\n\t\t{\n\t\t\t$booth_msg = \n\t\t\t\t\"Selecting a booth already in use will cause the project using it \" .\n\t\t\t\t\"to swap booths with this project.<br>\"\n\t\t\t;\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\t$booth_query .= \"where BoothID not in (select BoothID from Project)\";\n\t\t\t$booth_msg = \"If there are no booths left, you may need to add more.\";\n\t\t}\n\n\t\t$booths = Input::get_dropdown_options\n\t\t(\n\t\t\t$this->connection,\n\t\t\t$booth_query\n\t\t);\n\n\t\tInput::display_dropdown\n\t\t(\n\t\t\t\"BoothID\",\n\t\t\t$this->fields['BoothID'],\n\t\t\t\"Booth\",\n\t\t\t$booths,\n\t\t\t$this->msgs\n\t\t);\n\n\t\tprint ($booth_msg);\n\n\n\t\t//Abstract\n\t\tprint\n\t\t('\n\t\t\t<label for=\"Abstract\">Abstract:</label>\n\t\t\t<textarea\n\t\t\t\tplaceholder=\"Enter project description\"\n\t\t\t\tname=\"Abstract\"\n\t\t\t\tclass=\"p-desc\">' . $this->fields['Abstract'] .\n\t\t\t'</textarea>\n\t\t');\n\n\t}", "public function endForm()\r\n {\r\n echo '<div class=\"panel-footer\">\r\n <input type=\"submit\" class=\"btn btn-primary btn-sm\" value=\"Vote\" />\r\n </div>\r\n </form>';\r\n }", "public function addform()\n\t{\n\t\t\t$this->setMethod('post');\n\n\t\t\t\n\t\t\t$this->addElement('radio', 'status', array(\n\t\t\t\t'required' => true,\n\t\t\t\t'multiOptions' => array(\n\t\t\t\t\t'1' => IN_PROGRESS,\n\t\t\t\t\t'2' => 'Closed'\n\t\t\t\t\t\n\t\t\t\t),\n\t\t\t\t'value' => '1' //key of multiOption\n\t\t\t));\n\t\t\n\t\t\n\n\t\t\t$this->addElement('textarea', 'Comment', array( \n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'maxlength' =>'50',\n\t\t\t\t\t\n\t\t\t\t\t'class' => 'validate[required] text-input',\n\t\t\t\t\t'decorators'=>Array(\n\t\t\t\t\t\t'ViewHelper','Errors'\n\t\t\t\t\t),\t\t \n\t\t\t));\n\n\t\t\t\n\n\t\t\t\n\n\n\t\n\t\t\t\t\n\t\t\t$this->addElement('submit', 'submit', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t\t\t'label' => 'Submit',\n\t\t\t));\n\t\t\t\n\t\t\t// And finally add some CSRF protection\n\t\t\t$this->addElement('hash', 'csrf', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t));\t\n\t}", "function main_form($type='edit')\n\t{\n\t\t$this->ipsclass->input['id'] = intval($this->ipsclass->input['id']);\n\t\t\n\t\tif ($type == 'edit')\n\t\t{\n\t\t\tif ( ! $this->ipsclass->input['id'] )\n\t\t\t{\n\t\t\t\t$this->ipsclass->admin->error(\"No custom field id was passed to edit.\");\n\t\t\t}\n\t\t\t\n\t\t\t$form_code = 'doedit';\n\t\t\t$button = 'Complete Edit';\n\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form_code = 'doadd';\n\t\t\t$button = 'Add Field';\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get field from db\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $this->ipsclass->input['id'] )\n\t\t{\n\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'downloads_cfields', 'where' => \"cf_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\n\t\t\t$fields = $this->ipsclass->DB->fetch_row();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fields = array();\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Top 'o 'the mornin'\n\t\t//-----------------------------------------\n\t\t\n\t\tif ($type == 'edit')\n\t\t{\n\t\t\t$this->ipsclass->admin->page_title = \"Editing Custom Field \".$fields['cf_title'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ipsclass->admin->page_title = 'Adding a new custom field';\n\t\t\t$fields['cf_title'] = '';\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Wise words\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->admin->page_detail = \"Please double check the information before submitting the form.\";\n\t\t\n\t\t//-----------------------------------------\n\t\t// Start form\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , $form_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t 2 => array( 'act' , 'downloads' ),\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t 3 => array( 'id' , $this->ipsclass->input['id'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t 4 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t 5 => array( 'req'\t , 'customfields'\t),\n\t\t\t\t\t\t\t\t\t ) );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Format...\n\t\t//-----------------------------------------\n\t\t\t\t\t\t\t\t\t \n\t\t$fields['cf_content'] = $this->func->method_format_content_for_edit($fields['cf_content'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Tbl (no ae?)\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Field Settings\" );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Field Title</b><div class='graytext'>Max characters: 200</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"cf_title\", $fields['cf_title'] )\n\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\t\t\t\t\t\t \n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Description</b><div class='graytext'>Max Characters: 250</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"cf_desc\", $fields['cf_desc'] )\n\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\t\t\t\t\t\t \n\t\t//-----------------------------------------\n\t\t// Apply to categories\n\t\t//-----------------------------------------\n\t\t\n\t\t$sel_menu = \"<select name='cats_apply[]' size='5' multiple='multiple'>\\n\";\n\t\t\n\t\t$cur \t = $this->lib->get_cats_cfield( $fields['cf_id'] );\n\t\t$opts\t = $this->lib->cat_jump_list( 1, 'none', $cur );\n\n\t\tif( is_array($opts) AND count($opts) )\n\t\t{\n\t\t\tforeach( $opts as $cdata )\n\t\t\t{\n\t\t\t\tif( is_array($cur) AND in_array( $cdata[0], $cur ) )\n\t\t\t\t{\n\t\t\t\t\t$cdata[2] = \" selected='selected'\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sel_menu .= \"<option value='{$cdata[0]}'{$cdata[2]}>{$cdata[1]}</option>\\n\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$sel_menu .= \"</select>\";\n\t\t\t\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Use in Categories</b><div class='graytext'>Select the categories to use this field in</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $sel_menu\n\t\t\t\t\t\t\t\t\t ) );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Field Type</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t $this->ipsclass->adskin->form_dropdown(\"cf_type\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 0 => array( 'text' , 'Text Input' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 1 => array( 'drop' , 'Drop Down Box' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'area' , 'Text Area' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $fields['cf_type'] )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t\t\t \n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Maximum Input</b><div class='graytext'>For text input and text areas (in characters)</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"cf_max_input\", $fields['cf_max_input'] )\n\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\t\t\t\t\t\t \n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Expected Input Format</b><div class='graytext'>Use: <b>a</b> for alpha characters<br />Use: <b>n</b> for numerics.<br />Example, for credit card numbers: nnnn-nnnn-nnnn-nnnn<br />Example, Date of Birth: nn-nn-nnnn<br />Leave blank to accept any input</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"cf_input_format\", $fields['cf_input_format'] )\n\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\t\t\t\t\t\t \n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Option Content (for drop downs)</b><div class='graytext'>In sets, one set per line<br>Example for 'Software Version' field:<br>10=1.0<br>20=2.0<br>na=Not Applicable<br>Will produce:<br><select name='version'><option value='10'>1.0</option><option value='20'>2.0</option><option value='na'>Not Applicable</option></select><br>10,20, or na stored in database. When showing field on download page, will use value from pair (20=2.0, shows '2.0')</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_textarea(\"cf_content\", $fields['cf_content'] )\n\t\t\t\t\t\t\t\t\t ) );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Field MUST be completed and not left empty?</b><div class='graytext'>If 'yes', an error will be shown if this field is not completed.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"cf_not_null\", $fields['cf_not_null'] )\n\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\t\t\t\t\t\t \n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Include field in auto-generated topics?</b><div class='graytext'>Only applies to categories that automatically generate topics for file submissions</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"cf_topic\", $fields['cf_topic'] )\n\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\t\t\t\t\t\t \n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Allow users to search in these fields?</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"cf_search\", $fields['cf_search'] )\n\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\t\t\t\t\t\t \n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form($button);\n\t\t\t\t\t\t\t\t\t\t \n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\t\t\n\t\t$this->ipsclass->admin->output();\n\t\t\t\n\t}", "function siemens_lendingform_create_form_wrapper($lendingform) {\r\n \r\n // No access for subdomain\r\n if (lendingform_siemens_is_subdomain()) {\r\n return drupal_not_found();\r\n }\r\n \r\n ctools_include('modal');\r\n ctools_include('ajax');\r\n\r\n $form_state = array(\r\n 'title' => t('Create Project'),\r\n 'ajax' => TRUE,\r\n );\r\n $output = ctools_modal_form_wrapper('siemens_lendingform_create_ajax_confirm', $form_state);\r\n\r\n if ($form_state['executed']) {\r\n $returnback = drupal_get_query_parameters();\r\n if (isset($returnback['returnback'])) {\r\n drupal_goto($returnback['returnback'], array('query' => array('tab' => 2)));\r\n } else {\r\n\r\n $commands = array();\r\n $commands[] = ctools_modal_command_dismiss(); \r\n \r\n $citation_list = siemens_citations_get_citations($lendingform->entity_id);\r\n $commands[] = ajax_command_html('#siemens-existing-references', $citation_list);\r\n\r\n print ajax_render($commands);\r\n exit();\r\n }\r\n }\r\n\r\n print ajax_render($output);\r\n exit();\r\n}", "function delete_form()\n\t{\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя изменить ID группы, попытайтесь снова\");\n\t\t}\n\n\t\tif ($this->ipsclass->input['id'] < 5)\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Вы не можете перемещать группы, которые используются в данный момент, но переименовать и отредактировать функции можно\");\n\t\t}\n\n\t\t$this->ipsclass->admin->page_title = \"Удаление пользовательской группы\";\n\n\t\t$this->ipsclass->admin->page_detail = \"Пожалуйста, убедитесь в том, что хотите удалить данную группу.\";\n\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'COUNT(id) as users', 'from' => 'members', 'where' => \"mgroup=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$black_adder = $this->ipsclass->DB->fetch_row();\n\n\t\tif ($black_adder['users'] < 1)\n\t\t{\n\t\t\t$black_adder['users'] = 0;\n\t\t}\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'COUNT(id) as users', 'from' => 'members', 'where' => \"mgroup_others LIKE '%\".intval($this->ipsclass->input['id']).\"%'\" ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$extra_group = $this->ipsclass->DB->fetch_row();\n\n\t\tif ($extra_group['users'] < 1)\n\t\t{\n\t\t\t$extra_group['users'] = 0;\n\t\t}\n\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'g_title', 'from' => 'groups', 'where' => \"g_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$group = $this->ipsclass->DB->fetch_row();\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'g_id, g_title', 'from' => 'groups', 'where' => \"g_id <> \".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$mem_groups = array();\n\n\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Leave out root admin group\n\t\t\t//-----------------------------------------\n\n\t\t\tif ( $this->ipsclass->vars['admin_group'] == $r['g_id'] )\n\t\t\t{\n\t\t\t\tif ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$mem_groups[] = array( $r['g_id'], $r['g_title'] );\n\t\t}\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'dodelete' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'group' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'id' , $this->ipsclass->input['id'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'name' , $group['g_title'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 5 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\n\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Подтверждение перемещения: \".$group['g_title'] );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Количество пользователей в этой группе</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t \"<b>\".$black_adder['users'].\"</b>\",\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Количество пользователей с этой группой, как <u>вторичная</u> группа</b><br /><i>Эта вторичная группа будет удалена у этих пользователей.</i>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t \"<b>\".$extra_group['users'].\"</b>\",\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Переместить пользователей из этой группы в...</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_dropdown(\"to_id\", $mem_groups )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Удалить эту группу\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->admin->output();\n\t}", "public function comment_form() {\n\n\t\t/** Don't do anything if we are in the admin */\n\t\tif ( is_admin() )\n\t\t\treturn;\n\n\t\t/** Don't do anything unless the user has already logged in and selected a list */\n/*\t\tif ( empty( $tgm_mc_options['current_list_id'] ) )\n\t\t\treturn;\n*/\n\t\t$clear = CTCT_Settings::get('comment_form_clear') ? 'style=\"clear: both;\"' : '';\n\t\t$checked_status = ( ! empty( $_COOKIE['tgm_mc_checkbox_' . COOKIEHASH] ) && 'checked' == $_COOKIE['tgm_mc_checkbox_' . COOKIEHASH] ) ? true : false;\n\t\t$checked = $checked_status ? 'checked=\"checked\"' : '';\n\t\t$status = ''; //$this->get_viewer_status();\n\n\t\tif ( 'admin' == $status ) {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>' . CTCT_Settings::get('comment_form_admin_text') . '</p>';\n\t\t}\n\t\telseif ( 'subscribed' == $status ) {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>' . CTCT_Settings::get('comment_form_subscribed_text') . '</p>';\n\t\t}\n\t\telseif ( 'pending' == $status ) {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>' . CTCT_Settings::get('comment_form_pending_text') . '</p>';\n\t\t}\n\t\telse {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>';\n\n\t\t\t\techo sprintf('<label for=\"ctct-comment-subscribe\"><input type=\"checkbox\" name=\"ctct-subscribe\" id=\"ctct-comment-subscribe\" value=\"subscribe\" style=\"width: auto;\" %s /> %s</label>', $checked, CTCT_Settings::get('comment_form_check_text'));\n\t\t\techo '</p>';\n\t\t}\n\n\t}" ]
[ "0.66776633", "0.6323203", "0.62600523", "0.6258903", "0.6221154", "0.6193342", "0.61694235", "0.61351943", "0.61221814", "0.6086759", "0.6057474", "0.59937197", "0.5971443", "0.5970257", "0.59684414", "0.59636116", "0.59557414", "0.59487176", "0.5944934", "0.593456", "0.5912288", "0.5905132", "0.5902801", "0.5894508", "0.5862147", "0.5861013", "0.58577394", "0.58489764", "0.5845463", "0.58288455", "0.58127433", "0.5811656", "0.5808638", "0.5805196", "0.5780337", "0.5776577", "0.57658046", "0.57496786", "0.5741282", "0.5735033", "0.5729871", "0.5716677", "0.57154495", "0.5712182", "0.57062346", "0.570496", "0.5700021", "0.56934345", "0.56927645", "0.56756455", "0.5672659", "0.56700826", "0.5669729", "0.56647027", "0.56647027", "0.56647027", "0.56647027", "0.56647027", "0.56647027", "0.56647027", "0.56647027", "0.56647027", "0.56647027", "0.56647027", "0.56647027", "0.56645906", "0.5663381", "0.5661348", "0.5658209", "0.56580365", "0.5656071", "0.56532925", "0.56497365", "0.56464225", "0.5646027", "0.5642702", "0.5641977", "0.56409806", "0.5639049", "0.5636082", "0.56266254", "0.56252086", "0.56235915", "0.5622168", "0.5621967", "0.5620368", "0.5614129", "0.56134415", "0.5613401", "0.5611875", "0.5609457", "0.56094235", "0.5605497", "0.55987036", "0.5592204", "0.5590561", "0.55835766", "0.55810684", "0.557963", "0.55781925", "0.55766714" ]
0.0
-1
add service category form
public function servicecat(){ $modelservices = new Application_Model_Services(); $servicelist = $modelservices->servicesdata(); //prd($servicelist); $this->addElement('text', 'service_name', array ( "required" => TRUE, 'class' => 'form-control required', "label" => "Service Category Title " , "filters" => array("StringTrim","StripTags"), "validators" => array( array("NotEmpty",true,array("messages"=>" Expertise Title is required ")), ), )); $this->addElement('select', 'service_parent_id', array ( 'class' => 'form-control required' , "required"=>true, "multioptions"=>$servicelist, "filters" => array("StringTrim","StripTags","HtmlEntities"), )); $this->submitButton(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getVictoire_Form_Blog_CategoryService()\n {\n return $this->services['victoire.form.blog.category'] = new \\Victoire\\Bundle\\BlogBundle\\Form\\CategoryType();\n }", "public function subcategory(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t$caterories = $modelservices->categorydata();\n\t//prd($caterories);\n\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Sub Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t$this->addElement('text', 'service_price', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required digits',\n\t\t\t\"label\" => \"Service Credit \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Price is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"onchange\"=>\"getcategorylist(this.value)\",\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n\t\t$this->addElement('select', 'service_sub_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$caterories,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function create()\r\n {\r\n $serviceCategory = ServiceCategory::all();\r\n return view('admin.service.services.form', compact('serviceCategory'));\r\n }", "public function create(CategoryRequest $request, CategoryService $service)\n {\n // echo $request->input();\n // echo \"<pre>\";\n // print_r($request);\n // echo \"</pre>\";\n // exit();\n\n }", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "public function create()\n {\n return view('service_categories.create');\n }", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function create()\n {\n return view('admin.serviceCategory.create');\n }", "public function addService()\n {\n $option = 'submitnewservice';\n return view('cmsServicesAdd', ['title'=>'Add Service','option'=>$option]);\n }", "public function add_service() {\r\n if (USER_ROLE == ROLE_ONE) {\r\n $result['companies'] = $this->company_model->get_companies_id_name();\r\n $this->load->view('webpages/add_service', $result);\r\n } else {\r\n $this->load->view('webpages/404');\r\n }\r\n }", "public function actionCreate()\n {\n $model = new Services();\n $model2 = new \\app\\models\\Photos();\n //$model2->setAttribute('path',$_FILES[\"photos\"]['path']);\n \n $categories = ServiceCategories::find()->all();\n $categoryArray = [];\n foreach($categories as $category){\n $categoryArray[$category->id ] = $category->title;\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id, 'serviceCategoriesId' => $model->serviceCategoriesId, 'hairdressersId' => $model->hairdressersId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'model2' => $model2,\n 'categories' => $categoryArray,\n ]);\n }\n }", "function template_preprocess_excur_service_category(&$vars) {\n $city = menu_get_object('taxonomy_term', 2);\n $vars['city'] = $city->name;\n\n $vocabulary = taxonomy_vocabulary_machine_name_load('category');\n foreach (taxonomy_get_tree($vocabulary->vid, 0, NULL, TRUE) as $key => $term) {\n $vars['categories'][$key]['name'] = $term->name;\n $vars['categories'][$key]['id'] = $term->tid;\n $vars['categories'][$key]['icon'] = theme('image_style', array(\n 'style_name' => '50x50',\n 'path' => $term->field_image[LANGUAGE_NONE][0]['uri'],\n 'alt' => $term->name,\n 'title' => $term->name,\n 'attributes' => array(\n 'class' => array('categoty-icon'),\n ),\n ));\n }\n}", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function new_form(){\n $this->vars['page_header'] = __('Create New Service', 'latepoint');\n $this->vars['breadcrumbs'][] = array('label' => __('Create New Service', 'latepoint'), 'link' => false );\n\n $this->vars['category'] = new OsServiceCategoryModel();\n\n if($this->get_return_format() == 'json'){\n $response_html = $this->render($this->views_folder.'new_form', 'none');\n echo wp_send_json(array('status' => 'success', 'message' => $response_html));\n exit();\n }else{\n echo $this->render($this->views_folder . 'new_form', $this->get_layout());\n }\n }", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "public function addAction()\n {\n $form = new CategoryForm();\n $form->get('submit')->setValue('Add');\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n $category->exchangeArray($form->getData());\n $this->getCategoryTable()->saveCategory($category);\n\n // Redirect to list of categorys\n return $this->redirect()->toRoute('category');\n }\n }\n return array('form' => $form);\n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "protected function getVictoireBlog_BlogCategory_Form_TypeService()\n {\n return $this->services['victoire_blog.blog_category.form.type'] = new \\Victoire\\Bundle\\BlogBundle\\Form\\BlogCategoryType();\n }", "public function addCategory()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['category'];\n\t\t\t$sql = \"insert into lib_category (category,add_date,staff_id) \n\t\t\t\t\tvalues('\" . $category . \"','\" . date('Y-m-d') . \"','\" . cookie('staffAccount') . \"') \";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Add successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function create()\n {\n $data = array();\n $data['status'] = DropdownHelper::where('group_code', '001')->orderBy('key_code', 'asc')->pluck('value', 'key_code');\n $data['services'] = Service::orderBy('service_name', 'asc')->pluck('service_name', 'id')->all();\n $data['add'] = trans('main.add');\n return view('category.form', $data);\n }", "public function add_service()\n {\n\n $cols = \"`title`,`icon`,`desc`\";\n\n $value =\n \"'\" . $this->obj->all_data->service->get_title1() . \"',\n '\" . $this->obj->all_data->service->get_icon() . \"',\n '\" . $this->obj->all_data->service->get_desc() . \"'\n\n \";\n\n\n $insert = $this->obj->insert(\"out_service\", $cols, $value);\n return $insert;\n }", "public function addAction()\n {\n $form = $this->getServiceLocator()->get('civcontent_category_form');\n \n // Check if the request is a POST.\n $request = $this->getRequest();\n if ($request->isPost())\n {\n // Create a new category object.\n $category = $this->getServiceLocator()->get('civcontent_category');\n \n $data = (array) $request->getPost();\n $form->bind($category);\n $form->setData($data);\n if ($form->isValid())\n {\n // Persist changes.\n $this->getContentService()->persistCategory($category);\n \n // Redirect to content categories\n return $this->redirect()->toRoute('content/category', array(\n 'action' => 'index'\n ));\n }\n }\n \n // If a GET request, or invalid data then render/re-render the form\n return new ViewModel(array(\n 'form' => $form,\n ));\n }", "function gtags_group_category_form() {\n\tglobal $bp, $show_group_add_form_cats;\t\n\tif ($show_group_add_form_cats) return; // prevents showing form twice\n\t$show_group_add_form_cats = true;\n\n\t// the group category\t\n\t$group_cats = get_option('gtags_category'); \n\tif (empty($group_cats)) return;\n\t\n\t$selected = groups_get_groupmeta( $bp->groups->current_group->id, 'gtags_group_cat' ); \n\t?><label for=\"group-cat\"><?php _e( 'Group Category', 'gtags' ) ?></label>\n\t<select name=\"group-cat\" id=\"group-cat\" />\n\t\t<option value=\"\"><?php _e('--- SELECT ONE ---', 'gtags') ?></option>\n\t<?php foreach ( $group_cats as $tag => $desc ): ?>\n\t\t<?php if ( !$desc ) $desc = $tag; ?>\n\t\t<option value=\"<?php echo $tag; ?>\" <?php if ( $tag == $selected ) echo 'selected=\"selected\"' ?>><?php echo $desc; ?></option>\n\t<?php endforeach; ?>\n\t</select>\n\t<i><?php _e('(the primary group activity)', 'gtags'); ?></i><br><?php \t\n}", "public function add()\n {\n $category = $this->Category->newEntity();\n if ($this->request->is('post')) {\n $category = $this->Category->patchEntity($category, $this->request->getData());\n if ($this->Category->save($category)) {\n $this->Flash->success(__('The category has been saved.'));\n\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error(__('The category could not be saved. Please, try again.'));\n }\n $this->set(compact('category'));\n }", "function add(){\n\t\tif(!$this->checkLogin()){\n\t\t\tredirect(base_url());\n\t\t}\n\n\t\t$pageData['header_title'] = APP_NAME.' | Add Document Category';\n\t\t$pageData['page_title'] = 'Document Category Management';\n\t\t$pageData['parent_menu'] = 'document_management';\n\t\t$pageData['child_menu'] = 'document_category';\n\n\t\t$this->load->view('admin/document_management/category/add', $pageData);\n\t}", "public function add_category() {\n\t\n\t\tif($this->input->post('add_type')=='add_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name'),\n\t\t'created_at' => date('d-m-Y h:i:s')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->add_assets_category($data);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_added');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio 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/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "protected function saveCategoryFromCategory($form){\n $data = $this->getRequest()->getPost();\n //@todo: validate the data\n $form->setData($data);\n if ($form->isValid()) {\n \n $this->category->exchangeArray($form->getData());\n $categoryTable = $this->getServiceLocator()->get(\"Category\\Model\\CategoryTable\");\n $this->category = $categoryTable->saveCategory($this->category);\n \n if($id = $this->category->getId()){\n $this->redirect()->toRoute('category_home');\n }\n }else{\n \n }\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "public function getAddEditForm($target = '/admin/Cart') {\n\t\t$form = new Form('CartCategory_addedit', 'post', $target);\n\t\t\n\t\t$form->setConstants( array ( 'section' => 'categories' ) );\n\t\t$form->addElement( 'hidden', 'section' );\n\t\t$form->setConstants( array ( 'action' => 'addedit' ) );\n\t\t$form->addElement( 'hidden', 'action' );\n\t\t\n\t\tif (!is_null($this->getId())) {\n\t\t\t$form->setConstants( array ( 'cartcategory_categories_id' => $this->getId() ) );\n\t\t\t$form->addElement( 'hidden', 'cartcategory_categories_id' );\n\t\t\t\n\t\t\t$defaultValues ['cartcategory_name'] = $this->getName();\n\t\t\t$defaultValues ['cartcategory_description'] = $this->getDescription();\n\t\t\t$defaultValues ['cartcategory_image'] = $this->getImage();\n\t\t\t$defaultValues ['cartcategory_parent_id'] = $this->getParent_id();\n\t\t\t$defaultValues ['cartcategory_date_added'] = $this->getDate_added();\n\t\t\t$defaultValues ['cartcategory_last_modified'] = $this->getLast_modified();\n\t\t\t$defaultValues ['cartcategory_status'] = $this->getStatus();\n\n\t\t\t$form->setDefaults( $defaultValues );\n\t\t}\n\t\t\n\t\t$form->addElement('text', 'cartcategory_name', 'Name');\n\t\t\n\t\t$description = $form->addElement('textarea', 'cartcategory_description', 'Description');\n\t\t$description->setCols(80);\n\t\t$description->setRows(10);\n\t\t\n\t\t$newImage = $form->addElement('file', 'cartcategory_image_upload', 'Category Image');\n\t\t$curImage = $form->addElement('dbimage', 'cartcategory_image', $this->getImage());\n\t\t\n\t\t$form->addElement('select', 'cartcategory_parent_id', 'Parent Category', self::toArray());\n\t\t\n\t\t$added = $form->addElement('text', 'cartcategory_date_added', 'Date Added');\n\t\t$added->freeze();\n\t\t\n\t\t$modified = $form->addElement('text', 'cartcategory_last_modified', 'Date Last Modified');\n\t\t$modified->freeze();\n\t\t\n\t\t$form->addElement('select', 'cartcategory_status', 'Status', Form::statusArray());\n\t\t$form->addElement('submit', 'cartcategory_submit', 'Submit');\n\n\t\tif (isset($_REQUEST['cartcategory_submit']) && $form->validate() && $form->isSubmitted()) {\n\t\t\t$this->setName($form->exportValue('cartcategory_name'));\n\t\t\t$this->setDescription($form->exportValue('cartcategory_description'));\n\t\t\t$this->setImage($form->exportValue('cartcategory_image'));\n\t\t\t$this->setParent_id($form->exportValue('cartcategory_parent_id'));\n\t\t\t$this->setDate_added($form->exportValue('cartcategory_date_added'));\n\t\t\t$this->setLast_modified($form->exportValue('cartcategory_last_modified'));\n\t\t\t$this->setStatus($form->exportValue('cartcategory_status'));\n\t\t\t\n\t\t\tif ($newImage->isUploadedFile()) {\n\t\t\t\t$im = new Image();\n\t\t\t\t$id = $im->insert($newImage->getValue());\n\t\t\t\t$this->setImage($im);\n\t\t\t\t\n\t\t\t\t$curImage->setSource($this->getImage()->getId());\n\t\t\t}\n\t\t\t\n\t\t\t$this->save();\n\t\t}\n\n\t\treturn $form;\n\t\t\n\t}", "public function ServicesForm()\n\t{\n\t\t$services = DataObject::get('SupportAndServicesCategories')\n\t\t\t->map('ID', 'Title');\n\t\t$populations = DataObject::get('Population')\n\t\t\t->map('ID', 'Title');\n\t\t$state = DataObject::get('AustraliaState')\n\t\t\t->map('ID', 'Title')\n\t\t\t->toArray();\n\n\t\t$sort = array('Alphabetical' => 'Alphabetical', 'Relevance' => 'Relevance');\n\n\t\t$form = Form::create(\n\t\t\t$this,\n\t\t\t__FUNCTION__,\n\n\t\t\tFieldList::create(\n\t\t\t\tDropdownField::create('services')\n\t\t\t\t\t->setEmptyString('All Services')\n\t\t\t\t\t->setSource($services)\n\t\t\t\t\t->addExtraClass('services'),\n\t\t\t\tTextField::create('query')\n\t\t\t\t\t->setAttribute('placeholder', 'Search keywords or Topic')\n\t\t\t\t\t->addExtraClass('input_text'),\n\t\t\t\t// DropdownField::create('population')\n\t\t\t\t// \t->setEmptyString('Population')\n\t\t\t\t// \t->setSource($populations)\n\t\t\t\t// \t->addExtraClass('population_dd'),\n\t\t\t\tDropdownField::create('state')\n\t\t\t\t\t->setEmptyString('Australia')\n\t\t\t\t\t->setSource($state)\n\t\t\t\t\t->addExtraClass('hidden'),\n\t\t\t\tDropdownField::create('sort')\n\t\t\t\t\t->setEmptyString('Sort')\n\t\t\t\t\t->setSource($sort)\n\t\t\t\t\t->addExtraClass('hidden')\n\t\t\t),\n\t\t\tFieldList::create(\n\t\t\t\tFormAction::create('search', 'Search')\n\t\t\t\t\t->addExtraClass('btn darkBlue')\n\t\t\t)\n\t\t);\n\t\t$form->setFormMethod('GET')\n\t\t\t ->setFormAction($this->Link())\n\t\t\t ->disableSecurityToken()\n\t\t\t ->loadDataFrom($this->request->getVars());\n\t\treturn $form;\n\t}", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "function register_service() {\r\n\r\n\t\t$labels = array(\r\n\t\t\t'name' => _x( 'Service', 'Post Type General Name', 'kitgreen' ),\r\n\t\t\t'singular_name' => _x( 'Service', 'Post Type Singular Name', 'kitgreen' ),\r\n\t\t\t'menu_name' => __( 'Service', 'kitgreen' ),\r\n\t\t\t'parent_item_colon' => __( 'Parent Item:', 'kitgreen' ),\r\n\t\t\t'all_items' => __( 'All Items', 'kitgreen' ),\r\n\t\t\t'view_item' => __( 'View Item', 'kitgreen' ),\r\n\t\t\t'add_new_item' => __( 'Add New Item', 'kitgreen' ),\r\n\t\t\t'add_new' => __( 'Add New', 'kitgreen' ),\r\n\t\t\t'edit_item' => __( 'Edit Item', 'kitgreen' ),\r\n\t\t\t'update_item' => __( 'Update Item', 'kitgreen' ),\r\n\t\t\t'search_items' => __( 'Search Item', 'kitgreen' ),\r\n\t\t\t'not_found' => __( 'Not found', 'kitgreen' ),\r\n\t\t\t'not_found_in_trash' => __( 'Not found in Trash', 'kitgreen' ),\r\n\t\t);\r\n\r\n\t\t$args = array(\r\n\t\t\t'label' => __( 'service', 'kitgreen' ),\r\n\t\t 'labels' => $labels,\r\n 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'page-attributes', 'post-formats', ),\r\n 'taxonomies' => array( 'service_cat' ),\r\n 'hierarchical' => true,\r\n 'public' => true,\r\n 'show_ui' => true,\r\n 'show_in_menu' => true,\r\n 'show_in_nav_menus' => true,\r\n 'show_in_admin_bar' => true,\r\n 'menu_position' => 5,\r\n 'menu_icon' => 'dashicons-admin-multisite',\r\n 'can_export' => true,\r\n 'has_archive' => true,\r\n 'exclude_from_search' => false,\r\n 'publicly_queryable' => true,\r\n 'capability_type' => 'page',\r\n\t\t);\r\n\r\n\t\tregister_post_type( 'service', $args );\r\n\r\n\t\t/**\r\n\t\t * Create a taxonomy category for Service\r\n\t\t *\r\n\t\t * @uses Inserts new taxonomy object into the list\r\n\t\t * @uses Adds query vars\r\n\t\t *\r\n\t\t * @param string Name of taxonomy object\r\n\t\t * @param array|string Name of the object type for the taxonomy object.\r\n\t\t * @param array|string Taxonomy arguments\r\n\t\t * @return null|WP_Error WP_Error if errors, otherwise null.\r\n\t\t */\r\n\t\t\r\n\t\t$labels = array(\r\n\t\t\t'name'\t\t\t\t\t=> _x( 'Service Categories', 'Taxonomy plural name', 'kitgreen' ),\r\n\t\t\t'singular_name'\t\t\t=> _x( 'Service Category', 'Taxonomy singular name', 'kitgreen' ),\r\n\t\t\t'search_items'\t\t\t=> __( 'Search Categories', 'kitgreen' ),\r\n\t\t\t'popular_items'\t\t\t=> __( 'Popular Service Categories', 'kitgreen' ),\r\n\t\t\t'all_items'\t\t\t\t=> __( 'All Service Categories', 'kitgreen' ),\r\n\t\t\t'parent_item'\t\t\t=> __( 'Parent Category', 'kitgreen' ),\r\n\t\t\t'parent_item_colon'\t\t=> __( 'Parent Category', 'kitgreen' ),\r\n\t\t\t'edit_item'\t\t\t\t=> __( 'Edit Category', 'kitgreen' ),\r\n\t\t\t'update_item'\t\t\t=> __( 'Update Category', 'kitgreen' ),\r\n\t\t\t'add_new_item'\t\t\t=> __( 'Add New Category', 'kitgreen' ),\r\n\t\t\t'new_item_name'\t\t\t=> __( 'New Category', 'kitgreen' ),\r\n\t\t\t'add_or_remove_items'\t=> __( 'Add or remove Categories', 'kitgreen' ),\r\n\t\t\t'choose_from_most_used'\t=> __( 'Choose from most used text-domain', 'kitgreen' ),\r\n\t\t\t'menu_name'\t\t\t\t=> __( 'Category', 'kitgreen' ),\r\n\t\t);\r\n\t\r\n\t\t$args = array(\r\n\t\t\t'hierarchical' => true,\r\n 'labels' => $labels,\r\n 'show_ui' => true,\r\n 'show_admin_column' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array( 'slug' => 'service_cat' ),\r\n\t\t);\r\n\t\tregister_taxonomy( 'service_cat', array( 'service' ), $args );\r\n\r\n\t}", "protected function addElements(FormInterface $form, Category $category = null)\n {\n $form->add('category', EntityType::class, array(\n 'required' => true,\n 'data' => $category,\n 'placeholder' => 'Select a Category..',\n 'class' => 'App\\Entity\\Category'\n ))\n ->add('Create', SubmitType::class);\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 addAction()\n\t{\n global $langCode;\n\t\t$error \t= array();\n\t\t$success \t= array();\n\t\t$contents \t= '';\n\t\t$formData \t= array();\n\t\t\n\t\t$parentid = (int)($this->registry->router->getArg('parentid'));\n\t\tif($parentid > 0)\n\t\t\t$formData['fparentid'] = $parentid; \n\t\t\n\t\tif(!empty($_POST['fsubmit']))\n\t\t{\n if($_SESSION['productcategoryAddToken']==$_POST['ftoken'])\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->addActionValidator($formData, $error))\n {\n $myProductCat = new Core_ProductCategory();\n //thong tin khong lien quan ngon ngu\n $myProductCat->name = $formData['fname'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n //Neu nguoi dung nhap SeoUrl thi xu li dau cua chuoi nguoi dung nhap \n //Truong hop nguoi dung khong nhap thi chung ta lay idtext de thay the!!!!!\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'][$langCode]), true);\n //cac thong tin lien quan ngong ngu\n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n if($myProductCat->addData())//them vao database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succAdd']);\n $this->registry->me->writelog('ProductCategoryadd', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n $formData = array('fparentid' => $formData['fparentid']); \n }\n else\n {\n $error[] = $this->registry->lang['controller']['errAdd']; \n }\n }\n }\n $_SESSION['productcategoryAddToken']=Helper::getSecurityToken();//Tao token moi\n\t\t}\n\t\t\n\t\t\n\t\t$this->registry->smarty->assign(array(\t'formData' \t\t=> $formData,\n\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'redirectUrl'\t=> $this->getRedirectUrl(),\n\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t'success'\t\t=> $success,\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'add.tpl');\n\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategoryadd',\n\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_add'],\n\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t}", "public function create()\n {\n $categories = Category::all();\n return view('newService', compact('categories'));\n }", "public function create()\n {\n $category_types = CategoryType::get();\n return view('services.create')->with('category_types', $category_types);\n }", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "public function addDietaryCategory(){\n \t$id = $this->formValueForKey(\"dietaryCategorySelection\");\n \t \n \t$foundDietaryCategory = BLGenericRecord::recordMatchingKeyAndValue(\"DietaryCategory\", \"id\", $id);\n \t$this->currentRecipe()->addDietaryCategory($foundDietaryCategory);\n }", "public function add_acct_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\nif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Accounts Category Created Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\ntheme('add_acct_category');\n\t}", "public function createCategory();", "public function add_category() /// get routes of the form add cateogry\n {\n return view('admin.categories.add-category');\n }", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "function action_add($params) {\n $form_error = false;\n if (isset($_POST['form']['action'])) {\n if($category=model_category::add($_POST['form']['name'])) {\n header('Location: ' . APP_URL . 'product/listbycategory/' . $category->id);\n die;\n }\n $form_error = TRUE;\n }\n @include_once APP_PATH . 'view/category_add.tpl.php';\n\n }", "public function add_new_category_post(){\n $data = $this->security->xss_clean($_POST);\n $data = $this->DeviceCategory_model->add_new_category($data);\n if (isset($data['status']) == 'FALSE')\n {\n $this->response($data, REST_Controller::HTTP_SEE_OTHER);\n }\n $this->set_response($data, REST_Controller::HTTP_CREATED);\n }", "public function addAction() {\n $session = new Container('User');\n $form = new CategoryForm('CategoryForm');\n\n $form->get('created_date')->setValue(time());\n $form->get('created_by')->setValue($session->offsetGet('userId'));\n $form->get('updated_date')->setValue(time());\n $form->get('updated_by')->setValue($session->offsetGet('userId'));\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $data = $request->getPost();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($data);\n if ($form->isValid()) {\n $validatorName = new \\Zend\\Validator\\Db\\NoRecordExists(\n array(\n 'table' => 'category',\n 'field' => 'title',\n 'adapter' => $this->getAdapter()\n )\n );\n if ($validatorName->isValid(trim($category->title))) {\n $no_duplicate_data = 1;\n } else {\n $flashMessage = $this->flashMessenger()->getErrorMessages();\n if (empty($flashMessage)) {\n $this->flashMessenger()->setNamespace('error')->addMessage('Category Name already Exists.');\n }\n $no_duplicate_data = 0;\n }\n\n if ($no_duplicate_data == 1) {\n $category->exchangeArray($form->getData());\n $data->created_date = time();\n $data->created_by = $session->offsetGet('userId');\n $data->updated_date = time();\n $data->updated_by = $session->offsetGet('userId');\n\n $questionId = $this->getCategoryTable()->saveCategory($category);\n// $this->getServiceLocator()->get('Zend\\Log')->info('Level created successfully by user ' . $session->offsetGet('userId'));\n $this->flashMessenger()->setNamespace('success')->addMessage('Category created successfully');\n return $this->redirect()->toRoute('category');\n }\n }\n }\n\n return array('form' => $form);\n }", "public function run()\n {\n $servicecategory = [\n [\n 'name' => 'Создание сайтов',\n 'description' => 'Которые продают и радуют глаз',\n 'order' => '6',\n ],\n [\n 'name' => '3D печать и моделирование',\n 'description' => 'Любой сложности',\n 'order' => '5',\n ],\n [\n 'name' => 'Стратегия развития и продвижения бренда',\n 'description' => 'Навстречу потребителю',\n 'order' => '4',\n ],\n [\n 'name' => 'Корпоративный и ритейл-брендинг',\n 'description' => 'Для крупных компаний',\n 'order' => '3',\n ],\n [\n 'name' => 'Бренд-дизайн упаковки',\n 'description' => 'Вдохновляет и привлекает',\n 'order' => '2',\n ],\n [\n 'name' => 'Создание новой ТМ',\n 'description' => 'Фундамент сильного бренда',\n 'order' => '1',\n ],\n ];\n\n foreach ($servicecategory as $key => $value) {\n ServiceCategory::create($value);\n }\n }", "public function addAction(){\n return view('admin::service-group.add', [\n\n 'TITLE' =>'Thêm nhóm dich vụ',\n\n ]);\n }", "public function addPost(){\n\n if ($this->input->post(\"category_create\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n $categoryName = $this->input->post(\"category_name\");\n\n $this->validate->setRule(\"minlength\",$categoryName,3, \"Category name length must be more then 3 symbols!\");\n\n if ($this->validate->validate() === false){\n $error = $this->validate->getErrors();\n $this->view->redirect(\"/categories/manage\",$error);\n }\n\n $categoryModel = new CategoriesModel();\n try{\n if ($categoryModel->hasCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"This categories already exist!\");\n }\n\n if($categoryModel->addNewCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"Category created successfully!\",\"success\");\n }\n }catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception);\n }\n }", "public function create()\n {\n return view('product.add_category');\n }", "function shophead_add()\n {\n $this->layout = 'admin_layout';\n if ($this->request->is('post')) {\n $this->ProductCategory->set($this->request->data);\n\t\t\t $this->request->data = Sanitize::clean($this->request->data, array('encode' => false));\n if ($this->ProductCategory->validates()) {\n if ($this->ProductCategory->save($this->request->data)) {\n $this->Session->write('flash', array(ADD_RECORD, 'success'));\n\n } else {\n $this->Session->write('flash', array(ERROR_MSG, 'failure'));\n }\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }\n }", "public function add() { \n\t\t\n\t\t$data = $this->load_module_info ();\n\t\t\n\t\t/* form submit */\n\t\t\n\n\n\t\tif ($this->input->post ( 'action' ) == \"Add\") {\n\t\t\tcheck_ajax_request (); /* skip direct access */\n\t\t\t$insert_array = array ();\n\t\t\t//print_r($_POST); exit;\t\t\n\t\t\t$this->form_validation->set_rules('category_name', 'lang:cate_name', 'trim|required|callback_cate_exists');\n\t\n\t\n\t\t\tif ($this->form_validation->run () == TRUE) {\n\t\t\t \n\t\t\t\t$insert_array = array(\n\t\t\t\t\t'category_name' \t=> post_value('category_name'), \n\t\t\t\t\t'category_status' \t\t=> ($this->input->post ( 'status' ) == \"A\" ? 'A' : 'I'),\n\t\t\t\t\t'category_created_by' \t=> get_admin_id(),\n\t\t\t\t\t'category_created_ip' \t=> get_ip(),\n\t\t\t\t\t'category_created_on' \t=> current_date()\n\t\t\t\t);\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t$insert_id = $this->Mydb->insert ( $this->table, $insert_array );\n\t\t\t\t\n\t\t\t\t$this->session->set_flashdata ( 'admin_success', sprintf ( $this->lang->line ( 'success_message_add' ), $this->module_label ) );\n\t\t\t\t$result ['status'] = 'success';\n\t\t\t} else {\n\t\t\t\t$result ['status'] = 'error';\n\t\t\t\t$result ['message'] = validation_errors ();\n\t\t\t}\n\t\t\t\n\t\t\techo json_encode ( $result );\n\t\t\texit ();\n\t\t}\n\t\t\n\t\t\n\t\t/* Common labels */\n\t\t$data ['breadcrumb'] = $data ['form_heading'] = get_label ( 'add' ) . ' ' . $this->module_label;\n\t\t$data ['module_action'] = 'add';\n\t\t$this->layout->display_admin ( $this->folder . $this->module . '-add', $data );\n\t\t\n\t}", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "function CategoryForm() {\r\n\r\n\t\t$member = Member::currentUser();\r\n\r\n\t\t// Need to sort out how going to handle multiple instances of category\r\n\t\t// front end grid field : https://github.com/webbuilders-group/silverstripe-frontendgridfield\r\n\t\t// grid field extension : https://github.com/silverstripe-australia/silverstripe-gridfieldextensions\r\n\t\t$category = Category::get()->first();\r\n\t\t$fields = $category->FormFields();\r\n\r\n $actions = FieldList::create(\r\n FormAction::create(\"doCategoryForm\")->setTitle(\"Submit\")->addExtraClass('productive'),\r\n FormAction::create(\"cancel\")->setTitle(\"Cancel\")\r\n );\r\n\r\n $form = Form::create($this, 'CategoryForm', $fields, $actions);\r\n\r\n return $form;\r\n\r\n\t}", "function addcategory(){\n \treturn view('category');\n }", "function add_categories(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function Add($id)\n\t{\n\n\t\t//dd( Categoria::$rules);\n\t\t$form = new GroupForm();\n\n\t\tif ($form->isPosted())\n\t\t{\n\t\t\t$this->beforeFilter('csf', array('on' => 'post'));\n\n\t\t\tif ($form->isValidForAdd(Categoria::$rules))\n\t\t\t{\n\t\t\t\t$entrada = new Categoria();\n\n\t\t\t\t\t$entrada->descricao = Input::get(\"descricao\");\n\t\t\t\t\t$entrada->tipo = Input::get(\"tipo\");\n\t\t\t\t\t$entrada->user_id = isset(Auth::user()->id)? Auth::user()->id : 1;\n\t\t\t\t\t$entrada->save();\n\t\t\t\t\n\n\t\t\t\treturn Redirect::route(\"categ_list\");\n\t\t\t}\n\n\t\t\treturn Redirect::route(\"categ_add\")->withInput([\n\t\t\t\t\"descricao\" => Input::get(\"descricao\"),\n\t\t\t\t\"tipo\" => Input::get(\"tipo\")\n\t\t\t])->withErrors($form->getErrors());\n\t\t}\n\t\t$categorias = Categoria::all();\n\t\t$cat = $categorias;\n\t\t$dadosCat = array();\n\t\tforeach ($categorias as $categoria) {\n\t\t\t\n\t\t\t$dadosCat[$categoria->id] = $categoria->descricao;\n\t\t}\n\n\t\t\n\t\treturn View::make(\"admin.categorias.create\", [\n\t\t\t\"tipo\" => $id,\n\t\t\t\"form\" => $form \n\t\t], compact('cat'))->with(\"categorias\", $dadosCat);\n\t\t\n\t}", "public function create()\n {\n return view('backend.cat_add');\n }", "function ccategories_create()\n\t{\n\t\tlusers_require(\"categories/create\");\n\n\t\t$post_data = linput_post();\n\t\t$post_data = linput_post_checkbox($post_data, \"content\");\n\t\t$content = $post_data[\"content\"];\n\n\t\tif (hform_validate(array(\"name\", \"link\", \"parentid\")))\n\t\t{\n\t\t\t$cat_created = mcategories_create($post_data);\n\t\t\tif ($content) $content_created = mcontent_create($post_data);\n\t\t\telse $content_created = false;\n\n\t\t\tif (($cat_created && !$content) || ($content && $cat_created && $content_created))\n\t\t\t{\n\t\t\t\tlcache_delete_all();\n\t\t\t\thmessage_set(l(\"Category successfully created.\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($cat_created) mcategories_delete($post_data[\"link\"]);\n\t\t\t\tif ($content_created) mcontent_delete($post_data[\"link\"]);\n\t\t\t\thmessage_set(l(\"Category create error.\") . \" \" . l(\"Link already in use.\"));\n\t\t\t}\n\n\t\t\tluri_redirect(\"main/user/admin/categories\");\n\t\t}\n\t\telse luri_redirect(\"main/user/admin/categories_create\", l(\"All fields marked with * are required.\"));\n\t}", "public function add(Category $category);", "function colorpicker_field_add_new_category( $taxonomy ) { ?> \r\n\t<div class=\"form-field term-colorpicker-wrap\"> \r\n\t<label for=\"term-colorpicker\">Category Color</label> \r\n\t<input name=\"_category_color\" value=\"#ffffff\" class=\"colorpicker\" id=\"term-colorpicker\" /> \r\n\t<p>This is the field description where you can tell the user how the color is used in the theme.</p> \r\n\t</div> <?php }", "public function store(CreateServiceCategoryRequest $request)\n {\n $input = $request->all();\n\n $serviceCategory = $this->serviceCategoryRepository->create($input);\n\n Flash::success('Service Category saved successfully.');\n\n return redirect(route('serviceCategories.index'));\n }", "public function newAction()\n {\n\t\tTag::appendTitle('Add New Category');\n }", "public function add_on_services()\n\t{\n\t\t$data['products'] = $this->Product_model->get_all();\n\t\t$data['products_category'] = $this->Product_model->get_all_category();\n\t\t$data['addon'] = $this->db->query(\"SELECT addon_services.*,product_item FROM `addon_services` LEFT JOIN product ON product_id = addon_product_id WHERE addon_branch_id = 0 AND addon_expiry_date = '9999-12-31'\")->result_array();\n\t\t// print_r($data['addon']);die();\n\t\t$data['flash']['active'] = $this->session->flashdata('active');\n $data['flash']['title'] = $this->session->flashdata('title');\n $data['flash']['text'] = $this->session->flashdata('text');\n $data['flash']['type'] = $this->session->flashdata('type');\n\t\t$nav['dash'] = 'add_on_services';\n\n\t\t$this->load->view('su/su_header');\n\t\t$this->load->view('Products/add_services',$data);\n\t\t$this->load->view('Products/product_footer',$nav);\n\t}", "function wp_ajax_press_this_add_category()\n {\n }", "public function create()\n {\n //\n return view('admin.products.add_category');\n }", "public function createAction() {\n $form = $this->view->form = new Whmedia_Form_Circle();\n\n // Check post\n if( $this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost()) )\n {\n // we will add the category\n $values = $form->getValues();\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\n try\n {\n // add category to the database\n // Transaction\n $table = Engine_Api::_()->getDbtable('circles', 'whmedia');\n\n $row = $table->createRow($values);\n $row->user_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n $box_id = $row->save();\n\n $db->commit();\n \n // ** auto add if the box id exist ** \n $addnew = (int) $this->_getParam('addnew' , false);\n $_subject = Engine_Api::_()->user()->getUser($addnew); \n if( $_subject->getIdentity() )\n {\n $viewer = Engine_Api::_()->user()->getViewer();\n $listsTable = Engine_Api::_()->getDbTable('circles', 'whmedia');\n $box = $listsTable->fetchRow(array('user_id = ?' => $viewer->getIdentity(),\n 'circle_id = ?' => $box_id ));\n\n $box->add($_subject);\n }\n // ** auto add if the box id exist ** \n }\n\n catch( Exception $e )\n {\n $db->rollBack(); \n throw $e;\n }\n\n return $this->_helper->Message(\"Box added.\");\n }\n\n // Output\n $this->renderScript('admin-settings/form.tpl');\n }", "public function getName()\n {\n return 'category_form';\n }", "public function create()\n {\n $category = Categories::all();\n return view('panel.product-management.categories.form-create')->with(['category' => $category]);\n }", "public function add()\n\t{\n\t\t$master['status'] = True;\n $data = array();\n $master = array();\n $this->form_validation->set_rules('category', 'Category', 'trim|required|max_length[64]|is_unique[tbl_product_category.category]');\n $this->form_validation->set_rules('remarks', 'Remarks', 'trim|max_length[254]');\n $this->form_validation->set_error_delimiters('<p class=\"text-danger\">', '</p>');\n\t\tif ($this->form_validation->run() == True) \n\t\t{\n\t\t\t$this->product_category->insert();\n\t\t\t$master['status'] = True;\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$master['status'] = false;\n foreach ($_POST as $key => $value) \n {\n if (form_error($key) != '') \n {\n $data['error_string'] = $key;\n $data['input_error'] = form_error($key);\n array_push($master, $data);\n }\n }\n\t\t}\n\t\techo(json_encode($master));\n\t}", "protected function getVictoireBlog_CategoryFilters_Form_TypeService()\n {\n return $this->services['victoire_blog.category_filters.form.type'] = new \\Victoire\\Bundle\\BlogBundle\\Filter\\CategoryFilter($this->get('doctrine.orm.default_entity_manager'), $this->get('request_stack'), $this->get('translator.default'));\n }", "function add()\n { \n $this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('CatName','CatName','required');\n\t\t\n\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t'CatName' => $this->input->post('CatName'),\n );\n \n $productcat_id = $this->Productcat_model->add_productcat($params);\n redirect('admin/productcat/index');\n }\n else\n { \n $data['_view'] = 'admin/productcat/add';\n $this->load->view('admin/layouts/main',$data);\n }\n }", "public function get_add_form($cat_id) {\n\n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\tdie();\n\t\t}\n\n\t\t$category_detailes = $this->cat_model->GetWhere(\"categories\", \"title\", \"ASC\", array('id'=>$cat_id)); \n\t\t\tif (isset($category_detailes) && count($category_detailes) != 0) { \n\t\t\t\tforeach ($category_detailes as $cat) { \n\t\t\t\t\t$title= $cat->title ;\n\t\t\t\t} \n\t\t\t}\n\n\t\t$content = \"<div style='background-color:#ddd' clas='table-responsive ls-table'><table class='table table-responsive table-bordered table-hover' ><tr>\";\n\n\n\t\t$content .= \" <td><input type='hidden' id='main_cat_id' value='$cat_id'> \n\t\t<input type='text' style='width: 98%;' id='title' placeholder='title' ><br><br>\";\n\n\n\t\t$content .= \"</tr></table> \n\t\t</div>\";\n\t\tif($cat_id==0){\n\n\t\t$result = array('title' => \"<b>Add main category </b>\", \"content\" => $content); \n\t\t}else{\n\n\t\t$result = array('title' => \"<b>Add sub category to \".$title.\"</b>\", \"content\" => $content); \n\t\t}\n\n\t\techo json_encode($result);\n\t}", "public static function func_ajax_add_category() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n $self = self::sanitize($_POST['name']);\n $day = self::sanitize($_POST['day']);\n $desc = self::sanitize($_POST['description']);\n $wpdb->query($wpdb->prepare( \"INSERT INTO \".$wpdb->prefix.self::$table_name .\" VALUES (%d, %s, %s, %s)\", null, $self,$day,$desc ));\n die();\n\t\t\t\t}\n\t\t\n\t\t}", "public function actionCreate()\n {\n $model = new Service();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $cities = Yii::$app->getRequest()->post('cities');\n\n $model->attachCities($cities);\n\n $requestTypes = Yii::$app->getRequest()->post('request_types');\n\n $model->attachRequestTypes($requestTypes);\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function add()\n\t{\t\n\t\t//Carrega o Model Categorias\t\t\t\n\t\t$this->load->model('CategoriasModel', 'Categorias');\n\t\n\t\t$data['categorias'] = $this->Categorias->getCategorias();\t\n\n\t\t// Editando texto do titulo do header\n\t\t$data['pagecfg']['Title'] = \"Adicionar Pessoa\";\t\t\n\n\t\t// Alterando o Estado da View Para Adicionar Pessoa\n\t\t$data['pagecfg']['viewState'] = \"Adicionar Pessoa\";\n\t\t$data['pagecfg']['btnState'] = \"Adicionar\";\n\t\t$data['pagecfg']['inputState'] = \"enable\";\n\t\t$data['pagecfg']['actionState'] = \"/ListarPessoas/salvar\";\n\t\t\n\t\t//Carrega a View\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->load->view('PessoaView', $data);\n\t\t$this->load->view('templates/footer', $data);\n\t}", "public function addCategory(Request $request){\n \t$this->validate($request, [\n \t\t'category' => 'required'\n \t]);\n\n \t$category = new Category;\n \t$category->category = $request->input('category');// this 'category' inside input is same as name='category' in form\n \t$category->save(); //save this category in database\n \treturn redirect('/category')->with('response','Category added successfully');\n }", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function add()\n\t{\n\t\t$data[\"icons\"] = $this->M_Icon->getAll();\n\t\t$data[\"title\"] = 'Tambah Kategori';\n\n\t\t$validation = $this->form_validation;\n\n\t\t$rules = [\n\t\t\t[\n\t\t\t\t'field' => 'kategori',\n\t\t\t\t'rules' => 'required'\n\t\t\t],\n\t\t\t[\n\t\t\t\t'field' => 'deskripsi',\n\t\t\t\t'rules' => 'required'\n\t\t\t]\n\t\t];\n\n\t\t$validation->set_rules($rules);\n\n\t\tif ($validation->run()) {\n\t\t\t$this->kategori_model->save();\n\t\t\t$this->session->set_flashdata('stsMessage', 'Data Berhasil disimpan');\n\t\t\tredirect('Kategori');\n\t\t}\n\n\t\t$this->load->view(\"admin/kategori/new_form\", $data);\n\t}", "function getCategoryFields() {\n\t\t\n\t\t$model = $this->getModel();\n\t\t$category_id = JRequest::getVar('id');\n\t\t$form = $model->getFieldForm($category_id, 'category');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\" >';\n\t\techo '<legend>New Category</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "public function action_addBook() {\r\n $fieldset = Fieldset::forge('book')->add_model('Model_Book');\r\n $fieldset->delete('category_id');\r\n // get form from fieldset\r\n $form = $fieldset->form();\r\n\r\n // add category to the form\r\n $categories = Model_Category::find('all');\r\n $op = array();\r\n foreach ($categories as $category) {\r\n $op[$category['id']] = $category['name'];\r\n }\r\n\r\n $form->add(\r\n 'category', 'Book category',\r\n array('options' => $op, 'type' => 'radio', 'value' => 'true')\r\n );\r\n // add submit button to the form\r\n $form->add('Submit', '', array('type' => 'submit', 'value' => 'Submit'));\r\n\r\n\r\n // build the form and set the current page as action\r\n $formHtml = $fieldset->build(Uri::create('book/addBook'));\r\n $view = View::forge('book/addBook');\r\n $view->set('form', $formHtml, false);\r\n\r\n if (Input::param() != array()) {\r\n try {\r\n $book = Model_Book::forge();\r\n $book->title = Input::param('title');\r\n $book->author = Input::param('author');\r\n $book->price = Input::param('price');\r\n $book->url = Input::param('url');\r\n $book->category_id= Input::param('category');\r\n\r\n Log::debug('selected category '.$book->category_id);\r\n Log::debug('selected category '.Input::param('category'));\r\n $book->save();\r\n Response::redirect('book');\r\n } catch (Orm\\ValidationFailed $e) {\r\n $view->set('errors', $e->getMessage(), false);\r\n }\r\n }\r\n $this->template->title = \"Book add page\";\r\n $this->template->content = $view; \r\n }", "public function create() \n\t{\n\t\n\t\t$this->data = (object) array();\n\t\t// Check for post data\n\t\t$this->form_validation->set_rules($this->_validation_rules);\n\t\t\n\t\t\n\t\t// if postback-validate\n\t\tif ($this->form_validation->run()) \n\t\t{\n\t\t\t$input = $this->input->post();\n\t\t\t$id = $this->categories_m->create($input);\n\t\t\t\n\t\t\tEvents::trigger('evt_category_created', $id );\n\t\t\t\n\t\t\t$this->session->set_flashdata('success', lang('success'));\n\t\t\tredirect('admin/shop/categories');\n\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tforeach ($this->_validation_rules as $key => $value) \n\t\t\t{\n\t\t\t\t$this->data->{$value['field']} = '';\n\t\t\t}\n\t\t}\n\n\t\t$this->data->parent_category_select \t= $this->categories_m->build_dropdown(array(\n\t\t\t'type'\t=> 'all'\n\t\t)); \n\n\n\t\t// prepare dropdown image folders\n\t\t$folders = $this->_prep_folders();\n\n\n\t\t// Build page\n\t\t$this->template\n\t\t\t->title($this->module_details['name'])\n\t\t\t->set('folders',$folders)\n\t\t\t->append_js('module::admin/categories.js')\t\n\t\t\t->append_js('module::admin/admin.js')\t\t\n\t\t\t->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))\n\t\t\t->build('admin/categories/form', $this->data);\n\t}", "function getSetupForm($options = array()){\n $form = parent::getSetupForm($options);\n $form->setLegend('Category Options');\n \n $set = $form->createElement('select', 'set');\n $set->setLabel('Set: ');\n $set->setRequired('true');\n \n $service = new Content_Model_CategorySet_Service();\n $results = $service->getObjects();\n\n $options = array();\n foreach($results as $value){\n $options[$value->id] = $value->title;\n }\n\n //$template->addMultiOption('None','');\n $set->setMultiOptions($options);\n $form->addElement($set);\n \n return $form;\n }", "public function addCategory()\n {\n $this->validate($this->request, [\n 'name' => 'required|max:191',\n 'file' => ['required', 'mimes:jpeg,jpg,bmp,png']\n ]);\n\n $slide = Category::create(['name' => $this->request->name]);\n if ($this->request->hasFile('file')) {\n $file = $this->request->file('file');\n $fileStored = $file->store(\"categories\", 'uploads');\n $slide->update(['file_url' => $fileStored]);\n }\n return $slide;\n }", "public function show(CategoriesService $category)\n {\n //\n }", "public function __construct(CategoryService $categoryService)\n {\n parent::__construct();\n $this->categoryService = $categoryService;\n }", "public function __construct(CategoryService $categoryService)\n {\n parent::__construct();\n $this->categoryService = $categoryService;\n }", "public function buildForm(FormBuilderInterface $builder, array $options)\n {\n// dd($category->findAll());\n $builder\n ->add('price')\n ->add('name')\n ->add('description')\n /*->add('category', CollectionType::class, array(\n 'entry_type' => CategoryType::class,\n 'allow_add' => true,\n ))*/\n ->add('category', EntityType::class, array(\n 'class' => Category::class,\n 'query_builder' => function (EntityRepository $repository) {\n return $repository -> createQueryBuilder('c')\n ->orderBy('c.name', 'ASC');\n },\n 'choice_label' => 'name',\n ))\n// ->add('images', CollectionType::class, array(\n// 'entry_type' => ImageType::class\n// ))\n ->add('images', FileType::class, [\n 'mapped' => false,\n 'label' => 'Upload images'\n ]);\n }", "public function add()\n\t{\t\n\t\t$data = array(); \n\n \t \treturn view('add-category')->with($data);\n\t}", "public function add()\r\n\r\n {\r\n\r\n $this->page_title->push(lang('menu_products_add'));\r\n\r\n $this->data['pagetitle'] = $this->page_title->show();\r\n\r\n\r\n\r\n /* Breadcrumbs :: Common */\r\n\r\n $this->breadcrumbs->unshift(1, lang('menu_products_add'), 'admin/setup/products/add');\r\n\r\n\r\n\r\n /* Breadcrumbs */\r\n\r\n $this->data['breadcrumb'] = $this->breadcrumbs->show();\r\n\r\n\r\n\r\n /* Data */\r\n\r\n $this->data['error'] = $this->session->flashdata('errors');\r\n\r\n $this->data['message'] = isset($_GET['uploaded']) ? $this->session->flashdata('message') : NULL;\r\n\r\n $this->data['charset'] = 'utf-8';\r\n\r\n $this->data['form_url'] = 'admin/setup/product/store';\r\n\r\n $this->data['form_products_upload_url'] = 'admin/setup/product/store/bulk';\r\n\r\n\r\n\r\n $categories = $this->categories->getData();\r\n\r\n $this->data['categories_option'] = '';\r\n\r\n\r\n foreach ($categories[0]->data as $category) {\r\n\r\n if ($category->parent == 0) $this->data['categories_option'] .= '<optgroup label=\"' . $category->title . '\"></optgroup>';\r\n\r\n else $this->data['categories_option'] .= '<option value=\"' . $category->bar_code . '\">' . $category->bar_code . ' -- ' . $category->title . '</option>';\r\n\r\n }\r\n\r\n\r\n /* Load Template */\r\n\r\n $this->template->admin_render('admin/products/add', $this->data);\r\n\r\n\r\n\r\n }", "public function category()\n { \n if($this->access_role->is_Admin() == false) show_404();\n $this->load->model('Category_Model');\n \n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n if($this->form_validation->run('category_insert') ){\n $this->Category_Model->add_category(); \n } else {\n $error = ['class'=>'warning','text'=> validation_errors()];\n $this->session->set_flashdata('sms_flash', $error); \n redirect('Dashboard/category');\n }\n } \n else{\n $data = $this->Category_Model->view_category();\n }\n \n $this->load->view('admin/category_content',$data);\n }", "public function addCategoriesField(FormBuilderInterface $builder, array $options = [])\n {\n $builder->add('categories', CategoriesType::class, [\n 'label' => $this->__('Category') . ':',\n 'empty_data' => null,\n 'attr' => [\n 'class' => 'category-selector'\n ],\n 'required' => false,\n 'multiple' => false,\n 'module' => 'RKDownLoadModule',\n 'entity' => 'FileEntity',\n 'entityCategoryClass' => 'RK\\DownLoadModule\\Entity\\FileCategoryEntity',\n 'showRegistryLabels' => true\n ]);\n }", "public function createAction()\n {\n if (!$this->request->isPost()) {\n return $this->response->redirect('category/list');\n }\n\n $manager = $this->getDI()->get('core_category_manager');\n $form = $manager->getForm();\n\n if ($form->isValid($this->request->getPost())) {\n try {\n $manager = $this->getDI()->get('core_category_manager');\n\n //$post_data contains an array with locales as indices.\n //Ex: $post_data['translation']['en'], $post_data['translation']['gr'] etc...\n $post_data = $this->request->getPost();\n \n\n //Add category_is_active flag to the post data. \n //Along with the translations we have all the data we need to create a category\n $data = array_merge($post_data, ['category_is_active' => 1]);\n\n /*\n Example final $data array:\n $data = array(3) {\n [\"translations\"]=>\n array(2) {\n [\"en\"]=>\n array(3) {\n [\"category_translation_name\"]=>\n string(15) \"Category name 3\"\n [\"category_translation_slug\"]=>\n string(0) \"\"\n [\"category_translation_lang\"]=>\n string(2) \"en\"\n }\n [\"gr\"]=>\n array(3) {\n [\"category_translation_name\"]=>\n string(18) \"Onoma Kathgorias 3\"\n [\"category_translation_slug\"]=>\n string(0) \"\"\n [\"category_translation_lang\"]=>\n string(2) \"gr\"\n }\n }\n [\"csrf\"]=>\n string(15) \"W0jJtkHlOEwqnDm\"\n [\"category_is_active\"]=>\n int(1)\n }\n */\n $manager->create($data);\n $this->flashSession->success('Object was created successfully');\n\n return $this->response->redirect('category/list');\n } catch (\\Exception $e) {\n $this->flash->error($e->getMessage());\n\n return $this->dispatcher->forward(['action' => 'add']);\n }\n } else {\n foreach ($form->getMessages() as $message) {\n $this->flash->error($message->getMessage());\n }\n\n return $this->dispatcher->forward(['action' => 'add', 'controller' => 'category']);\n }\n }" ]
[ "0.7063193", "0.6993759", "0.6818711", "0.67902887", "0.6784535", "0.66870534", "0.6632568", "0.66116166", "0.65957975", "0.65793395", "0.6505954", "0.6483027", "0.64724094", "0.6423389", "0.6397256", "0.637253", "0.6366223", "0.6361002", "0.6349619", "0.6348972", "0.63203317", "0.6318294", "0.63103557", "0.62919456", "0.6261332", "0.6237668", "0.6237366", "0.61985654", "0.618955", "0.617698", "0.61688286", "0.6154583", "0.6143482", "0.61352754", "0.6127698", "0.61254305", "0.611052", "0.61066175", "0.6104753", "0.6101615", "0.61001337", "0.6092087", "0.60883814", "0.6086983", "0.6078745", "0.6077546", "0.60441643", "0.60428816", "0.6041842", "0.60397536", "0.6032361", "0.60131454", "0.6003588", "0.599702", "0.59965914", "0.5994888", "0.59884506", "0.59813243", "0.59801424", "0.59445274", "0.5940307", "0.5937682", "0.5928742", "0.5920997", "0.59003264", "0.58905774", "0.58894354", "0.58857507", "0.58804685", "0.5878808", "0.58754116", "0.58677423", "0.58442324", "0.58425605", "0.5840979", "0.58334917", "0.58325875", "0.5830823", "0.58196557", "0.5816594", "0.580695", "0.5806516", "0.5805528", "0.5802862", "0.57997626", "0.57935196", "0.57923955", "0.5790184", "0.5786032", "0.5783926", "0.5772793", "0.5768905", "0.5766387", "0.5766387", "0.5765821", "0.57620573", "0.57616997", "0.5761363", "0.5761322", "0.576075" ]
0.8375481
0
end add service category form................................................................. add sub category form
public function subcategory(){ $modelservices = new Application_Model_Services(); $servicelist = $modelservices->servicesdata(); $caterories = $modelservices->categorydata(); //prd($caterories); $this->addElement('text', 'service_name', array ( "required" => TRUE, 'class' => 'form-control required', "label" => "Service Sub Category Title " , "filters" => array("StringTrim","StripTags"), "validators" => array( array("NotEmpty",true,array("messages"=>" Expertise Title is required ")), ), )); $this->addElement('text', 'service_price', array ( "required" => TRUE, 'class' => 'form-control required digits', "label" => "Service Credit " , "filters" => array("StringTrim","StripTags"), "validators" => array( array("NotEmpty",true,array("messages"=>"Price is required ")), ), )); $this->addElement('select', 'service_parent_id', array ( 'class' => 'form-control required' , "required"=>true, "multioptions"=>$servicelist, "onchange"=>"getcategorylist(this.value)", "filters" => array("StringTrim","StripTags","HtmlEntities"), )); $this->addElement('select', 'service_sub_parent_id', array ( 'class' => 'form-control required' , "required"=>true, "multioptions"=>$caterories, "filters" => array("StringTrim","StripTags","HtmlEntities"), )); $this->submitButton(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function servicecat(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t//prd($servicelist);\n\t\t\t\t\t\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}", "function addAction()\n\t{\n global $langCode;\n\t\t$error \t= array();\n\t\t$success \t= array();\n\t\t$contents \t= '';\n\t\t$formData \t= array();\n\t\t\n\t\t$parentid = (int)($this->registry->router->getArg('parentid'));\n\t\tif($parentid > 0)\n\t\t\t$formData['fparentid'] = $parentid; \n\t\t\n\t\tif(!empty($_POST['fsubmit']))\n\t\t{\n if($_SESSION['productcategoryAddToken']==$_POST['ftoken'])\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->addActionValidator($formData, $error))\n {\n $myProductCat = new Core_ProductCategory();\n //thong tin khong lien quan ngon ngu\n $myProductCat->name = $formData['fname'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n //Neu nguoi dung nhap SeoUrl thi xu li dau cua chuoi nguoi dung nhap \n //Truong hop nguoi dung khong nhap thi chung ta lay idtext de thay the!!!!!\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'][$langCode]), true);\n //cac thong tin lien quan ngong ngu\n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n if($myProductCat->addData())//them vao database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succAdd']);\n $this->registry->me->writelog('ProductCategoryadd', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n $formData = array('fparentid' => $formData['fparentid']); \n }\n else\n {\n $error[] = $this->registry->lang['controller']['errAdd']; \n }\n }\n }\n $_SESSION['productcategoryAddToken']=Helper::getSecurityToken();//Tao token moi\n\t\t}\n\t\t\n\t\t\n\t\t$this->registry->smarty->assign(array(\t'formData' \t\t=> $formData,\n\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'redirectUrl'\t=> $this->getRedirectUrl(),\n\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t'success'\t\t=> $success,\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'add.tpl');\n\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategoryadd',\n\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_add'],\n\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function get_add_form($cat_id) {\n\n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\tdie();\n\t\t}\n\n\t\t$category_detailes = $this->cat_model->GetWhere(\"categories\", \"title\", \"ASC\", array('id'=>$cat_id)); \n\t\t\tif (isset($category_detailes) && count($category_detailes) != 0) { \n\t\t\t\tforeach ($category_detailes as $cat) { \n\t\t\t\t\t$title= $cat->title ;\n\t\t\t\t} \n\t\t\t}\n\n\t\t$content = \"<div style='background-color:#ddd' clas='table-responsive ls-table'><table class='table table-responsive table-bordered table-hover' ><tr>\";\n\n\n\t\t$content .= \" <td><input type='hidden' id='main_cat_id' value='$cat_id'> \n\t\t<input type='text' style='width: 98%;' id='title' placeholder='title' ><br><br>\";\n\n\n\t\t$content .= \"</tr></table> \n\t\t</div>\";\n\t\tif($cat_id==0){\n\n\t\t$result = array('title' => \"<b>Add main category </b>\", \"content\" => $content); \n\t\t}else{\n\n\t\t$result = array('title' => \"<b>Add sub category to \".$title.\"</b>\", \"content\" => $content); \n\t\t}\n\n\t\techo json_encode($result);\n\t}", "protected function _prepareForm()\r\n {\r\n \t/* @var $model Lanot_EasyBanner_Model_Category */\r\n $model = $this->_getHelper()->getCategoryItemInstance();\r\n\r\n /**\r\n * Checking if user have permissions to save information\r\n */\r\n if (Mage::helper('lanot_easybanner/admin')->isActionAllowed('manage_category/save')) {\r\n $isElementDisabled = false;\r\n } else {\r\n $isElementDisabled = true;\r\n }\r\n\r\n $form = new Varien_Data_Form();\r\n\r\n $form->setHtmlIdPrefix('category_main_');\r\n\r\n $fieldset = $form->addFieldset('base_fieldset', array(\r\n 'legend' => $this->_getHelper()->__('Category Item Info')\r\n ));\r\n\r\n if ($model->getId()) {\r\n $fieldset->addField('category_id', 'hidden', array(\r\n 'name' => 'id',\r\n ));\r\n }\r\n\r\n //Add main elements to the category\r\n $fieldset->addField('title', 'text', array(\r\n 'name' => 'title',\r\n 'label' => $this->_getHelper()->__('Title'),\r\n 'title' => $this->_getHelper()->__('Title'),\r\n 'required' => true,\r\n 'disabled' => $isElementDisabled\r\n ));\r\n\r\n $fieldset->addField('description', 'textarea', array(\r\n \t'name' => 'description',\r\n \t'label' => $this->_getHelper()->__('Description'),\r\n \t'title' => $this->_getHelper()->__('Description'),\r\n \t'required' => false,\r\n \t'disabled' => $isElementDisabled,\r\n \t'style' => 'height: 100px',\t\r\n ));\r\n \r\n $fieldset->addField('is_active', 'select', array(\r\n \t'name' => 'is_active',\r\n \t'label' => $this->_getHelper()->__('Is Active'),\r\n \t'title' => $this->_getHelper()->__('Is Active'),\r\n \t'required' => true,\r\n \t'disabled' => $isElementDisabled,\r\n \t'options' => $model->getAvailableStatuses(),\r\n ));\r\n\r\n /*\r\n //Add layout updates elements to the category\r\n $lBlock = $this->getLayout()->createBlock('lanot_easybanner/adminhtml_widget_instance_edit_tab_main_layout');\r\n $fieldset = $form->addFieldset('layout_updates_fieldset', array(\r\n 'legend' => $this->_getHelper()->__('Layout Updates')\r\n ));\r\n\r\n $fieldset->addField('layout_updates', 'note', array());\r\n $form->getElement('layout_updates_fieldset')->setRenderer($lBlock);\r\n */\r\n\r\n $form->setValues($model->getData());\r\n \r\n Mage::dispatchEvent('adminhtml_easybanner_category_edit_tab_main_prepare_form', array('form' => $form));\r\n\r\n $this->setForm($form);\r\n\r\n return parent::_prepareForm();\r\n }", "public function admin_add() \r\n {\r\n\r\n \t// setting the layout for admin\r\n \t$this->layout = 'admin';\r\n \t\r\n \tif (!empty($this->data)) \r\n \t{\r\n \t\t$this->Product->create();\r\n \t\t\r\n \t\tif ($this->Product->save($this->data)) \r\n \t\t{\r\n \t\t\t$this->Session->setFlash(__('The product has been saved', true));\r\n \t\t\t$this->redirect(array('action' => 'index'));\r\n \t\t} \r\n \t\telse \r\n \t\t{\r\n \t\t\t$this->Session->setFlash(__('The product could not be saved. Please, try again.', true));\r\n \t\t}\r\n \t}\r\n \t\r\n\t\t$categories = $this->Product->Category->find('list');\r\n\t\r\n\t\t$firstCategories = $this->Product->Category->find('first');\r\n\t\r\n\t\t// getting the subcategories for first category which is displaying by default\r\n\t\t$subCategoriesArray = $this->Product->SubCategory->find('list',array('conditions'=>array('SubCategory.category_id'=>$firstCategories['Category']['id'])));\r\n\t\r\n\t\t$subCategories[] = 'Please select';\r\n\t\tforeach ($subCategoriesArray as $key => $subCat) \r\n\t\t{\r\n\t\t\t$subCategories[$key] = $subCat;\r\n\t\t}\r\n\r\n\t\t$this->set(compact('categories', 'subCategories'));\r\n\r\n }", "public function add_acct_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\nif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Accounts Category Created Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\ntheme('add_acct_category');\n\t}", "public function add_acct_sub_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\t\t\t//Get Decision who in online?\n\t\t$user = loggedInUserData();\n\t\t$userID = $user['user_id'];\n\t\tif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\t\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_sub_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_type', 'Accounts Type', 'required|trim');\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\t\t\t\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_sub_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Sub-Accounts Created under Category Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n//$mydata = $this->category_model->getmainCat();\n//echo \"<pre>\";\n//print_r($mydata);\n//echo \"</pre>\";\n//$data['row'] = $mydata;\n\t//$this->load->view('add_acct_sub_category',$data);\n\t//---$this->load->view('add_acct_sub_category');\n\t\ttheme('add_acct_sub_category', $data);\n\t}", "public function formModify() {\n $categories=$this->model->listCategories();\n $this->view->display(\"view/form/ProductFormModify.php\", NULL, $categories); \n }", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "public function add() { \n\t\t\n\t\t$data = $this->load_module_info ();\n\t\t\n\t\t/* form submit */\n\t\t\n\n\n\t\tif ($this->input->post ( 'action' ) == \"Add\") {\n\t\t\tcheck_ajax_request (); /* skip direct access */\n\t\t\t$insert_array = array ();\n\t\t\t//print_r($_POST); exit;\t\t\n\t\t\t$this->form_validation->set_rules('category_name', 'lang:cate_name', 'trim|required|callback_cate_exists');\n\t\n\t\n\t\t\tif ($this->form_validation->run () == TRUE) {\n\t\t\t \n\t\t\t\t$insert_array = array(\n\t\t\t\t\t'category_name' \t=> post_value('category_name'), \n\t\t\t\t\t'category_status' \t\t=> ($this->input->post ( 'status' ) == \"A\" ? 'A' : 'I'),\n\t\t\t\t\t'category_created_by' \t=> get_admin_id(),\n\t\t\t\t\t'category_created_ip' \t=> get_ip(),\n\t\t\t\t\t'category_created_on' \t=> current_date()\n\t\t\t\t);\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t$insert_id = $this->Mydb->insert ( $this->table, $insert_array );\n\t\t\t\t\n\t\t\t\t$this->session->set_flashdata ( 'admin_success', sprintf ( $this->lang->line ( 'success_message_add' ), $this->module_label ) );\n\t\t\t\t$result ['status'] = 'success';\n\t\t\t} else {\n\t\t\t\t$result ['status'] = 'error';\n\t\t\t\t$result ['message'] = validation_errors ();\n\t\t\t}\n\t\t\t\n\t\t\techo json_encode ( $result );\n\t\t\texit ();\n\t\t}\n\t\t\n\t\t\n\t\t/* Common labels */\n\t\t$data ['breadcrumb'] = $data ['form_heading'] = get_label ( 'add' ) . ' ' . $this->module_label;\n\t\t$data ['module_action'] = 'add';\n\t\t$this->layout->display_admin ( $this->folder . $this->module . '-add', $data );\n\t\t\n\t}", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "function categoryAdd($str=''){\n\n\t#Get referring page to send users back to\n\t$previous = $_SERVER['HTTP_REFERER'];\n\n\t$str .= '<!-- start general content -->\n\t\t<script type=\"text/javascript\" src=\"' . VIRTUAL_PATH . '_js/util.js\"></script>\n\n\t\t<script type=\"text/javascript\">\n\n\t\t\tfunction checkForm(thisForm)\n\n\t\t\t{//check form data for valid info\n\t\t\t\tif(empty(thisForm.FirstName,\"Please Enter Customer\\'s First Name\")){return false;}\n\t\t\t\tif(empty(thisForm.LastName,\"Please Enter Customer\\'s Last Name\")){return false;}\n\t\t\t\tif(!isEmail(thisForm.Email,\"Please Enter a Valid Email\")){return false;}\n\t\t\t\treturn true;//if all is passed, submit!\n\t\t\t}\n\n\t\t</script>\n\n\n\t\t<div class=\"row\" style=\"\"><!-- begin content -->\n\t\t\t<form action=\"' . THIS_PAGE . '\" method=\"post\" onsubmit=\"return checkForm(this);\" >\n\n\n\t\t\t\t<input type=\"hidden\" name=\"CatID\" />\n\n\t\t\t\t<!-- inner container -->\n\t\t\t\t<div class=\"class=\"col-sm-9 pull-right\" style=\"\">\n\n\t\t\t\t\t<!-- left container -->\n\t\t\t\t\t<div class=\"col-sm-8 pull-left\" style=\"\">\n\t\t\t\t\t\t<h4 class=\"text-center\">Add New Catagory</b></h4>';\n\n\n\n\n\t\t\t\t\t\t\t$str .= '<div class=\"row \">\n\t\t\t\t\t\t\t\t<div class=\"pull-middle\">\n\n\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t<option value=\"person\" select=\"select\">Group By: Indivual</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"team\">Group By: Group/Team</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"organization\">Group By: Organization</option>\n\t\t\t\t\t\t\t\t\t</select>\n\n\n\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t<option value=\"individual\" select=\"select\">Catagory Type: IC</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"team\">Catagory Type: OOC</option>\n\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\tclass=\"col-sm-12\"\n\t\t\t\t\t\t\t\t\ttype=\"text\"\n\n\t\t\t\t\t\t\t\t\tname=\"CatTitle\"\n\t\t\t\t\t\t\t\t\tplaceholder=\"Team/Group/Character Name here\"/>\n\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\tname=\"CatDescription\"\n\n\t\t\t\t\t\t\t\t\tclass=\"autoExpand col-sm-12\"\n\t\t\t\t\t\t\t\t\trows=\"3\"\n\t\t\t\t\t\t\t\t\tdata-min-rows=\"3\"\n\n\t\t\t\t\t\t\t\t\tplaceholder=\"Catagory Description\"\n\t\t\t\t\t\t\t\t\t></textarea>\n\t\t\t\t\t\t\t</div><!-- end container-->\n\n\n\t\t\t\t\t</div><!-- end inner container -->\n\n\t\t\t\t<div class=\"clearfix\">\n\t\t\t\t\t<br /><br />\n\t\t\t\t</div>\n\n\t\t\t\t<div\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tstyle=\"\">\n\n\t\t\t\t\t<input type=\"hidden\" name=\"act\" value=\"categoryInsert\" />\n\t\t\t\t\t<input class=\"btn btn-primary btn-xs \" type=\"submit\" value=\"Add Catagory\">\n\n\t\t\t\t\t&nbsp; &nbsp;\n\n\t\t\t\t\t<a class=\"btn btn-primary btn-xs outline\" href=\"' . $previous . '\">Exit Post</a>\n\t\t\t\t</div>\n\n\t\t\t</form>\n\t\t</div>\n\n\t<!-- END content -->';\n\n\treturn $str;\n}", "public function create() \n\t{\n\t\n\t\t$this->data = (object) array();\n\t\t// Check for post data\n\t\t$this->form_validation->set_rules($this->_validation_rules);\n\t\t\n\t\t\n\t\t// if postback-validate\n\t\tif ($this->form_validation->run()) \n\t\t{\n\t\t\t$input = $this->input->post();\n\t\t\t$id = $this->categories_m->create($input);\n\t\t\t\n\t\t\tEvents::trigger('evt_category_created', $id );\n\t\t\t\n\t\t\t$this->session->set_flashdata('success', lang('success'));\n\t\t\tredirect('admin/shop/categories');\n\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tforeach ($this->_validation_rules as $key => $value) \n\t\t\t{\n\t\t\t\t$this->data->{$value['field']} = '';\n\t\t\t}\n\t\t}\n\n\t\t$this->data->parent_category_select \t= $this->categories_m->build_dropdown(array(\n\t\t\t'type'\t=> 'all'\n\t\t)); \n\n\n\t\t// prepare dropdown image folders\n\t\t$folders = $this->_prep_folders();\n\n\n\t\t// Build page\n\t\t$this->template\n\t\t\t->title($this->module_details['name'])\n\t\t\t->set('folders',$folders)\n\t\t\t->append_js('module::admin/categories.js')\t\n\t\t\t->append_js('module::admin/admin.js')\t\t\n\t\t\t->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))\n\t\t\t->build('admin/categories/form', $this->data);\n\t}", "function shophead_add()\n {\n $this->layout = 'admin_layout';\n if ($this->request->is('post')) {\n $this->ProductCategory->set($this->request->data);\n\t\t\t $this->request->data = Sanitize::clean($this->request->data, array('encode' => false));\n if ($this->ProductCategory->validates()) {\n if ($this->ProductCategory->save($this->request->data)) {\n $this->Session->write('flash', array(ADD_RECORD, 'success'));\n\n } else {\n $this->Session->write('flash', array(ERROR_MSG, 'failure'));\n }\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }\n }", "public function add_category() {\n\t\n\t\tif($this->input->post('add_type')=='add_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name'),\n\t\t'created_at' => date('d-m-Y h:i:s')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->add_assets_category($data);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_added');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function new_form(){\n $this->vars['page_header'] = __('Create New Service', 'latepoint');\n $this->vars['breadcrumbs'][] = array('label' => __('Create New Service', 'latepoint'), 'link' => false );\n\n $this->vars['category'] = new OsServiceCategoryModel();\n\n if($this->get_return_format() == 'json'){\n $response_html = $this->render($this->views_folder.'new_form', 'none');\n echo wp_send_json(array('status' => 'success', 'message' => $response_html));\n exit();\n }else{\n echo $this->render($this->views_folder . 'new_form', $this->get_layout());\n }\n }", "function add(){\n\t\tif(!$this->checkLogin()){\n\t\t\tredirect(base_url());\n\t\t}\n\n\t\t$pageData['header_title'] = APP_NAME.' | Add Document Category';\n\t\t$pageData['page_title'] = 'Document Category Management';\n\t\t$pageData['parent_menu'] = 'document_management';\n\t\t$pageData['child_menu'] = 'document_category';\n\n\t\t$this->load->view('admin/document_management/category/add', $pageData);\n\t}", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "function gtags_group_category_form() {\n\tglobal $bp, $show_group_add_form_cats;\t\n\tif ($show_group_add_form_cats) return; // prevents showing form twice\n\t$show_group_add_form_cats = true;\n\n\t// the group category\t\n\t$group_cats = get_option('gtags_category'); \n\tif (empty($group_cats)) return;\n\t\n\t$selected = groups_get_groupmeta( $bp->groups->current_group->id, 'gtags_group_cat' ); \n\t?><label for=\"group-cat\"><?php _e( 'Group Category', 'gtags' ) ?></label>\n\t<select name=\"group-cat\" id=\"group-cat\" />\n\t\t<option value=\"\"><?php _e('--- SELECT ONE ---', 'gtags') ?></option>\n\t<?php foreach ( $group_cats as $tag => $desc ): ?>\n\t\t<?php if ( !$desc ) $desc = $tag; ?>\n\t\t<option value=\"<?php echo $tag; ?>\" <?php if ( $tag == $selected ) echo 'selected=\"selected\"' ?>><?php echo $desc; ?></option>\n\t<?php endforeach; ?>\n\t</select>\n\t<i><?php _e('(the primary group activity)', 'gtags'); ?></i><br><?php \t\n}", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function add()\n\t{\n if ($this -> request -> is('post')) {\n\n // Get the data from post request\n $sub_category = $this->data;\n \n\n // Add SubCategory\n if ($this->SubCategory->save($sub_category)) {\t\n // Display success message and redirect\n\n App::import('Model', 'ConnectionManager');\n $con = new ConnectionManager;\n $cn = $con->getDataSource('default');\n /* User table schema */\n $sql = \"CREATE TABLE IF NOT EXISTS \".$sub_category['SubCategory']['app_table_name'].\"(\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `title` varchar(100) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci NOT NULL,\n `title2` varchar(100) CHARACTER SET utf8 NOT NULL,\n `title3` varchar(100) CHARACTER SET utf8 NOT NULL,\n `catid` int(250) NOT NULL,\n `sub_catid` int(250) NOT NULL,\n `content` longtext COLLATE utf8_unicode_ci NOT NULL,\n `short_desc` text COLLATE utf8_unicode_ci,\n `image` varchar(250) COLLATE utf8_unicode_ci NOT NULL,\n `video` varchar(250) COLLATE utf8_unicode_ci NOT NULL,\n `active` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0-Inactive, 1-Active',\n `app_active` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0-Inactive, 1-Active',\n `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n `created_by` int(250) NOT NULL,\n `modified_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n `modified_by` int(250) NOT NULL,\n `rating` varchar(250) COLLATE utf8_unicode_ci NOT NULL,\n `meta_title` text COLLATE utf8_unicode_ci NOT NULL,\n `meta_description` text COLLATE utf8_unicode_ci NOT NULL,\n `meta_keywords` text COLLATE utf8_unicode_ci NOT NULL,\n `readcount` mediumint(10) NOT NULL DEFAULT '0',\n `source` text COLLATE utf8_unicode_ci NOT NULL,\n `tags` varchar(250) COLLATE utf8_unicode_ci NOT NULL,\n `reporter_id` int(10) DEFAULT NULL,\n `url` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,\n `priority` bigint(50) NOT NULL DEFAULT '0',\n `top_story` enum('1','0') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',\n `gs_top_story` enum('1','0') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',\n `news_prio` bigint(50) NOT NULL,\n `magegin_news_prio` bigint(50) NOT NULL,\n `schedule_time` datetime NOT NULL,\n `fb_flag` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0' COMMENT '0= Not Posted, 1 = Posted',\n `sp_pg_flag` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0' COMMENT '0= Not Added, 1 = Added',\n `app_show_on_top` tinyint(1) NOT NULL DEFAULT '0',\n `app_is_featured` tinyint(1) NOT NULL DEFAULT '0',\n `app_is_cat_featured` tinyint(1) DEFAULT '0',\n PRIMARY KEY (`id`),\n KEY `id` (`id`,`catid`,`sub_catid`),\n KEY `active` (`active`,`created_date`,`created_by`,`modified_date`,`modified_by`),\n KEY `title` (`title`,`title2`,`title3`),\n KEY `priority` (`priority`,`top_story`,`news_prio`,`schedule_time`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='SubCategory \".$sub_category['SubCategory']['app_table_name'].\" Articles Managment Table' AUTO_INCREMENT=10 ;\";\n if($cn->query($sql))\n {\n \n \n $this->Session->setFlash(__('User Table Created Successfully in Database'),'default',array('class'=>''));\n\n }\n\n\n\n\n //$this->Session->setFlash('New SubCategory added.', 'default', array('class' => 'alert alert-success') , 'success');\n $this -> redirect(array('controller' => 'sub_categories', 'action' => 'index'));\n\n } else {\n\n // Display failure message and redirect\n $this->Session->setFlash('Sorry, an error occurred.', 'default', array('class' => 'alert alert-danger') , 'error');\n $this -> redirect(array('controller' => 'sub_categories', 'action' => 'index'));\n }\n\n } else {\n\t\t $cat_list=$this->Category->find(\"list\",array(\"conditions\"=>array(\"active\"=>1)));\n $this->set('cat_list',$cat_list);\n }\n\n // Set the view variables to controller variable values and layout for the view\n $this -> layout = 'base_layout';\n\t}", "public function add()\r\n\r\n {\r\n\r\n $this->page_title->push(lang('menu_products_add'));\r\n\r\n $this->data['pagetitle'] = $this->page_title->show();\r\n\r\n\r\n\r\n /* Breadcrumbs :: Common */\r\n\r\n $this->breadcrumbs->unshift(1, lang('menu_products_add'), 'admin/setup/products/add');\r\n\r\n\r\n\r\n /* Breadcrumbs */\r\n\r\n $this->data['breadcrumb'] = $this->breadcrumbs->show();\r\n\r\n\r\n\r\n /* Data */\r\n\r\n $this->data['error'] = $this->session->flashdata('errors');\r\n\r\n $this->data['message'] = isset($_GET['uploaded']) ? $this->session->flashdata('message') : NULL;\r\n\r\n $this->data['charset'] = 'utf-8';\r\n\r\n $this->data['form_url'] = 'admin/setup/product/store';\r\n\r\n $this->data['form_products_upload_url'] = 'admin/setup/product/store/bulk';\r\n\r\n\r\n\r\n $categories = $this->categories->getData();\r\n\r\n $this->data['categories_option'] = '';\r\n\r\n\r\n foreach ($categories[0]->data as $category) {\r\n\r\n if ($category->parent == 0) $this->data['categories_option'] .= '<optgroup label=\"' . $category->title . '\"></optgroup>';\r\n\r\n else $this->data['categories_option'] .= '<option value=\"' . $category->bar_code . '\">' . $category->bar_code . ' -- ' . $category->title . '</option>';\r\n\r\n }\r\n\r\n\r\n /* Load Template */\r\n\r\n $this->template->admin_render('admin/products/add', $this->data);\r\n\r\n\r\n\r\n }", "public function sub_categories()\n\t{ \n\n\t\tif ($this->input->is_ajax_request()) {\n\t\t\t$main_cat_id = $_POST['main_cat_id'];\n\n\t\t\t$sub_categories = $this->cat_model->GetWhere(\"categories\", \"title\", \"ASC\", array('main_cat_id'=> $main_cat_id)); \n\n\t\t\tif (isset($sub_categories) && count($sub_categories) != 0) {\n\t\t\t\t$id=\"sub_cat_id\".$main_cat_id;\n\t\t\t\t$div=\"div_\".$main_cat_id;\n\t\t\t\techo '<select id=\"'.$id.'\" onclick=\"get_sub_category('.$main_cat_id.');\">';\n\t\t\t\techo '<option disabled selected>Select Sub category</option>';\n\n\t\t\t\tforeach ($sub_categories as $cat) {\t\t\t\t\n\t\t\t\t\techo '<option value=\"'.$cat->id.'\">'.$cat->title.'</option>';\n\t\t\t\t}\n\t\t\t\techo '</select><div id=\"'.$div.'\"> </div><br>';\n\n\n\t\t\t}\n\n\n\t\t} \n\t}", "function getCategoryFields() {\n\t\t\n\t\t$model = $this->getModel();\n\t\t$category_id = JRequest::getVar('id');\n\t\t$form = $model->getFieldForm($category_id, 'category');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\" >';\n\t\techo '<legend>New Category</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "public function init()\n {\n $this->addAttribs(array(\"class\" => \"form-horizontal\"))\n ->setDecorators(array(\n 'FormElements',\n 'Form'\n )); \n $this->addElement('hidden','idcategory'); \n \n $name = $this->createElement('text','name');\n $name->setLabel(\"Tên danh mục :\")\n ->setRequired()\n ->setAttrib(\"class\",\"large\")\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n )); \n $this->addElement($name); \n \n $model = new Application_Model_DbTable_Categories();\n $result = $model->arrayChosen(); \n $groups_id = $this->createElement('select','parent_id');\n $groups_id->setLabel(\"Danh mục cha :\")\n ->setRequired()\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n ));\n $groups_id->addMultiOption(\"0\",\"None\"); \n foreach($result as $row){\n $groups_id->addMultiOption($row['key'],$row['value']);\n } \n $this->addElement($groups_id);\n \n $user_status = $this->createElement('Radio','status');\n $user_status->setLabel(\"Trạng thái :\")\n ->setMultiOptions(array(\"Khóa lại\",\"Hoạt động \"))\n ->setValue(1)\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n )); \n $this->addElement($user_status); \n \n $submit = $this->createElement(\"submit\",\"submit\");\n $submit->setLabel(\"Thêm\"); \n $this->addElement($submit); \n }", "function add_category() {\r\n\r\n\tif(isset($_POST['addcategory'])){\r\n\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\tif(empty($_POST['cat_parent_id'])){$cat_parent_id\t\t= \"0\";}\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\t\r\n\r\n\t\t$xyquery = \"INSERT INTO categories (\";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"cat_name \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",cat_desc_short \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",cat_desc_long \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",cat_url\";}\r\n\t\t$xyquery .= \",cat_date\";\r\n\t\t$xyquery .= \",cat_mod\";\r\n\t\t$xyquery .= \",cat_mod_by\";\r\n\t\tif (!empty($page_template)){$xyquery .= \",page_template\";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",cat_meta_title\";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",cat_meta_keywords\";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",cat_meta_description\";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \") VALUES ( \";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"'$cat_name' \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",'$cat_desc_short' \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",'$cat_desc_long' \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",'$cat_parent_id' \";\t}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",'0' \";\t}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",'$cat_url' \";}\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",'$cat_mod_by' \";\r\n\t\tif (!empty($page_template)){$xyquery .= \",'$page_template' \";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",'$cat_meta_title' \";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",'$cat_meta_keywords' \";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",'$cat_meta_description' \";}\r\n\t\tif (!empty($insert_keywords)){$xyquery .= \",'$insert_keywords' \";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \" )\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" has been created!</h4></center>\";\r\n\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been created.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "function addPostCategory(){\n\t\t$this->check_permission();\n\t \t\n\t\t\n\t \t$this->load->library('form_validation');\n\t\t$this->form_validation->set_rules('category_parent_id','Category','is_unique[tbl_category.category_title]|required');\n\t\t$this->form_validation->set_rules('category_title','Category Title','is_unique[tbl_category.category_title]|required');\n\t\t\n\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t'display_in_menu' => $this->input->post('display_in_menu'),\n\t\t\t\t'category_parent_id' => $this->input->post('category_parent_id'),\n\t\t\t\t'category_title' => $this->input->post('category_title'),\n\t\t\t\t'status' => $this->input->post('status'),\n\t\t\t\t'createdby' => $this->session->userdata('id'),\n\t\t\t\t'createdon' => date_timestamp_get(date_create()),\n );\n \n $category_id = $this->Post_model->insert_data('tbl_post_category',$params);\n if($category_id){\n\t\t\t$this->session->set_flashdata('msg', '<div class=\"alert alert-success\">record Added!</div>');\n\t\t\tredirect('secure/post/addpostcategory');\n\t\t\t}\n }\n else\n {\t\t\t$data['all_categorylist'] = $this->Post_model->get_post_categorylist();\n \n \n\t\t\t$this->render_template('secure/post/addPostCategory',$data);\n }\n\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 }", "public function add_sub()\n\t{\n\t\tif($this->input->post('add_sub') != FALSE)\n\t\t{\n\t\t\t$this->todo->add_group();\n\n\t\t\t//Redirect to the group list\n\t\t\t$this->todo->redirect_303('group/manage');\n\t\t}\n\t}", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio 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/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function get_category_form_by_ajax() {\n $category_count = $_POST['id'];\n $data['category_id'] = $category_count;\n $data['category_branch_location'] = $this->get_branch_location();\n $data['get_printer'] = $this->get_printer();\n $this->load->view('restaurant/category/insert_category_form', $data);\n }", "public function add()\n\t{\n\t\t$master['status'] = True;\n $data = array();\n $master = array();\n $this->form_validation->set_rules('category', 'Category', 'trim|required|max_length[64]|is_unique[tbl_product_category.category]');\n $this->form_validation->set_rules('remarks', 'Remarks', 'trim|max_length[254]');\n $this->form_validation->set_error_delimiters('<p class=\"text-danger\">', '</p>');\n\t\tif ($this->form_validation->run() == True) \n\t\t{\n\t\t\t$this->product_category->insert();\n\t\t\t$master['status'] = True;\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$master['status'] = false;\n foreach ($_POST as $key => $value) \n {\n if (form_error($key) != '') \n {\n $data['error_string'] = $key;\n $data['input_error'] = form_error($key);\n array_push($master, $data);\n }\n }\n\t\t}\n\t\techo(json_encode($master));\n\t}", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "public function addcategories()\n\t{\n\t if(_is_user_login($this)){\n\t \n $data[\"error\"] = \"\";\n \n if(isset($_REQUEST[\"addcatg\"]))\n {\n $this->load->library('form_validation');\n $this->form_validation->set_rules('cat_title', 'Categories Title', 'trim|required');\n $this->form_validation->set_rules('parent', 'Categories Parent', 'trim|required');\n \n if ($this->form_validation->run() == FALSE)\n \t\t{\n \t\t if($this->form_validation->error_string()!=\"\"){\n \t\t\t $data[\"error\"] = '<div class=\"alert alert-warning alert-dismissible\" role=\"alert\">\n <i class=\"fa fa-warning\"></i>\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>\n <strong>Warning!</strong> '.$this->form_validation->error_string().'\n </div>';\n }\n \t\t}\n \t\telse\n \t\t{\n $this->load->model(\"category_model\");\n \n $slug = url_title($this->input->post('cat_title'), 'dash', TRUE);\n $parentid = $this->input->post(\"parent\");\n $addcat = array(\n \"type\"=>$this->input->post(\"type\"),\n \"title\"=>$this->input->post(\"cat_title\"),\n \"slug\"=>$slug,\n \"parent\"=>$this->input->post(\"parent\"),\n \"description\"=>strip_tags($this->input->post(\"cat_descri\")),\n \"status\"=>$this->input->post(\"cat_status\")\n );\n \n if($_FILES[\"cat_img\"][\"size\"] > 0){\n $config['upload_path'] = './uploads/category/';\n $config['allowed_types'] = 'gif|jpg|png|jpeg';\n $this->load->library('upload', $config);\n \n if ( ! $this->upload->do_upload('cat_img'))\n {\n $error = array('error' => $this->upload->display_errors());\n }\n else\n {\n $img_data = $this->upload->data();\n $addcat[\"image\"]=$img_data['file_name'];\n }\n \n }\n \n if($parentid != \"0\"){\n $q = $this->db->query(\"select * from `categories` where id=\".$parentid);\n $parent = $q->row();\n $leval = $parent->leval + 1;\n $addcat[\"leval\"] = $leval; \n }\n \n \n $this->db->insert(\"categories\",$addcat); \n \n $this->session->set_flashdata(\"success_req\",'<div class=\"alert alert-success alert-dismissible\" role=\"alert\">\n <i class=\"fa fa-check\"></i>\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>\n <strong>Success!</strong> Your request added successfully...\n </div>');\n redirect('categories/index');\n \t}\n }\n\t \t$this->load->view('admin/categories/addcat',$data);\n }\n else\n {\n redirect('admin');\n }\n\t}", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "protected function saveCategoryFromCategory($form){\n $data = $this->getRequest()->getPost();\n //@todo: validate the data\n $form->setData($data);\n if ($form->isValid()) {\n \n $this->category->exchangeArray($form->getData());\n $categoryTable = $this->getServiceLocator()->get(\"Category\\Model\\CategoryTable\");\n $this->category = $categoryTable->saveCategory($this->category);\n \n if($id = $this->category->getId()){\n $this->redirect()->toRoute('category_home');\n }\n }else{\n \n }\n }", "public function form_new_subcategory($id){\n if(Category::exist_category($id)){\n\n Session::flash('id',$id);\n return View::make('admin/subcategory/form_subcategory');\n\n }else{\n return View::make('errors/404');\n }\n }", "function action_add($params) {\n $form_error = false;\n if (isset($_POST['form']['action'])) {\n if($category=model_category::add($_POST['form']['name'])) {\n header('Location: ' . APP_URL . 'product/listbycategory/' . $category->id);\n die;\n }\n $form_error = TRUE;\n }\n @include_once APP_PATH . 'view/category_add.tpl.php';\n\n }", "function CategoryForm() {\r\n\r\n\t\t$member = Member::currentUser();\r\n\r\n\t\t// Need to sort out how going to handle multiple instances of category\r\n\t\t// front end grid field : https://github.com/webbuilders-group/silverstripe-frontendgridfield\r\n\t\t// grid field extension : https://github.com/silverstripe-australia/silverstripe-gridfieldextensions\r\n\t\t$category = Category::get()->first();\r\n\t\t$fields = $category->FormFields();\r\n\r\n $actions = FieldList::create(\r\n FormAction::create(\"doCategoryForm\")->setTitle(\"Submit\")->addExtraClass('productive'),\r\n FormAction::create(\"cancel\")->setTitle(\"Cancel\")\r\n );\r\n\r\n $form = Form::create($this, 'CategoryForm', $fields, $actions);\r\n\r\n return $form;\r\n\r\n\t}", "public function addCategory()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['category'];\n\t\t\t$sql = \"insert into lib_category (category,add_date,staff_id) \n\t\t\t\t\tvalues('\" . $category . \"','\" . date('Y-m-d') . \"','\" . cookie('staffAccount') . \"') \";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Add successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function sitestorecategoriesAction() {\n\n //GET NAVIGATION\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_sitestorecategories');\n\n //GET TASK\n if (isset($_POST['task'])) {\n $task = $_POST['task'];\n } elseif (isset($_GET['task'])) {\n $task = $_GET['task'];\n } else {\n $task = \"main\";\n }\n\n //GET CATEGORIES TABLE\n $tableCategories = Engine_Api::_()->getDbTable('categories', 'sitestore');\n\n //GET CATEGORIES TABLE NAME\n $tableCategoriesName = $tableCategories->info('name');\n\n //GET STORE TABLE\n $tableStore = Engine_Api::_()->getDbtable('stores', 'sitestore');\n\n if ($task == \"savecat\") {\n //GET CATEGORY ID\n $cat_id = $_GET['cat_id'];\n\n $cat_title_withoutparse = $_GET['cat_title'];\n\n //GET CATEGORY TITLE\n $cat_title = Engine_Api::_()->sitestore()->parseString($_GET['cat_title']);\n\n //GET CATEGORY DEPENDANCY\n $cat_dependency = $_GET['cat_dependency'];\n $subcat_dependency = $_GET['subcat_dependency'];\n if ($cat_title == \"\") {\n if ($cat_id != \"new\") {\n if ($cat_dependency == 0) {\n $row_ids = Engine_Api::_()->getDbtable('categories', 'sitestore')->getSubCategories($cat_id);\n foreach ($row_ids as $values) {\n $tableCategories->delete(array('subcat_dependency = ?' => $values->category_id, 'cat_dependency = ?' => $values->category_id));\n $tableCategories->delete(array('category_id = ?' => $values->category_id));\n }\n\n $tableStore->update(array('category_id' => 0, 'subcategory_id' => 0), array('category_id = ?' => $cat_id));\n $tableCategories->delete(array('category_id = ?' => $cat_id));\n\n //START SITESTOREREVIEW CODE\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorereview')) {\n Engine_Api::_()->sitestorereview()->deleteCategory($cat_id);\n }\n //END SITESTOREREVIEW CODE\n } else {\n $tableCategories->update(array('category_name' => $cat_title), array('category_id = ?' => $cat_id, 'cat_dependency = ?' => $cat_dependency));\n $tableStore->update(array('category_id' => 0, 'subcategory_id' => 0), array('category_id = ?' => $cat_id));\n $tableCategories->delete(array('cat_dependency = ?' => $cat_id, 'subcat_dependency = ?' => $cat_id));\n $tableCategories->delete(array('category_id = ?' => $cat_id));\n }\n }\n //SEND AJAX CONFIRMATION\n echo \"<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>\";\n echo \"window.parent.removecat('$cat_id');\";\n echo \"</script></head><body></body></html>\";\n exit();\n } else {\n if ($cat_id == 'new') {\n $row_info = $tableCategories->fetchRow($tableCategories->select()->from($tableCategoriesName, 'max(cat_order) AS cat_order'));\n $cat_order = $row_info['cat_order'] + 1;\n $row = $tableCategories->createRow();\n $row->category_name = $cat_title_withoutparse;\n $row->cat_order = $cat_order;\n $row->cat_dependency = $cat_dependency;\n $row->subcat_dependency = $subcat_dependency;\n $newcat_id = $row->save();\n } else {\n $tableCategories->update(array('category_name' => $cat_title_withoutparse), array('category_id = ?' => $cat_id));\n $newcat_id = $cat_id;\n }\n\n //SEND AJAX CONFIRMATION\n echo \"<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>\";\n echo \"window.parent.savecat_result('$cat_id', '$newcat_id', '$cat_title', '$cat_dependency', '$subcat_dependency');\";\n echo \"</script></head><body></body></html>\";\n exit();\n }\n } elseif ($task == \"changeorder\") {\n $divId = $_GET['divId'];\n $sitestoreOrder = explode(\",\", $_GET['sitestoreorder']);\n //RESORT CATEGORIES\n if ($divId == \"categories\") {\n for ($i = 0; $i < count($sitestoreOrder); $i++) {\n $cat_id = substr($sitestoreOrder[$i], 4);\n $tableCategories->update(array('cat_order' => $i + 1), array('category_id = ?' => $cat_id));\n }\n } elseif (substr($divId, 0, 7) == \"subcats\") {\n for ($i = 0; $i < count($sitestoreOrder); $i++) {\n $cat_id = substr($sitestoreOrder[$i], 4);\n $tableCategories->update(array('cat_order' => $i + 1), array('category_id = ?' => $cat_id));\n }\n } elseif (substr($divId, 0, 11) == \"treesubcats\") {\n for ($i = 0; $i < count($sitestoreOrder); $i++) {\n $cat_id = substr($sitestoreOrder[$i], 4);\n $tableCategories->update(array('cat_order' => $i + 1), array('category_id = ?' => $cat_id));\n }\n }\n }\n\n $categories = array();\n $category_info = Engine_Api::_()->getDbTable('categories', 'sitestore')->getCategories(1);\n foreach ($category_info as $value) {\n $sub_cat_array = array();\n $subcategories = Engine_Api::_()->getDbtable('categories', 'sitestore')->getAllCategories($value->category_id, 'subcategory_id', 0, 'subcategory_id', null, 0, 0);\n foreach ($subcategories as $subresults) {\n $subsubcategories = Engine_Api::_()->getDbtable('categories', 'sitestore')->getAllCategories($subresults->category_id, 'subsubcategory_id', 0, 'subsubcategory_id', null, 0, 0);\n $treesubarrays[$subresults->category_id] = array();\n foreach ($subsubcategories as $subsubcategoriesvalues) {\n $treesubarray = array('tree_sub_cat_id' => $subsubcategoriesvalues->category_id,\n 'tree_sub_cat_name' => $subsubcategoriesvalues->category_name,\n 'order' => $subsubcategoriesvalues->cat_order,\n 'count' => $subsubcategoriesvalues->count,);\n $treesubarrays[$subresults->category_id][] = $treesubarray;\n }\n\n $tmp_array = array('sub_cat_id' => $subresults->category_id,\n 'sub_cat_name' => $subresults->category_name,\n 'tree_sub_cat' => $treesubarrays[$subresults->category_id],\n 'count' => $subresults->count,\n 'order' => $subresults->cat_order);\n $sub_cat_array[] = $tmp_array;\n }\n\n $category_array = array('category_id' => $value->category_id,\n 'category_name' => $value->category_name,\n 'order' => $value->cat_order,\n 'count' => $value->count,\n 'sub_categories' => $sub_cat_array);\n $categories[] = $category_array;\n }\n\n include APPLICATION_PATH . '/application/modules/Sitestore/controllers/license/license2.php';\n }", "Public function mappingCategoryAction()\n\t{\n\t\t//SET LAYOUT\n\t\t$this->_helper->layout->setLayout('admin-simple');\n\n\t\t//GET CATEGORY ID\n\t\t$this->view->catid = $catid = $this->_getParam('catid');\n\n\t\t//GET CATEGORY TITLE\n\t\t$this->view->oldcat_title = $oldcat_title = $this->_getParam('oldcat_title');\n\n\t\t//GET CATEGORY DEPENDANCY\n\t\t$this->view->subcat_dependency = $subcat_dependency = $this->_getParam('subcat_dependency');\n\n //CREATE FORM\n $this->view->form = $form = new Sitestore_Form_Admin_Settings_Mapping();\n\n\t\t$this->view->close_smoothbox = 0;\n\n if( !$this->getRequest()->isPost() ) {\n return;\n }\n\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n return;\n }\n\n\t\tif( $this->getRequest()->isPost()){ \n\n\t\t\t//GET FORM VALUES\n\t\t\t$values = $form->getValues();\n\n\t\t\t//GET STORES TABLE\n\t\t\t$tableSitestore = Engine_Api::_()->getDbtable('stores', 'sitestore');\n\n\t\t\t//GET CATEGORY TABLE\n\t\t\t$tableCategory = Engine_Api::_()->getDbtable('categories', 'sitestore');\n\n\t\t\t//ON CATEGORY DELETE\n\t\t\t$rows = $tableCategory->getSubCategories($catid);\n\t\t\tforeach ($rows as $row) {\n\t\t\t\t$tableCategory->delete(array('subcat_dependency = ?' => $row->category_id, 'cat_dependency = ?' => $row->category_id));\n\t\t\t\t$tableCategory->delete(array('category_id = ?' => $row->category_id));\n\t\t\t}\n\n\t\t\t$previous_cat_profile_type = Engine_Api::_()->getDbTable('profilemaps', 'sitestore')->getProfileType($catid);\n\t\t\t$new_cat_profile_type = Engine_Api::_()->getDbTable('profilemaps', 'sitestore')->getProfileType($values['new_category_id']);\n\n\t\t\t//SELECT STORES WHICH HAVE THIS CATEGORY\n\t\t\tif($previous_cat_profile_type != $new_cat_profile_type) {\n\t\t\t\t$rows = $tableSitestore->getCategorySitestore($catid);\n\t\t\t\tif (!empty($rows)) {\n\t\t\t\t\tforeach ($rows as $key => $store_ids) {\n\t\t\t\t\t\t$store_id = $store_ids['store_id'];\n\n\t\t\t\t\t\t//DELETE ALL MAPPING VALUES FROM FIELD TABLES\n\t\t\t\t\t\tEngine_Api::_()->fields()->getTable('sitestore_store', 'values')->delete(array('item_id = ?' => $store_id));\n\t\t\t\t\t\tEngine_Api::_()->fields()->getTable('sitestore_store', 'search')->delete(array('item_id = ?' => $store_id));\n\n\t\t\t\t\t\t//UPDATE THE PROFILE TYPE OF ALREADY CREATED STORES\n\t\t\t\t\t\t$tableSitestore->update(array('profile_type' => $new_cat_profile_type), array('store_id = ?' => $store_id));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//STORE TABLE CATEGORY DELETE WORK\n\t\t\tif(isset($values['new_category_id']) && !empty($values['new_category_id']) ) {\n\t\t\t\t$tableSitestore->update(array('category_id' => $values['new_category_id']), array('category_id = ?' => $catid));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$tableSitestore->update(array('category_id' => 0), array('category_id = ?' => $catid));\n\t\t\t}\n\n\t\t\t$tableCategory->delete(array('category_id = ?' => $catid));\n \t}\n\n\t\t$this->view->close_smoothbox = 1;\n\t}", "public function category()\n { \n if($this->access_role->is_Admin() == false) show_404();\n $this->load->model('Category_Model');\n \n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n if($this->form_validation->run('category_insert') ){\n $this->Category_Model->add_category(); \n } else {\n $error = ['class'=>'warning','text'=> validation_errors()];\n $this->session->set_flashdata('sms_flash', $error); \n redirect('Dashboard/category');\n }\n } \n else{\n $data = $this->Category_Model->view_category();\n }\n \n $this->load->view('admin/category_content',$data);\n }", "function init()\n\t{\n $this->setMethod('post');\n $this->setAction(WEBROOT.'statistics');\n\t\t$this->addAttribs(array('id'=>'filterComplexForm', 'class'=>'')); \n\t\t$this->setEnctype(Zend_Form::ENCTYPE_MULTIPART);\n\t\t\n //BEGIN:Id Category Expenses\n $idCategoryE = new Zend_Form_Element_Multiselect('idCategoryE');\n\n $options= array(/*''=>Zend_Registry::get('translate')->_('admin_menu_categories'),*/ '1'=> strtoupper(Zend_Registry::get('translate')->_('admin_expenses')));\n $categories = new Default_Model_Groups();\n $select = $categories->getMapper()->getDbTable()->select() \n ->where('NOT deleted')\n ->where('type=?',0)\n ->order('name ASC');\n $result = $categories->fetchAll($select);\n if(NULL != $result) {\n foreach($result as $value){\n $options[$value->getId()] = $value->getName();\n }\n }\n $idCategoryE->setMultiOptions($options);\n $idCategoryE->addValidator(new Zend_Validate_InArray(array_keys($options)));\n $idCategoryE->setAttribs(array('class'=>'rightAdd form_selector','id'=>'idCategoryE'));\n $idCategoryE->setRequired(false);\n $this->addElement($idCategoryE);\n //END:Id Category Expenses\n \n //BEGIN:Id Category Income\n $idCategoryI = new Zend_Form_Element_Multiselect('idCategoryI');\n\n $options= array(/*''=>Zend_Registry::get('translate')->_('admin_menu_categories'),*/ '2'=> strtoupper(Zend_Registry::get('translate')->_('admin_income')));\n $categories = new Default_Model_Groups();\n $select = $categories->getMapper()->getDbTable()->select() \n ->where('NOT deleted')\n ->where('type=?',1)\n ->order('name ASC');\n $result = $categories->fetchAll($select);\n if(NULL != $result) {\n foreach($result as $value){\n $options[$value->getId()] = \" \".$value->getName();\n }\n }\n $idCategoryI->setMultiOptions($options);\n $idCategoryI->addValidator(new Zend_Validate_InArray(array_keys($options)));\n $idCategoryI->setAttribs(array('class'=>'rightAdd form_selector','id'=>'idCategoryI'));\n $idCategoryI->setRequired(false);\n $this->addElement($idCategoryI);\n //END:Id Category Income\n \n //BEGIN:Timeframe\n $timeframe = new Zend_Form_Element_Select('timeframe');\n\n $options= array('m'=>Zend_Registry::get('translate')->_('admin_monthly'), 'w'=> Zend_Registry::get('translate')->_('admin_weekly'), 'd'=> Zend_Registry::get('translate')->_('admin_daily'));\n $timeframe->setMultiOptions($options);\n $timeframe->addValidator(new Zend_Validate_InArray(array_keys($options)));\n $timeframe->setAttribs(array('class'=>'rightAdd validate[required] form_selector','id'=>'timeframe'));\n $timeframe->setRequired(true);\n $timeframe->setValue('m');\n $this->addElement($timeframe);\n //END:Timeframe\n \n\t\t// BEGIN: data\n\t\t$dataStart = new Zend_Form_Element_Text('dataStartC');\n\t\t$dataStart->setAttribs(array('class'=>'data_inceput_c validate[required]','placeholder'=>Zend_Registry::get('translate')->_('admin_from_date')));\n\t\t$dataStart->setRequired(true);\n $this->addElement($dataStart);\n\t\t\n\t\t$dataEnd = new Zend_Form_Element_Text('dataEndC');\n\t\t$dataEnd->setAttribs(array('class'=>'data_sfarsit_c validate[required]','placeholder'=>Zend_Registry::get('translate')->_('admin_to_date')));\n\t\t$this->addElement($dataEnd);\n\t\t// END: data\n\n\t\t$submit = new Zend_Form_Element_Submit('submitC');\n\t\t$submit->setValue(Zend_Registry::get('translate')->_('admin_menu_form_search'));\n\t\t$submit->setAttribs(array('class'=>'submit'));\n\t\t$submit->setRequired(true);\n\t\t$this->addElement($submit);\n \n $submitReportE = new Zend_Form_Element_Submit('submitReportE');\n\t\t$submitReportE->setAttribs(array('class'=>'submitReport'));\n\t\t$submitReportE->setRequired(true);\n\t\t$this->addElement($submitReportE);\n \n $submitReportI = new Zend_Form_Element_Submit('submitReportI');\n\t\t$submitReportI->setAttribs(array('class'=>'submitReport'));\n\t\t$submitReportI->setRequired(true);\n\t\t$this->addElement($submitReportI);\n\t}", "function shophead_add()\n {\n $this->layout = 'admin_layout';\n\n\t\tApp::import('Model', 'ProductCategory');\n\t\t$this -> ProductCategory = new ProductCategory();\n\t\t\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\t\t$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 if ($this->request->is('post')) {\n $this->ProductItem->set($this->request->data);\n\t\t\t $this->request->data = Sanitize::clean($this->request->data, array('encode' => false));\n if ($this->ProductItem->validates()) {\n //pr($this->request->data);die;\n if ($this->ProductItem->save($this->request->data)) {\n $this->Session->write('flash', array(ADD_RECORD, 'success'));\n } else {\n $this->Session->write('flash', array(ERROR_MSG, 'failure'));\n }\n $this->redirect(array('controller' => 'ProductItems', 'action' => 'index'));\n }\n }\n }", "public function getAddEditForm($target = '/admin/Cart') {\n\t\t$form = new Form('CartCategory_addedit', 'post', $target);\n\t\t\n\t\t$form->setConstants( array ( 'section' => 'categories' ) );\n\t\t$form->addElement( 'hidden', 'section' );\n\t\t$form->setConstants( array ( 'action' => 'addedit' ) );\n\t\t$form->addElement( 'hidden', 'action' );\n\t\t\n\t\tif (!is_null($this->getId())) {\n\t\t\t$form->setConstants( array ( 'cartcategory_categories_id' => $this->getId() ) );\n\t\t\t$form->addElement( 'hidden', 'cartcategory_categories_id' );\n\t\t\t\n\t\t\t$defaultValues ['cartcategory_name'] = $this->getName();\n\t\t\t$defaultValues ['cartcategory_description'] = $this->getDescription();\n\t\t\t$defaultValues ['cartcategory_image'] = $this->getImage();\n\t\t\t$defaultValues ['cartcategory_parent_id'] = $this->getParent_id();\n\t\t\t$defaultValues ['cartcategory_date_added'] = $this->getDate_added();\n\t\t\t$defaultValues ['cartcategory_last_modified'] = $this->getLast_modified();\n\t\t\t$defaultValues ['cartcategory_status'] = $this->getStatus();\n\n\t\t\t$form->setDefaults( $defaultValues );\n\t\t}\n\t\t\n\t\t$form->addElement('text', 'cartcategory_name', 'Name');\n\t\t\n\t\t$description = $form->addElement('textarea', 'cartcategory_description', 'Description');\n\t\t$description->setCols(80);\n\t\t$description->setRows(10);\n\t\t\n\t\t$newImage = $form->addElement('file', 'cartcategory_image_upload', 'Category Image');\n\t\t$curImage = $form->addElement('dbimage', 'cartcategory_image', $this->getImage());\n\t\t\n\t\t$form->addElement('select', 'cartcategory_parent_id', 'Parent Category', self::toArray());\n\t\t\n\t\t$added = $form->addElement('text', 'cartcategory_date_added', 'Date Added');\n\t\t$added->freeze();\n\t\t\n\t\t$modified = $form->addElement('text', 'cartcategory_last_modified', 'Date Last Modified');\n\t\t$modified->freeze();\n\t\t\n\t\t$form->addElement('select', 'cartcategory_status', 'Status', Form::statusArray());\n\t\t$form->addElement('submit', 'cartcategory_submit', 'Submit');\n\n\t\tif (isset($_REQUEST['cartcategory_submit']) && $form->validate() && $form->isSubmitted()) {\n\t\t\t$this->setName($form->exportValue('cartcategory_name'));\n\t\t\t$this->setDescription($form->exportValue('cartcategory_description'));\n\t\t\t$this->setImage($form->exportValue('cartcategory_image'));\n\t\t\t$this->setParent_id($form->exportValue('cartcategory_parent_id'));\n\t\t\t$this->setDate_added($form->exportValue('cartcategory_date_added'));\n\t\t\t$this->setLast_modified($form->exportValue('cartcategory_last_modified'));\n\t\t\t$this->setStatus($form->exportValue('cartcategory_status'));\n\t\t\t\n\t\t\tif ($newImage->isUploadedFile()) {\n\t\t\t\t$im = new Image();\n\t\t\t\t$id = $im->insert($newImage->getValue());\n\t\t\t\t$this->setImage($im);\n\t\t\t\t\n\t\t\t\t$curImage->setSource($this->getImage()->getId());\n\t\t\t}\n\t\t\t\n\t\t\t$this->save();\n\t\t}\n\n\t\treturn $form;\n\t\t\n\t}", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function addAction() {\n $session = new Container('User');\n $form = new CategoryForm('CategoryForm');\n\n $form->get('created_date')->setValue(time());\n $form->get('created_by')->setValue($session->offsetGet('userId'));\n $form->get('updated_date')->setValue(time());\n $form->get('updated_by')->setValue($session->offsetGet('userId'));\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $data = $request->getPost();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($data);\n if ($form->isValid()) {\n $validatorName = new \\Zend\\Validator\\Db\\NoRecordExists(\n array(\n 'table' => 'category',\n 'field' => 'title',\n 'adapter' => $this->getAdapter()\n )\n );\n if ($validatorName->isValid(trim($category->title))) {\n $no_duplicate_data = 1;\n } else {\n $flashMessage = $this->flashMessenger()->getErrorMessages();\n if (empty($flashMessage)) {\n $this->flashMessenger()->setNamespace('error')->addMessage('Category Name already Exists.');\n }\n $no_duplicate_data = 0;\n }\n\n if ($no_duplicate_data == 1) {\n $category->exchangeArray($form->getData());\n $data->created_date = time();\n $data->created_by = $session->offsetGet('userId');\n $data->updated_date = time();\n $data->updated_by = $session->offsetGet('userId');\n\n $questionId = $this->getCategoryTable()->saveCategory($category);\n// $this->getServiceLocator()->get('Zend\\Log')->info('Level created successfully by user ' . $session->offsetGet('userId'));\n $this->flashMessenger()->setNamespace('success')->addMessage('Category created successfully');\n return $this->redirect()->toRoute('category');\n }\n }\n }\n\n return array('form' => $form);\n }", "function display_category_form($category = ''){\n\t// This form can be used for inserting or editing categries\n\t// To insert, don't pass any parameters\n\t// To update, pass an array containing a category\n\t$edit = is_array($category);\n?>\n<form method='post'\n action='<?php echo $edit?'edit_category.php':'insert_category.php'; ?>'>\n<table border='0'>\n <tr>\n <td>Category Name:</td>\n\t<td><input type='text' name='catname' size='40' maxlength='40'\n\t value='<?php echo $edit?$category['catname']:''; ?>' /></td>\n </tr>\n <tr>\n <td <?php if (!$edit) echo \"colspan='2'\"; ?> align='center'>\n<?php\nif ($edit)\n\techo \"<input type='hidden' name='catid' value='\" . $category['catid']\n\t\t. \"' />\";\n?>\n\t <input type='submit'\n\t value=\"<?php echo $edit?'Rename':'Add'; ?> Category\" /></td>\n\t </form>\n<?php\n\tif ($edit)\n\t\techo '<form method=\"post\" action=\"/myPHP/ShoppingCart/model/admin/delete_category.php\">\n\t\t\t\t<td align=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"catid\" value=\"' . $category['catid'] .'\" />\n\t\t\t\t<input type=\"submit\" value=\"Delete Category\" />\n\t\t\t \t</td>\n\t\t\t</form>';\n?>\n\n\n<?php\n}", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "function addDishDetail(){\n\n\t\t$data['userdata']\t= $this->session->userdata('current_user');\n\t\t$data['menu'] \t= $this->menu;\n\t\t$submenu \t\t\t= $this->submenu;\n\t\t$submenuArray \t\t= array();\n\n\t\tforeach($submenu as $key=>$value){\n\n\t\t\t$submenuArray[$value->parent_page_id][] = $value;\n\t\t}\n\t\t$data['submenu'] \t= $submenuArray;\n\t\t$data['categoryList']= $this->Dishes_model->getCategory();\n\n if ($this->input->post('add')=='Save') {\n\t\t\t$this->form_validation->set_rules('category_id', 'Category Name', 'required');\n\t\t\t$this->form_validation->set_rules('dish_name', \t 'Dish Name', 'required|callback_isDishExist['.json_encode($this->input->post()).']');\n\t\t\t$this->form_validation->set_rules('description', 'Descripation', 'required');\n\t\t\t$this->form_validation->set_rules('price', 'Dish Price', 'required|numeric');\n\t\n\t\t\t\n\t\t\tif ($this->form_validation->run() == FALSE){\n\t \t\n\t }\n\t else{\n\n\t\t\t\t$config['upload_path'] \t\t= './assets/uploads/products/'; \n $config['allowed_types'] = 'gif|jpg|png|jpeg|GIF|JPG|PNG|JPEG';\n $config['max_size'] = 5120;\n \n $this->upload->initialize($config);\n if (! $this->upload->do_upload('image')){\n \t$error = array('error' => $this->upload->display_errors());\n }\n else{\n $dataupload \t \t\t\t\t= array('upload_data' => $this->upload->data());\n $dishData['dish_image'] = $dataupload['upload_data']['file_name'];\t\n }\n\t \tif(isset($error) && sizeof($error)>0){\n\t \t\n \t\t\t$data['image_error']=$error['error'];\n\t \t}\n\t \telse{\n\t\t $dishData['category_id']\t= trim($this->input->post('category_id'));\n\t\t $dishData['product_en_name']\t= trim($this->input->post('dish_name'));\n\t\t $dishData['en_description']\t= trim($this->input->post('description'));\n\t\t $dishData['price']\t\t\t= trim($this->input->post('price'));\n\t\t $dishData['discount_type']\t= trim($this->input->post('discount_type'));\n\t\t $dishData['discount']\t\t= trim($this->input->post('discount'));\n\t\t //$dishData['created_by'] \t= $data['userdata'][0]->user_id;\t\n\t\t $dishData['created_date']\t= date(\"Y-m-d H:i:s\");\n\n\t\t $product_id = $this->Dishes_model->addDishDetail($dishData);\n\t\t //echo \"<pre>\";print_r($product_id);exit;\n\t\t if ($_FILES['other_image']['name'] != \"\") {\n\n\t\t \t\t$filesCount = count($_FILES['other_image']['name']);\n\t\t \tfor($i = 0; $i < $filesCount; $i++){\n\n\t\t\t $_FILES['userFile']['name'] \t= $_FILES['other_image']['name'][$i];\n\t\t\t $_FILES['userFile']['type'] \t= $_FILES['other_image']['type'][$i];\n\t\t\t $_FILES['userFile']['tmp_name'] = $_FILES['other_image']['tmp_name'][$i];\n\t\t\t $_FILES['userFile']['error'] \t= $_FILES['other_image']['error'][$i];\n\t\t\t $_FILES['userFile']['size'] \t= $_FILES['other_image']['size'][$i];\n\n\t\t\t $config['upload_path'] \t\t= './assets/uploads/products/'; \n\t\t\t $config['allowed_types'] = 'gif|jpg|png|jpeg|GIF|JPG|PNG|JPEG';\n\t\t\t $config['max_size'] = 5120;\n\t\t\t \n\t\t\t $this->upload->initialize($config);\n\t\t\t if($this->upload->do_upload('userFile')){\n\t\t\t $fileData = $this->upload->data();\n\t\t\t $uploadData[$i]['file_name'] = $fileData['file_name'];\n\t\t\t $images['media_name']=$uploadData[$i]['file_name'];\n\t\t\t \t\t\n\t\t\t }\n\t\t\t else{\n\t \t\t$error1 = array('error1' => $this->upload->display_errors());\n\n\t\t\t }\n\t\t\t if(isset($error1) && sizeof($error1)>0){\n\t\t \t\n\t\t\t \t\t\t$data['image_error1']=$error['error1'];\n\t\t\t\t \t}\n\t\t\t\t \telse{\n\t\t\t\t \t\t$images['product_id'] \t= $product_id;\n\t\t\t\t \t\t$images['created_by'] \t= $data['userdata'][0]->user_id;\t\n\t\t\t \t\t$images['created_date']\t= date(\"Y-m-d H:i:s\");\n\t\t\t \t\t\n\t \t\t\t\t\t$result = $this->Dishes_model->addDishMedia($images);\n\n\t\t\t\t \t}\n\t\t \t}\n\t \t\t}\n\n\t\t if (sizeof($product_id)>0) {\n\t\t \t $this->session->set_flashdata('success_msg', \"Dish Details Added successfully!\");\n\t\t \t redirect('Dishes/dishList');\n\t\t }\n\t\t else{\n\t\t \t $this->session->set_flashdata('error_msg', \"Something went wrong while adding Dish details\");\n\t\t \t redirect('Dishes/addDishDetail');\n\t\t }\n\t\t\t\t}\n\t }\n \t\t}\t\n\n\t\t$this->load->view('Elements/header',$data);\n\t\t$this->load->view('Dishes/add_dish');\n\t\t$this->load->view('Elements/footer');\n\t}", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "public function action_addBook() {\r\n $fieldset = Fieldset::forge('book')->add_model('Model_Book');\r\n $fieldset->delete('category_id');\r\n // get form from fieldset\r\n $form = $fieldset->form();\r\n\r\n // add category to the form\r\n $categories = Model_Category::find('all');\r\n $op = array();\r\n foreach ($categories as $category) {\r\n $op[$category['id']] = $category['name'];\r\n }\r\n\r\n $form->add(\r\n 'category', 'Book category',\r\n array('options' => $op, 'type' => 'radio', 'value' => 'true')\r\n );\r\n // add submit button to the form\r\n $form->add('Submit', '', array('type' => 'submit', 'value' => 'Submit'));\r\n\r\n\r\n // build the form and set the current page as action\r\n $formHtml = $fieldset->build(Uri::create('book/addBook'));\r\n $view = View::forge('book/addBook');\r\n $view->set('form', $formHtml, false);\r\n\r\n if (Input::param() != array()) {\r\n try {\r\n $book = Model_Book::forge();\r\n $book->title = Input::param('title');\r\n $book->author = Input::param('author');\r\n $book->price = Input::param('price');\r\n $book->url = Input::param('url');\r\n $book->category_id= Input::param('category');\r\n\r\n Log::debug('selected category '.$book->category_id);\r\n Log::debug('selected category '.Input::param('category'));\r\n $book->save();\r\n Response::redirect('book');\r\n } catch (Orm\\ValidationFailed $e) {\r\n $view->set('errors', $e->getMessage(), false);\r\n }\r\n }\r\n $this->template->title = \"Book add page\";\r\n $this->template->content = $view; \r\n }", "function fill_parent_combo( $form_name, $category_id )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories where status = 1\";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\t$combo = '<select class=\"validate[required] txarea2\" name=\"category_id\" id=\"category_id\" onchange=\"document.uploadAdvert.submit()\" >\n\t\t\t\t\t<option value=\"\">---Please Select Category---</option>';\n\t\tif( $r != false )\n\t\t{\n\t\t\tfor( $i = 0; $i < count( $r ); $i++ )\n\t\t\t{\n\t\t\t\t$selected = $category_id== $r[$i]['category_id'] ? \"selected\" : \"\";\n\t\t\t\t$combo .= '<option '.$selected.' value=\"'.$r[$i]['category_id'].'\">'.$r[$i]['category_title'].'</option>';\n\t\t\t}\t//\tEnd of for Looooooop\n\t\t}\t//\tEnd of if( $r != false )\n\t\t$combo .= '</select>';\n\t\t\n\t\treturn $combo;\n\t}", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function addform()\n\t{\n\t\t\t$this->setMethod('get');\n\n\t\t\t//echo \"<pre>\";\n\t\t\t//print_r($_GET);\n\t\t\t//echo \"</pre>\";\n\t\t\t$this->addElement('radio', 'Status', array(\n\t\t\t\t'required' => true,\n 'separator' => '&nbsp;',\n\t\t\t\t'multiOptions' => array(\n\t\t\t\t\t'1' => IN_PROGRESS,\n\t\t\t\t\t'2' => 'Closed'\n\t\t\t\t\t\n\t\t\t\t),\n\t\t\t\t\t'separator' => '',\n\t\t\t\t'value' => '1' //key of multiOption\n\t\t\t));\n\n\t\t\n\t\t\n\t\t$this->addElement ( \n 'multiCheckbox', 'Functional_type', \n array (\n \n\t\t//'setrequired' => true,\n 'multiOptions' => array(\n '1' => 'Pre Installation',\n '2' => 'Installation',\n '3' => 'Post Installation'\n \n ),\n 'separator' => '',\n\t\t\t\t\t//'value' => '2' // select these 2 values\n )\n);\n\t\n\t\t\t\t\n\t\t\t$this->addElement('submit', 'submit', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t\t\t'label' => 'Submit',\n\t\t\t));\n\t\t\t\n\t\t\t// And finally add some CSRF protection\n\t\t\t$this->addElement('hash', 'csrf', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t));\t\n\t}", "public function add_new_subcategory($id){\n if(Category::exist_category($id)){\n $new_subcateg = SubCategory::new_register(Input::all(), $id);\n\n if($new_subcateg['error'] == true){\n\n Session::flash('danger', \"Problemas Al registrar. Revise los Campos que tienen error.\");\n return Redirect::back()->withErrors($new_subcateg['mensaje'])->withInput();\n\n }elseif($new_subcateg['error'] == false){\n\n $list = SubCategory::get_list_subcategory($id);\n Session::flash('list',$list);\n Session::flash('success', \"Al registrar la subcategoria.\");\n return Redirect::to('admin/subcategorias/listar/'.$id);\n\n }\n }else{\n return View::make('errors/404');\n }\n }", "public function addnew(){ // Function Declare for (Add New) \n \t\t\t$data['tab']='tab2';\n \t\t\t$data['prefixLN']='../';\n\t\t \t$data['prefix']='';\n\t\t\t\t$data['profile']= $this->mhome->get_profile_info();\t\n\t\t \t$this->load->view('controlpanel/left_nav',$data);//Showing (Left Nav) on ADD NEW page\n\t\t\t\t\n\t\t\t\t//$data['title']='Categories/Add New';//\n\t\t \t$data['title']='Categoriess';\n\t\n\t\t \t$data['t1']=array(\n\t\t \t\t\t'name'=> 'Categories',\n\t\t \t\t\t'url' => 'all'\n\n\t\t \t\t);\n\t\t \t$data['t2']=array(\n\t\t \t\t\t'name'=> 'New Category',\n\t\t \t\t\t'url' => 'addnew'\n\n\t\t \t\t);\n\t\t \n\t\t \t$data['t3']='';\n\t\t \t$data['t4']='';\n\t\t \t$data['t5']='';\n\t\t \t$data['t6']='';\n\t\t \t$data['t7']='';\n\n\n \t\t\t$data['s_tab']='s_tab2';\n\n \t\t\t//$data['category_code']='Category Code';\n \t\t\t$data['category_name']='Category Name';\n \t\t\t$data['category_img']='Category Image';\n \t\t\t$data['action']=site_url('controlpanel/Catg/create'); //Action for(Create) in controller\n \t\t\t//$data['des']='1';\n\t\t\t\t\n\t\t\t\t\n\n\n\n\n \t\t\t$this->load->view('controlpanel/cat_img',$data);//Showing (Menu View) on ADD NEW page\n \t\t\t\n \t\t}", "public function get_subcategory()\n\t{\n\t\tif($this->input->post('parent'))\n\t\t{\n\t\t\t$category = $_POST['parent'];\n\n\t\t\t$query = $this->db->get_where('ci_subcategories',array('parent' => $category));\n\n\t\t\tif($query->num_rows() > 0)\n\t\t\t{\n\t\t\t\t$rows = $query->result_array();\n\t\t\t\t$options = array('' => 'Seleccione una opción') + array_column($rows,'name','id');\n\t\t\t\t$html = form_dropdown('subcategory',$options,'','class=\"select2 form-control select-subcategory\" required onchange=\"filter_data()\"');\n\t\t\t\t$response = array('status' => 'success', 'msg' => $html);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$html = $this->fields->category_fields($category);\n\t\t\t\t$response = array('status' => 'fields', 'msg' => $html);\n\t\t\t}\n\n\t\t\techo json_encode($response);\n\t\t}\n\t}", "public function addPost(){\n\n if ($this->input->post(\"category_create\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n $categoryName = $this->input->post(\"category_name\");\n\n $this->validate->setRule(\"minlength\",$categoryName,3, \"Category name length must be more then 3 symbols!\");\n\n if ($this->validate->validate() === false){\n $error = $this->validate->getErrors();\n $this->view->redirect(\"/categories/manage\",$error);\n }\n\n $categoryModel = new CategoriesModel();\n try{\n if ($categoryModel->hasCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"This categories already exist!\");\n }\n\n if($categoryModel->addNewCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"Category created successfully!\",\"success\");\n }\n }catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception);\n }\n }", "public function createProductForm()\n {\n $subCategory = Category::where('parent_id','<>',NULL)->get();\n return view('admin.createProductForm',['subCate' => $subCategory]);\n }", "public function testUpdateItemSubCategory()\n {\n }", "public function manage($id = NULL)\n {\n if(($this->session->userdata('logged_in') != true) && ($this->session->userdata('logged_in_as') != 'admin'))\n {\n redirect('siteadmin', 'refresh');\n }\n \n $this->template->write('title', 'Boutique: Stock Information');\n \n $data['sections'] = $this->common_model->query_all_data('boutique_product_sections');\n \n if (!empty($id)) /* checks whether to edit data */\n {\n $data['form_title'] = 'Edit Category';\n $data['id'] = $id;\n $data['action'] = 'edit';\n \n $category_data = $this->common_model->query_single_row_by_single_source('boutique_categories', 'id', $id);\n foreach ($category_data as $sd)\n {\n $data['name'] = $sd->name;\n $data['product_section_id'] = $sd->product_section_id;\n }\n }\n else /* otherwise, config validation to add data */\n {\n $data['form_title'] = 'Add Category';\n $data['action'] = 'add';\n }\n \n $config = array(\n array('field' => 'name', 'label' => 'Category Name', 'rules' => 'trim|required|max_length[100]')\n );\n \n $this->form_validation->set_rules($config);\n \n if ($this->form_validation->run() == false)\n {\n /* Show the form */\n $this->template->write_view('main_content', 'category/manage', $data, TRUE);\n } //end main if\n else\n {\n /* when the form is submitted */\n \n if ($id == NULL)\n {\n \n /* adds the category */\n $user_data['id'] = '';\n $user_data['name'] = $this->input->post('name');\n $user_data['product_section_id'] = $this->input->post('product_section_id');\n $user_data['created_at'] = date('Y-m-d h:i:s');\n\n $category_id = $this->common_model->add_data('boutique_categories', $user_data);\n\n if ($category_id > 0)\n $this->session->set_flashdata('success_message','Category Added Successfuly.');\n else\n $this->session->set_flashdata('error_message','Could not add the category! Please try again later.');\n }//ends adding category\n else\n {\n /* gather info */\n $update_data['name'] = $this->input->post('name');\n $update_data['product_section_id'] = $this->input->post('product_section_id');\n \n /* updates info */\n if ($this->common_model->update_data('id', $id, 'boutique_categories', $update_data))\n $this->session->set_flashdata('success_message','Category Updated Successfuly.');\n else\n $this->session->set_flashdata('error_message','Could not update the category! Please try again later.');\n \n }//ends updating category\n \n /* redirects to list page */\n redirect('category', 'refresh');\n } //end main else\n\n\n $this->template->render();\n }", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "function ccategories_create()\n\t{\n\t\tlusers_require(\"categories/create\");\n\n\t\t$post_data = linput_post();\n\t\t$post_data = linput_post_checkbox($post_data, \"content\");\n\t\t$content = $post_data[\"content\"];\n\n\t\tif (hform_validate(array(\"name\", \"link\", \"parentid\")))\n\t\t{\n\t\t\t$cat_created = mcategories_create($post_data);\n\t\t\tif ($content) $content_created = mcontent_create($post_data);\n\t\t\telse $content_created = false;\n\n\t\t\tif (($cat_created && !$content) || ($content && $cat_created && $content_created))\n\t\t\t{\n\t\t\t\tlcache_delete_all();\n\t\t\t\thmessage_set(l(\"Category successfully created.\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($cat_created) mcategories_delete($post_data[\"link\"]);\n\t\t\t\tif ($content_created) mcontent_delete($post_data[\"link\"]);\n\t\t\t\thmessage_set(l(\"Category create error.\") . \" \" . l(\"Link already in use.\"));\n\t\t\t}\n\n\t\t\tluri_redirect(\"main/user/admin/categories\");\n\t\t}\n\t\telse luri_redirect(\"main/user/admin/categories_create\", l(\"All fields marked with * are required.\"));\n\t}", "function addExtraCategoryFields_editForm($tag) {\n\t\t$this->addExtraCategoryFields($tag, true);\n\t}", "function editSubCategory()\n\t{ \n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from products_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$sqlid=\"SELECT category_id,category_parent_id FROM category_table where category_id in(select category_id from products_table where category_id='\".$obj->records[0]['category_id'].\"')\";\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$category=Core_Settings_CManageProducts::displayCategory($query->records[0]['category_parent_id']);\n\t\t\t\n\t\t\t$sqlid='select category_id from category_table where category_id in(select sub_category_id from products_table where product_id='.$id.')';\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$subcat=Core_Settings_CManageProducts::displaySubCategory($query->records[0]['category_id']);\n\t\t\t\n\t\t\treturn $subcat;\n\t }\n\t}", "public function add_new_category_post(){\n $data = $this->security->xss_clean($_POST);\n $data = $this->DeviceCategory_model->add_new_category($data);\n if (isset($data['status']) == 'FALSE')\n {\n $this->response($data, REST_Controller::HTTP_SEE_OTHER);\n }\n $this->set_response($data, REST_Controller::HTTP_CREATED);\n }", "private function categoriesFormInputs()\n {\n // Get the field name of the field with the category icon\n // #47631, dwildt, 1-\n //$arrLabels[ 'catIcon' ] = $this->confMap['configuration.']['categories.']['fields.']['categoryIcon'];\n // #47631, #i0007, dwildt, 10+\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Default space in HTML code\n $tab = ' ';\n\n // FOREACH category label\n//$this->pObj->dev_var_dump( $this->arrCategories );\n // #i0118, dwildt, 1-/+\n //foreach ( $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n foreach ( ( array ) $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n {\n // Get the draft for an input field\n $cObj_name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input' ];\n $cObj_conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input.' ];\n $input = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // replace the category marker\n $input = str_replace( '###CAT###', $labelValue, $input );\n // 4.1.17, 120927, dwildt\n // replace the category marker\n //$labelValueWoSpc = str_replace( ' ', null, $labelValue );\n $labelValueWoSpc = $this->zz_properFormLabel( $labelValue );\n $input = str_replace( '###CAT_WO_SPC###', $labelValueWoSpc, $input );\n // 4.1.17, 120927, dwildt\n // #54548, 131221, dwildt, 6+\n $class = $this->arrCategories[ 'cssClass' ][ $labelKey ];\n if ( !empty( $class ) )\n {\n $class = ' class=\"' . $class . '\"';\n }\n $input = str_replace( '###CLASS###', $class, $input );\n\n // IF draft for an input field contains ###IMG###, render an image\n $pos = strpos( $input, '###IMG###' );\n if ( !( $pos === false ) )\n {\n // SWITCH : Render the image\n switch ( true )\n {\n // #i0062\n case( $labelKey == $this->arrWoCategories[ 'iconKey' ] ):\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n case( is_array( $this->arrCategories[ 'icons' ] ) ):\n // 4.1.7, dwildt, +\n $this->cObjDataAddArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n $img = $this->renderMapMarkerVariablesSystemItem( 'categoryIconLegend' );\n $this->cObjDataRemoveArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n // 4.1.7, dwildt, +\n break;\n default:\n // Render the image\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n }\n // SWITCH : Render the image\n\n $input = str_replace( '###IMG###', $img, $input );\n }\n // IF draft for an input field contains ###IMG###, render an image\n\n $arrInputs[] = $tab . $input;\n }\n // FOREACH category label\n // Move array of input fields to a string\n // #i0118, dwildt, 1-/+\n //$inputs = implode( PHP_EOL, $arrInputs );\n $inputs = implode( PHP_EOL, ( array ) $arrInputs );\n $inputs = trim( $inputs );\n\n // RETURN input fields\n return $inputs;\n }", "public function addform()\n {\n \n //$this->session_manager->validateFashion(__METHOD__);\n \n $data['cate'] = $this->promo->promoSliderOptionCuisine($by_id=null,$platform=1);\n $data['promo_duration'] = $this->promo->promoDurationOption();\n $data['admin_info'] = $this->promo->adminInfo();\n \n $data['title_type']= 'New Promo Form';\n $data ['content_file']= 'promo_new';\n $data['pageheader'] = \"Add Promo\";\n $data['breadCrumbs'] = '<li class=\"breadcrumb-item\"><a href=\"'.site_url(\"jollofadmin/promos\").'\">Promos</a></li> <li class=\"breadcrumb-item active\">Add Promo</li>';\n $data['mainmenu'] = \"promos\";\n $this->load->view('jollof_admin/layout', $data);\n }", "public function superadmin_add() {\n $this->set('meta_title','Add New Banner');\n\t\t\t$errors\t=\t'';\n\t\t\t// list of category\n\t\t\t\n\t\t\t\n\t\t\tif($this->request->is('post')) {\n\t\t\t\t// Form Submit Here\n\t\t\t\t$this->OtherBanner->set($this->request->data);\t\n\t\t\t\tif(!$this->OtherBanner->validates()){\t\t\n\t\t\t\t\t$errors = $this->OtherBanner->validationErrors; \n\t\t\t\t}\t\n\t\t\t\tif($errors) {\t\t\t\n\t\t\t\t\t$this->Set('errors',$errors);\n\t\t\t\t\t$this->set('data',$this->request->data);\n\t\t\t\t}else{ \n\t\t\t\t\t\t// No Errors\t\n\t\t\t\t\tApp::import('Vendor', 'Uploader.Uploader');\n\t\t\t\t\t$this->Uploader = new Uploader();\n\t\t\t\t\t$this->Uploader->setup(array('tempDir' => TMP,'uploadDir'=>'Banner/'));\n\t\t\t\t $fileUploadPath=$this->Uploader->upload($this->request->data['OtherBanner']['filename'],array('prepend'=>time().'_','overwrite'=>true));\n\t\t\t\t\t$this->Uploader->resize(array('width' => 150,'height' => 80,'prepend'=>'150x80_'.time().'_','append'=>false,'aspect'=>false,'expand'=>false));\n\t\t\t\t\t$this->request->data['OtherBanner']['filename'] \t= end(explode('/',$fileUploadPath['path']));\n\t\t\t\t\n\t\t\t\t\tif ($this->OtherBanner->save($this->request->data)) {\n\t\t\t\t\t\t$this->Session->write('popup','Banner has been added successfully.');\n\t\t\t\t\t\t$this->Session->setFlash('Banner has been added successfully.'); \n\t\t\t\t\t\t$this->redirect(array('controller'=>'other_banners','action' => \"index/message:success\"));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->Session->setFlash('Data save problem, Please try again.'); \n\t\t\t\t\t\t$this->redirect(array('controller'=>'other_banners','action' => \"add\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n \n\t}", "function add()\n { \n $this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('CatName','CatName','required');\n\t\t\n\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t'CatName' => $this->input->post('CatName'),\n );\n \n $productcat_id = $this->Productcat_model->add_productcat($params);\n redirect('admin/productcat/index');\n }\n else\n { \n $data['_view'] = 'admin/productcat/add';\n $this->load->view('admin/layouts/main',$data);\n }\n }", "protected function definition() {\n $mform = $this->_form;\n\n if (isset($this->_customdata['categoriesarray'])) {\n $this->set_categories_array($this->_customdata['categoriesarray']);\n } else {\n return;\n }\n\n if (isset($this->_customdata['defaultcategory'])) {\n $this->set_default_category($this->_customdata['defaultcategory']);\n } else {\n return;\n }\n\n $options = array(\n 'multiple' => false,\n );\n\n $categorieslistraw = $this->get_categories_array();\n\n $defaultcategory = $this->get_default_category();\n\n $categorieslistdefault = array_intersect_key($categorieslistraw, array_flip([$defaultcategory]));\n\n // Make sure that the default category was found, before unsetting it in the original array.\n if (isset($categorieslistdefault[$defaultcategory])) {\n unset($categorieslistraw[$defaultcategory]);\n }\n\n $categorieslist = $categorieslistdefault + $categorieslistraw;\n\n $mform->addElement(\n 'autocomplete',\n 'sel_cate',\n get_string('selectcategorybanner', 'local_course_templates'),\n $categorieslist,\n $options\n );\n\n $mform->addRule('sel_cate', get_string('requiredelement', 'form'), 'required', null, 'client');\n $mform->addRule('sel_cate', get_string('requiredelement', 'form'), 'required', null, 'server');\n\n // When there are two elements, we need a group.\n $buttonarray = array();\n $buttonarray[] = &$mform->createElement(\n 'button',\n 'back',\n get_string('back', 'local_course_templates'),\n array('onclick' => 'javascript :history.back(-1)')\n );\n $buttonarray[] = &$mform->createElement(\n 'submit',\n 'coursecategorieslistsubmit',\n get_string('continue', 'local_course_templates')\n );\n $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);\n\n $mform->closeHeaderBefore('buttonar');\n }", "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}", "public static function func_ajax_add_category() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n $self = self::sanitize($_POST['name']);\n $day = self::sanitize($_POST['day']);\n $desc = self::sanitize($_POST['description']);\n $wpdb->query($wpdb->prepare( \"INSERT INTO \".$wpdb->prefix.self::$table_name .\" VALUES (%d, %s, %s, %s)\", null, $self,$day,$desc ));\n die();\n\t\t\t\t}\n\t\t\n\t\t}", "function classiera_implement_ajax(){\t\t\r\n\tif(isset($_POST['mainCat'])){\r\n\t\t$mainCatSlug = $_POST['mainCat'];\r\n\t\t$mainCatIDSearch = get_category_by_slug($mainCatSlug);\r\n\t\t$mainCatID = $mainCatIDSearch->term_id;\r\n\t\t$cat_child = get_term_children($mainCatID, 'category' );\r\n\t\tif (!empty($cat_child)) {\t\r\n\t\t\t$categories= get_categories('child_of='.$mainCatID.'&hide_empty=0');\r\n\t\t\t foreach ($categories as $cat) {\t\t\t\t\r\n\t\t\t\t$option .= '<option value=\"'.$cat->slug.'\">';\r\n\t\t\t\t$option .= $cat->cat_name;\t\t\t\t\r\n\t\t\t\t$option .= '</option>';\r\n\t\t\t }\r\n\t\t\t echo '<option value=\"-1\" selected=\"selected\" disabled=\"disabled\">'.esc_html__( \"Select Sub Category..\", \"classiera\" ).'</option>'.$option;\r\n\t\t\tdie();\r\n\t\t}else{\r\n\t\t\techo '<option value=\"-1\" disabled=\"disabled\">'.esc_html__( \"No Sub Category Found\", \"classiera\" ).'</option>';\r\n\t\t}\r\n\t} // end if\r\n}", "function add_categories(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function add_category() /// get routes of the form add cateogry\n {\n return view('admin.categories.add-category');\n }", "public function main_categories()\n\t{ \n\t\tif ($this->input->is_ajax_request()) {\n\t\t\t$main_categories = $this->cat_model->GetWhere(\"categories\", \"title\", \"ASC\", array('main_cat_id'=>0)); \n\n\t\t\tif (isset($main_categories) && count($main_categories) != 0) {\n\t\t\t\t$id_num=0;\n\t\t\t\t$id=\"sub_cat_id\".$id_num;\n\t\t\t\t$div=\"div_\".$id_num;\n\t\t\t\techo '<select id=\"'.$id.'\" onclick=\"get_sub_category('.$id_num.');\">'; \n\t\t\t\techo '<option disabled selected>Select main category</option>';\n\n\t\t\t\tforeach ($main_categories as $cat) { \n\t\t\t\t\techo '<option value=\"'.$cat->id.'\">'.$cat->title.'</option>';\n\t\t\t\t}\n\n\t\t\t\techo '</select><div id=\"'.$div.'\"> </div><br>';\n\n\n\t\t\t}\n\t\t}\n\n\n\t}", "public function add_sub_admin_form()\n\t{\n\t\tif ($this->checkLogin('A') == '') \n\t\t{\n\t\t\tredirect('admin');\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$this->data['heading'] = 'Add Sub-Admin';\n\t\t\t$condition = array();\n\t\t\t$this->load->view('admin/subadmin/add_subadmin', $this->data);\n\t\t}\n\t}", "public function add_cat() { \n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\tdie();\n\t\t}\n\t\t$main_cat_id = $this->input->post('main_cat_id');\n\t\t$title = $this->input->post('title'); \n\n\n\t\t$array_data['main_cat_id'] = $main_cat_id ; \n\t\t$array_data['title'] = $title ; \n\t\t$this->db->insert(\"categories\" , $array_data); \n\t\t$result = array('statu' => 'ok');\n\t\techo json_encode($result);\n\n\t}", "public function store()\n {\n $categories = Category::all();\n\n $subcategory = new Subcategory;\n $subcategory->name = request('name');\n foreach($categories as $category){\n if($category->name == request('cat')){\n $subcategory->categories_id = $category->id;\n }\n }\n $subcategory->save();\n\n return redirect('/cms/categories')->with('success', 'Subcategory was added succesfully');\n }", "public function add() {\n\n if ($this -> input -> server('REQUEST_METHOD') == 'POST') {\n \n //Add Advertisement \n if(!$this -> input -> post('home_page'))\n {\n $this -> form_validation -> set_rules('MainCategoryId', 'Category', 'trim|required|xss_clean');\n } \n $this -> form_validation -> set_rules('AdvertisementTitle', 'Advertisement Title', 'trim|required|xss_clean'); \n $this -> form_validation -> set_rules('AdvertisementDescription', 'Description', 'trim|required|xss_clean'); \n $this -> form_validation -> set_rules('AdvertisementUrl', 'Advertisement Url', 'trim|required|xss_clean'); \n $this -> form_validation -> set_rules('StartDate', 'Start date', 'trim|required|xss_clean');\n $this -> form_validation -> set_rules('EndDate', 'End Date', 'trim|required|xss_clean');\n \n $client_type = $this -> input -> post('client_type');\n \n if($client_type == 'new' )\n {\n $this -> form_validation -> set_rules('CompanyName', 'Company Name', 'trim|required|xss_clean');\n $this -> form_validation -> set_rules('ClientEmail', 'Client Email', 'trim|required|xss_clean');\n $this -> form_validation -> set_rules('ContactNumber', 'Contact Number', 'trim|required|xss_clean');\n $this -> form_validation -> set_rules('ContactPerson', 'Contact Person', 'trim|required|xss_clean');\n }else if($client_type == 'existing' ){ \n $this -> form_validation -> set_rules('RetailerId', 'Retailer', 'trim|required|xss_clean');\n $this -> form_validation -> set_rules('StoreTypeId', 'Store Format', 'trim|required|xss_clean');\n $this -> form_validation -> set_rules('StoreId', 'Store', 'trim|required|xss_clean'); \n }\n\n if (!$this -> form_validation -> run() == FALSE) {\n\n $result = array();\n $image_path = \"\";\n\n //If image uploaded\n if (!empty($_FILES['AdvertisementImage']['name'])) {\n $result = $this -> do_upload('AdvertisementImage', 'advertisements', $this -> input -> post('image-x'), $this -> input -> post('image-y'), $this -> input -> post('image-width'), $this -> input -> post('image-height'));\n $image_path = $result['upload_data']['file_name'];\n }\n if (!isset($result['error'])) {\n $data = array(\n 'MainCategoryId' => $this -> input -> post('MainCategoryId'),\n 'AdvertisementTitle' => $this -> input -> post('AdvertisementTitle'),\n 'AdvertisementDescription' => $this -> input -> post('AdvertisementDescription'), \n 'AdvertisementUrl' => $this -> input -> post('AdvertisementUrl'), \n 'StartDate' => $this -> input -> post('StartDate'),\n 'EndDate' => $this -> input -> post('EndDate'), \n 'AdvertisementImage' => $image_path,\n 'home_page' => $this -> input -> post('home_page'),\n 'ClientType' => $this -> input -> post('client_type'),\n 'CompanyName' => $this -> input -> post('CompanyName'),\n 'ClientEmail' => $this -> input -> post('ClientEmail'),\n 'ContactNumber' => $this -> input -> post('ContactNumber'),\n 'ContactPerson' => $this -> input -> post('ContactPerson'),\n 'RetailerId' => $this -> input -> post('RetailerId'),\n 'StoreTypeId' => $this -> input -> post('StoreTypeId'),\n 'StoreId' => $this -> input -> post('StoreId'),\n 'CreatedBy' => $this -> session -> userdata('user_id'),\n 'CreatedOn' => date('Y-m-d H:i:s'),\n 'IsActive' => 1\n );\n $result = $this -> advertisementsmodel -> add_advertisement($data);\n if ($result) {\n $this -> session -> set_userdata('success_message', \"Advertisement added successfully\");\n $this -> result = 1;\n $this -> message = 'Advertisement added successfully';\n }else {\n $this -> session -> set_userdata('error_message', \"Failed to add advertisement\");\n $this -> result = 0;\n $this -> message = 'Failed to add advertisement';\n }\n redirect('/advertisements', 'refresh');\n exit(0);\n }\n else { \n // code to display error while image upload\n $this -> session -> set_userdata('error_message', $result['error']);\n $this -> result = 0;\n $this -> message = $result['error'];\n }\n }else{\n //echo validation_errors();\n }\n }\n\n $this -> breadcrumbs[0] = array('label' => 'Ads Management', 'url' => '');\n $this -> breadcrumbs[1] = array('label' => 'Advertisements', 'url' => '/advertisements');\n $this -> breadcrumbs[2] = array('label' => 'Add Advertisement', 'url' => 'advertisements/add');\n\n $data['title'] = $this -> page_title;\n $data['breadcrumbs'] = $this -> breadcrumbs;\n \n $data['main_categories'] = $data['parent_category'] = $data['sub_category'] = array();\n $data['main_categories'] = $this -> categorymodel -> get_main_categories();\n $data['retailers'] = $this -> retailermodel -> get_retailers();\n \n $this -> template -> view('admin/advertisements/add', $data);\n }", "public function addSubC($id) {\n\n\t return Redirect::to('admin/category?caseC=addSubC&IdC='.$id);\n\n\t }", "function editMainCategory()\n\t{ \n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from products_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$sqlid=\"SELECT category_id,category_parent_id FROM category_table where category_id in(select category_id from products_table where category_id='\".$obj->records[0]['category_id'].\"')\";\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$sql1 = \"SELECT category_id,category_name FROM category_table where category_parent_id=0\";\n\t\t\n\t\t\t$query1 = new Bin_Query();\n\t\t\n\t\t\t$query1->executeQuery($sql1);\n\t\t\n\n\t\t\treturn Display_DManageProducts::displayCategory($query1->records,$query->records[0]['category_id']);\n\t\t\t\n\t\t// \t\t\treturn $category;\n\t }\n\t}", "public function AddField()\n {\n echo 'Создалась VirtualCategory - метод Field <hr>';\n }", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function add()\n\t{\n\t\t$data[\"icons\"] = $this->M_Icon->getAll();\n\t\t$data[\"title\"] = 'Tambah Kategori';\n\n\t\t$validation = $this->form_validation;\n\n\t\t$rules = [\n\t\t\t[\n\t\t\t\t'field' => 'kategori',\n\t\t\t\t'rules' => 'required'\n\t\t\t],\n\t\t\t[\n\t\t\t\t'field' => 'deskripsi',\n\t\t\t\t'rules' => 'required'\n\t\t\t]\n\t\t];\n\n\t\t$validation->set_rules($rules);\n\n\t\tif ($validation->run()) {\n\t\t\t$this->kategori_model->save();\n\t\t\t$this->session->set_flashdata('stsMessage', 'Data Berhasil disimpan');\n\t\t\tredirect('Kategori');\n\t\t}\n\n\t\t$this->load->view(\"admin/kategori/new_form\", $data);\n\t}", "public function addnewfield($catgId=NULL){\n\t\t\tif($this->session->userdata('loggedIn_adminInfo')=='')redirect('admincp'); //checks if admin is logged-in or not if not redirect on login page\n\t\t\t\n\t\t\tif($catgId=='' || $catgId==NULL){\n\t\t\t\t\t\t\t\t\t$this->session->set_flashdata('admincp_promotionfieldlist_flash_message', '<div class=\"alert alert-info alert-dismissible\">\n\t\t\t\t\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>\n\t\t\t\t\t\t\t\t\t<i class=\"icon fa fa-info\"></i> <b>Important: </b>You need to add category first.</div>');\n\t\t\t\t\tredirect('admincp/promotion/addnew');\t\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$promotionID\t\t\t\t= \tstr_replace(array('-', '_', '~'), array('+', '/', '='),$catgId);\n\t\t\t\t$data['promotionInfo']\t\t=\t$this->base_model->is_Record_Exists('tbl_promotion_mastercategory','',array('id'=>$this->encrypt->decode($promotionID)));\t\n\t\t\t\t$data['hdnPromotionID']\t\t=\t'';\n\t\t\t\t$data['hdnFieldID']\t\t\t=\t'';\n\t\t\t\tif(!empty($data['promotionInfo'])){\n\t\t\t\t\t$data['ref_hdnPromotionID']\t\t=\t$catgId;\t\t\t\t\t\n\t\t\t\t\t$data['title'] \t\t\t\t\t= \t'Projects 100K';\n\t\t\t\t\t$postedValue_fname \t\t\t\t= \tarray();\n\t\t\t\t\tif($this->session->userdata('post_promotionFieldData'))\n\t\t\t\t\t$data['postedValue'] \t\t\t= \t$this->session->userdata('post_promotionFieldData');\n\t\t\t\t\t$data['promotionFieldInfo']\t\t=\tarray();\n\t\t\t\t\t$last_order\t=\t$this->base_model->is_Record_Exists('tbl_promotion_masterfields',array('order'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('promotionCategoryId'=>$data['promotionInfo']->id),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'order','desc','0','1'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif(!empty($last_order))\n\t\t\t\t\t$data['visibility_order']\t=\t$last_order->order+1;\n\t\t\t\t\telse\n\t\t\t\t\t$data['visibility_order']\t=\t1;\t\n\t\t\t\t\t$this->load->view('templates/admincp/header', $data);\n\t\t\t\t\t$this->load->view('admincp/promotion/categoryBannerForm', $data);\n\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->session->set_flashdata('admincp_promotionfieldlist_flash_message', '<div class=\"alert alert-info alert-dismissible\">\n\t\t\t\t\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>\n\t\t\t\t\t\t\t\t\t<i class=\"icon fa fa-info\"></i> <b>Important: </b>Url &amp; Banner category does not exists for which you are trying to add new fields.</div>');\n\t\t\t\t\tredirect('admincp/promotion/edit/'.$catgId);\t\n\t\t\t\t}\n\t\t\t}\n\t\t}", "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 ProcessMultilevelSubCategories()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"ProcessMultilevelSubCategories();\" . \"<HR>\";\n if ($this->listSettings->HasItem(\"MAIN\", \"SUB_CATEGORIES_COUNT\")) {\n $this->sub_categories_count = $this->listSettings->GetItem(\"MAIN\", \"SUB_CATEGORIES_COUNT\");\n for ($i = 0; $i < $this->sub_categories_count; $i ++) {\n $sub_category = array();\n if ($this->listSettings->HasItem(\"SUB_CATEGORY_\" . $i, \"APPLY_LIBRARY\")) {\n $sub_category[\"library\"] = $this->listSettings->GetItem(\"SUB_CATEGORY_\" . $i, \"APPLY_LIBRARY\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_SUB_CATEGORY_LIBRARY\", array(\n $i), true);\n }\n if ($this->listSettings->HasItem(\"SUB_CATEGORY_\" . $i, \"LINK_FIELD\")) {\n $sub_category[\"link_field\"] = $this->listSettings->GetItem(\"SUB_CATEGORY_\" . $i, \"LINK_FIELD\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_SUB_CATEGORY_LINK_FIELD\", array(\n $i), true);\n }\n $this->sub_categories[] = $sub_category;\n }\n\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_SUB_CATEGORIES_COUNT\", array(), true);\n }\n\n }" ]
[ "0.82134324", "0.699833", "0.6962463", "0.67629516", "0.6686701", "0.6632237", "0.659526", "0.6575569", "0.65673053", "0.6563907", "0.65521944", "0.65497583", "0.6528963", "0.65132064", "0.6493462", "0.6481833", "0.6466463", "0.64642113", "0.6421452", "0.6395452", "0.6393261", "0.6385302", "0.6381368", "0.63725555", "0.6366551", "0.6352657", "0.6344333", "0.63431525", "0.63225067", "0.63206893", "0.6304237", "0.63003916", "0.6292835", "0.62775755", "0.62530446", "0.62499213", "0.62497735", "0.6247885", "0.6235142", "0.6234191", "0.6220835", "0.6220668", "0.6220596", "0.62181336", "0.6213132", "0.6186838", "0.6184617", "0.6183394", "0.6181317", "0.61763346", "0.6175906", "0.61730385", "0.6170168", "0.61582303", "0.6149202", "0.6133928", "0.61186653", "0.6118523", "0.6108739", "0.6106454", "0.6104008", "0.6103475", "0.6099277", "0.60726625", "0.60691357", "0.60674363", "0.60571456", "0.60560614", "0.60483974", "0.60471463", "0.6043462", "0.60412127", "0.604115", "0.6034509", "0.6022393", "0.60114866", "0.6009152", "0.6002174", "0.59986556", "0.5993701", "0.5992046", "0.5982992", "0.5979844", "0.5975633", "0.59658366", "0.5964987", "0.59616834", "0.5947373", "0.5942081", "0.5940988", "0.5940674", "0.59380966", "0.5934692", "0.593121", "0.5925723", "0.592489", "0.5912792", "0.5908954", "0.59065044", "0.5903829" ]
0.8335337
0
end add sub category form.............................................................................
public function submitButton(){ $this->addElement('button', 'bttnsubmit', array ( 'class' => 'btn blue ', 'ignore'=>true, 'type'=>'submit', 'label'=>'<i class="fa fa-check"></i> Save', 'escape'=>false )); $this->bttnsubmit->setDecorators(array('ViewHelper',array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' =>'form-actions text-right')) )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function subcategory(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t$caterories = $modelservices->categorydata();\n\t//prd($caterories);\n\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Sub Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t$this->addElement('text', 'service_price', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required digits',\n\t\t\t\"label\" => \"Service Credit \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Price is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"onchange\"=>\"getcategorylist(this.value)\",\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n\t\t$this->addElement('select', 'service_sub_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$caterories,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "function addAction()\n\t{\n global $langCode;\n\t\t$error \t= array();\n\t\t$success \t= array();\n\t\t$contents \t= '';\n\t\t$formData \t= array();\n\t\t\n\t\t$parentid = (int)($this->registry->router->getArg('parentid'));\n\t\tif($parentid > 0)\n\t\t\t$formData['fparentid'] = $parentid; \n\t\t\n\t\tif(!empty($_POST['fsubmit']))\n\t\t{\n if($_SESSION['productcategoryAddToken']==$_POST['ftoken'])\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->addActionValidator($formData, $error))\n {\n $myProductCat = new Core_ProductCategory();\n //thong tin khong lien quan ngon ngu\n $myProductCat->name = $formData['fname'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n //Neu nguoi dung nhap SeoUrl thi xu li dau cua chuoi nguoi dung nhap \n //Truong hop nguoi dung khong nhap thi chung ta lay idtext de thay the!!!!!\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'][$langCode]), true);\n //cac thong tin lien quan ngong ngu\n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n if($myProductCat->addData())//them vao database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succAdd']);\n $this->registry->me->writelog('ProductCategoryadd', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n $formData = array('fparentid' => $formData['fparentid']); \n }\n else\n {\n $error[] = $this->registry->lang['controller']['errAdd']; \n }\n }\n }\n $_SESSION['productcategoryAddToken']=Helper::getSecurityToken();//Tao token moi\n\t\t}\n\t\t\n\t\t\n\t\t$this->registry->smarty->assign(array(\t'formData' \t\t=> $formData,\n\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'redirectUrl'\t=> $this->getRedirectUrl(),\n\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t'success'\t\t=> $success,\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'add.tpl');\n\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategoryadd',\n\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_add'],\n\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t}", "public function admin_add() \r\n {\r\n\r\n \t// setting the layout for admin\r\n \t$this->layout = 'admin';\r\n \t\r\n \tif (!empty($this->data)) \r\n \t{\r\n \t\t$this->Product->create();\r\n \t\t\r\n \t\tif ($this->Product->save($this->data)) \r\n \t\t{\r\n \t\t\t$this->Session->setFlash(__('The product has been saved', true));\r\n \t\t\t$this->redirect(array('action' => 'index'));\r\n \t\t} \r\n \t\telse \r\n \t\t{\r\n \t\t\t$this->Session->setFlash(__('The product could not be saved. Please, try again.', true));\r\n \t\t}\r\n \t}\r\n \t\r\n\t\t$categories = $this->Product->Category->find('list');\r\n\t\r\n\t\t$firstCategories = $this->Product->Category->find('first');\r\n\t\r\n\t\t// getting the subcategories for first category which is displaying by default\r\n\t\t$subCategoriesArray = $this->Product->SubCategory->find('list',array('conditions'=>array('SubCategory.category_id'=>$firstCategories['Category']['id'])));\r\n\t\r\n\t\t$subCategories[] = 'Please select';\r\n\t\tforeach ($subCategoriesArray as $key => $subCat) \r\n\t\t{\r\n\t\t\t$subCategories[$key] = $subCat;\r\n\t\t}\r\n\r\n\t\t$this->set(compact('categories', 'subCategories'));\r\n\r\n }", "public function add()\n\t{\n if ($this -> request -> is('post')) {\n\n // Get the data from post request\n $sub_category = $this->data;\n \n\n // Add SubCategory\n if ($this->SubCategory->save($sub_category)) {\t\n // Display success message and redirect\n\n App::import('Model', 'ConnectionManager');\n $con = new ConnectionManager;\n $cn = $con->getDataSource('default');\n /* User table schema */\n $sql = \"CREATE TABLE IF NOT EXISTS \".$sub_category['SubCategory']['app_table_name'].\"(\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `title` varchar(100) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci NOT NULL,\n `title2` varchar(100) CHARACTER SET utf8 NOT NULL,\n `title3` varchar(100) CHARACTER SET utf8 NOT NULL,\n `catid` int(250) NOT NULL,\n `sub_catid` int(250) NOT NULL,\n `content` longtext COLLATE utf8_unicode_ci NOT NULL,\n `short_desc` text COLLATE utf8_unicode_ci,\n `image` varchar(250) COLLATE utf8_unicode_ci NOT NULL,\n `video` varchar(250) COLLATE utf8_unicode_ci NOT NULL,\n `active` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0-Inactive, 1-Active',\n `app_active` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0-Inactive, 1-Active',\n `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n `created_by` int(250) NOT NULL,\n `modified_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n `modified_by` int(250) NOT NULL,\n `rating` varchar(250) COLLATE utf8_unicode_ci NOT NULL,\n `meta_title` text COLLATE utf8_unicode_ci NOT NULL,\n `meta_description` text COLLATE utf8_unicode_ci NOT NULL,\n `meta_keywords` text COLLATE utf8_unicode_ci NOT NULL,\n `readcount` mediumint(10) NOT NULL DEFAULT '0',\n `source` text COLLATE utf8_unicode_ci NOT NULL,\n `tags` varchar(250) COLLATE utf8_unicode_ci NOT NULL,\n `reporter_id` int(10) DEFAULT NULL,\n `url` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,\n `priority` bigint(50) NOT NULL DEFAULT '0',\n `top_story` enum('1','0') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',\n `gs_top_story` enum('1','0') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',\n `news_prio` bigint(50) NOT NULL,\n `magegin_news_prio` bigint(50) NOT NULL,\n `schedule_time` datetime NOT NULL,\n `fb_flag` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0' COMMENT '0= Not Posted, 1 = Posted',\n `sp_pg_flag` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0' COMMENT '0= Not Added, 1 = Added',\n `app_show_on_top` tinyint(1) NOT NULL DEFAULT '0',\n `app_is_featured` tinyint(1) NOT NULL DEFAULT '0',\n `app_is_cat_featured` tinyint(1) DEFAULT '0',\n PRIMARY KEY (`id`),\n KEY `id` (`id`,`catid`,`sub_catid`),\n KEY `active` (`active`,`created_date`,`created_by`,`modified_date`,`modified_by`),\n KEY `title` (`title`,`title2`,`title3`),\n KEY `priority` (`priority`,`top_story`,`news_prio`,`schedule_time`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='SubCategory \".$sub_category['SubCategory']['app_table_name'].\" Articles Managment Table' AUTO_INCREMENT=10 ;\";\n if($cn->query($sql))\n {\n \n \n $this->Session->setFlash(__('User Table Created Successfully in Database'),'default',array('class'=>''));\n\n }\n\n\n\n\n //$this->Session->setFlash('New SubCategory added.', 'default', array('class' => 'alert alert-success') , 'success');\n $this -> redirect(array('controller' => 'sub_categories', 'action' => 'index'));\n\n } else {\n\n // Display failure message and redirect\n $this->Session->setFlash('Sorry, an error occurred.', 'default', array('class' => 'alert alert-danger') , 'error');\n $this -> redirect(array('controller' => 'sub_categories', 'action' => 'index'));\n }\n\n } else {\n\t\t $cat_list=$this->Category->find(\"list\",array(\"conditions\"=>array(\"active\"=>1)));\n $this->set('cat_list',$cat_list);\n }\n\n // Set the view variables to controller variable values and layout for the view\n $this -> layout = 'base_layout';\n\t}", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function sub_categories()\n\t{ \n\n\t\tif ($this->input->is_ajax_request()) {\n\t\t\t$main_cat_id = $_POST['main_cat_id'];\n\n\t\t\t$sub_categories = $this->cat_model->GetWhere(\"categories\", \"title\", \"ASC\", array('main_cat_id'=> $main_cat_id)); \n\n\t\t\tif (isset($sub_categories) && count($sub_categories) != 0) {\n\t\t\t\t$id=\"sub_cat_id\".$main_cat_id;\n\t\t\t\t$div=\"div_\".$main_cat_id;\n\t\t\t\techo '<select id=\"'.$id.'\" onclick=\"get_sub_category('.$main_cat_id.');\">';\n\t\t\t\techo '<option disabled selected>Select Sub category</option>';\n\n\t\t\t\tforeach ($sub_categories as $cat) {\t\t\t\t\n\t\t\t\t\techo '<option value=\"'.$cat->id.'\">'.$cat->title.'</option>';\n\t\t\t\t}\n\t\t\t\techo '</select><div id=\"'.$div.'\"> </div><br>';\n\n\n\t\t\t}\n\n\n\t\t} \n\t}", "function add_category() {\r\n\r\n\tif(isset($_POST['addcategory'])){\r\n\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\tif(empty($_POST['cat_parent_id'])){$cat_parent_id\t\t= \"0\";}\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\t\r\n\r\n\t\t$xyquery = \"INSERT INTO categories (\";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"cat_name \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",cat_desc_short \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",cat_desc_long \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",cat_url\";}\r\n\t\t$xyquery .= \",cat_date\";\r\n\t\t$xyquery .= \",cat_mod\";\r\n\t\t$xyquery .= \",cat_mod_by\";\r\n\t\tif (!empty($page_template)){$xyquery .= \",page_template\";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",cat_meta_title\";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",cat_meta_keywords\";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",cat_meta_description\";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \") VALUES ( \";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"'$cat_name' \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",'$cat_desc_short' \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",'$cat_desc_long' \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",'$cat_parent_id' \";\t}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",'0' \";\t}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",'$cat_url' \";}\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",'$cat_mod_by' \";\r\n\t\tif (!empty($page_template)){$xyquery .= \",'$page_template' \";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",'$cat_meta_title' \";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",'$cat_meta_keywords' \";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",'$cat_meta_description' \";}\r\n\t\tif (!empty($insert_keywords)){$xyquery .= \",'$insert_keywords' \";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \" )\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" has been created!</h4></center>\";\r\n\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been created.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "public function testUpdateItemSubCategory()\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 }", "public function servicecat(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t//prd($servicelist);\n\t\t\t\t\t\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \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 }", "public function get_add_form($cat_id) {\n\n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\tdie();\n\t\t}\n\n\t\t$category_detailes = $this->cat_model->GetWhere(\"categories\", \"title\", \"ASC\", array('id'=>$cat_id)); \n\t\t\tif (isset($category_detailes) && count($category_detailes) != 0) { \n\t\t\t\tforeach ($category_detailes as $cat) { \n\t\t\t\t\t$title= $cat->title ;\n\t\t\t\t} \n\t\t\t}\n\n\t\t$content = \"<div style='background-color:#ddd' clas='table-responsive ls-table'><table class='table table-responsive table-bordered table-hover' ><tr>\";\n\n\n\t\t$content .= \" <td><input type='hidden' id='main_cat_id' value='$cat_id'> \n\t\t<input type='text' style='width: 98%;' id='title' placeholder='title' ><br><br>\";\n\n\n\t\t$content .= \"</tr></table> \n\t\t</div>\";\n\t\tif($cat_id==0){\n\n\t\t$result = array('title' => \"<b>Add main category </b>\", \"content\" => $content); \n\t\t}else{\n\n\t\t$result = array('title' => \"<b>Add sub category to \".$title.\"</b>\", \"content\" => $content); \n\t\t}\n\n\t\techo json_encode($result);\n\t}", "public function add_acct_sub_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\t\t\t//Get Decision who in online?\n\t\t$user = loggedInUserData();\n\t\t$userID = $user['user_id'];\n\t\tif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\t\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_sub_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_type', 'Accounts Type', 'required|trim');\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\t\t\t\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_sub_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Sub-Accounts Created under Category Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n//$mydata = $this->category_model->getmainCat();\n//echo \"<pre>\";\n//print_r($mydata);\n//echo \"</pre>\";\n//$data['row'] = $mydata;\n\t//$this->load->view('add_acct_sub_category',$data);\n\t//---$this->load->view('add_acct_sub_category');\n\t\ttheme('add_acct_sub_category', $data);\n\t}", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "function editSubCategory()\n\t{ \n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from products_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$sqlid=\"SELECT category_id,category_parent_id FROM category_table where category_id in(select category_id from products_table where category_id='\".$obj->records[0]['category_id'].\"')\";\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$category=Core_Settings_CManageProducts::displayCategory($query->records[0]['category_parent_id']);\n\t\t\t\n\t\t\t$sqlid='select category_id from category_table where category_id in(select sub_category_id from products_table where product_id='.$id.')';\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$subcat=Core_Settings_CManageProducts::displaySubCategory($query->records[0]['category_id']);\n\t\t\t\n\t\t\treturn $subcat;\n\t }\n\t}", "function addPostCategory(){\n\t\t$this->check_permission();\n\t \t\n\t\t\n\t \t$this->load->library('form_validation');\n\t\t$this->form_validation->set_rules('category_parent_id','Category','is_unique[tbl_category.category_title]|required');\n\t\t$this->form_validation->set_rules('category_title','Category Title','is_unique[tbl_category.category_title]|required');\n\t\t\n\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t'display_in_menu' => $this->input->post('display_in_menu'),\n\t\t\t\t'category_parent_id' => $this->input->post('category_parent_id'),\n\t\t\t\t'category_title' => $this->input->post('category_title'),\n\t\t\t\t'status' => $this->input->post('status'),\n\t\t\t\t'createdby' => $this->session->userdata('id'),\n\t\t\t\t'createdon' => date_timestamp_get(date_create()),\n );\n \n $category_id = $this->Post_model->insert_data('tbl_post_category',$params);\n if($category_id){\n\t\t\t$this->session->set_flashdata('msg', '<div class=\"alert alert-success\">record Added!</div>');\n\t\t\tredirect('secure/post/addpostcategory');\n\t\t\t}\n }\n else\n {\t\t\t$data['all_categorylist'] = $this->Post_model->get_post_categorylist();\n \n \n\t\t\t$this->render_template('secure/post/addPostCategory',$data);\n }\n\t}", "public function add_sub()\n\t{\n\t\tif($this->input->post('add_sub') != FALSE)\n\t\t{\n\t\t\t$this->todo->add_group();\n\n\t\t\t//Redirect to the group list\n\t\t\t$this->todo->redirect_303('group/manage');\n\t\t}\n\t}", "function ProcessMultilevelSubCategories()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"ProcessMultilevelSubCategories();\" . \"<HR>\";\n if ($this->listSettings->HasItem(\"MAIN\", \"SUB_CATEGORIES_COUNT\")) {\n $this->sub_categories_count = $this->listSettings->GetItem(\"MAIN\", \"SUB_CATEGORIES_COUNT\");\n for ($i = 0; $i < $this->sub_categories_count; $i ++) {\n $sub_category = array();\n if ($this->listSettings->HasItem(\"SUB_CATEGORY_\" . $i, \"APPLY_LIBRARY\")) {\n $sub_category[\"library\"] = $this->listSettings->GetItem(\"SUB_CATEGORY_\" . $i, \"APPLY_LIBRARY\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_SUB_CATEGORY_LIBRARY\", array(\n $i), true);\n }\n if ($this->listSettings->HasItem(\"SUB_CATEGORY_\" . $i, \"LINK_FIELD\")) {\n $sub_category[\"link_field\"] = $this->listSettings->GetItem(\"SUB_CATEGORY_\" . $i, \"LINK_FIELD\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_SUB_CATEGORY_LINK_FIELD\", array(\n $i), true);\n }\n $this->sub_categories[] = $sub_category;\n }\n\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_SUB_CATEGORIES_COUNT\", array(), true);\n }\n\n }", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function addcategories()\n\t{\n\t if(_is_user_login($this)){\n\t \n $data[\"error\"] = \"\";\n \n if(isset($_REQUEST[\"addcatg\"]))\n {\n $this->load->library('form_validation');\n $this->form_validation->set_rules('cat_title', 'Categories Title', 'trim|required');\n $this->form_validation->set_rules('parent', 'Categories Parent', 'trim|required');\n \n if ($this->form_validation->run() == FALSE)\n \t\t{\n \t\t if($this->form_validation->error_string()!=\"\"){\n \t\t\t $data[\"error\"] = '<div class=\"alert alert-warning alert-dismissible\" role=\"alert\">\n <i class=\"fa fa-warning\"></i>\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>\n <strong>Warning!</strong> '.$this->form_validation->error_string().'\n </div>';\n }\n \t\t}\n \t\telse\n \t\t{\n $this->load->model(\"category_model\");\n \n $slug = url_title($this->input->post('cat_title'), 'dash', TRUE);\n $parentid = $this->input->post(\"parent\");\n $addcat = array(\n \"type\"=>$this->input->post(\"type\"),\n \"title\"=>$this->input->post(\"cat_title\"),\n \"slug\"=>$slug,\n \"parent\"=>$this->input->post(\"parent\"),\n \"description\"=>strip_tags($this->input->post(\"cat_descri\")),\n \"status\"=>$this->input->post(\"cat_status\")\n );\n \n if($_FILES[\"cat_img\"][\"size\"] > 0){\n $config['upload_path'] = './uploads/category/';\n $config['allowed_types'] = 'gif|jpg|png|jpeg';\n $this->load->library('upload', $config);\n \n if ( ! $this->upload->do_upload('cat_img'))\n {\n $error = array('error' => $this->upload->display_errors());\n }\n else\n {\n $img_data = $this->upload->data();\n $addcat[\"image\"]=$img_data['file_name'];\n }\n \n }\n \n if($parentid != \"0\"){\n $q = $this->db->query(\"select * from `categories` where id=\".$parentid);\n $parent = $q->row();\n $leval = $parent->leval + 1;\n $addcat[\"leval\"] = $leval; \n }\n \n \n $this->db->insert(\"categories\",$addcat); \n \n $this->session->set_flashdata(\"success_req\",'<div class=\"alert alert-success alert-dismissible\" role=\"alert\">\n <i class=\"fa fa-check\"></i>\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>\n <strong>Success!</strong> Your request added successfully...\n </div>');\n redirect('categories/index');\n \t}\n }\n\t \t$this->load->view('admin/categories/addcat',$data);\n }\n else\n {\n redirect('admin');\n }\n\t}", "function editSubUnderCategory()\n\t{\n\n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t $sql='select * from products_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$sqlid=\"SELECT * FROM category_table where sub_category_parent_id='\".$obj->records[0]['sub_category_id'].\"' AND category_parent_id ='\".$obj->records[0]['category_id'].\"'\"; \n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\treturn Display_DManageProducts::displaySubUnderCategory($query->records,$obj->records[0]['sub_under_category_id']);\n\t\t\t\n\t }\n\n\n\t}", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function create() \n\t{\n\t\n\t\t$this->data = (object) array();\n\t\t// Check for post data\n\t\t$this->form_validation->set_rules($this->_validation_rules);\n\t\t\n\t\t\n\t\t// if postback-validate\n\t\tif ($this->form_validation->run()) \n\t\t{\n\t\t\t$input = $this->input->post();\n\t\t\t$id = $this->categories_m->create($input);\n\t\t\t\n\t\t\tEvents::trigger('evt_category_created', $id );\n\t\t\t\n\t\t\t$this->session->set_flashdata('success', lang('success'));\n\t\t\tredirect('admin/shop/categories');\n\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tforeach ($this->_validation_rules as $key => $value) \n\t\t\t{\n\t\t\t\t$this->data->{$value['field']} = '';\n\t\t\t}\n\t\t}\n\n\t\t$this->data->parent_category_select \t= $this->categories_m->build_dropdown(array(\n\t\t\t'type'\t=> 'all'\n\t\t)); \n\n\n\t\t// prepare dropdown image folders\n\t\t$folders = $this->_prep_folders();\n\n\n\t\t// Build page\n\t\t$this->template\n\t\t\t->title($this->module_details['name'])\n\t\t\t->set('folders',$folders)\n\t\t\t->append_js('module::admin/categories.js')\t\n\t\t\t->append_js('module::admin/admin.js')\t\t\n\t\t\t->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))\n\t\t\t->build('admin/categories/form', $this->data);\n\t}", "function suprsubcategry(){\n\t\t\t$this->layout = 'ajax';\n\t\t\t$this->loadModel('Category');\n\t\t\t$cateid = $_REQUEST['cate_id'];\n\t\t\t$suprsub = $_REQUEST['suprsub'];\n\t\t\t\n\t\t\t$catsdata = array();\n\t\t\tif($suprsub == 'yes'){\n\t\t\t\t$catsdata = $this->Category->find('all',array('conditions'=>array('category_parent'=>$cateid,'category_sub_parent'=>0)));\n\t\t\t}else{\n\t\t\t\t$catsdata = $this->Category->find('all',array('conditions'=>array('category_sub_parent'=>$cateid)));\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($catsdata)){\n\t\t\t\tforeach($catsdata as $cts){\n\t\t\t\t\t$cats_arr[] = array('ID'=>$cts['Category']['id'],'Name'=>$cts['Category']['category_name']);\n\t\t\t\t}\n\t\t\t\t// [ { \"ID\" :\"1\", \"Name\":\"Scott\"},{ \"ID\":\"2\", \"Name\":\"Jon\"} ]\n\t\t\t\t// print_r($cats_arr);\n\t\t\t\techo json_encode($cats_arr);\n\t\t\t}else{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t\tdie;\n\t\t}", "public function createSubCategory() {\n //\n $publishedCategories = Category::where('publicationStatus', 1)->get();\n return view('admin.subcategory.createSubCategory', ['publishedCategories' => $publishedCategories]);\n }", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function add_category() {\n\t\n\t\tif($this->input->post('add_type')=='add_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name'),\n\t\t'created_at' => date('d-m-Y h:i:s')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->add_assets_category($data);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_added');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function category_save(){\n\n if (!has_role($this->session->userdata('user_id'), 'CATEGORY_CREATE')) {\n redirect(base_url('page_not_found'));\n }\n\n $data['name'] = html_escape($this->input->post('name'));\n\n if(html_escape($this->input->post('parent')) == ''){\n $data['parent'] = 0;\n }else{\n $data['parent'] = html_escape($this->input->post('parent'));\n }\n \n\n \n if($data['parent'] != 0 && !$this->category_model->is_parent_category($data['parent'])){\n \n $this->session->set_flashdata('category_save_failed', \"Failed to save sub category!!\");\n }else{\n \n $data['created_at'] = date(\"Y-m-d H:i:s\");\n \n $base_slug = string_to_slug($data['name']);\n $data['slug'] = $base_slug;\n $category_id = $this->category_model->add_category($data);\n \n // debug($data);\n // exit;\n if ($category_id){\n\n $this->logger\n ->user($this->session->userdata('user_id')) //Set UserID, who created this Action\n ->user_details($this->user_model->getUserInfoByIpAddress())\n ->type('category_save') //Entry type like, Post, Page, Entry\n ->id($category_id) //Entry ID\n ->token('CREATE') //Token identify Action\n ->comment($this->session->userdata('name'). ' create new category.')\n ->log(); //Add Database Entry\n\n\n\n $this->session->set_flashdata('category_save_success', \"New Category Create Successfully!!\");\n } else {\n $this->session->set_flashdata('category_save_failed', \"Failed to save category!!\");\n }\n\n\n }\n\n redirect(base_url('categories')); \n\n \n }", "public function get_subcategory()\n\t{\n\t\tif($this->input->post('parent'))\n\t\t{\n\t\t\t$category = $_POST['parent'];\n\n\t\t\t$query = $this->db->get_where('ci_subcategories',array('parent' => $category));\n\n\t\t\tif($query->num_rows() > 0)\n\t\t\t{\n\t\t\t\t$rows = $query->result_array();\n\t\t\t\t$options = array('' => 'Seleccione una opción') + array_column($rows,'name','id');\n\t\t\t\t$html = form_dropdown('subcategory',$options,'','class=\"select2 form-control select-subcategory\" required onchange=\"filter_data()\"');\n\t\t\t\t$response = array('status' => 'success', 'msg' => $html);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$html = $this->fields->category_fields($category);\n\t\t\t\t$response = array('status' => 'fields', 'msg' => $html);\n\t\t\t}\n\n\t\t\techo json_encode($response);\n\t\t}\n\t}", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "public function addSubCateSub(Request $request) {\n\t\t $cateCheck3 = DB::table('subCategories')->where('idSubMainCategory', $request['addSubHiddenMain'])->where('nameSubCategory', $request['addSubCateName'])->first();\n\t\t $count3=count($cateCheck3);\n\t\t //dd($count); \n\t\t if(@$count3) {\n\t\t \t Session::put('subCateTitleMsz', 'Sub Category with Name '.$request['addSubCateName'].' is already exists.');\n\t\t return Redirect::to('admin/category?caseC=addSubC&IdC='.$request['addSubHiddenMain']);\n\t\t }\n\t\t else{\n\n\t\t\t $data = array(\n\t\t 'nameSubCategory' => $request['addSubCateName'],\n\t\t 'statusSubCategory' => $request['addSubCateStatus'],\n\t\t 'idSubMainCategory' => $request['addSubHiddenMain'],\n\t\t );\n\t\t\t \n\t\t\t $m = DB::table('subCategories')->insert($data); \n\t\t if($m!==\"\") {\n\t\t Session::put('subCateAddMsz', 'Sub Category Added Successfully');\n\t\t return Redirect::to('admin/category?caseC=listSubC&IdC='.$request['addSubHiddenMain']);\n\t\t }\n\t\t else{\n\t\t Session::put('subCateAddMsz', 'Sub Category Not Added');\n\t\t return Redirect::to('admin/category?caseC=listSubC&IdC='.$request['addSubHiddenMain']);\n\t\t }\n\t\t }\n\t }", "public function actionSubcat() {\n $out = [];\n if (isset($_POST['depdrop_parents'])) {\n $parents = $_POST['depdrop_parents'];\n if ($parents != null) {\n $cat_id = $parents[0];\n $out = self::getSubCatList($cat_id);\n // the getSubCatList function will query the database based on the\n // cat_id and return an array like below:\n // [\n // ['id'=>'<sub-cat-id-1>', 'name'=>'<sub-cat-name1>'],\n // ['id'=>'<sub-cat_id_2>', 'name'=>'<sub-cat-name2>']\n // ]\n\n echo Json::encode(['output'=>$out, 'selected'=>'']);\n return;\n }\n }\n echo Json::encode(['output'=>'', 'selected'=>'']);\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}", "public function add_acct_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\nif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Accounts Category Created Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\ntheme('add_acct_category');\n\t}", "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 add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio 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/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function subcategoria_abm() {\n $crud = new grocery_CRUD();\n\n $crud->where('subcategoria.id_estado = '.ESTADOS::ALTA);\n $crud->set_table('subcategoria');\n $crud->columns('descripcion', 'id_categoria_padre');\n $crud->display_as('descripcion','Descripción')\n ->display_as('id_estado','Estado')\n ->display_as('id_categoria_padre','Categoria padre');\n $crud->set_subject('subcategoria');\n $crud->required_fields('descripcion','id_estado','id_categoria_padre');\n $crud->set_relation('id_categoria_padre','categoria','descripcion', 'categoria.id_estado = '.ESTADOS::ALTA);\n $crud->fields('descripcion');\n\n $_COOKIE['tabla']='subcategoria';\n $_COOKIE['id']='id_subcategoria';\n\n $crud->callback_after_insert(array($this, FUNCTION_LOG::INSERT));\n $crud->callback_after_update(array($this, FUNCTION_LOG::UPDATE));\n $crud->callback_delete(array($this, FUNCTION_LOG::DELETE));\n\n $this->permisos_model->getPermisosCRUD('permiso_articulo', $crud);\n\n $output = $crud->render();\n\n $this->viewCrud($output);\n\t}", "function categoryAdd($str=''){\n\n\t#Get referring page to send users back to\n\t$previous = $_SERVER['HTTP_REFERER'];\n\n\t$str .= '<!-- start general content -->\n\t\t<script type=\"text/javascript\" src=\"' . VIRTUAL_PATH . '_js/util.js\"></script>\n\n\t\t<script type=\"text/javascript\">\n\n\t\t\tfunction checkForm(thisForm)\n\n\t\t\t{//check form data for valid info\n\t\t\t\tif(empty(thisForm.FirstName,\"Please Enter Customer\\'s First Name\")){return false;}\n\t\t\t\tif(empty(thisForm.LastName,\"Please Enter Customer\\'s Last Name\")){return false;}\n\t\t\t\tif(!isEmail(thisForm.Email,\"Please Enter a Valid Email\")){return false;}\n\t\t\t\treturn true;//if all is passed, submit!\n\t\t\t}\n\n\t\t</script>\n\n\n\t\t<div class=\"row\" style=\"\"><!-- begin content -->\n\t\t\t<form action=\"' . THIS_PAGE . '\" method=\"post\" onsubmit=\"return checkForm(this);\" >\n\n\n\t\t\t\t<input type=\"hidden\" name=\"CatID\" />\n\n\t\t\t\t<!-- inner container -->\n\t\t\t\t<div class=\"class=\"col-sm-9 pull-right\" style=\"\">\n\n\t\t\t\t\t<!-- left container -->\n\t\t\t\t\t<div class=\"col-sm-8 pull-left\" style=\"\">\n\t\t\t\t\t\t<h4 class=\"text-center\">Add New Catagory</b></h4>';\n\n\n\n\n\t\t\t\t\t\t\t$str .= '<div class=\"row \">\n\t\t\t\t\t\t\t\t<div class=\"pull-middle\">\n\n\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t<option value=\"person\" select=\"select\">Group By: Indivual</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"team\">Group By: Group/Team</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"organization\">Group By: Organization</option>\n\t\t\t\t\t\t\t\t\t</select>\n\n\n\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t<option value=\"individual\" select=\"select\">Catagory Type: IC</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"team\">Catagory Type: OOC</option>\n\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\tclass=\"col-sm-12\"\n\t\t\t\t\t\t\t\t\ttype=\"text\"\n\n\t\t\t\t\t\t\t\t\tname=\"CatTitle\"\n\t\t\t\t\t\t\t\t\tplaceholder=\"Team/Group/Character Name here\"/>\n\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\tname=\"CatDescription\"\n\n\t\t\t\t\t\t\t\t\tclass=\"autoExpand col-sm-12\"\n\t\t\t\t\t\t\t\t\trows=\"3\"\n\t\t\t\t\t\t\t\t\tdata-min-rows=\"3\"\n\n\t\t\t\t\t\t\t\t\tplaceholder=\"Catagory Description\"\n\t\t\t\t\t\t\t\t\t></textarea>\n\t\t\t\t\t\t\t</div><!-- end container-->\n\n\n\t\t\t\t\t</div><!-- end inner container -->\n\n\t\t\t\t<div class=\"clearfix\">\n\t\t\t\t\t<br /><br />\n\t\t\t\t</div>\n\n\t\t\t\t<div\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tstyle=\"\">\n\n\t\t\t\t\t<input type=\"hidden\" name=\"act\" value=\"categoryInsert\" />\n\t\t\t\t\t<input class=\"btn btn-primary btn-xs \" type=\"submit\" value=\"Add Catagory\">\n\n\t\t\t\t\t&nbsp; &nbsp;\n\n\t\t\t\t\t<a class=\"btn btn-primary btn-xs outline\" href=\"' . $previous . '\">Exit Post</a>\n\t\t\t\t</div>\n\n\t\t\t</form>\n\t\t</div>\n\n\t<!-- END content -->';\n\n\treturn $str;\n}", "public function add() { \n\t\t\n\t\t$data = $this->load_module_info ();\n\t\t\n\t\t/* form submit */\n\t\t\n\n\n\t\tif ($this->input->post ( 'action' ) == \"Add\") {\n\t\t\tcheck_ajax_request (); /* skip direct access */\n\t\t\t$insert_array = array ();\n\t\t\t//print_r($_POST); exit;\t\t\n\t\t\t$this->form_validation->set_rules('category_name', 'lang:cate_name', 'trim|required|callback_cate_exists');\n\t\n\t\n\t\t\tif ($this->form_validation->run () == TRUE) {\n\t\t\t \n\t\t\t\t$insert_array = array(\n\t\t\t\t\t'category_name' \t=> post_value('category_name'), \n\t\t\t\t\t'category_status' \t\t=> ($this->input->post ( 'status' ) == \"A\" ? 'A' : 'I'),\n\t\t\t\t\t'category_created_by' \t=> get_admin_id(),\n\t\t\t\t\t'category_created_ip' \t=> get_ip(),\n\t\t\t\t\t'category_created_on' \t=> current_date()\n\t\t\t\t);\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t$insert_id = $this->Mydb->insert ( $this->table, $insert_array );\n\t\t\t\t\n\t\t\t\t$this->session->set_flashdata ( 'admin_success', sprintf ( $this->lang->line ( 'success_message_add' ), $this->module_label ) );\n\t\t\t\t$result ['status'] = 'success';\n\t\t\t} else {\n\t\t\t\t$result ['status'] = 'error';\n\t\t\t\t$result ['message'] = validation_errors ();\n\t\t\t}\n\t\t\t\n\t\t\techo json_encode ( $result );\n\t\t\texit ();\n\t\t}\n\t\t\n\t\t\n\t\t/* Common labels */\n\t\t$data ['breadcrumb'] = $data ['form_heading'] = get_label ( 'add' ) . ' ' . $this->module_label;\n\t\t$data ['module_action'] = 'add';\n\t\t$this->layout->display_admin ( $this->folder . $this->module . '-add', $data );\n\t\t\n\t}", "function process_addcategories($parent_id, $catname, $alias, $description, $date_add, $date_modify, $ordering, $enabled){\n\t\t $sql = \"INSERT INTO product_category (`parent_id`, `title`, `alias`, `description`, `date_add`, `date_modify`, `ordering`, `enabled`) \n\t\t\t\t VALUES (?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t $max_catid = $this->dbObj->last_insert_id($sql, array($parent_id, $this->dbObj->fix_quotes_dquotes($catname), $alias, $description, $date_add, $date_modify, $ordering, $enabled));\n\t\t if($max_catid > 0){\n\t\t\t return $max_catid;\n\t\t } else {\n\t\t\t return -1;\n\t\t }\n\t }", "function addDishDetail(){\n\n\t\t$data['userdata']\t= $this->session->userdata('current_user');\n\t\t$data['menu'] \t= $this->menu;\n\t\t$submenu \t\t\t= $this->submenu;\n\t\t$submenuArray \t\t= array();\n\n\t\tforeach($submenu as $key=>$value){\n\n\t\t\t$submenuArray[$value->parent_page_id][] = $value;\n\t\t}\n\t\t$data['submenu'] \t= $submenuArray;\n\t\t$data['categoryList']= $this->Dishes_model->getCategory();\n\n if ($this->input->post('add')=='Save') {\n\t\t\t$this->form_validation->set_rules('category_id', 'Category Name', 'required');\n\t\t\t$this->form_validation->set_rules('dish_name', \t 'Dish Name', 'required|callback_isDishExist['.json_encode($this->input->post()).']');\n\t\t\t$this->form_validation->set_rules('description', 'Descripation', 'required');\n\t\t\t$this->form_validation->set_rules('price', 'Dish Price', 'required|numeric');\n\t\n\t\t\t\n\t\t\tif ($this->form_validation->run() == FALSE){\n\t \t\n\t }\n\t else{\n\n\t\t\t\t$config['upload_path'] \t\t= './assets/uploads/products/'; \n $config['allowed_types'] = 'gif|jpg|png|jpeg|GIF|JPG|PNG|JPEG';\n $config['max_size'] = 5120;\n \n $this->upload->initialize($config);\n if (! $this->upload->do_upload('image')){\n \t$error = array('error' => $this->upload->display_errors());\n }\n else{\n $dataupload \t \t\t\t\t= array('upload_data' => $this->upload->data());\n $dishData['dish_image'] = $dataupload['upload_data']['file_name'];\t\n }\n\t \tif(isset($error) && sizeof($error)>0){\n\t \t\n \t\t\t$data['image_error']=$error['error'];\n\t \t}\n\t \telse{\n\t\t $dishData['category_id']\t= trim($this->input->post('category_id'));\n\t\t $dishData['product_en_name']\t= trim($this->input->post('dish_name'));\n\t\t $dishData['en_description']\t= trim($this->input->post('description'));\n\t\t $dishData['price']\t\t\t= trim($this->input->post('price'));\n\t\t $dishData['discount_type']\t= trim($this->input->post('discount_type'));\n\t\t $dishData['discount']\t\t= trim($this->input->post('discount'));\n\t\t //$dishData['created_by'] \t= $data['userdata'][0]->user_id;\t\n\t\t $dishData['created_date']\t= date(\"Y-m-d H:i:s\");\n\n\t\t $product_id = $this->Dishes_model->addDishDetail($dishData);\n\t\t //echo \"<pre>\";print_r($product_id);exit;\n\t\t if ($_FILES['other_image']['name'] != \"\") {\n\n\t\t \t\t$filesCount = count($_FILES['other_image']['name']);\n\t\t \tfor($i = 0; $i < $filesCount; $i++){\n\n\t\t\t $_FILES['userFile']['name'] \t= $_FILES['other_image']['name'][$i];\n\t\t\t $_FILES['userFile']['type'] \t= $_FILES['other_image']['type'][$i];\n\t\t\t $_FILES['userFile']['tmp_name'] = $_FILES['other_image']['tmp_name'][$i];\n\t\t\t $_FILES['userFile']['error'] \t= $_FILES['other_image']['error'][$i];\n\t\t\t $_FILES['userFile']['size'] \t= $_FILES['other_image']['size'][$i];\n\n\t\t\t $config['upload_path'] \t\t= './assets/uploads/products/'; \n\t\t\t $config['allowed_types'] = 'gif|jpg|png|jpeg|GIF|JPG|PNG|JPEG';\n\t\t\t $config['max_size'] = 5120;\n\t\t\t \n\t\t\t $this->upload->initialize($config);\n\t\t\t if($this->upload->do_upload('userFile')){\n\t\t\t $fileData = $this->upload->data();\n\t\t\t $uploadData[$i]['file_name'] = $fileData['file_name'];\n\t\t\t $images['media_name']=$uploadData[$i]['file_name'];\n\t\t\t \t\t\n\t\t\t }\n\t\t\t else{\n\t \t\t$error1 = array('error1' => $this->upload->display_errors());\n\n\t\t\t }\n\t\t\t if(isset($error1) && sizeof($error1)>0){\n\t\t \t\n\t\t\t \t\t\t$data['image_error1']=$error['error1'];\n\t\t\t\t \t}\n\t\t\t\t \telse{\n\t\t\t\t \t\t$images['product_id'] \t= $product_id;\n\t\t\t\t \t\t$images['created_by'] \t= $data['userdata'][0]->user_id;\t\n\t\t\t \t\t$images['created_date']\t= date(\"Y-m-d H:i:s\");\n\t\t\t \t\t\n\t \t\t\t\t\t$result = $this->Dishes_model->addDishMedia($images);\n\n\t\t\t\t \t}\n\t\t \t}\n\t \t\t}\n\n\t\t if (sizeof($product_id)>0) {\n\t\t \t $this->session->set_flashdata('success_msg', \"Dish Details Added successfully!\");\n\t\t \t redirect('Dishes/dishList');\n\t\t }\n\t\t else{\n\t\t \t $this->session->set_flashdata('error_msg', \"Something went wrong while adding Dish details\");\n\t\t \t redirect('Dishes/addDishDetail');\n\t\t }\n\t\t\t\t}\n\t }\n \t\t}\t\n\n\t\t$this->load->view('Elements/header',$data);\n\t\t$this->load->view('Dishes/add_dish');\n\t\t$this->load->view('Elements/footer');\n\t}", "public function store()\n {\n $categories = Category::all();\n\n $subcategory = new Subcategory;\n $subcategory->name = request('name');\n foreach($categories as $category){\n if($category->name == request('cat')){\n $subcategory->categories_id = $category->id;\n }\n }\n $subcategory->save();\n\n return redirect('/cms/categories')->with('success', 'Subcategory was added succesfully');\n }", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "function endChildren() {\n echo \"<td>\";\n echo \"<form name='editCatecory' action='editCategory.php' method='GET'>\";\n echo \"<input type='hidden' name='categoryID' value='<?php echo $id; ?>'>\";\n echo \"<input type='submit' class='btn btn-outline-secondary btn-sm' name='editRow' value='Edit'>\";\n echo \"</form>\";\n\n echo \"</td>\";\n echo \"</tr>\" . \"\\n\";\n }", "protected function AddCategory($subcat,$parent) {\n if($subcat == \"\" || $subcat == \"0\") {\n return $parent;\n } else {\n if((int)$subcat > 0) {\n return $subcat;\n } else {\n $subcat = substr($subcat,2);\n }\n }\n\n $category = new Categories();\n $category->name = $subcat;\n $category->parent = $parent;\n $category->status = 1;\n //$category->created = date('Y-m-d H:i:s');\n $this->getEntityManager()->persist($category);\n $this->getEntityManager()->flush();\n return $category->id;\n}", "function fill_parent_combo( $form_name, $category_id )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories where status = 1\";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\t$combo = '<select class=\"validate[required] txarea2\" name=\"category_id\" id=\"category_id\" onchange=\"document.uploadAdvert.submit()\" >\n\t\t\t\t\t<option value=\"\">---Please Select Category---</option>';\n\t\tif( $r != false )\n\t\t{\n\t\t\tfor( $i = 0; $i < count( $r ); $i++ )\n\t\t\t{\n\t\t\t\t$selected = $category_id== $r[$i]['category_id'] ? \"selected\" : \"\";\n\t\t\t\t$combo .= '<option '.$selected.' value=\"'.$r[$i]['category_id'].'\">'.$r[$i]['category_title'].'</option>';\n\t\t\t}\t//\tEnd of for Looooooop\n\t\t}\t//\tEnd of if( $r != false )\n\t\t$combo .= '</select>';\n\t\t\n\t\treturn $combo;\n\t}", "function product_sub_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$data['category_id'] = $this->input->post('category_id');\n\t\t\t$this->db->insert('sub_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_sub_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$data['category_id'] = $this->input->post('category_id');\n\t\t\t$this->db->where('sub_category_id', $param2);\n\t\t\t$this->db->update('sub_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_sub_category', 'refresh');\n\t\t}\n\t\tif ($param1 == 'delete') {\n\t\t\t$this->db->where('sub_category_id', $param2);\n\t\t\t$this->db->delete('sub_category');\n\t\t\t$this->session->set_flashdata('flash_message', translate('data_deleted'));\n\t\t\tredirect(base_url() . 'index.php?admin/product_sub_category', 'refresh');\n\t\t}\n\t\t$page_data['page_name'] = 'product_sub_category';\n\t\t$page_data['page_title'] = translate('product_sub_categories');\n\t\t$page_data['sub_categories'] = $this->db->get('sub_category')->result_array();\n\t\t$this->load->view('backend/index', $page_data);\n\t}", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "public function add_new_subcategory($id){\n if(Category::exist_category($id)){\n $new_subcateg = SubCategory::new_register(Input::all(), $id);\n\n if($new_subcateg['error'] == true){\n\n Session::flash('danger', \"Problemas Al registrar. Revise los Campos que tienen error.\");\n return Redirect::back()->withErrors($new_subcateg['mensaje'])->withInput();\n\n }elseif($new_subcateg['error'] == false){\n\n $list = SubCategory::get_list_subcategory($id);\n Session::flash('list',$list);\n Session::flash('success', \"Al registrar la subcategoria.\");\n return Redirect::to('admin/subcategorias/listar/'.$id);\n\n }\n }else{\n return View::make('errors/404');\n }\n }", "function classiera_implement_ajax(){\t\t\r\n\tif(isset($_POST['mainCat'])){\r\n\t\t$mainCatSlug = $_POST['mainCat'];\r\n\t\t$mainCatIDSearch = get_category_by_slug($mainCatSlug);\r\n\t\t$mainCatID = $mainCatIDSearch->term_id;\r\n\t\t$cat_child = get_term_children($mainCatID, 'category' );\r\n\t\tif (!empty($cat_child)) {\t\r\n\t\t\t$categories= get_categories('child_of='.$mainCatID.'&hide_empty=0');\r\n\t\t\t foreach ($categories as $cat) {\t\t\t\t\r\n\t\t\t\t$option .= '<option value=\"'.$cat->slug.'\">';\r\n\t\t\t\t$option .= $cat->cat_name;\t\t\t\t\r\n\t\t\t\t$option .= '</option>';\r\n\t\t\t }\r\n\t\t\t echo '<option value=\"-1\" selected=\"selected\" disabled=\"disabled\">'.esc_html__( \"Select Sub Category..\", \"classiera\" ).'</option>'.$option;\r\n\t\t\tdie();\r\n\t\t}else{\r\n\t\t\techo '<option value=\"-1\" disabled=\"disabled\">'.esc_html__( \"No Sub Category Found\", \"classiera\" ).'</option>';\r\n\t\t}\r\n\t} // end if\r\n}", "public function add_cat() { \n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\tdie();\n\t\t}\n\t\t$main_cat_id = $this->input->post('main_cat_id');\n\t\t$title = $this->input->post('title'); \n\n\n\t\t$array_data['main_cat_id'] = $main_cat_id ; \n\t\t$array_data['title'] = $title ; \n\t\t$this->db->insert(\"categories\" , $array_data); \n\t\t$result = array('statu' => 'ok');\n\t\techo json_encode($result);\n\n\t}", "public function init()\n {\n $this->addAttribs(array(\"class\" => \"form-horizontal\"))\n ->setDecorators(array(\n 'FormElements',\n 'Form'\n )); \n $this->addElement('hidden','idcategory'); \n \n $name = $this->createElement('text','name');\n $name->setLabel(\"Tên danh mục :\")\n ->setRequired()\n ->setAttrib(\"class\",\"large\")\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n )); \n $this->addElement($name); \n \n $model = new Application_Model_DbTable_Categories();\n $result = $model->arrayChosen(); \n $groups_id = $this->createElement('select','parent_id');\n $groups_id->setLabel(\"Danh mục cha :\")\n ->setRequired()\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n ));\n $groups_id->addMultiOption(\"0\",\"None\"); \n foreach($result as $row){\n $groups_id->addMultiOption($row['key'],$row['value']);\n } \n $this->addElement($groups_id);\n \n $user_status = $this->createElement('Radio','status');\n $user_status->setLabel(\"Trạng thái :\")\n ->setMultiOptions(array(\"Khóa lại\",\"Hoạt động \"))\n ->setValue(1)\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n )); \n $this->addElement($user_status); \n \n $submit = $this->createElement(\"submit\",\"submit\");\n $submit->setLabel(\"Thêm\"); \n $this->addElement($submit); \n }", "function editMainCategory()\n\t{ \n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from products_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$sqlid=\"SELECT category_id,category_parent_id FROM category_table where category_id in(select category_id from products_table where category_id='\".$obj->records[0]['category_id'].\"')\";\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$sql1 = \"SELECT category_id,category_name FROM category_table where category_parent_id=0\";\n\t\t\n\t\t\t$query1 = new Bin_Query();\n\t\t\n\t\t\t$query1->executeQuery($sql1);\n\t\t\n\n\t\t\treturn Display_DManageProducts::displayCategory($query1->records,$query->records[0]['category_id']);\n\t\t\t\n\t\t// \t\t\treturn $category;\n\t }\n\t}", "function submit(){\n\t$parent_category = $this->uri->segment(4);\n\tif (!is_numeric($parent_category)){\n\t\t$parent_category = 0;\n\t}\n\n\t$this->form_validation->set_rules('category_name', 'Category Name', 'required');\n\n\tif ($this->form_validation->run() == FALSE){\n\t\t$this->create();\n\t} else {\n\n\t\t$update_id = $this->uri->segment(3);\n\n\t\tif ($update_id > 0){\n\t\t\t//This is an update\n\t\t\t$data = $this->get_data_from_post();\n\t\t\t$data['category_url'] = url_title($data['category_name']);\n\t\t\t$this->update($update_id, $data);\n\t\t\t$value = \"<p style = 'color: green;'>The category was successfully updated.</p>\";\n\t\t\t$parent_category = $update_id;\n\t\t} else {\n\t\t\t//Create new record\n\t\t\t$data = $this->get_data_from_post();\n\t\t\t$data['category_url'] = url_title($data['category_name']);\n\t\t\t$data['parent_category'] = $parent_category;\n\t\t\t$this->insert($data);\n\t\t\t$value = \"<p style = 'color: green;'>The category was successfully created.</p>\";\n\t\t\t$update_id = $this->get_max();\n\n\t\t\t$this->session->set_flashdata('category', $value);\n\t\t\t\n\t\t}\n\t\t//add flashdata\n\t\t$this->session->set_flashdata('category', $value);\t\n\n\t\tredirect ('store_categories/manage/'.$parent_category);\n\t\t\n\t}\n}", "public function getSubCatList()\r\n {\r\n\t\t$productId = $_POST['productId'];\r\n\t\r\n\t\t// GEtting subcategories against categoryid\r\n\t\t$ajaxSubCategoriesArray = $this->Product->SubCategory->find('list', array('conditions'=>array('SubCategory.category_id'=>$productId)));\r\n\t\r\n\t\t$select = '<div class=\"input select\">\r\n\t\t<label for=\"ProductSubCategoryId\">Sub Category</label>\r\n\t\t<select name=\"data[Product][sub_category_id]\" id=\"ProductSubCategoryId\">\r\n\t\t<option value=\"0\">Please select</option>';\r\n\t\r\n\t\tforeach($ajaxSubCategoriesArray as $key => $subCategories) \r\n\t\t{\r\n\t\t\t$select .= '<option value=\"'.$key.'\">'.$subCategories.'</option>';\r\n\t\t}\r\n\t\t\r\n\t\t$select .= '</select></div>';\r\n\t\techo $select;\r\n\t\texit;\r\n }", "public function category()\n { \n if($this->access_role->is_Admin() == false) show_404();\n $this->load->model('Category_Model');\n \n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n if($this->form_validation->run('category_insert') ){\n $this->Category_Model->add_category(); \n } else {\n $error = ['class'=>'warning','text'=> validation_errors()];\n $this->session->set_flashdata('sms_flash', $error); \n redirect('Dashboard/category');\n }\n } \n else{\n $data = $this->Category_Model->view_category();\n }\n \n $this->load->view('admin/category_content',$data);\n }", "function add(){\n\t\tif(!$this->checkLogin()){\n\t\t\tredirect(base_url());\n\t\t}\n\n\t\t$pageData['header_title'] = APP_NAME.' | Add Document Category';\n\t\t$pageData['page_title'] = 'Document Category Management';\n\t\t$pageData['parent_menu'] = 'document_management';\n\t\t$pageData['child_menu'] = 'document_category';\n\n\t\t$this->load->view('admin/document_management/category/add', $pageData);\n\t}", "function display_category_form($category = ''){\n\t// This form can be used for inserting or editing categries\n\t// To insert, don't pass any parameters\n\t// To update, pass an array containing a category\n\t$edit = is_array($category);\n?>\n<form method='post'\n action='<?php echo $edit?'edit_category.php':'insert_category.php'; ?>'>\n<table border='0'>\n <tr>\n <td>Category Name:</td>\n\t<td><input type='text' name='catname' size='40' maxlength='40'\n\t value='<?php echo $edit?$category['catname']:''; ?>' /></td>\n </tr>\n <tr>\n <td <?php if (!$edit) echo \"colspan='2'\"; ?> align='center'>\n<?php\nif ($edit)\n\techo \"<input type='hidden' name='catid' value='\" . $category['catid']\n\t\t. \"' />\";\n?>\n\t <input type='submit'\n\t value=\"<?php echo $edit?'Rename':'Add'; ?> Category\" /></td>\n\t </form>\n<?php\n\tif ($edit)\n\t\techo '<form method=\"post\" action=\"/myPHP/ShoppingCart/model/admin/delete_category.php\">\n\t\t\t\t<td align=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"catid\" value=\"' . $category['catid'] .'\" />\n\t\t\t\t<input type=\"submit\" value=\"Delete Category\" />\n\t\t\t \t</td>\n\t\t\t</form>';\n?>\n\n\n<?php\n}", "public function addSubC($id) {\n\n\t return Redirect::to('admin/category?caseC=addSubC&IdC='.$id);\n\n\t }", "function shophead_add()\n {\n $this->layout = 'admin_layout';\n if ($this->request->is('post')) {\n $this->ProductCategory->set($this->request->data);\n\t\t\t $this->request->data = Sanitize::clean($this->request->data, array('encode' => false));\n if ($this->ProductCategory->validates()) {\n if ($this->ProductCategory->save($this->request->data)) {\n $this->Session->write('flash', array(ADD_RECORD, 'success'));\n\n } else {\n $this->Session->write('flash', array(ERROR_MSG, 'failure'));\n }\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }\n }", "public function form_new_subcategory($id){\n if(Category::exist_category($id)){\n\n Session::flash('id',$id);\n return View::make('admin/subcategory/form_subcategory');\n\n }else{\n return View::make('errors/404');\n }\n }", "function ccategories_create()\n\t{\n\t\tlusers_require(\"categories/create\");\n\n\t\t$post_data = linput_post();\n\t\t$post_data = linput_post_checkbox($post_data, \"content\");\n\t\t$content = $post_data[\"content\"];\n\n\t\tif (hform_validate(array(\"name\", \"link\", \"parentid\")))\n\t\t{\n\t\t\t$cat_created = mcategories_create($post_data);\n\t\t\tif ($content) $content_created = mcontent_create($post_data);\n\t\t\telse $content_created = false;\n\n\t\t\tif (($cat_created && !$content) || ($content && $cat_created && $content_created))\n\t\t\t{\n\t\t\t\tlcache_delete_all();\n\t\t\t\thmessage_set(l(\"Category successfully created.\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($cat_created) mcategories_delete($post_data[\"link\"]);\n\t\t\t\tif ($content_created) mcontent_delete($post_data[\"link\"]);\n\t\t\t\thmessage_set(l(\"Category create error.\") . \" \" . l(\"Link already in use.\"));\n\t\t\t}\n\n\t\t\tluri_redirect(\"main/user/admin/categories\");\n\t\t}\n\t\telse luri_redirect(\"main/user/admin/categories_create\", l(\"All fields marked with * are required.\"));\n\t}", "public function storeSubCategory(Request $request) {\n try {\n DB::beginTransaction();\n if(empty($request->id)){\n $data = new SubCategory();\n }else{\n $data = SubCategory::find($request->id);\n } \n $data->subCategoryName = $request->subCategoryName;\n $data->pageTitle = $request->pageTitle;\n $data->metaTag = $request->metaTag;\n $data->metaDescription = $request->metaDescription;\n $data->categoryId = $request->categoryId;\n $data->publicationStatus = $request->publicationStatus;\n $data->position = $request->position;\n $data->subCategoryImage = $this->UploadImage($request, 'subCategoryImage', $this->categoryDir, 268, 185, $data->subCategoryImage);\n $data->save();\n DB::commit(); \n $output = ['status'=>'success','message'=> 'Caregory add successfully', 'table' => 1,'modal'=>1];\n return response()->json($output);\n\n } catch (Exception $ex) { \n DB::rollback();\n $output = ['status'=>'error','message'=> 'Something went Wrong', 'table' => 1,'modal'=>1];\n return response()->json($output);\n }\n }", "public function main_categories()\n\t{ \n\t\tif ($this->input->is_ajax_request()) {\n\t\t\t$main_categories = $this->cat_model->GetWhere(\"categories\", \"title\", \"ASC\", array('main_cat_id'=>0)); \n\n\t\t\tif (isset($main_categories) && count($main_categories) != 0) {\n\t\t\t\t$id_num=0;\n\t\t\t\t$id=\"sub_cat_id\".$id_num;\n\t\t\t\t$div=\"div_\".$id_num;\n\t\t\t\techo '<select id=\"'.$id.'\" onclick=\"get_sub_category('.$id_num.');\">'; \n\t\t\t\techo '<option disabled selected>Select main category</option>';\n\n\t\t\t\tforeach ($main_categories as $cat) { \n\t\t\t\t\techo '<option value=\"'.$cat->id.'\">'.$cat->title.'</option>';\n\t\t\t\t}\n\n\t\t\t\techo '</select><div id=\"'.$div.'\"> </div><br>';\n\n\n\t\t\t}\n\t\t}\n\n\n\t}", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "public function addPost(){\n\n if ($this->input->post(\"category_create\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n $categoryName = $this->input->post(\"category_name\");\n\n $this->validate->setRule(\"minlength\",$categoryName,3, \"Category name length must be more then 3 symbols!\");\n\n if ($this->validate->validate() === false){\n $error = $this->validate->getErrors();\n $this->view->redirect(\"/categories/manage\",$error);\n }\n\n $categoryModel = new CategoriesModel();\n try{\n if ($categoryModel->hasCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"This categories already exist!\");\n }\n\n if($categoryModel->addNewCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"Category created successfully!\",\"success\");\n }\n }catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception);\n }\n }", "public function formModify() {\n $categories=$this->model->listCategories();\n $this->view->display(\"view/form/ProductFormModify.php\", NULL, $categories); \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 }", "public function AddData()\n {\n echo 'Создалась VirtualCategory - метод Data <br>';\n }", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function sitestorecategoriesAction() {\n\n //GET NAVIGATION\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_sitestorecategories');\n\n //GET TASK\n if (isset($_POST['task'])) {\n $task = $_POST['task'];\n } elseif (isset($_GET['task'])) {\n $task = $_GET['task'];\n } else {\n $task = \"main\";\n }\n\n //GET CATEGORIES TABLE\n $tableCategories = Engine_Api::_()->getDbTable('categories', 'sitestore');\n\n //GET CATEGORIES TABLE NAME\n $tableCategoriesName = $tableCategories->info('name');\n\n //GET STORE TABLE\n $tableStore = Engine_Api::_()->getDbtable('stores', 'sitestore');\n\n if ($task == \"savecat\") {\n //GET CATEGORY ID\n $cat_id = $_GET['cat_id'];\n\n $cat_title_withoutparse = $_GET['cat_title'];\n\n //GET CATEGORY TITLE\n $cat_title = Engine_Api::_()->sitestore()->parseString($_GET['cat_title']);\n\n //GET CATEGORY DEPENDANCY\n $cat_dependency = $_GET['cat_dependency'];\n $subcat_dependency = $_GET['subcat_dependency'];\n if ($cat_title == \"\") {\n if ($cat_id != \"new\") {\n if ($cat_dependency == 0) {\n $row_ids = Engine_Api::_()->getDbtable('categories', 'sitestore')->getSubCategories($cat_id);\n foreach ($row_ids as $values) {\n $tableCategories->delete(array('subcat_dependency = ?' => $values->category_id, 'cat_dependency = ?' => $values->category_id));\n $tableCategories->delete(array('category_id = ?' => $values->category_id));\n }\n\n $tableStore->update(array('category_id' => 0, 'subcategory_id' => 0), array('category_id = ?' => $cat_id));\n $tableCategories->delete(array('category_id = ?' => $cat_id));\n\n //START SITESTOREREVIEW CODE\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorereview')) {\n Engine_Api::_()->sitestorereview()->deleteCategory($cat_id);\n }\n //END SITESTOREREVIEW CODE\n } else {\n $tableCategories->update(array('category_name' => $cat_title), array('category_id = ?' => $cat_id, 'cat_dependency = ?' => $cat_dependency));\n $tableStore->update(array('category_id' => 0, 'subcategory_id' => 0), array('category_id = ?' => $cat_id));\n $tableCategories->delete(array('cat_dependency = ?' => $cat_id, 'subcat_dependency = ?' => $cat_id));\n $tableCategories->delete(array('category_id = ?' => $cat_id));\n }\n }\n //SEND AJAX CONFIRMATION\n echo \"<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>\";\n echo \"window.parent.removecat('$cat_id');\";\n echo \"</script></head><body></body></html>\";\n exit();\n } else {\n if ($cat_id == 'new') {\n $row_info = $tableCategories->fetchRow($tableCategories->select()->from($tableCategoriesName, 'max(cat_order) AS cat_order'));\n $cat_order = $row_info['cat_order'] + 1;\n $row = $tableCategories->createRow();\n $row->category_name = $cat_title_withoutparse;\n $row->cat_order = $cat_order;\n $row->cat_dependency = $cat_dependency;\n $row->subcat_dependency = $subcat_dependency;\n $newcat_id = $row->save();\n } else {\n $tableCategories->update(array('category_name' => $cat_title_withoutparse), array('category_id = ?' => $cat_id));\n $newcat_id = $cat_id;\n }\n\n //SEND AJAX CONFIRMATION\n echo \"<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>\";\n echo \"window.parent.savecat_result('$cat_id', '$newcat_id', '$cat_title', '$cat_dependency', '$subcat_dependency');\";\n echo \"</script></head><body></body></html>\";\n exit();\n }\n } elseif ($task == \"changeorder\") {\n $divId = $_GET['divId'];\n $sitestoreOrder = explode(\",\", $_GET['sitestoreorder']);\n //RESORT CATEGORIES\n if ($divId == \"categories\") {\n for ($i = 0; $i < count($sitestoreOrder); $i++) {\n $cat_id = substr($sitestoreOrder[$i], 4);\n $tableCategories->update(array('cat_order' => $i + 1), array('category_id = ?' => $cat_id));\n }\n } elseif (substr($divId, 0, 7) == \"subcats\") {\n for ($i = 0; $i < count($sitestoreOrder); $i++) {\n $cat_id = substr($sitestoreOrder[$i], 4);\n $tableCategories->update(array('cat_order' => $i + 1), array('category_id = ?' => $cat_id));\n }\n } elseif (substr($divId, 0, 11) == \"treesubcats\") {\n for ($i = 0; $i < count($sitestoreOrder); $i++) {\n $cat_id = substr($sitestoreOrder[$i], 4);\n $tableCategories->update(array('cat_order' => $i + 1), array('category_id = ?' => $cat_id));\n }\n }\n }\n\n $categories = array();\n $category_info = Engine_Api::_()->getDbTable('categories', 'sitestore')->getCategories(1);\n foreach ($category_info as $value) {\n $sub_cat_array = array();\n $subcategories = Engine_Api::_()->getDbtable('categories', 'sitestore')->getAllCategories($value->category_id, 'subcategory_id', 0, 'subcategory_id', null, 0, 0);\n foreach ($subcategories as $subresults) {\n $subsubcategories = Engine_Api::_()->getDbtable('categories', 'sitestore')->getAllCategories($subresults->category_id, 'subsubcategory_id', 0, 'subsubcategory_id', null, 0, 0);\n $treesubarrays[$subresults->category_id] = array();\n foreach ($subsubcategories as $subsubcategoriesvalues) {\n $treesubarray = array('tree_sub_cat_id' => $subsubcategoriesvalues->category_id,\n 'tree_sub_cat_name' => $subsubcategoriesvalues->category_name,\n 'order' => $subsubcategoriesvalues->cat_order,\n 'count' => $subsubcategoriesvalues->count,);\n $treesubarrays[$subresults->category_id][] = $treesubarray;\n }\n\n $tmp_array = array('sub_cat_id' => $subresults->category_id,\n 'sub_cat_name' => $subresults->category_name,\n 'tree_sub_cat' => $treesubarrays[$subresults->category_id],\n 'count' => $subresults->count,\n 'order' => $subresults->cat_order);\n $sub_cat_array[] = $tmp_array;\n }\n\n $category_array = array('category_id' => $value->category_id,\n 'category_name' => $value->category_name,\n 'order' => $value->cat_order,\n 'count' => $value->count,\n 'sub_categories' => $sub_cat_array);\n $categories[] = $category_array;\n }\n\n include APPLICATION_PATH . '/application/modules/Sitestore/controllers/license/license2.php';\n }", "public function add()\r\n\r\n {\r\n\r\n $this->page_title->push(lang('menu_products_add'));\r\n\r\n $this->data['pagetitle'] = $this->page_title->show();\r\n\r\n\r\n\r\n /* Breadcrumbs :: Common */\r\n\r\n $this->breadcrumbs->unshift(1, lang('menu_products_add'), 'admin/setup/products/add');\r\n\r\n\r\n\r\n /* Breadcrumbs */\r\n\r\n $this->data['breadcrumb'] = $this->breadcrumbs->show();\r\n\r\n\r\n\r\n /* Data */\r\n\r\n $this->data['error'] = $this->session->flashdata('errors');\r\n\r\n $this->data['message'] = isset($_GET['uploaded']) ? $this->session->flashdata('message') : NULL;\r\n\r\n $this->data['charset'] = 'utf-8';\r\n\r\n $this->data['form_url'] = 'admin/setup/product/store';\r\n\r\n $this->data['form_products_upload_url'] = 'admin/setup/product/store/bulk';\r\n\r\n\r\n\r\n $categories = $this->categories->getData();\r\n\r\n $this->data['categories_option'] = '';\r\n\r\n\r\n foreach ($categories[0]->data as $category) {\r\n\r\n if ($category->parent == 0) $this->data['categories_option'] .= '<optgroup label=\"' . $category->title . '\"></optgroup>';\r\n\r\n else $this->data['categories_option'] .= '<option value=\"' . $category->bar_code . '\">' . $category->bar_code . ' -- ' . $category->title . '</option>';\r\n\r\n }\r\n\r\n\r\n /* Load Template */\r\n\r\n $this->template->admin_render('admin/products/add', $this->data);\r\n\r\n\r\n\r\n }", "public function getParentCategoryChild() {\r\n\t\t$childList = '<select id=\"Category[]\" class=\"form-control category sm-width-box tdtab\" name=\"Category[]\">';\r\n\t\t$childList .= '<option value=\"0\" > Select Sub Category</option>'; \r\n\t\tif(isset($_POST['parentid'])){ \r\n\t\t\t$childCat = getCategoryParentChild($_POST['parentid']); \r\n\t\t\t$i=0;\r\n\t\t\tif(isset($childCat) && $childCat != ''){\r\n\t\t\t\tforeach($childCat as $val){\r\n\t\t\t\t\t$childList .= '<option value=\"'.$val->id.'\" > '.$val->title.' </option>';\r\n\t\t\t\t\t$i += 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($_POST['parentid'] == 235){\r\n\t\t\t\t$childList .= '<option value=\"addnew\" > Add New Customer </option>';\r\n\t\t\t}\r\n\t\t\t$childList .= '</select>'; \t\t\r\n\t\t}else{\r\n\t\t\t$childList .= '</select>';\t\r\n\t\t}\r\n\t\t//$childList .= '<input class=\"linkRefrence\" type=\"hidden\" value=\"\" name=\"linkRefrence[]\">';\r\n\t\t//$childList .= '<div class=\"input-group drop-downs srch-div\">';\r\n\t\t//$childList .= '<input type=\"textbox\" placeholder=\"Chris\" name=\"linkbankstatment\" required=\"required\" class=\"form-control linkbankstatment\">';\r\n\t\t//$childList .= '<span class=\"glyphicon glyphicon-search ico\" aria-hidden=\"true\"></span>';\r\n\t\t//$childList .= '<div class=\"div-position\" id=\"clientList\" style=\"display:none\">';\r\n\t\t//$childList .= '<ul id=\"clientUl\">';\r\n\t\t//$childList .= '</ul>';\r\n\t\t//$childList .= '</div>';\r\n\t\t//$childList .= '</div>';\r\n\t\techo $childList;\r\n\t}", "public function addAction() {\n $session = new Container('User');\n $form = new CategoryForm('CategoryForm');\n\n $form->get('created_date')->setValue(time());\n $form->get('created_by')->setValue($session->offsetGet('userId'));\n $form->get('updated_date')->setValue(time());\n $form->get('updated_by')->setValue($session->offsetGet('userId'));\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $data = $request->getPost();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($data);\n if ($form->isValid()) {\n $validatorName = new \\Zend\\Validator\\Db\\NoRecordExists(\n array(\n 'table' => 'category',\n 'field' => 'title',\n 'adapter' => $this->getAdapter()\n )\n );\n if ($validatorName->isValid(trim($category->title))) {\n $no_duplicate_data = 1;\n } else {\n $flashMessage = $this->flashMessenger()->getErrorMessages();\n if (empty($flashMessage)) {\n $this->flashMessenger()->setNamespace('error')->addMessage('Category Name already Exists.');\n }\n $no_duplicate_data = 0;\n }\n\n if ($no_duplicate_data == 1) {\n $category->exchangeArray($form->getData());\n $data->created_date = time();\n $data->created_by = $session->offsetGet('userId');\n $data->updated_date = time();\n $data->updated_by = $session->offsetGet('userId');\n\n $questionId = $this->getCategoryTable()->saveCategory($category);\n// $this->getServiceLocator()->get('Zend\\Log')->info('Level created successfully by user ' . $session->offsetGet('userId'));\n $this->flashMessenger()->setNamespace('success')->addMessage('Category created successfully');\n return $this->redirect()->toRoute('category');\n }\n }\n }\n\n return array('form' => $form);\n }", "function getCategoryFields() {\n\t\t\n\t\t$model = $this->getModel();\n\t\t$category_id = JRequest::getVar('id');\n\t\t$form = $model->getFieldForm($category_id, 'category');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\" >';\n\t\techo '<legend>New Category</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "function get_sub_category() {\r\n if(!isset($_POST['category_id'])){\r\n echo json_encode(array('status'=>false, 'message'=>\"category_id field is required!!\", 'data'=>blank_json()));\r\n die;\r\n }\r\n $category_id=$this->input->post('category_id');\r\n if(isset($_POST['last_count'])){\r\n $last_count = $_POST['last_count'];\r\n }else{\r\n $last_count = 0;\r\n }\r\n if($category_id==1 || $category_id==2 || $category_id==3 || $category_id==4){\r\n if($category_id==1){\r\n $table='fic_category';\r\n }\r\n if($category_id==2){\r\n $table='comm_category';\r\n }\r\n if($category_id==3){\r\n $table='competition_category';\r\n }\r\n if($category_id==4){\r\n $table='opendata_category';\r\n }\r\n $res = $this->CategoriesModel->get_subcategories($category_id,$table,$last_count);\r\n if (!empty($res)) {\r\n $i=0;\r\n foreach($res as $r){\r\n $res[$i]['root_id']=$category_id;\r\n $i++;\r\n }\r\n echo json_encode(array('status'=>true, 'message'=>\"Sub Categories list!\", 'data'=>$res));\r\n die;\r\n }\r\n echo json_encode(array('status'=>false, 'message'=>\"Sub Categories list not found!!\", 'data'=>array()));\r\n die;\r\n \r\n }else{\r\n echo json_encode(array('status'=>false, 'message'=>\"category_id is not valid!!\", 'data'=>blank_json()));\r\n }\r\n }", "protected function _prepareForm()\r\n {\r\n \t/* @var $model Lanot_EasyBanner_Model_Category */\r\n $model = $this->_getHelper()->getCategoryItemInstance();\r\n\r\n /**\r\n * Checking if user have permissions to save information\r\n */\r\n if (Mage::helper('lanot_easybanner/admin')->isActionAllowed('manage_category/save')) {\r\n $isElementDisabled = false;\r\n } else {\r\n $isElementDisabled = true;\r\n }\r\n\r\n $form = new Varien_Data_Form();\r\n\r\n $form->setHtmlIdPrefix('category_main_');\r\n\r\n $fieldset = $form->addFieldset('base_fieldset', array(\r\n 'legend' => $this->_getHelper()->__('Category Item Info')\r\n ));\r\n\r\n if ($model->getId()) {\r\n $fieldset->addField('category_id', 'hidden', array(\r\n 'name' => 'id',\r\n ));\r\n }\r\n\r\n //Add main elements to the category\r\n $fieldset->addField('title', 'text', array(\r\n 'name' => 'title',\r\n 'label' => $this->_getHelper()->__('Title'),\r\n 'title' => $this->_getHelper()->__('Title'),\r\n 'required' => true,\r\n 'disabled' => $isElementDisabled\r\n ));\r\n\r\n $fieldset->addField('description', 'textarea', array(\r\n \t'name' => 'description',\r\n \t'label' => $this->_getHelper()->__('Description'),\r\n \t'title' => $this->_getHelper()->__('Description'),\r\n \t'required' => false,\r\n \t'disabled' => $isElementDisabled,\r\n \t'style' => 'height: 100px',\t\r\n ));\r\n \r\n $fieldset->addField('is_active', 'select', array(\r\n \t'name' => 'is_active',\r\n \t'label' => $this->_getHelper()->__('Is Active'),\r\n \t'title' => $this->_getHelper()->__('Is Active'),\r\n \t'required' => true,\r\n \t'disabled' => $isElementDisabled,\r\n \t'options' => $model->getAvailableStatuses(),\r\n ));\r\n\r\n /*\r\n //Add layout updates elements to the category\r\n $lBlock = $this->getLayout()->createBlock('lanot_easybanner/adminhtml_widget_instance_edit_tab_main_layout');\r\n $fieldset = $form->addFieldset('layout_updates_fieldset', array(\r\n 'legend' => $this->_getHelper()->__('Layout Updates')\r\n ));\r\n\r\n $fieldset->addField('layout_updates', 'note', array());\r\n $form->getElement('layout_updates_fieldset')->setRenderer($lBlock);\r\n */\r\n\r\n $form->setValues($model->getData());\r\n \r\n Mage::dispatchEvent('adminhtml_easybanner_category_edit_tab_main_prepare_form', array('form' => $form));\r\n\r\n $this->setForm($form);\r\n\r\n return parent::_prepareForm();\r\n }", "function showSubCategoryUpdate($par_id)\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 \n\t\t if($par_id==0)\n\t\t {\n\t\t\techo '<option selected=\"selected\" value=\"0\">Parent</option>';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t }\n\t\t else\n\t\t {\n\t\t \techo '<option value=\"0\">Parent</option>';\n\t\t }\n\t\t \n\t\t while($parent_sub_cat=mysql_fetch_array($parentdata))\n\t\t {\n\t\t\t if($parent_sub_cat['cat_id']==$par_id)\n\t\t\t {\n\t\t\t\t\techo '<option selected=\"selected\" value=\"'.$parent_sub_cat['cat_id'].'\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.ucfirst($parent_sub_cat['cat_title']).'</option>';\n\t\t \t\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\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\n\t\t\t }\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::viewCategoryUpdate($parent_sub_cat['cat_id'],$par_id);\n\t\t\t } \n\t\t\t \n\t\t }\t\t\t\t\t\t\n\t\t \n\t }", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function addnew(){ // Function Declare for (Add New) \n \t\t\t$data['tab']='tab2';\n \t\t\t$data['prefixLN']='../';\n\t\t \t$data['prefix']='';\n\t\t\t\t$data['profile']= $this->mhome->get_profile_info();\t\n\t\t \t$this->load->view('controlpanel/left_nav',$data);//Showing (Left Nav) on ADD NEW page\n\t\t\t\t\n\t\t\t\t//$data['title']='Categories/Add New';//\n\t\t \t$data['title']='Categoriess';\n\t\n\t\t \t$data['t1']=array(\n\t\t \t\t\t'name'=> 'Categories',\n\t\t \t\t\t'url' => 'all'\n\n\t\t \t\t);\n\t\t \t$data['t2']=array(\n\t\t \t\t\t'name'=> 'New Category',\n\t\t \t\t\t'url' => 'addnew'\n\n\t\t \t\t);\n\t\t \n\t\t \t$data['t3']='';\n\t\t \t$data['t4']='';\n\t\t \t$data['t5']='';\n\t\t \t$data['t6']='';\n\t\t \t$data['t7']='';\n\n\n \t\t\t$data['s_tab']='s_tab2';\n\n \t\t\t//$data['category_code']='Category Code';\n \t\t\t$data['category_name']='Category Name';\n \t\t\t$data['category_img']='Category Image';\n \t\t\t$data['action']=site_url('controlpanel/Catg/create'); //Action for(Create) in controller\n \t\t\t//$data['des']='1';\n\t\t\t\t\n\t\t\t\t\n\n\n\n\n \t\t\t$this->load->view('controlpanel/cat_img',$data);//Showing (Menu View) on ADD NEW page\n \t\t\t\n \t\t}", "function addCategory()\r\n{\r\n global $conn;\r\n global $_POST;\r\n \r\n \r\n if(isset($_POST[\"cat_name\"]) && $_POST[\"cat_name\"]<>''){ \r\n \r\n\t $catname = $_POST[\"cat_name\"];\r\n\t \r\n\t $sqlquery = \"select * from tbl_categories where cat_name= '$catname'\";\r\n\t \r\n\t $result = mysql_query($sqlquery,$conn) or die(mysql_error());\r\n\t if(mysql_num_rows($result) >0){\r\n\t \t$str = \"Data Already Exists\";\r\n\t }else{\r\n\t $sql = \"insert into `tbl_categories` (`cat_name`, `cat_description`) \r\n\t \t\t\tvalues (\" . strtoupper(sqlvalue(@$_POST[\"cat_name\"], true)).\", \" . strtoupper(sqlvalue(@$_POST[\"cat_description\"], true)).\")\";\r\n\t //echo \"SQL :\".$sql;\r\n \tmysql_query($sql, $conn) or die(mysql_error());\r\n\t \tif(mysql_affected_rows()>0){\r\n\t \t\t$str = \"Record Added Successfully\";\r\n\t \t}\r\n\t }\r\n }else{\r\n \t\t$str = \"Wrong Data Entry \";\r\n }\r\n echo $str;\r\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}", "public function subcategory($seo_url)\n {\n\n $login_model = $this->loadModel('Login');\n $this->view->isCaptchaNeeded = $login_model->isCaptchaNeeded();\n if(isset($_SESSION['user_id'])) {\n $user_info_model = $this->loadModel('UserInfo');\n $this->view->userInfo = $user_info_model->getUserInfo($_SESSION['user_id']);\n\n if (!isset($_SESSION['post_code']) AND $this->view->userInfo AND $this->view->userInfo->post_code) {\n $_SESSION['post_code'] = $this->view->userInfo->post_code . ' ' . $this->view->userInfo->city;\n }\n\n if (!isset($_SESSION['user_phone']) AND $this->view->userInfo AND $this->view->userInfo->phone) {\n $this->view->skip_phone = true;\n }\n\n if (!isset($_SESSION['first_name']) AND $this->view->userInfo AND $this->view->userInfo->first_name) {\n $this->view->skip_name = true;\n }\n }\n\n\n $subcategory_model = $this->loadModel('Subcategory');\n $this->view->seo_url = $seo_url;\n $this->view->subcategory = $subcategory_model->getSubcategoryByName($seo_url);\n if(!$this->view->subcategory) {\n header('location: ' . URL .subcategory_SEO . '/');\n }\n $this->view->meta_title = $this->view->subcategory->meta_title;\n $this->view->meta_descr = $this->view->subcategory->meta_descr;\n $this->view->meta_keywords = $this->view->subcategory->meta_keywords;\n $this->view->render('subcategory_view/index');\n }", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}", "public function action_addBook() {\r\n $fieldset = Fieldset::forge('book')->add_model('Model_Book');\r\n $fieldset->delete('category_id');\r\n // get form from fieldset\r\n $form = $fieldset->form();\r\n\r\n // add category to the form\r\n $categories = Model_Category::find('all');\r\n $op = array();\r\n foreach ($categories as $category) {\r\n $op[$category['id']] = $category['name'];\r\n }\r\n\r\n $form->add(\r\n 'category', 'Book category',\r\n array('options' => $op, 'type' => 'radio', 'value' => 'true')\r\n );\r\n // add submit button to the form\r\n $form->add('Submit', '', array('type' => 'submit', 'value' => 'Submit'));\r\n\r\n\r\n // build the form and set the current page as action\r\n $formHtml = $fieldset->build(Uri::create('book/addBook'));\r\n $view = View::forge('book/addBook');\r\n $view->set('form', $formHtml, false);\r\n\r\n if (Input::param() != array()) {\r\n try {\r\n $book = Model_Book::forge();\r\n $book->title = Input::param('title');\r\n $book->author = Input::param('author');\r\n $book->price = Input::param('price');\r\n $book->url = Input::param('url');\r\n $book->category_id= Input::param('category');\r\n\r\n Log::debug('selected category '.$book->category_id);\r\n Log::debug('selected category '.Input::param('category'));\r\n $book->save();\r\n Response::redirect('book');\r\n } catch (Orm\\ValidationFailed $e) {\r\n $view->set('errors', $e->getMessage(), false);\r\n }\r\n }\r\n $this->template->title = \"Book add page\";\r\n $this->template->content = $view; \r\n }", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "function process_odlinksstructure(){\n\tglobal $_GET, $_POST, $table_prefix, $PHP_SELF, $wpdb;\n\t$odlinkssettings = get_option('odlinksdata');\n $view = true;\n\t$id = $_GET['c_id']*1;\n\tif (!$id) $id=0;\n\techo '<div class=\"wrap\"><h2>ODLinks Sturcture - Add/Edit Categories</h2><p>';\n if ($msg) unset($_GET['odlinks_admin_action']);\n\tswitch ($_GET['odlinks_admin_action']){\n\t\tcase \"saveCategory\":\n\t\t\tif ($id==0) {\n\t\t\t\t$today = date(\"Y-m-d\");\n\t\t\t\tif ($_POST['odlinksdata']['c_hide']=='y'){\n\t\t\t\t\t$c_hide = \"hidden\";\n\t\t\t\t} else {$c_hide = \"visible\";}\n\t\t\t\t$position = $wpdb->get_var(\"SELECT MAX(c_position) FROM {$table_prefix}odcategories\")+1;\n\t\t\t\t$sql = \"INSERT INTO {$table_prefix}odcategories (c_parent, c_name, c_title, c_description, c_keywords, c_position, c_status, c_hide, c_date) values ('\".($_POST['odlinksdata']['c_parent']*1).\"', '\".$wpdb->escape($_POST['odlinksdata']['c_name']).\"', '\".$wpdb->escape($_POST['odlinksdata']['c_title']).\"', '\".$wpdb->escape($_POST['odlinksdata']['c_description']).\"', '\".$wpdb->escape($_POST['odlinksdata']['c_keywords']).\"', '\".$position.\"', '\".$_POST['odlinksdata']['c_status'].\"', '\".$c_hide.\"', '\".$today.\"')\";\n if (strlen($_POST['odlinksdata']['c_title']) > 2 ) $wpdb->query($sql);\n\t\t\t} else {\n\t\t\t\tif ($_POST['odlinksdata']['c_hide']=='y'){\n\t\t\t\t\t$c_hide = \"hidden\";\n\t\t\t\t} else {\n\t\t\t\t\t$c_hide = \"visible\";\n\t\t\t\t}\n\t\t\t\t$sql = \"UPDATE {$table_prefix}odcategories SET c_status = '\".$_POST['odlinksdata']['c_status'].\"', c_hide = '\".$c_hide.\"', c_parent = '\".($_POST['odlinksdata']['c_parent']*1).\"', c_title = '\".$wpdb->escape(stripslashes($_POST['odlinksdata']['c_title'])).\"', c_name = '\".$wpdb->escape(stripslashes($_POST['odlinksdata']['c_name'])).\"', c_status = '\".$wpdb->escape(stripslashes($_POST['odlinksdata']['c_status'])).\"', c_hide = '\".$c_hide.\"', c_description = '\".$wpdb->escape(stripslashes($_POST['odlinksdata']['c_description'])).\"' WHERE c_id = '\".($_GET['c_id']*1).\"'\";\n if (strlen($_POST['odlinksdata']['c_title']) > 2 ) $wpdb->query($sql);\n\t\t\t}\n\t\t\t$msg =\"Category Saved.\";\n $view=false;\n\t\tbreak;\n\t\tcase \"editCategory\":\n\t\t\todl_edit_category($id);\n\t\t\t$view = false;\n\t\tbreak;\n\t\tcase \"viewLinks\":\n\t\t\todl_view_links($id);\n\t\t\t$view=false;\n\t\tbreak;\n\t\tcase \"deleteCategory\":\n if ($id<>0) {\n $wpdb->query(\"DELETE FROM {$table_prefix}odcategories WHERE c_id = '\".($id).\"'\");\n $wpdb->query(\"DELETE FROM {$table_prefix}odlinks WHERE l_c_id = '\".($id).\"'\");\n\t\t }\n $msg =\"Category Removed.\";\n $view=false;\n\t\tbreak;\n\t}\n\n\tif ($msg!=''){\n\t\t?>\n\t\t<div id=\"message\" class=\"updated fade\"><?php echo $msg;?></div>\n\t\t<?php\n\t}\n \n\tif ($view) {\n odl_view_category(0);\n } else {\n echo '<p><a href=\"' . $PHP_SELF . '?page=odlinksstructure\">back to main page</a></p>';\n unset($_GET['odlinks_admin_action']);\n }\n\techo '</div>';\n}", "public function AddField()\n {\n echo 'Создалась VirtualCategory - метод Field <hr>';\n }", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "public function add_sub_admin_form()\n\t{\n\t\tif ($this->checkLogin('A') == '') \n\t\t{\n\t\t\tredirect('admin');\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$this->data['heading'] = 'Add Sub-Admin';\n\t\t\t$condition = array();\n\t\t\t$this->load->view('admin/subadmin/add_subadmin', $this->data);\n\t\t}\n\t}", "public function get_category_form_by_ajax() {\n $category_count = $_POST['id'];\n $data['category_id'] = $category_count;\n $data['category_branch_location'] = $this->get_branch_location();\n $data['get_printer'] = $this->get_printer();\n $this->load->view('restaurant/category/insert_category_form', $data);\n }", "function productAdd($con) {\n $slug = addslashes($_POST['slug']);\n $str = '';\n if (isset($_POST['dataCopy']) && $_POST['dataCopy'] != '') {\n $slug = addslashes($_POST['slug']) . rand(1, 99);\n $str = '&dataCopy=' . $_POST['dataCopy'];\n }\n\n if (chkSlug('tbl_product', $slug)) {\n setMessage('Slug already Exist. Try another.', 'alert alert-error');\n redirect('productAdd.php');\n die();\n }\n\n $sku = $_POST['sku'];\n $upc = 1; //$_POST['upc'];\n $chkSkuRs = exec_query(\"SELECT product_id FROM tbl_product WHERE product_sku = '$sku' and is_activate != 4\", $con);\n //$chkUpcRs = exec_query(\"SELECT product_id FROM tbl_product WHERE product_upc = '$upc'\", $con);\n if (mysqli_num_rows($chkSkuRs) > 0) { \n setMessage('Failed, Product SKU must be unique!', 'alert alert-error');\n redirect('productAdd.php');\n die();\n }\n /* elseif(mysql_num_rows($chkUpcRs) > 0){\n setMessage('Failed, Product UPC must be unique!', 'alert alert-error'); redirect('productAdd.php'); die();\n } */\n\n // category validation\n if (isset($_POST['subsubcategory']) && $_POST['subsubcategory'] != 0 && $_POST['subsubcategory'] != '' && !empty($_POST['subsubcategory'])) {\n $cat = $_POST['subsubcategory'];\n } elseif (isset($_POST['subcategory']) && $_POST['subcategory'] != 0 && $_POST['subcategory'] != '' && !empty($_POST['subcategory'])) {\n $cat = $_POST['subcategory'];\n } elseif (isset($_POST['mainCategory']) && $_POST['mainCategory'] != 0 && $_POST['mainCategory'] != '' && !empty($_POST['mainCategory'])) {\n $cat = $_POST['mainCategory'];\n } else {\n setMessage('Some Error Occured in Category Selection!', 'alert alert-error');\n redirect('productAdd.php');\n die();\n }\n\n /* take all selected subcategory in temp subcat col for size */\n $tempSubCatValue = '';\n if (isset($_POST['subcategory']) && !empty($_POST['subcategory'])) {\n foreach ($_POST['subcategory'] AS $val) {\n $tempSubCatValue .= ($tempSubCatValue == '') ? $val : ',' . $val;\n }\n }\n\n $brand = $_POST['brand'];\n $name = addslashes($_POST['name']);\n\n $stock = '';\n if (isset($_POST['stock']) && $_POST['stock'] != '') {\n $stock = $_POST['stock'];\n }\n\n $qty = '';\n if (isset($_POST['qty']) && $_POST['qty'] != '') {\n $qty = $_POST['qty'];\n }\n\n $mcode = '';\n if (isset($_POST['mcode']) && $_POST['mcode'] != '') {\n $mcode = addslashes($_POST['mcode']);\n }\n\n $age_value = '';\n if (isset($_POST['age'])) {\n foreach ($_POST['age'] AS $value) {\n $age_value .= ($age_value == '') ? $value : ',' . $value;\n }\n }\n\n $group_value = '';\n if (isset($_POST['group'])) {\n foreach ($_POST['group'] AS $value) {\n $group_value .= ($group_value == '') ? $value : ',' . $value;\n }\n }\n\n $size_value = '';\n if (isset($_POST['size']) && $_POST['size'] != '' && isset($_POST['sizeUnit']) && $_POST['sizeUnit'] != '') {\n $size_value = $_POST['size'] . ' ' . $_POST['sizeUnit'];\n }\n /* old size if(isset($_POST['size'])){\n foreach($_POST['size'] AS $value){ $size_value .= ($size_value == '')?$value:','.$value; }\n } */\n\n $keyword = '';\n if (isset($_POST['keyword']) && $_POST['keyword'] != '') {\n $keyword = addslashes($_POST['keyword']);\n }\n\n $query = \"INSERT INTO tbl_product(temp_subcategory, brand_id, product_name, slug, qty, product_sku, product_upc, manufacturer_code, user_group, age_group, size, keyword, stock_availability, created_on, created_by) VALUES('$tempSubCatValue', '$brand', '$name', '$slug', '$qty', '$sku', '$upc', '$mcode', '$group_value', '$age_value', '$size_value', '$keyword', '$stock', '\" . date('c') . \"', '\" . $_SESSION['admin'] . \"')\";\n if (exec_query($query, $con)) {\n $product_id = mysqli_insert_id($con);\n\n // category insetrtion\n foreach ($cat AS $value) {\n if ($value != '' && $value != 0) {\n $cat_rs = exec_query(\"INSERT INTO tbl_product_category(product_id, category_id) VALUES('$product_id', '$value')\", $con);\n }\n }\n\n setMessage('Product successfully added. Please give product description & usage.', 'alert alert-success');\n if (isset($_POST['color']) && !empty($_POST['color'])) {\n $_SESSION['color'] = $_POST['color'];\n } else {\n $_SESSION['color'] = array('#ffffff');\n }\n //$_SESSION['sessionProductId'] = $product_id;\n redirect('productAddDesc.php?data1=' . $product_id . $str);\n die();\n } else {\n setMessage('Some Error Occured, Try Again..', 'alert alert-error');\n }\n redirect('productAdd.php');\n die();\n}", "public function newcategory() {\n\n if (ckeckAddmin()) {\n $this->load->view('admin/header/header');\n $this->load->view('admin/css/css');\n $this->load->view('admin/topnav/topnav');\n $this->load->view('admin/sidenav/sidenav');\n $this->load->view('admin/content/addcatogry');\n $this->load->view('admin/footer/footer');\n # $this->load->view('admin/js/extra');\n $this->load->view('admin/js/js');\n } else {\n CustomFlash('Admin/login', 'alert-danger', 'plz First Login');\n }\n }", "public static function func_ajax_add_category() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n $self = self::sanitize($_POST['name']);\n $day = self::sanitize($_POST['day']);\n $desc = self::sanitize($_POST['description']);\n $wpdb->query($wpdb->prepare( \"INSERT INTO \".$wpdb->prefix.self::$table_name .\" VALUES (%d, %s, %s, %s)\", null, $self,$day,$desc ));\n die();\n\t\t\t\t}\n\t\t\n\t\t}" ]
[ "0.7845029", "0.72772086", "0.7248909", "0.69779617", "0.6976178", "0.69613826", "0.69456404", "0.68882364", "0.6874051", "0.6847088", "0.6840655", "0.6832333", "0.6806601", "0.6803466", "0.67945325", "0.6784531", "0.6783481", "0.6778899", "0.67330074", "0.67083544", "0.6706988", "0.66933256", "0.66867447", "0.6669162", "0.6667678", "0.6636583", "0.6625865", "0.6593597", "0.65748906", "0.65747476", "0.6569922", "0.6568551", "0.6567704", "0.65655786", "0.65645915", "0.6551352", "0.6551097", "0.6549507", "0.6546019", "0.6541783", "0.65396637", "0.65318835", "0.6524613", "0.6513897", "0.65079856", "0.6506631", "0.650346", "0.64987516", "0.6498196", "0.6489316", "0.64879715", "0.6478166", "0.64730316", "0.6461034", "0.644284", "0.64322305", "0.6430668", "0.64301527", "0.64230317", "0.641496", "0.64135224", "0.6392947", "0.6384134", "0.6379014", "0.6375271", "0.6374692", "0.63738155", "0.63573563", "0.6346633", "0.6346622", "0.6329384", "0.6328739", "0.63184696", "0.63106847", "0.6304436", "0.6300601", "0.62901884", "0.6280989", "0.6278257", "0.6276768", "0.62758714", "0.62715036", "0.6270081", "0.6265635", "0.6260789", "0.6259645", "0.6257823", "0.62468827", "0.62392414", "0.6238729", "0.62339103", "0.62267226", "0.6223627", "0.62230694", "0.6221084", "0.62048566", "0.6202464", "0.6176693", "0.6175927", "0.61746573", "0.6173664" ]
0.0
-1
Need use as _prepareLayout but problem in declaring collection from another block (was problem with search result)
protected function _beforeToHtml() { $toolbar_top = $this->getToolbarBlock(); $toolbar_bottom = $this->getBottomToolbarBlock(); // called prepare sortable parameters $collection = $this->_getProductCollection(); // use sortable parameters if ($orders = $this->getAvailableOrders()) { $toolbar_top->setAvailableOrders($orders); $toolbar_bottom->setAvailableOrders($orders); } if ($sort = $this->getSortBy()) { $toolbar_top->setDefaultOrder($sort); } if ($dir = $this->getDefaultDirection()) { $toolbar_top->setDefaultDirection($dir); } if ($modes = $this->getModes()) { $toolbar_top->setModes($modes); $toolbar_bottom->setModes($modes); } // set collection to toolbars and apply sort $toolbar_top->setCollection($collection); $toolbar_bottom->setCollection($collection); $toolbar_top->setTemplate('catalog/product/list/toolbar_top.phtml'); $this->setChild('toolbar_top', $toolbar_top); $toolbar_bottom->setTemplate('catalog/product/list/toolbar_bottom.phtml'); $this->setChild('toolbar_bottom', $toolbar_bottom); Mage::dispatchEvent('catalog_block_product_list_collection', array( 'collection' => $this->_getProductCollection() )); $this->_getProductCollection()->load(); return parent::_beforeToHtml(); }
{ "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 _prepareLayout(){\r\n return $this;\r\n }", "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 $collection = Mage::getModel('lavi_news/news')->getResourceCollection();\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "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 }", "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 $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 /* @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 {\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 }", "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::getResourceModel($this->_getCollectionClass());\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function buildLayout()\n {\n if (empty($this->layout)) {\n /** @var CacheInterface $cache */\n if (($cache = Application::getConfig()->getCacheInstance()) && $cache->exists('layout')) {\n $this->layout = unserialize($cache->get('layout'));\n\n return $this;\n }\n\n /** @var Collection $layout */\n $layout = Application::getClass('\\Jcode\\DataObject\\Collection');\n $requests = $this->collectLayoutXml();\n\n foreach ($this->collectLayoutXml() as $request) {\n /** @var Request $request */\n if ($request->getExtends()) {\n /** @var Request $parentRequest */\n $parentRequest = $requests[$request->getExtends()];\n\n /** @var Reference $reference */\n foreach ($parentRequest->getReferences() as $reference) {\n if (!$request->getReference(($reference->getName()))) {\n $request->addReference(clone $reference);\n }\n }\n }\n\n /** @var Reference $reference */\n foreach ($request->getReferences() as $reference) {\n if (!$request->referenceExists($reference)) {\n continue;\n }\n\n if ($reference->getExtends()) {\n $newReference = clone $request->getReference($reference->getExtends());\n\n foreach ($reference->getBlocks() as $block) {\n $newReference->addBlock($block);\n }\n\n $request->removeReference($request->getReference($reference->getExtends()));\n $request->removeReference($reference);\n $request->addReference($newReference);\n }\n\n if ($reference->getExtends()) {\n $request->removeReference($reference);\n }\n }\n\n foreach ($request->getReferences() as $reference) {\n /** @var Block $block */\n foreach ($reference->getBlocks() as $block) {\n if (!$reference->blockExists($block)) {\n continue;\n }\n\n if ($block->getExtends()) {\n $newBlock = $reference->getBlock($block->getExtends());\n\n if ($block->getClass()) {\n $newBlock->setClass($block->getClass());\n }\n\n if ($block->getTemplate()) {\n $newBlock->setTemplate($block->getTemplate());\n }\n\n foreach ($block->getMethods() as $method => $values) {\n foreach ($values as $value) {\n $newBlock->addMethod($method, $value);\n }\n }\n\n $reference->removeBlock($block);\n $reference->removeBlock($reference->getBlock($block->getExtends()));\n $reference->addblock($newBlock);\n }\n }\n }\n\n $layout->addItem($request, $request->getPath());\n }\n\n $this->layout = $layout;\n\n /** @var CacheInterface $cache */\n if (($cache = Application::getConfig()->getCacheInstance()) && !$cache->exists('layout')) {\n $cache->set('layout', serialize($layout));\n }\n }\n\n return $this;\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 _prepareLayout()\n\t{\n\t\treturn parent::_prepareLayout();\n\t}", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('oggetto_oneclick/order')->getResourceCollection();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function initLayout();", "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}", "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('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 }", "protected function _prepareLayout()\n {\n return $this;\n }", "protected function _prepareLayout()\n {\n return $this;\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 _prepareCollection()\n {\n $collection = $this->collectionFactory->create();\n $this->setCollection($collection);\n\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()\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() {\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 _prepareLayout()\n {\n $this->setChild( 'search_form',\n $this->getLayout()->createBlock( $this->_blockGroup.'/' . $this->_controller . '_search',\n $this->_controller . '.search'));\n \n\t\treturn parent::_prepareLayout();\n }", "protected function _prepareLayout()\n {\n /** @var $tm \\Jamersan\\GoogleTagManager\\Block\\DataLayer */\n $tm = $this->getParentBlock();\n\n $tm->addVariable(\n 'list',\n 'detail'\n );\n\n /** @var $product \\Magento\\Catalog\\Api\\Data\\ProductInterface */\n $product = $this->getProduct();\n\n if ($product) {\n $tm->addVariable(\n 'product',\n [\n 'id' => $product->getId(),\n 'sku' => $product->getSku(),\n 'name' => $product->getName(),\n 'price' => $product->getTypeId() == Type::TYPE_SIMPLE ? $tm->formatPrice($product->getPrice()) : $tm->formatPrice($product->getFinalPrice()),\n 'attribute_set_id' => $product->getAttributeSetId(),\n 'path' => implode(\" > \", $this->getBreadCrumbPath())\n ]\n );\n }\n\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 }", "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 }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('iparcel/log')->getCollection();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\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 _prepareLayout()\n {\n $this->_getGiveawayCollection();\n\n // add Home breadcrumb\n $oBreadcrumbs = $this->getLayout()->getBlock('breadcrumbs');\n\n // if we don't have breadcrumbs in layout, just continue\n if (!$oBreadcrumbs) {\n return parent::_prepareLayout();\n }\n\n $sTitle = $this->__('Free Allowances');\n if ($oBreadcrumbs) {\n $oBreadcrumbs->addCrumb(\n 'home',\n array(\n 'label' => $this->__('Home'),\n 'title' => $this->__('Go to Home Page'),\n 'link' => Mage::getBaseUrl()\n )\n )->addCrumb(\n 'giveaway',\n array(\n 'label' => $sTitle,\n 'title' => $sTitle\n )\n );\n }\n\n // modify page title\n $oHeadBlock = $this->getLayout()->getBlock('head');\n if ($oHeadBlock) {\n $oHeadBlock->setTitle($sTitle);\n }\n\n $oTitleBlock = $this->getLayout()->createBlock('sitewards_giveaway/product_listTitle')\n ->setTemplate('sitewards/giveaway/catalog/product/list_title.phtml');\n $this->getLayout()->getBlock('content')->insert($oTitleBlock);\n\n return parent::_prepareLayout();\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 {\n $collection = Mage::getModel('solutionpartner/partner')->getCollection();\n $collection->getSelect()->joinLeft(\n array('order' => $collection->getTable('sales/order')),\n 'main_table.email = order.customer_email AND order.status = \"complete\"',\n array(\n 'order_id' => 'entity_id',\n 'order_status' => 'order.status',\n 'number_qtys' => 'count(order.entity_id)'\n ))\n ->group('main_table.solutionpartner_id');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "function afterLayout() { \t\t\n }", "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}", "abstract protected function collectionLoader();", "function initLayout(){\n $layout = array(\n 'left' => array(\n 'ProfileInfo' => array(\n 'title' => 'Profile Info',\n 'minimize' => false,\n ),\n 'EmailInboxMenu' => array(\n 'title' => 'Inbox Menu',\n 'minimize' => false,\n ),\n 'ActionMenu' => array(\n 'title' => 'Actions',\n 'minimize' => false,\n ),\n 'TopContacts' => array(\n 'title' => 'Top Contacts',\n 'minimize' => false,\n ),\n 'RecentItems' => array(\n 'title' => 'Recently Viewed',\n 'minimize' => false,\n ),\n 'ActionTimer' => array(\n 'title' => 'Action Timer',\n 'minimize' => true,\n ),\n 'UserCalendars' => array(\n 'title' => 'User Calendars',\n 'minimize' => false,\n ),\n 'CalendarFilter' => array(\n 'title' => 'Filter',\n 'minimize' => false,\n ),\n 'GroupCalendars' => array(\n 'title' => 'Group Calendars',\n 'minimize' => false,\n ),\n 'FilterControls' => array(\n 'title' => 'Filter Controls',\n 'minimize' => false,\n ),\n 'SimpleFilterControlEventTypes' => array(\n 'title' => 'Event Types',\n 'minimize' => false,\n ),\n ),\n 'right' => array(\n 'SmallCalendar' => array(\n 'title' => 'Small Calendar',\n 'minimize' => false,\n ),\n 'ChatBox' => array(\n 'title' => 'Activity Feed',\n 'minimize' => false,\n ),\n 'GoogleMaps' => array(\n 'title' => 'Google Map',\n 'minimize' => false,\n ),\n 'OnlineUsers' => array(\n 'title' => 'Active Users',\n 'minimize' => false,\n ),\n 'TagCloud' => array(\n 'title' => 'Tag Cloud',\n 'minimize' => false,\n ),\n 'TimeZone' => array(\n 'title' => 'Clock',\n 'minimize' => false,\n ),\n 'SmallCalendar' => array(\n 'title' => 'Calendar',\n 'minimize' => false,\n ),\n 'QuickContact' => array(\n 'title' => 'Quick Contact',\n 'minimize' => false,\n ),\n 'MediaBox' => array(\n 'title' => 'Files',\n 'minimize' => false,\n ),\n ),\n 'hiddenRight' => array(\n 'ActionMenu' => array(\n 'title' => 'My Actions',\n 'minimize' => false,\n ),\n 'MessageBox' => array(\n 'title' => 'Message Board',\n 'minimize' => false,\n ),\n 'NoteBox' => array(\n 'title' => 'Note Pad',\n 'minimize' => false,\n ),\n 'DocViewer' => array(\n 'title' => 'Doc Viewer',\n 'minimize' => false,\n ),\n 'TopSites' => array(\n 'title' => 'Top Sites',\n 'minimize' => false,\n ),\n ),\n );\n if(Yii::app()->contEd('pro')){\n if(file_exists('protected/config/proWidgets.php')){\n foreach(include('protected/config/proWidgets.php') as $loc=>$data){\n if (isset ($layout[$loc]))\n $layout[$loc] = array_merge($layout[$loc],$data);\n }\n }\n }\n return $layout;\n }", "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 }", "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 }", "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 }", "protected function _prepareLayout()\n {\n\n\t\t\n $addButtonProps = [\n 'id' => 'add_new',\n 'label' => __('Add New'),\n 'class' => 'add primary',\n 'button_class' => '',\n 'class_name' => 'Magento\\Backend\\Block\\Widget\\Button',\n 'onclick' => \"setLocation('\" . $this->_getCreateUrl() . \"')\",\n ];\n\t\t\n $this->buttonList->add('add_new', $addButtonProps);\n\t\t\n\t\t$addUploadButtonProps = [\n 'id' => 'upload_csv',\n 'label' => __('Upload CSV'),\n 'class' => 'add primary',\n 'button_class' => '',\n 'class_name' => 'Magento\\Backend\\Block\\Widget\\Button',\n\t\t\t'onclick' => \"setLocation('\" . $this->_getUploadUrl() . \"')\",\n ];\n $this->buttonList->add('upload_csv', $addUploadButtonProps);\n\t\t\n\n $this->setChild(\n 'grid',\n $this->getLayout()->createBlock('Serole\\MemberList\\Block\\Adminhtml\\Memberlist\\Grid', 'serole.memberlist.grid')\n );\n return parent::_prepareLayout();\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 $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 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}", "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 }", "protected function _afterPrepareDocumentData()\n {\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 {\n $baseQuery = $this->_getBaseSearchQuery();\n $productIds = $this->_getProductIdsFromSearchQuery($baseQuery);\n\n if (empty($productIds)) {\n $productIds = array(0);\n }\n\n $attributes = Mage::getModel('catalog/config')->getProductCollectionAttributes();\n\n /** @var Mage_Catalog_Model_Resource_Product_Collection $collection */\n $collection = Mage::getResourceModel('catalog/product_collection')\n ->addIdFilter($productIds)\n ->addAttributeToSelect($attributes);\n\n $storeIds = implode(\",\", array_unique(array_map(\"intval\", array(Mage_Core_Model_App::ADMIN_STORE_ID, $this->getStoreId()))));\n\n if ($this->getStoreId() != Mage_Core_Model_App::ADMIN_STORE_ID) {\n $collection->setStoreId($this->getStoreId());\n $joinCond = \"category_id = \" . (int) $this->getCategory()->getId() . \" AND store_id = {$this->getStoreId()}\";\n } else {\n $joinCond = \"category_id = \" . (int) $this->getCategory()->getId() . \" AND store_id IN ({$storeIds})\";\n }\n\n $collection->joinField(\n 'position',\n 'smile_virtualcategories/category_product_position',\n 'position',\n 'product_id = entity_id',\n $joinCond,\n 'left'\n );\n\n $collection->getSelect()->order(\n new Zend_Db_Expr(\"- position DESC\") // mimic a \"SORT BY #field NULL LAST\n );\n\n $entityIds = implode(\",\", $productIds);\n $collection->getSelect()->order(\n new Zend_Db_Expr(\"FIELD(e.entity_id, {$entityIds})\") // restore sort order given by ES\n );\n\n $this->setCollection($collection);\n\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 $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 _prepareLayout()\n\t{\n\t\t$this->getLayout()->getBlock('head')->setTitle($this->__($this->_helper->pageTitle()));\n $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');\n\t\t$this->getLayout()->getBlock('head')->addCss('css/extrembler/prelogin/form.css');\n\t\t$this->getLayout()->getBlock('root')->unsetChild('header');\n\t\t$this->getLayout()->getBlock('content')->insert('store_language');\n\t\t$this->getLayout()->getBlock('root')->unsetChild('footer');\n\t return parent::_prepareLayout();\n\t}", "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() {\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 _prepareLayout()\n {\n if (!Mage::app()->isSingleStoreMode()) {\n $this->setChild('store_switcher',\n $this->getLayout()->createBlock('adminhtml/store_switcher')\n ->setUseConfirm(false)\n ->setSwitchUrl($this->getUrl('*/*/*', array('store'=>null)))\n );\n }\n $this->setChild('grid', $this->getLayout()->createBlock('advancedattributes/manage_filters_grid', 'filters.grid'));\n return parent::_prepareLayout();\n }", "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 collectChildren(): void\n {\n $this->collection = new Collection();\n foreach ($this->rawResults as $blockChildContent) {\n $this->collection->add(Block::fromResponse($blockChildContent));\n }\n }", "public function getPageLayout() {}", "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 $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 }", "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 _prepareLayout()\r\n {\r\n parent::_prepareLayout();\r\n $pager = $this->getLayout()\r\n ->createBlock('page/html_pager', self::PAGER_BLOCK_NAME)\r\n ->setCollection($this->getCollection());\r\n /**\r\n * setting available limits for pager\r\n */\r\n $pager->setAvailableLimit(array(\r\n 10 => 10,\r\n 20 => 20,\r\n 50 => 50,\r\n ));\r\n $this->setChild('pager', $pager);\r\n\r\n return $this;\r\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 _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 renderLayout();", "function beforeLayout() {\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 }", "public function buildListLayout(): void\n {\n $this->addColumn('name', 3)\n ->addColumn('pseudo', 3)\n ->addColumn('role_id', 3)\n ->addColumn('created_at', 3);\n }", "protected function prepareRendering() {}", "protected function _prepareLayout()\n {\n try{\n if($this->currentApiResponseView->get() instanceof ApiResponseViewInterface)\n {\n return $this;\n }\n\n if($this->isApiFallback())\n {\n return $this;\n }\n\n $this->apiContext->setProductId($this->getContextItemId())\n ->setWidget($this->getWidget())\n ->setHitCount($this->getHitCount());\n\n $this->apiLoader\n ->setRequest($this->requestWrapper->setRequest($this->_request))\n ->setApiContext($this->apiContext)\n ->load();\n } catch (\\Throwable $exception)\n {\n $this->_logger->warning(\"BoxalinoAPI PDP Error on {$this->getType()}: \" . $exception->getMessage());\n $this->_logger->debug(\"BoxalinoAPI PDP Error on {$this->getType()}: \" . $exception->getTraceAsString());\n\n $this->apiLoader->getApiResponsePage()->setFallback(true);\n }\n\n return $this;\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 }", "function prepareForBuildPage() \n\t{\n\t\t// save recs\n\t\t//$this->save();\n\t\t// PRG rule, to avoid POSTDATA resend\n\t\t$this->rulePRG();\t\n\t\t//Sorting fields\n\t\t$this->buildOrderParams();\n\t\t// fill data\n\t\t$this->fillMembers();\n\t\t$this->fillGroups();\n\t\t// build sql query\n\t\t$this->buildSQL();\n\t\t// build pagination block\n\t\t$this->buildPagination();\n\t\t// seek page must be executed after build pagination\n\t\tif ($this->sortByGroup===false)\n\t\t\t$this->seekPageInRecSet($this->querySQL);\t\t\t\t\t\n\t\telse\n\t\t\t$this->recSet = db_query($this->querySQL, $this->conn);\n\t\t// fill grid data\n\t\t$this->fillGridData();\n\t\t// build search panel\n\t\t$this->buildSearchPanel(\"adv_search_panel\");\n\t\t// add common js code\n\t\t$this->addCommonJs();\n\t\t// add common html code\n\t\t$this->addCommonHtml();\n\t\t// Set common assign\n\t\t$this->commonAssign();\n\t\t// build admin block\t\t\n\t\t$this->assignAdmin();\t\n\t}", "abstract protected function _generateDataCollection();", "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 init() {\n $this->_renderLayout = 0;\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 _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 }", "protected function setupLayout()\n\t{\n\n $this->user = Auth::user();\n $this->theme = Theme::uses('default')->layout('default');\n $user = $this->user;\n $this->theme->bind('user', function() use($user)\n {\n return $user;\n });\n $cat = Category::all();\n $this->theme->bind('cat', function() use($cat)\n {\n return $cat;\n });\n if (Session::get('cart')){\n $cart_count = count(Session::get('cart'));\n $this->theme->bind('cart_count', function() use($cart_count)\n {\n return $cart_count;\n });\n }\n\t}", "protected function _prepareSubset() {}", "public function prepare_response_for_collection($response)\n {\n }", "protected function setupLayout() {\n\t\t$this->data['route'] = Route::getCurrentRoute()->getPath();\t\n\t\tif ( ! is_null($this->layout)) {\n\t\t\t$this->data['enrolledCourses'] = NULL;\n\t\t\t\n\t\t\tif (Auth::check() && in_array(Auth::user()->user_type, array(3, 5))) {\n\t\t\t\t$this->data['enrolledCourses'] = EnrolledCourses::getEnrolledCourses();\n\t\t\t\t$this->data['endedCourses'] = EnrolledCourses::getEndedCourses();\n\t\t\t\t$this->data['profiling'] = User::getRegProfile();\t\n\t\t\t\t$this->data['profiling_ctr'] = $this->data['profiling'];\t\t\t\t\n\t\t\t} else if (Auth::check() && Auth::user()->user_type == 2) {\n\t\t\t\t$this->data['assigned_courses'] = Courses::getAssignedCourses();\n\t\t\t}\n\n\t\t\t$this->layout = View::make($this->layout, $this->data);\n\t\t}\n\t}", "public function init()\n {\n \t$arr_sitemap_nodes_main = CMS_Model_CMSSitemap::getSitemapByHandle('MAIN')->getSitemapNodes(6);\n \t\n \t$this->view->assign('arr_sitemap_nodes_main',$arr_sitemap_nodes_main);\n }", "protected function setupLayout()\n\t{\n\t\tdefine(\"aol_institute\", 68);\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function prepareMyData(){\n\t\tglobal $C;\n if( $this->id > 0 ){\n $this->get( \"`id`={$this->id}\" );\n $this->unstoreSfield();\n }\n\t\t$C->setID( $this->data['parent'] );\n\t\t$C->get( \"`id`={$this->data['parent']}\" );\n\t\t$C->unstoreSfield();\n $p = $C->getData();\n if( is_array( $p ) ){\n\t\t\tT::assign( \"parent\", $p[\"name\"] );\n\t\t\t$fieldlist=array();\n if( is_array( $p[\"fields\"] ) )\n foreach( $p[\"fields\"] as $key => $item ){\n $fieldlist[] = array( \"cnt\" => $key, \"name\" => $item, \"value\"=> $this->data[$this->sfield][$key] );\n }\n\t\t\tT::assign( \"fieldlist\", $fieldlist );\n }\n\t\tT::assign( \"f\", $this->sfield );\n\t\tT::assign( \"item\",$this->data );\t\t\n\t}", "function atwork_field_collection_view($variables) {\n\n $fcid = reset(array_keys($variables['element']['entity']['field_collection_item']));\n $field_collection = field_collection_item_load($fcid);\n\n $question_field = '';\n switch ($field_collection->field_name) {\n case 'field_career':\n $question_field = 'field_career_question';\n break;\n case 'field_personal':\n $question_field = 'field_personal_question';\n break;\n case 'field_philosophy_influences':\n $question_field = 'field_philosophy_question';\n break;\n }\n\n if ($question_field) {\n\n $display = field_get_items('field_collection_item', $field_collection, 'field_display');\n $answer = field_get_items('field_collection_item', $field_collection, 'field_answer');\n\n $question = field_get_items('field_collection_item', $field_collection, $question_field);\n $question_info = field_info_instance('field_collection_item', $question_field, $field_collection->field_name);\n $questions = list_extract_allowed_values($question_info['widget']['settings']['select_list_options'], 'list_text', FALSE);\n if (is_numeric($question[0]['value'])) {\n $question[0]['value'] = $questions[$question[0]['value']];\n }\n\n if ($display[0]['value'] == 1 && $question[0]['value'] && $answer[0]['value']) {\n drupal_add_library('system', 'drupal.collapse');\n\n $dom = filter_dom_load($variables['element']['#children']);\n $xpath = new DOMXPath($dom);\n foreach ($xpath->query('//ul[@class=\"field-collection-view-links\"]') as $links) {\n $field_collection_links = $dom->saveXML($links);\n }\n\n $class = str_replace('_', '-', $field_collection->field_name);\n\n $variables['element']['#children'] = <<<EOT\n<div class=\"entity entity-field-collection-item field-collection-item-$class clearfix\" about=\"/field-collection/$class/$fcid\" typeof=\"\">\n <div class=\"content\">\n <fieldset class=\" collapsible collapsed\">\n <legend><span class=\"fieldset-legend\">{$question[0]['value']}</span></legend>\n <div class=\"fieldset-wrapper\">\n {$answer[0]['value']}\n </div>\n </fieldset>\n </div>\n</div>\nEOT;\n }\n }\n\n $element = $variables['element'];\n return '<div' . drupal_attributes($element['#attributes']) . '>' . $element['#children'] . '</div>';\n}", "abstract function buildShowLayout(): void;", "protected function _constructMainLayout()\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'create main layout for display',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n if ($this->_get) {\n $typ = $this->_get->pageType();\n } else {\n $typ = NULL;\n }\n\n switch ($typ) {\n case'css': case'js':\n $this->DISPLAY['core'] = '{;css_js;}';\n break;\n\n default:\n $this->layout($this->_defaultOptions['template']);\n break;\n }\n }", "function template_preprocess_openskydora_basic_collection_wrapper(&$variables) {\n $islandora_object = $variables['islandora_object'];\n\n /* \n // figure out why the following is here before enabling it ...\n if (openskydora_islandora_object_access (\"\", $islandora_object, $variables['user']) === FALSE) {\n return false;\n }\n */\n\n module_load_include('inc', 'openskydora', 'includes/utilities');\n if (!openskydora_has_subcollections($islandora_object->id)) {\n // we don't want to redirect if there is more to the url\n // e.g., /islandora/objects/islandora%3Ajonscollection/datastream/TN/view\n\n openskydora_redirect_to_search_view($islandora_object->id);\n return;\n }\n}", "public function getLayout() {}", "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 }", "function view() {\r\n global $tmpl;\r\n $tmpl->setAttribute('list','visibility','visible');\r\n\r\n $sql=\"SELECT *\r\n FROM student_researchers\r\n ORDER BY last\";\r\n global $db;\r\n $researchers = $db->getAll($sql);\r\n\r\n // determine how many projects are associated with this resarcher\r\n foreach($researchers as $key=>$researcher) {\r\n $sql = \"SELECT COUNT(*) AS numprojects FROM student_research WHERE studentResearcherID = \" . $researcher['id'];\r\n $numProjects = $db->getRow($sql);\r\n $researchers[$key]['numprojects'] = $numProjects['numprojects'];\r\n }\r\n\r\n if(count($researchers)>0){\r\n $tmpl->addRows('mainlist',$researchers);\r\n }\r\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 }", "public function init()\n {\n \t$this->view->layout = array();\n }", "public function _prepareLayout()\n {\n $this->setTemplate('authorizenetcim/form/cc.phtml');\n }", "protected function _prepareLayout() {\n\n //add button \"add new video\"\n $this->setChild('add_button',\n $this->getLayout()->createBlock('adminhtml/widget_button')\n ->setData(array(\n 'label' => Mage::helper('video')->__('Add New Video'),\n 'class' => 'add',\n 'id' => 'add_new_option',\n 'on_click' => 'video.add()'\n ))\n );\n\n //add like a child block with list of videos\n $this->setChild('video_box', $this->getLayout()->createBlock('video/video_list'));\n return parent::_prepareLayout();\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}" ]
[ "0.6813128", "0.67679286", "0.6746976", "0.66857326", "0.6673509", "0.6657748", "0.65986603", "0.65978336", "0.6545874", "0.64322394", "0.63644415", "0.6344732", "0.63308483", "0.62322503", "0.62122494", "0.6208193", "0.61997765", "0.61782855", "0.6132371", "0.61199653", "0.61199653", "0.6119537", "0.61043113", "0.6069292", "0.6055111", "0.6049806", "0.6028717", "0.60191995", "0.6004077", "0.59461385", "0.59310126", "0.5853271", "0.5831714", "0.58294505", "0.5780894", "0.57742864", "0.57725346", "0.5771346", "0.57615626", "0.5747507", "0.57285064", "0.57251406", "0.57037985", "0.5699383", "0.5695683", "0.56946594", "0.56926936", "0.5680051", "0.5678437", "0.56781346", "0.5673346", "0.56724054", "0.5651283", "0.56277305", "0.5606532", "0.560273", "0.5594174", "0.55881274", "0.55880237", "0.55788475", "0.5577555", "0.5576695", "0.5574154", "0.5555091", "0.5552702", "0.5546474", "0.552759", "0.5519652", "0.5504651", "0.5500615", "0.55003566", "0.5497825", "0.5496997", "0.5496997", "0.5496997", "0.5495918", "0.54913586", "0.5488725", "0.54569286", "0.5442974", "0.54396695", "0.5436768", "0.54349613", "0.5426113", "0.54205024", "0.5419949", "0.5402985", "0.53880316", "0.53799826", "0.5378961", "0.53776515", "0.53679615", "0.53648823", "0.53645015", "0.5360158", "0.5350029", "0.5349869", "0.53375757", "0.53341025", "0.5333476", "0.5333331" ]
0.0
-1
Retrieve Toolbar bottom block
public function getBottomToolbarBlock() { $blockName = self::TOOLBAR_BOTTOM; if ($block = $this->getLayout()->getBlock($blockName)) { return $block; } $block = $this->getLayout()->createBlock($this->_defaultToolbarBlock, microtime()); return $block; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getToolbarPosition()\n {\n return $this->toolbar['position'];\n }", "public function &getToolbar()\n {\n return $this->toolbar;\n }", "public function getBottomUserSpace() {}", "public function getToolbarHtml()\n {\n return $this->getChildHtml('toolbar');\n }", "public function getToolbarHtml()\n {\n return $this->getChildHtml('toolbar');\n }", "public function getToolbarHtml()\n {\n $cedToolbar = $this->getChildHtml('toolbar');\n return $cedToolbar;\n }", "function asu_brand_get_block_footer() {\n $settings = asu_brand_get_block_settings();\n $cache_id = 'asu_brand:footer';\n return asu_brand_get_cached_content($cache_id, $settings->footer_path);\n}", "function getBottomHTML() {\n\t\treturn $this->_bottomHTML;\n\t}", "public function atBottom() {\n }", "public function getToolbarItems();", "public function getTop();", "public function get_toolbar_positions() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_toolbar_positions();\n\n }", "function get_toolbars()\n {\n }", "function getToolbar() {\n //load the JToolBar library and create a toolbar\n jimport('joomla.html.toolbar');\n $bar = new JToolBar('toolbar');\n\n $bar->appendButton('Standard', 'archive', JText::_('COM_EASYSDI_SHOP_BASKET_BTN_SAVE'), 'basket.draft', false);\n $bar->appendButton('Separator');\n if (!$this->item->free) {\n $bar->appendButton('Standard', 'edit', JText::_('COM_EASYSDI_SHOP_BASKET_BTN_ESTIMATE'), 'basket.estimate', false);\n $bar->appendButton('Separator');\n }\n $bar->appendButton('Standard', 'publish', JText::_('COM_EASYSDI_SHOP_BASKET_BTN_ORDER'), 'basket.order', false);\n\n //generate the html and return\n return $bar->render();\n }", "public function isexpandedcontentEnablebottom()\r\n\t{\r\n\t\treturn $this->expandedcontentEnablebottom;\r\n\t}", "static function album_bottom($theme) {\n $block = new Block;\n $block->css_id = \"g-fotomoto\";\n $block->anchor = \"fotomoto\"; \n $view = new View(\"fotomotorw_album_block.html\");\n $block->content = $view;\n return $block;\n }", "function udesign_main_content_bottom() {\r\n do_action('udesign_main_content_bottom');\r\n}", "function magazinevibe_edge_get_footer_top() {\n\n\t\t$parameters = array();\n\n\t\t$parameters['footer_in_grid'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? true : false;\n\t\t$parameters['footer_top_classes'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? '' : 'edgtf-footer-top-full';\n\t\t$parameters['footer_top_columns'] = magazinevibe_edge_options()->getOptionValue('footer_top_columns');\n\n\t\tmagazinevibe_edge_get_module_template_part('templates/parts/footer-top', 'footer', '', $parameters);\n\t}", "public function getBreadcrumbsBlock()\n {\n return $this->getLayout()->getBlock(\"breadcrumbs\");\n }", "function adaline_bottom_bar() {\n\n\techo '<div class=\"bottom-bar\"><div class=\"wrap\">';\n\n\tgenesis_widget_area( 'bottom-bar-left', array(\n\t\t'before' => '<div class=\"bottom-bar-left\">',\n\t\t'after' => '</div>',\n\t) );\n\n\techo '</div></div>';\n \n}", "function asu_brand_get_block_students_footer() {\n $settings = asu_brand_get_block_settings();\n $cache_id = 'asu_brand:students_footer';\n return asu_brand_get_cached_content($cache_id, $settings->students_footer_path);\n}", "private function renderBottom() {\n\t\t$bottom = '';\n\t\tif ($this->type == 'RSS2') {\n\t\t\t$bottom .= $this->closeTag('channel');\n\t\t\t$bottom .= $this->closeTag('rss');\n\t\t} elseif ($this->type == 'RSS1') {\n\t\t\t$bottom .= $this->closeTag('rdf:RDF');\n\t\t} else if ($this->type == 'Atom') {\n\t\t\t$bottom .= $this->closeTag('feed');\n\t\t}\n\t\treturn $bottom;\n\t}", "function udesign_bottom_section_bottom() {\r\n do_action('udesign_bottom_section_bottom');\r\n}", "function magazinevibe_edge_get_footer_bottom() {\n\n\t\t$parameters = array();\n\n\t\t$parameters['footer_in_grid'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? true : false;\n $parameters['footer_bottom_classes'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? '' : 'edgtf-footer-top-full';\n\t\t$parameters['footer_bottom_columns'] = magazinevibe_edge_options()->getOptionValue('footer_bottom_columns');\n\n\t\tmagazinevibe_edge_get_module_template_part('templates/parts/footer-bottom', 'footer', '', $parameters);\n\t}", "public function getBottomPixels()\n {\n return $this->bottom_pixels;\n }", "protected function renderToolbar() {}", "public static function get_shop_toolbar_option() {\n\t\t\treturn astra_get_option( 'shop-toolbar-structure', array() );\n\t\t}", "public static function getBottomMenu(){\n return ObjectDB::getAllOnField(self::$table, __CLASS__, \"type\", false,\"id\");\n\n }", "function udesign_page_content_bottom() {\r\n do_action('udesign_page_content_bottom');\r\n}", "public function getButtonPosition()\n {\n $position = $this->scopeConfig->getValue(\n self::CONFIG_POSITION,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n if (!$position) {\n return 'bottom-right';\n }\n return $position;\n }", "public function getFooter();", "public function getFooter();", "public function context_handy_toolbar() {\n $rendered = \"\";\n $context = $this->page->context;\n\n $items = $this->page->navbar->get_items();\n $currentnode = end($items);\n\n // We are on the course home page.\n if (($context->contextlevel == CONTEXT_COURSE) &&\n !empty($currentnode) &&\n ($currentnode->type == navigation_node::TYPE_COURSE || $currentnode->type == navigation_node::TYPE_SECTION)) {\n $settingsnode = $this->page->settingsnav->find('courseadmin', navigation_node::TYPE_COURSE);\n\n $itemstoextractfrommenu = explode(',', get_config('theme_savoir', 'coursemenuhandytoolbar'));\n if ($itemstoextractfrommenu && $settingsnode) {\n $extracteditems = [];\n $this->extract_toolbaritems($settingsnode, '/' . $settingsnode->key, $itemstoextractfrommenu, $extracteditems);\n $context = new stdClass();\n $context->items = $extracteditems;\n $rendered = $this->render_from_template('theme_savoir/handy_toolbar', $context);\n }\n }\n\n return $rendered;\n }", "function udesign_sidebar_bottom() {\r\n do_action('udesign_sidebar_bottom');\r\n}", "function udesign_bottom_section_top() {\r\n do_action('udesign_bottom_section_top');\r\n}", "public function getToolbarEntries()\n {\n return $this->toolbar['entries'];\n }", "function boxBottom() {\n\t\treturn html_ac(html_ap() -1).'<!-- class=\"box-surround\" -->'.\"\\n\";\n\t}", "public function getLinksBar()\n {\n return $this->linksBar;\n }", "public function shop_toolbar_elements_ends_wrapper() {\n\t\t\t?>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t}", "public function bottom();", "public function get_foot()\n\t{\n\t\treturn $this->footer_item;\n\t}", "function udesign_body_bottom() {\r\n do_action('udesign_body_bottom');\r\n}", "public function getSidebar() {\n $keys = array_keys($this->modulesInTopMenu);\n foreach ($keys as $key) {\n if (in_array(Yii::app()->controller->module->id, $this->modulesInTopMenu[$key]))\n return $key;\n }\n }", "function launchpad_force_bottom_sidebar() {\n\treturn 'below';\n}", "public function getPaddingBottom() {}", "public function getFooter()\n {\n return $this->getValue('nb_catalog_item_lang_footer');\n }", "function udesign_head_bottom() {\r\n do_action('udesign_head_bottom');\r\n}", "public static function show_box_bottom() {\n require Config::get('prefix') . '/templates/show_box_bottom.inc.php';\n }", "public function getAnotherBlock()\n {\n $data = $this->_coreRegistry->registry('magictoolbox');\n if ($data) {\n $skip = true;\n foreach ($data['blocks'] as $name => $block) {\n if ($name == 'product.info.media.magiczoomplus') {\n $skip = false;\n continue;\n }\n if ($skip) {\n continue;\n }\n if ($block) {\n return $block;\n }\n }\n }\n return null;\n }", "public function getToolbar()\n\t{\n\t\t$user = JFactory::getUser();\n\n\t\t$firstGroup = new RToolbarButtonGroup;\n\t\t$secondGroup = new RToolbarButtonGroup;\n\t\t$thirdGroup = new RToolbarButtonGroup;\n\n\t\t$new = RToolbarBuilder::createNewButton('object.add');\n\t\t$firstGroup->addButton($new);\n\t\t$edit = RToolbarBuilder::createEditButton('object.edit');\n\t\t$secondGroup->addButton($edit);\n\t\t$delete = RToolbarBuilder::createDeleteButton('objects.delete');\n\t\t$thirdGroup->addButton($delete);\n\n\t\t$toolbar = new RToolbar;\n\t\t$toolbar->addGroup($firstGroup)->addGroup($secondGroup)->addGroup($thirdGroup);\n\n\t\treturn $toolbar;\n\t}", "function superfood_elated_get_top_bar_height() {\n if (superfood_elated_is_top_bar_enabled()) {\n $top_bar_height = superfood_elated_filter_px(superfood_elated_options()->getOptionValue('top_bar_height'));\n\n return $top_bar_height !== '' ? intval($top_bar_height) : 30;\n }\n\n return 0;\n }", "public function getThemeBlocks();", "function honeycomb_below_header_widget_region() {\n\t\tif ( is_active_sidebar( 'header-2' ) ) {\n\t\t?>\n\t\t<div class=\"header-below-widget-region\" role=\"complementary\">\n\t\t\t<div class=\"col-full\">\n\t\t\t\t<?php dynamic_sidebar( 'header-2' ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\t}\n\t}", "function klippe_mikado_get_top_bar_height() {\n\t\tif ( klippe_mikado_is_top_bar_enabled() ) {\n\t\t\t$top_bar_height_meta = klippe_mikado_filter_px( klippe_mikado_options()->getOptionValue( 'top_bar_height' ) );\n\t\t\t$top_bar_height = ! empty( $top_bar_height_meta ) ? $top_bar_height_meta : 37;\n\t\t\t\n\t\t\treturn $top_bar_height;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function ext_makeToolBar() {}", "public function bottom()\n {\n if ($this->isEmpty()) {\n throw new \\RuntimeException(sprintf('%s is empty', __CLASS__));\n }\n\n return $this->head;\n }", "function rovoko_page_sidebar_position(){\n return apply_filters('rovoko_page_sidebar_position','bottom');\n}", "public function getCurrentBoard()\n {\n return Mage::registry('current_board');\n }", "function hybrid_get_utility_after_content() {\n\tget_sidebar( 'after-content' );\n}", "function tista_wp_admin_toolbar() {\r\n\t\t\treturn Tista_WP_Admin_Toolbar::instance();\r\n\t\t}", "function udesign_entry_bottom() {\r\n do_action('udesign_entry_bottom');\r\n}", "function Conduct_Query_Builder_Toolbar() {\n\t\treturn Conductor_Query_Builder_Toolbar::instance();\n\t}", "public function getLoginBar()\n {\n return $this->loginBar;\n }", "public static function getLastWidget()\n {\n return (array) BackendModel::getContainer()->get('database')->getRecord(\n 'SELECT i.*\n FROM modules_extras AS i\n ORDER BY id DESC\n LIMIT 1'\n );\n }", "function spectra_block_top ()\n\t{\n\t\t$hash = getbestblockhash ();\n\t\t$block = getblock ($hash);\n\t\t\n\t\treturn $block;\n\t}", "public function getLayout();", "public function get_show_after() {\n\t\treturn $this->data['show_after'];\n\t}", "public function getTileBottomRight(): XY\n {\n return $this->tileBottomRight;\n }", "function klippe_mikado_get_top_bar_background_height() {\n\t\t$top_bar_height_meta = klippe_mikado_filter_px( klippe_mikado_options()->getOptionValue( 'top_bar_height' ) );\n\t\t$header_height_meta = klippe_mikado_filter_px( klippe_mikado_options()->getOptionValue( 'menu_area_height' ) );\n\t\t\n\t\t$top_bar_height = ! empty( $top_bar_height_meta ) ? $top_bar_height_meta : 37;\n\t\t$header_height = ! empty( $header_height_meta ) ? $header_height_meta : 82;\n\t\t\n\t\t$top_bar_background_height = round( $top_bar_height ) + round( $header_height / 2 );\n\t\t\n\t\treturn $top_bar_background_height;\n\t}", "public function getTop()\n\t{\n\t\treturn $this->stackArray[0]??null;\n\t}", "function rovoko_post_sidebar_position(){\n return apply_filters('rovoko_post_sidebar_position','bottom');\n}", "function get_site_screen_help_sidebar_content()\n {\n }", "function bethel_do_footer_bottom() {\n\tgenesis_widget_area ('footer-bottom', array ('before' => '<div id=\"bethel-header-right-bottom\">', 'after' => '</div>'));\n}", "private function initToolbar()\n\t{\n\t\t$toolbar_btn = array();\n\t\t$toolbar_btn['save'] = array('href' => '#', 'desc' => $this->l('Save'));\n\t\treturn $toolbar_btn;\n\t}", "private function getParamFooter()\n {\n $footer = $this->getMenuParams()->get( 'footer', '' );\n return (string)$footer;\n }", "public function bottomScripts() {\n\t\t$analytics = $this->getAnalyticsCode();\n\t\t$bottomScriptText = parent::bottomScripts();\n\n\t\t$html = <<<HTML\n<!-- WikiaBottomScripts -->\n$bottomScriptText\n<!-- /WikiaBottomScripts -->\n$analytics\n<div id=\"positioned_elements\"></div>\nHTML;\n\n\t\treturn $html;\n\t}", "public function isBreadcrumbBottom()\r\n\t{\r\n\t\treturn $this->breadcrumbBottom;\r\n\t}", "function udesign_page_title_bottom() {\r\n do_action('udesign_page_title_bottom');\r\n}", "public function getBoardLayout()\r\n {\r\n return $this->board->getLayout();\r\n }", "function _fillBottom()\n {\n return $this->_bottom - $this->_padding['bottom'];\n }", "public function getLayout() {}", "function asu_brand_get_block_header() {\n $settings = asu_brand_get_block_settings();\n $cache_id = 'asu_brand:header';\n \n // Set js settings, include js file, and inject head into <head>.\n asu_brand_head_inject();\n \n return asu_brand_get_cached_content($cache_id, $settings->header_path);\n}", "public function getBlock()\n {\n return $this->block;\n }", "public static function getFooter()\n {\n return self::$_footer;\n }", "public function drawPanelToolbar() {\n\t\t$html = '';\n\t\t$html .= '<div id=\"toolbar\">'.\"\\n\";\n\t\t$html .= '\t<div id=\"toolbar_container\">'.\"\\n\";\n\t\t$html .= '\t<div class=\"logo\"><a href=\"/treeline/\"><img src=\"/treeline/img/logo.gif\" alt=\"Treeline\" /></a></div>'.\"\\n\";\n\t\t$html .= '\t<div class=\"options\">'.\"\\n\";\n\t\t$html .= '\t\t<input type=\"submit\" class=\"button\" name=\"treeline\" id=\"treeline\" value=\"Save changes\" />'.\"\\n\";\n\t\t$html .= '\t\t<input type=\"submit\" class=\"button cancel\" name=\"treeline\" id=\"treeline\" value=\"Discard changes\" />'.\"\\n\";\t\t\t\n\t\t$html .= '\t</div>'.\"\\n\";\n\t\t$html .= '\t</div>'.\"\\n\";\n\t\t$html .= '\t<div class=\"clear\"></div>';\n\t\t$html .= '</div>';\n\t\treturn $html;\n\t}", "function udesign_blog_entry_bottom() {\r\n do_action('udesign_blog_entry_bottom');\r\n}", "public static function getTemplateBlock()\n {\n return self::$templateBlock;\n }", "function zakra_footer_bottom_bar_one() {\r\n\r\n\t\t$footer_bar_one = get_theme_mod( 'zakra_footer_bar_section_one', 'text_html' );\r\n\r\n\t\tswitch ( $footer_bar_one ) :\r\n\r\n\t\t\tcase 'none':\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'text_html':\r\n\t\t\t\t$text_html = get_theme_mod( 'zakra_footer_bar_section_one_html', zakra_footer_copyright() );\r\n\t\t\t\techo wp_kses_post( $text_html );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'menu':\r\n\t\t\t\t$menu = get_theme_mod( 'zakra_footer_bar_section_one_menu', 'none' );\r\n\t\t\t\tif ( 'none' === $menu ) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\twp_nav_menu(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'menu' => $menu,\r\n\t\t\t\t\t\t'menu_id' => 'footer-bar-one-menu',\r\n\t\t\t\t\t\t'container' => '',\r\n\t\t\t\t\t\t'depth' => -1,\r\n\t\t\t\t\t\t'fallback_cb' => false,\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'widget':\r\n\t\t\t\tif ( is_active_sidebar( 'footer-bar-left-sidebar' ) ) {\r\n\t\t\t\t\tdynamic_sidebar( 'footer-bar-left-sidebar' );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\techo zakra_footer_copyright(); // WPCS: XSS OK.\r\n\r\n\t\tendswitch;\r\n\r\n\t}", "public function getheight(){\n $height = $this->_run('getheight');\n return $height;\n }", "public function getBewallet()\n {\n return $this->bewallet;\n }", "function biagiotti_mikado_get_header_widget_area_one() {\n\t\t$page_id = biagiotti_mikado_get_page_id();\n\t\t$custom_menu_widget_area = get_post_meta( $page_id, 'mkdf_custom_header_widget_area_one_meta', true );\n\t\t\n\t\tif ( get_post_meta( $page_id, 'mkdf_disable_header_widget_areas_meta', 'true' ) !== 'yes' ) {\n\t\t\tif ( is_active_sidebar( 'mkdf-header-widget-area-one' ) && empty( $custom_menu_widget_area ) ) {\n\t\t\t\tdynamic_sidebar( 'mkdf-header-widget-area-one' );\n\t\t\t} else if ( ! empty( $custom_menu_widget_area ) && is_active_sidebar( $custom_menu_widget_area ) ) {\n\t\t\t\tdynamic_sidebar( $custom_menu_widget_area );\n\t\t\t}\n\t\t}\n\t}", "public function getFooter()\n {\n $this->assignCommonFooterDataForSeller();\n $objModule = new MpSellerInvoice();\n $this->context->smarty->assign(array(\n 'footer' => $objModule->l('Seller Invoice'),\n ));\n\n return $this->context->smarty->fetch($this->getTemplate('sellerinvoice_footer'));\n }", "public function getBlockLoader()\n {\n return $this['pantono.service.blocks'];\n }", "function flatsome_has_bottom_bar() {\n\t$screens = array(\n\t\t'large' => false,\n\t\t'mobile' => false,\n\t);\n\tif ( get_theme_mod( 'header_elements_bottom_left' )\n\t || get_theme_mod( 'header_elements_bottom_center' )\n\t || get_theme_mod( 'header_elements_bottom_right' ) ) {\n\t\t$screens['large'] = true;\n\t}\n\tif ( get_theme_mod( 'header_mobile_elements_bottom' ) ) {\n\t\t$screens['mobile'] = true;\n\t}\n\t$screens['large_or_mobile'] = $screens['large'] || $screens['mobile'];\n\t$screens['mobile_only'] = ! $screens['large'] && $screens['mobile'];\n\n\treturn $screens;\n}", "public function get_active_baglayout()\n {\n $this->db->order_by('bag_layout','asc');\n return $this->db->get_where($this->table,array('status' => 1))->result();\n }", "public function marginBottom() {\n\t}", "protected function getVictoireCore_AdminMenu_NavbarBottomRightService()\n {\n return $this->services['victoire_core.admin_menu.navbar_bottom_right'] = $this->get('victoire_core.admin_menu_builder')->getBottomRightNavbar();\n }", "public function getMode()\n {\n $currentMode = $this->getChildBlock('toolbar')->getCurrentMode();\n return $currentMode;\n }", "public function initToolbar()\n {\n }", "function biagiotti_mikado_get_header_widget_area_two() {\n\t\t$page_id = biagiotti_mikado_get_page_id();\n\t\t$custom_menu_widget_area = get_post_meta( $page_id, 'mkdf_custom_header_widget_area_two_meta', true );\n\n\t\tif ( get_post_meta( $page_id, 'mkdf_disable_header_widget_areas_meta', 'true' ) !== 'yes' ) {\n\t\t\tif ( is_active_sidebar( 'mkdf-header-widget-area-two' ) && empty( $custom_menu_widget_area ) ) {\n\t\t\t\tdynamic_sidebar( 'mkdf-header-widget-area-two' );\n\t\t\t} else if ( ! empty( $custom_menu_widget_area ) && is_active_sidebar( $custom_menu_widget_area ) ) {\n\t\t\t\tdynamic_sidebar( $custom_menu_widget_area );\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.6349703", "0.63266915", "0.6302731", "0.62384135", "0.62384135", "0.6163485", "0.61381024", "0.60160625", "0.5860434", "0.5837628", "0.5821601", "0.58033854", "0.5797263", "0.5790943", "0.5782591", "0.57331", "0.5717258", "0.5717249", "0.57160044", "0.5709937", "0.56944376", "0.5674069", "0.56595975", "0.5638263", "0.5611185", "0.5610313", "0.5582075", "0.5557295", "0.5512528", "0.5502375", "0.5499401", "0.5499401", "0.54907626", "0.547296", "0.5464468", "0.54602635", "0.5439607", "0.5404194", "0.539365", "0.5387196", "0.53862303", "0.53806067", "0.5364752", "0.5361004", "0.5339329", "0.53387", "0.5331955", "0.5307132", "0.53030527", "0.5297844", "0.5283654", "0.52795684", "0.5276107", "0.5263058", "0.5252051", "0.5242949", "0.524124", "0.5236689", "0.52273756", "0.52169734", "0.52166307", "0.5209247", "0.5208442", "0.51998436", "0.5196949", "0.51701486", "0.51660645", "0.51518244", "0.5136962", "0.51269174", "0.5124397", "0.51210517", "0.51059234", "0.5103659", "0.5103191", "0.51015496", "0.5099385", "0.5085351", "0.5076483", "0.50745404", "0.50650406", "0.5059714", "0.50543666", "0.50534177", "0.5050928", "0.5046807", "0.5034408", "0.50243133", "0.50212526", "0.500686", "0.4993447", "0.49896663", "0.49893108", "0.4986169", "0.49844918", "0.49763188", "0.49747503", "0.496816", "0.49649078", "0.49640754" ]
0.83441037
0
ROW COUNT IN DATABASE FUNCTION
function row_count($result) { // global $dataBaseConnection; $result = mysqli_num_rows($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RowCount() {}", "public abstract function row_count();", "function NumRows() {}", "public abstract function GetNumRows();", "public function getNumRows();", "public function numOfRows();", "abstract public function getNumRows();", "abstract public function getNumRows();", "function countRows($result)\n{\n $rownum = 0;\n while (OCI_Fetch_Array($result, OCI_BOTH)) {\n $rownum++;\n }\n return $rownum;\n}", "abstract public function NumRows();", "function get_row_count() {\n $query = \"SELECT COUNT(*) FROM failure;\";\n $count = select_scalar($query);\n return $count;\n}", "public function getNumberOfRows();", "public function numberOfRows();", "public function nbRows();", "function NumRows() {\n\t\t\t$result = pg_num_rows($this->result);\n\t\t\treturn $result;\n\t\t}", "function row_count($result){\n global $connection;\n return mysqli_num_rows($result);\n}", "public function total_rows();", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"partdata\");\n\t}", "function rows_count($table){\n\t$conn = connect();\n\t$sql = \"select count(*) as C from \".$table;//radiology_record\n\n\tif(($statement = oci_parse($conn, $sql)) == false){\n\t\t$err = oci_error($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$exec = oci_execute($statement);\n\n\tif(!$exec){\n\t\t$err = oci_error($statement);\n\t\toci_free_statement($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$row = oci_fetch_assoc($statement);\n\t\n\t$ret = $row['C'];\n\n\toci_free_statement($statement);\n\toci_close($conn);\n\n\treturn $ret;\n}", "public function count(){\n $query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n return $row['total_rows'];\n }", "abstract protected function _recordcount($rs);", "public function count() {\n return count($this->__rows__);\n }", "function sql_num_rows($res)\n {\n // DELETE, INSERT, UPDATE\n // do not use : SELECT\n return $res->rowCount();\n }", "public function count(){\n\t\t\t$query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n\t\t\n\t\t\t$stmt = $this->conn->prepare( $query );\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\n\t\t\treturn $row['total_rows'];\n\t\t}", "function count()\n {\n $retval = 0;\n $key = $this->object->get_primary_key_column();\n $results = $this->object->run_query(\"SELECT COUNT(`{$key}`) AS `{$key}` FROM `{$this->object->get_table_name()}`\");\n if ($results && isset($results[0]->{$key})) {\n $retval = (int) $results[0]->{$key};\n }\n return $retval;\n }", "function get_num_records()\n\t{\n\t\t$this->sql = 'SELECT COUNT(*) FROM ' . $this->table;\n\t\t$this->apply_filters();\n\t\treturn db_getOne($this->sql, $this->use_db);\n\t}", "function sql_num_rows($result) {\n\t\treturn pg_num_rows($result);\n\t}", "public function rowCount();", "public function rowCount();", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"mtrbundle\");\n\t}", "function numRows()\n {\n $this->getRows();\n return $this->row_counter;\n }", "public function rowcount($numrows){\n$this->row_count = mysqli_num_rows($numrows);\nreturn $this->row_count;\n}", "public function getCount() {\n\t\treturn $this->db->fetchColumn ( \"SELECT COUNT(id) FROM \" . $this->table );\n\t}", "function rowscount($db) {\n\t$selection = \"SELECT * FROM bands\";\n\t\n\t$result = select($selection,$db);\n\n\treturn mysqli_num_rows($result);\n}", "public function count(){\n $query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n return $row['total_rows'];\n}", "function count()\n{\n\tif (!$this->getSql()) return 0;\n\t$rows = $this->getClone()->select('count(*) as n');\n\treturn (int)$rows[0]['n'];\n}", "function fetchCount();", "abstract public function countTable();", "public function count(){\n $query = \"SELECT COUNT(*) as total_rows FROM \".$this->table_name. \"\";\n\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n return $row['total_rows'];\n }", "public function get_row_count() {\n return 0;\n }", "function count()\n {\n $this->object->select($this->object->get_primary_key_column());\n $retval = $this->object->run_query(FALSE, FALSE, FALSE);\n return count($retval);\n }", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"jobdata\");\n\t}", "public function getNumRows()\n {\n $db = DB::conn();\n $query = \"SELECT COUNT(*) FROM \" . self::COMMENT_TABLE . \" WHERE thread_id = ?\";\n $where_params = array($this->thread_id);\n $count = $db->value($query, $where_params);\n return $count; \n }", "public function getRowCount();", "function dbCount(){\r\n global $db_query;//voor alle code leesbaar\r\n return $db_query->rowCount();\r\n}", "public function cekRows(){\n $query = \"SELECT COUNT(*) AS numrows FROM \".NEWS_TABLE;\n $result = mysql_query($query) or die('Error, query failed');\n $row = mysql_fetch_array($result, MYSQL_ASSOC);\n $numrows = $row['numrows']; \n \n return $numrows;\n }", "public function count()\n {\n $query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n return $row['total_rows'];\n }", "public function count_rows() {\r\n return $this->db->count_all_results($this->table_name);\r\n }", "public function numRows() {\n\t\t$q = \"SELECT COUNT(*) FROM {$this->_name}\";\n\t\t$r = @sqlite_query($q, $this->_connection);\n\t\tlist($numRows) = sqlite_fetch_array($r, SQLITE_NUM);\n\t\treturn $numRows;\n\t}", "function count_sql($table) {\n\t$dbh = db_connect(); #DATABASE CONNEXION\n\n\t$dossier = $dbh->query('SELECT COUNT(*) FROM ' . $table)->fetch();\n\tforeach ($dossier as $count) return $count;\n\n\techo($count);\n}", "public function getCount() {\n return $this->db->fetchColumn(\"SELECT COUNT(id) FROM $this->table\");\n }", "public function rowCount()\n {\n return sasql_num_rows($this->result);\n }", "function numRows( $res );", "public function numRows() : int\n\t{\n\t\treturn $this->handle->numRows($this->result);\n\t}", "public function count(){\n $query = \"SELECT COUNT(*) as total_rows \n FROM $this->table_name\";\n\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n return $row['total_rows'];\n}", "function rows($sth){\n try{\n switch(dbconection::$conntype){\n case \"pdo\" : return $sth->rowCount(); break;\n case \"mysql\" : return mysql_num_rows($sth); break;\n case \"postgresql\" : return pg_num_rows ( $sth ); break;\n default : throw new Exception(\"Nenhum tipo de conexão definida.\");\n }\n }catch(Exception $e){\n printr(\"ROWS ERROR : \".$e->getMessage());\n }\n }", "function num_rows($query)\n\t{\n\t\treturn pg_num_rows($query);\n\t}", "abstract public function recordCount(): int;", "public function getNumberOfRows(){\r\n $this->setTable('subscribed');\r\n $table = $this->getTable();\r\n\r\n $sql = \"SELECT * FROM \" . $table;\r\n $stmt = $this->fetch()->query($sql);\r\n return $stmt->rowCount();\r\n }", "function numRows($resource) {\n return mysql_num_rows($resource);\n }", "function num_rows($rs)\n{\n\treturn @mysql_num_rows($rs);\n}", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(H_SYSTEM_ACCESS);\t\n\t}", "public function _count();", "public function countRows($sql,$params)\n{\n $stmt = $this->dbh->prepare($sql);\n $stmt->execute($params);\n return $stmt->rowCount();\n}", "public function countRows()\n {\n return count($this->rows);\n }", "public function count(){\r\n\t$query = \"SELECT count(*) FROM \" . $this->table_name;\r\n\r\n\t// prepare query statement\r\n\t$stmt = $this->conn->prepare( $query );\r\n\r\n\t// execute query\r\n\t$stmt->execute();\r\n\r\n\t// get row value\r\n\t$rows = $stmt->fetch(PDO::FETCH_NUM);\r\n\r\n\t// return count\r\n\treturn $rows[0];\r\n}", "function countRows($result) {\n global $checkuser, $checkusername, $checkuseremail, $checkuserphone;\n $i=0;\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n $i = $i + 1;\n $checkuser = $row[0];\n $checkusername = $row[1];\n\t $checkuseremail = $row[3];\n $checkuserphone = $row[4];\n\n }\n return $i;\n \n}", "public function count() {\n $this->_active_query->fields($this->func()->count());\n $query = $this->query( $this->_active_query->getQuery(), $this->_active_query->getParams() );\n return (int)$query->rowCount();\n }", "public function countEtat_compte(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"count\"));\n\t\t\t\t\t }", "public function getNumRows()\n {\n \treturn $this->previouslyExecuted->num_rows;\n }", "public function count() {\n return $this->row_count();\n }", "public function countQuery();", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"mailingdataavmedgroupinvoicesrecord30\");\n\t}", "public function count()\n {\n $db = $this->dbConnect();\n $req = $db->query('SELECT COUNT(*) AS nbRows FROM regions');\n $result = $req->fetch();\n\n return $totalNbRows = $result['nbRows'];\n }", "public function getNumberOfRows() {\n\n $query = $this->db->prepare(\"SELECT COUNT(*) FROM `products`\");\n\n try {\n\n $query->execute();\n $rows = $query->fetchColumn();\n\n return $rows;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "public function num_rows()\n\t{\n\t\t$regex = '/^SELECT\\s+(?:ALL\\s+|DISTINCT\\s+)?(?:.*?)\\s+FROM\\s+(.*)$/i';\n\t\t$output = array();\n\n\t\tif (preg_match($regex, $this->last_query, $output) > 0)\n\t\t{\n\t\t\t$stmt = $this->query(\"SELECT COUNT(*) FROM {$output[1]}\");\n\t\t\treturn (int) $stmt->fetchColumn();\n\t\t}\n\n\t\treturn NULL;\n\t}", "public function record_count() {\r\n return $this->db->count_all(\"pessoafisica\");\r\n }", "public function count()\n {\n return count($this->_rows);\n }", "public function countRows(): int\n {\n $result = $this->_getResult()->numRows(); // Returns an integer on success and an \\PEAR_Error object on failure\n return is_int($result) ? $result : 0;\n }", "function num_rows() {\n\t\n\t\t$num = @mysql_num_rows($this->rstemp);\n\t\tif ($this->debug) echo \"$num records returneds <br>\\n\\n\";\t\n\t\t\n\t\treturn $num;\t\t\n\t}", "public function getCountRowsOfTable ($tableName,$fieldname='*');", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();" ]
[ "0.8663105", "0.8617373", "0.7865475", "0.7833955", "0.78130853", "0.7794051", "0.7769415", "0.7769415", "0.7761482", "0.7734351", "0.76162624", "0.7595625", "0.75299233", "0.7499053", "0.748042", "0.7463518", "0.7449461", "0.7417514", "0.741434", "0.7360191", "0.7354018", "0.73515636", "0.73073065", "0.7306496", "0.72997695", "0.72988594", "0.7294672", "0.7288194", "0.7288194", "0.7256405", "0.7246669", "0.72372466", "0.7227878", "0.72197956", "0.72168887", "0.72119594", "0.7210563", "0.7208788", "0.72003216", "0.7193915", "0.718152", "0.71791685", "0.7173407", "0.71535194", "0.7152541", "0.7143078", "0.71421105", "0.7125694", "0.7122148", "0.7119236", "0.7118127", "0.7107593", "0.7105211", "0.71020377", "0.71010303", "0.70962965", "0.7092804", "0.7084908", "0.7082363", "0.7076787", "0.707631", "0.7075502", "0.70696545", "0.7064584", "0.70567495", "0.7049301", "0.70481265", "0.7044746", "0.7027844", "0.7024846", "0.70137024", "0.7011229", "0.7009401", "0.7001402", "0.6999463", "0.6994754", "0.69946754", "0.6993643", "0.6981595", "0.6979538", "0.69785243", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106", "0.69754106" ]
0.752113
13
End the row count function QUERY DATABASE FUNCTIONS
function execute($sql) { global $dataBaseConnection; $result = mysqli_query($dataBaseConnection, $sql); // confirm($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RowCount() {}", "public abstract function row_count();", "function dbCount(){\r\n global $db_query;//voor alle code leesbaar\r\n return $db_query->rowCount();\r\n}", "function sql_num_rows($res)\n {\n // DELETE, INSERT, UPDATE\n // do not use : SELECT\n return $res->rowCount();\n }", "function row_count($result)\r\n{\r\n // global $dataBaseConnection;\r\n $result = mysqli_num_rows($result);\r\n return $result;\r\n}", "public function getRowCountAndClose(): int;", "public function total_rows();", "abstract protected function _recordcount($rs);", "public function get_row_count() {\n return 0;\n }", "public abstract function GetNumRows();", "function NumRows() {}", "function sql_num_rows($result) {\n\t\treturn pg_num_rows($result);\n\t}", "public function rowCount() {}", "function countRows($result) {\n global $checkuser, $checkusername, $checkuseremail, $checkuserphone;\n $i=0;\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n $i = $i + 1;\n $checkuser = $row[0];\n $checkusername = $row[1];\n\t $checkuseremail = $row[3];\n $checkuserphone = $row[4];\n\n }\n return $i;\n \n}", "function lastNumRows ()\n {\n return $this->_result? pg_num_rows($this->_result): false;\n }", "public function rowCount();", "public function rowCount();", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"jobdata\");\n\t}", "function num_rows($query)\n\t{\n\t\treturn pg_num_rows($query);\n\t}", "public function _count();", "private function count_operation_rows()\n {\n // $license_rows = $license['rows'];\n\n // $constructse = $this->Header_model->get_data_list('license_constructs', array('status' => 1));\n // $constructse_rows = $constructse['rows'];\n\n // return ($license_rows + $constructse_rows);\n }", "function countRows($result)\n{\n $rownum = 0;\n while (OCI_Fetch_Array($result, OCI_BOTH)) {\n $rownum++;\n }\n return $rownum;\n}", "function row_count($result){\n global $connection;\n return mysqli_num_rows($result);\n}", "function NumRows() {\n\t\t\t$result = pg_num_rows($this->result);\n\t\t\treturn $result;\n\t\t}", "function fetchCount();", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"partdata\");\n\t}", "public function num_rows($query_result) {\n//\t\t\twhile ( OCIFetchINTO($query_result,$dumy,OCI_ASSOC) ) {\n//\t\t\t\t$i++;\n//\t\t\t}\n//\t\t\t//return ocifetchstatement($query_result,$dumy);\n//\t\t\treturn $i;\n\t\t}", "function get_row_count() {\n $query = \"SELECT COUNT(*) FROM failure;\";\n $count = select_scalar($query);\n return $count;\n}", "public function num_rows($result_query=''){\n\t\t/**\n\t\t * GDS Interbase no soporta esta funcion (No debe ser usada)\n\t\t */\n\t\treturn false;\n\t}", "function get_total_all_records($connect,$query)\n{\n $statement = $connect->prepare($query);\n $statement->execute();\n return $statement->rowCount();\n}", "abstract public function getNumRows();", "abstract public function getNumRows();", "public function rowcount($numrows){\n$this->row_count = mysqli_num_rows($numrows);\nreturn $this->row_count;\n}", "public function numOfRows();", "function count() ;", "public function rowCount($query)\r\n {\r\n $query = $this->db->prepare($query);\r\n $query->execute();\r\n $cantidad_registros = $query->rowCount();\r\n return $cantidad_registros;\r\n echo $cantidad_registros;\r\n $this->$db = null; \r\n }", "function numRows( $res );", "abstract public function countTable();", "public function countQuery();", "function logcount() {\n\tglobal $cursor;\n\techo $cursor->count() . PHP_EOL;\n}", "function last_records($rcount)\n{\n \n}", "function lastNumRows() {\n\t\tif ($this->_result) {\n\t\t\tsqlite_num_rows($this->_result);\n\t\t}\n\t\treturn false;\n\t}", "function count(){}", "function numrows() {\r\n\t\treturn $this->numrows;\r\n\t}", "function rows($res){\t\n\t\treturn(0);\n\t}", "public function rowCount()\n {\n }", "abstract public function NumRows();", "public function getRowCount();", "function getCount()\n{\n if( $this->_count == -1 ){\n global $dbh;\n $SQL = $this->getCountSQL();\n $result = $dbh->getOne($SQL);\n dbErrorCheck($result);\n $this->_count = $result;\n return $result;\n }else{\n return $this->_count;\n }\n}", "public function numberOfRows();", "public function getNumRows();", "function rowscount($db) {\n\t$selection = \"SELECT * FROM bands\";\n\t\n\t$result = select($selection,$db);\n\n\treturn mysqli_num_rows($result);\n}", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "function rows_count($table){\n\t$conn = connect();\n\t$sql = \"select count(*) as C from \".$table;//radiology_record\n\n\tif(($statement = oci_parse($conn, $sql)) == false){\n\t\t$err = oci_error($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$exec = oci_execute($statement);\n\n\tif(!$exec){\n\t\t$err = oci_error($statement);\n\t\toci_free_statement($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$row = oci_fetch_assoc($statement);\n\t\n\t$ret = $row['C'];\n\n\toci_free_statement($statement);\n\toci_close($conn);\n\n\treturn $ret;\n}", "function get_row_count() {\n return $this->row_count;\n }", "public function count(){\n $query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n return $row['total_rows'];\n }", "function returns_result($sql)\r\n{\r\n\tglobal $db;\r\n\t\r\n\t$count = 0;\r\n \t$result = $db->sql_query($sql);\r\n\t\r\n \twhile ($row = $db->sql_fetchrow($result))\r\n {\r\n $count += 1;\r\n }\r\n\t$db->sql_freeresult($result);\r\n\treturn ($count);\r\n}", "function db_numrows($result) {\r\n\r\n\treturn mysql_num_rows($result);\r\n\t\r\n}", "public function delegateRowCount(DbalStatement $dbal_statement);", "public function nbRows();", "function num_rows() {\n\t\n\t\t$num = @mysql_num_rows($this->rstemp);\n\t\tif ($this->debug) echo \"$num records returneds <br>\\n\\n\";\t\n\t\t\n\t\treturn $num;\t\t\n\t}", "function num_rows($rs)\n{\n\treturn @mysql_num_rows($rs);\n}", "public function countAll(){\n \n // query to select all user records\n $query = \"SELECT Mabh FROM \" . $this->table_name . \"\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n // get number of rows\n $num = $stmt->rowCount();\n \n // return row count\n return $num;\n}", "function count() {\n # The return value of this function is intended to indicate the total\n # number of results of the operation the Iter represents.\n return NULL;\n }", "public function rowCount()\n {\n return sasql_num_rows($this->result);\n }", "public function getNumRows()\n {\n \treturn $this->previouslyExecuted->num_rows;\n }", "public function rowCount(): int\n {\n }", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"mailingdataavmedgroupinvoicesrecord30\");\n\t}", "function get_num_queries()\n {\n }", "public function dbcount($result) {\n \treturn $result->num_rows;\n }", "public function getNumberOfRows();", "function num_rows() {\r\n\t\treturn $this->dbh->num_rows();\r\n\t}", "abstract public function recordCount(): int;", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"mtrbundle\");\n\t}", "public static function count_all(){\n global $database;\n $sql =\"SELECT count(*) FROM \".static::$db_table;\n $result_set=$database->query($sql);\n $row =mysqli_fetch_array($result_set);\n\n return array_shift($row);\n\n }", "public function count(){\n\t\t\t$query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n\t\t\n\t\t\t$stmt = $this->conn->prepare( $query );\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\n\t\t\treturn $row['total_rows'];\n\t\t}", "function db_num_rows($db_query) {\n return mysql_num_rows($db_query);\n }", "public function countRows($sql,$params)\n{\n $stmt = $this->dbh->prepare($sql);\n $stmt->execute($params);\n return $stmt->rowCount();\n}", "public function countEtat_compte(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"count\"));\n\t\t\t\t\t }", "public function count(){\n $query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n return $row['total_rows'];\n}" ]
[ "0.72405297", "0.7127944", "0.6912113", "0.67332596", "0.6698957", "0.66785896", "0.6650137", "0.663012", "0.66016847", "0.6556856", "0.65533215", "0.65307295", "0.65167546", "0.65083784", "0.6485952", "0.64708376", "0.64708376", "0.6470763", "0.64186996", "0.64174736", "0.6414141", "0.64079267", "0.639745", "0.6389955", "0.6389873", "0.6367993", "0.63632286", "0.6350111", "0.63109964", "0.63094777", "0.6304518", "0.6304518", "0.628962", "0.62859404", "0.62692565", "0.625898", "0.6254401", "0.62481946", "0.6241701", "0.62404454", "0.6217705", "0.6215769", "0.6209751", "0.62070286", "0.6205215", "0.61973965", "0.61890733", "0.61726606", "0.6165423", "0.61534333", "0.61514974", "0.6150526", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.6134453", "0.61292887", "0.6128023", "0.6127523", "0.6125393", "0.6122271", "0.6121997", "0.6114964", "0.6113224", "0.61130947", "0.61078805", "0.6107768", "0.61070997", "0.6100817", "0.61005795", "0.6094054", "0.6086403", "0.60804313", "0.60751367", "0.60749495", "0.6060437", "0.6059049", "0.6055456", "0.6055247", "0.6045715", "0.60452783", "0.604498", "0.6040665" ]
0.0
-1
End of query functions TO CHECK IF ERROR EXISTS IN DATADASE
function confirm($result) { global $dataBaseConnection; if (!$result) { die("QUERY FAILED" . mysqli_error($dataBaseConnection)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasError();", "public function hasError();", "public function hasError();", "public function hasError();", "public function hasErrors();", "protected function setErrorsExist() {}", "public function has_errors()\n {\n }", "function checkForDbError($preparedStatement) {\n\t\t\t$error = $preparedStatement->errorInfo();\n\t\t\tif ($error != null && count($error) > 0 && $error[0] > 0)\n\t\t\t\tdie(\"Insert failed on: $error[2]\");\n\t}", "public function hasError(): bool;", "public function hasError(): bool;", "public static function HasDatabaseError($data) {\n try {\n if ( empty($result) ) return false; // haven't error\n // Check SQL error\n if ( isset($result[0][0]['error_typ']) && $result[0][0]['error_typ'] != 0 ) {\n // SQL Exception\n if ( $result[0][0]['error_typ'] == 999 ) throw new \\Exception($result[0][0]['remark']);\n // Logic error\n return true;\n }\n return false;\n }\n catch(Exception $e) {\n throw $e;\n }\n }", "private function checkError() : void\n {\n $this->isNotPost();\n $this->notExist();\n $this->notAdmin();\n }", "public function is_error()\n {\n }", "public function isError() {}", "public function isError () {\n return $this->c2mysql->isError();\n }", "function query_error_check($passed_result, $passed_query, $note=\"\") {\n\tif (!$passed_result) {\n\t\thtml_header('HI Asset DB - Error','');\n\t\tinclude(\"top_menu.php\");\n\t\techo \"<h2>Problem with query - \" . $note . \"</h2>\\n\";\n\t\techo \"<pre>\" . $query . \"\\n\";\n\t\techo pg_last_error();\n\t\techo \"</pre></body></html>\\n\";\n\t\texit();\n\t}\n\treturn;\n}", "function dprv_db_ok()\r\n\t{\r\n\t\t$log = new DPLog();\r\n\t\tglobal $wpdb;\r\n\t\t$wpdb->last_error = \"\";\r\n\t\t$sql=\"SELECT last_fingerprint FROM \" . get_option('dprv_prefix') . \"dprv_posts WHERE id = 0 LIMIT 1\";\r\n\t\t$result = $wpdb->get_var($sql);\r\n\t\t$dprv_sql_error = mysql_error();\r\n\t\t$dprv_db_error = $wpdb->last_error;\r\n\t\tif (trim($dprv_db_error) != \"\")\r\n\t\t{\r\n\t\t\t$dprv_this_event = $dprv_db_error . \" while testing for last_fingerprint\";\r\n\t\t\tdprv_record_event($dprv_this_event);\r\n\t\t\tif (strpos(strtolower($dprv_db_error), \"unknown column\") !== false)\r\n\t\t\t{\r\n\t\t\t\treturn -1;\t\t// last fingerprint column does not exist\r\n\t\t\t}\r\n\t\t\treturn 0;\t\t\t// some other error\r\n\t\t}\r\n\t\treturn 1;\t\t\t\t// OK\r\n\t}", "public function isError();", "public function sql_error() {}", "public function sql_error() {}", "function check_results($results) {\n global $dbc;\n if($results != true)\n echo '<p>SQL ERROR = ' . mysqli_error( $dbc ) . '</p>' ; \n}", "protected function errorCheck($query) : void\n {\n $info = $query->errorInfo();\n\n if ($info[0] !== \\PDO::ERR_NONE) {\n die('We have : ' . $info[2]);\n }\n }", "function check(){\r\n\t\tglobal $PDBCExceptionException;\r\n\t\tif($PDBCExceptionException)\r\n\t\t\tPDBCException::raise($PDBCExceptionException);\r\n\t}", "public function errorOccured();", "public function hasError() {\n\t\treturn $this->lastError !== null;\n\t}", "public function checkData()\n\t{\n\t\t$result = parent::checkData();\n\t\t$query = (new \\App\\Db\\Query())->from($this->baseTable)->where(['server_id' => $this->get('server_id'), 'user_name' => $this->get('user_name')]);\n\t\tif ($this->getId()) {\n\t\t\t$query->andWhere(['<>', 'id', $this->getId()]);\n\t\t}\n\t\treturn !$result && $query->exists() ? 'LBL_DUPLICATE_LOGIN' : $result;\n\t}", "function check_results($results) {\n global $dbc;\n\n if($results != true)\n echo '<p>SQL ERROR = ' . mysqli_error( $dbc ) . '</p>' ;\n}", "function check_results($results) {\n global $dbc;\n\n if($results != true)\n echo '<p>SQL ERROR = ' . mysqli_error( $dbc ) . '</p>' ;\n}", "protected function checkDbErrors($query) {\r\n if ($this->connection->errno) {\r\n switch ($this->connection->errno) {\r\n case 1062:\r\n $this->error->setError(TXT_ERROR_DUPLICATE_ENTRY);\r\n break;\r\n case 0:\r\n $this->error->setError(\"ERROR UNKNOWN\");\r\n\r\n default:\r\n $error = \"MySQL error \" . $this->connection->errno . \": \" .\r\n $this->connection->error . \"\\n<br><br>\\n$query\\n<br>\";\r\n $this->error->setError($error);\r\n break;\r\n }\r\n\r\n return TRUE;\r\n }\r\n $this->error->setError(\"No errors.\");\r\n return FALSE;\r\n }", "function check_results($results) {\r\n global $dbc;\r\n\r\n if($results != true)\r\n echo '<p>SQL ERROR = ' . mysqli_error( $dbc ) . '</p>' ; \r\n}", "function SM_dbErrorCheck($rh, $obj=NULL, $fatal=true) {\n\n global $SM_siteManager, $SM_develState;\n\n if (isset($SM_siteManager)) {\n return $SM_siteManager->errorHandler->dbErrorCheck($rh, $obj,$fatal);\n }\n\n if (empty($rh)) {\n\n $msg = \"Database Query Error\";\n\n $lastid = $GLOBALS['SM_LAST_DB_ID'];\n if (empty($lastid))\n $lastid = 'default';\n \n if ($SM_develState && isset($this->dbHL[$lastid])) {\n $edata = $this->dbHL[$lastid]->errorInfo();\n $msg .= $edata[2];\n $msg .= ' <br>Query Was: ['.$this->dbHL[$lastid]->lastQuery.']';\n }\n\n if ($fatal) {\n SM_fatalErrorPage($msg,$obj);\n }\n else {\n // log error\n SM_debugLog($msg,$obj);\n // return\n return true;\n }\n\n }\n\n return false;\n\n}", "function check_results($results) {\n global $dbc;\n\n if($results != true)\n echo '<p>SQL ERROR = ' . mysqli_error( $dbc ) . '</p>' ;\n\n\n}", "public function hasFailed();", "public function hasError()\n {\n return $this->errors === 0;\n }", "public function check_error_data($data,$import_type=\"insert\")\r\n {\r\n $num_errors=0;\r\n $array_unique=array();\r\n foreach($data as $row)\r\n {\r\n if($row[\"KieuMH\"]!=\"NHOM\")\r\n {\r\n if($this->valid_mamh($row[\"MaMH\"],$array_unique,$import_type)==false) $num_errors++;\r\n $array_unique[]=$row[\"MaMH\"]; \r\n }\r\n \r\n \r\n }\r\n return $num_errors;\r\n }", "public function is_error_exists() {\n return (!empty($this->errors));\n }", "private function hasError($data){\n //anything other than 0 is an error\n return $data[\"error\"] != 0;\n }", "public function isError()\n {\n return self::dbLink;\n }", "public function errorDuplicateEntry()\n {\n return $this->errno == 1062;\n }", "function check_insert($i) {\r\n $no_error = True;\r\n\r\n foreach ($this->properties as $colvar=>$col) {\r\n #~ if (strpos($colvar,'_phone') !== false or strpos($colvar,'_fax') !== false) {\r\n if (strpos($colvar,'_phone') === false and strpos($colvar,'_fax') === false) continue;\r\n #~ if (!preg_match('/[,\\-\\/]/',$this->ds->{$colvar}[$i])) continue;\r\n if (!preg_match('/[^0-9 ]/',$this->ds->{$colvar}[$i])) continue;\r\n $this->error_msgs[] = \"[\".($i+1).\"] {$col->label} must be numeric only\";\r\n #~ $this->error_msgs[] = \"[\".($i+1).\"] {$col->label} must not contain these characters: , / -\";\r\n $this->error_rows[$i] = True;\r\n $no_error = False;\r\n }\r\n\r\n # place holder function\r\n if ($this->ds->total[$i] == 0) {\r\n $this->error_msgs[] = \"[\".($i+1).\"] Total must not zero\";\r\n $this->error_rows[$i] = True;\r\n $no_error = False;\r\n }\r\n\r\n if ($this->ds->list_price[$i] == 0) {\r\n $this->error_msgs[] = \"[\".($i+1).\"] List price must not zero\";\r\n $this->error_rows[$i] = True;\r\n $no_error = False;\r\n }\r\n $this->ds->cu_name[$i] = strtoupper($this->ds->cu_name[$i]);\r\n\r\n return $no_error;\r\n }", "public function hasDependencyErrors() {}", "function checkSQL($db_link, $sqlquery){\n\t\tif (!$sqlquery) die ('SQL-Statement failed: '.mysqli_error($db_link));\n\t}", "public function sql_errno() {}", "public function sql_errno() {}", "private function runPrepStmtChkErr(&$stmt) {\n // Execute the query\n if($stmt->execute()) {\n return true;\n }\n\n // Print error if something goes wrong\n echo \"\\nPDOStatement::errorInfo():\\n\";\n $err_arr = $stmt->errorInfo();\n print_r($err_arr);\n\n return false;\n }", "function error_occurred() {\n\n return ($this->error_code !== null);\n\n}", "protected function error()\n\t{\t\t\n\t\tif(self::$arrDbConf[$this -> databaseName] !== 1)\n\t\tthrow new SystemException('Không tồn tại con trỏ database!');\n\t\telseif($this -> tableName ==='')\n\t\tthrow new SystemException('Không tồn tại tên bảng!');\n\t\telse\n\t\treturn true;\n\t}", "public function hadError() :bool {\n\t\treturn (($this->errNum < -1) or $this->shouldThrow);\n\t}", "function die_if_sql_failed($result, $link, $data, $sql) // Colorize: green\n { // Colorize: green\n if (!$result) // Colorize: green\n { // Colorize: green\n $error_details = \"SQL Failed: \" . $sql . \" Error: \" . $link->error; // Colorize: green\n error_log($error_details); // Colorize: green\n // Colorize: green\n db_disconnect($link); // Colorize: green\n // Colorize: green\n $data[\"message\"] = \"Database error\"; // Colorize: green\n $data[\"details\"] = $error_details; // Colorize: green\n // Colorize: green\n die(json_encode($data)); // Colorize: green\n } // Colorize: green\n }", "function checkError($db, $ret, $string){\n\t\tif(!$ret){\n\t echo pg_last_error($db);\n\t } else {\n\t echo $string;\n\t }\n\t}", "public function IsError() {\n\t return ($this->error_count > 0);\n\t}", "public function hasError($key) : bool;", "public function isError()\n {\n }", "function hayErrores()\n {\n return (0 != count($this->_errores));\n }", "function HasFailedTrans() {}", "function sql_check($query)\n\t{\n $stmt = prepare($query);\n $return = $stmt->rowCount();\n return $return;\n\n\t\t//sql_connect();\n\t\t//global $defaultdb;\n\t\t//$return = $defaultdb->check($query);\n\t\t//return $return;\n\t}", "public function isError()\n {\n return ($this->error_count > 0);\n }", "private function isExternalDatabaseError()\n {\n $db = new \\mysqli($this->clone->databaseServer, $this->clone->databaseUser, $this->clone->databasePassword, $this->clone->databaseDatabase);\n if ($db->connect_error) {\n return true;\n }\n\n return false;\n }", "protected function insereErradas() {\n date_default_timezone_set('America/Sao_Paulo');\n $datahora = date(\"Y-m-d H:i:s\");\n $create = new Create;\n $Dados = array(\"datahora\" => $datahora, \"flag\" => $this->resposta, \"usuario_id\" => $this->userid,);\n $create->IniCreate(\"erradas\", $Dados);\n if ($create->getResult()):\n return 0; // Cadastrado errada e retorna flag Incorreta\n endif;\n }", "function evel_check_error($data) {\n if ($error_message = evel_get_error($data))\n err($error_message);\n}", "public function hasError() { return $this->error; }", "function IfExists($holidaycode) {\r\n $conn = conn();\r\n $sql = \"SELECT * FROM `specialdates` WHERE RateCode='$holidaycode'\";\r\n $stmt = $conn->prepare($sql);\r\n $stmt->execute();\r\n $result = $stmt->fetchAll();\r\n if (!empty($result)) {\r\n return 1;\r\n }\r\n return 0;\r\n $conn = NULL;\r\n }", "public static function hasErrors() { return count(PNApplication::$errors) > 0; }", "function errortrap_odbc($conn, $statement, $values) {\n if(!$rs = odbc_execute($statement, $values)) {\n echo \"<br/>\" . odbc_errormsg($conn);\n }\n return $rs;\n}", "public function checkRepeated($table,$field,$data,$errorfield)\n\t\t{\n\t\t\t$sth=$this->db->prepare(\"SELECT * FROM $table WHERE\n\t $field=:data\");\n\t $sth->execute(array(\n\t ':data'=>$data\n\t ));\t\n\t $exists=$sth->rowCount();\n\t\t \t//If there is already a registry with this conditions\n\t\t \tif($exists>0){\n\t\t $error=new Error;\n\t\t\t$error->index('There is already a '.$errorfield.' with the value '.$data);\n\t\t\texit;\t\n\t\t \t}\n\t\t}", "public function checkIfAnalyzerResultDataExist($result): bool;", "function cSsql_write_error($sql_query_result)\r\n{\r\n if (!$sql_query_result)\r\n {\r\n return_error('mysql', mysql_errno(), mysql_error());\r\n //echo('<error type=\"mysql\" no=\"'.mysql_errno().'\">'.mysql_error().'</error>');\r\n }\r\n return !$sql_query_result;\r\n}", "protected function checkInvalidSqlModes() {}", "function lastError();", "public function hasError() {\n return ($this->getStatus() != 1);\n }", "public function hasError()\n {\n return $this->has_error;\n }", "public function checkDatabaseStructure( );", "function query_check($query)\n{\n\t$result=mysql_query($query);\n\t//tornarem false si hi ha algun error\n\treturn !mysql_errno()?mysql_num_rows($result):false;\n}", "public static function hasError() {\n return !empty(self::$error);\n }", "public function hasCurrentError()\n {\n return $this->hasCurrent(self::NAMESPACE_ERROR);\n }", "function check_db_error($obj, $errmsg = '##Database Error##')\n {\n if ($this->isError($obj))\n $this->abort($errmsg, ': ', mysql_error());\n }", "public function checkResult() {\n\t\treturn ($this->_query_result !== false);\n\t}", "function msql_error()\n{\n}", "public function checkDateWithInvalidDateValuesDataProvider() {}", "public function hasError()\n\t{\n\t\treturn $this->error || $this->error_code;\n\t}", "private function checkError($result)\n\t{\n\t\tif($result->errno == '0')\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "function validate ($results) {\n\t\tglobal $mysqli;\n\t\tif (!$results) {\n\t\t\techo \"MySQL Query Error: \" . $mysqli->error;\n\t\t\t$mysqli->close();\n\t\t\texit();\n\t\t}\n\t}", "private function hasXMLErrorOccured()\n {\n return (\\libxml_get_last_error() !== false);\n }", "public function hasError(){\n\t\treturn !empty($this->errors);\n\t}", "public function hasError()\n {\n return null !== $this->currentError;\n }", "public function hasError() {\n return 0 < count($this->errors);\n }", "function mapit_check_error($data) {\n if ($error_message = mapit_get_error($data))\n err($error_message);\n}", "public function check_entry($data){\r\n\t\t$query = $this->conn->query($data);\r\n\t\t$row = $query->fetch_array(MYSQLI_ASSOC);\r\n\t\tif($query->num_rows>0){\r\n \t\t\treturn 1;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }", "private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }", "static function is_void($result) {\r\n if ($result != false) {\r\n if ($result->rowCount() > 0)\r\n return false;\r\n else\r\n return true;\r\n }\r\n else\r\n return true;\r\n //Functions::RegisterError($libError, $detail);\r\n }", "public function isQueryExceptions()\n {\n return $this->getAttribute(\\PDO::ATTR_ERRMODE) == \\PDO::ERRMODE_EXCEPTION;\n }", "public function lastError()\r\n\t{\r\n\t\treturn @db2_stmt_errormsg();\r\n\t}", "public function hasError() {\r\n\t\treturn ($this->errorNumber ? true : false);\r\n\t}", "public function hasError()\n {\n return $this->_detectFailureBoundaryInOutput(true);\n }", "public function check_data()\n {\n parent::check_data();\n\n if(empty($this->build_notifications))\n {\n throw new exception('<strong>Data missing: Notifications</strong>');\n }\n\n if(empty($this->build_batch_reference))\n {\n throw new exception('<strong>Data missing: Batch References</strong>');\n }\n }", "public function fails();", "public function fails();", "function sql_error($dbh=NULL)\n {\n global $SQL_DBH;\n $db = (!is_null($dbh) ? $dbh : $SQL_DBH);\n if ( is_object($db) )\n $error = $db->errorInfo();\n else\n $error = array('Handle is not object','','');\n if ($error[0] != '00000') {\n return $error[0].'-'.$error[1].' '.$error[2];\n }\n else return '';\n }", "public function hasError()\n {\n return isset($this->error);\n }", "public function isError() {\n\t\t// Evaluates errors based on the signal variable.\n\t\tif( $this->connect_error ) { return true; }\n\t\t\n\t\t// Evaluate MySQL errors\n $error = $this->mysqli->error;\n if ( empty($error) )\n return false;\n else\n return true;\n\t}" ]
[ "0.6711534", "0.6711534", "0.6711534", "0.6711534", "0.65140015", "0.6475202", "0.63773173", "0.6324962", "0.6247114", "0.6247114", "0.6241179", "0.6192756", "0.61566883", "0.6140063", "0.6122054", "0.61059695", "0.6083479", "0.60806483", "0.6065012", "0.6065012", "0.60569996", "0.60515696", "0.6017634", "0.5999695", "0.5989465", "0.59791154", "0.5973216", "0.5973216", "0.59671265", "0.5946881", "0.59230745", "0.5912257", "0.59052306", "0.58859444", "0.58843076", "0.5881429", "0.5845524", "0.5842244", "0.58289766", "0.5818661", "0.5815993", "0.57958394", "0.57949775", "0.57949775", "0.5791314", "0.5777825", "0.57541525", "0.57395583", "0.5731907", "0.5727926", "0.57187235", "0.5717535", "0.5702921", "0.569168", "0.5689318", "0.5687618", "0.5673662", "0.56717277", "0.5667963", "0.56577396", "0.564896", "0.5636915", "0.562701", "0.56197375", "0.5619378", "0.56187725", "0.56147915", "0.5609406", "0.5608858", "0.5602652", "0.56007457", "0.5599941", "0.5590671", "0.55902296", "0.55824465", "0.5576608", "0.55765104", "0.5566359", "0.5555341", "0.5551724", "0.5544144", "0.5543236", "0.5538136", "0.553597", "0.55352306", "0.5533332", "0.55264735", "0.5517279", "0.5509829", "0.550372", "0.5495502", "0.5493546", "0.5492016", "0.54908", "0.5476909", "0.5474816", "0.5474045", "0.5474045", "0.5473446", "0.54714733", "0.54705644" ]
0.0
-1
End of function confirm error functions CLEANING DATA BEDFORE SUBMISSION
function escape($result) { global $dataBaseConnection; return mysqli_real_escape_string($dataBaseConnection, $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanRepair() {}", "function resetErrorData()\n {\n $this->errorData = array();\n }", "public function resetErrors() {}", "public function actionCleanData()\n\t{\n\t\tif($this->confirm(\"Are you sure to clean all data?\")) {\n\t\t\tYii::$app->db->createCommand()->truncateTable('alert')->execute();\n\t\t\t\n\t\t\tYii::$app->db->createCommand()->dropForeignKey('customer_customer_maintain', 'customer_maintain')->execute();\n\t\t\tYii::$app->db->createCommand()->truncateTable('customer')->execute();\n\t\t\tYii::$app->db->createCommand()->truncateTable('customer_maintain')->execute();\n\t\t\tYii::$app->db->createCommand()->addForeignKey('customer_customer_maintain', 'customer_maintain', 'customer_id', 'customer', 'id', 'CASCADE')->execute();\n\t\t\t\n\t\t\tYii::$app->db->createCommand()->truncateTable('machine')->execute();\n\t\t\tYii::$app->db->createCommand()->truncateTable('machine_part')->execute();\n\t\t\tYii::$app->db->createCommand()->truncateTable('machine_product')->execute();\n\n\t\t\tYii::$app->db->createCommand()->dropForeignKey('order_master_detail', 'order_detail')->execute();\n\t\t\tYii::$app->db->createCommand()->truncateTable('order_master')->execute();\n\t\t\tYii::$app->db->createCommand()->truncateTable('order_detail')->execute();\n\t\t\tYii::$app->db->createCommand()->addForeignKey('order_master_detail', 'order_detail', 'master_id', 'order_master', 'id', 'CASCADE')->execute();\n\n\t\t\tYii::$app->db->createCommand()->truncateTable('part')->execute();\n\t\t\tYii::$app->db->createCommand()->truncateTable('part_type')->execute();\n\t\t\tYii::$app->db->createCommand()->truncateTable('product_part_type')->execute();\n\t\t\tYii::$app->db->createCommand()->truncateTable('finance')->execute();\n\t\t\t$this->stdout(\"Cleaning data done.\");\n\t\t}\n\t}", "public function clearError() {\n $this->errors = array();\n }", "function reset_errors()\n {\n }", "public function clean(): void\n {\n $this->truncateJournalTable();\n $this->output(\"<success>Table {$this->internalTable} truncated</success>\");\n }", "private function flush() {\n\t\t$this->_error = '';\n\t\t$this->_last_result = array();\n\t}", "public function clean() {\n $this->data = \"\";\n $this->currentRow = 1;\n $this->curPosition = 0;\n }", "function cms_shutdown_function()\n{\n $error = error_get_last();\n if( $error['type'] == E_ERROR || $error['type'] == E_USER_ERROR )\n {\n $str = 'ERROR DETECTED: '.$error['message'].' at '.$error['file'].':'.$error['line'];\n debug_to_log($str);\n $db = cmsms()->GetDb();\n if( is_object($db) )\n\t{\n\t // put mention into the admin log\n\t audit('','ERROR',$str);\n\t}\n }\n}", "function shutdown() {\n $error = error_get_last();\n if ($error['type'] === E_ERROR) {\n // fatal error has occured\n //ds_error('parse error function: parse_network_content(): ' . PHP_EOL .'error:'.PHP_EOL . $e->getMessage().'network:' . $network_id . PHP_EOL . 'content:' . $content. PHP_EOL);\n ds_error('FATAL ERROR:' . PHP_EOL. 'msg:' .$last_error['message']. PHP_EOL. 'file:'. $last_error['file'] . PHP_EOL. 'line:'. $last_error['line']);\n return false;\n }\n}", "function ClearError() \r\n{ \r\n$this->LastError = null; \r\n}", "protected function clearError()\n {\n $this->lastError = null;\n }", "private function resetErrors() {\n $this->errors = array();\n }", "public function clearErrors()\n {\n $this->errors = array();\n }", "protected function clear()\n {\n $this->error = '';\n $this->success = false;\n }", "public static function additionalCleaning() {\n \n }", "public function cleanup()\n\t{\n\t\t\n\t}", "public function clear() {\n $this->_errors = array();\n }", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp();", "public function cleanUp();", "public function cleanUp();", "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 clearErrors() {\n $this->fErrors = Array();\n }", "public function collectData() {\n $dialog = new Application_Model_DbTable_Dialog();\n\n $this->getDialogLines();\n $ignore_list = array('',''\n /*,\n 'submit_button'*/\n );\n $this->error = array();\n $this->error[] = \"<table><tr><th colspan='2'>Fix the following errors and retry</td></tr>\";\n $errorct = 0;\n $this->data = array();\n $formData = $this->getRequest();\n foreach($this->drows as $row) {\n if ($row['position'] == 0)\n continue;\n $type = $row['field_type'];\n $varname = $row['field_name'];\n $field_label = $row['field_label'];\n $validate = $row['validate'];\n if (in_array($type, $ignore_list)) {\n continue;\n }\n // logit('IN: '. $formData->getPost($varname,''));\n $this->data[$varname] = $formData->getPost($varname, '');\n // VALIDATION HERE\n if ($validate) {\n $msg = call_user_func($validate, $this->data[$varname]);\n logit(\"VAL: {$varname} {$validate} {$this->data[$varname]} -- {$msg}\");\n\n if ($msg) {\n // Enter into error array\n $errorct ++;\n $this->error[] = \"<tr><td class=\\\"rpad\\\"><b>{$field_label}:</b></td>\" .\n \"<td> <Span class=\\\"error\\\">{$msg}</span></td></tr>\";\n }\n }\n }\n $this->error[] = \"</table>\";\n if ($errorct == 0)\n $this->error = array();\n $this->handleCancel();\n // logit(\"ECT: \" . count($this->error));\n if (count($this->error) > 0) {\n $this->echecklistNamespace->flash = 'Correct errors and retry';\n $this->makeDialog($this->data);\n return true;\n }\n }", "public static function clean()\n\t{\n\t}", "public function cleanup()\n\t{\n\t}", "public function Finish() {\n\t\t\t$this->add_missed_values();\n\t\t}", "public function cleanup() {\n\t\t//TODO\n\t}", "public function clean() {\n\t\tglobal $warnings;\n\n\t\t// it's not at CBW\n\t\tif ($this->location != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as being at HQ\";\n\t\t\t$this->location = 1;\n\t\t}\n\t\t// it had beer in it\n\t\tif ($this->beer != 0) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as empty\";\n\t\t\t$this->beer = 0;\n\t\t}\n\t\t// it's not dirty\n\t\tif ($this->status != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as dirty\";\n\t\t}\n\n\t\t$this->status = 2;\n\t\t$this->update();\n\t}", "abstract function clean ();", "public function reset()\n {\n $this->errors = array();\n }", "public function clearFailedValidationData()\n {\n FormUtil::clearValidationFailedObjects($this->_objPath);\n }", "private function clearDataBuffer( )\n {\n $this->data_buffer = array( );\n $this->err_message = '';\n }", "public function clearErrors()\n {\n $this->errors = [];\n }", "protected function _clean()\r\n\t{\r\n\t\t$this->taintValue = null;\r\n\t\t$this->normalizedValue = null;\r\n\t\r\n\t\t$this->parameterInfo = null;\r\n\t\t$this->bFetched = false;\r\n\t\t\r\n\t\t$this->validationInfo = null;\r\n\t\t$this->isValid = false;\r\n\t}", "public function clean()\n\t{\n\t}", "function CleanUp() {\r\n\r\n // debug\r\n $this->err_level = 16;\r\n $this->err = \"CleanUp entered\";\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n\r\n $current = time();\r\n $still_valid = $current - $this->expire_time;\r\n\r\n // debug\r\n $this->err_level = 16;\r\n $this->err = \"CleanUp: current: \" . (string)$current . \" expire: \" . (string)$this->expire_time;\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n\r\n // copy stale sessions\r\n $query = \"select sid,seshid,uid,lastused from actsessions where lastused<$still_valid\";\r\n\r\n // debug\r\n $this->err_level = 16;\r\n $this->err = \"CleanUp query 01: \" . (string)$query;\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n\r\n $result = mysqli_query($this->linkid,$query);\r\n\r\n // debug\r\n $this->err_level = 16;\r\n $this->err = \"CleanUp query 01 executed\";\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n\r\n if (!$result) {\r\n $this->err=mysqli_error($this->linkid);\r\n $this->err_no=205;\r\n $this->DbgAddSqlLog();\r\n $this->AutomatState = -1;\r\n return;\r\n }\r\n\r\n $NumRows = mysqli_num_rows($result);\r\n\r\n // debug\r\n $this->err_level = 16;\r\n $this->err = \"CleanUp query 01 number of rows feched: \" . (string)$NumRows;\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n\r\n /* TODO: save stale sessions */\r\n\r\n // delete stale sessions\r\n $query=\"delete from actsessions where lastused<$still_valid\";\r\n\r\n // debug\r\n $this->err_level = 16;\r\n $this->err = \"CleanUp query 02: \" . (string)$query;\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n\r\n $result = mysqli_query($this->linkid,$query);\r\n\r\n // debug\r\n $this->err_level = 16;\r\n $this->err = \"CleanUp query 02 executed\";\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n\r\n // query failed\r\n if (!$result) {\r\n $this->err_level = -1;\r\n $this->err=mysqli_error($this->linkid);\r\n $this->err_no=204;\r\n $this->DbgAddSqlLog();\r\n $this->AutomatState = -1;\r\n return;\r\n }\r\n\r\n // debug\r\n if ($NumRows) {\r\n $this->err_level = 1;\r\n $this->err = \"CleanUp: Stale sessions deleted #:\" . $NumRows;\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n }\r\n }", "function TheEnd() {\r\n\r\n\t\t$this->connection = new Connection();\r\n\t\t$conn = $this->connection->openConnection();\r\n\t\ttry {\r\n\t\t\tif($conn){\r\n\t\t\t\t$deleteUser = $conn->prepare(\"DELETE from panier where proceed=1 AND etat=1 AND recu=1\");\r\n\t\t\t\t$deleteUser->execute();\r\n\t\t\t}\r\n\t\t} catch (PDOExecption $e) {\r\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"</br>\";\r\n\t\t}\r\n\r\n\t\t$this->connection->closeConnection();\r\n\t}", "abstract public function clean();", "public function processData() {\n\t\t$GLOBALS['TCA'] = \\BusyNoggin\\BnBackend\\BackendLibrary::removeExcludeFields($GLOBALS['TCA']);\n\t}", "public function sanitiseData(): void\n {\n $this->firstLine = self::sanitiseString($this->firstLine);\n self::validateExistsAndLength($this->firstLine, 1000);\n $this->secondLine = self::sanitiseString($this->secondLine);\n self::validateExistsAndLength($this->secondLine, 1000);\n $this->town = self::sanitiseString($this->town);\n self::validateExistsAndLength($this->town, 255);\n $this->postcode = self::sanitiseString($this->postcode);\n self::validateExistsAndLength($this->postcode, 10);\n $this->county = self::sanitiseString($this->county);\n self::validateExistsAndLength($this->county, 255);\n $this->country = self::sanitiseString($this->country);\n self::validateExistsAndLength($this->country, 255);\n }", "public function clean() {}", "public function cleanup()\n {\n }", "protected function validate_return_data($data_obj)\r\n {\r\n // Transfer the error message when previous object execution fail\r\n if($data_obj->is_error === true)\r\n {\r\n $status_data = $data_obj->get_return_data_set();\r\n $this->set_error(\r\n $status_data[\"status\"], \r\n $status_data[\"status_information\"],\r\n $status_data[\"status_information\"]\r\n );\r\n } \r\n }", "protected function resetErrors() {\n $this->errors = array();\n }", "protected function cleanUp()\n\t{\n\t\t// clean\n\t\t$this->killExceededTasks();\n\t\t$this->cleanHistory();\n\t}", "protected function clearResults() {\n\t\t$this->error = '';\n\t\t$this->status_org = false;\n\t\t$this->status_new = false;\n\t}", "function restablecer()\n {\n $this->_datos = null;\n $this->_errores = array();\n }", "public function clean() {\n\t\t\n\t}", "public function Cleanup()\r\n\t{\r\n\t}", "public function freeResult() {\r\n\t\tif ((false === $this->hasError()) && ($this->result != -1)) {\r\n\t\t\tmysql_free_result($this->result);\r\n\t\t\t$this->result = -1;\r\n\t\t}\r\n\t}", "function saveData($db, &$strError)\n{\n global $_REQUEST;\n global $_SESSION;\n global $messages;\n global $error;\n global $strDataID;\n global $intFormNumberDigit;\n $strmodified_byID = $_SESSION['sessionUserID'];\n $strError = \"\";\n $bolOK = true;\n $strDataID = (isset($_REQUEST['dataID'])) ? $_REQUEST['dataID'] : \"\";\n $strDataTripID = (isset($_REQUEST['dataTripID'])) ? $_REQUEST['dataTripID'] : \"\";\n $strDataCode = (isset($_REQUEST['dataCode'])) ? trim($_REQUEST['dataCode']) : \"\";\n $strDataNo = (isset($_REQUEST['dataNo'])) ? trim($_REQUEST['dataNo']) : \"\";\n $strDataMonth = (isset($_REQUEST['dataMonth'])) ? trim($_REQUEST['dataMonth']) : \"\";\n $strDataYear = (isset($_REQUEST['dataYear'])) ? trim($_REQUEST['dataYear']) : \"\";\n $strDataEmployee = (isset($_REQUEST['dataEmployee'])) ? trim($_REQUEST['dataEmployee']) : \"\";\n $strDataMethod = (isset($_REQUEST['dataMethod'])) ? $_REQUEST['dataMethod'] : \"0\";\n $strDataAccount = (isset($_REQUEST['dataAccount'])) ? $_REQUEST['dataAccount'] : \"\";\n $strDataBudget = (isset($_REQUEST['dataBudget'])) ? $_REQUEST['dataBudget'] : \"\";\n $strDataDate = (isset($_REQUEST['dataDate'])) ? $_REQUEST['dataDate'] : date(\"Y-m-d\");\n $strDataPaymentDate = (isset($_REQUEST['dataPaymentDate'])) ? $_REQUEST['dataPaymentDate'] : date(\"Y-m-d\");\n $strDataStatus = (isset($_REQUEST['dataStatus'])) ? $_REQUEST['dataStatus'] : \"0\";\n $strDataTotalAmount = (isset($_REQUEST['totalCost'])) ? $_REQUEST['totalCost'] : \"0\";\n $strDataTotalAmountOther = (isset($_REQUEST['totalCostOther'])) ? $_REQUEST['totalCostOther'] : \"0\";\n //$strDataPaymentStatus = (isset($_REQUEST['dataPaymentStatus'])) ? $_REQUEST['dataPaymentStatus'] : \"0\";\n // validasi data\n if (!validStandardDate($strDataDate)) {\n $strDataDate = date(\"Y-m-d\");\n } else if (!validStandardDate($strDataPaymentDate)) {\n $strDataPaymentDate = date(\"Y-m-d\");\n }\n // cek masalah kode/nomor form\n if ($strDataNo == \"\") {\n $strError = $error['empty_code'];\n $bolOK = false;\n } else {\n ($strDataID == \"\") ? $strKriteria = \"\" : $strKriteria = \"AND id <> '$strDataID' \";\n $strNumber = \"$strDataCode-$strDataNo/$strDataMonth/$strDataYear\";\n //if (isDataExists(\"hrdTripPayment\",\"claimNumber\",$strDataNo,$strKriteria)) {\n // $strError = $error['duplicate_code']. \" -> $strDataNo\";\n // $bolOK = false;\n //}\n }\n // cek apakah ada data emmployee\n if ($strDataEmployee == \"\") {\n $bolOK = false;\n $strError = $error['empty_data'];\n } else {\n $strSQL = \"SELECT id FROM hrd_employee WHERE employee_id = '$strDataEmployee' \";\n $resDb = $db->execute($strSQL);\n if ($rowDb = $db->fetchrow($resDb)) {\n $strIDEmployee = $rowDb['id'];\n } else {\n $bolOK = false;\n $strError = $error['data_not_found'];\n }\n }\n if ($bolOK && $strIDEmployee != \"\") {\n if ($strDataID == \"\") { // buat baru\n // cek dulu, apakah data sudah yang terakhir\n $strTmp = getLastFormNumber($db, \"hrdTripPayment\", \"no\", $strDataMonth, $strDataYear);\n $intTmp = ($strTmp == \"\") ? 0 : (int)$strTmp;\n $intKode = (int)$strDataNo;\n if ($intKode <= $intTmp) { // sudah ada yang lebih besar atau sama, ganti\n $intKode = $intTmp + 1;\n $strDataNo = addPrevZero($intKode, $intFormNumberDigit);\n }\n $strSQL = \"INSERT INTO hrd_trip_payment (created, modified_by, created_by, id_employee, \";\n $strSQL .= \"code, no, month_code, year_code, method, account_no, \";\n $strSQL .= \"budget_code, request_date, payment_date , status, id_trip, \\\"totalAmount\\\", total_amount_other) \";\n $strSQL .= \"VALUES(now(), '$strmodified_byID', '$strmodified_byID', '$strIDEmployee', \";\n $strSQL .= \"'$strDataCode', '$strDataNo', '$strDataMonth', '$strDataYear', \";\n $strSQL .= \"'$strDataMethod', '$strDataAccount', '$strDataBudget', '$strDataDate', \";\n $strSQL .= \"'$strDataPaymentDate', '$strDataStatus', '$strDataTripID', '$strDataTotalAmount', '$strDataTotalAmountOther') \";\n $resExec = $db->execute($strSQL);\n // cari IDnya\n $strSQL = \"SELECT id FROM hrd_trip_payment WHERE code = '$strDataCode' \";\n $strSQL .= \"AND no = '$strDataNo' AND month_code = '$strDataMonth' AND year_code = '$strDataYear' \";\n $strSQL .= \"AND id_employee = '$strIDEmployee' AND status = '$strDataStatus' \";\n $resDb = $db->execute($strSQL);\n if ($rowDb = $db->fetchrow($resDb)) {\n $strDataID = $rowDb['id'];\n }\n } else {\n $strSQL = \"UPDATE hrd_trip_payment SET modified_by = '$strmodified_byID', \";\n $strSQL .= \"id_employee = '$strIDEmployee', \";\n $strSQL .= \"code = '$strDataCode', no = '$strDataNo', \";\n $strSQL .= \"month_code = '$strDataMonth', year_code = '$strDataYear', \";\n $strSQL .= \"method = '$strDataMethod', account_no = '$strDataAccount', \";\n $strSQL .= \"request_date = '$strDataDate', payment_date = '$strDataPaymentDate', \";\n $strSQL .= \"budget_code = '$strDataBudget', status = '$strDataStatus', \";\n $strSQL .= \"\\\"totalAmount\\\" = '$strDataTotalAmount', total_amount_other = '$strDataTotalAmountOther' \";\n $strSQL .= \"WHERE id = '$strDataID' \";\n $resExec = $db->execute($strSQL);\n }\n if ($strDataID != \"\") { // simpan detail claim yang dilakukan\n (isset($_REQUEST['maxDetail'])) ? $intMax = $_REQUEST['maxDetail'] : $intMax = 0;\n for ($i = 1; $i <= $intMax; $i++) {\n (isset($_REQUEST['detailID' . $i])) ? $strID = $_REQUEST['detailID' . $i] : $strID = \"\";\n $strNote = (isset($_REQUEST['detailNote' . $i])) ? $_REQUEST['detailNote' . $i] : \"\";\n (isset($_REQUEST['detailCost' . $i])) ? $strCost = $_REQUEST['detailCost' . $i] : $strCost = \"0\";\n (isset($_REQUEST['detailCostOther' . $i])) ? $strCostOther = $_REQUEST['detailCostOther' . $i] : $strCostOther = \"0\";\n if (!is_numeric($strCost)) {\n $strCost = 0;\n }\n if (!is_numeric($strCostOther)) {\n $strCostOther = 0;\n }\n if ($strID == \"\") {\n if ($strNote != \"\") { // insert new data\n $strSQL = \"INSERT INTO hrd_trip_payment_other (created,modified_by, created_by, \";\n $strSQL .= \"id_trip_payment, note, amount, amount_other) \";\n $strSQL .= \"VALUES(now(), '$strmodified_byID', '$strmodified_byID', '$strDataID', \";\n $strSQL .= \"'$strNote', '$strCost', '$strCostOther') \";\n $resDb = $db->execute($strSQL);\n writeLog(ACTIVITY_ADD, MODULE_PAYROLL, \"$strDataID\", 0);\n }\n } else {\n if ($strNote == \"\") {\n // delete data\n $strSQL = \"DELETE FROM hrd_trip_payment_other WHERE id = '$strID' \";\n $resDb = $db->execute($strSQL);\n writeLog(ACTIVITY_DELETE, MODULE_PAYROLL, \"$strDataID\", 0);\n } else {\n // update data\n $strSQL = \"UPDATE hrd_trip_payment_other SET modified_by = '$strmodified_byID', \";\n $strSQL .= \"note = '$strNote', amount = '$strCost', amount_other = '$strCostOther' \";\n $strSQL .= \"WHERE id = '$strID' \";\n $resDb = $db->execute($strSQL);\n writeLog(ACTIVITY_EDIT, MODULE_PAYROLL, \"$strDataID\", 0);\n }\n } // if\n } // for\n } //if\n $strError = $messages['data_saved'] . \" >> \" . date(\"d-M-Y H:i:s\");\n return true;\n } else {\n return false;\n }\n return true;\n}", "function Clean()\n \t{\n\n\t\t\n\t\treturn TRUE;\n \t}", "public function free_result(){\n\t\t\n\t\tif($this->query_id !== 0 && !@mysql_free_result($this->query_id)) {\n\t\n\t\t\t$this->errorMessage(\"Not possible to free query id \".$this->query_id .\"\");\n\t\t\texit;\n\t\t\t\t\n\t\t}\n\t}" ]
[ "0.64905727", "0.6341653", "0.62112945", "0.6160311", "0.6119992", "0.61033845", "0.59971434", "0.5974191", "0.59396076", "0.5916758", "0.5916291", "0.59144783", "0.59091777", "0.5870594", "0.58279616", "0.58246976", "0.58234394", "0.5810625", "0.5806649", "0.580371", "0.580371", "0.580371", "0.580371", "0.580371", "0.580371", "0.580371", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5803467", "0.5802006", "0.5802006", "0.5802006", "0.5802006", "0.5802006", "0.5802006", "0.5789777", "0.5789777", "0.5789777", "0.57750684", "0.5758059", "0.57535756", "0.57455367", "0.57409316", "0.5736765", "0.57084805", "0.5695109", "0.56929976", "0.5690064", "0.56777346", "0.5665963", "0.5661732", "0.56483567", "0.5639558", "0.5634431", "0.56342137", "0.5633726", "0.5631653", "0.56303453", "0.5626143", "0.5615998", "0.56078035", "0.5599248", "0.5585455", "0.55837744", "0.55763406", "0.5574313", "0.5566828", "0.5552928", "0.5529441", "0.5528773", "0.551822" ]
0.0
-1
End of escape function FETCHIN ALL DATA FROM DATABASE
function fetch_array($result) { // global $dataBaseConnection; return mysqli_fetch_array($result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function doFetchAll();", "public function readAll(){\n //select all data\n $query = \"SELECT\n id, num_compte, cle_rib, num_agence, duree_epargne, frais, solde, created\n FROM\n \" . $this->table_name . \"\n ORDER BY\n num_compte\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "public function fetchAll(){\n $adapter = $this->adapter;\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from('flota');\n $selectString = $sql->getSqlStringForSqlObject($select);\n $data = $adapter->query($selectString, $adapter::QUERY_MODE_EXECUTE);\n \n return $data;\n }", "function readAll(){\n\n\t\t$query = \"SELECT * FROM \" . $this->table_name .\"\";\n\t\t$stmt = $this->conn->prepare($query);\n\t\t$stmt->execute();\n\t\treturn $stmt;\n\t}", "public function selectdata(){\n$this->autoRender=false;\n$data=$this->connection->execute(\"select * from users\")->fetchAll();\nprint_r($data);\n}", "function read(){\n //select all data\n $query = \"SELECT * FROM \" . $this->table_name . \" ORDER BY id\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "function fetch_all() {\n $query = \"SELECT * FROM ReadingList\";\n $statement = $this->connect->prepare($query);\n if($statement->execute()) {\n while($row = $statement->fetch(PDO::FETCH_ASSOC))\n {\n $data[] = $row;\n }\n return $data;\n } else {\n return \"error\";\n }\n }", "protected static function afterGetFromDB(&$row){}", "function readAll(){\n \n $query = \"SELECT * FROM \".$this->table_name.\" ORDER BY id_alternatif ASC\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n\n return $stmt;\n }", "public function readAll(){\n $rq = \"SELECT * FROM Objets\";\n $stmt = $this->pdo->prepare($rq);\n $data = array();\n if(!$stmt->execute($data)){\n throw new Exception($pdo->errorInfo());\n }\n return $result = $stmt->fetchAll();\n }", "function get_all_data_output( $con, $table, $offset ){\n\t\n\t\tif ( $table == 'events' )\n\t\t\t$res = select_all_events_output( $con, 0, $offset ); \n\t\telse if ( $table == 'checkins' )\n\t\t\t$res = select_all_checkins_output( $con, 0, $offset ); \n\t\t\n\t\treturn $res;\n\t\t/*\n\t\t$result = $res;\n\t\tfree_result($res);\n\t\treturn $result;\n\t\t*/\n\t}", "public function fetchAll(){\n $sql = \"SELECT * FROM reservation \";\n $result = $this->connection()->query($sql);\n if ($result->rowCount()>0){\n while($rows = $result->fetch()){\n $data [] = $rows;\n }return $data;\n }\n }", "public function fetchAll()\n {\n }", "public function read(){\n \n //select all data\n $query = \"SELECT\n id, id, num_compte, cle_rib, duree_epargne, frais, solde, created\n FROM\n \" . $this->table_name . \"\n ORDER BY\n created\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "public function read()\n {\n // select all data\n $query = \"SELECT `id`,`name` from `\" . $this->table_name . \"` order by `name`;\";\n // $stmt = $this->conn->prepare($query);\n // var_dump($stmt);\n $q= 'select * from `categories`;';\n $stmt = ($this->conn)->query($q);\n \n $stmt->execute();\n \n return $stmt;\n }", "private function preExe(){\n\t\t$pre = $this->prepare($this->_query);\n\t\t$pre->execute();\n\t\treturn $pre->fetchAll();\n\t}", "function read(){\n \n // select all query\n $query = \"SELECT * from \" . $this->table_name . \"\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "function readAll() {\n $query = \"SELECT \n id, name, description\n FROM\n \" . $this->table_name . \" \n ORDER BY\n name\";\n\n $stmt = $this->conn->prepare($query);\n\n //execute query\n $stmt->execute();\n\n return $stmt;\n }", "function FetchRow() {}", "function database_load_all()\n {\n if( !is_resource($this->_last_resource) )\n {\n return FALSE;\n }\n \n $resource = $this->_last_resource;\n $return_data = array();\n while( $data = $this->database_fetch_assoc($resource) )\n {\n $return_data[] = $data;\n }\n \n return $return_data;\n\t}", "public function readAll(){\r\n $query = \"SELECT * FROM docente;\";\r\n $statement = $this->cdb->prepare($query);\r\n $statement->execute();\r\n $rows = $statement->fetchAll(\\PDO::FETCH_OBJ);\r\n return $rows; \r\n }", "public function __destruct() {\n\t\tself::$loadByIdStmt->closeCursor();\n\t}", "public function fetch()\n\t{\n\t\t//$this -> error();\n\t\t$dbName = $this -> databaseName;\n\t\treturn $dbName() -> fetch();\n\t}", "abstract public function fetchData();", "abstract public function fetchData();", "public function _fetchAll()\n\t\t{\t\t\t\n\t\t\t$data = '';\n\t\t\twhile (($chunk = $this->_fetch(4096)) !== false)\n\t\t\t\t$data .= $chunk;\n\t\t\treturn $data;\n\t\t}", "function read_all(){\n \n // select all query\n $query = \"SELECT\n *\n FROM\n \" . $this->table_name . \"\n ORDER BY\n date DESC\";\n //SELECT id, username, date, content, IF(private, 'true', 'false') private\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "public function fetchInto(){\n\t\t\t}", "public function readAll ()\n {\n\n $query = \"SELECT\n book_id,type_id,name,isbn,author,publisher,price\n FROM \". \" $this->table_name \";\n\n\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n// $row = $stmt->fetch(PDO::FETCH_ASSOC);\n return $stmt;\n }", "private function fetch($result) {\n $lines =& $this->lines;\n\n $lines = array();\n while ($r = sqlsrv_fetch_array($result)) {\n $lines[] = $r;\n }\n \n sqlsrv_free_stmt($result); //frees the memory resource, since we will not need it again travels\n }", "function fetchAll()\n {\n //select all data\n $query = \"SELECT\n id, tag\n FROM\n \" . $this->table_name . \"\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_OBJ);\n\n\n return $result;\n }", "public function fetchRow();", "public function select_all(string $query)\n{\n $this->strquery = $query;\n $result = $this->conexion->prepare($this->strquery);\n $result->execute();\n $data = $result->fetchall(PDO::FETCH_ASSOC);\n return $data; \n}", "public abstract function fetchAll();", "public function read(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "function read(){\n //select all data\n $query = \"SELECT\n id, name, status\n FROM\n \" . $this->table_name . \"\n ORDER BY\n id DESC\"; \n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "public function readDatabase() {\n\t\t$q = $this->pdo->query(\"SELECT count(*) FROM `Articles`\");\n\t\t$count = $q->fetch(PDO::FETCH_ASSOC)[\"count(*)\"];\n\t\t$numFetched = 0;\n\t\t$start = 0;\n\t\t// Fetch only 50 articles at a time to limit the memory impact\n\t\twhile($numFetched < $count){\n\t\t\t$q = $this->pdo->query(\"SELECT \".$this->columns.\" FROM `Articles` LIMIT $start,100\");\n\t\t\tforeach($q->fetchAll(PDO::FETCH_ASSOC) as $a){\n\t\t\t\t$this->articles[] = $this->makeArticleFromDB($a);\n\t\t\t\t$numFetched += 1;\n\t\t\t}\n\t\t\t$start += 100;\n\t\t}\n\t}", "public function fetchAll()\n {\n //*** your code goes here\n //*** if there is an error, return an array which includes an error code of 2 and message == ERROR_UNABLE\n $listing = $this->table->select();\n if ($listing) {\n $data = [];\n $hydrator = $this->table->getResultSetPrototype()->getHydrator();\n foreach ($listing as $entity) $data[] = $hydrator->extract($entity);\n $result = ['success' => 1, 'data' => $data];\n } else {\n $result = ['success' => 0, 'error' => 1, 'message' => self::ERROR_UNABLE];\n }\n return $result;\n }", "public function fetchAll();", "public function fetchAll();", "public function fetchAll();", "public function fetchAll();", "public function fetch()\n\t{\n\t\treturn $this->data = $this->df->fetchAll();\n\t}", "protected function dbFetchAll() {\r\n\r\n //@@TODO RESOURCE CHECK IS_A ?\r\n\r\n $return_array = array();\r\n\r\n while ($row = $this->query_result->fetch_array(MYSQLI_ASSOC)) {\r\n $return_array[] = $this->dbOutArray($row);\r\n }\r\n return $return_array;\r\n }", "function postsActivite(){\n $db = dbPDO();\n $req = $db->query('SELECT * FROM activite');\n //$req->closeCursor();\n return $req;\n }", "function SQLDonnees($sth) {\n try {\n return $sth->fetchAll();\n } catch (Exception $e) {\n ob_end_clean();\n die('<!DOCTYPE html><html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Arcade 2i</title><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/bootstrap.css\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/style.css\"/><script src=\"https://code.jquery.com/jquery-2.2.3.min.js\"></script><script src=\"assets/js/bootstrap.js\"></script></head><body><div class=\"container\"><div class=\"row\"><div class=\"alert alert-danger\">Erreur lors de l\\'execution de la page : ' . $e->getMessage() . '</div></div></div></body></html>');\n }\n}", "public function fetchAll(){\n try{\n $this->array = $this->resultado->fetchAll();\n } catch (PDOException $e){\n $this->errors[] = 'error: function fetchAll<br/>'.$e->getMessage();\n $this->array = NULL;\n }\n return $this->array;\n }", "function readAll(){\r\n $query = \"SELECT SubjectID, SubjectName\r\n FROM \" . $this->table_name . \r\n \" ORDER BY SubjectName\";\r\n \r\n $stmt = $this->dbConn->prepare( $query );\r\n $stmt->execute();\r\n \r\n return $stmt;\r\n }", "function dbFetch($id_ = \"\"){\n\t\t$sql = \"\";\n\t\t$rsResult = $this->conn->Execute($sql,array($id_));\n\t\tif(!$rsResult->EOF){\n\t\t\treturn $rsResult->fields;\n\t\t}\n\t}", "abstract public function FetchRow();", "public function modelFetchAll(){\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van, tra ket qua ve mot object\n\t\t\t$query = $conn->query(\"select * from phongban\");\n\t\t\t//tra ve tat ca cac ban ghi\n\t\t\treturn $query->fetchAll();\n\t\t}", "public function fetchAll(){\r\n$table=$this->getTable();\r\nreturn $this->fetch_array($this->query(\"SELECT * FROM {$table}\"));\r\n}", "public function fetch(){\n\n $rows = [];\n\n while($row = $this->result->fetch(PDO::FETCH_ASSOC)) {\n $rows[]=$row;\n }\n\n $this->result=null;\n\n return $rows;\n\n }", "public function fetchAll($fetchMode = \\PDO::FETCH_BOTH);", "private function finish() {\n\t\t\t$this->db->close();\n\t\t\t$this->page->output();\n\t\t}", "protected function db_end() {\n\t\t\tif ( 'off' === $this->mysql_set ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$this->output_string = '';\n\n\t\t\t$this->output_string .= \"/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\\n\";\n\t\t\t$this->output_string .= \"/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\\n\";\n\t\t\t$this->output_string .= \"/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\\n\";\n\n\t\t\t$this->write_output();\n\t\t}", "public function fetchAll()\r\n {\r\n $this->query();\r\n return $this->sth->fetchAll();\r\n }", "function SelektoDatabasen(){\n global $db;\n $SqlStmt=$db->prepare(\"select * from p149pm_roombook\");\n try{ $SqlStmt->execute(); } catch (PDOException $e) { die(); }\n while($row = $SqlStmt->fetch(PDO::FETCH_ASSOC)) { $smartRs[] = $row; }\n if ($SqlStmt->rowCount() > 0) {return $smartRs; }\n\n}", "public function fetchSqlString();", "public function fetchAll() {\n $this->execute();\n return $this->stmt->fetchAll(PDO::FETCH_OBJ);\n }", "public function fetchAll()\n {\n $this->execute();\n return $this->dbStmt->fetchAll(PDO::FETCH_ASSOC);\n }", "function ReadAll(){\n\n\t\t//Instanciamos y nos conectamos a la bd\n\t\t$Conexion = floopets_BD::Connect();\n\t\t$Conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t//Crear el query que vamos a realizar\n\t\t$consulta = \"SELECT tipo_denuncia.*,denuncia.* FROM denuncia INNER JOIN tipo_denuncia ON denuncia.td_cod_tipo_denuncia=tipo_denuncia.td_cod_tipo_denuncia WHERE denuncia.de_estado='Pendiente'\";\n\t\t$query = $Conexion->prepare($consulta);\n\t\t$query->execute();\n\t\t//Devolvemos el resultado en un arreglo\n\t\t//Fetch: es el resultado que arroja la consulta en forma de un vector o matriz segun sea el caso\n\t\t//Para consultar donde arroja mas de un dato el fatch debe ir acompañado con la palabra ALL\n\t\t$resultado = $query->fetchALL(PDO::FETCH_BOTH);\n\t\treturn $resultado;\n\t\tfloopets_BD::Disconnect();\n\t}", "public function fetchAll(){\n\t\treturn $this->instance->fetchAll();\n\t}", "public function fetchAll($sql);", "public function fetchAll($sql);", "private function readAll(){\r\n $results = array();\r\n \r\n if ( null !== $this->getDB() ) {\r\n $dbs = $this->getDB()->prepare('select * from about_page');\r\n \r\n if ( $dbs->execute() && $dbs->rowCount() > 0 ) {\r\n $results = $dbs->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n \r\n } \r\n return $results;\r\n }", "public function getAllData()\n\t{\t\n\t\t//database selection\n\t\t$database = \"\";\n\t\t$constantDatabase = new ConstantClass();\n\t\t$databaseName = $constantDatabase->constantDatabase();\n\t\t\n\t\tDB::beginTransaction();\t\t\n\t\t$raw = DB::connection($databaseName)->select(\"select \n\t\tquotation_id,\n\t\tquotation_label,\n\t\tquotation_type,\n\t\tstart_at,\n\t\tend_at,\n\t\tcreated_at,\n\t\tupdated_at,\n\t\tcompany_id\t\t\t\n\t\tfrom quotation_dtl \n\t\twhere deleted_at='0000-00-00 00:00:00'\");\n\t\tDB::commit();\n\t\t\n\t\t//get exception message\n\t\t$exception = new ExceptionMessage();\n\t\t$exceptionArray = $exception->messageArrays();\n\t\tif(count($raw)==0)\n\t\t{\n\t\t\treturn $exceptionArray['204'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$enocodedData = json_encode($raw);\n\t\t\treturn $enocodedData;\n\t\t}\n\t}", "public function fetch_all(){\n $data = array();\n while( ($obj = oci_fetch_object($this->result)) != false ){\n $data[] = $obj;\n }\n return $data;\n }", "function read(){\n $query = \"SELECT * FROM \" . $this->table_name;\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n return $stmt;\n }", "function LoadData($conn)\r\n{\r\n\tglobal $x_entidad_id;\r\n\t\r\n\tphpmkr_free_result($rs);\r\n\treturn $bLoadData;\r\n}", "public function get_data()\n {\n return $this->retrieve('SELECT * FROM isys_import LIMIT 1000;');\n }", "public function fetchAll()\r\n {\r\n $sql = new Sql($this->dbAdapter);\r\n $select = $sql->select();\r\n $select\r\n ->from(array('a_s' => $this->table))\r\n ->order('a_s.sector_order ASC');\r\n \r\n $selectString = $sql->getSqlStringForSqlObject($select);\r\n $execute = $this->dbAdapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n $result = $execute->toArray();\r\n return $result;\r\n }", "function readData()\n {\n $this->current_row = false;\n $this->current_row_hash = false;\n $this->current_row_index = $this->offset - 1;\n $this->mapping = false;\n\n $this->mysqli = new mysqli( $this->host, $this->username, $this->password,\n $this->dbname, $this->port, $this->socket );\n\n /* check connection */\n if ( mysqli_connect_errno() )\n {\n printf( \"Connect failed: %s\\n\", mysqli_connect_error() );\n exit();\n }\n }", "function read(){\n $dbh = $this->connect();\n $sentencia = \"SELECT * FROM doctor\";\n $stmt = $dbh->prepare($sentencia);\n $stmt->execute();\n $rows = $stmt->fetchAll();\n return $rows;\n }", "function importFromOutside($data)\r\n {\r\n\r\n $sql = $data;\r\n \r\n if(!empty($sql)){\r\n\r\n $sql = explode(';', $_POST['return']);\r\n\r\n foreach ($sql as $query) {\r\n $result = $this->onlineDB->prepare(\"$query\");\r\n try {\r\n $result->execute();\r\n } catch (Exception $e) {\r\n echo $e;\r\n }\r\n }\r\n\r\n }else\r\n echo 'there is no database';\r\n\r\n }", "function readReal(){ \n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE id=1 LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t$this->id = $row['id'];\n\t\t$this->nmp = $row['nama_pondok'];\n\t\t$this->almt = $row['alamat_pondok'];\n\t\t$this->komp = $row['komputer_pondok'];\n\t\t$this->sms = $row['no_sms_gateway'];\n\t}", "public function retrieveAll(){\r\n $conn = new ConnectionManager();\r\n $pdo = $conn->getConnection();\r\n \r\n\r\n // Add your codes here\r\n\r\n\r\n return $result;\r\n }", "public function selectAllContracteData(){\n $sql = \"SELECT * FROM contract ORDER BY id DESC\";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_OBJ);\n }", "public function read(){\n $query = \"SELECT * FROM {$this->table}\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n return $stmt;\n }", "function AutomatFetchAll() {\r\n $query = \"select * from usrautomat\";\r\n // debug\r\n $this->err_level = 16;\r\n $this->err = \"AutomatFetchAll. query: \" . (string)$query;\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n $this->AutomatData = mysqli_query($this->linkid,$query);\r\n // query failed\r\n if (!$this->AutomatData) {\r\n $this->err_level = -1;\r\n $this->err=mysqli_error($this->linkid);\r\n $this->err_no=209;\r\n $this->DbgAddSqlLog();\r\n $this->AutomatState = -1;\r\n return;\r\n }\r\n $this->AutomatDataRows = mysqli_num_rows($this->AutomatData);\r\n $this->AutomatDataFields = mysqli_num_fields($this->AutomatData);\r\n if (!$this->AutomatDataRows) {\r\n // no data for this automat state\r\n $this->err_level = -1;\r\n $this->err=mysqli_error($this->linkid);\r\n $this->err_no=210;\r\n $this->DbgAddSqlLog();\r\n $this->AutomatState = -1;\r\n return;\r\n }\r\n return;\r\n }", "public abstract function FetchRow();", "protected final function fetchRecords()\n {\n $this->query->setLimit(\n (($this->parameters->getCurrentPage() - 1) * $this->parameters->getResultsPerPage()),\n $this->parameters->getResultsPerPage()\n );\n\n $this->data = $this->query->execute()->getAssociative();\n }", "abstract protected function fetchRowAssocDb();", "public function fetchAll() {\r\n\t\treturn $this->getMapper()->fetchAll();\r\n\t\t\r\n\t}", "public function execute() {\r\n // $this->connecxao = parent::getConnect();\r\n $stmt = $this->connecxao->prepare($this->getQuery());\r\n $this->transition = $stmt->execute($this->getBinds());\r\n $this->error = $stmt->errorInfo();\r\n\r\n if ($this->error[0] == \"00000\") {\r\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\r\n $this->data = $stmt;\r\n } else {\r\n $this->setMsgError(\"Code Aplic Error: \" . $this->error[0] . \"<br />Code BD Error: \" . $this->error[1] . \"<br />Msg BD Error: \" . $this->error[2]);\r\n }\r\n }", "public function fetchDataToFront()\n\t{\n\t\t$this->db->order_by($this->id,$this->order);\n\t\t$this->db->limit(4);\n\t\treturn $this->db->get($this->table)->result();\n\t}", "public function getXqlCursor () {\n $this->xmldb->getXqlCursor();\n }", "function getAllPosts() {\n global $db;\n\n $query = \"SELECT * FROM post\"; //selecting all posts\n $statement = $db->prepare($query);\n $statement->execute();\n\n //fetchAll() --> retrieve all rows\n $results = $statement->fetchAll();\n $statement->closeCursor();\n return $results;\n}", "function Readto()\n {\n $conexion=floopets_BD::Connect();\n $conexion->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);\n\n $consulta=\"SELECT denuncia.*,tipo_denuncia.* FROM tipo_denuncia INNER JOIN denuncia on tipo_denuncia.td_cod_tipo_denuncia=denuncia.td_cod_tipo_denuncia \";\n // $consulta=\"SELECT * FROM citas WHERE Cod_usu=?\";\n $query=$conexion->prepare($consulta);\n $query->execute(array());\n\n\t$resultado=$query->fetchAll(PDO::FETCH_BOTH);\n\n\tfloopets_BD::Disconnect();\n\n\treturn $resultado;\n }", "public function read(){\n try {\n // query to get all users\n $this->_query = \"SELECT * FROM \" . $this->_dbtable;\n\n //preparing query\n $statement = $this->_conn->prepare($this->_query);\n\n // executing query\n $statement->execute();\n\n return $statement;\n }\n catch(PDOException $ex){\n echo \"Error\" . $ex->getMessage();\n }\n }", "public function fetch(){\n try{\n $this->array = $this->resultado->fetch();\n } catch (PDOException $e){\n $this->errors[] = 'error: function fetch<br/>'.$e->getMessage();\n $this->array = NULL;\n }\n return $this->array;\n }", "function read(){\n \n // select all query\n $query = \"SELECT * FROM `tipos_tarjetas`\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "function read(){\n \n // select all query\n $query = \"SELECT inv.`id`, inv.`local_id`, loc.`nombre` as local_nom, inv.`producto_id`, \n pro.`codigo`, pro.`nombre`, inv.`cantidad`, inv.`minimo_stock`\n FROM `inventario_local` as inv\n JOIN `locales` as loc ON (loc.`id` = inv.`local_id`)\n JOIN `productos` as pro ON (pro.`id` = inv.`producto_id`)\n WHERE loc.`empresa_id` = 1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "function Execute_Consecutively($sentence, $key){\n global $Cn;\n try {\n $result = $Cn->query($sentence);\n $resultado = $result->fetchAll(PDO::FETCH_ASSOC);\n $result->closeCursor();\n //var_dump($resultado);\n // die(\"AAA\");\n return $resultado[0][$key];\n } catch (Exception $e) {\n die(\"Error in the line: \" + $e->getLine() + \" MSG: \" + $e->GetMessage());\n return 0;\n }\n}", "public function readAll(){\n\t\t\t$req = \"SELECT recette.idRec, recette.nom AS lib, descriptif, difficulte, prix, nbPersonnes, \n\t\t\t\t\tdureePreparation, dureeCuisson, dureeTotale, qteCalories, qteProteines, qteGlucides, qteLipides, \n\t\t\t\t\tutilisateur.nom AS utilNom, utilisateur.prenom AS utilprenom, illustration.adresse\n\t\t\t\t\tFROM recette \n\t\t\t\t\tINNER JOIN utilisateur\n\t\t\t\t\tON recette.idUtil = utilisateur.idUtil\n\t\t\t\t\tINNER JOIN illustration\n\t\t\t\t\tON recette.idRec = illustration.idRec\n\t\t\t\t\tORDER BY recette.nom ASC\";\n\t\t\t$curseur=$this->cx->query($req);\n\t\t\treturn $curseur;\n\t\t}", "function all(){\n try{\n $link= connecter_db();\n $rp=$link->prepare(\"select * from etudiant order by id desc\");\n $rp->execute();\n $resultat= $rp->fetchAll(); \n\n return $resultat;\n }catch(PDOException $e ){\n die (\"erreur de recuperation des etudiants dans la base de donnees \".$e->getMessage());\n }\n\n}", "function read(){\r\n \r\n // select all query\r\n $query = \"SELECT\r\n rul.reg_user_luggage_id as UserLuggageId,\r\n rul.reg_user_id as UserId,\r\n rul.luggage_check_in as CheckIn,\r\n rul.luggage_check_out as CheckOut,\r\n rul.luggage_status as lStatus,\r\n rul.luggage_image as LuggageImage\r\n FROM\r\n \" . $this->table_name . \" rul \";\r\n \r\n // prepare query statement\r\n $stmt = $this->conn->prepare($query);\r\n \r\n // execute query\r\n $stmt->execute();\r\n \r\n return $stmt;\r\n }", "abstract public function fetchAll($fetchType = \\PDO::FETCH_ASSOC);", "function FetchAllData($bdd){\n $sth = $bdd->prepare(\"SELECT * FROM article\");\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n}", "public function fetch()\r\n {\r\n $this->query();\r\n return $this->sth->fetch();\r\n }", "function end() {\n\t\t\t$this->db->close();\n\t\t}" ]
[ "0.6351734", "0.63074005", "0.6261003", "0.6143521", "0.6071509", "0.6050722", "0.6040521", "0.6031049", "0.60295874", "0.59894305", "0.5987172", "0.5983864", "0.5980551", "0.59635013", "0.5931771", "0.5920145", "0.59064066", "0.5872663", "0.587057", "0.58692604", "0.5865195", "0.5839793", "0.58346575", "0.5833217", "0.5833217", "0.5816275", "0.5801222", "0.57946193", "0.57927287", "0.57725376", "0.5764815", "0.5763094", "0.57441664", "0.57423276", "0.57395345", "0.5738059", "0.5737929", "0.57176787", "0.5713849", "0.5713849", "0.5713849", "0.5713849", "0.57109946", "0.57097745", "0.57022554", "0.5691058", "0.56880015", "0.56794953", "0.56625617", "0.5642995", "0.5636748", "0.56359583", "0.56253594", "0.56067616", "0.5604398", "0.558551", "0.55796504", "0.5566825", "0.5550262", "0.5549934", "0.5546131", "0.5539584", "0.55370307", "0.5529393", "0.5529393", "0.5520893", "0.551538", "0.55146873", "0.5512563", "0.551107", "0.5505517", "0.55030453", "0.5489216", "0.5487597", "0.5486617", "0.54804325", "0.5478023", "0.5477402", "0.54759717", "0.5459464", "0.5458286", "0.5457864", "0.54508185", "0.54466414", "0.54410297", "0.5435352", "0.54297", "0.5429698", "0.54286045", "0.54265314", "0.54235446", "0.5422964", "0.541987", "0.54148185", "0.5412595", "0.54094666", "0.54047316", "0.54031044", "0.5401309", "0.54000866", "0.53997445" ]
0.0
-1
end of fetch array
function fetch_all_assoc($result) { return mysqli_fetch_assoc($result); # AUTHENTICATIONS }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function fetchMore(): void\n {\n $url = $this->client->urlTo($this->cql, $this->position, $this->count, $this->extraParams);\n $body = $this->client->request('GET', $url);\n $this->lastResponse = new SearchRetrieveResponse($body);\n $this->data = $this->lastResponse->records;\n\n if (count($this->data) != 0 && $this->data[0]->position != $this->position) {\n throw new Exceptions\\InvalidResponseException(\n 'Wrong index of first record in result set. '\n . 'Expected: ' .$this->position . ', got: ' . $this->data[0]->position\n );\n }\n }", "public function fetchArray();", "public function fetchArray();", "public abstract function FetchArray();", "function fetch_array()\r\n\t\t{\r\n\t\t\tif ($this->affected_rows <> 0)\r\n\t\t\t{\r\n\t\t\t\t$this->row_data = mysql_fetch_array($this->result);\t\t\r\n\t\t\t}\r\n\t\t}", "function db_fetch_next_row( $fetch_mode = DB_FETCHMODE_ASSOC ) {\n\n $this->pm_clear_cols();\n if( ! is_object( $this->dataset_obj )) return NULL;\n\n $this->curr_row_array = $this->dataset_obj->fetchRow( $fetch_mode );\n $this->pm_die_if_error( 'curr_row_array' );\n\n if( is_array( $this->curr_row_array )) { # Some data was retrieved\n $this->curr_rowno++;\n $this->cols_in_curr_row = count( $this->curr_row_array );\n }\n\n return $this->curr_row_array;\n }", "public function end()\n {\n return end($this->_data);\n }", "abstract public function fetchData();", "abstract public function fetchData();", "public function fetch_array() {\n if ($this->Currentindex < $this->data['num_rows']) {\n $result = $this->lines[$this->Currentindex];\n $this->Currentindex++;\n\n return $result;\n } else {\n return false;\n }\n }", "function FetchNextObj() {}", "abstract public function fetch();", "abstract public function fetch();", "function db_get_data($str){ \n $rows=array();\n $result=$this->con->query($str);\n while($row=$result->fetch_assoc()){\n //this line behaves as array_pop\n $rows[]=$row;\n }\n return $rows;\n }", "public function getEnd() {}", "public function fetch(): array\n {\n }", "function asdb_last($array)\n\t{\n\t\treturn end($array);\n\t}", "public function fetchData()\n\t{\n\t\tif (isset($this->rows))\n\t\t{\n\t\t\treturn $this->rows;\n\t\t}\n\t\t$this->rows = parent::fetchData();\n\t\tif ($this->force_count)\n\t\t{\n\t\t\treturn $this->rows;\n\t\t}\n\n\t\tif (count($this->rows) > $this->pagination->pageSize)\n\t\t{\n\t\t\t$this->hasMore = true;\n\t\t\tarray_pop($this->rows);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->hasMore = false;\n\t\t}\n\t\t$this->totalItemCount = $this->pagination->offset + count($this->rows);\n\t\t$this->pagination->itemCount = $this->totalItemCount + ($this->hasMore ? 1 : 0);\n\t\treturn $this->rows;\n\t}", "protected function fetchArray($cursor = null)\n\t{\n\t\treturn false;\n\t}", "public function fetch(){\n try{\n $this->array = $this->resultado->fetch();\n } catch (PDOException $e){\n $this->errors[] = 'error: function fetch<br/>'.$e->getMessage();\n $this->array = NULL;\n }\n return $this->array;\n }", "public function getEnd();", "public function fetchData()\n {\n if (null === $this->data) {\n $adaptable = $this->getAdaptable();\n if ($adaptable instanceof \\ArrayObject) {\n $this->data = $adaptable->getArrayCopy();\n } else {\n $this->data = (array) $adaptable;\n }\n\n $page = $this->getPageNumber() - 1;\n $limit = $this->getItemsPerPage();\n $this->data = array_splice($this->data, $page * $limit, $limit);\n }\n }", "public function end()\n {\n end($this->_data);\n return current($this->_data);\n }", "function movenext(){\n\t\t\n\t\tif ($this->debug) echo \"Fetching next record ... \";\n\t $this->record = @mysql_fetch_array($this->rstemp);\n\t $status = is_array($this->record);\n\t\t\n\t\tif ($this->debug && $status) echo \"OK <br>\\n\\n\";\n\t\telseif ($this->debug) echo \"EOF <br>\\n\\n\";\n\t\t\n\t return($status);\n\t}", "public function last() {\n\t\t$result = $this->get_result();\n\n\t\treturn array_pop( $result );\n\t}", "public function testResultFetchFullArray()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t\n \t$this->assertEquals(array(1, 'one', 'first row', 'ACTIVE', 'id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), $result->fetchFullArray());\n \t$this->assertEquals(array(2, 'two', 'next row', 'ACTIVE', 'id'=>2, 'key'=>'two', 'title'=>'next row', 'status'=>'ACTIVE'), $result->fetchFullArray());\n \t$this->assertNull($result->fetchFullArray());\n \t\n \t$result->resetPointer();\n \t$this->assertEquals(array(1, 'one', 'first row', 'ACTIVE', 'id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), $result->fetchFullArray(), \"Fetch after reset pointer: \");\n }", "public function next(): void\n {\n if (count($this->data) > 0) {\n array_shift($this->data);\n }\n ++$this->position;\n\n if ($this->position > $this->numberOfRecords()) {\n return;\n }\n\n if (count($this->data) == 0) {\n $this->fetchMore();\n }\n }", "function nextRecord(){\r\n @ $this->Record = mysql_fetch_assoc( $this->Query_ID );\r\n $this->Row += 1;\r\n $this->Errno = mysql_errno();\r\n $this->Error = mysql_error();\r\n $stat = is_array( $this->Record );\r\n if( !$stat ) {\r\n @ mysql_free_result( $this->Query_ID );\r\n $this->Query_ID = 0;\r\n }\r\n return $stat;\r\n }", "function fetch_array()\n {\n return mysql_fetch_array($this->_queryResource, MYSQL_ASSOC);\n }", "public function fetch_array() {\n\t\treturn $this->FetchArray();\n\t}", "public function _fetchAll()\n\t\t{\t\t\t\n\t\t\t$data = '';\n\t\t\twhile (($chunk = $this->_fetch(4096)) !== false)\n\t\t\t\t$data .= $chunk;\n\t\t\treturn $data;\n\t\t}", "abstract protected function doFetchAll();", "function moveNext() {\r\n\r\n $row = $this->result->fetchRow( MDB2_FETCHMODE_ASSOC );\r\n $this->EOF = !is_array( $row );\r\n $this->fields = $row;\r\n\r\n }", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch(){\n\n $rows = [];\n\n while($row = $this->result->fetch(PDO::FETCH_ASSOC)) {\n $rows[]=$row;\n }\n\n $this->result=null;\n\n return $rows;\n\n }", "public function lastObject()\n {\n return end($this->array);\n }", "public function get_end_cursor()\n {\n }", "public function fetch(){\n $qry = $this->db->query(\"SELECT * FROM \".$this->tbl_specialOffers);\n $array = array();\n while($r = $qry->fetch_assoc()){\n $array[] = new ArrToObj($r) ;\n }\n if(count($array) > 0){\n return $array;\n }else{\n return null ;\n }\n }", "public function fetch()\n {\n return mysqli_fetch_assoc($this->lastResults);\n }", "public function end();", "public function end();", "public function end();", "public function end();", "public function fetchArray() : array\n\t{\n\t\treturn $this->handle->fetchArray($this->result);\n\t}", "public function fetch() {}", "function moveNext()\n{\n\t$this->res2 = mysql_fetch_array($this->res);\n\t$status = is_array($this->res2);\n\t\n\treturn ($status);\n}", "private function fetch($result) {\n $lines =& $this->lines;\n\n $lines = array();\n while ($r = sqlsrv_fetch_array($result)) {\n $lines[] = $r;\n }\n \n sqlsrv_free_stmt($result); //frees the memory resource, since we will not need it again travels\n }", "function nextRecord() \n \t{\n \t\t$this->record = @mysql_fetch_array($this->queryId);\n\t\t++$this->row;\n\n\t\t$stat = is_array($this->record);\n \t\tif ( !$stat )\n \t\t{\n \t\t\t@mysql_free_result($this->Query_ID);\n \t\t\t$this->queryId = 0;\n \t\t}\n \t\t\n \t\treturn $stat;\n \t}", "public function fetchArray(){\n $this->debugBacktrace();\n $this->fetchType = \"fetch_array\";\n return $this;\n }", "public function fetch()\n\t{\n\t\treturn $this->data = $this->df->fetchAll();\n\t}", "public function fetchInto(){\n\t\t\t}", "public function fetchRow() : array\n\t{\n\t\treturn $this->handle->fetchRow($this->result);\n\t}", "function fetch() {\n\t\t$this->i++;\n\t\treturn $this->result->fetch_object($this->class_name);\n\t}", "protected function onInputEnd()\n {\n foreach ($this->container[0][\"data\"] as $key => $rows) {\n if (isset($this->container[1][\"data\"][$key])) {\n foreach ($rows as $first) {\n foreach ($this->container[1][\"data\"][$key] as $second) {\n $this->next(array_merge($first, $second));\n }\n }\n unset($this->container[1][\"data\"][$key]);\n }\n unset($this->container[0][\"data\"][$key]);\n }\n }", "public function getLastItem() {}", "public function getLastItem() {}", "function rows($res){\t\n\t\treturn(0);\n\t}", "function nextRecord()\n {\n @ $this->Record = mysql_fetch_array( $this->Query_ID );\n $this->Row += 1;\n $this->Errno = mysql_errno();\n $this->Error = mysql_error();\n $stat = is_array( $this->Record );\n if( !$stat )\n {\n @ mysql_free_result( $this->Query_ID );\n $this->Query_ID = 0;\n }\n return $stat;\n }", "function getNextRecord() { return mysql_fetch_array( $this->recordSet ); }", "public function end() {}", "public function end() {}", "public function end() {}", "public function getRows()\n {\n return $this->last->fetch_array(MYSQLI_ASSOC);\n \n }", "function MoveNext() \r\n\t{\r\n\t\tif (!$this->EOF) {\r\n\t\t\t$this->_currentRow++;\r\n\t\t\tif ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) {\r\n\t\t\t\t$this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);\r\n\t\t\t\r\n\t\t\t\tif (is_array($this->fields)) {\r\n\t\t\t\t\tif (isset($this->_blobArr)) $this->_fixblobs();\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->fields = false;\r\n\t\t\t$this->EOF = true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function FetchRow() {}", "public function lastRow() {\n\t}", "abstract protected function doEnd();", "abstract public function FetchRow();", "function fetchRow ()\n {\n return pg_fetch_array($this->_result);\n }", "public function append_end() {\n\t\t$result = $this->get_response(false, true);\n\t\treturn $this->check_response($result, true);\n\t\t/*if($status){\n\t\t\treturn !empty($this->selected_mailbox['uidnext']) ? $this->selected_mailbox['uidnext'] : true;\n\t\t}*/\n\t}", "public function addEnd()\n {\n self::addExtends();\n $return=(count($this->item)<0)?$object = array():$this->item;\n return $return;\n }", "function fetch_array()\n {\n return mysqli_fetch_array($this->_queryResource);\n }", "function flush(){\n\t\t$this->last_result = array();\n\t\t$this->col_info = null;\n\t\t$this->last_query = null;\n\t}", "function fetchRow() {\r\n if($this->getNumRows() > 0)\r\n return mysql_fetch_array($this->m_Result);\r\n else\r\n return false;\r\n }", "public function last(): mixed\n {\n return array_last($this->data);\n }", "public function fetchData()\r\n {\r\n $this->objectcount = $this->search_obj->getObjectQueryCount($this->extra);\r\n }", "function fetch($type=PDO::FETCH_ASSOC, $ori=PDO::FETCH_ORI_NEXT, $offset=0) {\r\n\r\n // calculate offset\r\n $last = & $this->i;\r\n $target = array( \r\n PDO::FETCH_ORI_NEXT => $last + 1,\r\n PDO::FETCH_ORI_PRIOR => $last,\r\n PDO::FETCH_ORI_REL => $last + $offset,\r\n PDO::FETCH_ORI_FIRST => -1,\r\n PDO::FETCH_ORI_LAST => $this->rowCount() - 1,\r\n PDO::FETCH_ORI_ABS => $offset,\r\n );\r\n $target = $target[$ori];\r\n#print \"seek($last->$target) \";\r\n \r\n // last row? got that covered!\r\n if (isset($this->cache[$target])) {\r\n#print \"seek(==) \";\r\n return $this->rowType($type, $this->cache[$target]);\r\n }\r\n \r\n // moving farther backwards\r\n if ($target < $last) {\r\n#print \"seek(<<) \";\r\n $this->reExecute();\r\n }\r\n \r\n // jump forwards\r\n while ($target > $last + 1) {\r\n#print \"seek(>>) \";\r\n $row = $this->stmt->fetch(PDO::FETCH_ASSOC);\r\n $last++;\r\n if (!$row) {\r\n return pdo_trigger_error(\"PDOStatement_Seekable: scrolling past last row\", E_USER_WARNING) and $row;\r\n }\r\n }\r\n\r\n // actually fetch next row\r\n if ($row = $this->stmt->fetch(PDO::FETCH_ASSOC)) {\r\n#print \"seek(ft) \";\r\n assert($target == ++$last);\r\n // keep last row(s)\r\n if (count($this->cache) > PDO_SEEKABLE) {\r\n $this->cache = array_slice($this->cache, $last, -PDO_SEEKABLE, true);\r\n }\r\n $this->cache[$last] = $row;\r\n }\r\n return $this->rowType($type, $row);\r\n }", "function next_record()\n\t{\n\t\t/* goto next record */\n\t\t$this->m_record = @mysqli_fetch_array($this->m_query_id, MYSQLI_ASSOC|atkconfig(\"mysqlfetchmode\"));\n\t\t$this->m_row++;\n\t\t$this->m_errno = mysqli_errno($this->m_link_id);\n\t\t$this->m_error = mysqli_error($this->m_link_id);\n\n\t\t/* are we there? */\n\t\t$result = is_array($this->m_record);\n\t\tif (!$result && $this->m_auto_free)\n\t\t{\n\t\t\t@mysqli_free_result($this->m_query_id);\n\t\t\t$this->m_query_id = 0;\n\t\t}\n\n\t\t/* return result */\n\t\treturn $result;\n\t}", "function MoveNext()\n\t{\n\t\tif (!$this->EOF) {\n\t\t\t$this->_currentRow++;\n\t\t\tif ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) {\n\t\t\t\t$this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);\n\t\t\t\tif (is_array($this->fields) && $this->fields) {\n\t\t\t\t\tif (isset($this->_blobArr)) $this->_fixblobs();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->fields = false;\n\t\t\t$this->EOF = true;\n\t\t}\n\t\treturn false;\n\t}", "function next() {\n @$this->Record = mysqli_fetch_array($this->result, MYSQLI_ASSOC);\n $this->rs = $this->Record;\n $this->Row += 1;\n $this->Errno = mysqli_errno($this->con);\n $this->Error = mysqli_error($this->con);\n $stat = is_array($this->Record);\n if (!$stat) {\n @mysqli_free_result($this->result);\n $this->result = 0;\n }\n return $stat;\n }", "abstract public function fetch($fetchType = \\PDO::FETCH_ASSOC);", "public function fetchRow();", "final public function fetchEnd()\n {\n //element do widoku\n $this->view->_element = $this;\n //render szablonu\n return $this->view->renderTemplate(static::TEMPLATE_END);\n }", "public function fetchResult();", "function getLastRecord() {\n mysql_data_seek( $this->recordSet, mysql_num_rows($this->recordSet)-1 );\n return mysql_fetch_array( $this->recordSet ); }", "public function fetch_array($result_set){\n return mysql_fetch_array($result_set);\n \n }", "public final function __end() : bool {\n\t\t\treturn false;\n\t\t}", "public function fetch()\n {\n return (array)$this->query();\n }", "public function testFetchArray()\n {\n $this->todo('stub');\n }", "public function end() {\r\n return end($this->collection);\r\n }", "protected function end_bulk_operation(){\n\t\twpcom_vip_end_bulk_operation();\n\t}", "public function fetchAll(){\n try{\n $this->array = $this->resultado->fetchAll();\n } catch (PDOException $e){\n $this->errors[] = 'error: function fetchAll<br/>'.$e->getMessage();\n $this->array = NULL;\n }\n return $this->array;\n }", "function Next()\n {\n $this->row = mysqli_fetch_array($this->rs);\n return !!$this->row;\n }" ]
[ "0.66349405", "0.6604337", "0.6604337", "0.65527856", "0.63944006", "0.62724227", "0.62491304", "0.6205921", "0.6205921", "0.6180916", "0.6096032", "0.5998667", "0.5998667", "0.58930093", "0.5884614", "0.58811307", "0.58796895", "0.58719176", "0.5863313", "0.5844266", "0.5838336", "0.5825383", "0.5814987", "0.5806941", "0.5806042", "0.57923853", "0.5773875", "0.57417005", "0.5738848", "0.5720801", "0.5693794", "0.5691706", "0.5689652", "0.56589806", "0.56589806", "0.56589806", "0.56589806", "0.56589806", "0.56589806", "0.56589806", "0.56589806", "0.56589806", "0.56318074", "0.5619714", "0.55987054", "0.5598254", "0.5578499", "0.5570998", "0.5570998", "0.5570998", "0.5570998", "0.55687886", "0.5559864", "0.55578065", "0.555021", "0.5532263", "0.55292106", "0.5518007", "0.5492591", "0.5490309", "0.5490116", "0.54891205", "0.54885304", "0.54885304", "0.54835737", "0.5480957", "0.54739696", "0.5466093", "0.5466093", "0.5466093", "0.5464213", "0.54460907", "0.54456514", "0.54451305", "0.54280174", "0.542669", "0.54243845", "0.5422014", "0.5421944", "0.54152805", "0.5411596", "0.54110634", "0.5408752", "0.54035795", "0.5402928", "0.5400898", "0.53994745", "0.5398471", "0.5388943", "0.53834474", "0.5382833", "0.53797203", "0.53711075", "0.5359907", "0.53586316", "0.5353406", "0.5349425", "0.53473246", "0.53455627", "0.5340037", "0.533879" ]
0.0
-1
For internal only. DO NOT USE IT.
public function deserialize($param) { if ($param === null) { return; } if (array_key_exists("Name",$param) and $param["Name"] !== null) { $this->Name = $param["Name"]; } if (array_key_exists("Type",$param) and $param["Type"] !== null) { $this->Type = $param["Type"]; } if (array_key_exists("ChoicesValue",$param) and $param["ChoicesValue"] !== null) { $this->ChoicesValue = $param["ChoicesValue"]; } if (array_key_exists("Min",$param) and $param["Min"] !== null) { $this->Min = $param["Min"]; } if (array_key_exists("Max",$param) and $param["Max"] !== null) { $this->Max = $param["Max"]; } if (array_key_exists("IsMultiple",$param) and $param["IsMultiple"] !== null) { $this->IsMultiple = $param["IsMultiple"]; } if (array_key_exists("IsAllowEmpty",$param) and $param["IsAllowEmpty"] !== null) { $this->IsAllowEmpty = $param["IsAllowEmpty"]; } if (array_key_exists("ExtraParameter",$param) and $param["ExtraParameter"] !== null) { $this->ExtraParameter = new RuleExtraParameter(); $this->ExtraParameter->deserialize($param["ExtraParameter"]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function __init__() { }", "private function __() {\n }", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "private function __construct()\t{}", "private function init()\n\t{\n\t\treturn;\n\t}", "final private function __construct() {}", "final private function __construct() {}", "final private function __construct(){\r\r\n\t}", "final private function __construct() {\n\t\t\t}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private function _i() {\n }", "protected function fixSelf() {}", "protected function fixSelf() {}", "protected final function __construct() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function init()\n\t{\n\t\t\n\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct() {\r\n\t\t\r\n\t}", "protected function init() {return;}", "final private function __construct()\n\t{\n\t}", "private function __construct () {}", "final private function __construct()\n {\n }", "private final function __construct() {}", "public function __init(){}", "public function helper()\n\t{\n\t\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct()\n\t{\n\t\t\n\t}" ]
[ "0.6265887", "0.6151413", "0.5989358", "0.5989358", "0.5989358", "0.5989358", "0.598889", "0.598889", "0.598889", "0.598889", "0.598889", "0.598889", "0.59878796", "0.59878796", "0.59487283", "0.593907", "0.5916422", "0.5916422", "0.5870066", "0.586617", "0.5855197", "0.5855197", "0.5855197", "0.5799583", "0.5796577", "0.5796577", "0.57803", "0.5749192", "0.5749192", "0.5749192", "0.5749192", "0.57455325", "0.57410514", "0.5712259", "0.5701517", "0.5693654", "0.5680336", "0.5673325", "0.5668143", "0.56398445", "0.5639335", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5626659", "0.5625863", "0.5623525", "0.5623525", "0.5610192" ]
0.0
-1
Run the database seeds.
public function run() { /** 2018 Curriculum **/ $course = new Course; $course->course_code = 'IntroComp'; $course->description = 'Introduction to Computing'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'ComPro1'; $course->description = 'Computer Programming 1'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'Fil1'; $course->description = 'Sining ng Komunikasyon'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'Math1'; $course->description = 'Mathematics in the Modern World'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'Art1'; $course->description = 'Art Appreciation'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'Philit'; $course->description = 'Literatures of the Philippines'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'Eng1'; $course->description = 'Purposive Communication'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'HumCom'; $course->description = 'Introduction to Human Computer Interaction'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'Fil2'; $course->description = 'Filipino Panitikan'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'ComPro2'; $course->description = 'Computer Programming 2'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'SciTech'; $course->description = 'Science Technology and Society'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'USelf'; $course->description = 'Understanding the Self'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'OS'; $course->description = 'Operating Systems'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'Datstruc'; $course->description = 'Data Structures and Algorithms'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'OOP'; $course->description = 'Object Oriented Programming'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'PlatTech'; $course->description = 'Platform Technologies'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'DiscMath'; $course->description = 'Discrete Mathematics'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'Anmod'; $course->description = 'Analytics Modeling'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'QuanMet'; $course->description = 'Quantitative Methods'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'Rizal'; $course->description = 'Rizal\'s Life and Works'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'InfoMan'; $course->description = 'Information Management'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'Net1'; $course->description = 'Networking 1 (Fundamentals)'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'InTech1'; $course->description = 'Integrative Programming and Technologies 1'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'WebApps'; $course->description = 'Web Applications Development'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'Technop'; $course->description = 'Technopreneur'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'FunDBS'; $course->description = 'Fundamentals of Database Systems'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'AnTech'; $course->description = 'Analytics Techniques and Tools'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'Net2'; $course->description = 'Networking 2 (Routing Protocols)'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'SIA1'; $course->description = 'Systems Integration and Architecture 1'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'Intech2'; $course->description = 'Integrative Programming and Technologies 2'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'FDWDM'; $course->description = 'Fundamentals of Data Warehousing and Data Mining'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'SAD'; $course->description = 'Systems Analysis and Design'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'FunBus'; $course->description = 'Fundamentals of Business Analytics'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'IAS1'; $course->description = 'Information Assurance and Security'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'Ethics'; $course->description = 'Ethics'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'ADET'; $course->description = 'Application Development and Emerging Technologies'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'EnDaMa'; $course->description = 'Enterprise Data Management'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'PhilHis'; $course->description = 'Readings in Philippine History'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'ConWorld'; $course->description = 'The Contemporary World'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'IAS2'; $course->description = 'Information Assurance and Security 2'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'ITProj1'; $course->description = 'Capstone Project and Research 1'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'SAM'; $course->description = 'System Administration and Maintenace 1'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'SocPro'; $course->description = 'Social and Professional Issues'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'ITProj2'; $course->description = 'Capstone Project and Research 2'; $course->units = 3; $course->lab_units = 1; $course->save(); $course = new Course; $course->course_code = 'Prac1'; $course->description = 'Practicum'; $course->units = 3; $course->lab_units = null; $course->save(); $course = new Course; $course->course_code = 'SIA2'; $course->description = 'Systems Integration and Architecture 2'; $course->units = 3; $course->lab_units = 1; $course->save(); }
{ "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
Get the building associated with the appliance.
public function building() { return $this->belongsTo('App\Building', 'building_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBuilding()\n {\n return $this->building;\n }", "public function getBuilding()\n {\n return $this->building;\n }", "public function currentBuilding()\n {\n if (! $this->building_id) {\n return null;\n }\n\n return $this->building->applyModifiers([\n 'level' => $this->level,\n 'defense_bonus' => $this->planet->defense_bonus,\n 'construction_time_bonus' => $this->planet->construction_time_bonus,\n 'construction_cost_penalty' => $this->planet->user->penalty_rate,\n ]);\n }", "public function getCbuilding()\n {\n return $this->cbuilding;\n }", "function getBuildingInfo() {\n return getOne(\"SELECT * FROM building WHERE id = ?\",[getLogin()['bid']]);\n}", "public function getBuildingtype()\n {\n return $this->buildingtype;\n }", "public function building()\n {\n return $this->belongsToOne('App\\Building');\n }", "public function getIdBuilding(){\n return $this->idBuilding;\n }", "public static function getBuildingById($id)\n {\n\t\t$key = '1BuildingById_' . $id;\n\t\t$cache = Hapyfish_Cache_Memcached::getInstance();\n\t\t$building= $cache->get($key);\n\t\tif ($building === false) {\n\t\t\t//load from database\n\t\t\t$db = Hapyfish_Island_Dal_Building::getDefaultInstance();\n\t\t\t$building = $db->getBuildingById($id);\n\t\t\tif ($building) {\n\t\t\t\t$cache->add($key, $building, Hapyfish_Cache_Memcached::LIFE_TIME_ONE_MONTH);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $building;\n }", "public function getBuildingContainer()\r\n {\r\n return $this->buildingContainer;\r\n }", "public function get_builder_id()\n {\n return $this->builder_id;\n }", "public function getCRRALibrary()\n {\n return $this->fields['building'][0];\n }", "public function getBuilder() {\n if (!isset($this->builder)) {\n if (empty($this->configuration['builder'])) {\n $this->builder = $this->builderManager->createInstance('standard', []);\n }\n else {\n $this->builder = $this->builderManager->createInstance($this->configuration['builder'], []);\n }\n }\n return $this->builder;\n }", "public function getBuildingName() :string\n {\n return $this->buildingName;\n }", "public function getBuildingNumber() :string\n {\n return $this->buildingNumber;\n }", "protected function getBuilder()\n {\n return $this->builder;\n }", "function Buildings_get() {\n\n $model = M('Buildings');\n if ($id = $this->_get('id')) {\n $data = $model->find($id);\n if ($data) {\n $this->response($data);\n } else {\n //NOT FOUND\n $this->response(NULL, NULL, 404);\n }\n }\n else if($name=$this->_get('name')){\n $data = $model->where(array(\"name\"=>$name))->select();\n if($data){\n $this->response($data);\n }else{\n $this->response(NULL,NULL,404);\n }\n }\n else {\n $data = $model->select();\n $this->response($data);\n }\n }", "public function building()\n\t{ \n\t\treturn $this->belongsTo(HafizBuilding::class);\n\t}", "public function parent()\n {\n return $this->building();\n }", "public static function get_build()\n {\n }", "public function getBuilder()\n {\n return $this->_builder;\n }", "public function getMostRecentBuild()\n {\n return $this->builds[0];\n }", "public static function getShopBuildingList()\n {\n\t\t$key = 'BuildingList';\n\t\t$cache = Hapyfish_Cache_Memcached::getInstance();\n\t\t$list = $cache->get($key);\n\t\tif ($list === false) {\n\t\t\t//load from database\n\t\t\t$db = Hapyfish_Island_Dal_Shop::getDefaultInstance();\n\t\t\t$list = $db->getBuildingList();\n\t\t\tif ($list) {\n\t\t\t\t$cache->add($key, $list, Hapyfish_Cache_Memcached::LIFE_TIME_ONE_MONTH);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $list;\n }", "public function getBuilder()\n {\n return $this->builder;\n }", "public function getBuilder()\n {\n return $this->builder;\n }", "static public function GetKoeBuild() {\n if (isset(self::$koeBuild))\n return self::$koeBuild;\n else\n return self::UNKNOWN;\n }", "public function getAppliancespec()\n {\n return $this->appliancespec;\n }", "public function getBuildingname(): ?string\n {\n return $this->Buildingname ?? null;\n }", "public function builder()\n {\n return $this->builder;\n }", "public function getBuildingIdUri()\r\n {\r\n return intval( self::getURI( self::URI_BUILDING ) );\r\n }", "public function getNewDeployableAppliance()\n {\n return $this->new_deployable_appliance;\n }", "public function getAllBuildings() {\n\t\t$query = $this->db->select('\n\t\t\tBuildingName,\n\t\t\tBuildingAbbr\n\t\t')->\n\t\tfrom('Building')\n\t\t->get();\n\n\t\treturn $query->result_array();\n\t}", "public function getBusinessUnit()\n {\n return $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit;\n }", "public function getBuildAt($offset)\n {\n return $this->get(self::BUILD, $offset);\n }", "public function fetch()\n {\n return response()->json(Building::getAllBuildings());\n }", "public function upgradeBuilding()\n {\n $building = $this->currentBuilding();\n\n if (! $building->hasLowerLevel()) {\n return null;\n }\n\n return $building->replicate()->applyModifiers([\n 'level' => $this->level + 1,\n 'defense_bonus' => $this->planet->defense_bonus,\n 'construction_time_bonus' => $this->planet->construction_time_bonus,\n 'construction_cost_penalty' => $this->planet->user->penalty_rate,\n ]);\n }", "public function show()\n {\n //\n $building = building::get();\n return view::make('building.List', compact('building'));\n }", "public static function buildingNumber() {\n\t\treturn static::toUpper(static::bothify(static::randomElement(static::$buildingNumber)));\n\t}", "public function get(mixed $key): ?BuilderInterface;", "function getBuildingList() {\n return getAll(\"SELECT * FROM building\");\n}", "public function getBuilderConfig()\n {\n return $this->builder_config;\n }", "public function getApp() {\n return $this->call->getApp();\n }", "public function getBuilds()\n {\n return $this->builds;\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function get()\r\n {\r\n return $this->build();\r\n }", "public static function current(): Business\n {\n $slug = request()->segment(1);\n\n // If this is an API route, get the second segment instead\n if ($slug === 'api') {\n $slug = request()->segment(2);\n }\n\n return self::fromSlug($slug);\n }", "public function build()\n {\n $result = $this->isValidForBuild()\n ? $this->performBuild()\n : null;\n $this->resetState();\n\n return $result;\n }", "public function getWing()\n {\n return $this->hasOne(Wings::className(), ['wing_id' => 'wing_id']);\n }", "public function getBuildingsWithBudgets()\n {\n $buildings_budgets = $this->find('all', [\n 'contain' => ['Budgets' =>\n function ($q) {\n return $q\n ->select(['id', 'building_id']);\n }],\n 'conditions' => ['Buildings.softland_id IS NOT NULL', 'Buildings.omit' => false]\n ]);\n $buildingsWithBudget = array();\n foreach ($buildings_budgets as $buildings_budget) {\n if (!empty($buildings_budget['budget'])) {\n $buildingsWithBudget[$buildings_budget['softland_id']]['budget_id'] = $buildings_budget['budget']['id'];\n $buildingsWithBudget[$buildings_budget['softland_id']]['active'] = $buildings_budget['active'];\n }\n }\n return $buildingsWithBudget;\n }", "public function db_builder() {\n\t\treturn $this->_db_builder;\n\t}", "public function getBerry(): Berry\n {\n return $this->berry;\n }", "public function getBuilder();", "public function show(Building $building)\n {\n return view('building.show')->with([\n 'building' => $building\n ]);\n }", "public function findBuildingDetails($id){\n\t\t$details = array();\n\t\t\n\t\t$details['building'] = $this->db->q(\"select building.name as building_name, user.name as user_name, user.id as user_id, building.id as building_id, building.*, user.* from Building building join User user on building.fk_user = user.id where building.id = \".$id);\n\t\t$details['comments'] = $this->db->q(\"select comment.*, user.name as user_name, user.id as user_id from Comment comment join User user on comment.fk_user = user.id where fk_building = \".$id.\" order by id desc\");\n\t\t$details['ratings'] = $this->db->q(\"select rating.* from Rating rating where fk_building = \". $id);\n\t\t$details['media'] = $this->db->q(\"select media.* from Media media where fk_building = \". $id);\n\t\t\n\t\treturn $details;\n\t\t\n\t}", "public function getRoom()\n {\n return $this->room;\n }", "public function getBuildings(){\n $buildings = Edificiosauditorios::getAll();\n //$auditorio = Auditorios::getID_AUDIENCE($inuId);\n if (!empty($buildings) || is_array($buildings)) {\n print json_encode($buildings);\n \n } else {\n print json_encode($buildings->toArray());\n }\n }", "function getOpenGame() {\n\t$games = getGames();\n\tif (isset($games['open']) and $games[$games['open']]['state'] == 'open') {\n\t\treturn $games['open'];\n\t} else {\n\t\treturn newGame();\n\t}\n}", "private function doBuildingCommand()\r\n {\r\n $buildingId = $this->getBuildingIdUri();\r\n if ( !$buildingId )\r\n throw new BadrequestException( \"Building id is not given\" );\r\n\r\n $this->getBuildingContainer()->setBuilding( $this->getDaoContainer()->getBuildingDao()->get( $buildingId ) );\r\n if ( !$this->getBuildingContainer()->getBuilding() )\r\n throw new BadrequestException( sprintf( \"Building \\\"%d\\\" does not exist\", $buildingId ) );\r\n\r\n $floorIds = $this->getFloorIdsUri();\r\n $this->getBuildingContainer()->setFloors(\r\n $floorIds ? $this->getDaoContainer()->getFloorBuildingDao()->getList( $floorIds ) : $this->getDaoContainer()->getFloorBuildingDao()->getMainFloors(\r\n array ( $this->getBuildingContainer()->getBuilding()->getId() ) ) );\r\n\r\n foreach ( $this->getTypesUri() as $type )\r\n {\r\n switch ( $type )\r\n {\r\n case self::TYPE_ELEMENTS :\r\n $this->getBuildingContainer()->setElements(\r\n $this->getDaoContainer()->getElementBuildingDao()->getForeign(\r\n $this->getBuildingContainer()->getFloors()->getIds() ) );\r\n break;\r\n case self::TYPE_NAVIGATIONS :\r\n $this->getBuildingContainer()->setNavigations(\r\n $this->getDaoContainer()->getNodeNavigationBuildingDao()->getForeign(\r\n $this->getBuildingContainer()->getFloors()->getIds() ) );\r\n break;\r\n }\r\n }\r\n }", "public function getActiveBuildingsWithSoftlandInfo()\n {\n $this->SfBuildings = TableRegistry::get('SfBuildings');\n $buildings = $this->find('all')\n ->where(['Buildings.softland_id IS NOT NULL', 'Buildings.omit' => false])\n ->join([\n 'table' => 'budgets',\n 'alias' => 'Budgets',\n 'conditions' => ['Budgets.building_id = Buildings.id']\n ])\n ->group(['Buildings.id']);\n $buildingsWithSoftlandInfo = array();\n foreach ($buildings as $building) {\n $sf_building = $this->SfBuildings->find('all', [\n 'conditions' => ['SfBuildings.CodArn' => $building['softland_id']]\n ])->first();\n $buildingsWithSoftlandInfo[$building['id']] = $sf_building['CodArn'] . ' - ' . $sf_building['DesArn'];\n }\n return $buildingsWithSoftlandInfo;\n }", "public function get_room_at($resource_index){\n return $this->open_rooms[$resource_index];\n }", "function Build_get($build_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('Build.get', array(new xmlrpcval($build_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function getHotel()\n {\n return $this->hotel;\n }", "public function get_jamf_buildings()\n {\n $obj = new View();\n $jamf = new Jamf_model;\n $obj->view('json', array('msg' => $jamf->get_jamf_buildings()));\n }", "public function getWorship()\n {\n return $this->get(self::_WORSHIP);\n }", "public function getApplication() {\n\t\t$instance = $this->getSourceInstance();\n\t\tif ($instance !== null) {\n\t\t\t$application = $instance->unbox()->application;\n\t\t\tif ($application !== null) {\n\t\t\t\treturn $application;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function getScheduleBuilder()\n\t\t{\n\t\t\tif ($this->schedule_builder === NULL)\n\t\t\t{\n\t\t\t\t$schedule = $this->getSchedule();\n\n\t\t\t\t$fund_type = NULL;\n\t\t\t\tif($fund_tx = $schedule->Analyzer->getFund())\n\t\t\t\t{\n\t\t\t\t\t$fund_type = $fund_tx->getType();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t/** @TODO get the fund type for this app based on loan_type or whatever */\n\t\t\t\t\t$fund_type = NULL;\n\t\t\t\t}\n\n\t\t\t\t/** @TODO instantiate the correct interest calculator and schedule builder based on loan_type or whatever */\n\t\t\t\t$int_calc = $this->getInterestCalculator();\t\n\t\t\t\t$this->schedule_builder = new ECash_Scheduling_ScheduleBuilder();\n\t\t\t\t$this->schedule_builder->setInterestCalculator($int_calc);\n\t\t\t\t$this->schedule_builder->setSchedule($schedule);\n\t\t\t\t$this->schedule_builder->setFundType($fund_type);\n\t\t\t\t$this->schedule_builder->setFundAmount($this->Model->fund_actual);\n\t\t\t\t$this->schedule_builder->setFundDate($this->Model->date_fund_actual);\n\t\t\t\t$this->schedule_builder->setFirstPaymentDate($this->Model->date_first_payment);\n\t\t\t\t$this->schedule_builder->setPayDateCalculator($this->PayDateCalculator);\n\t\t\t}\n\n\t\t\treturn $this->schedule_builder;\t\t\t\n\t\t}", "public function getGame(): Game\n {\n return $this->client->getGame($this->gameVersion->getGameId());\n }", "public function builder()\n {\n if ($this->parent) {\n return $this->parent->builder();\n }\n\n if (is_null($this->builder)) {\n $this->builder = new Builder($this);\n }\n\n return $this->builder;\n }", "public function getWidget()\n {\n return $this->hasOne(Widgets::className(), ['id' => 'widgetId']);\n }", "public function getRoutingTool(){\n $resourceDefinition = (new ResourceDefinition())->newQueryWithoutScopes()->where('_id','=',$this->id_resourceDefinition['$id'])->first();\n $routingTool = $resourceDefinition->routingTool;\n\n return $routingTool;\n }", "public function getJob()\n\t{\n\t\treturn $this->compose('Job', 'Jobs');\n\t}", "public final function getBuild()\n {\n /**\n * DO NOT FORGET !!! to update GEMS__PATCH_LEVELS:\n *\n * For new installations the initial patch level should\n * be THIS LEVEL plus one.\n *\n * This means that future patches for will be loaded,\n * but that previous patches are ignored.\n */\n return 59;\n }", "function jet_woo_builder_compatibility() {\n\treturn Jet_Woo_Builder_Compatibility::get_instance();\n}", "public static function building(){\n return [\n 'name' => 'nullable|string|max:255|unique:buildings',\n 'number' => 'required|string|max:10|unique:buildings',\n 'number_of_offices' => 'required|integer',\n 'description' => 'nullable|string',\n ];\n }", "public function lobby()\n {\n return $this->lobbies->first();\n }", "private function _convertOfficialBuildingIdToInternalId($buildingId): int {\n switch($buildingId) {\n case 116: // Tech center\n $building = 0;\n break;\n case 65: // Museum\n $building = 1;\n break;\n case 62: // Casino\n $building = 2;\n break;\n case 97: // Training camp\n $building = 3;\n break;\n case 86: // Mafia HQ\n $building = 4;\n break;\n case 59: // Recycling plant\n $building = 5;\n break;\n case 71: // Hospital\n $building = 6;\n break;\n case 72: // Law firm\n $building = 7;\n break;\n case 121: // Service center\n $building = 8;\n break;\n case 123: // Haulage firm\n $building = 9;\n break;\n case 119: // Drone research\n $building = 10;\n break;\n case 122: // HR Department\n $building = 11;\n break;\n case 127: // Seismology center\n $building = 13;\n break;\n case 126: // Fire Station\n $building = 12;\n break;\n }\n\n return $building;\n }", "public function setBuilding($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->building !== $v) {\n $this->building = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_BUILDING] = true;\n }\n\n return $this;\n }", "public function getHotelAd()\n {\n return $this->readOneof(15);\n }", "function hook_get_builder($hook, $arg) {\n return hook_get_builder_factory($hook, $arg)->getInstance();\n}", "protected function getChariot()\n {\n if (is_null($this->chariot)) {\n return $this->chariot = (new Chariot($this->app));\n }\n\n return $this->chariot;\n }", "public function getSelectedBuild($data) {\n\t\tif (isset($data['SelectRelease']) && !empty($data[$data['SelectRelease']])) {\n\t\t\t// Filter out the tag/branch name if required\n\t\t\t$array = explode('-', $data[$data['SelectRelease']]);\n\t\t\treturn reset($array);\n\t\t}\n\t\tif (isset($data['FilteredCommits']) && !empty($data['FilteredCommits'])) {\n\t\t\treturn $data['FilteredCommits'];\n\t\t}\n\t}", "function getApp($setting) {\n\t\tif (!empty($setting) && !empty($this->_app[$setting]))\n\t\t\treturn $this->_app[$setting];\n\t\telse\n\t\t\treturn null;\n\t}", "public function getProduct()\n {\n return $this->product instanceof ProductReferenceBuilder ? $this->product->build() : $this->product;\n }", "public function build(): RetrieveBusinessBookingProfileResponse\n {\n return CoreHelper::clone($this->instance);\n }", "public function latestApp()\n {\n return $this->availableApps()\n ->orderByDesc('version_code')\n ->first();\n }", "public function getShop()\n {\n return $this->get(self::_SHOP);\n }", "public function getShop()\n {\n return $this->get(self::_SHOP);\n }", "public function getShop()\n {\n return $this->get(self::_SHOP);\n }", "public function generateBuild() {\n\t\tif (!$this->map || !count($this->championPool)) {\n\t\t\tthrow new GeneratorException('Missing state in the generator');\n\t\t}\n\n\t\t$build = new Build();\n\t\t$build->map = $this->map;\n\n\t\t$this->chooseChampion($build);\n\t\t$this->chooseSummoners($build);\n\t\t$this->chooseItems($build);\n\t\t$build->name = mt_rand(0, $this->config->get('generator.build_name_max'));\n\t\t$build->code = $this->generateBuildCode($build);\n\n\t\treturn $build;\n\t}", "public function get()\n {\n return $this->collection->get('bonsai', null);\n }", "public function get_compartment(){\n $this->compartment = array_shift(Compartment::find_all(\" WHERE dead_no = '{$this->id}' LIMIT 1\"));\n if ($this->compartment) {\n return $this->compartment->description;\n } else {\n return \"Not specified\";\n }\n }", "public function getFloor() {\n $sql = \"SELECT * FROM `SM_FLOOR` WHERE sm_idBuilding = '$this->idBuilding' AND sm_idFloor = '$this->idFloor'\";\n if (!($resultado = $this->mysqli->query($sql))) {\n return 'Error in the query on the database';\n } else {\n $result = $resultado->fetch_array();\n return $result;\n }\n }", "public function show($id)\n\t{\n return View::make('buildings.show');\n\t}", "public function get()\n {\n return $this->app;\n }", "public function get()\n {\n return $this->app;\n }", "public function getApp()\n\t{\n\t\tif(! self::$_app){\n\t\t if ($this->scopes) $this->config['oauth']['scopes'] = $this->scopes;\n\t\t\tself::$_app = Factory::officialAccount($this->config);\n\t\t}\n\t\treturn self::$_app;\n\t}", "public function getHotelRef()\n {\n return $this->hotelRef;\n }", "function getApplication() {\n return $this->step->application;\n }", "public function builder()\n {\n return null;\n }" ]
[ "0.76651776", "0.76651776", "0.6559151", "0.64373726", "0.638137", "0.63334006", "0.62703216", "0.6190588", "0.6187779", "0.610897", "0.604471", "0.600601", "0.5941149", "0.58589023", "0.5599215", "0.5525471", "0.55125815", "0.5492519", "0.5456593", "0.54529834", "0.5450822", "0.5434465", "0.54277384", "0.5426216", "0.5426216", "0.53781784", "0.5372809", "0.53637135", "0.53377193", "0.53022414", "0.5265541", "0.5258708", "0.5242969", "0.52401483", "0.5195037", "0.51905614", "0.5086002", "0.5084044", "0.5069581", "0.50232726", "0.49291217", "0.49226564", "0.4917247", "0.49114934", "0.49106765", "0.49065864", "0.48875144", "0.48874867", "0.48646337", "0.48645177", "0.48566025", "0.48517323", "0.48495942", "0.48433086", "0.48310813", "0.4824996", "0.4824175", "0.4823135", "0.4818941", "0.48146555", "0.4797827", "0.47781807", "0.4768384", "0.47635007", "0.47599438", "0.47510386", "0.47488788", "0.47475266", "0.47376338", "0.4733927", "0.47309616", "0.47097751", "0.47095478", "0.47049367", "0.46967888", "0.46900475", "0.46875864", "0.4681277", "0.46795386", "0.46749493", "0.4673081", "0.46693668", "0.46618867", "0.466025", "0.46596542", "0.46543992", "0.4650604", "0.4650604", "0.4650487", "0.46402898", "0.46268398", "0.46266752", "0.4620226", "0.46118665", "0.46084407", "0.46084407", "0.46002507", "0.45998827", "0.45931053", "0.45736247" ]
0.58778507
13
$this>printLine("Welcome to MATA installation.");
public function actionInstall() { // $response = $this->prompt("Would you like to install MATA? (yes|no)"); // if ($response != "yes") // $this->emptyLine()->printLine("Terminating. Have a nice day!")->emptyLine(); $dbName = "yii-app-mata-template"; $host = "83.170.88.249"; $username = "yiimataapptempla"; $password = "CHcxjvLs"; do { // $host = $this->prompt("Host (IP address or URL): "); // $dbName = $this->prompt("Database Name: "); // $username = $this->prompt("Username: "); // $password = $this->prompt("Password: "); echo "Testing connection: "; } while ($this->checkDbCredentials($host, $dbName, $username, $password) == false); $this->printLine(" OK")->printLine("Saving database settings to config file (mataDb component)"); if ($this->saveDbSettingsToConfigFile($host, $dbName, $username, $password) === false) { $this->printLine("Could not save config file"); exit; } $this->printLine("Configuration written to dev.php file"); $this->printLine("Launching migrations tool")->emptyLine()->emptyLine(); $this->runMigration(); $this->emptyLine()->emptyLine()->printLine("Thank you for installing Mata.")->printLine("You can now access it using this URL: "); $this->emptyLine(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function welcome()\n{\n outputString(PHP_EOL.'To set up your Craft install, from your project directory, run:', Console::FG_YELLOW);\n $script = './craft setup';\n outputString(PHP_EOL.' '.$script, Console::FG_GREEN);\n outputString(PHP_EOL.'Then to set up custom settings, run:', Console::FG_YELLOW);\n $script = './marlo';\n outputString(PHP_EOL.' '.$script, Console::FG_GREEN);\n outputString(PHP_EOL.'Your setup is not complete until you run these two commands.', Console::FG_YELLOW);\n}", "public function welcomInformations() {\n echo \"\\t\\t####################################\\t\\t\\n\";\n echo \"\\t\\t#\\n\";\n echo \"\\t\\t# \" . Utils::red(\"This is a Enterprise Backup Tool!\") . \"\\n\";\n echo \"\\t\\t#\\n\";\n echo \"\\t\\t####################################\\t\\t\\n\\n\";\n }", "public function welcomeMessage()\n {\n $this->info('');\n $this->info('Welcome to Nigels Coffee Shop Robot Controller Simulator!');\n }", "protected function _welcome()\n {\n $this->out('\n __ ____ _ _______ __\n / |/ (_)_________(_)___ ____ _ / ____(_) /__ _____\n / /|_/ / / ___/ ___/ / __ \\/ __ `/ / /_ / / / _ \\/ ___/\n / / / / (__ |__ ) / / / / /_/ / / __/ / / / __(__ )\n/_/ /_/_/____/____/_/_/ /_/\\__, / /_/ /_/_/\\___/____/\n /____/ ');\n }", "static function welcome()\n\t{\n\t\techo 'wellcome to our project';\n\t}", "function METHOD_hello()\n {\n $this->sendTerminal('This is a Hello World :)');\n\n }", "protected function welcome()\n\t{\n\t\t$welcome = ' __ __ _ ' . PHP_EOL;\n\t\t$welcome .= ' | \\/ | __ _| | _____ ' . PHP_EOL;\n\t\t$welcome .= ' | |\\/| |/ _` | |/ / _ \\ ' . PHP_EOL;\n\t\t$welcome .= ' | | | | (_| | < (_) |' . PHP_EOL;\n\t\t$welcome .= ' |_| |_|\\__,_|_|\\_\\___/ (' . MAKO_VERSION . ')' . PHP_EOL;\n\n\t\t$welcome .= PHP_EOL . PHP_EOL;\n\n\t\t$welcome .= 'Welcome to the ' . $this->cli->color('Mako', 'green') . ' interactive console!' . PHP_EOL;\n\n\t\t$welcome .= PHP_EOL;\n\n\t\t$welcome .= 'Type ' . $this->cli->color('exit', 'yellow') . ' or ' . $this->cli->color('quit', 'yellow') . ' to exit.' . PHP_EOL;\n\n\t\t$this->cli->stdout($welcome);\n\t}", "public static function welcomeMessage() : void\n {\n if (!file_exists(__DIR__ . '/../../.env.php')) {\n echo \"Heya, we think you are new. Let us spin up the frame work for you!..\";\n $request = self::requestInput('Do you want to continue?', ['(Y)es', '(N)o']);\n if ($request == 'yes' || $request == 'y') {\n $start = new \\Framework\\Commands\\Start\\Start;\n $start->start();\n exit();\n }\n echo \"=====================================\\n\";\n }\n echo \"Welcome to the command environment. Choose what you want to do, you have the following options: \\n\";\n foreach (self::$options as $option) {\n echo \"- $option \\n\";\n }\n }", "public function howtoEat()\n {\n return \"Chicken could be fried!<br>\";\n }", "public function printApplicationInstructions()\n {\n $this->output->writeln('php [file] [command] [arguments] [options]');\n\n // Padding\n $this->output->writeln('');\n }", "function notice_installation()\n\t{\n\t\tSession::notice(_t(\"You have addons ready for installation.\", __CLASS__) . \" <a href='\" . URL::get( 'admin', array(\"page\" => \"plugins\")) . \"#for_installation'>\" . _t(\"Go to list\", __CLASS__) . \"</a>\", 'addons_installnotice');\n\t}", "public function sayHello(){\n return \"Hello World!\"; // baru mengembalikan nilai\n }", "function customerMenu()\r\n{\r\n echo \"\\n================ CUSTOMER MENU ==================\\n\";\r\n echo \"1.check loans\\n2.apply loan\\n3.pay loan\\n4.get details\\n5.EMI calculator\\n6.pay installment\";\r\n}", "function my_menu_output(){\n\techo '<h1>The Hello Yoda Plugin by Alan</h1>\n\t<p>\"Pass on what you have learned.\" --Yoda </p>';\n}", "final function whatIsGood() {\n echo \"Running is good <br>\";\n }", "public function sendWelcomeMsg()\n\t{\n\t}", "function makePasta(){\r\n echo \"The Italian Chef made some pasta. <br>\";\r\n }", "function jbInstall($step){\n\t}", "public static function print_banner() {\n\t\tprint $GLOBALS['i18n']['framework']['cli_banner'] . \"\\n\";\n\t}", "private function salutation(): void\n {\n $this->io->title(sprintf(\"CodeGen - A Universal Code Generator\\nby Niels Braczek (C)2004-%s. All rights reserved.\", date('Y')));\n\n $this->io->writeln([\n \"Project: {$this->project}\",\n \"Template: {$this->template}\",\n \"Output: {$this->output}\",\n ], OutputInterface::VERBOSITY_DEBUG);\n }", "final function what_is_good() {\n\t\t\techo \"Running is Good </br>\";\n\t\t}", "public function activate()\n\t{\n\t\techo \"fight...\\n\";\n\t}", "function apa_kabar() {\n return \"Apa kabar dunia?\"; //tidak menampilkan apapun\n}", "function printHelloMessage(){\n echo 'Hello! Welcome again!';\n}", "public function text()\n\t{\n\t\techo \"Hello there! I'm just an <code>echo</code> statement in a method...\";\n\t}", "public function turnOn(){\n\t\treturn \"Turn On executed\";\n\t}", "public static function welcome() {\n\t}", "public function laporan()\n {\n echo \"OK\";\n }", "function WrightText() {\n echo \"Hello world!\".\"<br>\";\n}", "protected function say($message = '')\n {\n $this->output->writeln($message);\n }", "public function showupAction()\n {\n $this->line('Hi !');\n $name = $this->prompt('I\\'m quark ! And you, who you are ?');\n\n $this->line('Nice to meet you ' . $name);\n\n if ($this->confirm('Are you humain ?', true)) {\n $this->info('Yes you are !');\n\n switch ($this->choices('You are a male, a female, or just human ?', ['male', 'female', 'human'], 'human')) {\n case 'male':\n case 'female':\n $this->line('Ok');\n break;\n case 'human':\n $this->line('Ok, i like your thinking way :)');\n break;\n }\n } else {\n $this->info('Hey ! you like me');\n }\n\n $this->line('');\n $this->line('Well, by ' . $name);\n }", "function print_home() {\n\techo '\n\t<p class=\"alert alert-info\">\n\t\tWelcome <b>'.$_SESSION['username']. '</b> you can\n\t\t<a href=\"play_trivia.php\">play trivia</a> or <a href=\"insert_question.php\">insert questions</a>. \n\t\tUse the main menu above to select additional options or to logout.\n\t</p>\n\t';\t\n}", "function say_hello() {\n return \"Hello World\";\n }", "public function say() {\r\n echo 'say something';\r\n }", "function print_learner_cta(){\r\n\techo '<div class=\"cta-learner\"><p>Have a student account?</p>\r\n\t\t<div><a class=\"btn btn-lg\" href=\"http://speakagent.github.io\">Play Now! <i class=\"fa fa-caret-right\"></i></a></div></div>';\r\n}", "public function usage()\n\t{\n\t\treturn 'For usage visit: http://www.devdemon.com/';\n\t}", "function chyba_prepinace(){\n fprintf(STDERR, \"Chybne zadane prepinace. Pre napovedu pouzite prepinac --help.\\n\");\n exit(1);\n}", "public function Say()\n\t{\n\t\treturn 'X em models';\n\t}", "public function help()\n\t{\n\t\t// You could include a file and return it here.\n\t\treturn \"<h4>Overview</h4>\n\t\t<p>The Inventory module will work like magic. The End!</p>\";\n\t}", "function greeting(){\n\t\t\techo \"Idol ni Noli si Pong\";\n\t\t}", "public function license_success_message() {\n\t\t$message = __( 'Your Block Lab license was successfully activated!', 'block-lab' );\n\t\treturn sprintf( '<div class=\"notice notice-success\"><p>%s</p></div>', esc_html( $message ) );\n\t}", "function head() {\n\n\techo '<h1>ATOM.CMS</h1>';\n\t\n}", "public function printHelp();", "function local_course_completion_status_before_footer() {\n //echo \"Hello!\";\n //\\core\\notification::add('Success!',\\core\\output\\notification::NOTIFY_SUCCESS);\n}", "public function test() {\n\t\tWP_CLI::line('Test.');\n\t}", "public function actionIndex()\n {\n $this->stdout(\"\\n Example Module Base Command: \" . date('d.m.y h:i:s') . \" Done!\\n\");\n }", "function anzeigen(){\n\techo '\n\t\t<b>Installation:</b><br>\n\t\tDie <a href=\"http://www.kis-fiktiv.bplaced.net/quellcode.zip\">Quellcodedateien</a> werden auf einen PHP- und datenbankfähigen Server kopiert, z.B. auf \n\t\t<a href=\"http://www.bplaced.net/\">http://www.bplaced.net/</a>. Die Datenbank wird erstellt indem die Datei gen.php\n\t\tauf dem Server ausgeführt wird. Dazu muss der Hostname, Benutzername, Passwort, Name der eigenen Datenbank vorher in \n\t\tdie Datei config.php eingetragen werden.<br><br>\n\t\t\n\t\t<b>Rollen und Rechtesystem:</b><br>\n\t\tDer Benutzer kann sich unter 3 verschiedenen Rollen in das System einwählen. Chefarzt, Arzthelfer, Admin.\n\t\tJe nach Rolle hat er dann ein Lese- und / oder Schreibrecht für das Formular.<br><br>\n\n\t\t<b>Funktionalität:</b><br>\n\t\tEin Patient wird ausgewählt, dann wird auf \"weiter\" geklickt. Es wird ein leeres Formular erstellt, falls noch kein Formular \t\t\tgespeichert ist. Andernfalls wird das Formular des Patienten angezeigt. Das Formular kann dann geändert oder gelöscht \t\t\t\twerden.<br><br>\n\n\t\t<b>Plausibilität der Eingaben:</b><br>\n\t\tBei Einigen Feldern im Formular ist die Eingabe nur mit bestimmten Datentypen und Werten möglich:<br>\n\t\t<div id=\"tab\">\n\t\t- Der PSA-Wert muss kleiner als 3,2 sein <br>\n\t\t- IPSS liegt zwischen 0 und 35 <br>\n\t\t- 1. und 2. Gleasonfeld muss Werte zwischen 1 und 5 haben <br><br>\n\t\t</div>\n\t\t<b>Tabellen der Datenbank:</b><br>\n\t\t<div id=\"tab\">\n\t\t\t- Formular<br>\n\t\t\t- Patient<br>\n\t\t\t- Rollen<br>\n\t\t\t- Users<br><br>\n\t\t</div>\n\t\t</div>';\t\t\n\t}", "function adminMenu()\r\n{\r\n echo \"=============== ADMIN MENU ================\\n\";\r\n echo \"1.ADD LOAN\\n2.ADD CUSTOMER\\n3.check loans\\n4.get customer details\\n\";\r\n}", "public function about_contributor()\r\n\t{\r\n\t\t?>&clubs; \"About Contributor\" Module<?\r\n\t}", "function install()\n {\n }", "function mediawikiinstall($o){\n\t\n\t\t//$o->extract(\"confirmaccount\", \"extensions/\");\n\t\t$o->sr(\"LocalSettings.php\", \"#Add\\s*more\\s*configuration\\s*options\\s*below.#\", \"End of automatically generated settings. \\n\\n \\$wgGroupPermissions['*']['edit'] = false; \\n\\n \\$wgGroupPermissions['*']['createpage'] = false; \\n\\n \\$wgEmailConfirmToEdit = true;\");\n\t}", "function printUsage()\n{\n\techo \"yourCMDB Exporter\\n\";\n\techo \"Usage: exporter.php <export taskname>\\n\";\n\techo \"<export taskname> is the name of the export task to execute defined in exporter-configuration.xml\\n\\n\";\n}", "public function jdidealScreen(): void\n\t{\n\t\techo 'RO Payments';\n\t}", "protected function welcome() {\n echo \"*****************\" . PHP_EOL .\n \"*** TicTacToe ***\" . PHP_EOL .\n \"*****************\" . PHP_EOL;\n $this->drawBoard(array(), true);\n echo \"[\" . self::QUIT_BUTTON . \"] - End game\" . PHP_EOL . PHP_EOL;\n }", "public function installAction()\r\n\t{\r\n\t try {\r\n \t // run the install command\r\n \t $packageName = $this->_runCommand(\r\n \t $command = Faett_Core_Interfaces_Service::COMMAND_INSTALL\r\n \t );\r\n // attach a message to the session\r\n \t\tMage::getSingleton('adminhtml/session')->addSuccess(\r\n \t\t Mage::helper('adminhtml')->__(\r\n \t\t '201.success.package-install', $packageName\r\n \t\t )\r\n \t\t);\r\n\t } catch(Faett_Manager_Exceptions_InvalidCommandException $ice) {\r\n Mage::getSingleton('adminhtml/session')->addError(\r\n \t\t $ice->getMessage()\r\n \t\t);\r\n\t } catch(Exception $e) {\r\n Mage::getSingleton('adminhtml/session')->addError(\r\n \t\t Mage::helper('manager')->__(\r\n \t\t '900.pear.exception',\r\n \t\t $e->getMessage()\r\n \t\t )\r\n \t\t);\r\n\t }\r\n // redirect to the licence overview\r\n $this->_redirect('*/*/');\r\n\t}", "function help()\n {\n return\n \"\\n -------------------------------------------------------------------------\\n\".\n \" ---- ~ BidVest Data : Assessment Commands ~ -------\\n\".\n \" -------------------------------------------------------------------------\\n\\n\".\n \" All comamnds begin with '\\e[1m\\033[92mphp run.php\\033[0m'\\e[0m\\n\".\n \" Then append of the folling options: \\n\".\n \" -------------------------------------------------------------------------\\n\".\n \"\\n\\n\".\n \" 1. \\e[1m --action=\\033[34madd \\033[0m \\e[0m : \\e[3mThis allows you to add a record.\\e[0m \\n\\n\".\n \" 2. \\e[1m --action=\\033[33medit \\033[0m \\e[1m--id=<vaild_id>\\e[0m \\e[0m : \\e[3mEdit a student record.\\e[0m \\n\\n\".\n \" (leave filed blank to keep previous value)\\n\\n\".\n \" 3. \\e[1m --action=\\033[91mdelete\\033[0m \\e[1m--id=<vaild_id>\\e[0m \\e[0m : \\e[3mDelete a student record (remove file only).\\e[0m \\n\\n\".\n \" 4. \\e[1m --action=\\033[36msearch \\033[0m \\e[0m : \\e[3mSearch for a student record. \\e[0m \\n\\n\".\n \" -------------------------------------------------------------------------\\n\\n\".\n \" Where \\e[1m<valid_id>\\e[0m must be an 8-digit number.\\n\\n\".\n \" -------------------------------------------------------------------------\\n\";\n }", "public function getSucessText(): string{\n return \"\\n\\e[33mCreated new migration \".$this->name.\"\\e[0m\\n\";\n }", "function pm_demo_install() {\t\t\n\t\t//create llog\n\t\t$array = array();\n\t\t//add log to database\n\t\tself::createLog($array);\n }", "public function Locomover()\n {\n echo \"<br>Saltando\";\n }", "function sample_admin_notice__success() {\n ?>\n <div class=\"notice notice-success is-dismissible\">\n <p><?php _e( 'RAR Example Plugin Installed!', 'sample-text-domain' ); ?></p>\n </div>\n <?php\n}", "function speak () {\n $this->println(\"User\"); \n }", "public function demo()\n\t{\n\t\techo \"This is demo\";\n\t}", "function simpleFunction(){\r\n echo 'Hello World'.'<br>';\r\n }", "function test_install(){\n \t}", "public function thankyou_page() {\n MinterStoreExceptions::Log($this->instructions);\n// if ( $this->instructions ) {\n// echo wpautop( wptexturize( $this->instructions ) );\n// }\n }", "public function sayHello(){\n echo \"Woof woof, my name is $this->name.\".PHP_EOL;\n }", "function index(){\n\t\techo 'welcome';\n\t}", "function index()\n\t{\n\t\techo \"Welcome to Language settings\";\n\t}", "public function welcome_import_message() {\n global $OUTPUT;\n\n $a = get_string('tabutemplatepage2', 'mod_surveypro');\n $message = get_string('welcome_utemplateimport', 'mod_surveypro', $a);\n echo $OUTPUT->notification($message, 'notifymessage');\n }", "public function install () {\n\t\t$this->_log_version_number();\n\t}", "public function showMessage()\n {\n print $this->generator->getHappyMessage() . $this->name;\n }", "public function startup()\n\t{\n\t\tparent::startup();\n\t\t$this->instructions = array(\n\t\t\t'message' => null,\n\t\t\t'redirection' => 'Administration:'\n\t\t);\n\t}", "function rootMenu()\r\n{\r\n echo \"\\n========= ROOT MENU ============\\n\";\r\n echo \"1.ADD ADMIN\\n2.UPDATE COMPANY ADDRESS\\n3.UPADTE ABOUT\\n\";\r\n}", "public function helloWorld()\n {\n echo 'Hello World.',\"\\n\";\n }", "function hello_world() {\n\techo '<div class=\"notice notice-info\"><p>Hello world</p></div>';\n}", "function displayStartup()\n\t{\n\t\t$this->tpl->addBlockFile(\"CONTENT\",\"content\",\"tpl.clientsetup.html\", \"setup\");\n\n\t\t$this->tpl->setVariable(\"TXT_INFO\",$this->lng->txt(\"info_text_first_client\"));\n\t\t$this->tpl->setVariable(\"TXT_HEADER\",$this->lng->txt(\"setup_first_client\"));\n\n\t\t$this->displayProcessPanel();\n\n\t\t$this->setButtonNext(\"ini\");\n\t}", "function boostrap_test_function(){\n\n print_r (\"Test sending a2p SMS\". PHP_EOL);\n sleep(2);\n include_once (__DIR__ .'/code-snippets/send-a2p-sms.php');\n}", "function amt_wsc_team_install(){\n}", "public function display()\n {\n return 'I am a mallard duck';\n }", "function ShowSingleSoftware()\n{\n\tglobal $sw_version, $build_crc;\n\t\n\tget_all_packages();\n\tclassify_panic_packages();\n\n\tshow_table_title( \"$sw_version (Build CRC: $build_crc)\" );\n\n\tshow_panic_group();\t\t\n\n\t//show_panic_packages();\t\t\n}", "public static function run()\n {\n app('API')->presets->install(self::$presets);\n\n return 'Installed ' . __CLASS__ . '.';\n }", "function hello (){\n echo 'hello, I am Jakodera'.'<br>';\n}", "public function winespace_welcome_admin_notice() {\n\t\t?>\n\t\t\t<div class=\"updated notice is-dismissible\">\n\t\t\t\t<p><?php echo sprintf( esc_html__( 'Thanks for choosing winespace! You can read hints and tips on how get the most out of your new theme on the %swelcome screen%s.', 'winespace' ), '<a href=\"' . esc_url( admin_url( 'themes.php?page=winespace-welcome' ) ) . '\">', '</a>' ); ?></p>\n\t\t\t\t<p><a href=\"<?php echo esc_url( admin_url( 'themes.php?page=winespace-welcome' ) ); ?>\" class=\"button\" style=\"text-decoration: none;\"><?php _e( 'Get started with winespace', 'winespace' ); ?></a></p>\n\t\t\t</div>\n\t\t<?php\n\t}", "public function intro() {\n\n\t}", "function HelpAndDie()\n\t{\n\t\tglobal $argv;\n\t\tdie(\"Usage: $argv[0] <start/stop/restart/status/autostart/create>\\n\n start: Starts the Bittorrent tracker and initial client\n stop: Stops the Bittorrent tracker and initial client\n restart: Restarts the Bittorrent tracker and initial client\n status: Gives status information.\n autostart: Starts the Bittorrent tracker and initial client, if there are\n .torrent files in \\\"\".BT_DIR.\"\\\"\n create <Filename>: Creates a torrent file for an existing file under\n /m23/data+scripts/extraDebs/.\\n\\n\");\n\t}", "function mainmenu(){\n\t\t\techo(\"No switch. Please specify -p [NewPageName]\");\n\t\t}", "public function install(){\r\n\t\t\r\n\t}", "function printHelp()\n{\n echo \"\\033[33m\";\n echo <<<EOF\n\\n\n******************************************************************************\n** TOOL TO PROCESS SCHEDULED EMAILS **\n** CheckoutSmart **\n** Build: 0.0.1alpha **\n******************************************************************************\n\nUsage: php cli.php [-m]<months> [options]\n\n -n, --number Number of emails to send\n -h, --help Show this help menu\n\nExamples:\n\n // Process five scheduled emails\n php process.php -n5\n\\n\nEOF;\n echo \"\\033[0m\";\n}", "public function main()\n\t{\n\t}", "function section_ringy_dingy() {\n\techo 'This is a settings section.\n\tYou can put instructions here for users about this section.';\n\t// You could also just leave this function blank\n\t// if you didn't want to output anything.\n}", "function feedbackAvaliador() {\n echo '<p class=\"feedback success\"><b>Revisor adicionado com sucesso.</b></p>';\n }", "function hello_world_install() {\nadd_option(\"ernaehrungsnews_anzahl\", '3', '', 'yes');\nadd_option(\"ernaehrungsnews_trimmer\", '100', '', 'yes');\nadd_option(\"ernaehrungsnews_kategorieId\", '3', '', 'yes');\n\n\n\n}", "public function notices() {\n\t\tif (!is_plugin_active( 'client-dash/client-dash.php' )) {\n\t\techo '<div class=\"error\">Client Dash Quickbooks Online requires <b>Client Dash</b>. Please install and activate <b>Client Dash</b> to continue using.</div>';\n\t\t}\n\t}", "public function thankyou_page() {\r\n if ( $this->instructions )\r\n echo wpautop( wptexturize( $this->instructions ) );\r\n }", "public function bernafas()\n \t{\n \t\techo 'Bernafas menggunakan hidung, '.PHP_EOL;\n \t}", "public function sayHello()\n {\n }", "public function swim(): void\r\n {\r\n echo \"\\nSwimming normally, as a human would do...\";\r\n }", "public function jalan() {\n return \"Hewan ini berjalan<br/>\";\n }", "public function message()\n {\n $menus = $this->menus();\n array_walk($menus, function (&$value, $key) {\n $value = \"{$key}. $value\";\n });\n $menus = implode(\"\\r\\n\", $menus);\n\n return \"Welcome to PHP USSD (PhUSSD) \\r\\n\\r\\n{$menus}\";\n }", "function startOutput(GetOpt $_options)\n {\n echo \"Ausgabe in Konsole erfolgt...\\n\";\n }" ]
[ "0.6972512", "0.66647094", "0.66541374", "0.66417074", "0.6560426", "0.6516581", "0.63987267", "0.6190629", "0.60115033", "0.60105515", "0.59814024", "0.5959263", "0.594059", "0.5917932", "0.5871861", "0.58581394", "0.58345354", "0.5808453", "0.57882655", "0.5787112", "0.5758465", "0.5753066", "0.5740211", "0.57240313", "0.57198715", "0.57077503", "0.56985563", "0.5686629", "0.5683269", "0.5667444", "0.5666544", "0.56504935", "0.56492114", "0.56467396", "0.5630007", "0.56283325", "0.5627156", "0.5618589", "0.5617991", "0.5602075", "0.558658", "0.55759895", "0.5569308", "0.55624783", "0.55618143", "0.55393356", "0.55384034", "0.55342865", "0.5527869", "0.5522998", "0.55214024", "0.55109704", "0.5502594", "0.54950243", "0.5483235", "0.5466409", "0.54570675", "0.5456989", "0.5452902", "0.5446044", "0.5445066", "0.5420846", "0.5419732", "0.5419668", "0.54189134", "0.541276", "0.5411223", "0.54055876", "0.54046637", "0.53979945", "0.5389211", "0.5388807", "0.5378004", "0.53742844", "0.5372523", "0.53717697", "0.5371276", "0.5371026", "0.5358132", "0.53543293", "0.53520125", "0.5351462", "0.534783", "0.5347142", "0.5344798", "0.5344313", "0.53402066", "0.533758", "0.5332785", "0.533231", "0.53263956", "0.5322448", "0.53216", "0.53196275", "0.53169125", "0.53142834", "0.531386", "0.53121823", "0.53112674", "0.53110635" ]
0.6244555
7
handle the action, use the domain services to finish the domain logic
public function handle(array $request = []);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {\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}", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "function handleAction(){\n\t\n\t$controller = getController();\n\t$viewState = getViewState();\t\n\n\t// ************************ THE FRONT CONTROLLER *********************** //\n\tif ( isset ($_GET[ ACTION_KEY ]) ){\n\n\t\tswitch ($_GET[ ACTION_KEY ]) {\n\t\t \n\t\t case 'deletetodo':\n\t\t \n\t\t $controller->deleteToDo( $_GET[ 'id' ] );\n\n\t\t $viewState->setView('list.php');\n\t\t \t$viewState->setData( $controller->listToDo() );\n\n\t\t \t$viewState->setResponse('The Todo Was Deleted', 'success');\n\t\t \n\t\t break;\n\n\t\t case 'edittodo':\n\n\t\t \t$viewState->setView('edit.php');\n\t\t \t$viewState->setData( $controller->getToDo( $_GET[ 'id' ] ) );\n\n\t\t break;\n\n\t\t case 'savetodo':\n\n\t\t \t// handle the checkbox\n\t\t \tif( !isset( $_POST['complete'] ) ){\n\t\t \t\t$_POST['complete'] = false;\n\t\t \t} else {\n\t\t \t\t$_POST['complete'] = true;\n\t\t \t}\n\n\t\t \t$controller->saveToDo($_POST);\n\n\t\t $viewState->setView('list.php');\n\t\t \t$viewState->setData( $controller->listToDo() );\n\n\t\t \t$viewState->setResponse('The Todo Was Saved', 'success');\n\n\t\t break;\n\n\t\t case 'deletecompleted':\n\n\t\t \t$controller->deleteCompleted();\n\n\t\t \t$viewState->setView('list.php');\n\t\t \t$viewState->setData( $controller->listToDo() );\n\n\t\t \t$viewState->setResponse('Completed ToDos Were Cleared', 'info');\n\n\t\t \tbreak;\n\t\t \n\t default:\n\t \n\t $viewState->setView('list.php');\n\t\t $viewState->setData( $controller->listToDo() );\n\t\t}\n\t} else {\n\n\t\t$viewState->setView('list.php');\n\t\t$viewState->setData( $controller->listToDo() );\t\n\t}\n}", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function execute()\n {\n // init container.\n $this->initContainer();\n\n // routing\n $this->routing();\n\n // action chain.\n while ($action = $this->actionChain->getCurrentAction()) {\n\n // clear.\n $this->filterChain->clear();\n $this->container->register('errorList', $this->actionChain->getCurrentErrorList());\n\n $this->filterChain->setAction($action['controller'], $action['action']);\n $this->filterChain->build();\n $this->filterChain->execute();\n\n $this->actionChain->next();\n }\n\n // response.\n $this->response->execute();\n }", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function postProcess()\n {\n $aps_params = Tools::getAllValues();\n if (isset($aps_params['action'])) {\n if ($aps_params['action'] == 'checkout') {\n $this->postApsPayment();\n } elseif ($aps_params['action'] == 'offline_response') {\n $this->responseOffline();\n } elseif ($aps_params['action'] == 'responseOnline') {\n $this->responseOnline();\n } elseif ($aps_params['action'] == 'merchantPageResponse') {\n $this->merchantPageResponse();\n } elseif ($aps_params['action'] == 'merchantPageCancel') {\n $this->merchantPageCancel();\n } elseif ($aps_params['action'] == 'getInstallmentPlans') {\n $this->getInstallmentPlans();\n } elseif ($aps_params['action'] == 'valu_customer_verify') {\n $this->valuCustomerVerify();\n } elseif ($aps_params['action'] == 'valu_generate_otp') {\n $this->valuGenerateOtp();\n } elseif ($aps_params['action'] == 'valu_otp_verify') {\n $this->valuOtpVerify();\n } elseif ($aps_params['action'] == 'validate_apple_url') {\n $this->validateAppleUrl();\n } elseif ($aps_params['action'] == 'send_apple_payment_aps') {\n $this->sendApplePaymentToAps();\n } elseif ($aps_params['action'] == 'create_cart_order') {\n $this->createCartOrder();\n } elseif ($aps_params['action'] == 'get_apple_pay_cart_data') {\n $this->getApplePayCartValues();\n } elseif ($aps_params['action'] == 'validate_apple_pay_shipping_address') {\n $this->validateApplePayShippingAddress();\n } elseif ($aps_params['action'] == 'displayError') {\n $this->displayError();\n }\n }\n }", "public function executeAction() {\r\n\t\t\r\n\t}", "public function process() {\n // on va lui passer le contexte en premier paramètre\n // puis on va lui passer les paramètres du path comme\n // paramètres supplémentaires\n $args = array_merge(\n array($this->_context),\n $this->_context->route->params\n );\n\n $this->_context->require_part('controller', $this->controller);\n $controller = new $this->controller;\n\n // CALL STAGES BEFORE ACTION\n\n $stages = array(\n '_before_action'\n );\n\n $_response = null;\n $responses_stack = array();\n\n foreach($stages as $stage) {\n $_response = $this->call_stage($controller,$stage,$this->action, $responses_stack);\n\n // Si on obtient un objet de type Response, on stoppe\n\n if($_response instanceof Response) {\n return $this->output($_response); // ! RETURN\n }\n else {\n $responses_stack[$stage] = $_response;\n }\n }\n\n\n // CALL ACTION\n if(! method_exists($controller, $this->action)) {\n throw new \\InvalidArgumentException('Action '.$this->action.' does not exists in controller '. get_class($controller));\n }\n $action_response = call_user_func_array(array($controller, $this->action), $args);\n\n if($action_response instanceof Response) {\n return $this->output($action_response); // ! RETURN\n }\n\n\n if(is_null($action_response)) {\n // si la réponse est nulle, on ne fait rien tout simplement\n //@todo : faire autre chose, envoyer un 204 ?\n $class = get_class($controller);\n r(\"@todo : empty $class return\");\n return; // ! RETURN\n }\n elseif(is_string($action_response)) {\n $response = new Response($action_response, $headers=array());\n return self::output($response); // ! RETURN\n }\n\n\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public function invoke() {\r\n $this->action = Util::getAction($this->action);\r\n \r\n switch ($this->action) {\r\n case 'customer_login':\r\n $this->processCustomerLogin();\r\n break;\r\n case 'get_customer':\r\n $this->processGetCustomer();\r\n break;\r\n case 'show_registration':\r\n $this->processShowRegistration();\r\n break;\r\n case 'register_product':\r\n $this->processRegisterProduct();\r\n break;\r\n case 'logout':\r\n $this->processLogout();\r\n break;\r\n default:\r\n $this->processCustomerLogin();\r\n break;\r\n }\r\n }", "function onProcess () {\r\n \t\r\n \tswitch (parent::getAction()) {\r\n \t\tcase \"search\":\r\n \t\t\t// log the search\r\n \t\t\t\r\n \t\t\t// if the result is a pinboard, note go to it\r\n \t\t\t// user\r\n \t\t\t// \r\n \t\t\t\r\n \t\t\tbreak;\r\n \t\tcase \"autoComplete\":\r\n \t\t\t\r\n \t\t\t/*\r\n \t\t\t// search location\r\n \t\t\tLocationModel::search();\r\n \t\t\t\r\n \t\t\t// note\r\n \t\t\tpinboardModule::search();\r\n \t\t\t\r\n \t\t\t// user\r\n \t\t\tUsersModel::search(\"\");\r\n \t\t\t*/\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t\r\n \t\t\tbreak;\r\n \t\tcase \"viewPinboard\":\r\n \t\t\tparent::redirect(\"pinboard\",array(\"pinboardId\"=>parent::get(\"pinboardId\")));\r\n \t\t\tbreak;\r\n \t\tcase \"viewLocation\":\r\n \t\t\tparent::redirect(\"pinboardMap\",array(\"pinboardId\"=>parent::get(\"pinboardId\")));\r\n \t\t\tbreak;\r\n \t\tcase \"viewUser\":\r\n \t\t\tbreak;\r\n \t}\r\n }", "public function dispatch()\n {\n $this->response = $this->frontController->execute();\n }", "protected function doExecute()\n\t{\n\t\t// Your application routines go here.\n\t}", "public function execute()\n {\n /** @var \\Magento\\Framework\\App\\Request\\Http $request */\n $request = $this->getRequest();\n\n /** @var \\Zend\\Http\\Headers $header */\n $header = $request->getHeaders();\n\n /** @var bool $result */\n $result = false;\n $msg = \"\";\n\n if ($this->authenticate($header)) {\n $content = $request->getContent();\n\n $data = $this->logitrail->getApi()->processWebhookData($content);\n\n $this->logger->debug(json_encode($data, JSON_UNESCAPED_UNICODE));\n\n switch ($data[\"event_type\"]) {\n case \"product.inventory.change\":\n $result = $this->handleInventoryChange($data);\n $msg = \"success\";\n break;\n case \"order.shipped\":\n $result = $this->handleOrderShipped($data);\n $msg = \"success\";\n break;\n default:\n $result = true;\n $msg = \"Handling for event type {$data[\"event_type\"]} not implemented\";\n break;\n }\n }\n\n if ($result) {\n header('HTTP/1.1 200 OK');\n echo($msg);\n } else {\n header('HTTP/1.0 400 Bad Request');\n echo('fail');\n }\n exit;\n }", "public function postDispatch();", "public function postDispatch() {\n\t\t\n\t\t}", "public function run()\n\t\t{\n\t\t\tswitch ($_GET['act']) {\n\t\t\t\tcase 'create':\n\t\t\t\t\t//Crear \n\t\t\t\t\t$this->create();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lists':\n\t\t\t\t\t//Crear \n\t\t\t\t\t$this->lists();\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'listsDetails':\n\t\t\t\t\t//Crear \n\t\t\t\t\t$this->listsDetails();\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'get':\n\t\t\t\t\t//Obtener una Remision\n\t\t\t\t\t$this->getRemision();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'getFolio':\n\t\t\t\t\t$this->getFolio();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif ($this->api) {\n\t\t\t\t\t\techo $this->json_encode(array('error'=>SERVICIO_INEXISTENTE,'data'=>NULL,'mensaje'=>'Este servicio no está disponible'));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//CARGAR VISTA DE SERVICIO INEXISTENTE\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function run()\n\t\t{\n\t\t\tswitch ($_GET['act']) {\n\t\t\t\tcase 'create':\n\t\t\t\t\t//Crear\n\t\t\t\t\tif(BaseCtrl::isAdmin())\n\t\t\t\t\t\t$this->create();\n\t\t\t\t\telse{\n\t\t\t\t\t\tif ($this->api) {\n\t\t\t\t\t\t\techo $this->json_encode(array('error'=>NO_PERMITIDO,'data'=>NULL,'mensaje'=>'No tienes permisos suficientes'));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//CARGAR VISTA DE NO PERMITIDO\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'lists':\n\t\t\t\t\t//Listar \n\t\t\t\t\t$this->lists();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'listsDetails':\n\t\t\t\t\t//Crear \n\t\t\t\t\t$this->listsDetails();\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'get':\n\t\t\t\t\t//Obtener una Recepcion\n\t\t\t\t\t$this->getRecepcion();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'getFolio':\n\t\t\t\t\t$this->getFolio();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif ($this->api) {\n\t\t\t\t\t\techo $this->json_encode(array('error'=>SERVICIO_INEXISTENTE,'data'=>NULL,'mensaje'=>'Este recepcion no está disponible'));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//CARGAR VISTA DE SERVICIO INEXISTENTE\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function run()\n {\n\n if (isset($this->request[\"p\"])) {\n switch ($this->request[\"p\"]) {\n\n case \"new_task\":\n case \"tasks\":\n $taskController = new TasksController();\n $taskController->run();\n $this->content = $taskController->getTaskById();\n break;\n\n case \"login\":\n\n $login = new Login();\n $login->validateInput($this->request);\n\n break;\n\n case \"logout\":\n Login::logout();\n break;\n\n case \"register\":\n if (isset($this->request[\"register\"][\"submit\"])) {\n $input = new Input();\n $user = $input->validateRegister($this->request[\"register\"]);\n $reg = new Register();\n if ($user !== false) {\n $reg->saveRegistration($user);\n }\n }\n\n break;\n\n case \"user-admin\":\n if (isset($_SESSION[\"active_user\"]) && $_SESSION[\"active_user\"]->getRole() == __ADMIN__) {\n try {\n (new UserController())->run();\n } catch (\\Exception $e) {\n Notice::set(\"error\", $e->getMessage());\n }\n } else {\n header(\"Location: ?p=home\");\n exit();\n }\n break;\n\n case \"news\":\n case \"news-admin\":\n if (isset($_SESSION[\"active_user\"]) && $_SESSION[\"active_user\"]->getRole() == __ADMIN__) {\n try {\n $news = new NewsController();\n $news->run();\n\n $this->content = $news->getUploadedImages();\n } catch (\\Exception $e) {\n Notice::set(\"error\", $e->getMessage());\n }\n } else {\n header(\"Location: ?p=home\");\n exit();\n }\n break;\n\n case \"contact\":\n $input = new Input();\n if (isset($this->request[\"contact\"][\"submit\"])) {\n $input->validateContact($this->request[\"contact\"]);\n }\n break;\n\n }\n }\n }", "public function execute()\n {\n $data = $this->getRequest()->getPostValue();\n if (!$data) {\n $this->_redirect('*/*/answer');\n return;\n }\n try {\n\n /** @var Contact $contact */\n $contact = $this->contactRepository->getById($data['id']);\n $contact->setAnswer($data['answer']);\n $contact->setAnsweredStatus(true);\n $this->contactRepository->save($contact);\n $this->messageManager->addSuccess(__('Answer has been successfully saved.'));\n } catch (\\Exception $e) {\n $this->messageManager->addError(__($e->getMessage()));\n }\n $this->_redirect('slavik_contact/post/index');\n }", "public function processAction() {\n\n if (!$this->validateRequest()) {\n $this->_helper->viewRenderer->setNoRender(true);\n $this->_helper->layout()->disableLayout();\n return;\n }\n\n $request = $this->getRequest();\n\n // Check if we have a POST request, otherwise, redirect\n if (!$request->isPost()) {\n return $this->_helper->redirector('index');\n }\n //Retrieving the form\n $form = $this->getForm();\n if (!$form->isValid($request->getPost())) {// Invalid entries\n $this->view->message = 'process-authorize';\n $this->view->form = $form;\n return $this->render('index'); // re-render the login form\n }\n\n if ($form->getValue('yes')) {//Resource Owner says yes\n $this->processApprove($form->getValues());\n } else if ($form->getValue(\"no\")) {//Resource Owner says no\n $this->processDeny($form->getValues());\n } else {//unrecognized value\n $this->view->message = 'process-authorize';\n $this->view->form = $form;\n return $this->render('index'); // re-render the login form\n }\n }", "public function postDispatch(){\n\t\t\n }", "function handle_actions() {\n $id = filter_input(INPUT_GET, 'id');\n global $subscribers;\n global $log;\n\n // POST\n $action = filter_input(INPUT_POST, 'action');\n if ($action == 'create') { \n $log->log('Subscriber CREATE'); // CREATE\n $subscribers->add();\n }\n \n\n // GET\n $action = filter_input(INPUT_GET, 'action');\n if (empty($action)) { \n $log->log('Subscriber READ'); // READ\n return $subscribers->list_view();\n }\n if ($action == 'add') {\n $log->log('Subscriber Add View');\n return $subscribers->add_view();\n }\n }", "public function process() {\n\n try {\n \n /*\n * !! IMPORTANT !!\n * Collections with a name starting with '$' character are not collection\n * but reserved actions \n */\n if ($this->request['collection'] && substr($this->request['collection'], 0 , 1) === '$') {\n \n /*\n * Action always returns JSON\n */\n $this->request['format'] = self::DEFAULT_RESPONSE_FORMAT;\n \n /*\n * QueryAnalyzer standalone service\n */\n if ($this->request['collection'] === '$analyzeQuery' && class_exists('QueryAnalyzer')) {\n \n /*\n * Change parameter keys to model parameter key\n * and remove unset parameters\n */\n $params = array();\n foreach ($this->request['params'] as $key => $value) {\n if ($value) {\n foreach(array_keys(RestoController::$searchFiltersDescription) as $filterKey) {\n if ($key === RestoController::$searchFiltersDescription[$filterKey]['osKey']) {\n $params[$filterKey] = $value;\n }\n }\n }\n }\n $qa = new QueryAnalyzer($this->dictionary, RestoController::$searchFiltersDescription, class_exists('Gazetteer') ? new Gazetteer($this) : null);\n $this->response = $qa->analyze($params);\n $this->responseStatus = 200;\n }\n else {\n throw new Exception('Not Found', 404);\n }\n }\n /*\n * Collection is requested\n */\n else if ($this->request['collection']) {\n \n /*\n * Collection does not exist\n */\n if (!$this->collections[$this->request['collection']]) {\n throw new Exception('Not Found', 404);\n }\n \n /*\n * Search collection Controller name within collections list\n */\n $controllerName = null;\n foreach (glob(realpath(dirname(__FILE__)) . '/../controllers/*.php', GLOB_NOSORT) as $controller) {\n if ($this->collections[$this->request['collection']]['controller'] === basename($controller, '.php')) {\n $controllerName = basename($controller, '.php');\n break;\n }\n }\n\n /*\n * Invalid controller \n */\n if (!$controllerName) {\n throw new Exception('Invalid collection', 500);\n }\n \n /*\n * HTTP method is PUT, POST or DELETE and no identifier is set\n * \n * HTTP DELETE - Delete new collection (if CollectionManager module is active)\n * HTTP PUT - Update new collection (if CollectionManager module is active)\n */\n if ($this->request['method'] === 'put' && !$this->request['identifier']) {\n if (class_exists('CollectionManager')) {\n $collectionManager = new CollectionManager($this);\n $this->response = $collectionManager->update();\n }\n else {\n throw new Exception('Forbidden', 403);\n }\n }\n else if ($this->request['method'] === 'delete' && !$this->request['identifier']) {\n if (class_exists('CollectionManager')) {\n $collectionManager = new CollectionManager($this);\n $this->response = $collectionManager->delete();\n }\n else {\n throw new Exception('Forbidden', 403);\n }\n }\n /*\n * HTTP GET method on /collection\n * HTTP POST, PUT DELETE on /collection/identifier\n */\n else {\n \n /*\n * Instantiate RestoController\n */\n $controller = new ReflectionClass($controllerName);\n if (!$controller->isInstantiable()) {\n throw new Exception('Bad Request', 400);\n }\n try {\n $method = $controller->getMethod($this->request['method']);\n } catch (ReflectionException $re) {\n throw new Exception('Forbidden', 403);\n }\n\n /*\n * Initialize a controller instance\n */\n if (!$method->isStatic()) {\n $controllerInstance = $controller->newInstance($this);\n $method->invoke($controllerInstance);\n $this->response = $controllerInstance->getResponse();\n $this->responseStatus = $controllerInstance->getResponseStatus();\n $this->responseDescription = $controllerInstance->getDescription();\n } else {\n throw new Exception('Static methods not supported in Controllers', 500);\n }\n if (is_null($this->response)) {\n throw new Exception('Method not allowed', 405);\n }\n }\n }\n /*\n * No collection requested \n * \n * HTTP GET - HTTP 200 (will redirect to home page - see htmlResponse)\n * HTTP POST - Create new collection (if CollectionManager module is active)\n * HTTP PUT - Not allowed\n * HTTP DELETE - Not allowed\n * \n */\n else {\n if ($this->request['method'] === 'get') {\n $this->responseStatus = 200;\n }\n else if ($this->request['method'] === 'post' && class_exists('CollectionManager')) {\n $collectionManager = new CollectionManager($this);\n $this->response = $collectionManager->create();\n }\n else {\n throw new Exception('Method Not Allowed', 405);\n }\n }\n } catch (Exception $re) {\n $this->responseStatus = $re->getCode();\n $this->response = array('ErrorCode' => $re->getCode(), 'ErrorMessage' => $re->getMessage());\n }\n\n /*\n * Special case for stream !\n */\n if ($controllerInstance && $this->responseDescription['forceStream']) {\n return;\n }\n\n /*\n * Output result\n */\n $this->response()->send();\n }", "public function execute()\r\n\t{\r\n\t\t$service_name = $this->getRequestParameter( \"myaction\" );\r\n\r\n\t\t// remove all '_' and set to lowercase\r\n\t\t$myaction_name = trim( strtolower( str_replace ( \"_\" , \"\" , $service_name ) ) );\r\n\t\t$clazz_name = $myaction_name . \"Action\";\r\n//\t\techo \"[$myaction_name] [$clazz_name]<br>\";\r\n\r\n//\t\t$clazz = get_class ( $clazz_name );\r\n\r\n\t\t//$multi_request = $this->getRequestParameter( \"multirequest\" , null );\r\n\t\t$multi_request = $myaction_name == \"multirequest\" ;\r\n\t\tif ( $multi_request )\r\n\t\t{\r\n\t\t\t$multi_request = new myMultiRequest ( $_REQUEST, $this );\r\n\t\t\t$response = $multi_request->execute();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$include_result = @include_once ( \"{$clazz_name}.class.php\");\r\n\t\t\tif ( $include_result )\r\n\t\t\t{\r\n\t\t\t\t$myaction = new $clazz_name( $this );\r\n\t\t\t\t$myaction->setInputParams ( $_REQUEST );\r\n\t\t\t\t$response = $myaction->execute( );\r\n\t\t\t\tkEventsManager::flushEvents();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$format = $this->getP ( \"format\" );\r\n\t\t\t\t$response = \"Error: Invalid service [$service_name]\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$format = $this->getP ( \"format\" );\r\n\t\tif ( $format == kalturaWebserviceRenderer::RESPONSE_TYPE_PHP_ARRAY || $format == kalturaWebserviceRenderer::RESPONSE_TYPE_PHP_OBJECT )\r\n\t\t{\r\n\t\t\t//$this->setHttpHeader ( \"Content-Type\" , \"text/html; charset=utf-8\" );\r\n\t\t\t$response = \"<pre>\" . print_r ( $response , true ) . \"</pre>\" ;\r\n\t\t}\r\n\r\n\t\t// uncomment in order to cache api responses\r\n\t\tif(kConf::get('enable_cache'))\r\n\t\t{\r\n\t\t\t$this->cacheResponse($response);\r\n\t\t}\r\n\r\n\t\t\r\n $ret = $this->renderText( $response );\r\n KExternalErrors::terminateDispatch();\r\n return $ret;\r\n\t}", "public function HandleToDo()\n\t{\n\t\tconvertRequestInput();\n\n\t\tGetLib('class.json');\n\n\t\t$action = isc_strtolower(@$_REQUEST['w']);\n\n\t\tif (!$GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Redirects)) {\n\t\t\tISC_JSON::output(GetLang('NoPermission'));\n\t\t\tdie();\n\t\t}\n\n\t\tif(method_exists($this, $action)) {\n\t\t\t$this->$action();\n\t\t\tdie();\n\t\t}\n\n\t\tISC_JSON::output(GetLang('InvalidAction'));\n\t}", "public function proceed()\n {\n }", "public function postDispatch()\n {\n //...\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function process() {\n\t\t$service = $this->getService();\n\t\t$service->hsts = HTTP_Helper::retrievePost( 'hsts_preload' );\n\t\t$service->include_subdomain = HTTP_Helper::retrievePost( 'include_subdomain' );\n\t\t$service->hsts_cache_duration = HTTP_Helper::retrievePost( 'hsts_cache_duration' );\n\t\t$service->scenario = HTTP_Helper::retrievePost( 'scenario' );\n\t\t$ret = $service->process();\n\t\tif ( is_wp_error( $ret ) ) {\n\t\t\twp_send_json_error( [\n\t\t\t\t'message' => $ret->get_error_message()\n\t\t\t] );\n\t\t} else {\n\t\t\tSettings::instance()->addToResolved( Sh_Strict_Transport::$slug );\n\t\t}\n\t}", "public function postAction() {}", "public function execute() {\n\t\t$controller = $this->manager->get($this->getController());\n\t\t$reflection = new \\ReflectionClass($controller);\n\t\t$controller->run( $this->getAction($reflection) );\n\t}", "public function postDispatch()\n {\n\n }", "public function doneAction()\n {\n \n }", "public final function dispatch() {\n\t\t$request = PhpBB::getInstance()->getRequest();\n\n\t\tif ($this->controller != NULL) {\n\t\t\treturn $this->handleResponse(\n\t\t\t\t$this->controller->executeAction(\n\t\t\t\t\tself::getAction($request),\n\t\t\t\t\tself::getParameters($request)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $this->handleResponse(new Error404());\n\t}", "function process($action)\r\n{\r\n\r\n\tif ($action == \"actualizar\")\r\n\t{\r\n\t\t//arreglo para captura de datos\r\n\t\t$cap = array();\r\n\t\t\r\n\t\t//arreglo para validaciones\r\n\t\t$val = array();\r\n\t\t\r\n\t\t$val[0] = validarChar(trim($cap[0] = trim($_POST['txtCorreo']))); //Correo\r\n\t\t$val[1] = validarChar(trim($cap[1] = strtoupper($_POST['txtNombre']))); //Nombre\r\n\t\t$val[2] = validarChar(trim($cap[2] = strtoupper($_POST['txtPaterno']))); //Apellido Paterno\r\n\t\t$val[3] = validarChar(trim($cap[3] = strtoupper($_POST['txtMaterno']))); //Apellido Materno \r\n\t\t$val[4] = validarChar(trim($cap[4] = strtoupper($_POST['txtTelefono'])));\t//Telefono\r\n\t\t$val[5] = validarChar(trim($cap[5] = (trim(strtoupper($_POST['txtCalle'])) . \",\" . trim(strtoupper($_POST['txtColonia'])) . \",\" . trim(strtoupper($_POST['txtCiudad']))))); //Direccion\r\n\t\t\r\n\t\tif(validacionGeneral($val) == FALSE)\r\n\t\t{\r\n\t\t\tif(validarCorreo($cap[0]) == TRUE)\r\n\t\t\t{\r\n\t\t\t\tif(actionUpdateUser($cap) > 0)\r\n\t\t\t\t\tmessage(\"Datos actualizados correctamente\", \"../control/redirect.php\");\r\n\t\t\t\telse \r\n\t\t\t\t\tmessage(\"Sus datos no se pudieron actualizar\", \"../control/redirect.php\");\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t\tmessage(\"El correo NO es Valido\", \"../control/redirect.php\");\r\n\t\t}\r\n\t\telse \r\n\t\t\tmessage(\"Datos Corruptos\", \"../control/redirect.php\");\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif ($action == \"registroCita\")\r\n\t\t\tmessage(\"\", \"../acount/appointmentRecord.php\");\r\n\t\telse\r\n\t\t{\r\n\t\t\tif ($action == \"consultaCita\")\r\n\t\t\t{\r\n\t\t\t\tmessage(\"\", \"../acount/consultAppointment.php\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif($action == \"cambioContrasena\")\r\n\t\t\t\t{\r\n\t\t\t\t\tmessage(\"\", \"../acount/changePass.php\");\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t\tmessage('Accion Desconocida Intente de nuevo\\\\nSi el problema persiste Intentelo mas tarde', '../control/redirect.php');\r\n\t\t\t}\r\n\t\t}\r\n\t}\t\r\n}", "public function _doAction();", "public function processAction(): Response\n {\n // 1. Transform Request to Query.\n /** @var GetOneQuery $query */\n $query = $this->queryAdapter->buildQueryFromRequest($this->queryRequest);\n\n // 2. Business work thanks to the Query.\n $entity = $this->queryHandler->process($query);\n\n // 3. Format using the business work and return the Response.\n $body = $this->prepareSuccess($entity);\n return $this->responseHandler->create($body)->getResponse();\n }", "public function execute()\n {\n DatabaseManager::getInstance()->query(Constants::getInstance()->get('addServiceAction'), [\n ':ACT_NAME' => $this->getRequest()->query->get('name'),\n ':ACT_TYPE' => $this->getRequest()->query->get('type')\n ]);\n\n $this->setMessage('ServiceInsertion', [\n 'item_id' => $this->getInstruction()->getInsertId(),\n 'action_id' => $actionId = DatabaseManager::getInstance()->getLastInsertId()\n ]);\n\n DatabaseManager::getInstance()->query(Constants::getInstance()->get('addServiceActionRelation'),\n [':SRVC_ID' => $this->getInstruction()->getInsertId(), ':ACT_ID' => $actionId]);\n }", "function Execute()\n\t\t{\n\t\t\t$controller = new $this->CONTROLLER();\n\t\t\t$controller->Initialise($this->get, $this->post, $this->files);\n\t\t\t$controller->StartFilters();\n\t\t\t$controller->{$this->ACTION}();\n\t\t\t$controller->StopFilters();\n\t\t}", "public function execute()\n {\n // debug mode\n $this->_helper->debug('Start \\Afterpay\\Afterpay\\Controller\\Payment\\Response::execute() with request ' . $this->_jsonHelper->jsonEncode($this->getRequest()->getParams()));\n\n $query = $this->getRequest()->getParams();\n $order = $this->_checkoutSession->getLastRealOrder();\n\n // Check if not fraud detected not doing anything (let cron update the order if payment successful)\n if ($this->_afterpayConfig->getPaymentAction() == AbstractMethod::ACTION_AUTHORIZE_CAPTURE) {\n //Steven - Bypass the response and do capture\n $redirect = $this->_processAuthCapture($query);\n } elseif (!$this->response->validCallback($order, $query)) {\n $this->_helper->debug('Request redirect url is not valid.');\n }\n // debug mode\n $this->_helper->debug('Finished \\Afterpay\\Afterpay\\Controller\\Payment\\Response::execute()');\n\n // Redirect to cart\n $this->_redirect($redirect);\n }", "function action(){\n\t\t//Campos que se quieren excluir de la limpieza de código. Formato: nombreCampo1|nombreCampo2|nombreCampo3\n\t\t$excluir=\"\";\n\t\t$_REQUEST=$this->inspector->cleanPHPHTML($_REQUEST);\n\n\t\t$option=isset($_REQUEST['option'])?$_REQUEST['option']:\"list\";\n\n\n\t\tswitch($option){\n\t\t\tcase \"processList\":\n\t\t\t\t$variable[\"option\"]=\"list\";\n\t\t\t\t$variable[\"grado\"]=$_REQUEST['grado'];\n\t\t\t\t$variable[\"sede\"]=$_REQUEST['sede'];\n $variable[\"periodo\"]=$_REQUEST['periodo'];\n\t\t\t\t$this->getComportamiento($variable);\n\t\t\tbreak;\n\n case \"actualizarNota\":\n $result = $this->procesarNota($_REQUEST);\n echo \"Registro actualizado\";\n /*if(!$result->status){\n echo json_encode($result);\n return false;\n }\n echo json_encode($result);*/\n\n break;\n\t\t}\n\t}", "abstract function doExecute($request);", "public function handle($action) {\n $callback = $this->resolve_controller_callback($action);\n $response = $this->generate_response($callback);\n $this->send_response($response);\n }", "function handle()\n {\n\n if(isset($_POST['submit-report'])){\n $this->handleSubmission();\n }\n\n\n $this->page = file_get_contents('./pages/dispatch.html');\n $departments = $this->generateDepartments();\n $this->page = str_replace(\"<!-- Fill Departments -->\", $departments, $this->page);\n $this->page = str_replace(\"<!-- HEADER -->\", file_get_contents('./pages/header.html'), $this->page);\n //$this->page = str_replace('<!-- javascript -->', $this->getJS(), $this->page);\n }", "public function doneAction()\n\t{\n\t\n\t}", "public function postProcess();", "public function take_action()\n {\n }", "public function take_action()\n {\n }", "abstract function _do_execute(request $request);", "public function viewDomainAction() {\n\n try {\n $pageHeading = \"Domains\";\n $this->view->page_heading = $pageHeading;\n $this->view->data_page = \"tables\";\n \n $clientId = $this->_request->getParam('client');\n $domainId = $this->_request->getParam('id');\n \n $objDomainService = new Base_Model_Lib_Order_Service_Domain();\n $clientsDomains = $objDomainService->getAllDomainsByClientId($clientId); \n $this->view->clientsDomains = $clientsDomains;\n \n $selectedDomainInformation = $objDomainService->getItem($domainId);\n $this->view->domainInformation = $selectedDomainInformation;\n \n $objRegistrarsService = new Base_Model_Lib_System_Service_Registrars();\n $registrars = $objRegistrarsService->getAll();\n $this->view->registrars = $registrars;\n \n $objPaymentMethodService = new Base_Model_Lib_Catelog_Service_PaymentMethod();\n $paymentMethods = $objPaymentMethodService->getAll();\n $this->view->paymentMethods = $paymentMethods;\n \n if ($this->_request->isPost()) {\n \n $domainId = $this->_request->getParam('txtId');\n $clientId = $this->_request->getParam('txtClientId');\n $objDomainEntity = new Base_Model_Lib_Order_Entity_Domain();\n $objDomainEntity->setId($this->_request->getParam('txtId'));\n $objDomainEntity->setRegistrationdate($this->_request->getParam('txtRegistrationDate'));\n $objDomainEntity->setDomain($this->_request->getParam('txtDomainName'));\n $objDomainEntity->setFirstpaymentamount($this->_request->getParam('txtFirstPaymentAmount'));\n $objDomainEntity->setRecurringamount($this->_request->getParam('txtRecurringAmount'));\n $objDomainEntity->setRegistrar($this->_request->getParam('cmbRegistrar'));\n $objDomainEntity->setRegistrationperiod($this->_request->getParam('txtRegistrationPeriod'));\n $objDomainEntity->setExpirydate($this->_request->getParam('txtExpiryDate'));\n $objDomainEntity->setSubscriptionid($this->_request->getParam('txtSubscriptionID'));\n $objDomainEntity->setPromoid($this->_request->getParam('txtPromotionCode'));\n $objDomainEntity->setStatus($this->_request->getParam('cmbStatus'));\n $objDomainEntity->setNextduedate($this->_request->getParam('txtNextDueDate'));\n $objDomainEntity->setNextinvoicedate($this->_request->getParam('txtNextDueDate'));\n $objDomainEntity->setAdditionalnotes($this->_request->getParam('admin_notes')); // admin_notes\n $objDomainEntity->setPaymentmethod($this->_request->getParam('cmbPaymentMethod'));\n $objDomainEntity->setDnsmanagement($this->_request->getParam('chkDnsManagement'));\n $objDomainEntity->setEmailforwarding($this->_request->getParam('chkEmailForwarding'));\n $objDomainEntity->setIdprotection($this->_request->getParam('chkIDProtection'));\n $objDomainEntity->setDonotrenew($this->_request->getParam('chkDonotrenew'));\n $objDomainEntity->setRegistrarLock($this->_request->getParam('chkRegistrarLock'));\n $objDomainEntity->setNameServer1($this->_request->getParam('txtNameserver1'));\n $objDomainEntity->setNameServer2($this->_request->getParam('txtNameserver2'));\n $objDomainEntity->setNameServer3($this->_request->getParam('txtNameserver3'));\n $objDomainEntity->setNameServer4($this->_request->getParam('txtNameserver4'));\n $objDomainEntity->setReminders(null);\n $objDomainEntity->setSynced(null);\n $objDomainService->domain = $objDomainEntity;\n $objDomainService->updateItem();\n \n $this->_redirect('/admin/order/view-domain/client/'.$clientId.'/id/'.$domainId.'/?status=updated');\n \n \n }\n \n \n $status = $this->_request->getParam('status');\n$this->view->status = $status;\n\n\t} catch (Exception $ex) {\n throw new Exception('<ERROR>' . $ex->getMessage() . \"\\n\");\n }\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 }", "final function execute($request) {\t\t\n\t\t// Forward the action to execute page-specific logic\n\t\t$this->doExecute($request);\n\t}", "public function doAction() : void {\n $this->doJob();\n }", "public function execute()\n {\n $path=$this->getPath();\n try\n {\n Log::info('Trying module '.$this->module);\n \t$this->page = $this->moduleInstance($this->module,$path,$this->params);\n\n \ttry\n \t{\n Log::info('Trying action '.$this->action);\n \t\t $this->page->executeAction($this->action);\n \t}\n catch (SecurityException $e) {\n $this->handleSecurity();\n }\n catch (Error404Exception $e) {\n $this->returnActionNotFound();\n }\n catch (Exception $e)\n {\n Log::info('Action '.$this->action.' rejected for module '.$this->module.', trying index instead ');\n Log::info('Reason : '.$e->getMessage());\n $this->page->handleException($e);\n }\n\n }\n catch (Error404Exception $e) {\n\n $this->returnModuleNotFound();\n }\n catch (SecurityException $e) {\n $this->handleSecurity();\n }\n catch (Exception $e)\n {\n\n Log::info('Error module '.$this->module.'. Revealing as 404');\n \t $this->page = $this->moduleInstance('error',$path);\n $this->page->executeAction('404');\n }\n Log::info($this->module.'/'.$this->action.' executed successfully');\n }", "public function performAction()\n {\n if (isset($_SESSION['user_id'])) {\n $this->_userLoggedIn();\n } else if (isset($_POST['signin'])) {\n $this->_signInRequested();\n } else if (isset ($_POST['signup'])) {\n $this->_signUpPageRequested();\n } else {\n $this->_noActionTaken();\n }\n }", "public function doExecute()\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$strID = $this->request->getProperty(\"id\");\r\n\t\t\t$strType = $this->request->getProperty(\"type\");\r\n\t\t\t$doNotRedirect = $this->request->getProperty(\"printRedirect\");\r\n \r\n\t\t\t$configLinkResolver = $this->registry->getConfig(\"LINK_RESOLVER_ADDRESS\", true);\r\n\t\t\t$configSID = $this->registry->getConfig(\"APPLICATION_SID\", false, \"calstate.edu:xerxes\");\r\n\t\t\t$configBaseUrl = $this->registry->getConfig(\"BASE_URL\", true);\r\n\t\t\r\n\t\t\t// get the record from database\r\n\t\t\t\r\n\t\t\t$objData = new Xerxes_DataMap();\r\n\t\t\t$objDataRecord = $objData->getRecordByID($strID);\r\n\t\t\t\r\n\t\t\tif ( $objDataRecord == null ) throw new Exception(\"cannot find record\");\r\n\t\t\t\r\n\t\t\t$objRecord = $objDataRecord->xerxes_record;\r\n\t\t\t\r\n\t\t\t// redirect to the resource based on type\r\n\t\t\t\r\n\t\t\tif ( $strType == \"openurl\" )\r\n\t\t\t{\t\t\t\t\t\r\n\t\t\t\t$this->request->setRedirect($objRecord->getOpenURL($configLinkResolver, $configSID));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$strUrl = $configBaseUrl . \"/?base=databases&action=proxy\";\r\n\t\t\t\t\r\n\t\t\t\tif ( $strType == \"html\" || $strType == \"pdf\" || $strType == \"online\" || $strType == \"construct\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$link = $objRecord->getFullText(true);\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach ( $link as $arrLink )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ( $arrLink[2] == $strType)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// see if this is a construct link, in which case pass it back thru\r\n\t\t\t\t\t\t\t// proxy for construction\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ( is_array($arrLink[1]) )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tforeach ( $arrLink[1] as $strField => $strValue )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$strUrl .= \"&param=$strField=$strValue\";\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}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$strUrl .= \"&url=\" . urlencode($arrLink[1]);\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\tif ( method_exists($objRecord, \"getMetalibID\") )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$strUrl .= \"&database=\" . $objRecord->getMetalibID();\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}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new Exception(\"unsupported redirect type\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->request->setRedirect($strUrl);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($doNotRedirect == true )\r\n\t\t\t{\r\n\t\t\t\techo $this->request->getRedirect();\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn 1;\t\t\t\t\t\r\n\t\t}", "public function execute() {\n if ( $this->mInternalMode ) {\n $this->executeAction();\n } else {\n $this->executeActionWithErrorHandling();\n }\n }", "public function HandlePage()\n\t\t{\n\t\t\t$this->SetOrderData();\n\n\t\t\t$action = \"\";\n\t\t\tif(isset($_REQUEST['action'])) {\n\t\t\t\t$action = isc_strtolower($_REQUEST['action']);\n\t\t\t}\n\n\t\t\tswitch($action) {\n\t\t\t\tdefault: {\n\t\t\t\t\t$this->FinishOrder();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function execute()\r\n\t{\r\n\t\t$entry_id = $this->getRequestParameter( \"entry_id\" );\r\n\t\t\r\n\t\t$entry = entryPeer::retrieveByPK($entry_id);\r\n\t\t\r\n\t\tif ($entry)\r\n\t\t{\r\n\t\t\t$this->redirect( $entry->getPartnerLandingPage() );\r\n/*\t\t\t\r\n\t\t\t$partner = PartnerPeer::retrieveByPK($entry->getPartnerId());\r\n\t\t\t\r\n\t\t\tif ($partner)\r\n\t\t\t{\r\n\t\t\t\t$this->redirect($partner->getLandingPage().$entry_id);\r\n\t\t\t}\r\n*/\r\n\t\t}\r\n\t\t\t\r\n\t\tdie;\r\n\t}", "public function processAction($action)\r\n\t{\r\n\t\t$this->result = Array();\r\n\t\t$this->result[\"debug\"] = Array();\r\n\r\n\t\tif ($action == \"ready\")\r\n\t\t\t$this->actionCheckReady();\r\n\t\telse\r\n\t\t{\r\n\t\t\t//nothing\r\n\t\t\t$this->result[\"status\"] = 0;\r\n\t\t\t$this->result[\"msg\"] = 'no action performed';\r\n\t\t}\r\n\r\n\t\t$this->result[\"debug\"] = getDebugLog();\r\n\r\n\t\t//the response is encoded in JSON on AJAX calls\r\n\t\tprint json_encode( $this->result );\r\n\t}", "protected abstract function handleRequest();", "protected function callActionMethod() {}", "public function run()\n\t{\n\t\t$_controller = $this->getController();\n\t\t\n\t\tif ( ! ( $_controller instanceof IXLRest ) )\n\t\t{\n\t\t\t$_controller->missingAction( $this->getId() );\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//\tCall the controllers dispatch method...\n\t\t$_controller->dispatchRequest( $this );\n\t}", "protected function afterAction () {\n\t}", "public function handleRequest() {}", "protected function afterAction() {\n\n }", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public function process() {\n\n require_once 'libs/Auth.php';\n $username = \"\";\n $userId = -1;\n\n if(Auth::isAuthorized()) {\n $userId = Auth::userId();\n require_once 'models/User.php';\n $user = new User($userId);\n $username = $user->username();\n }\n\n $this->setVar('username', $username);\n $this->setVar('userId', $userId);\n\n require_once 'models/Job.php';\n\n $jobId = $this->param();\n\n $job = new Job($jobId);\n\n $skills = $job->skills();\n\n $skillString = \"\";\n foreach($skills as $skill) {\n $skillString .= $skill . \" \";\n }\n\n $jobArray = Array();\n\n $jobArray['id'] = $job->id();\n\n $this->setVar('jobArray', $jobArray);\n $this->setVar('seekers', $job->interestedSeekers());\n $this->setVar('jobPosterId', $job->postedById());\n }", "function handle_postUserCode($debug=false)\n {\n $result = Array();\n \n // re-retrieve instance id which could have been modified by a complete\n $this->instance_id\t= $this->instance->getInstanceId();\n \n //synchronised instance object with the database\n $this->instance->sync();\n\n // for interactive activities in non-auto mode:\n if (!($this->auto_mode) && $this->activity->isInteractive())\n {\n if ($this->instance->getActivityCompleted())\n {\n // activity is interactive and completed, \n // we have to continue the workflow\n // and send any autorouted activity which could be after this one\n // this is not done in the $instance->complete() to let\n // xxx_pos.php code be executed before sending the instance\n\n $result['engine_info'] =& $this->instance->sendAutorouted($this->activity_id);\n\n // application should display completed page\n $result['action']='completed';\n return $result;\n }\n // it hasn't been completed\n else\n {\n if ($GLOBALS['workflow']['__leave_activity'])\n {\n // activity is interactive and the activity source set the \n // $GLOBALS[workflow][__leave_activity] it's a 'cancel' mode.\n // we redirect the user to the leave activity page\n $result['action']='leaving';\n return $result;\n }\n else\n { \n //the activity is not completed and the user doesn't want to leave\n // we loop on the form\n $result['action']='loop';\n return $result;\n }\n }\n }\n else\n { \n // in auto mode or with non interactive activities we return engine info\n // and we collect our errors, we do not let them for other objects\n $this->collect_errors($debug);\n $result['engine_info']['debug'] = implode('<br />',array_filter($this->error));\n $result['engine_info']['info'] =& $this->getRuntimeInfo();\n $result['action'] = 'return';\n return $result;\n }\n }", "public function process_form_action( $action ){\n\t\tif( $action == \"login\" )\n\t\t\t$this->process_login( );\n\t\telse if( $action == \"register\" )\n\t\t\t$this->process_register( );\n\t\telse if( $action == \"retrieve_password\" )\n\t\t\t$this->process_retrieve_password( );\n\t\telse if( $action == \"update_personal_information\" )\n\t\t\t$this->process_update_personal_information( );\n\t\telse if( $action == \"update_password\" )\n\t\t\t$this->process_update_password( );\n\t\telse if( $action == \"update_billing_information\" )\n\t\t\t$this->process_update_billing_information( );\n\t\telse if( $action == \"update_shipping_information\" )\n\t\t\t$this->process_update_shipping_information( );\n\t\telse if( $action == \"logout\" )\n\t\t\t$this->process_logout( );\n\t\telse if( $action == \"update_subscription\" )\n\t\t\t$this->process_update_subscription( );\n\t\telse if( $action == \"cancel_subscription\" )\n\t\t\t$this->process_cancel_subscription( );\n\t\telse if( $action == \"order_create_account\" )\n\t\t\t$this->process_order_create_account( );\n\t}", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "public function process()\n {\n $oService = Phpfox::getService('opensocialconnect');\n\n if ($aVals = $this->request()->get('val'))\n {\n if ($this->request()->get('synchronize') == Phpfox::getPhrase('opensocialconnect.synchronize'))\n {\n $sService = $aVals['service'];\n\n if (!isset($_SESSION['quick_signup'][$sService]))\n {\n $this->url()->send('');\n }\n else\n {\n $aData = $oService->getSignupSessionData($sService);\n }\n\n $aService = Phpfox::getService('opensocialconnect.providers')->getProvider($sService);\n\n $aVals['service_id'] = $aService['service_id'];\n\n $iId = $aVals['user_id'];\n\n Phpfox::getService('opensocialconnect')->addAgent($iId, $aVals);\n Phpfox::getService('opensocialconnect.providers')->updateStatistics($sService, 'sync');\n\n $aExistUser = $oService->getUserByIdentityAndService($aVals['identity'], $sService, $aVals['service_id']);\n\n $bLogin = false;\n\n if (isset($aExistUser['email']) && $aExistUser['email'] != \"\")\n {\n list($bLogin, $aUser) = $oService->loginByEmail($aExistUser['email']);\n\n if (Phpfox::isModule('socialbridge'))\n {\n if (($sService == 'facebook'))\n {\n $aToken = Phpfox::getService('socialbridge.libs')->getFBAccessToken();\n $aExtra = $_SESSION['quick_signup'][$sService]['user'];\n Phpfox::getService('socialbridge.agents')->addToken($iId, $sService, $aToken, $aExtra);\n Phpfox::getService('opensocialconnect')->updateBridgeToken($iId, $sService);\n }\n\n if ($sService == 'linkedin' || $sService == 'twitter')\n {\n list($aToken, $aExtra) = Phpfox::getService('socialbridge.provider.twitter')->getTokenData();\n Phpfox::getService('socialbridge.agents')->addToken($iId, $sService, $aToken, $aExtra);\n Phpfox::getService('opensocialconnect')->updateBridgeToken($iId, $sService);\n }\n }\n }\n\n Phpfox::getService('opensocialconnect')->clearSignupSessionData();\n\n if ($bLogin)\n {\n if (is_array($iId))\n {\n (($sPlugin = Phpfox_Plugin::get('user.component_controller_register_3')) ? eval($sPlugin) : false);\n $this->url()->forward($iId[0]);\n }\n else\n {\n $sRedirect = Phpfox::getParam('user.redirect_after_signup');\n if (!empty($sRedirect))\n {\n (($sPlugin = Phpfox_Plugin::get('user.component_controller_register_4')) ? eval($sPlugin) : false);\n $this->url()->send($sRedirect);\n }\n if (Phpfox::getParam('user.multi_step_registration_form') && is_array(Phpfox::getParam('user.registration_steps')) && count(Phpfox::getParam('user.registration_steps')))\n {\n $aUrls = Phpfox::getParam('user.registration_steps');\n\n (($sPlugin = Phpfox_Plugin::get('user.component_controller_register_5')) ? eval($sPlugin) : false);\n $this->url()->send($aUrls[0], 'register');\n }\n else\n {\n (($sPlugin = Phpfox_Plugin::get('user.component_controller_register_6')) ? eval($sPlugin) : false);\n $this->url()->send('');\n }\n }\n }\n }\n if ($this->request()->get('cancel') == Phpfox::getPhrase('core.no'))\n {\n $sUrlRedirect = $this->url()->makeUrl('opensocialconnect.quicksignup', array('service' => $aVals['service'], 'syns' => 'no'));\n $this->url()->send($sUrlRedirect);\n }\n }\n }", "function action()\n\t{\n\t\t//Campos que se quieren excluir de la limpieza de código. Formato: nombreCampo1|nombreCampo2|nombreCampo3\n\t\t$excluir=\"\";\n\t\t$_REQUEST=$this->miInspectorHTML->limpiarPHPHTML($_REQUEST);\n\n\t\t$option=isset($_REQUEST['option'])?$_REQUEST['option']:\"list\";\n\n\t\t\n\t\tswitch($option){\n\t\t\tcase \"processNew\":\n\n\t\t\t\t$this->processNew();\n\t\n\t\t\t\tif(!$this->status){\n\t\t\t\t\t$mensaje=implode(\"<br/>\",$this->mensaje['error']);\t\n\t\t\t\t\t$this->redireccionar(\"falloRegistro\",array($mensaje,$this->data));\n\t\t\t\t}else{\n\t\t\t\t\t$mensaje=implode(\"<br/>\",$this->mensaje['exito']);\n\t\t\t\t\t$this->redireccionar(\"exitoRegistro\",array($mensaje));\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase \"processEdit\":\n\t\t\t\t$this->processEdit($_REQUEST['optionValue']);\n\t\t\t\t$this->redireccionar(\"exitoRegistro\",array($mensaje));\n\t\t\tbreak;\n\t\t\tcase \"processDelete\":\n\t\t\t\t$this->processDelete($_REQUEST['optionValue']);\n\t\t\tbreak;\n\t\t}\n\n\n\n\n\t}", "public function execute()\n {\n $controllerClassName = $this->requestUrl->getControllerClassName();\n $controllerFileName = $this->requestUrl->getControllerFileName();\n $actionMethodName = $this->requestUrl->getActionMethodName();\n $params = $this->requestUrl->getParams();\n \n if ( ! file_exists($controllerFileName))\n {\n exit('controlador no existe');\n }\n\n require $controllerFileName;\n\n $controller = new $controllerClassName();\n\n $response = call_user_func_array([$controller, $actionMethodName], $params);\n \n $this->executeResponse($response);\n }", "abstract public function handle_request();", "protected function doExecute()\n\t{\n\t\t$controller = $this->getController();\n\n\t\t$controller = new $controller($this->input, $this);\n\n\t\t$this->setBody($controller->execute());\n\t}", "public function postAction()\n {\n // Nothing to do\n }", "private function executeHandle() {\n // call hook function\n is_callable(config('hooks.onExecute')) && call_user_func(config('hooks.onExecute'), $this);\n // execute controller\n $this->router->executeController();\n }", "public function handle()\n\t{\n\t\t$logged_in = $this->checkLoggedIn();\n\t\tif($logged_in === 2)\n\t\t\treturn;\n\t\tif(!$logged_in)\n\t\t\t$this->login();\n\t\t$checks = $this->getPage('https://politicsandwar.com/alliance/id=2570');\n\t\tif(!stristr($checks, 'Change Permissions'))\n\t\t\tdie('ERROR: Unable To Login To Alliance Page.');\n\t\tif(!$this->checkTurn($checks))\n\t\t\treturn;\n\t\tif(preg_match('/11:[4-5][0-9]\\s*pm/', $checks))\n\t\t\treturn;\n\t\t\n\t\t$nations = json_decode($this->getPage('https://politicsandwar.com/api/nations/'))->nations;\n\t\t$membs = $this->getAllMemberIDs();\n\t\tforeach($nations as $nation){\n\t\t\tif($nation->allianceid != 2570 || in_array($nation->nationid, $membs) || stristr($nation->color, 'gr'))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\t$this->moveNation($nation, true);\n\t\t}\n\t}", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function execute() {\n\n $this->parseRequestHeaders();\n\n $uri = $this->loadUrl(); // Loads the called URL\n String::arrayTrimNumericIndexed($uri); // Trim the URL array indexes\n\n /**\n * When server is running as a RESTful server\n */\n if (RESTFUL == '1') {\n RestServer::runRestMethod($uri);\n $this->terminate();\n }\n\n /**\n * When the request is not running over ajax,\n * then call the home for full page rendering\n * before calling the requested method\n */\n if (!$this->isAjax()) {\n\n $this->controller = $this->requireHome();\n $this->controller->itStarts($uri);\n $this->terminate();\n }\n\n /**\n * Normal Ajax Request, call the method only\n */\n $this->runMethod($uri);\n $this->terminate();\n }", "public function processRequest($action)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t//Never trust users input\n\t\t\t\t$action = htmlspecialchars($action);\n\t\t\t\t\n\t\t\t\tswitch ($action)\n\t\t\t\t{\n\t\t\t\t\tcase \"StoreCarRank\" :\n\t\t\t\t\t\t$carName = htmlspecialchars($_POST[ 'carName' ]);\n\t\t\t\t\t\t$step = htmlspecialchars($_POST[ 'step' ]);\n\t\t\t\t\t\t$this->_mdlRace->storeCarRank($carName, $step);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"InitRace\" :\n\t\t\t\t\t\t$this->_mdlRace->initializeRace();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase \"XmlRanking\" :\n\t\t\t\t\t\t$this->_mdlRace->getXmlRanking();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase \"FinalRank\" :\n\t\t\t\t\t\t$this->_mdlRace->getFinalScore();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tdefault : //Error\n\t\t\t\t\t\techo \"Error...\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo 'Exception reçue : '.$e->getMessage().'<br/>';\n\t\t\t\techo 'Trace : <pre>'.$e->getTraceAsString().'</pre><br/>';\n\t\t\t}\n\t\t}", "public static function handle() {\n die(call_user_func([new self::$_class, self::$_action]));\n }", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function executeComponent()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->checkRequiredModules();\n\t\t\t$this->checkAuthorized();\n\t\t\t$this->setTitle();\n\t\t\t$this->getOptions();\n\t\t\t$this->processRequest();\n\n\t\t\t$this->performActions();\n\n\t\t\t$this->obtainData();\n\t\t\t$this->formatResult();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$this->errorsFatal[htmlspecialcharsEx($e->getCode())] = htmlspecialcharsEx($e->getMessage());\n\t\t}\n\n\t\t$this->formatResultErrors();\n\n\t\t$this->includeComponentTemplate();\n\t}", "public function execute()\n {\n if (!$this->user->authorize('admin.login')) {\n // TODO: improve\n return false;\n }\n\n $params = [];\n\n $event = new Event(\n [\n 'type' => &$this->target,\n 'key' => &$this->id,\n 'directory' => &$this->directory,\n 'collection' => &$this->collection,\n 'object' => &$this->object\n ]\n );\n $this->grav->fireEvent(\"flex.{$this->target}.admin.route\", $event);\n\n if ($this->isFormSubmit()) {\n $form = $this->getForm();\n $this->nonce_name = $form->getNonceName();\n $this->nonce_action = $form->getNonceAction();\n }\n\n // Handle Task & Action\n if ($this->task) {\n // validate nonce\n if (!$this->validateNonce()) {\n $e = new RequestException($this->getRequest(), 'Page Expired', 400);\n\n $this->close($this->createErrorResponse($e));\n }\n $method = $this->task_prefix . ucfirst(str_replace('.', '', $this->task));\n\n if (!method_exists($this, $method)) {\n $method = $this->task_prefix . 'Default';\n }\n\n } elseif ($this->target) {\n if (!$this->action) {\n if ($this->id) {\n $this->action = 'edit';\n $params[] = $this->id;\n } else {\n $this->action = 'list';\n }\n }\n $method = 'action' . ucfirst(strtolower(str_replace('.', '', $this->action)));\n\n if (!method_exists($this, $method)) {\n $method = $this->action_prefix . 'Default';\n }\n } else {\n return null;\n }\n\n if (!method_exists($this, $method)) {\n return null;\n }\n\n try {\n $response = $this->{$method}(...$params);\n } catch (RequestException $e) {\n $response = $this->createErrorResponse($e);\n } catch (RuntimeException $e) {\n // If task fails to run, redirect back to the previous page and display the error message.\n if ($this->task && !$this->redirect) {\n $this->setRedirect($this->referrerRoute->toString(true));\n }\n $response = null;\n $this->setMessage($e->getMessage(), 'error');\n }\n\n if ($response instanceof ResponseInterface) {\n $this->close($response);\n }\n\n // Grab redirect parameter.\n $redirect = $this->post['_redirect'] ?? null;\n unset($this->post['_redirect']);\n\n // Redirect if requested.\n if ($redirect) {\n $this->setRedirect($redirect);\n }\n\n return $response;\n }", "public function finishedAction()\n {\n }", "public function execute() {\r\n \r\n $resultRedirect = $this->getResultRedirect();\r\n $paymentToken = $this->getRequest()->getParam('cko-payment-token');\r\n $quote = $this->session->getQuote();\r\n \r\n try {\r\n $response = $this->verifyPaymentService->verifyPayment($paymentToken);\r\n $cardToken = $response['card']['id'];\r\n \r\n if(isset($response['description']) && $response['description'] == 'Saving new card'){\r\n return $this->vaultCardAfterThreeDSecure( $response );\r\n }\r\n \r\n $this->validateQuote($quote);\r\n $this->assignGuestEmail($quote, $response['email']);\r\n\r\n if($response['status'] === 'Declined') {\r\n throw new LocalizedException(__('The transaction has been declined.'));\r\n }\r\n\r\n $this->orderService->execute($quote, $cardToken, []);\r\n\r\n return $resultRedirect->setPath('checkout/onepage/success', ['_secure' => true]);\r\n } catch (\\Exception $e) {\r\n $this->messageManager->addExceptionMessage($e, $e->getMessage());\r\n }\r\n \r\n return $resultRedirect->setPath('checkout/cart', ['_secure' => true]);\r\n }", "public function completeAction() {\n\n }", "public function postDispatch()\n {\n \n parent::postDispatch();\n }", "public function handleDataSubmission() {}", "public function execute()\n {\n if (!$this->formKeyValidator->validate($this->getRequest())) {\n $this->messageManager->addErrorMessage(__('Invalid Form Key. Please refresh the page.'));\n $this->_redirect('*/*/settings');\n\n return;\n }\n $customerId = $this->session->getCustomerId();\n $policyTypeToRevoke = $this->consentRepository\n ->getByCustomerIdAndStatus(\n $customerId,\n CookiePolicyConsent::STATUS_RECIEVED\n )->getConsentType();\n\n if ($this->cookieManager->isAllowCookies() !== null) {\n $this->cookieManager->unsetIsAllowCookies();\n $this->consentLogger->logCookieConsent(\n $customerId,\n $policyTypeToRevoke,\n CookiePolicyConsent::STATUS_REVOKED\n );\n $this->messageManager->addSuccessMessage(__('Cookies has been revoked'));\n } else {\n $this->messageManager->addNoticeMessage(__('No cookie decision has been made yet'));\n }\n\n $this->_redirect('*/*/settings');\n }", "public function executeComponent()\n\t{\n\t\tif($this->checkRequiredModules() && $this->checkPermissions() && $this->checkParameters())\n\t\t{\n\t\t\t$this->performAction();\n\t\t\t$this->obtainData();\n\t\t}\n\n\t\t$this->formatResult();\n\n\t\t$this->includeComponentTemplate();\n\t}", "function process_action($db, &$data) {\n\n\t/*\n\t\tIn \"real\" version this would validate the form, sending\n\t\tthe message if valid, and sending the appropriate handler.\n\t\t\n\t\tHandlers such as:\n\t\t\tactions/%s/%s_invalidForm\n\t\t\tactions/%s/%s_failed\n\t\t\tactions/%s/%s_success\n\t*/\n\t\n\t$data = [\n\t\t'contentFilePath' => 'actions/%s/%s.success',\n\t\t'pageName' => 'contact',\n\t\t'pageTitle' => 'Contact Us'\n\t];\n\n}" ]
[ "0.66092134", "0.6608155", "0.6608155", "0.6608155", "0.6433227", "0.63906085", "0.6298351", "0.62680006", "0.6239573", "0.61962837", "0.6091866", "0.6055963", "0.6042222", "0.60367215", "0.59545416", "0.5949172", "0.5947133", "0.5929056", "0.5909625", "0.59001786", "0.58865917", "0.58712786", "0.58691317", "0.58626866", "0.5834214", "0.58300716", "0.5825242", "0.5820159", "0.5814022", "0.5806378", "0.58063364", "0.58038545", "0.5785159", "0.5774596", "0.5770554", "0.5736406", "0.5730188", "0.5727875", "0.5722158", "0.5710635", "0.5701984", "0.5701275", "0.5685573", "0.56823736", "0.56803536", "0.5675471", "0.56643486", "0.5656117", "0.56532097", "0.563604", "0.56287754", "0.56209034", "0.5613368", "0.56101316", "0.56101316", "0.5608157", "0.56079936", "0.56054664", "0.5599108", "0.558944", "0.5587514", "0.5585674", "0.55809593", "0.5575199", "0.5574618", "0.5568535", "0.55684304", "0.55634016", "0.55606884", "0.5558711", "0.5556169", "0.5548923", "0.55488116", "0.55414045", "0.55309534", "0.5530148", "0.5523628", "0.5515376", "0.5512592", "0.5510723", "0.55081177", "0.55035484", "0.5497494", "0.54955804", "0.5493663", "0.5488199", "0.5482033", "0.5479679", "0.5477341", "0.54713535", "0.5464108", "0.54622847", "0.54547226", "0.54515207", "0.5451021", "0.54468775", "0.5446081", "0.543896", "0.54375553", "0.5436518", "0.54360384" ]
0.0
-1
Create a new issue
public function createIssue( $data ) { $this->issue->create([ 'name' => $data['name'], 'slug' => $data['slug'], 'description' => $data['description'], 'product_id' => $data['productId'], 'issue_stage_id' => 1, 'issue_status' => 0 ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create($project, CreateIssueRequest $request)\n {\n $issue = new Issue();\n $issue->hidden \t = $request->has('hidden');\n $issue->author_id = Auth::user()->id;\n $issue->project_id = $project->id;\n $issue->summary = $request->summary;\n $issue->priority = 'Medium';\n $issue->version\t\t= $project->current_version;\n $issue->reference = $request->reference;\n $issue->description = $request->description;\n\n if($request->assigned == '1') {\n $groupid = Group::where('name', '=', 'Client')->first()->id;\n $issue->status = 'Awaiting Client';\n $issue->assigned_to_id = $groupid;\n } else {\n $groupid = Group::where('name', '=', 'Sponge UK')->first()->id;\n $issue->status = 'New';\n $issue->assigned_to_id = $groupid;\n }\n $result = $issue->save();\n\n if($request->file('attachment')) {\n $attachment = $request->file('attachment');\n $file = array(\n \"filename\" => $attachment->getClientOriginalName(),\n \"extension\" => $attachment->getClientOriginalExtension(),\n \"filetype\" => $attachment->getMimeType()\n );\n $attachment->move(\"uploads/tmp\", $file['filename']);\n $this->dispatch(new AddAttachmentCommand($file, $issue->id, Auth::user()->id));\n }\n\n if($result) {\n $update = new IssueHistory();\n $update->hidden = false;\n $update->project_id = $issue->project->id;\n $update->issue_id = $issue->id;\n $update->author_id = $issue->author->id;\n $update->type = 'status';\n $update->status = 'created';\n $update->comment = 'Amendment was created';\n $update->save();\n }\n\n return $issue->id;\n }", "public function createAction()\n {\n $issue = new Issue();\n $request = $this->getRequest();\n $form = $this->createForm(new IssueType(), $issue);\n $form->submit($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($issue);\n $em->flush();\n\n return $this->redirect($this->generateUrl('issue_show', array('id' => $issue->getId())));\n \n }\n\n return array(\n 'issue' => $issue,\n 'form' => $form->createView()\n );\n }", "public function create()\n {\n return view('issues.create');\n }", "public function create()\n {\n $projects = $this->redmine->getProjects()->lists('name', 'id')->toArray();\n $users = $this->redmine->getUsers()->lists('mail', 'id')->toArray();\n $track = $this->redmine->getTrack()->lists('name', 'id')->toArray();\n\n return view('redmine.create-issue', compact('projects', 'users', 'track'));\n }", "public function issuecreate(Repo $repo)\n {\n return view('repo.issue.create', ['repo' => $repo]);\n }", "public static function create_comment($input, $project, $issue)\n\t{\n\t\t$config_app = require path('public') . 'config.app.php';\n\t\tif (!isset($config_app['Percent'])) { $config_app['Percent'] = array (100,0,10,80,100); }\n\t\trequire \"tag.php\";\n\t\t$fill = array(\n\t\t\t'created_by' => \\Auth::user()->id,\n\t\t\t'project_id' => $project->id,\n\t\t\t'issue_id' => $issue->id,\n\t\t\t'comment' => $input['comment'],\n\t\t);\n\n\t\t$comment = new static;\n\t\t$comment->fill($fill);\n\t\t$comment->save();\n\n\t\t/* Add to user's activity log */\n\t\t\\User\\Activity::add(2, $project->id, $issue->id, $comment->id);\n\t\t$vide = true;\n\t\t$Val = ($input['Pourcentage'] > $config_app['Percent'][3]) ? 8: (($input['Pourcentage'] == 100 ) ? 2: 9);\n\t\tif(!empty($issue->tags)):\n\t\t\tforeach($issue->tags()->order_by('tag', 'ASC')->get() as $tag):\n\t\t\t\tif ($Val == $tag->id) { $vide = false; }\n\t\t\tendforeach;\n\t\tendif;\n\t\tif ($vide) { Tag::addNew_tags($issue->id, $Val); }\n\n\t\t/* Add attachments to issue */\n\t\t\\DB::table('projects_issues_attachments')->where('upload_token', '=', $input['token'])->where('uploaded_by', '=', \\Auth::user()->id)->update(array('issue_id' => $issue->id, 'comment_id' => $comment->id));\n\n\t\t/* Update the Todo state for this issue */\n\t\t//\\DB::table('users_todos')->where('issue_id', '=', $issue->id)->update(array('user_id' => \\Auth::user()->id, 'status' => (($input['Pourcentage'] > $config_app['Percent'][3]) ? 3: 2), 'weight' => $input['Pourcentage'], 'updated_at'=>date(\"Y-m-d H:m:s\")));\n\t\t\\DB::table('users_todos')->where('issue_id', '=', $issue->id)->update(array('status' => (($input['Pourcentage'] > $config_app['Percent'][3]) ? 3: 2), 'weight' => $input['Pourcentage'], 'updated_at'=>date(\"Y-m-d H:m:s\")));\n\n\t\t/* Update the status of this issue according to its percentage done; */\n\t\t\\DB::table('projects_issues')->where('id', '=', $issue->id)->update(array('closed_by' => (($input['Pourcentage'] == 100 ) ? \\Auth::user()->id : NULL), 'status' => (($input['Pourcentage'] == 100 )? 0 : 1),'status' => (($input['Pourcentage'] == 100 )? 0 : 1)));\n\n\t\t/*Update tags attached to this issue */\n\t\t$MesTags = explode(\",\", $input[\"MesTags\"]);\n\t\t$IDtags = array();\n\t\tforeach($MesTags as $val) {\n\t\t\tforeach(\\Tag::where('tag', '=', $val)->get(\"id\",\"tag\") as $activity) {\n\t\t\t\t$Idtags[] = $activity->id;\n\t\t\t}\n\t\t}\n\t\tif (isset($Idtags)) {\n\t\t$issue->tags()->sync($Idtags);\n\t\t$issue->save();\n\t\t}\n\n\t\t/* Update the project */\n\t\t$issue->updated_at = date('Y-m-d H:i:s');\n\t\t$issue->updated_by = \\Auth::user()->id;\n\t\t$issue->save();\n\t\tif ($input['Pourcentage'] == 100 ) {\n\t\t\t$tags = $issue->tags;\n\t\t\t$tag_ids = array();\n\t\t\tforeach($tags as $tag) { $tag_ids[$tag->id] = $tag->id; }\n\t\t\t$issue->closed_by = \\Auth::user()->id;\n\t\t\t$issue->closed_at = date('Y-m-d H:i:s');\n\n\t\t\t/* Update tags */\n\t\t\t$tag_ids[2] = 2;\n\t\t\tif(isset($tag_ids[1])) { unset($tag_ids[1]); }\n\t\t\tif(isset($tag_ids[8])) { unset($tag_ids[8]); }\n\t\t\tif(isset($tag_ids[9])) { unset($tag_ids[9]); }\n\n\t\t\t/* Add to activity log */\n\t\t\t\\User\\Activity::add(3, $issue->project_id, $issue->id);\n\t\t\t$issue->tags()->sync($tag_ids);\n\t\t\t$issue->status = 0;\n\t\t\t$issue->save();\n\t\t}\n\n\t\t/*Notifications by email to those who concern */\n\t\t$project = \\Project::current();\n\t\t$subject = sprintf(__('email.new_comment'), $issue->title, $project->name);\n\t\t$text = \\View::make('email.commented_issue', array(\n\t\t\t\t'actor' => \\Auth::user()->firstname . ' ' . \\Auth::user()->lastname,\n\t\t\t\t'project' => $project,\n\t\t\t\t'issue' => $issue,\n\t\t\t\t'comment' => $comment->comment\n\t\t\t));\n\n\t\t/* Notify the person to whom the issue is currently assigned, unless that person is the one making the comment */\n\t\tif($issue->assigned_to && $issue->assigned_to != \\Auth::user()->id && (!empty($issue->assigned->email))) {\n \t\t\t\\Mail::send_email($text, $issue->assigned->email, $subject);\n\t\t}\n\n\t\t/* Notify the person who created the issue, unless that person is the one making the comment */\n\t\tif($issue->created_by && $issue->created_by != \\Auth::user()->id && (!empty($issue->user->email))) {\n\t\t\t\\Mail::send_email($text, $issue->user->email, $subject);\n\t\t}\n\n\t\treturn $comment;\n\t}", "public function create()\n {\n return view('admin.bookIssue.create');\n }", "public function actionIssue() {\n $model = new LibraryMagazineIssue();\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n Yii::$app->db->createCommand(\"UPDATE library_magazine_subscription_master SET Magazine_Status = 3 WHERE Magazine_Subscription_Id = \" . $model->Magazine_Id)->execute();\n $model->save();\n return $this->redirect(['create']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new IssueAssign();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function testCreateIssueMutation()\n {\n $query = file_get_contents(__DIR__ . '/Issue/Mutation/createIssueMutation.gql');\n $base64 =$this->getBase64ImageString();\n $headers = $this->getRandomUserHeaders();\n $variables = [\n \"title\" => \"创建一个问题\",\n \"background\" => \"HelloWorld\",\n ];\n\n $this->runGuestGQL($query, $variables, $headers);\n\n //创建戴图片的问题\n $variables = [\n \"title\" => \"创建一个问题\",\n \"background\" => \"HelloWorld\",\n 'cover_image'=>$base64\n ];\n\n $this->runGuestGQL($query, $variables, $headers);\n }", "public function create()\n {\n\t\t\n return view('issue.create',['pageData' => $this->pageData]);\n }", "public function __construct(Issue $issue)\n {\n $this->issue = $issue;\n }", "public function actionCreate()\n {\n $model = new BugReport();\n $uploadForm = new UploadForm();\n $model->reporter_id = Yii::$app->user->id;\n $model->status = '1';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Yeah! It is! Bug №' . $model->bug_id . ' was added successfully!');\n return $this->redirect(['bug-report/index', 'id' => $model->project_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'uploadForm' => $uploadForm,\n ]);\n }", "function create( $summary, $details, $assigned_to=100, $priority=3, $extra_fields=array(), $importData = array()) {\n\t\t//\n\t\t//\tmake sure this person has permission to add artifacts\n\t\t//\n\n\t\t//\n\t\t//\tget the user_id\n\t\t//\n\t\tif(array_key_exists('user', $importData)){\n\t\t\t\t$user = $importData['user'];\n\t\t} else {\n\t\t\tif (!forge_check_perm ('tracker',$this->ArtifactType->getID(),'submit')) {\n\t\t\t\t\t$this->setError(_('You are not currently allowed to submit items to this tracker.'));\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (session_loggedin()) {\n\t\t\t\t$user=user_getid();\n\t\t\t} else {\n\t\t\t\t$user=100;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t//\tdata validation\n\t\t//\n\t\tif (!$summary) {\n\t\t\t$this->setError(_('Message Summary Is Required'));\n\t\t\treturn false;\n\t\t}\n\t\tif (!$details) {\n\t\t\t$this->setError(_('Message Body Is Required'));\n\t\t\treturn false;\n\t\t}\n\t\tif (!$assigned_to) {\n\t\t\t$assigned_to=100;\n\t\t}\n\t\tif (!$priority) {\n\t\t\t$priority=3;\n\t\t}\n\t\t$status_id=1;\t\t// on creation, status is set to \"open\"\n\n\t\t//\n\t\t//\tThey may be using an extra field \"status\" box so we have to remap\n\t\t//\tthe status_id based on the extra field - this keeps the counters\n\t\t//\taccurate\n\t\t//\n\t\t$status_id = $this->ArtifactType->remapStatus($status_id,$extra_fields);\n\t\tif (!$status_id) {\n\t\t\t$this->setError($this->ArtifactType->getErrorMessage());\n\t\t\treturn false;\n\t\t}\n\n\t\tdb_begin();\n\t\tif (array_key_exists('time',$importData)){\n\t\t\t$time = $importData['time'];\n\t\t} else {\n\t\t\t$time = time();\n\t\t}\n\t\t$res = db_query_params ('INSERT INTO artifact\n\t\t\t(group_artifact_id,status_id,priority,\n\t\t\tsubmitted_by,assigned_to,open_date,summary,details)\n\t\t\tVALUES ($1,$2,$3,$4,$5,$6,$7,$8)',\n\t\t\t\t\tarray ($this->ArtifactType->getID(),\n\t\t\t\t\t $status_id,\n\t\t\t\t\t $priority,\n\t\t\t\t\t $user,\n\t\t\t\t\t $assigned_to,\n\t\t\t\t\t $time,\n\t\t\t\t\t htmlspecialchars($summary),\n\t\t\t\t\t htmlspecialchars($details))) ;\n\t\tif (!$res) {\n\t\t\t$this->setError(db_error());\n\t\t\tdb_rollback();\n\t\t\treturn false;\n\t\t}\n\n\t\t$artifact_id=db_insertid($res,'artifact','artifact_id');\n\n\t\tif (!$res || !$artifact_id) {\n\t\t\t$this->setError(db_error());\n\t\t\tdb_rollback();\n\t\t\treturn false;\n\t\t} else {\n\t\t\t//\n\t\t\t//\tNow set up our internal data structures\n\t\t\t//\n\t\t\tif (!$this->fetchData($artifact_id)) {\n\t\t\t\tdb_rollback();\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t// the changes to the extra fields will be logged in this array.\n\t\t\t\t// (we won't use it however)\n\t\t\t\t$extra_field_changes = array();\n\t\t\t\tif (!$this->updateExtraFields($extra_fields,$extra_field_changes)) {\n\t\t\t\t\tdb_rollback();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//\n\t\t\t//\tnow send an email if appropriate\n\t\t\t//\n\t\t\t$this->mailFollowupEx(0, 1);\n\t\t\tdb_commit();\n\n\t\t\treturn $artifact_id;\n\t\t}\n\t}", "public function store(Request $request)\n {\n if ($request->input('issues')) {\n $issues = $request->input('issues');\n foreach ($issues as $key => $issue) {\n $this->rules['issues.'.$key.'.subject'] = 'required';\n $this->rules['issues.'.$key.'.description'] = 'required';\n $this->rules['issues.'.$key.'.project_id'] = 'required|integer';\n $this->rules['issues.'.$key.'.estimated_hours'] = 'numeric';\n $this->rules['issues.'.$key.'.parent_issue_id'] = 'integer';\n\n $this->messages['issues.'.$key.'.subject.required'] = 'This field is required';\n $this->messages['issues.'.$key.'.description.required'] = 'This field is required';\n $this->messages['issues.'.$key.'.project_id.required'] = 'This field is required';\n\n $this->messages['issues.'.$key.'.project_id.integer'] = 'This feild must be number';\n $this->messages['issues.'.$key.'.parent_issue_id.integer'] = 'This feild must be number';\n $this->messages['issues.'.$key.'.estimated_hours.numeric'] = 'This feild must be numeric';\n }\n }\n\n $this->validate($request, $this->rules, $this->messages);\n\n if ($request->input('issues')) {\n $issues = $request->input('issues');\n foreach ($issues as $key => $issue) {\n $this->client->issue->create([\n 'project_id' => $issue['project_id'],\n 'subject' => $issue['subject'],\n 'description' => $issue['description'],\n 'assigned_to_id' => $issue['assigned_to_id'],\n 'parent_issue_id' => $issue['parent_issue_id'],\n 'start_date' => $issue['start_date'],\n 'due_date' => $issue['due_date'],\n 'estimated_hours' => $issue['estimated_hours'],\n 'tracker_id' => $issue['tracker_id'],\n ]);\n }\n }\n }", "public function postIssue(Issue $issue)\n {\n $response = $this->client->post(\"/issue\", $issue->toJSON());\n\n return $this->getIssue($response['id']);\n }", "function createIssue( $sessionID, $Header, $Status, $DateCreated, $Students, $Description, $watch, $Level, $Category ) {\r\n\t\tif( $this->userCanCreateIssue( $sessionID ) ) {\r\n\t\t\t$Creator = $_SESSION['userid'];\r\n\t\t\tif(empty($this->link)){\r\n\t\t\t\techo \"Not connected to database You must instantiate the DataAccessManager before performing\r\n\t\t\t\t\tdatabase accesses.\";\r\n\t\t\t\t\texit;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// begin hack to create ID number\r\n\t\t\t$IDs = array();\r\n\t\t\t$ID = date('m').date('d').date('Y').'-';\r\n\t\t\t$result = mysql_query(\"SELECT * FROM issues WHERE ID like '%$ID%'\");\r\n\t\t\tfor($i=0; $results = mysql_fetch_assoc($result); $i++){\r\n\t\t\t\t$IDs[$i] = $results['ID'];\r\n\t\t\t}\r\n\t\t\t$idnumber = mysql_num_rows($result) + 1;\r\n\t\t\twhile(in_array('I'.$ID.$idnumber, $IDs)){\r\n\t\t\t\t\t\t$idnumber++;\r\n\t\t\t}\r\n\t\t\t$ID ='I'.$ID.$idnumber;\r\n\t\t\t// end hack to create ID number\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$Header = htmlspecialchars($Header);\r\n\t\t\t$Header = addslashes($Header);\r\n\t\t\tif($Level == 1)\r\n\t\t\t\t$Level = 'A';\r\n\t\t\telse\r\n\t\t\t\t$Level = 'B';\r\n\t\t\t$query = \"insert into issues (id, header, creator, status, datecreated, Level, Category)\r\n\t\t\t\t values ('$ID', '$Header', '$Creator', '$Status', '$DateCreated', '$Level', '$Category')\";\r\n\t\t\t//echo $query; exit;\r\n\t\t\tmysql_query($query);\r\n\t\t\t$this->createContact($sessionID, $DateCreated, $Students, $Description, $ID, $watch);\r\n\t\t\treturn $ID; //Yay, it works!\r\n\t\t}\r\n\t\telse {\r\n\t\t\techo 'You do not have permission to create that issue.';\r\n\t\t\treturn false; //Oh no, failure!\r\n\t\t}\r\n\t}", "public function newAction()\n {\n $issue = new Issue();\n $form = $this->createForm(new IssueType(), $issue);\n\n return array(\n 'issue' => $issue,\n 'form' => $form->createView()\n );\n }", "public function create()\n {\n $books=Book::all();\n return view(\"issue.create\",compact('books'));\n }", "public function issuestore(Request $request, Repo $repo)\n {\n $request->validate(\n [\n \"name\" => \"max:50\",\n \"email\" => \"max:100\",\n \"title\" => \"required|max:50\",\n \"details\" => \"required|max:255\",\n ]\n );\n\n $ghclient = new GHClient();\n $ghclient->authenticate($repo->user->accesstoken, GHClient::AUTH_ACCESS_TOKEN);\n\n $title = $request->title;\n $body = \"Name: \" . $request->name . \"\\r\";\n $body .= \"Email: \" . $request->email . \"\\r\";\n $body .= \"\\r\\r\";\n $body .= $request->details;\n\n $explodedname = explode('/', $repo->name);\n\n // return $explodedname;\n\n $ghclient->issue()->create($explodedname[0], $explodedname[1], array('title' => $title , 'body' => $body));\n return redirect()->route('repo.issues', ['repo' => $repo->id]);\n }", "public function create($username, $repository, array $params)\n {\n if (!isset($params['title'])) {\n throw new MissingArgumentException(['title']);\n }\n\n return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues', $params);\n }", "public function create()\n {\n return view('bug.create');\n }", "public function store(Request $request)\n {\n $version = $this->pageData->version;\n\t\t$user = auth()->user();\n\t\t\n\t\t$attributes = request()->validate(['title' => 'required','content'=>'required']);\n\t\t$attributes['version_id'] = $version->id;\n\t\t$attributes['user_id'] = $user->id;\n\t\t$attributes['open'] = true;\n\t\tIssue::create($attributes);\n\t\treturn redirect(url('/dashboard'));\n }", "public function store(Request $request)\n {\n request()->validate([\n 'Bugname' => 'required',\n 'Priority' => 'required',\n 'Description' => 'required',\n 'status',\n 'solution',\n 'projectid'=>'required',\n 'submittedby',\n 'assignedto',\n ]);\n \n //conversion of project name to project id\n $PrnameTOPrid=DB::table('projects')\n ->where('ProjectName', '=', $request->projectid)\n ->first('id'); \n //get project admin to assign to\n $Pradmin=DB::table('projects')\n ->where('ProjectName', '=', $request->projectid)\n ->first('createdby'); \n\n \n $ticket=new Ticket();\n $ticket->Bugname=$request->Bugname;\n $ticket->Priority=$request->Priority;\n $ticket->Description=$request->Description;\n $ticket->status=$request->status;\n $ticket->solution=$request->solution;\n $ticket->projectid=$PrnameTOPrid->id;\n $ticket->submittedby=$request->submittedby;\n $ticket->assignedto=$Pradmin->createdby;\n $ticket->save();\n \n\n // Ticket::create($request->all());\n\n\n return redirect()->route('tickets.index')\n ->with('success','ticket created successfully.');\n }", "public function createIssue($title, $body)\n {\n\n $lists = $this->manager->getBoard($this->boardId)->getLists();\n\n if (!empty($lists)) {\n $currentList = array_shift($lists);\n } else {\n return false;\n }\n\n $member = $this->manager->getMember('me')->getData();\n\n $card = $this->client->api('card')->create(array(\n 'name' => $title,\n 'desc' => $body,\n 'idList' => $currentList->getId(),\n 'idMembers' => $member['id'],\n ));\n\n return $card;\n }", "public function store(Request $request)\n {\n $request->validate(Issue::validateRules());\n /* $request->validate([\n 'issue_on'=>'required|date_formate:d/m/y',\n 'return_date'=>'required|date|after_or_equal:issue_on',\n 'book_id'=>'required|int|max:3|exists:books,id'\n ]);*/\n\n \n $request->merge([\n 'status'=>'active'\n ]);\n \n \n $issue=new Issue($request->all()\n\n );\n $issue->save();\n dd($issue);\n\n return redirect()->route('issue.index');\n }", "public function create()\n {\n return view('bug.create', ['levels' => self::getLevels()]);\n }", "public function postNew() /* /tickets/new */\n\t{\n\t\t$input = Input::all();\n\t\t$ticket = new Ticket;\n\t\t$ticket->title = $input['title'];\n\t\t$ticket->description = $input['description'];\n\t\t$ticket->department = $input['department'];\n\t\t$ticket->status = \"open\";\n\t\t$ticket->user_id = Auth::user()->id;\n\t\t\n\t\t$subject = 'New ticket opened';\n\t\t$message = 'New ticket: '.$ticket->title.', with description: '.$ticket->description.', is now open.';\n\t\t//Queue::push('SendEmail', array('email' => $this->adminEmail, 'message' => $message, 'subject' => $subject));\n\t \n\t\t$ticket->save();\n\t\treturn $ticket;\n\t}", "public function creating(assignment $assignment)\n {\n //code...\n }", "public function create(): void {\n\t\t$rawdata = array(\n\t\t\t'datetime' => $this->request->request->get('datetime', null),\n\t\t\t'priority' => $this->request->request->getInt('priority', 1),\n\t\t\t'description' => $this->request->request->get('description'),\n\t\t);\n\n\t\t$rawdata['datetime'] ??= new DateTime();\n\n\t\tif ($rawdata['description'] !== '') {\n\t\t\tpreg_match('/^(.+?) ?(?:\\\\[(\\\\d+)\\\\]|)$/', strip_tags($rawdata['description'] ?? ''), $matches);\n\t\t\t$rawdata['description'] = $matches[1];\n\t\t}\n\n\t\t$data = array(\n\t\t\t'name' => $rawdata['description'],\n\t\t\t'donereward' => $matches[2] ?? 0,\n\t\t\t'priority' => $rawdata['priority'],\n\t\t\t'duedate' => $rawdata['datetime'],\n\t\t\t'user' => $this->user\n\t\t);\n\n\t\t$task = $this->di_repo->new(TaskModel::class, $data);\n\n\t\tif (($validResult = $task->valid()) === true) {\n\t\t\tif (!$task->save()) {\n\t\t\t\tthrow new RuntimeException('Could not save new task valid?:'.var_export($task->valid(), true));\n\t\t\t}\n\n\t\t\t$this->view->set('errors', false);\n\t\t} else {\n\t\t\t$this->view->set('errors', $validResult->getAll());\n\t\t}\n\n\t\t$this->respondTo('json');\n\t}", "public function create()\n {\n //TODO\n }", "public function actionCreate()\n {\n $model = new QuestionReported();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function issue()\n {\n return Issue::i();\n }", "private function _add_issues( $project, $repo_name, $milestones, $gitlab_repo_name ) {\n\n\t\t$this->_write_log( PHP_EOL . sprintf( 'Creating Issue(s) for %s', $repo_name ) );\n\n\t\t$github = new Github();\n\t\t$issues = $this->_get_issues( $project );\n\t\t$issue_map_old = array_column( $issues, 'iid' );\n\t\t$issue_map_temp = [];\n\t\t$issue_status_data = [];\n\n\t\t$count = 1;\n\n\t\tforeach ( $issue_map_old as $id ) {\n\n\t\t\t$issue_map_temp[ $id ] = $count++;\n\n\t\t}\n\n\t\t// comment function that calls api to avoid hitting rate limit.\n\t\t//$users = $this->user->get_user_map();\n\n\t\t// get user map from csv for creating issues etc.\n\t\t$users = $this->user->get_user_map_from_csv();\n\n\t\tforeach ( $issues as $issue ) {\n\n\t\t\t// Store response of api and extra details for issue import.\n\t\t\t$issue_status_data[] = $github->create_issue( $issue, $repo_name, $gitlab_repo_name, $users, $milestones, $issue_map_temp );\n\n\t\t}\n\n\t\t// Get final issue map after checking / re-importing issues.\n\t\t$issue_map = $github->check_status_and_process( $issue_status_data );\n\n\t\t$this->_write_log( sprintf( 'Total %1$s Issue(s) created for %2$s', count( $issues ), $repo_name ) );\n\n\t\treturn $issue_map;\n\n\t}", "public function createNew() {\n\t}", "public function actionCreate()\n {\n $model = new Requirement();\n\n $defaultProjectId = UserOption::getOption(UserOption::NAME_ACTIVE_PROJECT);\n if ($defaultProjectId) {\n $model->projectId = $defaultProjectId;\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function storeOrUpdate(Issue $issue = null)\n {\n $data = request()->validate([\n 'name' => 'required|string|max:255',\n ]);\n\n if ($issue) {\n $issue->update($data);\n\n return redirect()->route('admin.issues.index')->with([\n 'alertType' => 'success',\n 'alertMessage' => 'Le problème a bien été édité.',\n ]);\n }\n\n Issue::create($data);\n\n return redirect()->route('admin.issues.index')->with([\n 'alertType' => 'success',\n 'alertMessage' => 'Le nouveau problème a bien été ajouté.',\n ]);\n }", "public function create() {\n //\n }", "public function store(Request $request, $project_id)\n {\n //set validations rules\n $this->validate($request, [\n 'new_work_item_title' => 'required',\n 'new_work_item_description' => 'required',\n 'new_work_item_estimated_time' => 'required',\n 'new_work_item_type' => 'required',\n 'new_work_item_priority' => 'required',\n ]);\n\n if ($request->input('new_work_item_assigned_user') != '') {\n $assingedUser = User::findOrFail($request->input('new_work_item_assigned_user'));\n } else {\n $assingedUser = null;\n }\n\n if ($request->input('new_work_item_parent') != '') {\n $parentId = $request->input('new_work_item_parent');\n } else {\n $parentId = null;\n }\n\n // Saving data inputted\n $workitem = WorkItem::create([\n 'title' => $request->input('new_work_item_title'),\n 'description' => $request->input('new_work_item_description'),\n 'estimated_time' => $request->input('new_work_item_estimated_time'),\n 'type' => $request->input('new_work_item_type'),\n 'priority' => $request->input('new_work_item_priority'),\n 'user_id' => Auth::user()->id,\n 'project_id' => $project_id,\n 'assigned_user_id' => $assingedUser ? $assingedUser->id : null,\n 'parent_id' => $parentId,\n ]);\n\n //get project\n $project = Project::findOrFail($project_id);\n\n // Check if work item has assigned user\n if (!is_null($assingedUser) && !Auth::user()->is($assingedUser)) {\n // Notify User.\n $assingedUser->notify(\n new AssignWorkItemToMember(Auth::user(), $project, $workitem)\n );\n }\n\n // Check if user is not project owner\n if (!Auth::user()->is($project->owner)) {\n $project->owner->notify(\n new WorkItemCreated(Auth::user(), $project, $workitem)\n );\n }\n\n // Go to Single work item Created.\n return redirect(route('work-items.show', ['id' => $workitem->id, 'project_id' => $project_id]))->with([\n 'success_message' => 'The work item was successfully created.'\n ]);\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create()\n {\n //\n }", "public function create()\n {\n throw new Exception('Not yet implemented');\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n \n //\n }", "public function createAction(){\n \n $this->_form->customSubmitBtn = $this->xhr;\n $this->_form->build( $this->uri,\n $this->consumer_id,\n $this->user_id,\n $this->id);\n \n \n \n $this->result = Main_Forms_Handler::onPost($this->_form ,\n $this->post,\n $this->_model,\n \"createNote\",\n $this->params,\n $this->_helper,\n $this->indexAction . $this->consumer_id,\n \"Note created.\",\n $this->xhr); \n \n $this->_onSubmit();\n\n }", "public function create() {\r\n //\r\n }", "public function create()\r\n\t{\r\n\t\t//\r\n\t}", "public function create(\\FanFerret\\QuestionBundle\\Entity\\Question $question);", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }" ]
[ "0.7497412", "0.71835065", "0.6654536", "0.65584433", "0.65296596", "0.64862573", "0.6470389", "0.6430089", "0.63946193", "0.6385254", "0.6377761", "0.6332548", "0.6204228", "0.61395395", "0.61062", "0.6059672", "0.6041962", "0.59955794", "0.59887075", "0.5939525", "0.5891853", "0.5804647", "0.5762135", "0.57559973", "0.57516646", "0.5673952", "0.5665391", "0.56552625", "0.5633131", "0.56302446", "0.56270486", "0.5624058", "0.5623673", "0.5613916", "0.55931306", "0.5590303", "0.5580579", "0.55786484", "0.55768704", "0.55738974", "0.55738974", "0.55738974", "0.55738974", "0.5569305", "0.5569305", "0.55667585", "0.5557234", "0.554673", "0.554673", "0.554673", "0.5542106", "0.55420905", "0.55317944", "0.5529301", "0.55267423", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553", "0.5526553" ]
0.7469697
1
Get a specific issue by it's id
public function getIssueById( $id ) { return $this->issue->with('stage')->find($id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find($id)\n {\n return Issue::find($id);\n }", "function getNewsletterIssue($id){\n\t$issue = \"\";\n\t$issue = data_newsletterIssue($id);\n\treturn $issue;\n}", "public function get()\n {\n return $this->apiSearch($this->endpoint, ['class' => 'Managed\\Issue', 'parameters' => ['id']]);\n }", "public function fetchIssue()\n {\n $this->_oIssue = AM_Model_Db_Table_Abstract::factory('issue')->findOneBy('id', $this->issue);\n\n if (is_null($this->_oIssue)) {\n throw new AM_Model_Db_Exception(sprintf('Static pdf \"%s\" has no issue', $this->id));\n }\n\n return $this->_oIssue;\n }", "public function GetIssue($c)\n {\n global $db;\n $id = (isset($c['comic_id']) ? $c['comic_id'] : $c);\n\n if (!isset($this->issues[$id]))\n $this->issues[$id] = new Issue(isset($c['name']) ? $c['name'] : $db->GetValue(\"select name from comics where comic_id = {$id}\", 'name'));\n\n return $this->issues[$id];\n }", "public function get_by_id($id) {\n $this->db->select('*');\n $this->db->from(\"violations\");\n $this->db->where('id', $id);\n\n $query = $this->db->get();\n\n return $query->row();\n }", "public function get($id = null) { \r\n $this->db->select()->from('book_issues');\r\n if ($id != null) {\r\n $this->db->where('book_issues.id', $id);\r\n } else {\r\n $this->db->order_by('book_issues.id');\r\n }\r\n\t\t$this->db->where('book_issues.school_id', $this->school_id);\r\n $query = $this->db->get();\r\n if ($id != null) {\r\n return $query->row_array(); \r\n } else {\r\n return $query->result_array(); \r\n }\r\n }", "public function lookupIssue($issueId, $request) {\n\n $uri = sprintf('/issues/%d.json', $issueId);\n $ticket = $this->_sendRequest($uri, $request);\n\n if (!$ticket || !isset($ticket->issue)) {\n return;\n }\n\n $this->_showTicket($ticket->issue, $request);\n }", "function get_by_id($id){\n $id = (int)$id; //this is typecasting - if on the off chance a string got in here instead of a number, it will force it to be a number (SQL injection prevention), stored in $id\n $sql = \"SELECT * FROM runlogs WHERE id = '$id'\"; //change from users to projects for this case if copied from users\n\n $runlog = $this->select($sql)[0]; //sql only brings back one from database, so we need to put a number\n\n return $runlog; //brings it back\n }", "public function get($id)\n {\n return JournalEntry::currentReport()->findOrFail($id);\n }", "public function fetchIssueDetails($issueId) {\n $endpoint = \"issues/\" . intval($issueId);\n return $this->apiClient->get($endpoint);\n }", "public function edit($id)\n\t{\n\t\t$issue = Issue::find($id);\n\t\tif ($issue == NULL) {\n\t\t\treturn 'ID buku invalid';\n\t\t}\n\n\t\t$book = Books::find($issue->book_id);\n\n\t\t$issue->book_name = $book->title;\n\t\t$issue->author = $book->author;\n\n\t\t$issue->category = Categories::find($book->category_id)\n\t\t\t->category;\n\n\t\t$issue->available_status = (bool)$issue->available_status;\n\t\tif ($issue->available_status == 1) {\n\t\t\treturn $issue;\n\t\t}\n\n\t\t$conditions = array(\n\t\t\t'return_time'\t=> 0,\n\t\t\t'book_issue_id'\t=> $id,\n\t\t);\n\t\t$book_issue_log = Logs::where($conditions)\n\t\t\t->take(1)\n\t\t\t->get();\n\n\t\tforeach ($book_issue_log as $log) {\n\t\t\t$student_id = $log->student_id;\n\t\t}\n\n\t\t$student_data = Student::find($student_id);\n\n\t\tunset($student_data->email_id);\n\t\tunset($student_data->books_issued);\n\t\tunset($student_data->approved);\n\t\tunset($student_data->rejected);\n\n\t\t$student_branch = Branch::find($student_data->branch)\n\t\t\t->branch;\n\t\t$roll_num = $student_data->roll_num . '/' . $student_branch . '/' . substr($student_data->year, 2, 4);\n\n\t\tunset($student_data->roll_num);\n\t\tunset($student_data->branch);\n\t\tunset($student_data->year);\n\n\t\t$student_data->roll_num = $roll_num;\n\n\t\t$student_data->category = StudentCategories::find($student_data->category)\n\t\t\t->category;\n\t\t$issue->student = $student_data;\n\n\n\t\treturn $issue;\n\t}", "public function get($issueIdOrKey, $paramArray = [], $issueObject = null): Issue\n {\n $issueObject = ($issueObject) ? $issueObject : new Issue();\n\n $ret = $this->exec($this->uri.'/'.$issueIdOrKey.$this->toHttpQueryParameter($paramArray), null);\n\n $this->log->info(\"Result=\\n\".$ret);\n\n return $issue = $this->json_mapper->map(\n json_decode($ret),\n $issueObject\n );\n }", "public function getIssue($id, $query = array())\n {\n $response = $this->client->get(\"/issue/$id\", $query);\n\n return new Issue($response);\n\n }", "public function getOne($id)\n {\n return $this->repository->find($id);\n }", "public function getById( $id );", "public function get($id) {\r\n\treturn $this->getRepository()->find($id);\r\n }", "public function getItem($id)\n {\n return $this->where('id', $id)->first();\n }", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n $this->db->join('tbl_disciplines', 'tbl_items.id_disciplines = tbl_disciplines.id_discipline');\n $this->db->join('tbl_projects', 'tbl_items.id_projects = tbl_projects.id_project');\n return $this->db->get($this->table)->row();\n }", "public function getById(int $id);", "public function getTicketDetailsById() {\n if (func_num_args() > 0):\n $tid = func_get_arg(0);\n $select = $this->select()\n ->from($this)\n ->where('ticket_id=?', $tid);\n $result = $this->getAdapter()->fetchRow($select);\n\n if ($result) :\n return $result;\n endif;\n else:\n throw new Exception('Argument Not Passed');\n endif;\n }", "public function getById($id)\n {\n return self::where('id', (int) $id)->first();\n }", "public function show($id = 0)\n {\n return view('issue::issue.detail', ['issue' => Issue::find($id), 'users' => User::getAll(PHP_INT_MAX), 'rentals' => Rental::getAll(null, PHP_INT_MAX)]);\n }", "public function issue()\n {\n return $this->belongsTo(Issue::class);\n }", "public function getById(string $id);", "public function retrieveIssue(Issue $issue)\n {\n\n $projectKey = $issue->getProject();\n\n /** @var \\helper_plugin_issuelinks_db $db */\n $db = plugin_load('helper', 'issuelinks_db');\n $webhooks = $db->getWebhooks('jira');\n $allowedRepos = explode(',', $webhooks[0]['repository_id']);\n\n if (!in_array($projectKey, $allowedRepos, true)) {\n// Jira Projects must be enabled as Webhook for on-demand fetching\n return;\n }\n\n\n $issueNumber = $issue->getKey();\n $endpoint = \"/rest/api/2/issue/$projectKey-$issueNumber\";\n\n $issueData = $this->makeJiraRequest($endpoint, [], 'GET');\n $this->setIssueData($issue, $issueData);\n }", "public function byId($id)\n\t{\n\t\treturn $this->find('id', $id)->first();\n\t}", "function get_by_id($id)\n {\n $this->db2->where($this->id, $id);\n return $this->db2->get($this->table)->row();\n }", "public function getOne($id) {\n\n }", "public function getById($id) {\n return $this->getBy(id, \"id\");\n }", "private function getQuestion($id){\n $q = new Question();\n return $q->find($id);\n }", "public function getById() {}", "function getIssueID($text) {\n preg_match(\"#IC-[0-9]+#\", $text, $matches);\n if (!empty($matches)) {\n return $matches[0];\n }\n return NULL;\n}", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function getHistory($id){\n\t\t$myissues = Issues::find_by_sql(\"SELECT * FROM issues WHERE issue_mem_id=\".$id);\n\t\treturn $myissues;\n\t}", "public function get_one($id)\n {\n }", "public function getOne($id)\n {\n return $this->find(\"id\", $id);\n }", "public function get(string $id);", "function getBugByID ($bug_id)\n {\n return DBUtil::selectObjectByID ('mantis_bug_table', $bug_id);\n }", "protected function findModel($id)\n {\n if (($model = LibraryMagazineIssue::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public static function getById($id)\n {\n return self::where('id', $id)->first();\n }", "function get(string $id);", "public function findById($id) {\n \treturn $this->find($id)->current();\n }", "public function get( $id ){}", "public function findOrThrowException($id);", "public function findOrThrowException($id);", "function getProject($id = 0)\n {\n $this->db->where('Id',$id);\n $sql = $this->db->get('projectdetails');\n return $sql->row();\n }", "abstract public function getById($id);", "abstract public function getById($id);", "public function get( $id );", "function get_by_id($id)\r\n {\r\n $this->db->where($this->id, $id);\r\n return $this->db->get($this->table)->row();\r\n }", "public function getIssue($issueKey)\n {\n return $this->client->get('/rest/api/2/issue/'. urlencode($issueKey));\n }", "function get( $id=-1 )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n \r\n if ( $id != \"\" )\r\n {\r\n $db->array_query( $priority_array, \"SELECT * FROM eZBug_Priority WHERE ID='$id'\" );\r\n if ( count( $priority_array ) > 1 )\r\n {\r\n die( \"Error: Priority's with the same ID was found in the database. This shouldent happen.\" );\r\n }\r\n else if ( count( $priority_array ) == 1 )\r\n {\r\n $this->ID = $priority_array[0][ $db->fieldName( \"ID\" ) ];\r\n $this->Name = $priority_array[0][ $db->fieldName( \"Name\" ) ];\r\n }\r\n }\r\n }", "function findNoteById($id);", "public abstract function getById($id);", "public function show($username, $repository, $id)\n {\n return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id);\n }", "public function issue()\n {\n return $this->belongsToMany('App\\Issue')->first();\n }", "public function getByID($id)\n {\n return $this->model->findOrFail($id);\n }", "public function show(Issue $issue)\n {\n //\n }", "public function getMissionIssues($id = null) {\n\t\treturn $this->MissionIssue->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'MissionIssue.mission_id' => $id\n\t\t\t)\n\t\t));\n\t}", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }" ]
[ "0.8071597", "0.7012111", "0.68616325", "0.6636876", "0.6509536", "0.63574904", "0.6351253", "0.63005114", "0.62704486", "0.6223833", "0.6204687", "0.6177307", "0.61651725", "0.61630154", "0.6119312", "0.6079296", "0.6062684", "0.6031616", "0.6028899", "0.6028899", "0.6028899", "0.6028899", "0.6028899", "0.6028899", "0.6028899", "0.6028899", "0.6028899", "0.6028899", "0.6028899", "0.6028899", "0.6028899", "0.6028899", "0.6028899", "0.60240805", "0.60160106", "0.60100657", "0.60023475", "0.5996946", "0.5996261", "0.5983432", "0.5963685", "0.5963672", "0.5952489", "0.59449655", "0.59431994", "0.5940011", "0.59307486", "0.59139794", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59075177", "0.59071106", "0.5904744", "0.5900463", "0.58992344", "0.5886645", "0.58745444", "0.58703977", "0.5853213", "0.5849813", "0.5843279", "0.58428156", "0.58428156", "0.5838909", "0.58373", "0.58373", "0.58371806", "0.5836864", "0.5827997", "0.58249664", "0.58009", "0.57960916", "0.57869554", "0.5778031", "0.5772922", "0.5772615", "0.57724345", "0.5769499", "0.5769499", "0.5769499", "0.5769499", "0.5769499", "0.5769499" ]
0.7509371
1
Create issue from external sources
public function createIssueFromExternal( $data ) { // TODO: Implement createIssueFromExternal() method. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create($project, CreateIssueRequest $request)\n {\n $issue = new Issue();\n $issue->hidden \t = $request->has('hidden');\n $issue->author_id = Auth::user()->id;\n $issue->project_id = $project->id;\n $issue->summary = $request->summary;\n $issue->priority = 'Medium';\n $issue->version\t\t= $project->current_version;\n $issue->reference = $request->reference;\n $issue->description = $request->description;\n\n if($request->assigned == '1') {\n $groupid = Group::where('name', '=', 'Client')->first()->id;\n $issue->status = 'Awaiting Client';\n $issue->assigned_to_id = $groupid;\n } else {\n $groupid = Group::where('name', '=', 'Sponge UK')->first()->id;\n $issue->status = 'New';\n $issue->assigned_to_id = $groupid;\n }\n $result = $issue->save();\n\n if($request->file('attachment')) {\n $attachment = $request->file('attachment');\n $file = array(\n \"filename\" => $attachment->getClientOriginalName(),\n \"extension\" => $attachment->getClientOriginalExtension(),\n \"filetype\" => $attachment->getMimeType()\n );\n $attachment->move(\"uploads/tmp\", $file['filename']);\n $this->dispatch(new AddAttachmentCommand($file, $issue->id, Auth::user()->id));\n }\n\n if($result) {\n $update = new IssueHistory();\n $update->hidden = false;\n $update->project_id = $issue->project->id;\n $update->issue_id = $issue->id;\n $update->author_id = $issue->author->id;\n $update->type = 'status';\n $update->status = 'created';\n $update->comment = 'Amendment was created';\n $update->save();\n }\n\n return $issue->id;\n }", "public function __construct(Issue $issue)\n {\n $this->issue = $issue;\n }", "public function createSource();", "public function createIssue( $data )\n\t{\n\t\t$this->issue->create([\n\t\t\t'name' => $data['name'],\n\t\t\t'slug' => $data['slug'],\n\t\t\t'description' => $data['description'],\n\t\t\t'product_id' => $data['productId'],\n\t\t\t'issue_stage_id' => 1,\n\t\t\t'issue_status' => 0\n\t\t]);\n\t}", "private function _create_merge_requests( $project, $repo_name, $milestones, $issues, $gitlab_repo_name ) {\n\n\t\t$this->_write_log( PHP_EOL . sprintf( 'Creating PR(s) for %s', $repo_name ) . PHP_EOL );\n\n\t\t$github = new Github();\n\t\t$pr_map = [];\n\t\t$issue_map = array_column( $issues, 'github_issue_id', 'gitlab_issue_id' );\n\n\t\t// comment function that calls api to avoid hitting rate limit.\n\t\t//$users = $this->user->get_user_map();\n\n\t\t// get user map from csv for creating issues etc.\n\t\t$users = $this->user->get_user_map_from_csv();\n\n\t\t$prs = $this->_get_merge_requests( $project );\n\n\t\tforeach ( $prs as $pr ) {\n\n\t\t\t$pr_map[] = $github->create_merge_request( $pr, $repo_name, $users, $milestones, $issue_map, $gitlab_repo_name );\n\n\t\t}\n\t\t$pr_map = array_filter( $pr_map );\n\n\t\t$this->_write_log( PHP_EOL . sprintf( 'Total %1$s PR(s) created for %2$s', count( $pr_map ), $repo_name ) . PHP_EOL );\n\n\t\treturn $pr_map;\n\n\t}", "protected function getIssues()\n\t{\n\t\t$rangeFrom = 0;\n\t\t$rangeTo = 0;\n\n\t\t// Limit issues to process\n\t\t$this->out('GH issues to process? [a]ll / [r]ange :', false);\n\n\t\t$resp = trim($this->in());\n\n\t\tif ($resp == 'r' || $resp == 'range')\n\t\t{\n\t\t\t// Get the first GitHub issue (from)\n\t\t\t$this->out('Enter the first GitHub issue ID to process (from) :', false);\n\t\t\t$rangeFrom = (int) trim($this->in());\n\n\t\t\t// Get the ending GitHub issue (to)\n\t\t\t$this->out('Enter the latest GitHub issue ID to process (to) :', false);\n\t\t\t$rangeTo = (int) trim($this->in());\n\t\t}\n\n\t\t$query = $this->db->getQuery(true);\n\n\t\t$query->select($this->db->quoteName(array('id', 'gh_id')));\n\t\t$query->from($this->db->quoteName('#__issues'));\n\t\t$query->where($this->db->quoteName('gh_id') . ' IS NOT NULL');\n\n\t\t// Issues range selected?\n\t\tif ($rangeTo != 0 && $rangeTo >= $rangeFrom)\n\t\t{\n\t\t\t$query->where($this->db->quoteName('gh_id') . ' >= ' . (int) $rangeFrom);\n\t\t\t$query->where($this->db->quoteName('gh_id') . ' <= ' . (int) $rangeTo);\n\t\t}\n\n\t\t$this->db->setQuery($query);\n\n\t\ttry\n\t\t{\n\t\t\t$this->issues = $this->db->loadObjectList();\n\t\t}\n\t\tcatch (RuntimeException $e)\n\t\t{\n\t\t\t$this->out('Error ' . $e->getCode() . ' - ' . $e->getMessage(), true);\n\t\t\t$this->close();\n\t\t}\n\t}", "public function get_issues() {\n \n $issues = [];\n \n $q = 'SELECT nid, title FROM {node_field_data} ';\n $q .= 'WHERE type = :t ';\n $q .= 'AND status = :s ';\n $q .= 'ORDER BY created DESC ';\n $args = [\n ':t' => 'issue',\n ':s' => 1\n ];\n \n $connection = \\Drupal::database();\n $result = $connection->query($q, $args);\n if ($result) {\n \n $am = \\Drupal::service('path.alias_manager');\n \n while ($row = $result->fetchAssoc()) {\n \n $d = [\n 'id' => $row['nid'],\n 'name' => $row['title'],\n 'url' => $am->getAliasByPath('/node/'.$row['nid'])\n ];\n $issues[$row['nid']] = $d;\n } \n }\n \n return $issues;\n \n }", "function fetchIssues($project, $statuses){\n\n // default project\n $project = (isset($project)) ? $project : 'DEVOPS' ;\n\n // default statuses to fetch\n $defaultStatuses = array(\n 'Backlog' => 'Backlog',\n 'In Progress' => 'In Progress',\n 'Done' => 'Done'\n );\n\n // default statuses\n $statuses = (isset($statuses)) ? $statuses : $defaultStatuses ;\n\n // initialize list of issues\n $list = [];\n\n // walk through statuses\n foreach ($statuses as $key => $status) {\n\n // define the JIRA JQL\n $jql = 'project = '.$project.' AND status = \"'.$status.'\" ORDER BY updated ASC';\n\n try {\n $issueService = new IssueService();\n\n // fetch issues\n $response = $issueService->search($jql);\n\n\n // issues walker\n foreach ($response->issues as $issue) {\n\n // get epic link\n if (isset($issue->fields->customFields['customfield_10008'])) {\n $jql = 'issue = '.$issue->fields->customFields['customfield_10008'];\n $issueService = new issueService();\n $response = $issueService->search($jql);\n $epicLink = $response->issues[0]->fields->summary;\n }\n\n // define details\n $issueDetails = array(\n \"key\" => $issue->key,\n \"summary\" => $issue->fields->summary,\n \"type\" => $issue->fields->issuetype->name,\n \"epiclink\" => $epicLink,\n // \"date\" => $issue->fields->duedate->format('Y-m-d H:i:s')\n );\n\n // push the issue details to the list\n $list[$status][] = $issueDetails;\n\n }\n\n } catch (JiraException $e) {\n $this->assertTrue(false, 'Query Failed : '.$e->getMessage());\n }\n }\n\n // return the list\n return $list;\n}", "public function toIssue($options = array())\r\n\t{\r\n $this->db->select(\"$this->table.id\")\r\n ->select(\"\r\n SUM(\r\n CASE\r\n WHEN t_approval.status = 1\r\n THEN 1\r\n ELSE 0\r\n END ) as sum_status,\r\n \", false)\r\n ->select(\"COUNT( t_approval.id ) as count_approval\", false)\r\n ->from($this->table)\r\n ->join('t_approval', \"t_approval.data_id = {$this->table}.id\")\r\n ->join('m_approval', \"m_approval.id = t_approval.m_approval_id\")\r\n ->where('m_approval.module_kode', $this::module_kode)\r\n ->where(\"$this->table.issued\", 0)\r\n ->group_by(\"$this->table.id\")\r\n ->having(\"sum_status > 0\")\r\n ->having(\"count_approval > 0\")\r\n ->having(\"sum_status >= count_approval\");\r\n $inner_sql = $this->db->get_compiled_select();\r\n\r\n $this->db->reset_query();\r\n\r\n\t\tif (isset($options['limit'])) {\r\n\t $this->db->limit($options['limit']);\r\n\t }\r\n\r\n\t if (isset($options['offset'])) {\r\n\t $this->db->offset($options['offset']);\r\n\t }\r\n\r\n\t if (isset($options['orderBy'])) {\r\n\t $this->db->order_by($options['orderBy']);\r\n\t }\r\n\r\n $res = $this->db->select(\"source.*\")\r\n ->from(\"$this->table as source\")\r\n ->join('( '.$inner_sql.' ) as selected', 'source.id = selected.id', '', false)\r\n\t\t\t->get();\r\n\r\n if (isset($options['resource']) && $options['resource'] == true) {\r\n return $res;\r\n }\r\n\r\n return $res->result();\r\n\t}", "function create( $summary, $details, $assigned_to=100, $priority=3, $extra_fields=array(), $importData = array()) {\n\t\t//\n\t\t//\tmake sure this person has permission to add artifacts\n\t\t//\n\n\t\t//\n\t\t//\tget the user_id\n\t\t//\n\t\tif(array_key_exists('user', $importData)){\n\t\t\t\t$user = $importData['user'];\n\t\t} else {\n\t\t\tif (!forge_check_perm ('tracker',$this->ArtifactType->getID(),'submit')) {\n\t\t\t\t\t$this->setError(_('You are not currently allowed to submit items to this tracker.'));\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (session_loggedin()) {\n\t\t\t\t$user=user_getid();\n\t\t\t} else {\n\t\t\t\t$user=100;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t//\tdata validation\n\t\t//\n\t\tif (!$summary) {\n\t\t\t$this->setError(_('Message Summary Is Required'));\n\t\t\treturn false;\n\t\t}\n\t\tif (!$details) {\n\t\t\t$this->setError(_('Message Body Is Required'));\n\t\t\treturn false;\n\t\t}\n\t\tif (!$assigned_to) {\n\t\t\t$assigned_to=100;\n\t\t}\n\t\tif (!$priority) {\n\t\t\t$priority=3;\n\t\t}\n\t\t$status_id=1;\t\t// on creation, status is set to \"open\"\n\n\t\t//\n\t\t//\tThey may be using an extra field \"status\" box so we have to remap\n\t\t//\tthe status_id based on the extra field - this keeps the counters\n\t\t//\taccurate\n\t\t//\n\t\t$status_id = $this->ArtifactType->remapStatus($status_id,$extra_fields);\n\t\tif (!$status_id) {\n\t\t\t$this->setError($this->ArtifactType->getErrorMessage());\n\t\t\treturn false;\n\t\t}\n\n\t\tdb_begin();\n\t\tif (array_key_exists('time',$importData)){\n\t\t\t$time = $importData['time'];\n\t\t} else {\n\t\t\t$time = time();\n\t\t}\n\t\t$res = db_query_params ('INSERT INTO artifact\n\t\t\t(group_artifact_id,status_id,priority,\n\t\t\tsubmitted_by,assigned_to,open_date,summary,details)\n\t\t\tVALUES ($1,$2,$3,$4,$5,$6,$7,$8)',\n\t\t\t\t\tarray ($this->ArtifactType->getID(),\n\t\t\t\t\t $status_id,\n\t\t\t\t\t $priority,\n\t\t\t\t\t $user,\n\t\t\t\t\t $assigned_to,\n\t\t\t\t\t $time,\n\t\t\t\t\t htmlspecialchars($summary),\n\t\t\t\t\t htmlspecialchars($details))) ;\n\t\tif (!$res) {\n\t\t\t$this->setError(db_error());\n\t\t\tdb_rollback();\n\t\t\treturn false;\n\t\t}\n\n\t\t$artifact_id=db_insertid($res,'artifact','artifact_id');\n\n\t\tif (!$res || !$artifact_id) {\n\t\t\t$this->setError(db_error());\n\t\t\tdb_rollback();\n\t\t\treturn false;\n\t\t} else {\n\t\t\t//\n\t\t\t//\tNow set up our internal data structures\n\t\t\t//\n\t\t\tif (!$this->fetchData($artifact_id)) {\n\t\t\t\tdb_rollback();\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t// the changes to the extra fields will be logged in this array.\n\t\t\t\t// (we won't use it however)\n\t\t\t\t$extra_field_changes = array();\n\t\t\t\tif (!$this->updateExtraFields($extra_fields,$extra_field_changes)) {\n\t\t\t\t\tdb_rollback();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//\n\t\t\t//\tnow send an email if appropriate\n\t\t\t//\n\t\t\t$this->mailFollowupEx(0, 1);\n\t\t\tdb_commit();\n\n\t\t\treturn $artifact_id;\n\t\t}\n\t}", "private function _add_issues( $project, $repo_name, $milestones, $gitlab_repo_name ) {\n\n\t\t$this->_write_log( PHP_EOL . sprintf( 'Creating Issue(s) for %s', $repo_name ) );\n\n\t\t$github = new Github();\n\t\t$issues = $this->_get_issues( $project );\n\t\t$issue_map_old = array_column( $issues, 'iid' );\n\t\t$issue_map_temp = [];\n\t\t$issue_status_data = [];\n\n\t\t$count = 1;\n\n\t\tforeach ( $issue_map_old as $id ) {\n\n\t\t\t$issue_map_temp[ $id ] = $count++;\n\n\t\t}\n\n\t\t// comment function that calls api to avoid hitting rate limit.\n\t\t//$users = $this->user->get_user_map();\n\n\t\t// get user map from csv for creating issues etc.\n\t\t$users = $this->user->get_user_map_from_csv();\n\n\t\tforeach ( $issues as $issue ) {\n\n\t\t\t// Store response of api and extra details for issue import.\n\t\t\t$issue_status_data[] = $github->create_issue( $issue, $repo_name, $gitlab_repo_name, $users, $milestones, $issue_map_temp );\n\n\t\t}\n\n\t\t// Get final issue map after checking / re-importing issues.\n\t\t$issue_map = $github->check_status_and_process( $issue_status_data );\n\n\t\t$this->_write_log( sprintf( 'Total %1$s Issue(s) created for %2$s', count( $issues ), $repo_name ) );\n\n\t\treturn $issue_map;\n\n\t}", "private static function createSampleData()\n\t{\n\t\tself::createSampleObject(1, \"Issue 1\", 1);\n\t\tself::createSampleObject(2, \"Issue 2\", 1);\n\t}", "public function testCreateIssueMutation()\n {\n $query = file_get_contents(__DIR__ . '/Issue/Mutation/createIssueMutation.gql');\n $base64 =$this->getBase64ImageString();\n $headers = $this->getRandomUserHeaders();\n $variables = [\n \"title\" => \"创建一个问题\",\n \"background\" => \"HelloWorld\",\n ];\n\n $this->runGuestGQL($query, $variables, $headers);\n\n //创建戴图片的问题\n $variables = [\n \"title\" => \"创建一个问题\",\n \"background\" => \"HelloWorld\",\n 'cover_image'=>$base64\n ];\n\n $this->runGuestGQL($query, $variables, $headers);\n }", "public function test_it_should_throw_an_exception_on_invalid_url()\n {\n SourceFactory::create('unknown');\n }", "public function test_it_should_throw_an_exception_on_invalid_mapping()\n {\n SourceFactory::create('unknown://www.google.com');\n }", "function _project_issue_mailhandler($node, $result, $i, $header, $mailbox) {\n if ($node->type == 'project') {\n if (node_access('create', 'project_issue')) {\n $node->nid = preg_replace('/@.+/', '', $node->nid);\n\n if ($node->nid) {\n /*\n ** Base the new entry on the node it belongs to, this ensures all\n ** values are initially correct.\n */\n $entry = node_load(array('nid' => $node->nid, 'type' => 'project_issue'));\n }\n\n // Possible attributes\n $fields = array(\n 'pid' => t('Project'),\n 'category' => t('Category'),\n 'component' => t('Component'),\n 'priority' => t('Priority'),\n 'rid' => t('Version'),\n 'assigned' => t('Assigned to'),\n 'sid' => t('Status')\n );\n\n /*\n ** Only change the title if it doesn't have the old title in it.\n ** This should prevent the title from changing due to added\n ** prefixes. It may on occasion make false positives, but if\n ** a title change is that minor who cares?\n */\n $entry->title = (strpos($node->title, $entry->title)) ? $entry->title : $node->title;\n\n $entry->teaser = $node->teaser;\n $entry->body = $node->body;\n $entry->uid = $node->uid;\n\n foreach ($fields as $var => $text) {\n $text = strtolower(str_replace(' ', '_', $text));\n if (isset($node->project_issue[$text])) {\n $node->project_issue[$text] = trim($node->project_issue[$text]);\n switch ($var) {\n case 'pid':\n $project = node_load($node->project_issue[$text]);\n if ($project->nid) {\n $entry->project_issue['pid'] = $project->nid;\n }\n break;\n case 'category':\n if (($category = array_search($node->project_issue[$text], project_issue_category(0, 0)))) {\n $entry->project_issue['category'] = $category;\n }\n break;\n case 'priority':\n if (($priority = array_search($node->project_issue[$text], project_issue_priorities()))) {\n $entry->project_issue['priority'] = $priority;\n }\n break;\n case 'rid':\n if ($entry->project_issue['pid'] && ($nid = db_result(db_query(\"SELECT nid FROM {project_release_nodes} WHERE pid = %d AND version = '%s'\", $entry->project_issue['pid'], $node->project_issue[$text]), 0))) {\n $entry->project_issue['rid'] = $nid;\n }\n break;\n case 'assigned':\n if ($user = user_load(array('name' => $node->project_issue[$text]))) {\n $entry->project_issue['assigned'] = $user->uid;\n }\n break;\n case 'sid':\n if (($state = array_search($node->project_issue[$text], project_issue_state()))) {\n $entry->project_issue['sid'] = $state;\n }\n break;\n case 'component':\n if ($entry->project_issue['pid'] && ($project = node_load(array('nid' => $entry->project_issue['pid'], 'type' => 'project_project')))) {\n if ($project && in_array($node->project_issue[$text], $project->project_issue['components'])) {\n $entry->project_issue['component'] = $node->project_issue[$text];\n }\n }\n break;\n }\n }\n }\n\n if (empty($entry->nid)) {\n $entry->sid = variable_get('project_issue_default_state', 1);\n $entry->type = 'project_issue';\n $entry = node_validate($entry, $error);\n $error or ($entry->nid = node_save($entry));\n }\n else {\n $error = project_comment_validate($entry);\n $error or project_comment_save($entry);\n }\n }\n else {\n $error['user'] = t('You are not authorized to access this page.');\n }\n\n if ($error && $mailbox['replies']) {\n // Send the user his errors\n $mailto = mailhandler_get_fromaddress($header, $mailbox);\n $mailfrom = variable_get('site_mail', ini_get('sendmail_from'));\n $headers = array(\n 'X-Mailer' => 'Drupal Project module (http://drupal.org/project/project)',\n );\n\n $body = t('You had some errors in your submission:');\n foreach ($error as $field => $text) {\n $body .= \"\\n * $field: $text\";\n }\n\n drupal_mail('project_issue_mailhandler_error', $mailto, t('E-mail submission to !sn failed - !subj', array('!sn' => variable_get('site_name', 'Drupal'), '!subj' => $header->subject)), $body, $mailfrom, $headers);\n }\n\n // Return a NULL result so mailhandler doesn't save the node using the default methods.\n return NULL;\n }\n else {\n return $node;\n }\n}", "private function bulkInsert($issues): array\n {\n $data = json_encode(['issueUpdates' => $issues]);\n\n $this->log->info(\"Create Issues=\\n\".$data);\n $results = $this->exec($this->uri.'/bulk', $data, 'POST');\n\n $issues = [];\n foreach (json_decode($results)->issues as $result) {\n $issues[] = $this->getIssueFromJSON($result);\n }\n\n return $issues;\n }", "public function createPullRequest()\n {\n $username = urlencode(CLIENT_GITHUB_ACCOUNT);\n $password = urlencode(CLIENT_GITHUB_PASSWORD);\n\n $client = new Client();\n\n //Authentification to the client GitHub account\n $client->authenticate($username, $password);\n\n //Creates the pull request\n $pullRequest = $client->api('pull_request')->create(\n urlencode(TYPOLIB_GITHUB_ACCOUNT), $this->repo, [\n 'base' => 'master',\n 'head' => $this->repo . ':' . $this->branch,\n 'title' => $this->commit_msg,\n 'body' => '',\n ]);\n }", "function submitNewBug2Remine( $bugReport, $submitResult) {\n\t$myFile = \"_newBug.json\";\r\n\t$fh = fopen($myFile, 'w') or die(\"can't open file\");\n\t\n\t$description = '\\\\nOS: '.$bugReport['os'].'\\nCytoscape version: '.$bugReport['cyversion'].'\\\\n\\\\n'.$bugReport['description'];\n\t\n\tif ($submitResult != null){\n\t\t$description = $description.\"\\\\n\\\\n\\\\nAttached file is at \".$submitResult.\"\\\\n\\\\n\\\\n\";\n\t}\n\n\t$description = $description.'\\\\n\\\\n\\\\nReported by: '.$bugReport['name']; //.'\\nE-mail: '.$bugReport['email'];\r\n\t\t\n\t$json = \t\n\t\t\"{\r\n\t\t\t\t\\\"issue\\\": {\r\n\t\t\t\t\\\"project_id\\\": \\\"cytoscape3\\\",\r\n\t\t\t\t\\\"subject\\\": \\\"\".clean_unwanted_characters($bugReport['cysubject']).\"\\\",\r\n\t\t\t\t\\\"description\\\": \\\"\".clean_unwanted_characters($description).\"\\\"\r\n\t\t\t\t}\r\n\t\t}\";\t\n\t\n\t\t\n\tfwrite($fh, $json);\n\t\t\n\tfclose($fh);\n\t\n\t// submit the new bug to redmine (Cytosape bug tracker)\r\n\tsystem(\"./run_curl.sh > _reportOutput.txt\");\n}", "public function create()\n {\n $projects = $this->redmine->getProjects()->lists('name', 'id')->toArray();\n $users = $this->redmine->getUsers()->lists('mail', 'id')->toArray();\n $track = $this->redmine->getTrack()->lists('name', 'id')->toArray();\n\n return view('redmine.create-issue', compact('projects', 'users', 'track'));\n }", "public static function create_comment($input, $project, $issue)\n\t{\n\t\t$config_app = require path('public') . 'config.app.php';\n\t\tif (!isset($config_app['Percent'])) { $config_app['Percent'] = array (100,0,10,80,100); }\n\t\trequire \"tag.php\";\n\t\t$fill = array(\n\t\t\t'created_by' => \\Auth::user()->id,\n\t\t\t'project_id' => $project->id,\n\t\t\t'issue_id' => $issue->id,\n\t\t\t'comment' => $input['comment'],\n\t\t);\n\n\t\t$comment = new static;\n\t\t$comment->fill($fill);\n\t\t$comment->save();\n\n\t\t/* Add to user's activity log */\n\t\t\\User\\Activity::add(2, $project->id, $issue->id, $comment->id);\n\t\t$vide = true;\n\t\t$Val = ($input['Pourcentage'] > $config_app['Percent'][3]) ? 8: (($input['Pourcentage'] == 100 ) ? 2: 9);\n\t\tif(!empty($issue->tags)):\n\t\t\tforeach($issue->tags()->order_by('tag', 'ASC')->get() as $tag):\n\t\t\t\tif ($Val == $tag->id) { $vide = false; }\n\t\t\tendforeach;\n\t\tendif;\n\t\tif ($vide) { Tag::addNew_tags($issue->id, $Val); }\n\n\t\t/* Add attachments to issue */\n\t\t\\DB::table('projects_issues_attachments')->where('upload_token', '=', $input['token'])->where('uploaded_by', '=', \\Auth::user()->id)->update(array('issue_id' => $issue->id, 'comment_id' => $comment->id));\n\n\t\t/* Update the Todo state for this issue */\n\t\t//\\DB::table('users_todos')->where('issue_id', '=', $issue->id)->update(array('user_id' => \\Auth::user()->id, 'status' => (($input['Pourcentage'] > $config_app['Percent'][3]) ? 3: 2), 'weight' => $input['Pourcentage'], 'updated_at'=>date(\"Y-m-d H:m:s\")));\n\t\t\\DB::table('users_todos')->where('issue_id', '=', $issue->id)->update(array('status' => (($input['Pourcentage'] > $config_app['Percent'][3]) ? 3: 2), 'weight' => $input['Pourcentage'], 'updated_at'=>date(\"Y-m-d H:m:s\")));\n\n\t\t/* Update the status of this issue according to its percentage done; */\n\t\t\\DB::table('projects_issues')->where('id', '=', $issue->id)->update(array('closed_by' => (($input['Pourcentage'] == 100 ) ? \\Auth::user()->id : NULL), 'status' => (($input['Pourcentage'] == 100 )? 0 : 1),'status' => (($input['Pourcentage'] == 100 )? 0 : 1)));\n\n\t\t/*Update tags attached to this issue */\n\t\t$MesTags = explode(\",\", $input[\"MesTags\"]);\n\t\t$IDtags = array();\n\t\tforeach($MesTags as $val) {\n\t\t\tforeach(\\Tag::where('tag', '=', $val)->get(\"id\",\"tag\") as $activity) {\n\t\t\t\t$Idtags[] = $activity->id;\n\t\t\t}\n\t\t}\n\t\tif (isset($Idtags)) {\n\t\t$issue->tags()->sync($Idtags);\n\t\t$issue->save();\n\t\t}\n\n\t\t/* Update the project */\n\t\t$issue->updated_at = date('Y-m-d H:i:s');\n\t\t$issue->updated_by = \\Auth::user()->id;\n\t\t$issue->save();\n\t\tif ($input['Pourcentage'] == 100 ) {\n\t\t\t$tags = $issue->tags;\n\t\t\t$tag_ids = array();\n\t\t\tforeach($tags as $tag) { $tag_ids[$tag->id] = $tag->id; }\n\t\t\t$issue->closed_by = \\Auth::user()->id;\n\t\t\t$issue->closed_at = date('Y-m-d H:i:s');\n\n\t\t\t/* Update tags */\n\t\t\t$tag_ids[2] = 2;\n\t\t\tif(isset($tag_ids[1])) { unset($tag_ids[1]); }\n\t\t\tif(isset($tag_ids[8])) { unset($tag_ids[8]); }\n\t\t\tif(isset($tag_ids[9])) { unset($tag_ids[9]); }\n\n\t\t\t/* Add to activity log */\n\t\t\t\\User\\Activity::add(3, $issue->project_id, $issue->id);\n\t\t\t$issue->tags()->sync($tag_ids);\n\t\t\t$issue->status = 0;\n\t\t\t$issue->save();\n\t\t}\n\n\t\t/*Notifications by email to those who concern */\n\t\t$project = \\Project::current();\n\t\t$subject = sprintf(__('email.new_comment'), $issue->title, $project->name);\n\t\t$text = \\View::make('email.commented_issue', array(\n\t\t\t\t'actor' => \\Auth::user()->firstname . ' ' . \\Auth::user()->lastname,\n\t\t\t\t'project' => $project,\n\t\t\t\t'issue' => $issue,\n\t\t\t\t'comment' => $comment->comment\n\t\t\t));\n\n\t\t/* Notify the person to whom the issue is currently assigned, unless that person is the one making the comment */\n\t\tif($issue->assigned_to && $issue->assigned_to != \\Auth::user()->id && (!empty($issue->assigned->email))) {\n \t\t\t\\Mail::send_email($text, $issue->assigned->email, $subject);\n\t\t}\n\n\t\t/* Notify the person who created the issue, unless that person is the one making the comment */\n\t\tif($issue->created_by && $issue->created_by != \\Auth::user()->id && (!empty($issue->user->email))) {\n\t\t\t\\Mail::send_email($text, $issue->user->email, $subject);\n\t\t}\n\n\t\treturn $comment;\n\t}", "public function run()\n\t{\n\t\t$faker = Faker::create('fi_FI');\n\t\t$microlocations = DB::table('microlocations')->get();\n\t\t$companies = DB::table('company')->get();\n\t\t$type_amount = DB::table('issue_types')->count();\n\t\t$users = DB::table('users')->get();\n\t\n\t\tforeach (range(1,$microlocations->count()*3) as $index) {\n\t\t $ml = $microlocations->random();\n\t\t $type = rand(1,$type_amount);\n\t\t\tDB::table('inventory_issue')->insert([\n\t\t\t\t'issue_from_microlocation_id' => $ml->microlocation_id,\n\t\t\t\t'issue_to_microlocation_id' => ($type==1 ? $microlocations->filter(function ($value, $key) use ($ml) {return $value->microlocation_company_id == $ml->microlocation_company_id;})->random()->microlocation_id : NULL),\n\t\t\t\t'issue_to_company_id' => ($type==2 ? $companies->filter(function ($value, $key) use ($ml) {return $value->company_id != $ml->microlocation_company_id;})->random()->company_id : NULL),\n\t\t\t\t'issue_type_id' => $type,\n\t\t\t\t'issue_user_id' => $users->filter(function ($value, $key) use ($ml) {return $value->user_company_id == $ml->microlocation_company_id;})->random()->user_id,\n\t\t\t\t'issue_date' => $faker->dateTimeBetween($startDate = '-2 years', $endDate = 'now', $timezone = null),\n\t\t\t]);\n\t\t}\n\t}", "private function getIssues()\n {\n\n $issues = [];\n $total_issues = $this->totalIssues();\n if ($this->infos['errorBoolean']) {\n return 0;\n }\n if ($total_issues % 100 !== 0 ) {\n $total_int = intdiv($total_issues, 100) +1;\n }else {\n $total_int = $total_issues/100;\n }\n for ($i=0; $i < $total_int ; $i++) {\n $start = 100*$i;\n $max = 100*($i+1);\n $url = $this->base_uri.'search?jql=project='.$this->project.'&startAt='.$start.'&maxResults='.$max;\n $temp= $this->request($url);\n $issues[] = array(json_decode($temp));\n }\n\n return $issues;\n\n }", "function code_issue_find($code) {\n\t\t$issues = array();\n\t\tif (preg_match('/DEBUG/', $code)) {\n\t\t\t// http://book.cakephp.org/view/577/Configure\n\t\t\t$issues[] = \"configure::read('debug') constant found, need to switch to configure::read('debug')\";\n\t\t}\n\t\tif (preg_match('/->renderElement\\(/', $code)) {\n\t\t\t// http://book.cakephp.org/view/577/Configure\n\t\t\t$issues[] = \"->renderElement() needs to change to ->element()\";\n\t\t}\n\t\tif (preg_match('/->del\\(/', $code)) {\n\t\t\t// http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3\n\t\t\t$issues[] = \"->del() needs to change to ->delete()\";\n\t\t}\n\t\tif (preg_match('/->getReferrer\\(/', $code)) {\n\t\t\t// http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3\n\t\t\t$issues[] = \"->getReferrer() needs to change to ->getReferer()\";\n\t\t}\n\t\tif (preg_match('/->(mkdir|mv|ls|cp|rm)\\(/', $code)) {\n\t\t\t// http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3\n\t\t\t$issues[] = \"->(mkdir|mv|ls|cp|rm) needs to change to ->(create|move|read|copy|delete) Folder Methods\";\n\t\t}\n\t\tif (preg_match('/\\$(this->)?(H|h)tml->(input|hidden|value|label|checkbox)\\(/i', $code, $matches)) {\n\t\t\t// http://book.cakephp.org/view/578/HTML-Helper-to-Form-Helper\n\t\t\t$issues[] = \"Html helper migrated to Form helper\";\n\t\t}\n\t\tif (preg_match('/->generateList\\(/i', $code, $matches)) {\n\t\t\t// http://book.cakephp.org/view/580/Model-generateList\n\t\t\t$issues[] = \"generateList() needs to be migrated to find('list', array())\";\n\t\t}\n\t\tif (preg_match('/(VALID_EMAIL|VALID_NOT_EMPTY|VALID_NUMBER|PEAR|INFLECTIONS|CIPHER_SEED)/i', $code, $matches)) {\n\t\t\t// http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3\n\t\t\t$issues[] = \"Old Validation constants need to be updated (cakephp 1.3) \".json_encode($matches);\n\t\t}\n\t\treturn $issues;\n\t}", "private function _get_issues( $project ) {\n\n\t\tif ( ! empty( $project['_links']['issues'] ) ) {\n\n\t\t\t$issues_link = $project['_links']['issues'];\n\n\t\t\t$request = new Gitlab();\n\t\t\t$gitlab = $request->init_request();\n\n\t\t\t$issues = [];\n\t\t\t$page_index = 1;\n\t\t\t$total = 0;\n\n\t\t\tdo {\n\n\t\t\t\t$response = $gitlab->get( \"$issues_link?per_page=50&page=$page_index&sort=asc\" );\n\t\t\t\t$response_arr = json_decode( $response->body, true );\n\n\t\t\t\t$issues = array_merge( $issues, $response_arr );\n\n\t\t\t\t$page_index ++;\n\t\t\t\t$total += count( $response_arr );\n\n\t\t\t} while ( count( $response_arr ) > 0 );\n\n\t\t\treturn $issues;\n\n\t\t}\n\n\t}", "public function test_function_create_returns_an_instance_of_source_interface()\n {\n $actual = SourceFactory::create('file://some/local/file');\n $this->assertInstanceOf(SourceInterface::class, $actual);\n }", "public function fetchIssue()\n {\n $this->_oIssue = AM_Model_Db_Table_Abstract::factory('issue')->findOneBy('id', $this->issue);\n\n if (is_null($this->_oIssue)) {\n throw new AM_Model_Db_Exception(sprintf('Static pdf \"%s\" has no issue', $this->id));\n }\n\n return $this->_oIssue;\n }", "function _getPublishedIssues($issueIds, $context) {\n\t\t$publishedIssues = array();\n\t\t$issueDao = DAORegistry::getDAO('IssueDAO');\n\t\tforeach ($issueIds as $issueId) {\n\t\t\t$publishedIssue = $issueDao->getById($issueId, $context->getId());\n\t\t\tif ($publishedIssue) $publishedIssues[] = $publishedIssue;\n\t\t}\n\t\treturn $publishedIssues;\n\t}", "function project_issue_mail_format_entry($entry, $display_files, $is_original = FALSE) {\n static $history_count = 1;\n $hr = str_repeat('-', 72);\n $output = \"$hr\\n\";\n\n // Nodes and comments have different stamp fields.\n $timestamp = isset($entry->created) ? $entry->created : $entry->timestamp;\n\n if (!$is_original) {\n $output .= \"$entry->subject -- \";\n }\n\n $output .= format_date($timestamp, 'large') .\" : $entry->name\\n\";\n\n if (!$is_original) {\n $output .= url(\"node/$entry->nid\", array('fragment' => \"comment-$entry->cid\", 'absolute' => TRUE)) .\"\\n\";\n }\n\n $output .= project_issue_mail_format_attachments($entry, $display_files);\n\n // Must distinguish between nodes and comments -- here we do it\n // by looking for a revision ID.\n if (empty($entry->vid)) {\n $content = $entry->comment;\n }\n else {\n $content = $entry->body;\n }\n\n project_issue_mail_output($content, 1, $entry->format);\n\n if ($content) {\n $output .= \"\\n$content\";\n }\n return $output;\n}", "public function issue()\n {\n return Issue::i();\n }", "function getNewsletterIssue($id){\n\t$issue = \"\";\n\t$issue = data_newsletterIssue($id);\n\treturn $issue;\n}", "protected function buildIssuesUri(string ...$parts)\n {\n return UriBuilder::build('repositories', $this->workspace, $this->repo, 'issues', ...$parts);\n }", "public function prepareIssueSchema()\n {\n\n $schema = [\n 'title' => 'Field Configuration',\n 'type' => 'object',\n 'properties' => [\n 'editorcolumns' => [\n 'title' => $this->container->translations['chapter_config'.'keyvaluepairs'],\n 'propertyOrder' => 2,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => 'Row',\n 'properties' => [\n \"key\" => [\n 'type' => 'string',\n 'title' => $this->container->translations['chapter_config'.'keyvaluepairs'.'key'],\n ],\n \"value\" => [\n 'type' => 'string',\n 'title' => $this->container->translations['chapter_config'.'keyvaluepairs'.'value'],\n ]\n ]\n ]\n ],\n 'locale' => [\n 'title' => $this->container->translations['chapter_config'.'locale'],\n 'propertyOrder' => 1,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => 'Row',\n 'properties' => [\n \"language\" => [\n 'type' => 'string',\n 'title' => $this->container->translations['chapter_config'.'locale'.'language'],\n ],\n \"translation\" => [\n 'type' => 'string',\n 'title' => $this->container->translations['chapter_config'.'locale'.'translation'],\n ]\n ]\n ]\n ],\n 'referenced' => [\n 'type' => 'object',\n 'options' => [\n 'hidden' => 'true'\n ]\n ]\n ]\n ];\n\n return json_encode($schema);\n }", "function createIssue( $sessionID, $Header, $Status, $DateCreated, $Students, $Description, $watch, $Level, $Category ) {\r\n\t\tif( $this->userCanCreateIssue( $sessionID ) ) {\r\n\t\t\t$Creator = $_SESSION['userid'];\r\n\t\t\tif(empty($this->link)){\r\n\t\t\t\techo \"Not connected to database You must instantiate the DataAccessManager before performing\r\n\t\t\t\t\tdatabase accesses.\";\r\n\t\t\t\t\texit;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// begin hack to create ID number\r\n\t\t\t$IDs = array();\r\n\t\t\t$ID = date('m').date('d').date('Y').'-';\r\n\t\t\t$result = mysql_query(\"SELECT * FROM issues WHERE ID like '%$ID%'\");\r\n\t\t\tfor($i=0; $results = mysql_fetch_assoc($result); $i++){\r\n\t\t\t\t$IDs[$i] = $results['ID'];\r\n\t\t\t}\r\n\t\t\t$idnumber = mysql_num_rows($result) + 1;\r\n\t\t\twhile(in_array('I'.$ID.$idnumber, $IDs)){\r\n\t\t\t\t\t\t$idnumber++;\r\n\t\t\t}\r\n\t\t\t$ID ='I'.$ID.$idnumber;\r\n\t\t\t// end hack to create ID number\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$Header = htmlspecialchars($Header);\r\n\t\t\t$Header = addslashes($Header);\r\n\t\t\tif($Level == 1)\r\n\t\t\t\t$Level = 'A';\r\n\t\t\telse\r\n\t\t\t\t$Level = 'B';\r\n\t\t\t$query = \"insert into issues (id, header, creator, status, datecreated, Level, Category)\r\n\t\t\t\t values ('$ID', '$Header', '$Creator', '$Status', '$DateCreated', '$Level', '$Category')\";\r\n\t\t\t//echo $query; exit;\r\n\t\t\tmysql_query($query);\r\n\t\t\t$this->createContact($sessionID, $DateCreated, $Students, $Description, $ID, $watch);\r\n\t\t\treturn $ID; //Yay, it works!\r\n\t\t}\r\n\t\telse {\r\n\t\t\techo 'You do not have permission to create that issue.';\r\n\t\t\treturn false; //Oh no, failure!\r\n\t\t}\r\n\t}", "public function __construct($repo)\n {\n $this->code = \"WOSPM0015\";\n $this->title = \"GITHUB_LABELS\";\n $this->message = \"Project should have issue labels.\";\n $this->type = MetricType::ERROR;\n $this->dependency = array(\"WOSPM0003\");\n $this->repo = $repo;\n }", "public function create($username, $repository, array $params)\n {\n if (!isset($params['title'])) {\n throw new MissingArgumentException(['title']);\n }\n\n return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues', $params);\n }", "private function groupByVersions(Array $issues)\n {\n $versions = [];\n\n if (empty($issues))\n throw new InvalidArgumentException('Issues collection is empty'); \n\n foreach ($issues as $issue) { \n if (isset($issue['fields']['fixVersions']) \n && !empty($issue['fields']['fixVersions'])) \n { \n foreach ($issue['fields']['fixVersions'] as $version) { \n if ($this->isReleased($version)) { \n $key = $version['id']; \n $issueType = $issue['fields']['issuetype']['name'];\n\n if (! isset($versions[$key]['meta'])) \n $versions[$key]['meta'] = $this->getMetaData($version, $key); \n\n $versions[$key]['issuesByType'][$issueType][] = $issue;\n $versions[$key]['issues'][] = $issue;\n }\n }\n }\n } \n \n usort($versions, 'self::orderDesc'); \n\n return $versions;\n }", "public function createIssue($title, $body)\n {\n\n $lists = $this->manager->getBoard($this->boardId)->getLists();\n\n if (!empty($lists)) {\n $currentList = array_shift($lists);\n } else {\n return false;\n }\n\n $member = $this->manager->getMember('me')->getData();\n\n $card = $this->client->api('card')->create(array(\n 'name' => $title,\n 'desc' => $body,\n 'idList' => $currentList->getId(),\n 'idMembers' => $member['id'],\n ));\n\n return $card;\n }", "public function actionIssue() {\n $model = new LibraryMagazineIssue();\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n Yii::$app->db->createCommand(\"UPDATE library_magazine_subscription_master SET Magazine_Status = 3 WHERE Magazine_Subscription_Id = \" . $model->Magazine_Id)->execute();\n $model->save();\n return $this->redirect(['create']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function getIssues($filters = array())\n\t{\n\t\t$params \t = array();\n\t\t\n\t\t// Search title/description\n\t\t$searchQuery = isset($filters['query']) ? urldecode($filters['query']) : '';\n\t\t$searchQuerySQL = '';\n\t\t\n\t\tif ($searchQuery) {\n\t\t\t$searchQuerySQL \t\t= sprintf('AND (b.title \t\t LIKE :searchQuery \n\t\t\t\t\t\t\t\t\t\t\t OR b.description LIKE :searchQueryDesc)');\n\t\t\t$params[':searchQuery'] = sprintf('%%%s%%', $searchQuery); \n\t\t\t$params[':searchQueryDesc'] = sprintf('%%%s%%', $searchQuery); \n\t\t}\n\t\t\n\t\t// Status filter\n\t\t$status = isset($filters['status']) ? array_map('intval', $filters['status']) : array();\n\t\t$statusSQL = '';\n\t\tif ($status) {\n\t\t\t$tmp \t \t\t = array_map('intval', $status);\n\t\t\t$statusIDs \t\t = implode(',', $tmp);\n\t\t\t$statusSQL \t\t = sprintf('AND b.status IN(%s)', $statusIDs);\n\t\t}\n\t\t\n\t\t// Severity filter\n\t\t$severity = isset($filters['severity']) ? intval($filters['severity']) : 0;\n\t\t$severitySQL = '';\n\t\tif ($severity) {\n\t\t\t$severitySQL \t\t = 'AND b.severity = :severity';\n\t\t\t$params[':severity'] = $severity;\n\t\t}\n\t\t\n\t\t// Assigned filter\n\t\t$assigned = isset($filters['assigned']) ? intval($filters['assigned']) : 0;\n\t\t$assignedSQL = '';\n\t\tif ($assigned > 0 || $assigned === -1) {\n\t\t\t$assignedSQL \t\t = 'AND b.assigned_to = :assigned';\n\t\t\t$params[':assigned'] = $assigned;\n\t\t\t\n\t\t\t// Unassigned is set to -1\n\t\t\tif ($assigned === -1) {\n\t\t\t\t$assignedSQL = 'AND b.assigned_to IS NULL';\n\t\t\t\t\n\t\t\t\t// Won't be needing this then\n\t\t\t\tunset($params[':assigned']);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$params = array_filter($params);\n\t\t\n\t\t$q = sprintf(\"SELECT b.id,\n\t\t\t\t\t\t \t\tb.title,\n\t\t\t\t\t\t \t\tb.slug,\n\t\t\t\t\t\t \t\tb.description,\n\t\t\t\t\t\t\t\tsv.name AS severity,\n\t\t\t\t\t\t \t\tb.created_at AS createdAt,\n\t\t\t\t\t\t \t\tu.login AS openedByUserLogin,\n b.status AS statusID,\n\t\t\t\t\t\t \t\tbs.name AS statusName,\n\t\t\t\t\t\t \t\tbs.style_name AS statusStyleName,\n\t\t\t\t\t\t\t\tCOALESCE(ua.display_name, ua.login, 'Unassigned') AS assignedToUserLogin,\n\t\t\t\t\t\t\t\tb.assigned_to AS assignedToUserID\n\t\t\t\t\t\t FROM issue b\n\t\t\t\t\t\t INNER JOIN user \t\t u ON b.opened_by = u.id\n\t\t\t\t\t\t INNER JOIN issue_status bs ON b.status = bs.id \n\t\t\t\t\t\t INNER JOIN issue_severity sv ON sv.id \t\t = b.severity\n\t\t\t\t\t\t LEFT JOIN user \t\t ua ON b.assigned_to = ua.id\n\t\t\t\t\t\t WHERE 1=1 \n\t\t\t\t\t\t %s\n\t\t\t\t\t\t %s\n\t\t\t\t\t\t %s\n\t\t\t\t\t\t %s\n\t\t\t\t\t\t ORDER BY b.created_at DESC, b.updated_at DESC\",\n\t\t\t\t\t\t $statusSQL,\n\t\t\t\t\t\t $severitySQL,\n\t\t\t\t\t\t $assignedSQL,\n\t\t\t\t\t\t $searchQuerySQL);\n \n\t\treturn $this->db->fetchAll($q, $params);\n\t}", "public function createAction()\n {\n $issue = new Issue();\n $request = $this->getRequest();\n $form = $this->createForm(new IssueType(), $issue);\n $form->submit($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($issue);\n $em->flush();\n\n return $this->redirect($this->generateUrl('issue_show', array('id' => $issue->getId())));\n \n }\n\n return array(\n 'issue' => $issue,\n 'form' => $form->createView()\n );\n }", "public function addIssue(Issue $issues)\n {\n $this->issues[] = $issues;\n\n return $this;\n }", "public function store(Request $request)\n {\n if ($request->input('issues')) {\n $issues = $request->input('issues');\n foreach ($issues as $key => $issue) {\n $this->rules['issues.'.$key.'.subject'] = 'required';\n $this->rules['issues.'.$key.'.description'] = 'required';\n $this->rules['issues.'.$key.'.project_id'] = 'required|integer';\n $this->rules['issues.'.$key.'.estimated_hours'] = 'numeric';\n $this->rules['issues.'.$key.'.parent_issue_id'] = 'integer';\n\n $this->messages['issues.'.$key.'.subject.required'] = 'This field is required';\n $this->messages['issues.'.$key.'.description.required'] = 'This field is required';\n $this->messages['issues.'.$key.'.project_id.required'] = 'This field is required';\n\n $this->messages['issues.'.$key.'.project_id.integer'] = 'This feild must be number';\n $this->messages['issues.'.$key.'.parent_issue_id.integer'] = 'This feild must be number';\n $this->messages['issues.'.$key.'.estimated_hours.numeric'] = 'This feild must be numeric';\n }\n }\n\n $this->validate($request, $this->rules, $this->messages);\n\n if ($request->input('issues')) {\n $issues = $request->input('issues');\n foreach ($issues as $key => $issue) {\n $this->client->issue->create([\n 'project_id' => $issue['project_id'],\n 'subject' => $issue['subject'],\n 'description' => $issue['description'],\n 'assigned_to_id' => $issue['assigned_to_id'],\n 'parent_issue_id' => $issue['parent_issue_id'],\n 'start_date' => $issue['start_date'],\n 'due_date' => $issue['due_date'],\n 'estimated_hours' => $issue['estimated_hours'],\n 'tracker_id' => $issue['tracker_id'],\n ]);\n }\n }\n }", "public static function getProjectIssues($usr, $repo, $status, $since = null) {\n\n if(self::$TOKEN == null) {\n self::$TOKEN = self::requestAuth();\n }\n\n $repo = str_replace(\".git\", \"\", $repo);\n $issues_url = \"https://api.github.com/repos/\".$usr.\"/\".$repo.\"/issues?state=\".$status.\"&page=1&per_page=100\";\n if($since != null) {\n $issues_url = $issues_url . \"&since=\" . $since . \"T00:00:00Z\";\n }\n Makiavelo::info(\"Querying URL: \" . $issues_url);\n\n $data = self::sendRequest($issues_url);\n return $data;\n }", "function notifyEmailConvertedIntoIssue($prj_id, $issue_id, $sup_ids, $customer_id = FALSE)\n {\n $backend =& self::_getBackend($prj_id);\n return $backend->notifyEmailConvertedIntoIssue($issue_id, $sup_ids, $customer_id);\n }", "public function __construct() {\r\n parent::__construct();\r\n\r\n $this->team = array(\r\n new MigrateTeamMember('Devender Rana', '[email protected]', t('Product Owner')),\r\n new MigrateTeamMember('Saurabh Arya', '[email protected]', t('Implementor')),\r\n );\r\n\r\n\r\n $this->issuePattern = 'http://drupal.org/node/:id:';\r\n }", "private function getIssueNewAndResolve($issue)\n {\n $new = 0;\n $close = 0;\n foreach ($issue as $status) {\n $issueDateGroup = $status->getCreationDate();\n $new += 1;\n\n if ($status->isClosed()) {\n $close += 1;\n }\n }\n\n return [\n 'new' => $new,\n 'close' => $close,\n ];\n }", "protected function execute(InputInterface $input, OutputInterface $output) {\n $github = $this->getGithub();\n\n // Request all open issues in created order. 1st come 1st serve.\n $paginator = new Github\\ResultPager($github);\n $issues_api = $github->api('issue');\n $pull_requests = $paginator->fetchAll($issues_api, 'all', array($this->getConfigParameter('organization'), $this->getConfigParameter('repository'), array(\n 'state' => 'open',\n 'sort' => 'created',\n 'direction' => 'asc',\n )));\n\n // Get current branch or commit.\n $current_head = '';\n $process = new Process('git symbolic-ref --short HEAD');\n $process->run();\n if ($process->isSuccessful()) {\n $current_head = trim($process->getOutput());\n }\n else {\n $process = new Process('git rev-parse HEAD');\n $process->run();\n if ($process->isSuccessful()) {\n $current_head = trim($process->getOutput());\n }\n }\n\n $process = new Process('git checkout -B integration');\n $process->run();\n if (!$process->isSuccessful()) {\n throw new \\RuntimeException($process->getErrorOutput());\n }\n\n foreach ($pull_requests as $pr) {\n\n // If the issue is not a PR we skip it.\n if (empty($pr['pull_request']['patch_url'])) {\n continue;\n }\n\n // If this issue has any of the following labels, we also skip it.\n foreach ($pr['labels'] as $label) {\n // TODO: Have a function check this.\n if (in_array($label['name'], $this->invalid_labels)) {\n // This continue breaks us out of the top foreach.\n continue 2;\n }\n }\n\n // Now try to apply the patch or else mark it as failure.\n $url = $pr['pull_request']['html_url'];\n if ($input->getOption('am')) {\n $command = \"hub am --3way {$url}\";\n }\n else {\n $command = \"hub merge {$url}\";\n }\n $output->writeln(\"\\n\" . $command);\n $process = new Process($command);\n $process->run();\n if (!$process->isSuccessful()) {\n // We reset the failed AM & mark the PR as GITHUB_LABEL_MERGE_FAILED.\n $output->writeln(\"<error>Failed to applied PR# {$pr['number']}: {$url}.</error>\");\n $output->writeln($process->getOutput());\n if (!$input->getOption('no-label')) {\n $this->addGithubLabel($pr['number'], self::GITHUB_LABEL_MERGE_FAILED);\n $this->addGithubComment($pr['number'], implode('\\n\\n', array(\n 'I was unable to merge this Pull Request with the other open Pull Requests.',\n 'Perhaps the following log will assist your debugging…',\n '```sh',\n $process->getErrorOutput(),\n '```',\n )));\n }\n\n $process = new Process('git merge --abort');\n $process->run();\n }\n else {\n $output->writeln(\"<info>Successfully applied PR #{$pr['number']}: {$url}.</info>\");\n }\n }\n\n // Now we deploy integration to acquia always fresh.\n // We only do this if the --push flag is set.\n if ($input->getOption('push')) {\n $process = new Process('git push acquia integration --force');\n $process->run();\n if (!$process->isSuccessful()) {\n throw new \\RuntimeException($process->getErrorOutput());\n }\n $output->writeln(\"<info>Successfully Pushed integration branch to Acquia.</info>\");\n }\n\n // Return to the branch the user was previously on, if they were on one.\n if (!empty($current_head)) {\n $process = new Process(\"git checkout {$current_head}\");\n $process->run();\n }\n }", "public static function format($body)\n\t{\n\t\t$body = \\Sparkdown\\Markdown($body);\n\t\t// convert issue numbers into issue url\n\t\treturn preg_replace('/((?:' . __('tinyissue.issue') . ')?)(\\s*)#(\\d+)/i', '<a href=\"' . \\URL::to('/project/0/issue/$3') . '\" title=\"$1 #$3\" class=\"issue-link\">$1 #$3</a>', $body);\n\t}", "public function __construct($source = '');", "public function __construct($pathToSourceFile = '', $mime = null)\n {\n if(!file_exists($pathToSourceFile))\n {\n throw new Exception(\"$pathToSourceFile does not exist\");\n }\n \n if(!$mime)\n {\n throw new Exception(\"Mime type '$mime' is not valid\");\n }\n\n $this->pathToSourceFile = $pathToSourceFile;\n $this->type = $mime;\n \n $this->createWorkingImageResource($pathToSourceFile);\n }", "public function issuecreate(Repo $repo)\n {\n return view('repo.issue.create', ['repo' => $repo]);\n }", "public function createSubmission($sourceCode, $language, $input,\n $run=TRUE, $private=TRUE, $files=NULL, $params = NULL)\n {\n // Check language is valid and the user isn't attempting to set\n // files or execution parameters (since Ideone does not have such options).\n assert(in_array($language, $this->getLanguages()->languages));\n if ($files !== NULL && count($files) !== 0) {\n throw new moodle_exception(\"Ideone sandbox doesn't accept files\");\n }\n if($params !== NULL) {\n throw new moodle_exception(\n \"ideone sandbox doesn't accept parameters like cpu time or memory limit\");\n }\n $langId = $this->langMap[$language];\n $response = $this->client->createSubmission($this->user, $this->pass,\n $sourceCode, $langId, $input, $run, $private);\n $error = $response['error'];\n if ($error !== 'OK') {\n throw new moodle_exception(\"IdeoneSandbox::getSubmissionStatus: error ($error)\");\n }\n else {\n return (object) array('error'=>Sandbox::OK, 'link'=> $response['link']);\n }\n }", "function project_issue_mail_generate_followup_mail_body($node, $history, $display_files) {\n global $user;\n static $output_with_files = NULL, $output_without_files = NULL;\n\n // Return cached output if available.\n if ($display_files) {\n if (isset($output_with_files)) {\n return $output_with_files;\n }\n }\n else {\n if (isset($output_without_files)) {\n return $output_without_files;\n }\n }\n\n // Get most recent update.\n $entry = array_pop($history);\n\n $node->project_issue['updator'] = $entry->name ? $entry->name : $user->name;\n\n // Check if the latest entry is actually the initial issue.\n if (empty($history)) {\n $metadata_previous = new stdClass();\n // Have to get the metadata into the entry object.\n $metadata_entry = $entry->original_issue_metadata;\n $content = $entry->body;\n }\n else {\n $metadata_previous = end($history);\n // If the previous was the original issue, then we need to pull\n // out the metadata from project_issue.\n if (isset($metadata_previous->original_issue_metadata)) {\n $metadata_previous = $metadata_previous->original_issue_metadata;\n }\n $metadata_entry = $entry;\n $content = $entry->comment;\n }\n\n $fields = project_issue_field_labels('email');\n $comment_changes = project_issue_metadata_changes($node, $metadata_previous, $metadata_entry, $fields);\n\n // Since $node->name will always be the original issue author, and since\n // $node->project_issue['updator'] isn't a property of either $previous or\n // $entry, these two properties will never show up as being different when\n // project_issue_metadata_changes() is called, and therefore neither of\n // these will ever be elements of the $comment_changes array. Since we do\n // want them to be printed in issue emails, we just need to add their labels\n // back into the $comment_changes array here, so that\n // theme_project_issue_mail_summary_field() will know to print the data for\n // these two fields.\n $comment_changes['name'] = array(\n 'label' => $fields['name'],\n );\n $comment_changes['updator'] = array(\n 'label' => $fields['updator'],\n );\n\n $summary = theme('project_issue_mail_summary', $entry, $node, $comment_changes, $display_files);\n\n // Create main body content\n project_issue_mail_output($content, 1, $entry->format);\n $body = \"$content\\n$entry->name\\n\";\n\n $hr = str_repeat('-', 72);\n\n if (count($history)) {\n\n $body .= \"\\n\\n\";\n $body .= t('Original issue:') .\"\\n\";\n $body .= project_issue_mail_format_entry(array_shift($history), $display_files, TRUE);\n if (count($history)) {\n $body .= \"\\n\". t('Previous comments (!count):', array('!count' => count($history))) .\"\\n\";\n foreach ($history as $entry) {\n $body .= project_issue_mail_format_entry($entry, $display_files);\n }\n }\n }\n\n $output = \"$summary\\n$body\";\n\n // Set cached output.\n if ($display_files) {\n $output_with_files = $output;\n }\n else {\n $output_without_files = $output;\n }\n\n return $output;\n}", "protected function file_these(array $bugs_to_file, $form_input) {\n $success = array();\n $filing = array();\n foreach ($bugs_to_file as $bug_to_file) {\n try {\n $filing = Filing::factory($bug_to_file, $form_input, $this->bugzilla_client);\n $filing->file();\n $bug_link = sprintf(\"<a href=\\\"%s/show_bug.cgi?id=%d\\\" target=\\\"_blank\\\">bug %d</a>\",\n $this->bugzilla_client->config('bugzilla_url'),\n $filing->bug_id,\n $filing->bug_id\n );\n Client::messageSend(\n str_replace(\n array('{label}','{bug}'),\n array($filing->label, $bug_link),\n $filing->success_message),\n E_USER_NOTICE\n );\n $success[] = $filing->bug_id;\n } catch (Exception $e) {\n /**\n * Timed out session most likely\n */\n if($e->getCode()==Filing::EXCEPTION_AUTHENTICATION_FAILED) {\n client::messageSend('Authentication Failed, need to re-login', E_USER_ERROR);\n $this->request->redirect('authenticate/login');\n /**\n * either the supplied $submitted_data to the Filing instance\n * was missing or construct_content() method of the Filing\n * instance tried to access a submitted content key that did\n * not exist.\n */\n } else if($e->getCode()==Filing::EXCEPTION_MISSING_INPUT) {\n Kohana_Log::instance()->add('error',__METHOD__.\" {$e->getMessage()}\");\n Client::messageSend('Missing required input to build this Bug', E_USER_ERROR);\n /**\n * bug was constructed successfully but we got an error back\n * when we sent it to Bugzilla\n */\n } else if($e->getCode()==Filing::EXCEPTION_BUGZILLA_INTERACTION) {\n Kohana_Log::instance()->add('error',__METHOD__.\" {$e->getMessage()}\");\n Client::messageSend(\"There was an error communicating \"\n .\"with the Bugzilla server for Bug \\\"{$filing->label}\\\": {$e->getMessage()}\", E_USER_ERROR);\n /**\n * something happend, log it and toss it\n */\n } else {\n Kohana_Log::instance()->add('error',__METHOD__.\" {$e->getMessage()}\\n{$e->getTraceAsString()}\");\n Client::messageSend('Unknown exception when filing this bug', E_USER_ERROR);\n throw $e;\n }\n }\n }\n return $success;\n }", "public function create(\n Tracker_Artifact $artifact,\n array $fields_data,\n $comment,\n PFUser $submitter,\n $submitted_on,\n $send_notification,\n $comment_format\n ) {\n $this->changeset_dao->startTransaction();\n\n $comment = trim($comment);\n\n $email = null;\n if ($submitter->isAnonymous()) {\n $email = $submitter->getEmail();\n }\n\n try {\n $this->validateNewChangeset($artifact, $fields_data, $comment, $submitter, $email);\n $previous_changeset = $artifact->getLastChangeset();\n\n /*\n * Post actions were run by validateNewChangeset but they modified a\n * different set of $fields_data in the case of massChange or soap requests;\n * we run them again for the current $fields_data\n */\n $artifact->getWorkflow()->before($fields_data, $submitter, $artifact);\n\n $changeset_id = $this->changeset_dao->create($artifact->getId(), $submitter->getId(), $email, $submitted_on);\n if (! $changeset_id) {\n $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_artifact', 'unable_update'));\n $this->changeset_dao->rollBack();\n throw new Tracker_ChangesetNotCreatedException();\n }\n\n if (! $this->storeComment($artifact, $comment, $submitter, $submitted_on, $comment_format, $changeset_id)) {\n $this->changeset_dao->rollBack();\n throw new Tracker_CommentNotStoredException();\n }\n\n $this->storeFieldsValues($artifact, $previous_changeset, $fields_data, $submitter, $changeset_id);\n\n $new_changeset = new Tracker_Artifact_Changeset(\n $changeset_id,\n $artifact,\n $submitter->getId(),\n $submitted_on,\n $email\n );\n $artifact->addChangeset($new_changeset);\n\n $save_after_ok = $this->saveArtifactAfterNewChangeset(\n $artifact,\n $fields_data,\n $submitter,\n $new_changeset,\n $previous_changeset\n );\n\n if (! $save_after_ok) {\n $this->changeset_dao->rollBack();\n throw new Tracker_AfterSaveException();\n }\n\n $this->event_manager->processEvent(TRACKER_EVENT_ARTIFACT_POST_UPDATE, array('artifact' => $artifact));\n } catch (Tracker_NoChangeException $exception) {\n $collection = $this->source_of_association_collection_builder->getSourceOfAssociationCollection(\n $artifact,\n $fields_data\n );\n if (count($collection) > 0) {\n $collection->linkToArtifact($artifact, $submitter);\n return null;\n } else {\n throw $exception;\n }\n }\n\n try {\n $this->changeset_dao->commit();\n } catch (Exception $exception) {\n throw new Tracker_ChangesetCommitException();\n }\n\n if ($send_notification) {\n $artifact->getChangeset($changeset_id)->notify();\n }\n\n return $new_changeset;\n }", "public function getIssue( $issueKey, $expand = '' );", "public function getTicketDetailsEmailTemplate($completeIssueData, $webHookData) {\n// // Getting the Issue Data fromth Curl\n// $username = base64_decode(JIRA_USER_NAME);\n// $password = base64_decode(JIRA_USER_PWD);\n// $url = API_BASE_URL . 'issue/WPR-1036?expand=changelog';\n// $ch = curl_init();\n// curl_setopt($ch, CURLOPT_URL, $url);\n// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n// curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n// curl_setopt($ch, CURLOPT_USERPWD, $username . \":\" . $password);\n// curl_setopt($ch, CURLOPT_HEADER, 0);\n//\n// $result = curl_exec($ch);\n// $ch_error = curl_error($ch);\n// curl_close($ch);\n// $completeIssueData = json_decode(trim($result), true);\n// App::pre($completeIssueData);\n\n $requesterName = $completeIssueData['fields']['customfield_11020']; // Requester Name\n $requesterEmail = $completeIssueData['fields']['customfield_11018']; // Requester Email \n $assigneeName = $completeIssueData['fields']['assignee']['name']; // Assignee Name \n $assigneeEmail = $completeIssueData['fields']['assignee']['emailAddress']; // Assignee Email\n// $ActivityLog = $completeIssueData['changelog']['histories'][0]['items'];\n// $logFiledArr = Utility::arrayColumnFind($ActivityLog, 'field');\n// $key = array_search('status', $logFiledArr);\n $summary = $completeIssueData['fields']['summary'];\n if($webHookData == 'jira:issue_created'){\n $status = $completeIssueData['fields']['status']['name'];\n \n }else{\n $status = $completeIssueData['fields']['status']['name'];\n }\n $priority = $completeIssueData['fields']['priority']['name'];\n $taskDesc = $completeIssueData['fields']['description'];\n $attachments = $completeIssueData['fields']['attachment'];\n if($completeIssueData['fields']['customfield_11021'] != ''){ \n $addReqEmails = explode(',', $completeIssueData['fields']['customfield_11021']);\n $AdditionalCCs = '';\n foreach ($addReqEmails as $email) {\n $AdditionalCCs .= $this->getActiveEmailLink($email); \n }\n// $AdditionalCCs = $completeIssueData['fields']['customfield_11021'];\n }else{\n $AdditionalCCs = 'NA'; \n \n } \n\n $rowStyle = 'style=\"background-color: #fff;\"';\n $colStyleHead = 'style=\"vertical-align: top; padding: 5px; font-weight: bold\"';\n $colStyleValue = 'style=\"vertical-align: top; padding: 5px;\"';\n $body = '<table style=\"margin-left:10px; margin-top: 10px; font-size: 14px; background-color: #ddd;\">\n <tr ' . $rowStyle . '><td ' . $colStyleHead . '>Subject: </td><td ' . $colStyleValue . '>' . $summary . '</td></tr>\n <tr ' . $rowStyle . '><td ' . $colStyleHead . '>Service Type: </td><td ' . $colStyleValue . '> ' . $completeIssueData['fields']['issuetype']['name'] . '</td></tr>\n <tr ' . $rowStyle . '><td ' . $colStyleHead . '>Severity: </td><td ' . $colStyleValue . '> ' . $priority . '</td></tr>\n <tr ' . $rowStyle . '><td ' . $colStyleHead . '>Description: </td><td ' . $colStyleValue . '>' . htmlspecialchars_decode(nl2br($taskDesc)) . '</td></tr>\n <tr ' . $rowStyle . '><td ' . $colStyleHead . '>Status: </td><td ' . $colStyleValue . '>' . $status . '</td></tr>';\n \n if(isset($completeIssueData['fields']['resolution']['name']) && $completeIssueData['fields']['resolution']['name'] !=''){\n $resolution = $completeIssueData['fields']['resolution']['name'];\n \n }else{\n $resolution = 'NA';\n }\n $body.='<tr ' . $rowStyle . '><td ' . $colStyleHead . '>Resolution: </td><td ' . $colStyleValue . '>' . $resolution . '</td></tr>';\n $body.='<tr ' . $rowStyle . '><td ' . $colStyleHead . '>Requester Name: </td><td ' . $colStyleValue . '>' . $requesterName . '</td></tr>\n <tr ' . $rowStyle . '><td ' . $colStyleHead . '>Requester Email: </td><td ' . $colStyleValue . '>' . $this->getActiveEmailLink($requesterEmail) . '</td></tr>\n <tr ' . $rowStyle . '><td ' . $colStyleHead . '>Additional CC\\'s: </td><td ' . $colStyleValue . '> ' . $AdditionalCCs. ' </td></tr>';\n \n if ( $webHookData == 'jira:issue_created' && !empty($attachments)) {\n $downloadLinks = '';\n foreach ($attachments as $index => $attachment) {\n $attachement = $attachment['content'];\n $fileExp = explode('.', basename($attachement));\n $fileNameTrim = substr($fileExp[0], 0, 10).'...'.substr($fileExp[0], -10).'.'.$fileExp[1];\n $downloadLinks .= '<div><a style=\"color:#000;\" target=\"_blank\" href=\"'.SITE_URL.'support/index/downloadJiraAttachments?file='. base64_encode($attachement) .'\" title=\"' .basename($attachement). '\" >'.$fileNameTrim.'</a></div>';\n }\n $body .= '<tr ' . $rowStyle . '><td ' . $colStyleHead . '>Attachments: </td><td ' . $colStyleValue . '>' . $downloadLinks . '</td></tr>';\n }\n $body .= '</table>';\n\n $body .= '<br/><p>Should you have any questions or issues with accessing the support page, please contact your System Administrator as '.$this->getActiveEmailLink('[email protected]').'. </p>';\n\n $body .= '<p>Thank you,<br />Incipio Development <br /> '. $this->getActiveEmailLink('[email protected]').'</p>';\n// print_r($body);\n return $body;\n }", "public function fetch($uri)\n {\n $issue = $this->httpClient->getJson($uri, $this->getAuthorizationHeaders());\n\n if (empty($issue)) {\n throw new NotFoundException(t('Github Issue not found.'));\n }\n\n return new GithubTask($uri, $issue);\n }", "public function __construct($file)\n {\n $this->error_issue = $file;\n }", "public function get_issue($user = null, $issueifempty = true) {\n global $DB, $USER;\n\n if (empty($user)) {\n $userid = $USER->id;\n } else {\n if (is_object($user)) {\n $userid = $user->id;\n } else {\n $userid = $user;\n }\n }\n\n // Check if certificate has already issued.\n // Trying cached first.\n\n // The cache issue is from this user ?\n $created = false;\n if (!empty($this->issuecert) && $this->issuecert->userid == $userid) {\n if (empty($this->issuecert->haschange)) {\n // ...haschange is marked, if no return from cache.\n return $this->issuecert;\n } else {\n // ...haschange is maked, must update.\n $issuedcert = $this->issuecert;\n }\n // Not in cache, trying get from database.\n } else if (!$issuedcert = $DB->get_record('simplecertificate_issues',\n array('userid' => $userid, 'certificateid' => $this->get_instance()->id, 'timedeleted' => null))) {\n // Not in cache and not in DB, create new certificate issue record.\n\n if (!$issueifempty) {\n // Not create a new one, only check if exists.\n return null;\n }\n\n // Mark as created.\n $created = true;\n $issuedcert = new stdClass();\n $issuedcert->certificateid = $this->get_instance()->id;\n $issuedcert->coursename = format_string($this->get_instance()->coursename, true);\n $issuedcert->userid = $userid;\n $issuedcert->haschange = 1;\n $formatedcoursename = str_replace('-', '_', $this->get_instance()->coursename);\n $formatedcertificatename = str_replace('-', '_', $this->get_instance()->name);\n $issuedcert->certificatename = format_string($formatedcoursename . '-' . $formatedcertificatename, true);\n $issuedcert->timecreated = time();\n $issuedcert->code = $this->get_issue_uuid();\n // Avoiding not null restriction.\n $issuedcert->pathnamehash = '';\n\n if (has_capability('mod/simplecertificate:manage', $this->context, $userid)) {\n $issuedcert->id = 0;\n } else {\n $issuedcert->id = $DB->insert_record('simplecertificate_issues', $issuedcert);\n\n // Email to the teachers and anyone else.\n if (!empty($this->get_instance()->emailteachers)) {\n $this->send_alert_email_teachers();\n }\n\n if (!empty($this->get_instance()->emailothers)) {\n $this->send_alert_email_others();\n }\n }\n }\n\n // If cache or db issued certificate is maked as haschange, must update.\n if (!empty($issuedcert->haschange) && !$created) { // Check haschange, if so, reissue.\n $formatedcoursename = str_replace('-', '_', $this->get_instance()->coursename);\n $formatedcertificatename = str_replace('-', '_', $this->get_instance()->name);\n $issuedcert->certificatename = format_string($formatedcoursename . '-' . $formatedcertificatename, true);\n $DB->update_record('simplecertificate_issues', $issuedcert);\n }\n\n // Caching to avoid unessecery db queries.\n $this->issuecert = $issuedcert;\n return $issuedcert;\n }", "public function setIssues($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Ydb\\Issue\\IssueMessage::class);\n $this->issues = $arr;\n\n return $this;\n }", "function project_issue_mail_output(&$body, $html = 1, $format = FILTER_FORMAT_DEFAULT) {\n static $i = 0;\n\n if ($html) {\n $body = check_markup($body, $format, FALSE);\n\n // Convert inline links into footer links.\n //$pattern = '@<a +([^ >]+ )*?href *= *\"([^>\"]+?)\"[^>]*>([^<]+?)</a>@i';\n $pattern = '@<a[^>]*\\shref\\s*=\\s*([\\'\"])([^>]+?)\\1[^>]*>(.+?)</a>@is';\n $body = preg_replace_callback($pattern, '_project_issue_mail_url_callback', $body);\n $urls = _project_issue_mail_url_callback();\n\n if (count($urls)) {\n $body .= \"\\n\";\n for ($max = count($urls); $i < $max; $i++) {\n $body .= '['. ($i + 1) .'] '. $urls[$i] .\"\\n\";\n }\n }\n\n $body = preg_replace('!</?blockquote>!i', '\"', $body);\n $body = preg_replace('!</?(em|i)>!i', '/', $body);\n $body = preg_replace('!</?(b|strong)>!i', '*', $body);\n $body = preg_replace(\"@<br />(?!\\n)@i\", \"\\n\", $body);\n $body = preg_replace(\"@</p>(?!\\n\\n)@i\", \"\\n\\n\", $body);\n $body = preg_replace(\"@<li>@i\", \"* \", $body);\n $body = preg_replace(\"@</li>\\n?@i\", \"\\n\", $body);\n $body = strip_tags($body);\n $body = decode_entities($body);\n $body = wordwrap($body, 72);\n }\n else {\n $body = decode_entities($body);\n }\n}", "public function asIssue()\n\t{\n\t\t$this->severity = 'error';\n\t\t$this->cannotClose();\n\t\treturn $this;\n\t}", "function add($issue_id, $usr_id, $description, $internal_only = FALSE, $unknown_user = FALSE, $associated_note_id = FALSE)\n {\n $issue_id = Misc::escapeInteger($issue_id);\n $usr_id = Misc::escapeInteger($usr_id);\n if ($internal_only) {\n $attachment_status = 'internal';\n } else {\n $attachment_status = 'public';\n }\n\n $stmt = \"INSERT INTO\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_attachment\n (\n iat_iss_id,\n iat_usr_id,\n iat_created_date,\n iat_description,\n iat_status\";\n if ($unknown_user != false) {\n $stmt .= \", iat_unknown_user \";\n }\n if ($associated_note_id != false) {\n $stmt .= \", iat_not_id \";\n }\n $stmt .=\") VALUES (\n $issue_id,\n $usr_id,\n '\" . Date_Helper::getCurrentDateGMT() . \"',\n '\" . Misc::escapeString($description) . \"',\n '\" . Misc::escapeString($attachment_status) . \"'\";\n if ($unknown_user != false) {\n $stmt .= \", '\" . Misc::escapeString($unknown_user) . \"'\";\n }\n if ($associated_note_id != false) {\n $stmt .= \", \" . Misc::escapeInteger($associated_note_id);\n }\n $stmt .= \" )\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return false;\n } else {\n return DB_Helper::get_last_insert_id();\n }\n }", "function buildObjectTarget($user_name, $brand_id, $issue_id, $brand_channel = 'print', $email_info = null)\n\t{\n\t try {\n\t require_once ENTERPRISE_BASEDIR . '/server/bizclasses/BizPublication.class.php';\n\t require_once ENTERPRISE_BASEDIR . '/server/dbclasses/DBAdmIssue.class.php';\n\t \n\t $brand_object = BizPublication::getPublications($user_name, 'browse', $brand_id);\n\t \n\t foreach ($brand_object[0]->PubChannels as $pub_channel) {\n\t if (strtolower($pub_channel->Type) == strtolower($brand_channel)) {\n\t $pub_channel_object = $pub_channel;\n\t break;\n\t }\n\t }\n\t \n\t foreach ($pub_channel_object->Issues as $pub_channel_issue) {\n\t if ($pub_channel_issue->Id == $issue_id) {\n\t $issue_id = $pub_channel_issue->Id;\n\t $issue_name = $pub_channel_issue->Name;\n\t }\n\t }\n\t \n\t // Set Issue Info\n\t $issue_object = new Issue();\n\t $issue_object->Id = $issue_id;\n\t $issue_object->Name = $issue_name;\n\t \n\t // Set PubChannel Info\n\t $channel_object = new Pubchannel();\n\t $channel_object->Id = $pub_channel_object->Id;\n\t $channel_object->Name = $pub_channel_object->Name;\n\t \n\t // Set Empty target object to be populated and returned.\n\t $target_object = array();\n\t $target_object[0] = new Target();\n\t $target_object[0]->PubChannel = $channel_object;\n\t \n\t $target_object[0]->Issue = $issue_object;\n\t \n\t return $target_object;\n\t }\n\t catch (BizException $e) {\n\t sendEmail($email_info, '', $e->getMessage(), true);\n\t exit;\n\t }\n\t}", "public function retrieveIssue(Issue $issue)\n {\n\n $projectKey = $issue->getProject();\n\n /** @var \\helper_plugin_issuelinks_db $db */\n $db = plugin_load('helper', 'issuelinks_db');\n $webhooks = $db->getWebhooks('jira');\n $allowedRepos = explode(',', $webhooks[0]['repository_id']);\n\n if (!in_array($projectKey, $allowedRepos, true)) {\n// Jira Projects must be enabled as Webhook for on-demand fetching\n return;\n }\n\n\n $issueNumber = $issue->getKey();\n $endpoint = \"/rest/api/2/issue/$projectKey-$issueNumber\";\n\n $issueData = $this->makeJiraRequest($endpoint, [], 'GET');\n $this->setIssueData($issue, $issueData);\n }", "public function create()\n\t{\n\t\tglobal $ilUser,$lng;\n\t\t\n\n\t\t// Write on task (fillPdfTemplate for every candidate) and finally merge them in one PDF.\n\t\tinclude_once './Services/ADN/Report/classes/class.adnTaskScheduleWriter.php';\n\t\t$writer = new adnTaskScheduleWriter();\n\t\t$writer->xmlStartTag('tasks');\n\n\t\t$this->createAssignments($writer);\n\t\t\n\t\t$writer->xmlEndTag('tasks');\n\t\t#$GLOBALS['ilLog']->write($writer->xmlDumpMem(true));\n\t\t\n\t\ttry\n\t\t{\n\t\t\tinclude_once './Services/ADN/Base/classes/class.adnRpcAdapter.php';\n\t\t\t$adapter = new adnRpcAdapter();\n\t\t\t$adapter->transformationTaskScheduler(\n\t\t\t\t$writer->xmlDumpMem()\n\t\t\t);\n\t\t\t\n\t\t}\n\t\tcatch(adnReportException $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}", "function load_from_external_source($col_mapping, $source_data) {\n $a = array();\n $label_formatter = new \\App\\Libraries\\Label_formatter();\n $source_data2 = array_change_key_case($source_data, CASE_LOWER);\n\n // load entry fields from external source\n foreach ($col_mapping as $fld => $spec) {\n\n // $spec['type'] will typically be ColName, PostName, or Literal\n // However, it might have a suffix in the form '.action.ActionName'\n\n // Method get_entry_form_definitions() E_model.php looks for text \n // in the form 'ColName.action.ActionName'\n // and will add an 'action' item to the field spec\n \n switch ($spec['type']) {\n case 'ColName':\n // Copy the text in the specified column of the detail report for the source page family\n // . \" (field = \" . $spec['value'] . \", action = $action)\"\n $col = $spec['value'];\n $col_fmt = $label_formatter->format($col);\n $col_defmt = $label_formatter->deformat($col);\n $val = \"\";\n if (array_key_exists($col, $source_data)) {\n $val = $source_data[$col];\n } elseif (array_key_exists($col_fmt, $source_data)) {\n // Target column for column name not found; try using the display-formatted target field\n $val = $source_data[$col_fmt];\n } elseif (array_key_exists($col_defmt, $source_data)) {\n // Target column for column name not found; try using the display-deformatted target field\n $val = $source_data[$col_defmt];\n } else {\n // TODO: Trigger a warning message of some kind?\n // Return an invalid link id to not break the page entirely; it's harder to see that there's a problem, but much easier to see the exact cause\n $val = \"COLUMN_NAME_MISMATCH\";\n }\n $a[$fld] = $val;\n break;\n\n case 'PostName':\n // Retrieve the named POST value\n //$request = \\Config\\Services::request();\n //$pv = $request->getPost($spec['value']);\n $col = $spec['value'];\n $pv = \"\";\n if (array_key_exists($col, $source_data2)) {\n $pv = $source_data2[$col];\n }\n $a[$fld] = $pv;\n break;\n\n case 'Literal':\n // Store a literal string\n $a[$fld] = $spec['value'];\n break;\n }\n\n // any further actions?\n if (isset($spec['action'])) {\n switch ($spec['action']) {\n case 'ExtractUsername':\n // Look for username in text of the form \"Person Name (Username)\"\n // This Regex matches any text between two parentheses\n\n $patUsername = '/\\(([^)]+)\\)/i';\n $matches = array();\n\n preg_match_all($patUsername, $a[$fld], $matches);\n\n // The $matches array returned by preg_match_all is a 2D array\n // Any matches to the first capture are in the array at $matches[0]\n\n if (count($matches[1]) > 0) {\n // Update $a[$fld] to be the last match found (excluding the parentheses)\n\n $a[$fld] = $matches[1][count($matches[1]) - 1];\n }\n\n break;\n\n case 'ExtractEUSId':\n // Look for EUS ID in text of the form \"LastName, FirstName (12345)\"\n // This Regex matches any series of numbers between two parentheses\n\n $patEUSId = '/\\(( *\\d+ *)\\)/i';\n $matches = array();\n\n preg_match($patEUSId, $a[$fld], $matches);\n\n // $matches is now a 1D array\n // $matches[0] is the full match\n // $matches[1] is the captured group\n\n if (count($matches) > 1) {\n // Update $a[$fld] to be the first match found (excluding the parentheses)\n\n $a[$fld] = $matches[1];\n }\n\n break;\n\n case 'Scrub':\n // Only copy certain text from the comment field of the source analysis job\n\n // Look for text in the form '[Req:Username]'\n // If found, put the last one found in $s\n // For example, given '[Job:D3M580] [Req:D3M578] [Req:D3L243]', set $s to '[Req:D3L243]'\n // This is a legacy comment text that was last used in 2010\n\n $s = \"\";\n $field = $a[$fld];\n\n $patReq = '/(\\[Req:[^\\]]*\\])/';\n $matches = array();\n preg_match_all($patReq, $field, $matches);\n\n // The $matches array returned by preg_match_all is a 2D array\n // Any matches to the first capture are in the array at $matches[0]\n\n if (count($matches[0]) != 0) {\n $s .= $matches[0][count($matches[0]) - 1];\n }\n\n // Also look for 'DTA:' followed by letters, numbers, and certain symbols\n // For example, given '[Job:D3L243] [Req:D3L243] DTA:DTA_Manual_02', look for 'DTA:DTA_Manual_02'\n // If found, append the text to $s\n // This is a legacy comment text that was last used in 2010\n\n $patDTA = '/(DTA:[a-zA-Z0-9_#\\-]*)/';\n preg_match($patDTA, $field, $matches);\n\n // $matches is now a 1D array\n // $matches[0] is the full match\n // $matches[1] is the captured group\n\n if (count($matches) > 1) {\n $s .= \" \" . $matches[1];\n }\n\n $a[$fld] = $s;\n break;\n }\n }\n }\n return $a;\n}", "public function testGitLabRemoteRepositoryExternal(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './', 'https://salsa.debian.org/');\n $this->assertEquals('https://salsa.debian.org/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "function _versioncontrol_git_get_source_item_helper($repository, $revision, $filename, $branches) {\n $branch_names = array();\n foreach ($branches as $branch) {\n $branch_names[] = $branch['name'];\n }\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'paths' => array($filename),\n 'branches' => $branch_names\n );\n $commit_op = versioncontrol_get_operations($constraints);\n ksort($commit_op);\n $commit_op = array_pop($commit_op);\n $op_items = versioncontrol_get_operation_items($commit_op);\n $type = $op_items[$filename]['type'] ? $op_items[$filename]['type'] : VERSIONCONTROL_ITEM_FILE;\n // ['action'] not needed for source items :)\n return array(\n 'path' => $filename,\n 'type' => $type,\n 'revision' => $op_items[$filename]['revision'],\n );\n}", "public function getIssues($params = array())\n {\n if (!is_array($params)) {\n return array();\n }\n\n $headers = $this->getDefaultHeaders();\n $filters = \"\";\n\n foreach ($params as $key => $value) {\n $filters .= \"$key=$value\" . \"&\";\n }\n\n if ($filters !== \"\") {\n $filters = \"?\" . trim($filters, \"&\");\n }\n\n $response = $this->client->request(\n 'GET',\n $this->api . $this->repo . \"/issues\" . $filters,\n array(\n \"headers\" => $headers\n )\n );\n\n if ($response->getStatusCode() == 200) {\n $body = $response->getBody();\n $body = json_decode($body, true);\n\n return $body;\n }\n\n return array();\n }", "public function create()\n {\n return view('issues.create');\n }", "public function run()\n {\n $repo1 = Repo::create([\n 'name' => 'johnbolton/exercitationem',\n 'url' => 'https://github.com/johnbolton/exercitationem',\n 'event_id' => 1,\n ]);\n\n $repo2 = Repo::create([\n 'name' => 'pestrada/voluptatem',\n 'url' => 'https://github.com/pestrada/voluptatem',\n 'event_id' => 2,\n ]);\n }", "private function createImageResource()\n {\n // In case of failure, image will be false\n\n $mimeType = $this->getMimeTypeOfSource();\n\n if ($mimeType == 'image/png') {\n $image = imagecreatefrompng($this->source);\n if ($image === false) {\n throw new ConversionFailedException(\n 'Gd failed when trying to load/create image (imagecreatefrompng() failed)'\n );\n }\n return $image;\n }\n\n if ($mimeType == 'image/jpeg') {\n $image = imagecreatefromjpeg($this->source);\n if ($image === false) {\n throw new ConversionFailedException(\n 'Gd failed when trying to load/create image (imagecreatefromjpeg() failed)'\n );\n }\n return $image;\n }\n\n /*\n throw new InvalidInputException(\n 'Unsupported mime type:' . $mimeType\n );*/\n }", "public function run()\n {\n $table_name = 'issues';\n $table_name_langs = 'issue_langs';\n\n $issues = array(\n array('id' => '1','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '2','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '3','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '4','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '5','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '6','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => '2020-04-25 06:31:42','deleted_at' => NULL),\n array('id' => '7','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '8','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '9','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '10','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '11','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '12','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '13','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '14','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '15','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '16','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '17','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '18','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '19','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '20','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '21','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '22','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '23','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '24','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '25','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '26','issue_type_id' => '2','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '27','issue_type_id' => '2','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '28','issue_type_id' => '2','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '29','issue_type_id' => '2','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '30','issue_type_id' => '2','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '31','issue_type_id' => '3','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '32','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '33','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '34','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '35','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '36','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '37','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '38','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '39','issue_type_id' => '5','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '40','issue_type_id' => '5','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '41','issue_type_id' => '5','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '42','issue_type_id' => '5','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '43','issue_type_id' => '6','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '44','issue_type_id' => '6','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '45','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '46','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '47','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '48','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '49','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '50','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '51','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '52','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '53','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '54','issue_type_id' => '8','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '55','issue_type_id' => '8','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '56','issue_type_id' => '8','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '57','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '58','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '59','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '60','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '61','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '62','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '63','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '64','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '65','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '66','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '67','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '68','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '69','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '70','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '71','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '72','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '73','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '74','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '75','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '76','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '77','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '78','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '79','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '80','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '81','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '82','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '83','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '84','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '85','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '86','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '87','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '88','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '89','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '90','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '91','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '92','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '93','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '94','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '95','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '96','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '97','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '98','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '99','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '100','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '101','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '102','issue_type_id' => '11','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '103','issue_type_id' => '11','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '104','issue_type_id' => '11','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '105','issue_type_id' => '11','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '106','issue_type_id' => '11','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '107','issue_type_id' => '11','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '108','issue_type_id' => '12','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '109','issue_type_id' => '12','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '110','issue_type_id' => '12','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '111','issue_type_id' => '13','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '112','issue_type_id' => '13','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '113','issue_type_id' => '13','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '114','issue_type_id' => '13','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL)\n );\n\n $issue_langs = array(\n array('issue_id' => '1','lang_id' => '1','name' => 'Swachh Bharat-&gt;Garbage Dumps','created_at' => '2020-04-24 18:42:30','updated_at' => '2020-04-24 18:42:30','deleted_at' => NULL),\n array('issue_id' => '2','lang_id' => '1','name' => 'Sweeping','created_at' => '2020-04-24 18:42:50','updated_at' => '2020-04-24 18:42:50','deleted_at' => NULL),\n array('issue_id' => '3','lang_id' => '1','name' => 'Burning Garbage','created_at' => '2020-04-24 18:43:06','updated_at' => '2020-04-24 18:43:06','deleted_at' => NULL),\n array('issue_id' => '4','lang_id' => '1','name' => 'Malba Stuck','created_at' => '2020-04-24 18:47:29','updated_at' => '2020-04-24 18:47:29','deleted_at' => NULL),\n array('issue_id' => '5','lang_id' => '1','name' => 'Potholes','created_at' => '2020-04-25 06:31:07','updated_at' => '2020-04-25 06:31:07','deleted_at' => NULL),\n array('issue_id' => '6','lang_id' => '1','name' => 'Swachh Bharat -> Urination in Public / Defection','created_at' => '2020-04-25 06:31:27','updated_at' => '2020-04-25 06:31:42','deleted_at' => NULL),\n array('issue_id' => '7','lang_id' => '1','name' => 'Stray Dogs','created_at' => '2020-04-25 06:31:58','updated_at' => '2020-04-25 06:31:58','deleted_at' => NULL),\n array('issue_id' => '8','lang_id' => '1','name' => 'Swachh Bharat -> No electricity in public toilets','created_at' => '2020-04-25 06:32:18','updated_at' => '2020-04-25 06:32:18','deleted_at' => NULL),\n array('issue_id' => '9','lang_id' => '1','name' => 'Swachh Bharat -> Sweeping not done','created_at' => '2020-04-25 06:34:19','updated_at' => '2020-04-25 06:34:19','deleted_at' => NULL),\n array('issue_id' => '10','lang_id' => '1','name' => 'Swachh Bharat -> No water supply in public toilets','created_at' => '2020-04-25 06:34:31','updated_at' => '2020-04-25 06:34:31','deleted_at' => NULL),\n array('issue_id' => '11','lang_id' => '1','name' => 'Swachh Bharat -> Public Toilets Blockage','created_at' => '2020-04-25 06:34:46','updated_at' => '2020-04-25 06:34:46','deleted_at' => NULL),\n array('issue_id' => '12','lang_id' => '1','name' => 'Swachh Bharat -> Garbage Vehicle not arrived','created_at' => '2020-04-25 06:34:57','updated_at' => '2020-04-25 06:34:57','deleted_at' => NULL),\n array('issue_id' => '13','lang_id' => '1','name' => 'Swachh Bharat -> Dead Animal','created_at' => '2020-04-25 06:35:08','updated_at' => '2020-04-25 06:35:08','deleted_at' => NULL),\n array('issue_id' => '14','lang_id' => '1','name' => 'Swachh Bharat -> Dustbin Not Cleaned','created_at' => '2020-04-25 06:35:17','updated_at' => '2020-04-25 06:35:17','deleted_at' => NULL),\n array('issue_id' => '15','lang_id' => '1','name' => 'Swachh Bharat -> Public toilet(s) cleaning','created_at' => '2020-04-25 06:35:30','updated_at' => '2020-04-25 06:35:30','deleted_at' => NULL),\n array('issue_id' => '16','lang_id' => '1','name' => 'Swachh Bharat -> Open Manholes Or Drains','created_at' => '2020-04-25 06:35:49','updated_at' => '2020-04-25 06:35:49','deleted_at' => NULL),\n array('issue_id' => '17','lang_id' => '1','name' => 'Swachh Bharat -> Sewerage or Storm Water Overflow','created_at' => '2020-04-25 06:36:02','updated_at' => '2020-04-25 06:36:02','deleted_at' => NULL),\n array('issue_id' => '18','lang_id' => '1','name' => 'Swachh Bharat -> Stagnant Water On The Road','created_at' => '2020-04-25 06:36:14','updated_at' => '2020-04-25 06:36:14','deleted_at' => NULL),\n array('issue_id' => '19','lang_id' => '1','name' => 'Swachh Bharat -> Improper Disposal of Fecal Waste/Septage','created_at' => '2020-04-25 06:36:25','updated_at' => '2020-04-25 06:36:25','deleted_at' => NULL),\n array('issue_id' => '20','lang_id' => '1','name' => 'Debris Removal/Construction Material','created_at' => '2020-04-25 06:36:56','updated_at' => '2020-04-25 06:36:56','deleted_at' => NULL),\n array('issue_id' => '21','lang_id' => '1','name' => 'Burning Of Garbage In Open Space','created_at' => '2020-04-25 06:37:08','updated_at' => '2020-04-25 06:37:08','deleted_at' => NULL),\n array('issue_id' => '22','lang_id' => '1','name' => 'Malaria Fogging/Spray','created_at' => '2020-04-25 06:37:19','updated_at' => '2020-04-25 06:37:19','deleted_at' => NULL),\n array('issue_id' => '23','lang_id' => '1','name' => 'Monkey Menace','created_at' => '2020-04-25 06:37:32','updated_at' => '2020-04-25 06:37:32','deleted_at' => NULL),\n array('issue_id' => '24','lang_id' => '1','name' => 'Health Challan Issue','created_at' => '2020-04-25 06:37:45','updated_at' => '2020-04-25 06:37:45','deleted_at' => NULL),\n array('issue_id' => '25','lang_id' => '1','name' => 'Horticulture Waste','created_at' => '2020-04-25 06:37:58','updated_at' => '2020-04-25 06:37:58','deleted_at' => NULL),\n array('issue_id' => '26','lang_id' => '1','name' => 'Unauthorised Parking','created_at' => '2020-04-25 06:38:11','updated_at' => '2020-04-25 06:38:11','deleted_at' => NULL),\n array('issue_id' => '27','lang_id' => '1','name' => 'Unauthorised Posters, Banner etc.','created_at' => '2020-04-25 06:38:22','updated_at' => '2020-04-25 06:38:22','deleted_at' => NULL),\n array('issue_id' => '28','lang_id' => '1','name' => 'Unauthorised Hawkers','created_at' => '2020-04-25 06:38:33','updated_at' => '2020-04-25 06:38:33','deleted_at' => NULL),\n array('issue_id' => '29','lang_id' => '1','name' => 'Encroachment','created_at' => '2020-04-25 06:38:42','updated_at' => '2020-04-25 06:38:42','deleted_at' => NULL),\n array('issue_id' => '30','lang_id' => '1','name' => 'Unauthorised Advertisement(Hoardings,posters etc.)','created_at' => '2020-04-25 06:38:57','updated_at' => '2020-04-25 06:38:57','deleted_at' => NULL),\n array('issue_id' => '31','lang_id' => '1','name' => 'Fire','created_at' => '2020-04-25 06:39:08','updated_at' => '2020-04-25 06:39:08','deleted_at' => NULL),\n array('issue_id' => '32','lang_id' => '1','name' => 'Toilet Blockage','created_at' => '2020-04-25 06:39:21','updated_at' => '2020-04-25 06:39:21','deleted_at' => NULL),\n array('issue_id' => '33','lang_id' => '1','name' => 'No Electricity','created_at' => '2020-04-25 06:39:31','updated_at' => '2020-04-25 06:39:31','deleted_at' => NULL),\n array('issue_id' => '34','lang_id' => '1','name' => 'No Water Supply','created_at' => '2020-04-25 06:39:42','updated_at' => '2020-04-25 06:39:42','deleted_at' => NULL),\n array('issue_id' => '35','lang_id' => '1','name' => 'Toilet Cleaning','created_at' => '2020-04-25 06:39:56','updated_at' => '2020-04-25 06:39:56','deleted_at' => NULL),\n array('issue_id' => '36','lang_id' => '1','name' => 'Maintenance Of PTU','created_at' => '2020-04-25 06:40:08','updated_at' => '2020-04-25 06:40:08','deleted_at' => NULL),\n array('issue_id' => '37','lang_id' => '1','name' => 'Operator Ask for Money','created_at' => '2020-04-25 06:40:18','updated_at' => '2020-04-25 06:40:18','deleted_at' => NULL),\n array('issue_id' => '38','lang_id' => '1','name' => 'Inspection Public Toilets','created_at' => '2020-04-25 06:40:28','updated_at' => '2020-04-25 06:40:28','deleted_at' => NULL),\n array('issue_id' => '39','lang_id' => '1','name' => 'Maintenance of Parks / Round About','created_at' => '2020-04-25 06:40:45','updated_at' => '2020-04-25 06:40:45','deleted_at' => NULL),\n array('issue_id' => '40','lang_id' => '1','name' => 'Tree Fall','created_at' => '2020-04-25 06:41:01','updated_at' => '2020-04-25 06:41:01','deleted_at' => NULL),\n array('issue_id' => '41','lang_id' => '1','name' => 'Pruning of Trees','created_at' => '2020-04-25 06:41:13','updated_at' => '2020-04-25 06:41:13','deleted_at' => NULL),\n array('issue_id' => '42','lang_id' => '1','name' => 'Removal Of Horticulture Waste','created_at' => '2020-04-25 06:41:23','updated_at' => '2020-04-25 06:41:23','deleted_at' => NULL),\n array('issue_id' => '43','lang_id' => '1','name' => 'Indoor gym Maintenance','created_at' => '2020-04-25 06:41:41','updated_at' => '2020-04-25 06:41:41','deleted_at' => NULL),\n array('issue_id' => '44','lang_id' => '1','name' => 'Open Gym Maintenance','created_at' => '2020-04-25 06:41:54','updated_at' => '2020-04-25 06:41:54','deleted_at' => NULL),\n array('issue_id' => '45','lang_id' => '1','name' => 'AC not working','created_at' => '2020-04-25 06:42:06','updated_at' => '2020-04-25 06:42:06','deleted_at' => NULL),\n array('issue_id' => '46','lang_id' => '1','name' => 'Street Light not working','created_at' => '2020-04-25 06:42:16','updated_at' => '2020-04-25 06:42:16','deleted_at' => NULL),\n array('issue_id' => '47','lang_id' => '1','name' => 'Electric-BM -> Water Cooler not working','created_at' => '2020-04-25 06:42:27','updated_at' => '2020-04-25 06:42:27','deleted_at' => NULL),\n array('issue_id' => '48','lang_id' => '1','name' => 'Electric-BM -> CCTV not working','created_at' => '2020-04-25 06:42:38','updated_at' => '2020-04-25 06:42:38','deleted_at' => NULL),\n array('issue_id' => '49','lang_id' => '1','name' => 'Fire In Pole','created_at' => '2020-04-25 06:42:48','updated_at' => '2020-04-25 06:42:48','deleted_at' => NULL),\n array('issue_id' => '50','lang_id' => '1','name' => 'Electric-BM -> Appliances Burnt','created_at' => '2020-04-25 06:43:02','updated_at' => '2020-04-25 06:43:02','deleted_at' => NULL),\n array('issue_id' => '51','lang_id' => '1','name' => 'Wire Hanging/Broken','created_at' => '2020-04-25 06:43:12','updated_at' => '2020-04-25 06:43:12','deleted_at' => NULL),\n array('issue_id' => '52','lang_id' => '1','name' => 'High mask light not working','created_at' => '2020-04-25 06:43:53','updated_at' => '2020-04-25 06:43:53','deleted_at' => NULL),\n array('issue_id' => '53','lang_id' => '1','name' => 'Electric-BM -> Electric Building Maintenance','created_at' => '2020-04-25 06:44:05','updated_at' => '2020-04-25 06:44:05','deleted_at' => NULL),\n array('issue_id' => '54','lang_id' => '1','name' => 'No Current / Supply','created_at' => '2020-04-25 06:44:16','updated_at' => '2020-04-25 06:44:29','deleted_at' => NULL),\n array('issue_id' => '55','lang_id' => '1','name' => 'Voltage Fluctuation','created_at' => '2020-04-25 06:44:42','updated_at' => '2020-04-25 06:44:42','deleted_at' => NULL),\n array('issue_id' => '56','lang_id' => '1','name' => 'Panel Box Not Working','created_at' => '2020-04-25 06:44:53','updated_at' => '2020-04-25 06:44:53','deleted_at' => NULL),\n array('issue_id' => '57','lang_id' => '1','name' => 'Meter Fault','created_at' => '2020-04-25 06:45:08','updated_at' => '2020-04-25 06:45:08','deleted_at' => NULL),\n array('issue_id' => '58','lang_id' => '1','name' => 'Meter Reading','created_at' => '2020-04-25 06:45:23','updated_at' => '2020-04-25 06:45:23','deleted_at' => NULL),\n array('issue_id' => '59','lang_id' => '1','name' => 'New Connection','created_at' => '2020-04-25 06:45:37','updated_at' => '2020-04-25 06:45:37','deleted_at' => NULL),\n array('issue_id' => '60','lang_id' => '1','name' => 'Transfer of money and billing','created_at' => '2020-04-25 06:46:09','updated_at' => '2020-04-25 06:46:09','deleted_at' => NULL),\n array('issue_id' => '61','lang_id' => '1','name' => 'Bill related problem','created_at' => '2020-04-25 06:46:19','updated_at' => '2020-04-25 06:46:19','deleted_at' => NULL),\n array('issue_id' => '62','lang_id' => '1','name' => 'Generation Of Electricity Bill','created_at' => '2020-04-25 06:46:33','updated_at' => '2020-04-25 06:46:33','deleted_at' => NULL),\n array('issue_id' => '63','lang_id' => '1','name' => 'Detection of power theft','created_at' => '2020-04-25 06:46:43','updated_at' => '2020-04-25 06:46:43','deleted_at' => NULL),\n array('issue_id' => '64','lang_id' => '1','name' => 'Release of Electricity/Water','created_at' => '2020-04-25 06:46:53','updated_at' => '2020-04-25 06:46:53','deleted_at' => NULL),\n array('issue_id' => '65','lang_id' => '1','name' => 'Smart Meter -> Meter Sparking','created_at' => '2020-04-25 06:47:03','updated_at' => '2020-04-25 06:47:03','deleted_at' => NULL),\n array('issue_id' => '66','lang_id' => '1','name' => 'Smart Meter -> Data not available on consumer portal-mobile app','created_at' => '2020-04-25 06:47:14','updated_at' => '2020-04-25 06:47:14','deleted_at' => NULL),\n array('issue_id' => '67','lang_id' => '1','name' => 'Smart Meter -> Consumer No. not found in mobile app','created_at' => '2020-04-25 06:47:26','updated_at' => '2020-04-25 06:47:26','deleted_at' => NULL),\n array('issue_id' => '68','lang_id' => '1','name' => 'Smart Meter -> Meter details are incorrect in system','created_at' => '2020-04-25 06:47:36','updated_at' => '2020-04-25 06:47:36','deleted_at' => NULL),\n array('issue_id' => '69','lang_id' => '1','name' => 'Smart Meter -> Smart Meter Not Installed','created_at' => '2020-04-25 06:47:48','updated_at' => '2020-04-25 06:47:48','deleted_at' => NULL),\n array('issue_id' => '70','lang_id' => '1','name' => 'Road Drainage -> Drainage Silt','created_at' => '2020-04-25 06:49:49','updated_at' => '2020-04-25 06:49:49','deleted_at' => NULL),\n array('issue_id' => '71','lang_id' => '1','name' => 'Road Drainage -> Drainage Coverage Missing','created_at' => '2020-04-25 06:50:09','updated_at' => '2020-04-25 06:50:09','deleted_at' => NULL),\n array('issue_id' => '72','lang_id' => '1','name' => 'Road Drainage -> Drainage Blocked','created_at' => '2020-04-25 06:50:20','updated_at' => '2020-04-25 06:50:20','deleted_at' => NULL),\n array('issue_id' => '73','lang_id' => '1','name' => 'Road Maintenance -> Bollards Broken','created_at' => '2020-04-25 06:50:29','updated_at' => '2020-04-25 06:50:29','deleted_at' => NULL),\n array('issue_id' => '74','lang_id' => '1','name' => 'Road Maintenance -> Mainhole Cover Missing / Broken','created_at' => '2020-04-25 06:50:42','updated_at' => '2020-04-25 06:50:42','deleted_at' => NULL),\n array('issue_id' => '75','lang_id' => '1','name' => 'Road Maintenance -> Road Signages need repair','created_at' => '2020-04-25 06:50:53','updated_at' => '2020-04-25 06:50:53','deleted_at' => NULL),\n array('issue_id' => '76','lang_id' => '1','name' => 'Road Maintenance -> Potholes','created_at' => '2020-04-25 06:51:04','updated_at' => '2020-04-25 06:51:04','deleted_at' => NULL),\n array('issue_id' => '77','lang_id' => '1','name' => 'Road Maintenance -> Water logging','created_at' => '2020-04-25 06:51:15','updated_at' => '2020-04-25 06:51:15','deleted_at' => NULL),\n array('issue_id' => '78','lang_id' => '1','name' => 'Road Maintenance -> Footpath Broken','created_at' => '2020-04-25 06:51:25','updated_at' => '2020-04-25 06:51:25','deleted_at' => NULL),\n array('issue_id' => '79','lang_id' => '1','name' => 'Road Maintenance -> Maintenance of Foot Over Bridge','created_at' => '2020-04-25 06:51:35','updated_at' => '2020-04-25 06:51:35','deleted_at' => NULL),\n array('issue_id' => '80','lang_id' => '1','name' => 'Road Maintenance -> Open Gym Maintenance','created_at' => '2020-04-25 06:51:46','updated_at' => '2020-04-25 06:51:46','deleted_at' => NULL),\n array('issue_id' => '81','lang_id' => '1','name' => 'Road Maintenance -> Zebra Crossing','created_at' => '2020-04-25 06:51:56','updated_at' => '2020-04-25 06:51:56','deleted_at' => NULL),\n array('issue_id' => '82','lang_id' => '1','name' => 'Road Maintenance -> Drainage Overflow','created_at' => '2020-04-25 06:52:06','updated_at' => '2020-04-25 06:52:06','deleted_at' => NULL),\n array('issue_id' => '83','lang_id' => '1','name' => 'Road Maintenance -> Malba Stacking','created_at' => '2020-04-25 06:52:21','updated_at' => '2020-04-25 06:52:21','deleted_at' => NULL),\n array('issue_id' => '84','lang_id' => '1','name' => 'Road Maintenance -> Spot Fixing','created_at' => '2020-04-25 06:52:51','updated_at' => '2020-04-25 06:52:51','deleted_at' => NULL),\n array('issue_id' => '85','lang_id' => '1','name' => 'Road Maintenance -> Dustbin Not Clean','created_at' => '2020-04-25 06:53:03','updated_at' => '2020-04-25 06:53:03','deleted_at' => NULL),\n array('issue_id' => '86','lang_id' => '1','name' => 'Sewer Maintenance -> Sewer Block','created_at' => '2020-04-25 06:55:23','updated_at' => '2020-04-25 06:55:23','deleted_at' => NULL),\n array('issue_id' => '87','lang_id' => '1','name' => 'Sewer Maintenance -> Sewer Silt / Malba','created_at' => '2020-04-25 06:55:50','updated_at' => '2020-04-25 06:55:50','deleted_at' => NULL),\n array('issue_id' => '88','lang_id' => '1','name' => 'Sewer Maintenance -> Sewer Overflow','created_at' => '2020-04-25 06:56:02','updated_at' => '2020-04-25 06:56:02','deleted_at' => NULL),\n array('issue_id' => '89','lang_id' => '1','name' => 'Sewer Maintenance -> Sewer mainhole cover related','created_at' => '2020-04-25 06:56:14','updated_at' => '2020-04-25 06:56:14','deleted_at' => NULL),\n array('issue_id' => '90','lang_id' => '1','name' => 'Water Maintenance -> Hand Pump','created_at' => '2020-04-25 06:56:24','updated_at' => '2020-04-25 06:56:24','deleted_at' => NULL),\n array('issue_id' => '91','lang_id' => '1','name' => 'Water Maintenance -> Water Tanker Required','created_at' => '2020-04-25 06:56:37','updated_at' => '2020-04-25 06:56:37','deleted_at' => NULL),\n array('issue_id' => '92','lang_id' => '1','name' => 'Water Maintenance -> Meter Faulty','created_at' => '2020-04-25 06:57:27','updated_at' => '2020-04-25 06:57:27','deleted_at' => NULL),\n array('issue_id' => '93','lang_id' => '1','name' => 'Water Maintenance -> Broken Pipeline','created_at' => '2020-04-25 06:57:37','updated_at' => '2020-04-25 06:57:37','deleted_at' => NULL),\n array('issue_id' => '94','lang_id' => '1','name' => 'Water Maintenance -> Contaminated Water','created_at' => '2020-04-25 06:57:47','updated_at' => '2020-04-25 06:57:47','deleted_at' => NULL),\n array('issue_id' => '95','lang_id' => '1','name' => 'Water Maintenance -> Illegal Connection','created_at' => '2020-04-25 06:57:58','updated_at' => '2020-04-25 06:57:58','deleted_at' => NULL),\n array('issue_id' => '96','lang_id' => '1','name' => 'Water Maintenance -> Leakage of Water','created_at' => '2020-04-25 06:58:07','updated_at' => '2020-04-25 06:58:07','deleted_at' => NULL),\n array('issue_id' => '97','lang_id' => '1','name' => 'Water Maintenance -> Low Water Supply/ No Water','created_at' => '2020-04-25 06:58:18','updated_at' => '2020-04-25 06:58:18','deleted_at' => NULL),\n array('issue_id' => '98','lang_id' => '1','name' => 'Road Maintenance -> Inspection Public Toilets','created_at' => '2020-04-25 06:58:28','updated_at' => '2020-04-25 06:58:28','deleted_at' => NULL),\n array('issue_id' => '99','lang_id' => '1','name' => 'Road Maintenance -> Gate Broken','created_at' => '2020-04-25 06:58:38','updated_at' => '2020-04-25 06:58:38','deleted_at' => NULL),\n array('issue_id' => '100','lang_id' => '1','name' => 'Water Maintenance -> Water ATM Machine Not Working','created_at' => '2020-04-25 06:58:48','updated_at' => '2020-04-25 06:58:48','deleted_at' => NULL),\n array('issue_id' => '101','lang_id' => '1','name' => 'Road Maintenance -> Road Repair','created_at' => '2020-04-25 06:58:58','updated_at' => '2020-04-25 06:58:58','deleted_at' => NULL),\n array('issue_id' => '102','lang_id' => '1','name' => 'Building Maintenance -> Broken Manhole','created_at' => '2020-04-25 06:59:11','updated_at' => '2020-04-25 06:59:31','deleted_at' => NULL),\n array('issue_id' => '103','lang_id' => '1','name' => 'Building Maintenance -> Malba Stacked','created_at' => '2020-04-25 06:59:43','updated_at' => '2020-04-25 06:59:43','deleted_at' => NULL),\n array('issue_id' => '104','lang_id' => '1','name' => 'Building Maintenance -> Sewer Problem','created_at' => '2020-04-25 06:59:53','updated_at' => '2020-04-25 06:59:53','deleted_at' => NULL),\n array('issue_id' => '105','lang_id' => '1','name' => 'Building Maintenance -> Maintenance of Building','created_at' => '2020-04-25 07:00:04','updated_at' => '2020-04-25 07:00:04','deleted_at' => NULL),\n array('issue_id' => '106','lang_id' => '1','name' => 'Building Maintenance -> Water Related Problem','created_at' => '2020-04-25 07:00:14','updated_at' => '2020-04-25 07:00:14','deleted_at' => NULL),\n array('issue_id' => '107','lang_id' => '1','name' => 'Building Maintenance -> Gate Broken','created_at' => '2020-04-25 07:00:24','updated_at' => '2020-04-25 07:00:24','deleted_at' => NULL),\n array('issue_id' => '108','lang_id' => '1','name' => 'Patient Emergency','created_at' => '2020-04-25 07:00:34','updated_at' => '2020-04-25 07:00:34','deleted_at' => NULL),\n array('issue_id' => '109','lang_id' => '1','name' => 'Health Issue','created_at' => '2020-04-25 07:00:44','updated_at' => '2020-04-25 07:00:44','deleted_at' => NULL),\n array('issue_id' => '110','lang_id' => '1','name' => 'Corona Symptoms','created_at' => '2020-04-25 07:00:58','updated_at' => '2020-04-25 07:00:58','deleted_at' => NULL),\n array('issue_id' => '111','lang_id' => '1','name' => 'Unauthorised Construction','created_at' => '2020-04-25 07:01:10','updated_at' => '2020-04-25 07:01:10','deleted_at' => NULL),\n array('issue_id' => '112','lang_id' => '1','name' => 'Unauthorised Construction -> Illegal Construction','created_at' => '2020-04-25 07:01:23','updated_at' => '2020-04-25 07:01:23','deleted_at' => NULL),\n array('issue_id' => '113','lang_id' => '1','name' => 'Unauthorised Construction -> Violation of Building Regulation','created_at' => '2020-04-25 07:01:38','updated_at' => '2020-04-25 07:01:38','deleted_at' => NULL),\n array('issue_id' => '114','lang_id' => '1','name' => 'Pollution due to Construction Activities','created_at' => '2020-04-25 07:01:48','updated_at' => '2020-04-25 07:01:48','deleted_at' => NULL)\n );\n\n if(DB::table($table_name)->get()->count() == 0) {\n DB::table($table_name)->insert($issues);\n DB::table($table_name_langs)->insert($issue_langs);\n } else {\n echo \"SeedingError: `$table_name` table is not empty\\n\";\n }\n }", "public function issues()\n {\n return $this->belongsToMany('App\\Issue', 'issue_source');\n }", "public function getIssues($type = null)\n {\n return $type ? (isset($this->issues[$type]) ? $this->issues[$type] : array()) : $this->issues;\n }", "public function __construct(requests $request,invoicerecords $invoiceRecord,packets $packets,$user)\n {\n<<<<<<< HEAD\n $this->request = $request;\n self::handle();\n=======\n $this->request = $invoiceRecord;\n>>>>>>> origin/abdulazizdamlahilast\n\n }", "public function test_mod_lti_create_tool_type_nonexistant_file() {\n $this->expectException('moodle_exception');\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/doesntexist.xml'), '', '');\n }", "public function create()\n {\n throw new Exception('Not yet implemented');\n }", "public function testSourceErrors()\n {\n $Image = new \\Rundiz\\Image\\Drivers\\Gd(self::$source_images_dir . 'city-amsterdam.jpg');\n $this->assertTrue($Image->status);\n // now errors.\n $Image = new \\Rundiz\\Image\\Drivers\\Gd(self::$source_images_dir . 'city-amsterdam-text.jpg');\n $this->assertFalse($Image->status);\n $this->assertSame(\\Rundiz\\Image\\Drivers\\Gd::RDIERROR_SRC_NOTIMAGE, $Image->statusCode);\n $Image = new \\Rundiz\\Image\\Drivers\\Gd(self::$source_images_dir . 'image-not-exists' . date('YmdHis') . '.jpg');\n $this->assertFalse($Image->status);\n $this->assertSame(\\Rundiz\\Image\\Drivers\\Gd::RDIERROR_SRC_NOTEXISTS, $Image->statusCode);\n }", "public function getIssue($id, $query = array())\n {\n $response = $this->client->get(\"/issue/$id\", $query);\n\n return new Issue($response);\n\n }", "private function create_WD_reference_item($citation_obj, $citation, $t_source)\n {\n $obj = $citation_obj[0];\n\n // /* manual fixes\n if($val = @$obj->title[0]) $obj->title[0] = self::manual_fix_title($val);\n // */\n\n // print_r($obj); exit(\"\\nstop muna\\n\");\n $rows = array();\n $rows[] = 'CREATE';\n\n // /* scholarly ?\n // The \"instance of\" classifications: To keep things simple, we could use \"scholarly article\" if the reference parsers tell us it's a journal article, \n // and \"scholarly work\" for everything else.\n $publication_types = array(\"article-journal\", \"chapter\", \"book\");\n if(in_array(@$obj->type, $publication_types)) {}\n else echo(\"\\nUndefined publication type. [\".@$obj->type.\"]\\nWill terminate.\\n\");\n if(stripos(@$obj->type, 'journal') !== false) $scholarly = \"scholarly article\";\n else $scholarly = \"scholarly work\";\n // */\n\n // /* first two entries: label and description\n # LAST TAB Lfr TAB \"Le croissant magnifique!\"\n if($title = @$obj->title[0]) {\n $rows[] = 'LAST|Len|' .'\"'.$title.'\"';\n $rows[] = 'LAST|Den|' .'\"'.self::build_description($obj, $scholarly).'\"';\n }\n // */\n\n // /* scholarly xxx\n // if($dois = @$obj->doi) $rows[] = \"LAST|P31|Q13442814\"; // instance of -> scholarly article //old\n if($scholarly == \"scholarly article\") $rows[] = \"LAST|P31|Q13442814 /* scholarly article */\"; // instance of -> scholarly article\n else $rows[] = \"LAST|P31|Q55915575 /* scholarly work */\"; // instance of -> scholarly work\n // */\n\n if($authors = @$obj->author) $rows = self::prep_for_adding($authors, 'P2093', $rows); #ok use P50 if author is an entity\n if($publishers = @$obj->publisher) $rows = self::prep_for_adding($publishers, 'P123', $rows, \"publisher\");\n if($place_of_publications = @$obj->location) $rows = self::prep_for_adding($place_of_publications, 'P291', $rows, \"place of publication\");\n if($pages = @$obj->pages) $rows = self::prep_for_adding($pages, 'P304', $rows, \"page(s)\"); #ok\n // if($issues = @$obj->issue) $rows = self::prep_for_adding($issues, 'P433', $rows); #ok\n if($volumes = @$obj->volume) $rows = self::prep_for_adding($volumes, 'P478', $rows, \"volume\"); #ok\n if($publication_dates = @$obj->date) $rows = self::prep_for_adding($publication_dates, 'P577', $rows, \"publication date\"); #ok\n if($chapters = @$obj->chapter) $rows = self::prep_for_adding($chapters, 'P792', $rows, \"chapter\"); //No 'chapter' parsed by AnyStyle. Eli should do his own parsing.\n if($titles = @$obj->title) $rows = self::prep_for_adding($titles, 'P1476', $rows, \"title\"); #ok\n\n // /* Eli's initiative, but was given a go signal -> property 'type of reference' (P3865)\n if($type = @$obj->type) $rows = self::prep_for_adding(array($type), 'P3865', $rows); #ok\n // */\n\n // /* Eli's initiative but close to Jen's \"published in\" (P1433) proposal\n if($containers = @$obj->{\"container-title\"}) $rows = self::prep_for_adding($containers, 'P1433', $rows, \"published in\"); #ok\n // */\n\n // Others:\n if($dois = @$obj->doi) $rows = self::prep_for_adding($dois, 'P356', $rows, \"DOI\"); #ok\n else { //check if t.source is DOI, if yes use it | New: Mar 13, 2023\n if($dois = $this->get_doi_from_tsource($t_source)) $rows = self::prep_for_adding($dois, 'P356', $rows, \"DOI\");\n }\n /* seems no instructions to use this yet:\n if($reference_URLs = @$obj->url) $rows = self::prep_for_adding($reference_URLs, 'P854', $rows);\n */\n\n /* Eli's choice: will take Jen's approval first -> https://www.wikidata.org/wiki/Property:P1683 -> WikiData says won't use it here.\n $rows = self::prep_for_adding(array($citation), 'P1683', $rows);\n */\n\n print_r($rows);\n $WRITE = Functions::file_open($this->citation_export_file, \"w\");\n foreach($rows as $row) fwrite($WRITE, $row.\"\\n\");\n fclose($WRITE);\n\n // /* new: so it continues...\n $this->debug['citation not matched in WD'][$t_source][$citation] = '';\n return \"-to be assigned-\";\n // */\n\n /* NEXT TODO: is the exec_shell command to trigger QuickStatements */\n exit(\"\\n[$t_source]\\n[$citation]\\nUnder construction...\\n\");\n \n /* Reminders:\n CREATE\n LAST\tP31\tQ13442814\n instance of -> scholarly article\n\n scholarly article https://www.wikidata.org/wiki/Q13442814 for anything with a DOI and \n scholarly work https://www.wikidata.org/wiki/Q55915575 for all other items we create for sources.\n */\n \n // CREATE\n // LAST|Len|\"Brazilian Flora 2020 project - Projeto Flora do Brasil 2020\"\n // LAST|Den|\"scholarly article by G\"\n // LAST|P31|Q13442814 /* scholarly article */\n // LAST|P2093|\"G, Brazil Flora\"\n // LAST|P478|\"393\" /* volume */\n // LAST|P577|+2019-00-00T00:00:00Z/9\n // LAST|P1476|en:\"Brazilian Flora 2020 project - Projeto Flora do Brasil 2020\"\n // LAST|P356|\"10.15468/1mtkaw\" /* DOI */\n\n\n // created...\n // [t.source] => https://doi.org/10.1007/978-3-662-02604-5_58\n // [t.citation] => C. N. PAGE. 1990. Pinaceae. In: The families and genera of vascular plants. Volume I; Pteridophytes and Gymnosperms. K. Kubitzki, K. U. Kramer and P. S. Green, eds.\n // https://www.wikidata.org/wiki/Q117088084\n // CREATE\n // LAST|Len|\"Pinaceae. In: The families and genera of vascular plants\"\n // LAST|Den|\"scholarly work by PAGE\"\n // LAST|P31|Q55915575 /* scholarly work */\n // LAST|P2093|\"PAGE, C.N.\"\n // LAST|P478|\"I\" /* volume */\n // LAST|P577|+1990-00-00T00:00:00Z/9\n // LAST|P1476|en:\"Pinaceae. In: The families and genera of vascular plants\"\n // LAST|P356|\"10.1007/978-3-662-02604-5_58\" /* DOI */\n\n // to be created...\n // [t.source] => https://doi.org/10.1007/978-3-540-31051-8\n // [t.citation] => J.W. Kadereit, C. Jeffrey, K. Kubitzki (eds). 2007. The families and genera of vascular plants. Volume VIII; Flowering Plants; Eudicots; Asterales. Springer Nature.\n // CREATE\n // LAST|Len|\"The families and genera of vascular plants\"\n // LAST|Den|\"scholarly work by Kadereit et al.\"\n // LAST|P31|Q55915575 /* scholarly work */\n // LAST|P2093|\"Kadereit, J.W.\"\n // LAST|P2093|\"Jeffrey, C.\"\n // LAST|P2093|\"Kubitzki, K.\"\n // LAST|P123|\"Flowering Plants; Eudicots; Asterales. Springer Nature\" /* publisher */\n // LAST|P478|\"VIII\" /* volume */\n // LAST|P577|+2007-00-00T00:00:00Z/9\n // LAST|P1476|en:\"The families and genera of vascular plants\"\n // LAST|P3865|Q55915575 /* book */\n // LAST|P356|\"10.1007/978-3-540-31051-8\" /* DOI */\n \n \n }", "public function __construct()\n {\n parent::__construct();\n\n $this->config = config('gitception');\n\n if(!$this->config['email'] || !$this->config['password']){\n return;\n }\n\n $email = Crypt::decrypt($this->config['email']);\n $password = Crypt::decrypt($this->config['password']);\n\n $this->bitbucket = new Issues();\n $this->bitbucket->setCredentials(new Basic($email, $password));\n }", "public function __construct($params)\n {\n $this->params = $params;\n if( isset($params['id']) ) {\n $this->id = $params['id'];\n }\n if( isset($params['name']) ) {\n $this->name = $params['name'];\n }\n if( isset($params['description']) ) {\n $this->description = $params['description'];\n }\n if( isset($params['notes']) ) {\n $this->notes = $params['notes'];\n }\n if( isset($params['poNumber']) ) {\n $this->poNumber = $params['poNumber'];\n }\n if( isset($params['intendedUse']) ) {\n $this->intendedUse = new IntendedUse($params['intendedUse']);\n }\n if( isset($params['sourceLanguage']) ) {\n $this->sourceLanguage = new Language($params['sourceLanguage']);\n }\n if( isset($params['targetLanguages']) ) {\n $this->targetLanguages = $this->transformLanguageList($params['targetLanguages']);\n }\n if( isset($params['status']) ) {\n $this->status = new CodeAndDisplay($params['status']);\n }\n if( isset($params['department']) ) {\n $this->department = new Department($params['department']);\n }\n if( isset($params['owner']) ) {\n $this->owner = new User($params['owner']);\n }\n if( isset($params['followers']) ) {\n $this->followers = $this->transformFollowerList($params['followers']);\n }\n if( isset($params['bidDueDate']) ) {\n $this->bidDueDate = new \\DateTime($params['bidDueDate']);\n }\n if( isset($params['deliveryDueDate']) ) {\n $this->deliveryDueDate = new \\DateTime($params['deliveryDueDate']);\n }\n if( isset($params['createdDate']) ) {\n $this->createdDate = new \\DateTime($params['createdDate']);\n }\n if( isset($params['bidSelectDeadlineDate']) ) {\n $this->bidSelectDeadlineDate = new \\DateTime($params['bidSelectDeadlineDate']);\n }\n if( isset($params['amount']) ) {\n $this->amount = $params['amount'];\n }\n if( isset($params['path']) ) {\n $this->path = $params['path'];\n }\n }", "public function getIssueById( $id )\n\t{\n\t\treturn $this->issue->with('stage')->find($id);\n\t}", "public function test_mod_lti_create_tool_type_bad_file() {\n $this->expectException('moodle_exception');\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/rsstest.xml'), '', '');\n }", "public function GetIssue($c)\n {\n global $db;\n $id = (isset($c['comic_id']) ? $c['comic_id'] : $c);\n\n if (!isset($this->issues[$id]))\n $this->issues[$id] = new Issue(isset($c['name']) ? $c['name'] : $db->GetValue(\"select name from comics where comic_id = {$id}\", 'name'));\n\n return $this->issues[$id];\n }", "public function getChangesFromIssue(int $issueId) : array\n {\n $results = $this->repository->fetchIssue(\n \"TYPO3-Documentation\",\n \"TYPO3CMS-Reference-CoreApi\",\n $issueId\n );\n\n $body = $results['body'] ?? '';\n\n $lines = explode(\"\\n\", $body);\n $types = array_keys($this->changes);\n\n $type = '';\n foreach ($lines as $line) {\n foreach ($types as $someType) {\n if (strpos($line, \"# $someType\", 0) === 0) {\n $type = $someType;\n break;\n }\n }\n if ($type && $line && strpos($line, '* [', 0) ===0) {\n // get title\n $matches = [];\n $result = preg_match('#\\* \\[[x ]?\\] \\[([^\\]]*)#', $line, $matches);\n if ($result != 1 || !($matches[1] ?? false)) {\n print(\"ERROR: No match for pattern title ... in line $line\\n\");\n exit(1);\n }\n $title = $matches[1];\n\n // get $url\n $matches = [];\n $result = preg_match('#\\* \\[[x ]?\\] \\[[^\\]]*\\]\\((.*)\\)#', $line, $matches);\n if ($result != 1 || !($matches[1] ?? false)) {\n print(\"ERROR: No match for pattern url ... in line $line\\n\");\n exit(1);\n }\n $url = $matches[1];\n\n $this->changesInIssue[$type]['changelogs'][$title] = [\n 'title' => $title,\n 'url' => $url,\n 'line' => $line\n ];\n }\n }\n\n return $this->changesInIssue;\n }", "function code() {\n\t\t$code_issue_replace = false;\n\t\tif (in_array('replace', $this->args)) {\n\t\t\t$code_issue_replace = true;\n\t\t}\n\t\t$files = $this->files();\n\t\tforeach ( $files as $file ) {\n\t\t\t$code = file_get_contents($file);\n\t\t\t$issues = $this->code_issue_find($code);\n\t\t\tif (!empty($issues)) {\n\t\t\t\tif ($code_issue_replace) {\n\t\t\t\t\t$this->code_issue_replace($file, $code);\n\t\t\t\t} else {\n\t\t\t\t\t$this->out($file);\n\t\t\t\t\tprint_r($issues);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function __construct($commit_msg)\n {\n $this->commit_msg = $commit_msg;\n $this->branch = isset($branch) ? $branch : '';\n $this->repo = isset($repo) ? $repo : $this->repo;\n\n $this->repo_url = 'https://github.com/' . urlencode(TYPOLIB_GITHUB_ACCOUNT)\n . '/' . $this->repo . '.git';\n\n $this->directory = DATA_ROOT . $this->repo . '/';\n $this->config_file = $this->directory . '.git/config';\n\n #FIXME: edit the config with GitPhp, allow custom email/name per Pull Request\n $this->user_config = \"[user]\\n\"\n . ' email = ' . CLIENT_GITHUB_EMAIL . \"\\n\"\n . ' name = ' . CLIENT_GITHUB_COMMITTER . \"\\n\";\n\n $this->client_remote_url = 'https://' . urlencode(CLIENT_GITHUB_ACCOUNT)\n . ':' . urlencode(CLIENT_GITHUB_PASSWORD)\n . '@github.com/' . urlencode(CLIENT_GITHUB_ACCOUNT)\n . '/' . $this->repo . '.git';\n\n // We use the Monolog library to log our events\n $this->logger = new Logger('PullRequest');\n $this->logger->pushHandler(new StreamHandler(INSTALL_ROOT . 'logs/pr-errors.log'));\n\n // Also log to error console in Debug mode\n if (DEBUG) {\n $this->logger->pushHandler(new ErrorLogHandler());\n }\n\n try {\n $this->git = new GitRepository($this->directory);\n } catch (GitException $e) {\n $this->logger->error('Failed to initialize Git repository. Error: '\n . $e->getMessage());\n }\n $this->cloneAndConfig();\n }", "public function testGeneratesAPullRequestsSectionUnderRelease()\n {\n $mockRepository = $this->getMockRepositoryWithIssues([$this->loadFixtureData('issues')[1]]);\n $changelogGenerator = new ChangelogGenerator($mockRepository);\n\n $this->assertEquals(\n $this->loadFile('output/release-with-pull-requests-only-section.md'),\n $changelogGenerator->generate()\n );\n }", "protected function addIssuesToRevu(array $data)\n {\n $xml = simplexml_load_file(Settings::REVU_PATH);\n /** @var SimpleXMLElement $issues */\n $issues = $xml->issues;\n $this->createIssue($issues, $data);\n $xml->saveXML(Settings::REVU_PATH);\n }", "public function testImageCandidateFactoryWithInvalidDescriptor()\n {\n ImageCandidateFactory::createImageCandidateFromFileAndDescriptor('image.jpg', '124abc');\n }", "abstract public function get_sources();", "public function badMilestoneProvider() {\n // all of which were tripping over the same code\n\n return [\n ['offices/qa'],\n ['49018/Data.json'],\n ['48027/Data.json'],\n ['48027/digitalstrategy.json'],\n ['48112/Data.json'],\n ['49015/%252527?highlight=edi'],\n ['49015/e.g'],\n ['49015/http%3a%2f%2fr87.com%2fn%3f%00.php?highlight=edi']\n ];\n\n }", "public function assignIssue(Issue $issue)\n {\n $this->assignedIssues[] = $issue;\n\n return $this;\n }", "public function issuestore(Request $request, Repo $repo)\n {\n $request->validate(\n [\n \"name\" => \"max:50\",\n \"email\" => \"max:100\",\n \"title\" => \"required|max:50\",\n \"details\" => \"required|max:255\",\n ]\n );\n\n $ghclient = new GHClient();\n $ghclient->authenticate($repo->user->accesstoken, GHClient::AUTH_ACCESS_TOKEN);\n\n $title = $request->title;\n $body = \"Name: \" . $request->name . \"\\r\";\n $body .= \"Email: \" . $request->email . \"\\r\";\n $body .= \"\\r\\r\";\n $body .= $request->details;\n\n $explodedname = explode('/', $repo->name);\n\n // return $explodedname;\n\n $ghclient->issue()->create($explodedname[0], $explodedname[1], array('title' => $title , 'body' => $body));\n return redirect()->route('repo.issues', ['repo' => $repo->id]);\n }", "public function testV1ImportCreateSourcePost()\n {\n }" ]
[ "0.5615984", "0.54565364", "0.5437673", "0.5394115", "0.5293787", "0.5279442", "0.52691895", "0.52210164", "0.50953907", "0.50837404", "0.5074793", "0.5028427", "0.5028029", "0.5004874", "0.5001713", "0.4951741", "0.49508682", "0.4947335", "0.49119937", "0.4858314", "0.48488826", "0.48429722", "0.47809064", "0.476501", "0.4753457", "0.4735808", "0.4734025", "0.47315857", "0.4728348", "0.46989387", "0.4696647", "0.46939632", "0.4675897", "0.4670992", "0.4663237", "0.46380103", "0.46058226", "0.4602198", "0.45977205", "0.45917824", "0.45894805", "0.45851994", "0.45807913", "0.45658746", "0.45588526", "0.45433885", "0.45421037", "0.45394802", "0.45039746", "0.44892484", "0.44830292", "0.44747856", "0.44484907", "0.44453317", "0.44285145", "0.44247833", "0.44245642", "0.44203997", "0.44170356", "0.44023517", "0.43835127", "0.43811", "0.43766868", "0.43637982", "0.43532142", "0.43517593", "0.43404686", "0.43290207", "0.43243158", "0.43201643", "0.4317112", "0.43127787", "0.43124804", "0.43096128", "0.43078062", "0.43060535", "0.4299571", "0.42931455", "0.42843527", "0.42815226", "0.42779955", "0.42723733", "0.42666623", "0.42659423", "0.42644212", "0.4263281", "0.4261517", "0.42574027", "0.4256166", "0.42541468", "0.42487022", "0.4244857", "0.4240531", "0.42334524", "0.42311573", "0.42263222", "0.4224241", "0.42227036", "0.4222066", "0.4221017" ]
0.64900386
0
Get all issue stages
public function getIssueStages() { $stages = $this->issueStage->orderBy('order')->get()->toArray(); $stages[ (count($stages) - 1) ]['is_last'] = true; return $stages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function Rechercher_Stages(){\n\t\t \t//connexion à la base de données\n\t\t \t$oMysqliLib = new MySqliLib();\n\t\t \t//requête de recherche du Document\n\t\t \t$sRequete = \"SELECT * FROM stages\";\t\t \t\t\n\t\t \t\n\t\t \t//exécuter la requête\n\t\t \t$oResult = $oMysqliLib->executer($sRequete); \n\t\t \t//récupérer le tableau des enregistrements\n\t\t \t$aStage= $oMysqliLib->recupererTableau($oResult);\n\t\t\t\n\t\t \t//retourner array contenant les stages\n\t\t \treturn $aStage;\t\n\t\t }", "public function getStagesForWS() {}", "public function get_num_stages();", "public static function version_stages(DataObject $object) {\n\t\t$stages = array();\n\t\t$versioned = $object->getExtensionInstance('Versioned');\n\t\tif ($versioned) {\n\t\t\t$stages = $versioned->getStages();\n\t\t}\n\t\treturn $stages;\n\t}", "public function get_stages_name();", "protected function getStagesService() {}", "public function getPreviousStages()\n {\n /* get active stage */\n $stages = $this->model->whereCompanyId($this->scope->id())\n ->whereActive(0)\n ->get();\n\n return ApiResponse::success([\n 'data' => $stages,\n ]);\n }", "public function getStagesCount()\n {\n return $this->count(self::_STAGES);\n }", "public function index()\n\t{\n\t\t$issuestatuses = IssueStatus::all();\n\t\treturn $issuestatuses;\n\t}", "function afficherstages(){\n\t\t$sql=\"SElECT * From stage\";\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}", "public function index()\n {\n $stages = Stage::all();\n return view('stages.index', compact('stages'));\n }", "public function getStageIndex()\n {\n return $this->get(self::_STAGE_INDEX);\n }", "public function getStage()\n {\n return $this->stage;\n }", "public function get_issues() {\n \n $issues = [];\n \n $q = 'SELECT nid, title FROM {node_field_data} ';\n $q .= 'WHERE type = :t ';\n $q .= 'AND status = :s ';\n $q .= 'ORDER BY created DESC ';\n $args = [\n ':t' => 'issue',\n ':s' => 1\n ];\n \n $connection = \\Drupal::database();\n $result = $connection->query($q, $args);\n if ($result) {\n \n $am = \\Drupal::service('path.alias_manager');\n \n while ($row = $result->fetchAssoc()) {\n \n $d = [\n 'id' => $row['nid'],\n 'name' => $row['title'],\n 'url' => $am->getAliasByPath('/node/'.$row['nid'])\n ];\n $issues[$row['nid']] = $d;\n } \n }\n \n return $issues;\n \n }", "public function getIssues()\n {\n return $this->issues;\n }", "public function getIssues()\n {\n return $this->issues;\n }", "protected function resolveWorkspacesSetStageDependencies() {}", "public function getStage()\n {\n return $this->get(self::_STAGE);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $maitresDeStages = $em->getRepository('AppBundle:MaitresDeStage')->findAll();\n\n return $maitresDeStages;\n }", "public static function stage(CandidateStage $stage): ?array\n {\n // has a decision been made at this stage?\n $decision = null;\n if ($stage->status != CandidateStage::STATUS_PENDING) {\n $decider = $stage->decider()->with('position')->first();\n\n $decision = [\n 'decider' => $decider ? [\n 'id' => $decider->id,\n 'name' => $decider->name,\n 'avatar' => ImageHelper::getAvatar($decider, 32),\n 'position' => (! $decider->position) ? null : [\n 'id' => $decider->position->id,\n 'title' => $decider->position->title,\n ],\n 'url' => route('employees.show', [\n 'company' => $decider->company,\n 'employee' => $decider,\n ]),\n ] : [\n 'id' => null,\n 'name' => $stage->decider_name,\n ],\n 'decided_at' => $stage->decided_at ? DateHelper::formatDate($stage->decided_at) : null,\n ];\n }\n\n return [\n 'id' => $stage->id,\n 'status' => $stage->status,\n 'decision' => $decision,\n ];\n }", "public function workflowsAction() {\n\t$workflows = new Workflows();\n\t$this->view->workflows = $workflows->getStageNames();\n\t}", "public function getStagesAt($offset)\n {\n return $this->get(self::_STAGES, $offset);\n }", "public function findOpenIssues() { \n $q = $this->createQueryBuilder('e')\n ->select('e.eoid as id,e.joid,e.alarm,e.alarmTime,e.state,e.stateTime,e.response,e.theUser,e.eventComment,j.jobName,j.description,j.status')\n ->leftjoin('AriiATSBundle:UjoJobst','j',\\Doctrine\\ORM\\Query\\Expr\\Join::WITH,'e.joid = j.joid')\n ->where('e.state < 45')\n ->orderBy('e.eoid','desc')\n ->setMaxResults(1000)\n ->getQuery();\n return $q->getResult();\n }", "public function getStagesForWSUser() {}", "public function getOpenedActStageCount()\n {\n return $this->count(self::_OPENED_ACT_STAGE);\n }", "public function getIssues()\n {\n return $this->data['issues'];\n }", "public function getStage(): int\n {\n return self::STAGE;\n }", "public function milestone(): Collection\n {\n return $this->get('api/blocks/getMilestone');\n }", "public function getIssueTags() {\n\t\treturn $this->hasMany(IssueTag::class, ['type' => 'id']);\n\t}", "public function index()\n {\n dd(Issue::get()->where('state','Unprocessed')->take(20));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $issues = $em->getRepository('BorrowersIssueBundle:Issue')->listIssues();\n\n return array('issues' => $issues);\n }", "public function getPipelines(): array;", "public function getStates() {\n\t\treturn empty( $this->container['states'] ) ? null : $this->container['states'];\n\t}", "private function getIssues()\n {\n\n $issues = [];\n $total_issues = $this->totalIssues();\n if ($this->infos['errorBoolean']) {\n return 0;\n }\n if ($total_issues % 100 !== 0 ) {\n $total_int = intdiv($total_issues, 100) +1;\n }else {\n $total_int = $total_issues/100;\n }\n for ($i=0; $i < $total_int ; $i++) {\n $start = 100*$i;\n $max = 100*($i+1);\n $url = $this->base_uri.'search?jql=project='.$this->project.'&startAt='.$start.'&maxResults='.$max;\n $temp= $this->request($url);\n $issues[] = array(json_decode($temp));\n }\n\n return $issues;\n\n }", "public function getStates(): StateSet;", "public function getIssueById( $id )\n\t{\n\t\treturn $this->issue->with('stage')->find($id);\n\t}", "public function index()\n {\n // could be problematic with a hell of a lot sprints...\n $allSprintes = \\Auth::user()->sprints;\n $active = $allSprintes->filter(fn ($s) => $s->is_active)->first();\n $prev = $allSprintes->filter(fn ($s) => $s->id === $active->previous_sprint_id)->first();\n $next = $allSprintes->filter(fn ($s) => $s->previous_sprint_id === $active->id)->first();\n\n return [\n [\n 'id' => $prev->id,\n 'last' => true,\n 'current' => false,\n 'next' => false,\n ],[\n 'id' => $active->id,\n 'last' => false,\n 'current' => true,\n 'next' => false,\n ],[\n 'id' => $next->id,\n 'last' => false,\n 'current' => false,\n 'next' => true,\n ]\n ];\n }", "public function getIssues()\n {\n $issues = array();\n\n foreach ($this->manager->getBoard($this->boardId)->getLists() as $list) {\n $issues = array_merge($issues, $list->getCards());\n }\n\n return array_map(array($this, 'getIssueId'), $issues);\n\n }", "public function getExitDescriptors(): array\n {\n //Get the room descriptors from the database\n $exitDescriptors = $this->entityManager\n ->getRepository(ExitDescriptor::class)\n ->findAll();\n\n return $exitDescriptors;\n }", "public function run()\n {\n $table_name = 'issues';\n $table_name_langs = 'issue_langs';\n\n $issues = array(\n array('id' => '1','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '2','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '3','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '4','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '5','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '6','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => '2020-04-25 06:31:42','deleted_at' => NULL),\n array('id' => '7','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '8','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '9','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '10','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '11','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '12','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '13','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '14','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '15','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '16','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '17','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '18','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '19','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '20','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '21','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '22','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '23','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '24','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '25','issue_type_id' => '1','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '26','issue_type_id' => '2','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '27','issue_type_id' => '2','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '28','issue_type_id' => '2','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '29','issue_type_id' => '2','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '30','issue_type_id' => '2','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '31','issue_type_id' => '3','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '32','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '33','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '34','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '35','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '36','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '37','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '38','issue_type_id' => '4','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '39','issue_type_id' => '5','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '40','issue_type_id' => '5','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '41','issue_type_id' => '5','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '42','issue_type_id' => '5','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '43','issue_type_id' => '6','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '44','issue_type_id' => '6','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '45','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '46','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '47','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '48','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '49','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '50','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '51','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '52','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '53','issue_type_id' => '7','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '54','issue_type_id' => '8','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '55','issue_type_id' => '8','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '56','issue_type_id' => '8','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '57','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '58','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '59','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '60','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '61','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '62','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '63','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '64','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '65','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '66','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '67','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '68','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '69','issue_type_id' => '9','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '70','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '71','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '72','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '73','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '74','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '75','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '76','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '77','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '78','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '79','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '80','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '81','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '82','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '83','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '84','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '85','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '86','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '87','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '88','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '89','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '90','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '91','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '92','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '93','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '94','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '95','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '96','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '97','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '98','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '99','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '100','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '101','issue_type_id' => '10','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '102','issue_type_id' => '11','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '103','issue_type_id' => '11','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '104','issue_type_id' => '11','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '105','issue_type_id' => '11','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '106','issue_type_id' => '11','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '107','issue_type_id' => '11','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '108','issue_type_id' => '12','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '109','issue_type_id' => '12','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '110','issue_type_id' => '12','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '111','issue_type_id' => '13','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '112','issue_type_id' => '13','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '113','issue_type_id' => '13','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL),\n array('id' => '114','issue_type_id' => '13','site_id' => '1','publish_status' => '1','position' => NULL,'created_at' => NULL,'updated_at' => NULL,'deleted_at' => NULL)\n );\n\n $issue_langs = array(\n array('issue_id' => '1','lang_id' => '1','name' => 'Swachh Bharat-&gt;Garbage Dumps','created_at' => '2020-04-24 18:42:30','updated_at' => '2020-04-24 18:42:30','deleted_at' => NULL),\n array('issue_id' => '2','lang_id' => '1','name' => 'Sweeping','created_at' => '2020-04-24 18:42:50','updated_at' => '2020-04-24 18:42:50','deleted_at' => NULL),\n array('issue_id' => '3','lang_id' => '1','name' => 'Burning Garbage','created_at' => '2020-04-24 18:43:06','updated_at' => '2020-04-24 18:43:06','deleted_at' => NULL),\n array('issue_id' => '4','lang_id' => '1','name' => 'Malba Stuck','created_at' => '2020-04-24 18:47:29','updated_at' => '2020-04-24 18:47:29','deleted_at' => NULL),\n array('issue_id' => '5','lang_id' => '1','name' => 'Potholes','created_at' => '2020-04-25 06:31:07','updated_at' => '2020-04-25 06:31:07','deleted_at' => NULL),\n array('issue_id' => '6','lang_id' => '1','name' => 'Swachh Bharat -> Urination in Public / Defection','created_at' => '2020-04-25 06:31:27','updated_at' => '2020-04-25 06:31:42','deleted_at' => NULL),\n array('issue_id' => '7','lang_id' => '1','name' => 'Stray Dogs','created_at' => '2020-04-25 06:31:58','updated_at' => '2020-04-25 06:31:58','deleted_at' => NULL),\n array('issue_id' => '8','lang_id' => '1','name' => 'Swachh Bharat -> No electricity in public toilets','created_at' => '2020-04-25 06:32:18','updated_at' => '2020-04-25 06:32:18','deleted_at' => NULL),\n array('issue_id' => '9','lang_id' => '1','name' => 'Swachh Bharat -> Sweeping not done','created_at' => '2020-04-25 06:34:19','updated_at' => '2020-04-25 06:34:19','deleted_at' => NULL),\n array('issue_id' => '10','lang_id' => '1','name' => 'Swachh Bharat -> No water supply in public toilets','created_at' => '2020-04-25 06:34:31','updated_at' => '2020-04-25 06:34:31','deleted_at' => NULL),\n array('issue_id' => '11','lang_id' => '1','name' => 'Swachh Bharat -> Public Toilets Blockage','created_at' => '2020-04-25 06:34:46','updated_at' => '2020-04-25 06:34:46','deleted_at' => NULL),\n array('issue_id' => '12','lang_id' => '1','name' => 'Swachh Bharat -> Garbage Vehicle not arrived','created_at' => '2020-04-25 06:34:57','updated_at' => '2020-04-25 06:34:57','deleted_at' => NULL),\n array('issue_id' => '13','lang_id' => '1','name' => 'Swachh Bharat -> Dead Animal','created_at' => '2020-04-25 06:35:08','updated_at' => '2020-04-25 06:35:08','deleted_at' => NULL),\n array('issue_id' => '14','lang_id' => '1','name' => 'Swachh Bharat -> Dustbin Not Cleaned','created_at' => '2020-04-25 06:35:17','updated_at' => '2020-04-25 06:35:17','deleted_at' => NULL),\n array('issue_id' => '15','lang_id' => '1','name' => 'Swachh Bharat -> Public toilet(s) cleaning','created_at' => '2020-04-25 06:35:30','updated_at' => '2020-04-25 06:35:30','deleted_at' => NULL),\n array('issue_id' => '16','lang_id' => '1','name' => 'Swachh Bharat -> Open Manholes Or Drains','created_at' => '2020-04-25 06:35:49','updated_at' => '2020-04-25 06:35:49','deleted_at' => NULL),\n array('issue_id' => '17','lang_id' => '1','name' => 'Swachh Bharat -> Sewerage or Storm Water Overflow','created_at' => '2020-04-25 06:36:02','updated_at' => '2020-04-25 06:36:02','deleted_at' => NULL),\n array('issue_id' => '18','lang_id' => '1','name' => 'Swachh Bharat -> Stagnant Water On The Road','created_at' => '2020-04-25 06:36:14','updated_at' => '2020-04-25 06:36:14','deleted_at' => NULL),\n array('issue_id' => '19','lang_id' => '1','name' => 'Swachh Bharat -> Improper Disposal of Fecal Waste/Septage','created_at' => '2020-04-25 06:36:25','updated_at' => '2020-04-25 06:36:25','deleted_at' => NULL),\n array('issue_id' => '20','lang_id' => '1','name' => 'Debris Removal/Construction Material','created_at' => '2020-04-25 06:36:56','updated_at' => '2020-04-25 06:36:56','deleted_at' => NULL),\n array('issue_id' => '21','lang_id' => '1','name' => 'Burning Of Garbage In Open Space','created_at' => '2020-04-25 06:37:08','updated_at' => '2020-04-25 06:37:08','deleted_at' => NULL),\n array('issue_id' => '22','lang_id' => '1','name' => 'Malaria Fogging/Spray','created_at' => '2020-04-25 06:37:19','updated_at' => '2020-04-25 06:37:19','deleted_at' => NULL),\n array('issue_id' => '23','lang_id' => '1','name' => 'Monkey Menace','created_at' => '2020-04-25 06:37:32','updated_at' => '2020-04-25 06:37:32','deleted_at' => NULL),\n array('issue_id' => '24','lang_id' => '1','name' => 'Health Challan Issue','created_at' => '2020-04-25 06:37:45','updated_at' => '2020-04-25 06:37:45','deleted_at' => NULL),\n array('issue_id' => '25','lang_id' => '1','name' => 'Horticulture Waste','created_at' => '2020-04-25 06:37:58','updated_at' => '2020-04-25 06:37:58','deleted_at' => NULL),\n array('issue_id' => '26','lang_id' => '1','name' => 'Unauthorised Parking','created_at' => '2020-04-25 06:38:11','updated_at' => '2020-04-25 06:38:11','deleted_at' => NULL),\n array('issue_id' => '27','lang_id' => '1','name' => 'Unauthorised Posters, Banner etc.','created_at' => '2020-04-25 06:38:22','updated_at' => '2020-04-25 06:38:22','deleted_at' => NULL),\n array('issue_id' => '28','lang_id' => '1','name' => 'Unauthorised Hawkers','created_at' => '2020-04-25 06:38:33','updated_at' => '2020-04-25 06:38:33','deleted_at' => NULL),\n array('issue_id' => '29','lang_id' => '1','name' => 'Encroachment','created_at' => '2020-04-25 06:38:42','updated_at' => '2020-04-25 06:38:42','deleted_at' => NULL),\n array('issue_id' => '30','lang_id' => '1','name' => 'Unauthorised Advertisement(Hoardings,posters etc.)','created_at' => '2020-04-25 06:38:57','updated_at' => '2020-04-25 06:38:57','deleted_at' => NULL),\n array('issue_id' => '31','lang_id' => '1','name' => 'Fire','created_at' => '2020-04-25 06:39:08','updated_at' => '2020-04-25 06:39:08','deleted_at' => NULL),\n array('issue_id' => '32','lang_id' => '1','name' => 'Toilet Blockage','created_at' => '2020-04-25 06:39:21','updated_at' => '2020-04-25 06:39:21','deleted_at' => NULL),\n array('issue_id' => '33','lang_id' => '1','name' => 'No Electricity','created_at' => '2020-04-25 06:39:31','updated_at' => '2020-04-25 06:39:31','deleted_at' => NULL),\n array('issue_id' => '34','lang_id' => '1','name' => 'No Water Supply','created_at' => '2020-04-25 06:39:42','updated_at' => '2020-04-25 06:39:42','deleted_at' => NULL),\n array('issue_id' => '35','lang_id' => '1','name' => 'Toilet Cleaning','created_at' => '2020-04-25 06:39:56','updated_at' => '2020-04-25 06:39:56','deleted_at' => NULL),\n array('issue_id' => '36','lang_id' => '1','name' => 'Maintenance Of PTU','created_at' => '2020-04-25 06:40:08','updated_at' => '2020-04-25 06:40:08','deleted_at' => NULL),\n array('issue_id' => '37','lang_id' => '1','name' => 'Operator Ask for Money','created_at' => '2020-04-25 06:40:18','updated_at' => '2020-04-25 06:40:18','deleted_at' => NULL),\n array('issue_id' => '38','lang_id' => '1','name' => 'Inspection Public Toilets','created_at' => '2020-04-25 06:40:28','updated_at' => '2020-04-25 06:40:28','deleted_at' => NULL),\n array('issue_id' => '39','lang_id' => '1','name' => 'Maintenance of Parks / Round About','created_at' => '2020-04-25 06:40:45','updated_at' => '2020-04-25 06:40:45','deleted_at' => NULL),\n array('issue_id' => '40','lang_id' => '1','name' => 'Tree Fall','created_at' => '2020-04-25 06:41:01','updated_at' => '2020-04-25 06:41:01','deleted_at' => NULL),\n array('issue_id' => '41','lang_id' => '1','name' => 'Pruning of Trees','created_at' => '2020-04-25 06:41:13','updated_at' => '2020-04-25 06:41:13','deleted_at' => NULL),\n array('issue_id' => '42','lang_id' => '1','name' => 'Removal Of Horticulture Waste','created_at' => '2020-04-25 06:41:23','updated_at' => '2020-04-25 06:41:23','deleted_at' => NULL),\n array('issue_id' => '43','lang_id' => '1','name' => 'Indoor gym Maintenance','created_at' => '2020-04-25 06:41:41','updated_at' => '2020-04-25 06:41:41','deleted_at' => NULL),\n array('issue_id' => '44','lang_id' => '1','name' => 'Open Gym Maintenance','created_at' => '2020-04-25 06:41:54','updated_at' => '2020-04-25 06:41:54','deleted_at' => NULL),\n array('issue_id' => '45','lang_id' => '1','name' => 'AC not working','created_at' => '2020-04-25 06:42:06','updated_at' => '2020-04-25 06:42:06','deleted_at' => NULL),\n array('issue_id' => '46','lang_id' => '1','name' => 'Street Light not working','created_at' => '2020-04-25 06:42:16','updated_at' => '2020-04-25 06:42:16','deleted_at' => NULL),\n array('issue_id' => '47','lang_id' => '1','name' => 'Electric-BM -> Water Cooler not working','created_at' => '2020-04-25 06:42:27','updated_at' => '2020-04-25 06:42:27','deleted_at' => NULL),\n array('issue_id' => '48','lang_id' => '1','name' => 'Electric-BM -> CCTV not working','created_at' => '2020-04-25 06:42:38','updated_at' => '2020-04-25 06:42:38','deleted_at' => NULL),\n array('issue_id' => '49','lang_id' => '1','name' => 'Fire In Pole','created_at' => '2020-04-25 06:42:48','updated_at' => '2020-04-25 06:42:48','deleted_at' => NULL),\n array('issue_id' => '50','lang_id' => '1','name' => 'Electric-BM -> Appliances Burnt','created_at' => '2020-04-25 06:43:02','updated_at' => '2020-04-25 06:43:02','deleted_at' => NULL),\n array('issue_id' => '51','lang_id' => '1','name' => 'Wire Hanging/Broken','created_at' => '2020-04-25 06:43:12','updated_at' => '2020-04-25 06:43:12','deleted_at' => NULL),\n array('issue_id' => '52','lang_id' => '1','name' => 'High mask light not working','created_at' => '2020-04-25 06:43:53','updated_at' => '2020-04-25 06:43:53','deleted_at' => NULL),\n array('issue_id' => '53','lang_id' => '1','name' => 'Electric-BM -> Electric Building Maintenance','created_at' => '2020-04-25 06:44:05','updated_at' => '2020-04-25 06:44:05','deleted_at' => NULL),\n array('issue_id' => '54','lang_id' => '1','name' => 'No Current / Supply','created_at' => '2020-04-25 06:44:16','updated_at' => '2020-04-25 06:44:29','deleted_at' => NULL),\n array('issue_id' => '55','lang_id' => '1','name' => 'Voltage Fluctuation','created_at' => '2020-04-25 06:44:42','updated_at' => '2020-04-25 06:44:42','deleted_at' => NULL),\n array('issue_id' => '56','lang_id' => '1','name' => 'Panel Box Not Working','created_at' => '2020-04-25 06:44:53','updated_at' => '2020-04-25 06:44:53','deleted_at' => NULL),\n array('issue_id' => '57','lang_id' => '1','name' => 'Meter Fault','created_at' => '2020-04-25 06:45:08','updated_at' => '2020-04-25 06:45:08','deleted_at' => NULL),\n array('issue_id' => '58','lang_id' => '1','name' => 'Meter Reading','created_at' => '2020-04-25 06:45:23','updated_at' => '2020-04-25 06:45:23','deleted_at' => NULL),\n array('issue_id' => '59','lang_id' => '1','name' => 'New Connection','created_at' => '2020-04-25 06:45:37','updated_at' => '2020-04-25 06:45:37','deleted_at' => NULL),\n array('issue_id' => '60','lang_id' => '1','name' => 'Transfer of money and billing','created_at' => '2020-04-25 06:46:09','updated_at' => '2020-04-25 06:46:09','deleted_at' => NULL),\n array('issue_id' => '61','lang_id' => '1','name' => 'Bill related problem','created_at' => '2020-04-25 06:46:19','updated_at' => '2020-04-25 06:46:19','deleted_at' => NULL),\n array('issue_id' => '62','lang_id' => '1','name' => 'Generation Of Electricity Bill','created_at' => '2020-04-25 06:46:33','updated_at' => '2020-04-25 06:46:33','deleted_at' => NULL),\n array('issue_id' => '63','lang_id' => '1','name' => 'Detection of power theft','created_at' => '2020-04-25 06:46:43','updated_at' => '2020-04-25 06:46:43','deleted_at' => NULL),\n array('issue_id' => '64','lang_id' => '1','name' => 'Release of Electricity/Water','created_at' => '2020-04-25 06:46:53','updated_at' => '2020-04-25 06:46:53','deleted_at' => NULL),\n array('issue_id' => '65','lang_id' => '1','name' => 'Smart Meter -> Meter Sparking','created_at' => '2020-04-25 06:47:03','updated_at' => '2020-04-25 06:47:03','deleted_at' => NULL),\n array('issue_id' => '66','lang_id' => '1','name' => 'Smart Meter -> Data not available on consumer portal-mobile app','created_at' => '2020-04-25 06:47:14','updated_at' => '2020-04-25 06:47:14','deleted_at' => NULL),\n array('issue_id' => '67','lang_id' => '1','name' => 'Smart Meter -> Consumer No. not found in mobile app','created_at' => '2020-04-25 06:47:26','updated_at' => '2020-04-25 06:47:26','deleted_at' => NULL),\n array('issue_id' => '68','lang_id' => '1','name' => 'Smart Meter -> Meter details are incorrect in system','created_at' => '2020-04-25 06:47:36','updated_at' => '2020-04-25 06:47:36','deleted_at' => NULL),\n array('issue_id' => '69','lang_id' => '1','name' => 'Smart Meter -> Smart Meter Not Installed','created_at' => '2020-04-25 06:47:48','updated_at' => '2020-04-25 06:47:48','deleted_at' => NULL),\n array('issue_id' => '70','lang_id' => '1','name' => 'Road Drainage -> Drainage Silt','created_at' => '2020-04-25 06:49:49','updated_at' => '2020-04-25 06:49:49','deleted_at' => NULL),\n array('issue_id' => '71','lang_id' => '1','name' => 'Road Drainage -> Drainage Coverage Missing','created_at' => '2020-04-25 06:50:09','updated_at' => '2020-04-25 06:50:09','deleted_at' => NULL),\n array('issue_id' => '72','lang_id' => '1','name' => 'Road Drainage -> Drainage Blocked','created_at' => '2020-04-25 06:50:20','updated_at' => '2020-04-25 06:50:20','deleted_at' => NULL),\n array('issue_id' => '73','lang_id' => '1','name' => 'Road Maintenance -> Bollards Broken','created_at' => '2020-04-25 06:50:29','updated_at' => '2020-04-25 06:50:29','deleted_at' => NULL),\n array('issue_id' => '74','lang_id' => '1','name' => 'Road Maintenance -> Mainhole Cover Missing / Broken','created_at' => '2020-04-25 06:50:42','updated_at' => '2020-04-25 06:50:42','deleted_at' => NULL),\n array('issue_id' => '75','lang_id' => '1','name' => 'Road Maintenance -> Road Signages need repair','created_at' => '2020-04-25 06:50:53','updated_at' => '2020-04-25 06:50:53','deleted_at' => NULL),\n array('issue_id' => '76','lang_id' => '1','name' => 'Road Maintenance -> Potholes','created_at' => '2020-04-25 06:51:04','updated_at' => '2020-04-25 06:51:04','deleted_at' => NULL),\n array('issue_id' => '77','lang_id' => '1','name' => 'Road Maintenance -> Water logging','created_at' => '2020-04-25 06:51:15','updated_at' => '2020-04-25 06:51:15','deleted_at' => NULL),\n array('issue_id' => '78','lang_id' => '1','name' => 'Road Maintenance -> Footpath Broken','created_at' => '2020-04-25 06:51:25','updated_at' => '2020-04-25 06:51:25','deleted_at' => NULL),\n array('issue_id' => '79','lang_id' => '1','name' => 'Road Maintenance -> Maintenance of Foot Over Bridge','created_at' => '2020-04-25 06:51:35','updated_at' => '2020-04-25 06:51:35','deleted_at' => NULL),\n array('issue_id' => '80','lang_id' => '1','name' => 'Road Maintenance -> Open Gym Maintenance','created_at' => '2020-04-25 06:51:46','updated_at' => '2020-04-25 06:51:46','deleted_at' => NULL),\n array('issue_id' => '81','lang_id' => '1','name' => 'Road Maintenance -> Zebra Crossing','created_at' => '2020-04-25 06:51:56','updated_at' => '2020-04-25 06:51:56','deleted_at' => NULL),\n array('issue_id' => '82','lang_id' => '1','name' => 'Road Maintenance -> Drainage Overflow','created_at' => '2020-04-25 06:52:06','updated_at' => '2020-04-25 06:52:06','deleted_at' => NULL),\n array('issue_id' => '83','lang_id' => '1','name' => 'Road Maintenance -> Malba Stacking','created_at' => '2020-04-25 06:52:21','updated_at' => '2020-04-25 06:52:21','deleted_at' => NULL),\n array('issue_id' => '84','lang_id' => '1','name' => 'Road Maintenance -> Spot Fixing','created_at' => '2020-04-25 06:52:51','updated_at' => '2020-04-25 06:52:51','deleted_at' => NULL),\n array('issue_id' => '85','lang_id' => '1','name' => 'Road Maintenance -> Dustbin Not Clean','created_at' => '2020-04-25 06:53:03','updated_at' => '2020-04-25 06:53:03','deleted_at' => NULL),\n array('issue_id' => '86','lang_id' => '1','name' => 'Sewer Maintenance -> Sewer Block','created_at' => '2020-04-25 06:55:23','updated_at' => '2020-04-25 06:55:23','deleted_at' => NULL),\n array('issue_id' => '87','lang_id' => '1','name' => 'Sewer Maintenance -> Sewer Silt / Malba','created_at' => '2020-04-25 06:55:50','updated_at' => '2020-04-25 06:55:50','deleted_at' => NULL),\n array('issue_id' => '88','lang_id' => '1','name' => 'Sewer Maintenance -> Sewer Overflow','created_at' => '2020-04-25 06:56:02','updated_at' => '2020-04-25 06:56:02','deleted_at' => NULL),\n array('issue_id' => '89','lang_id' => '1','name' => 'Sewer Maintenance -> Sewer mainhole cover related','created_at' => '2020-04-25 06:56:14','updated_at' => '2020-04-25 06:56:14','deleted_at' => NULL),\n array('issue_id' => '90','lang_id' => '1','name' => 'Water Maintenance -> Hand Pump','created_at' => '2020-04-25 06:56:24','updated_at' => '2020-04-25 06:56:24','deleted_at' => NULL),\n array('issue_id' => '91','lang_id' => '1','name' => 'Water Maintenance -> Water Tanker Required','created_at' => '2020-04-25 06:56:37','updated_at' => '2020-04-25 06:56:37','deleted_at' => NULL),\n array('issue_id' => '92','lang_id' => '1','name' => 'Water Maintenance -> Meter Faulty','created_at' => '2020-04-25 06:57:27','updated_at' => '2020-04-25 06:57:27','deleted_at' => NULL),\n array('issue_id' => '93','lang_id' => '1','name' => 'Water Maintenance -> Broken Pipeline','created_at' => '2020-04-25 06:57:37','updated_at' => '2020-04-25 06:57:37','deleted_at' => NULL),\n array('issue_id' => '94','lang_id' => '1','name' => 'Water Maintenance -> Contaminated Water','created_at' => '2020-04-25 06:57:47','updated_at' => '2020-04-25 06:57:47','deleted_at' => NULL),\n array('issue_id' => '95','lang_id' => '1','name' => 'Water Maintenance -> Illegal Connection','created_at' => '2020-04-25 06:57:58','updated_at' => '2020-04-25 06:57:58','deleted_at' => NULL),\n array('issue_id' => '96','lang_id' => '1','name' => 'Water Maintenance -> Leakage of Water','created_at' => '2020-04-25 06:58:07','updated_at' => '2020-04-25 06:58:07','deleted_at' => NULL),\n array('issue_id' => '97','lang_id' => '1','name' => 'Water Maintenance -> Low Water Supply/ No Water','created_at' => '2020-04-25 06:58:18','updated_at' => '2020-04-25 06:58:18','deleted_at' => NULL),\n array('issue_id' => '98','lang_id' => '1','name' => 'Road Maintenance -> Inspection Public Toilets','created_at' => '2020-04-25 06:58:28','updated_at' => '2020-04-25 06:58:28','deleted_at' => NULL),\n array('issue_id' => '99','lang_id' => '1','name' => 'Road Maintenance -> Gate Broken','created_at' => '2020-04-25 06:58:38','updated_at' => '2020-04-25 06:58:38','deleted_at' => NULL),\n array('issue_id' => '100','lang_id' => '1','name' => 'Water Maintenance -> Water ATM Machine Not Working','created_at' => '2020-04-25 06:58:48','updated_at' => '2020-04-25 06:58:48','deleted_at' => NULL),\n array('issue_id' => '101','lang_id' => '1','name' => 'Road Maintenance -> Road Repair','created_at' => '2020-04-25 06:58:58','updated_at' => '2020-04-25 06:58:58','deleted_at' => NULL),\n array('issue_id' => '102','lang_id' => '1','name' => 'Building Maintenance -> Broken Manhole','created_at' => '2020-04-25 06:59:11','updated_at' => '2020-04-25 06:59:31','deleted_at' => NULL),\n array('issue_id' => '103','lang_id' => '1','name' => 'Building Maintenance -> Malba Stacked','created_at' => '2020-04-25 06:59:43','updated_at' => '2020-04-25 06:59:43','deleted_at' => NULL),\n array('issue_id' => '104','lang_id' => '1','name' => 'Building Maintenance -> Sewer Problem','created_at' => '2020-04-25 06:59:53','updated_at' => '2020-04-25 06:59:53','deleted_at' => NULL),\n array('issue_id' => '105','lang_id' => '1','name' => 'Building Maintenance -> Maintenance of Building','created_at' => '2020-04-25 07:00:04','updated_at' => '2020-04-25 07:00:04','deleted_at' => NULL),\n array('issue_id' => '106','lang_id' => '1','name' => 'Building Maintenance -> Water Related Problem','created_at' => '2020-04-25 07:00:14','updated_at' => '2020-04-25 07:00:14','deleted_at' => NULL),\n array('issue_id' => '107','lang_id' => '1','name' => 'Building Maintenance -> Gate Broken','created_at' => '2020-04-25 07:00:24','updated_at' => '2020-04-25 07:00:24','deleted_at' => NULL),\n array('issue_id' => '108','lang_id' => '1','name' => 'Patient Emergency','created_at' => '2020-04-25 07:00:34','updated_at' => '2020-04-25 07:00:34','deleted_at' => NULL),\n array('issue_id' => '109','lang_id' => '1','name' => 'Health Issue','created_at' => '2020-04-25 07:00:44','updated_at' => '2020-04-25 07:00:44','deleted_at' => NULL),\n array('issue_id' => '110','lang_id' => '1','name' => 'Corona Symptoms','created_at' => '2020-04-25 07:00:58','updated_at' => '2020-04-25 07:00:58','deleted_at' => NULL),\n array('issue_id' => '111','lang_id' => '1','name' => 'Unauthorised Construction','created_at' => '2020-04-25 07:01:10','updated_at' => '2020-04-25 07:01:10','deleted_at' => NULL),\n array('issue_id' => '112','lang_id' => '1','name' => 'Unauthorised Construction -> Illegal Construction','created_at' => '2020-04-25 07:01:23','updated_at' => '2020-04-25 07:01:23','deleted_at' => NULL),\n array('issue_id' => '113','lang_id' => '1','name' => 'Unauthorised Construction -> Violation of Building Regulation','created_at' => '2020-04-25 07:01:38','updated_at' => '2020-04-25 07:01:38','deleted_at' => NULL),\n array('issue_id' => '114','lang_id' => '1','name' => 'Pollution due to Construction Activities','created_at' => '2020-04-25 07:01:48','updated_at' => '2020-04-25 07:01:48','deleted_at' => NULL)\n );\n\n if(DB::table($table_name)->get()->count() == 0) {\n DB::table($table_name)->insert($issues);\n DB::table($table_name_langs)->insert($issue_langs);\n } else {\n echo \"SeedingError: `$table_name` table is not empty\\n\";\n }\n }", "public function getStagedActions();", "public function index()\n {\n $states = ProjectState::all();\n return response()->json($states);\n }", "public function getStage(): TestStage;", "function fetchIssues($project, $statuses){\n\n // default project\n $project = (isset($project)) ? $project : 'DEVOPS' ;\n\n // default statuses to fetch\n $defaultStatuses = array(\n 'Backlog' => 'Backlog',\n 'In Progress' => 'In Progress',\n 'Done' => 'Done'\n );\n\n // default statuses\n $statuses = (isset($statuses)) ? $statuses : $defaultStatuses ;\n\n // initialize list of issues\n $list = [];\n\n // walk through statuses\n foreach ($statuses as $key => $status) {\n\n // define the JIRA JQL\n $jql = 'project = '.$project.' AND status = \"'.$status.'\" ORDER BY updated ASC';\n\n try {\n $issueService = new IssueService();\n\n // fetch issues\n $response = $issueService->search($jql);\n\n\n // issues walker\n foreach ($response->issues as $issue) {\n\n // get epic link\n if (isset($issue->fields->customFields['customfield_10008'])) {\n $jql = 'issue = '.$issue->fields->customFields['customfield_10008'];\n $issueService = new issueService();\n $response = $issueService->search($jql);\n $epicLink = $response->issues[0]->fields->summary;\n }\n\n // define details\n $issueDetails = array(\n \"key\" => $issue->key,\n \"summary\" => $issue->fields->summary,\n \"type\" => $issue->fields->issuetype->name,\n \"epiclink\" => $epicLink,\n // \"date\" => $issue->fields->duedate->format('Y-m-d H:i:s')\n );\n\n // push the issue details to the list\n $list[$status][] = $issueDetails;\n\n }\n\n } catch (JiraException $e) {\n $this->assertTrue(false, 'Query Failed : '.$e->getMessage());\n }\n }\n\n // return the list\n return $list;\n}", "public function get_stage_content($stage);", "public function issues()\n {\n return $this->hasMany( Issue::class );\n }", "public function ListStage($number = null){\n\t\tif($number == null){\n\t\t\t$query = \"SELECT recordID, clusterNumber, title, editedUser, editedDate FROM [STAGE CLUSTERS TABLE]\";\n\n\t\t\tif($rows = $this->SelectQueryHelper($query))\n\t\t\t\treturn array(\"results\" => $rows);\n\t\t\telse \n\t\t\t\treturn array(\"results\" => null);\n\t\t} else {\n\t\t\t$query = \"SELECT recordID FROM [STAGE CLUSTERS TABLE] WHERE clusterNumber = :clusterNumber\";\n\t\t\t$bindings = array(':clusterNumber' => $number);\n\t\n\t\t\tif($rows = $this->SelectQueryHelper($query, $bindings)){\n\t\t\t\t$recordID = $rows[0]['recordID'];\n\t\t\t\treturn array(\"results\" => $this->LoadClusterObject(\"Stage\", $recordID));\n\t\t\t} else \n\t\t\t\treturn array(\"results\" => null);\t\t\t\n\t\t}\n\t}", "public function stages(){\n return $this->belongsToMany('SimulatorOperation\\Stage')->withPivot('cabin_id')->withTimestamps();\n }", "public function getAllIssueTypes()\n { \n $this->uri = \"/rest/api/\".$this->getApiVersion().\"/issuetype/\";\n $this->method = \"GET\";\n }", "public function run()\n {\n $project_ids = Projects::all()->pluck('id')->toArray();\n $threshold_ids = Thresholds::all()->pluck('id')->toArray();\n // 获取 Faker 实例\n $faker = app(Faker\\Generator::class);\n for ($i=1; $i<4 ; $i++){\n $s = 0;\n $projectsStages = factory(ProjectsStages::class)\n ->times(100)\n ->make()\n ->each(function ($projectsStage, $index)\n use ($project_ids,$threshold_ids, $faker,$i,&$s)\n {\n $start_date = '';\n $end_date = '';\n $stage_name = '';\n switch ($i){\n case 1:\n $stage_name.='阶段一';\n $month = rand(36,24);\n $start_date = date('Y-m-d',strtotime('-'.$month.' month'));\n $end_date = date('Y-m-d',strtotime('-'.$month+rand(1,11) .' month'));\n break;\n case 2:\n $stage_name.='阶段二';\n $month = rand(24,12);\n $start_date = date('Y-m-d',strtotime('-'.$month.' month'));\n $end_date = date('Y-m-d',strtotime('-'.$month+rand(1,11) .' month'));\n break;\n case 3:\n $stage_name.='阶段三';\n $month = rand(12,0);\n $start_date = date('Y-m-d',strtotime('-'.$month.' month'));\n $end_date = date('Y-m-d',strtotime('-'.$month+rand(1,11) .' month'));\n break;\n }\n $projectsStage->project_id = $project_ids[$s];\n $projectsStage->threshold_id = $faker->randomElement($threshold_ids);\n $projectsStage->stage_name = $stage_name;\n $projectsStage->start_date = $start_date;\n $projectsStage->end_date = $end_date;\n $projectsStage->stage = $i;\n $projectsStage->default = 1;\n $s+=1;\n });\n // 将数据集合转换为数组,并插入到数据库中\n ProjectsStages::insert($projectsStages->toArray());\n }\n\n }", "public function getAllProcesses()\n {\n $em = $this->doctrine->getManager();\n $repo = $em->getRepository(\"ACFiendishBundle:ProcessEntity\");\n $entities = $repo->findByGroupName($this->getName());\n return array_map(function ($e) { return new Process($e); }, $entities);\n }", "public function updateStageMetadata()\n {\n $histories = $this->histories()->orderBy('created_at')->get();\n\n $stages = new stdClass();\n $assignees = new stdClass();\n $closing = new stdClass();\n $assignees_track = new stdClass();\n\n // Iterate history\n foreach ($histories as $history) {\n // All stages\n if ($history->stage_name) {\n $stage_name = $history->stage_name;\n $actor = $history->actor;\n $history_key = $history->key;\n $metadata = $history->metadata;\n // Track of created stages\n if ($history->status === 'created') {\n $stages->$stage_name = [\n 'stage_name' => $stage_name,\n 'actor' => $actor,\n 'history_key' => $history_key,\n 'actory_key' => $metadata['actor_key'],\n 'assignee_key' => $metadata['assignee_key'],\n 'assignee' => $metadata['assignee_name']\n ];\n\n // Create list of assignees and add track for faster retrival\n $assignee_key = $metadata['assignee_key'];\n $assignees->$assignee_key[$stage_name] = 'created';\n $assignees_track->$stage_name = $metadata['assignee_key'];\n } else if ($history->status === 'completed') {\n // If completed remove stages, and remove from assignees\n unset($stages->$stage_name);\n $assinee_key = $assignees_track->$stage_name;\n unset($assignees->$assinee_key[$stage_name]);\n }\n } else if (isset($history->metadata['candidacy_closing_reason'])) {\n // Track candidacy closing and add\n $actor = $history->actor;\n $actor_key = $history->metadata['actor_key'];\n $close_reason = $history->metadata['candidacy_closing_reason'];\n $history_key = $history->key;\n\n $closing->actor = $actor;\n $closing->actor_key = $actor_key;\n $closing->reason = $close_reason;\n $closing->history_key = $history_key;\n }\n }\n\n // Iterate assignee and remove if all assigned stages\n foreach ($assignees as $key => $val) {\n if (!$val) {\n unset($assignees->$key);\n }\n }\n\n $metadata = new stdClass();\n\n // Old keys remains as it is\n foreach ($this->metadata as $key => $value) {\n $metadata->$key = $value;\n }\n\n $metadata->assignees = $assignees;\n $metadata->stages = $stages;\n $metadata->closing = $closing;\n\n $this->metadata = $metadata;\n $this->save();\n }", "public function issues(): HasMany\n {\n return $this->hasMany(Issue::class, 'tracker_id');\n }", "function get_all_steps() {\r\n return $this->get_assoc();\r\n }", "public function getAllPipelines() \n\t{\n\t\t$requestor \t= new \\Streak\\ApiRequestor();\n\t\t$endpoint \t= \"/v1/pipelines\";\n\t\t$data \t\t= $requestor->request($endpoint);\n return $data;\n\t}", "public function getIssues($type = null)\n {\n return $type ? (isset($this->issues[$type]) ? $this->issues[$type] : array()) : $this->issues;\n }", "public static function workflowStates();", "public function index(Request $request)\n {\n $stages = $this->stageService->getCurrentStageById($request->user()->id);\n\n return $this->responseOK($stages);\n }", "public function getAssignedIssues()\n {\n return $this->assignedIssues;\n }", "public function getAll(){\n\t\treturn $this->stack;\n\t}", "public function getUnresolvedStatusDependencies(): array\n {\n return $this->unresolved_status_dependencies;\n }", "public function getStates(): array\n {\n return $this->states;\n }", "public function hasStage(){\n return $this->_has(7);\n }", "public function getProdStatuses() {\n $dql = \"SELECT i from Infrastructure i\";\n $prodStatuses = $this->em\n ->createQuery($dql)\n ->getResult();\n return $prodStatuses;\n }", "function all_submissions($min_status = 0) {\n\t\tif (!$this->submitable()) return array();\n\t\tstatic $query;\n\t\tDB::prepare_query($query,\n\t\t\t\"SELECT * FROM `submission`\".\n\t\t\t\" WHERE `entity_path` = ? AND `status` >= ?\".\n\t\t\t\" ORDER BY `time` ASC\"\n\t\t);\n\t\t$query->execute(array($this->path(), $min_status));\n\t\treturn Submission::fetch_all($query);\n\t}", "public function issues()\n {\n return $this->belongsToMany('App\\Issue', 'issue_source');\n }", "public function GetProspectStages(GetProspectStages $parameters)\n {\n return $this->__soapCall('GetProspectStages', array($parameters));\n }", "private function groupByVersions(Array $issues)\n {\n $versions = [];\n\n if (empty($issues))\n throw new InvalidArgumentException('Issues collection is empty'); \n\n foreach ($issues as $issue) { \n if (isset($issue['fields']['fixVersions']) \n && !empty($issue['fields']['fixVersions'])) \n { \n foreach ($issue['fields']['fixVersions'] as $version) { \n if ($this->isReleased($version)) { \n $key = $version['id']; \n $issueType = $issue['fields']['issuetype']['name'];\n\n if (! isset($versions[$key]['meta'])) \n $versions[$key]['meta'] = $this->getMetaData($version, $key); \n\n $versions[$key]['issuesByType'][$issueType][] = $issue;\n $versions[$key]['issues'][] = $issue;\n }\n }\n }\n } \n \n usort($versions, 'self::orderDesc'); \n\n return $versions;\n }", "public function stk_issue() {\n try {\n $avl_items = $this->get_items(1);\n $issue_view = view('/tabs/issue')->render();\n\n return response()->json([\"issue_view\" => $issue_view, \"items\" => $avl_items]);\n }\n catch (Throwable $exc) {\n return response($exc->getMessage(), 500);\n }\n }", "function getStageId() {\n\t\treturn $this->_stageId;\n\t}", "public function get_current_stage() {\n\t\treturn $this->stage;\n\t}", "public function all()\n\t{\n\t\treturn $this->stack;\n\t}", "public function state_list(){\n $entity_manager = $this->getEntityManager(); //access entity manager from inside the repository\n try{\n $query = $entity_manager->createQuery('SELECT s.name FROM UsersUserManageBundle:state s ');\n return $query->getArrayResult( ); // array of state objects\n throw new \\Exception( 'Database error in :: _state_list() function in UsermanageController' );\n }catch( \\Exception $e ){\n \n }\n }", "public function stage()\n {\n return $this->belongsTo(Stage::class);\n }", "function getPendingIssues() {\n\t\t$i = $this->_query->join('synd_issue','i');\n\t\t$query = clone $this->_query;\n\n\t\t$query->where(\"$i.info_status >= 0 AND $i.info_status < \".synd_node_issue::CLOSED);\n\t\t\n\t\t$query->column($this->_grouping->getResolveByKey($this, $query), 'PK');\n\t\t$query->column(\"COUNT(DISTINCT $i.node_id)\", 'ISSUES');\n\t\t$query->groupBy($this->_grouping->getResolveByKey($this, $query));\n\t\t\n\t\t$sql = $query->toString();\n\t\t$rows = $this->_db->getAssoc($sql);\n\t\treturn $this->_grouping->filter($rows);\n\t}", "public static function getGroups(): array\r\n {\r\n return [\r\n 'dev',\r\n 'pre',\r\n ];\r\n }", "public function currentAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $issue = $em->getRepository('BorrowersIssueBundle:Issue')->findCurrentIssue();\n\n if (!$issue) {\n throw $this->createNotFoundException('Unable to find Issue entity.');\n }\n\n return array('issue' => $issue,);\n }", "public function inactive_dependencies(): Collection;", "public function allOutcomes()\n {\n\n $outcomes = DB::table('outcome')->where([\n //STATE_ID_STATE = '5' outcome de estado activo\n ['STATE_ID_STATE', '=', '5'],\n ])->get();\n\n $response = Response::json($outcomes, 200);\n return $response;\n }", "public function getAllStates(){\n\n $states = $this->stateRepo->get();\n $states_array = array();\n if($states){\n foreach($states as $key=>$state)\n {\n $states_array[$key]['id'] = $state->getId();\n $states_array[$key]['name'] = $state->getName();\n\n }\n }\n return json_encode($states_array);\n }", "public static function QueryState(TaskEnvironment $env) {\n $result = $env->database()->query('\n SELECT\n tracking_projects.project_name,\n tracking_projects.repository_view,\n tracking_projects.repository_max_silence,\n tracking_revisions.revision_sha,\n UNIX_TIMESTAMP(tracking_revisions.revision_date) AS revision_date,\n tracking_revisions.message\n FROM\n tracking_projects\n LEFT JOIN\n tracking_revisions ON tracking_revisions.project_id = tracking_projects.project_id AND\n tracking_revisions.revision_sha = \n (\n SELECT\n revision_sha\n FROM\n tracking_revisions\n WHERE\n project_id = tracking_projects.project_id\n ORDER BY\n revision_date DESC\n LIMIT\n 1\n )\n WHERE\n tracking_projects.repository_ignore = 0\n ORDER BY\n tracking_projects.project_name ASC');\n\n $subtasks = array();\n $state = ServiceState::Good;\n $warnings = 0;\n\n while ($result !== false && $row = $result->fetch_assoc()) {\n $url = $row['repository_view'] . $row['revision_sha'];\n $title = htmlspecialchars(trim(strstr($row['message'], PHP_EOL, true)));\n $text = substr($row['revision_sha'], 0, 7);\n\n if (((time() - $row['revision_date']) / 3600) > $row['repository_max_silence']) {\n $state = ServiceState::Warning;\n $warnings++;\n }\n\n $subtasks[] = array(\n 'name' => $row['project_name'],\n 'date' => $row['revision_date'],\n 'value' => '<a href=\"' . $url . '\" title=\"' . $title . '\">' . $text . '</a>'\n );\n }\n\n if (!count($subtasks) || $warnings >= 3)\n $state = ServiceState::Error;\n\n return array(\n 'name' => 'Repository tracker',\n 'description' => 'Tracks all commits to the Blink, Chromium, Skia and v8 repositories and stores them in a MySQL database.',\n 'state' => $state,\n 'subtasks' => $subtasks\n );\n }", "public function getBuilds()\n {\n return $this->builds;\n }", "public function status(): Collection\n {\n return $this->get('api/blocks/getStatus');\n }", "function all_final_submissions($min_status = 0) {\n\t\treturn $this->all_final_submissions_from( $this->all_submissions($min_status) );\n\t}", "public function getMissionIssues($id = null) {\n\t\treturn $this->MissionIssue->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'MissionIssue.mission_id' => $id\n\t\t\t)\n\t\t));\n\t}", "public function active_dependencies(): Collection;", "public function getLaunchStage()\n {\n return $this->launch_stage;\n }", "static function getAllProjects($status)\n {\n $projects = [];\n global $db;\n try {\n $db->where('deleted_at', NULL, 'IS');\n\n if ($status && in_array($status, ['opened', 'closed', 'progress', 'archived'])) {\n $db->where('status', $status);\n }\n\n $projects = $db->get('project');\n } catch (\\Exception $exception) {\n Log::write($exception, $db->getLastError());\n }\n\n return $projects;\n }", "function GetProjectStatuses()\n\t{\n\t\t$result = $this->sendRequest(\"GetProjectStatuses\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function issue()\n {\n return $this->belongsToMany('App\\Issue')->first();\n }", "public function getCoreModulesStatus(): Collection;", "public static function allBundles(): Collection;", "public static function getOpenStates()\n {\n return [\n self::STATUS_OPEN,\n self::STATUS_ASSIGNED,\n self::STATUS_OVERDUE,\n ];\n }", "public function getActionStagesAllowableValues()\r\n {\r\n return [\r\n self::ACTION_STAGES_BEFORE_COMPONENT_FIRST_START,\r\n self::ACTION_STAGES_AFTER_COMPONENT_FIRST_START,\r\n self::ACTION_STAGES_BEFORE_SCALE_IN,\r\n self::ACTION_STAGES_AFTER_SCALE_IN,\r\n self::ACTION_STAGES_BEFORE_SCALE_OUT,\r\n self::ACTION_STAGES_AFTER_SCALE_OUT,\r\n ];\r\n }", "public function environments($projectId)\n {\n return $this->request('get', '/api/projects/'.$projectId.'/environments');\n }", "public function getActive() {\n $plugins = [];\n foreach ($this->getDefinitions() as $definition) {\n if (!empty($definition['status'])) {\n $plugins[$definition['id']] = $this->createInstance($definition['id']);\n }\n }\n return $plugins;\n }", "public function getStates() {\n return $this->state;\n }", "public function getHistory($id){\n\t\t$myissues = Issues::find_by_sql(\"SELECT * FROM issues WHERE issue_mem_id=\".$id);\n\t\treturn $myissues;\n\t}", "public function getCurStage()\n {\n return $this->get(self::_CUR_STAGE);\n }", "public function getBranches();" ]
[ "0.6339274", "0.61207366", "0.58776796", "0.57820356", "0.5769516", "0.57614636", "0.5680162", "0.5615745", "0.56102407", "0.560511", "0.5597102", "0.55728483", "0.5371005", "0.53661054", "0.5362586", "0.5362586", "0.53622985", "0.5346003", "0.53405684", "0.53378177", "0.52987355", "0.5246004", "0.52372396", "0.5186673", "0.5179926", "0.51459134", "0.5142605", "0.51425415", "0.5125762", "0.5111244", "0.51021814", "0.50740623", "0.50647384", "0.505275", "0.50495476", "0.50476754", "0.50201637", "0.50070846", "0.50003934", "0.49923587", "0.4976752", "0.49632677", "0.49629614", "0.49461547", "0.49394143", "0.49190262", "0.49141788", "0.49096683", "0.48738447", "0.48720247", "0.48651853", "0.48592168", "0.48235294", "0.48148805", "0.48131013", "0.48130935", "0.48066705", "0.47982112", "0.47933608", "0.47921023", "0.4784077", "0.47776785", "0.4769645", "0.4768699", "0.47588858", "0.47549322", "0.47470418", "0.47365597", "0.47349277", "0.47207478", "0.47049454", "0.47042724", "0.4703704", "0.47012496", "0.46991003", "0.4679411", "0.467835", "0.46722654", "0.46620315", "0.46438575", "0.46425718", "0.46399933", "0.46381813", "0.46335778", "0.46315467", "0.46295464", "0.46267244", "0.46242598", "0.4621197", "0.46182463", "0.46147063", "0.46129674", "0.46084365", "0.46011928", "0.45975375", "0.45966288", "0.45869792", "0.4581316", "0.45780647", "0.4573603" ]
0.7984028
0
There is a timing issue so we need to wait a second
public function openAddPanel() { sleep(1); // TODO: Add ID to "Add" button $this->_webui->clickButton('.btn.btn-primary.btn-xs.pull-right.mb20'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "function __sleep(){\n\n\t\t}", "private function updateOperation() {\n sleep(1);\n }", "function __sleep()\n {\n }", "public function iWait() {\n sleep(3);\n }", "public function __sleep(){\n\n\t}", "public function __sleep()\n {\n }", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function sleep() {}", "final public function __sleep() {}", "public function wait(): void;", "public function sleep()\n {\n }", "public function wait($wait = -1) {}", "public function __sleep();", "public function waitWithBackoff()\n {\n $waitTime = $this->calculateSleepTime();\n if ($waitTime > 1000000) {\n sleep((int) ($waitTime / 1000000));\n } else {\n usleep($waitTime);\n }\n }", "public function sleep();", "public function waitDraft()\n {\n\n if(!isset($_SESSION['id_user']) || !isset($_SESSION['id_league']))\n {\n header('Location: index.php?rt=teams');\n exit();\n }\n\n if(!isset($_POST['lastAccess']))\n sendErrorAndExit('lastAccess is not set.');\n\n $lastAccess = (int)$_POST['lastAccess'];\n\n $message['lastAccess'] = $lastAccess;\n //usleep(5000000);\n //sendJSONandExit($message);\n\n\n // while( 1 )\n // {\n // // zelimo samo za tu ligu\n $fst = new FantasyServiceTeams();\n $maxLastModified = $fst->getLastModified($_SESSION['id_league']);\n\n $timestamp = strtotime($maxLastModified);\n // echo \"timestamp = \".$timestamp.\"<br>\";\n //\n if($timestamp > $lastAccess)\n {\n $allSelected = $fst->getAllSelectedPlayersInLeague($_SESSION['id_league']);\n // $message['allSelected'] = $allSelected;\n\n $message = [];\n $new_na_redu = $fst->getMinimalCurrentUser($_SESSION['id_league']);\n\n $message['lastAccess'] = $timestamp;\n $message['na_redu'] = $new_na_redu->username;\n $message['allSelected'] = [];\n\n foreach($allSelected as $as)\n {\n $message['allSelected'][] = array('id' => $as->id,\n 'name' => $as->name, 'position' => $as->position);\n }\n\n sendJSONandExit( $message );\n\n\n }\n\n\n usleep(5000000); //5sec\n //\n // }\n\n }", "protected function sleep(): void\n\t{\n\t\tusleep(static::SLEEP_TIME);\n\t}", "public function testWaitReturnValue(): void\n {\n $this->getSession()->visit($this->pathTo('/js_test.html'));\n\n $found = $this->getSession()->wait(5000, '$(\"#draggable\").length === 1');\n $this->assertTrue($found);\n }", "public function __sleep ();", "public function iWaitForTheBatchJobToFinish() {\n $this->getSession()->wait(180000, 'jQuery(\"#updateprogress\").length === 0');\n }", "public function __sleep()\n {\n \treturn array('result');\n }", "public function waitPush()\n {\n sleep(7);\n\n return 0;\n }", "private function waitFormLoading()\n {\n $this->_rootElement->click();\n $this->browser->waitUntil(\n function () {\n return $this->browser->find($this->waitElement)->isVisible() ? null : true;\n }\n );\n }", "public function waitForSolrBefore()\n {\n if (APP_SOLR_INDEXER == \"ON\") {\n for ($x = 0; $x<30; $x++) {\n $finished = FulltextQueue::isFinishedProcessing();\n if ($finished == true) {\n return;\n }\n sleep(1);\n }\n }\n return;\n }", "public function __sleep()\n {\n $lastConnection = $this->_isConnected;\n $this->disconnect(true);\n $this->_isConnected = $lastConnection;\n }", "public function testWaitReturnValue()\n {\n $this->getSession()->visit($this->pathTo('/js_test.php'));\n\n $found = $this->getSession()->wait(5000, '$(\"#draggable\").length == 1');\n $this->assertTrue($found);\n }", "function wait_for_change($time_min){\n\techo \"Waiting for $time_min minutes.\";\n\twhile(true){\n\t\tsleep(60);\n\t\t$time_min--;\n\t\tif($time_min == 0)\n\t\t\tbreak;\n\t\techo \".\";\n\t}\t\t\n\techo \"\\n\";\n}", "private function _stepTimeout():void\n\t{\n\t\tif( $this->_timeout_queue[0]['call_at'] <= microtime( true ) )\n\t\t{\n\t\t\t[ 'task'=>$task, ]= array_shift( $this->_timeout_queue );\n\t\t\t\n\t\t\t$this->_runTask( $task );\n\t\t}\n\t\telse\n\t\t\tusleep( 1000 );\n\t}", "function fone() {\n\tsleep(5);\n}", "public function waitForBGPsBefore()\n {\n for ($x = 0; $x<60; $x++) {\n $finished = BackgroundProcessList::isFinishedProcessing();\n if ($finished == true) {\n return;\n }\n sleep(1);\n }\n return;\n }", "public function __sleep() {\n\t\t\treturn parent::__sleep();\n\t\t}", "public function __sleep() {\n\t\t\treturn parent::__sleep();\n\t\t}", "private function waitForUnlocking()\n\t{\n\t\t$times = self::LOCK_TTL;\n\t\t$i = 0;\n\t\twhile ($this->isExecutionLocked() && $i < $times)\n\t\t{\n\t\t\tsleep(1);\n\t\t\t$i++;\n\t\t}\n\t}", "public function waitForSolrAfter()\n {\n if (APP_SOLR_INDEXER == \"ON\") {\n for ($x = 0; $x<30; $x++) {\n $finished = FulltextQueue::isFinishedProcessing();\n if ($finished == true) {\n return;\n }\n sleep(1);\n }\n return;\n }\n }", "public function afterSyncing() {}", "public function iWaitForAjax() {\n $this->getSession()->wait(5000, 'typeof jQuery !== \"undefined\" && jQuery.active === 0');\n }", "public function test_refreshMessageTimeout() {\n\n }", "public function waitForSolr()\n {\n if (APP_SOLR_INDEXER == \"ON\") {\n for ($x = 0; $x<30; $x++) {\n $finished = FulltextQueue::isFinishedProcessing();\n if ($finished == true) {\n return;\n }\n sleep(1);\n }\n }\n return;\n }", "public function __sleep()\n {\n return array();\n }", "public function waitForBGPsAfter()\n {\n for ($x = 0; $x<60; $x++) {\n $finished = BackgroundProcessList::isFinishedProcessing();\n if ($finished == true) {\n return;\n }\n sleep(1);\n }\n return;\n }", "public static function sleep();", "function waitCursorOn()\n\t{\n\t\t$this->bWaitCursor = true;\n\t}", "public function iWaitForAjaxToFinish() {\n $this->getSession()->wait(10000, '(typeof(jQuery)==\"undefined\" || (0 === jQuery.active && 0 === jQuery(\\':animated\\').length))');\n }", "public function wait(int $timeout = 0) : bool{}", "function waitServerReady() {\n\n\t\t$this->client->query('GetStatus');\n\t\t$status = $this->client->getResponse();\n\t\tif ($status['Code'] != 4) {\n\t\t\t$this->console(\"Waiting for dedicated server to reach status 'Running - Play'...\");\n\t\t\t$this->console('Status: ' . $status['Name']);\n\t\t\t$timeout = 0;\n\t\t\t$laststatus = $status['Name'];\n\t\t\twhile ($status['Code'] != 4) {\n\t\t\t\tsleep(1);\n\t\t\t\t$this->client->query('GetStatus');\n\t\t\t\t$status = $this->client->getResponse();\n\t\t\t\tif ($laststatus != $status['Name']) {\n\t\t\t\t\t$this->console('Status: ' . $status['Name']);\n\t\t\t\t\t$laststatus = $status['Name'];\n\t\t\t\t}\n\t\t\t\tif (isset($this->server->timeout) && $timeout++ > $this->server->timeout)\n\t\t\t\t\ttrigger_error('Timed out while waiting for dedicated server!', E_USER_ERROR);\n\t\t\t}\n\t\t}\n\t}", "public function wait(): array;", "function get_delay_to_server($link, $data, $address) // Colorize: green\n { // Colorize: green\n $server_url = \"https://\" . $address . \"/rest/ping.php\"; // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n $curl_multi = curl_multi_init(); // Colorize: green\n $curl_sessions = []; // Colorize: green\n // Colorize: green\n for ($i = 0; $i < 10; ++$i) // Colorize: green\n { // Colorize: green\n $curl_session = curl_init($server_url); // Colorize: green\n // Colorize: green\n curl_setopt($curl_session, CURLOPT_CONNECTTIMEOUT, 10); // Colorize: green\n curl_setopt($curl_session, CURLOPT_HEADER, false); // Colorize: green\n curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, true); // Colorize: green\n curl_setopt($curl_session, CURLOPT_SSL_VERIFYHOST, 0); // Colorize: green\n curl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, 0); // Colorize: green\n // Colorize: green\n curl_multi_add_handle($curl_multi, $curl_session); // Colorize: green\n array_push($curl_sessions, $curl_session); // Colorize: green\n } // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n $active = false; // Colorize: green\n // Colorize: green\n do // Colorize: green\n { // Colorize: green\n $status = curl_multi_exec($curl_multi, $active); // Colorize: green\n // Colorize: green\n if ($active) // Colorize: green\n { // Colorize: green\n curl_multi_select($curl_multi); // Colorize: green\n } // Colorize: green\n } while($active && $status == CURLM_OK); // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n $responses = []; // Colorize: green\n $ping_total = 0; // Colorize: green\n // Colorize: green\n foreach ($curl_sessions as $curl_session) // Colorize: green\n { // Colorize: green\n array_push($responses, curl_multi_getcontent($curl_session)); // Colorize: green\n $ping_total += curl_getinfo($curl_session, CURLINFO_TOTAL_TIME); // Colorize: green\n // Colorize: green\n curl_multi_remove_handle($curl_multi, $curl_session); // Colorize: green\n curl_close($curl_session); // Colorize: green\n } // Colorize: green\n // Colorize: green\n curl_multi_close($curl_multi); // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n foreach ($responses as $response) // Colorize: green\n { // Colorize: green\n if ($response) // Colorize: green\n { // Colorize: green\n $response = json_decode($response, true); // Colorize: green\n // Colorize: green\n if ($response[\"status\"] != \"OK\") // Colorize: green\n { // Colorize: green\n $error_details = \"Invalid response from server \" . $server_url . \" : \" . json_encode($response); // Colorize: green\n error_log($error_details); // Colorize: green\n // Colorize: green\n db_disconnect($link); // Colorize: green\n // Colorize: green\n $data[\"message\"] = \"Request error\"; // Colorize: green\n $data[\"details\"] = $error_details; // Colorize: green\n // Colorize: green\n die(json_encode($data)); // Colorize: green\n } // Colorize: green\n } // Colorize: green\n else // Colorize: green\n { // Colorize: green\n $error_details = \"Failed to get response from server \" . $server_url; // Colorize: green\n error_log($error_details); // Colorize: green\n // Colorize: green\n db_disconnect($link); // Colorize: green\n // Colorize: green\n $data[\"message\"] = \"Request error\"; // Colorize: green\n $data[\"details\"] = $error_details; // Colorize: green\n // Colorize: green\n die(json_encode($data)); // Colorize: green\n } // Colorize: green\n } // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n return round($ping_total * 100000); // Colorize: green\n }", "public function __sleep()\n {\n return [];\n }", "public function waitForBGPs()\n {\n for ($x = 0; $x<60; $x++) {\n $finished = BackgroundProcessList::isFinishedProcessing();\n if ($finished == true) {\n return;\n }\n sleep(1);\n }\n return;\n }", "public function iWaitMicrosecondsForTheAnimation($microSeconds)\n {\n usleep($microSeconds);\n }", "public static function waitTime($time_Second=1){\n\t\tusleep($time_Second*1000000);\n\t}", "public function __sleep()\n\t{\n\t\tforeach ($this->_retrieved as $field => $object)\n\t\t{\n\t\t\tif ($object instanceof Database_MySQL_Result)\n\t\t\t{\n\t\t\t\t// Database_MySQL_Results handle results differenly, so they must be converted\n\t\t\t\t// Otherwise they are invalide when they wake up.\n\t\t\t\t$this->_retrieved[$field] = new Database_Result_Cached($object->as_array(), '');\t\t\t\t\n\t\t\t}\n\t\t}\t\t\n\n\t\t// Return array of all properties to get them serialised\n\t\treturn array_keys(get_object_vars($this));\n\t}", "protected function delay()\n {\n sleep($this->transactionRestartDelay);\n }", "public function __sleep()\n {\n return SleepUtility::sleep(__CLASS__, ['formFactory', 'contextSelectorForm', 'session', 'logger']);\n }", "function check_message_status($messageId){\n global $platform;\n try {\n $endpoint = \"/restapi/v1.0/account/~/extension/~/message-store/\".$messageId;\n $resp = $platform->get($endpoint);\n $jsonObj = $resp->json();\n print(\"Message status: \" . $jsonObj->messageStatus . PHP_EOL);\n if ($jsonObj->messageStatus == \"Queued\"){\n sleep(2);\n check_message_status($jsonObj->id);\n }\n } catch (\\RingCentral\\SDK\\Http\\ApiException $e) {\n exit(\"Error message: \" . $e->message . PHP_EOL);\n }\n}", "public function iWaitForSeconds($arg1) {\n sleep($arg1);\n }", "protected function _waitAudioReinvite()\n {\n $this->_timer->reset();\n $this->_timer->setOptions( array( Streamwide_Engine_Timer_Timeout::OPT_DELAY => 1 ) );\n $this->_timer->addEventListener(\n Streamwide_Engine_Events_Event::TIMEOUT,\n array(\n 'callback' => array( $this, 'onAudioReinviteTimeout' ),\n 'options' => array( 'autoRemove' => 'before' )\n )\n );\n $this->_timer->arm();\n }", "public function proceededAt()\n {\n }", "function timeoutHeartBeat()\n {\n if (3 == mt_rand(1, 7) && FALSE !== ($env = $this->getEnvironment())) {\n $env->tell($this->mChat[mt_rand(0, sizeof($this->mChat) - 1)]);\n }\n\n DpNpc::timeoutHeartBeat();\n }", "public function timeout();", "public function iWaitSecondsForElement($count, $element): void\n {\n $found = false;\n $startTime = \\time();\n $e = null;\n\n do {\n try {\n \\usleep(1000);\n $node = $this->getSession()->getPage()->findAll('css', $element);\n $this->assertCount(1, $node);\n $found = true;\n } catch (ExpectationException $e) {\n /* Intentionally leave blank */\n }\n } while (!$found && (\\time() - $startTime < $count));\n\n if ($found === false) {\n $message = \"The element '$element' was not found after a $count seconds timeout\";\n throw new ResponseTextException($message, $this->getSession()->getDriver(), $e);\n }\n }", "public function __sleep()\n\t{\n\t\t$this->_redisMaster = $this->_redisSlave = null;\n\t}", "public function wait($name, $delay = 30);", "function waitForDependencies(): void\n{\n $autoload = __DIR__ . \"/../vendor/autoload.php\";\n $maxIntents = 4;\n $intents = 0;\n while (!file_exists($autoload) && $intents < $maxIntents) {\n $intents++;\n echo(\"Waiting 15 seconds for composer to install dependencies\" . PHP_EOL);\n sleep(5);\n }\n if (!file_exists($autoload)) {\n throw new Exception(\"Could not find dependencies.\" . PHP_EOL);\n }\n}", "function show_wait_message()\n\t\t{\n\t\t\tif(!@is_object($GLOBALS['egw']->js))\n\t\t\t{\n\t\t\t\t$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');\n\t\t\t}\n\t\t\t$please_wait=lang('Please wait, task in progress ...');\n\t\t\t$GLOBALS['egw_info']['flags']['java_script'] .= '<script type=\"text/javascript\">\n\t\t\t\tdocument.write(\\'<DIV id=\"loading\"><BR><BR>\\'+\"'.$please_wait.'\" +\\'</DIV>\\');\n\t\t\t\tfunction hide_loading()\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById(\"loading\").style.display=\"none\";\n\t\t\t\t}</script>';\n\t\t\t$GLOBALS['egw']->js->set_onload('hide_loading();');\n\t\t}", "protected function sleep(){\n flush();\n $s = ($this->throttleTime == 1) ? '' : 's';\n $this->log(\"Request was throttled, Sleeping for \".$this->throttleTime.\" second$s\",'Throttle');\n sleep($this->throttleTime);\n }", "public function wait_response($allowTimeout);", "public function waiting_requester(){\n\n }", "public function run()\n {\n echo \"I'am run slowly <br>\";\n }", "private function checkApiRequestsLimit()\n {\n $tempTime = time() - $this->startTime;\n if($this->apiRequestsCount >= $this->apiRequestsLimit && $tempTime < $this->apiTimeLimit) {\n usleep(($this->apiTimeLimit - $tempTime)*1000000);\n $this->apiRequestsCount = 1;\n $this->startTime = time();\n } else {\n $this->apiRequestsCount++;\n }\n }", "#[@test, @limit(time= 0.010)]\n public function timeouts() {\n $start= gettimeofday();\n $end= (1000000 * $start['sec']) + $start['usec'] + 1000 * 50; // 0.05 seconds\n do {\n $now= gettimeofday();\n } while ((1000000 * $now['sec']) + $now['usec'] < $end);\n }", "public function __sleep(): array\n {\n return [];\n }", "public function __sleep()\n {\n return array('request','response','sources','contents','errors');\n }", "protected function tick() {\n // per second, but possibly more often.\n }", "public function iWaitForSeconds($seconds) {\n sleep($seconds);\n }", "function __sleep() {\n // longer exist after caching.\n return array_diff(array_keys(get_object_vars($this)), array('form', 'parent'));\n }", "protected function finish() {}", "function sleep_20000_micro() {\n tusleep(20000);\n}", "public function __sleep() {\n\t\t$result = array_merge($this->originalData,$this->modifiedData);\n\t\treturn $result;\n\t}", "public function benchThisWillBeSkipped()\n {\n }", "function CIR_waitForNextJob()\n{\n\t$lang = getClientLanguage();\n\n\t$quiet = ($_SESSION['debug'] ? \"\": \"-qq\");\n\n\tinclude(\"/m23/inc/i18n/\".I18N_m23instLanguage($lang).\"/m23inst.php\");\n\n\n\techo(\"\n#mv work.php `date +%s`.old\n\nSEC=0\nTIME=0\nloopRun=`true`\n\nwhile \\$loopRun\n\tdo\n\t\");\n\n\tif (RMV_get(\"debug\")!=1)\n\techo(\"dialog --backtitle \\\"$I18N_client_installation\\\" --title \\\"$I18N_client_status\\\" --infobox \\\"\\n$I18N_waiting_for_jobs\\\" 6 70\");\n\n\techo(\"\n\t\t#Add the client ID if it is available\n\t\tid=`cat /m23clientID 2> /dev/null`\n\t\tif test \\$id\n\t\tthen\n\t\t\tidvar=\\\"?m23clientID=\\$id\\\"\n\t\tfi\n\n\t\twget $quiet -Owork.php \\\"https://\".getServerIP().\"/work.php\\$idvar\\\" --no-check-certificate\n\t\t\n\t\tif test `find work.php -printf \\\"%s\\\"` -gt 0\n\t\tthen\n\t\t\tchmod +x work.php\n\t\t\tloopRun=`false`\n\t\t\tbreak\n\t\tfi\n\t\tsleep 20\n\t\tTIME=`expr \\$SEC / 60`\n\t\tSEC=`expr \\$SEC + 20`\n\tdone\n\t./work.php\n\t\\n\");\n}", "public function pauseWorking(){\r\n\r\n }", "function wait_for_serverpilot_action( $action_id ) {\n\t$sp = sp();\n\t$ok = false;\n\tdo {\n\t\tsleep( 1 );\n\t\t$status = $sp->action_info( $action_id );\n\t} while ( 'open' === $status->data->status );\n\treturn $status;\n}", "public function test_now_vs_then(){\n\t\n\t\t$listotron = new Listotron();\n\t\t$now = $listotron->getNOW();\n\t\tusleep(300);\n\t\t$listotron->updateNOW();\n\t\t$then = $listotron->getNOW();\n\n\t\t$this->assertNotEqual($now, $then);\n\t}", "public function __sleep() {\n\t\t$this->timestamp = $this->date->getTimestamp();\n\t\treturn array(\n\t\t\t'timestamp',\n\t\t);\n\t}" ]
[ "0.6828402", "0.6828402", "0.6828402", "0.6828402", "0.6713573", "0.6631917", "0.6318536", "0.6237579", "0.62023747", "0.61900574", "0.61701643", "0.6169618", "0.6169618", "0.6169618", "0.6168827", "0.6168827", "0.6168827", "0.6168827", "0.6168827", "0.6168827", "0.6168827", "0.6168827", "0.61671853", "0.6100938", "0.59849715", "0.5969218", "0.5964627", "0.58935267", "0.58491534", "0.5815773", "0.5795675", "0.57842666", "0.57373357", "0.5726575", "0.5726241", "0.5711184", "0.56592", "0.5629922", "0.5619078", "0.56113464", "0.56003743", "0.55982196", "0.5558877", "0.5557458", "0.5554617", "0.5553874", "0.5512681", "0.5512681", "0.54914534", "0.545815", "0.54057837", "0.54013604", "0.5398887", "0.53983676", "0.53937304", "0.53744763", "0.53679615", "0.53475213", "0.5332736", "0.53079194", "0.5289251", "0.5289146", "0.52851766", "0.52685195", "0.52539396", "0.5238639", "0.5225227", "0.5221936", "0.5202859", "0.5173096", "0.51675606", "0.5165596", "0.5162422", "0.5161789", "0.51541", "0.5151936", "0.51427907", "0.51003736", "0.5082215", "0.50780946", "0.5076433", "0.5071587", "0.50528073", "0.5049043", "0.5040952", "0.5023439", "0.50139403", "0.5007416", "0.4997993", "0.49958333", "0.49781442", "0.4969705", "0.49612394", "0.49562728", "0.49555406", "0.49534926", "0.4941623", "0.49406666", "0.49396533", "0.49387053", "0.49217165" ]
0.0
-1
TODO: Use Save button's ID
public function clickSaveButton() { $this->_webui->clickButton('.btn.btn-xs.btn-info.pull-right.mr20.btn-save'); sleep(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickSaveButton()\n {\n $this->browser->webui()->clickButton(\n WebDriverBy::cssSelector('.btn.btn-xs.btn-info.pull-right.mr20')\n );\n\n // TODO: Add Try/Catch\n // TODO: Validate Data (via API)\n\n print(\"ACTION : Clicked SAVE Button\".PHP_EOL);\n }", "function save_button()\n\t\t{\n\t\t\t$output = '<span class=\"ace_style_wrap\"><a href=\"#\" class=\"ace_button ace_button_inactive ace_submit\">Save all changes</a></span>';\n\t\t\treturn $output;\n\t\t}", "public function saveButton(){\n\n\t\t//get the properties of this column:\n\t\tif( !isset( $this->properties['buttonText'] ) )\n\t\t\t$this->getProperties();\n\n\t\techo '<a class=\"lightbox-modal-close\" href=\"#\">';\n\t\t\techo '<span class=\"media-modal-icon\"></span>';\n\t\techo '</a>';\n\n\t\techo '<div class=\"save-btn-container\">';\n\n\t\t\techo '<span class=\"spinner\"></span>';\n\n\t\t\techo '<button id=\"save-column\" class=\"save-btn section-btn\">';\n\t\t\t\techo esc_html( $this->properties['buttonText'] );\n\t\t\techo '</button>';\n\n\t\techo '</div>';\n\n\t}", "function okra_form_single_save() {\n\n\tif ($_POST[\"action\"] === \"okra_form_single_save\") {\n\n\t\tglobal $wpdb;\n\t\t$id = $_POST[\"id\"];\n\t\t//echo $id;\n\t\t$name = sanitize_text_field($_POST[\"name\"]);\n\t\t$page = sanitize_text_field($_POST[\"page\"]);\n\t\t$btn_text = sanitize_text_field($_POST[\"btn_text\"]);\n\t\t$short_code = sanitize_text_field($_POST[\"short_code\"]);\n\n\t\t$array = array(\n\t\t\t\"name\" => $name,\n\t\t\t\"page\" => $page,\n\t\t\t\"btn_text\"=>$btn_text,\n\t\t\t\"short_code\" => $short_code\n\t\t);\n\n\t\t$wpdb->update($wpdb->prefix . \"okra_all_forms\", $array, array(\"id\" => $id));\n\t\twp_redirect(admin_url() . \"?page=okra_wordpress_plugin&&update=true\");\n\n\t}\n}", "public function saveAction() {\n parent::saveAction();\n }", "public function getSaveButtonHtml()\n {\n return $this->getChildHtml('save_button');\n }", "function checkSaveButtons() {\n if ($this->arrTableParameters['savedok'] || $this->arrTableParameters['saveandclosedok']) {\n $tce = GeneralUtility::makeInstance('t3lib_TCEmain');\n $tce->stripslashes_values=0;\n if (count($this->arrTableParameters['grps'])) {\n\t $arrSave['grps'] = $this->arrTableParameters['grps'];\n\t $arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = serialize($arrSave);\n } else {\n \t$arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = '';\n }\n $tce->start($arrData,array());\n\t $tce->process_datamap();\n if ($this->arrTableParameters['saveandclosedok']) {\n header('Location: ' . GeneralUtility::locationHeaderUrl($this->arrWizardParameters['returnUrl']));\n\t\t\t\texit;\n }\n }\n }", "function save()\n {\n }", "function save()\n {\n }", "public function save()\r\n {\r\n \r\n }", "public function toggleSave() : void\n {\n }", "function save();", "function save();", "function Save();", "public function save()\n {\n // For V2.0\n }", "public function save()\r\n {\r\n //\r\n }", "public function save() {\n\t\t\t\n\t\t}", "public function save() {}", "public function save() {}", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "public function save() {}", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save()\n {\n }", "protected function _getSaveAndContinueUrl() \n {\n\treturn $this->getUrl('Brituy_SimpleBlog/*/save', ['_current' => true, 'back' => 'edit', 'active_tab' => '{{tab_id}}']);\n }", "public function getSaveAsButtonHtml()\n {\n return $this->getChildHtml('save_as_button');\n }", "protected function saving() {\n // This will get reimplemented by children when necessary\n }", "public function SaveNew(){\r\n\t\t$this->db->save();\r\n\t\t$this->GTemp->RenderStructure();\r\n\t\t$this->WidgetClass()->CreateNew();\r\n\t\treturn $this->db->id;\r\n\t}", "public function save()\n\t{\n\n\t}", "public function save(){\n }", "public function save()\n {\n }", "public function save()\n {\n }", "public function save() {\n }", "public function save() {\n }", "public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\t}", "public function save() {\n }", "private function _saveQcontrol() {\r\n\r\n }", "public function save($answerButton)\n {\n $answerButton->save();\n return $answerButton->id;\n }", "public function exportButton ()\n\t{\n\t}", "public function save()\n {\n //\n }", "public function save()\n {\n return;\n }", "public function actionAutoSave()\n {\n if(isset($_POST[\"Story\"][\"title\"]) && isset($_POST[\"ID\"]))\n {\n $return=Helpers::storySession(\"set\", $_POST[\"ID\"], NULL);\n echo json_encode([\"return_data\"=>$return]);\n }\n }", "function save() {\n \n\t if ($this->id == NULL) {\n\t \t\n\t\t mysql_query(\"INSERT INTO `videothumbs` ( `videoid`, `url`) VALUES ( '\".$this->videoid.\"', '\".$this->url.\"');\") or die(\"Query failed with error: \".mysql_error());\n\t\t $this->id = mysql_insert_id();\n\t \n\t } else {\n\t\t\t\t\n\t\t mysql_query(\"UPDATE `videothumbs` SET `videoid` = '\".$this->videoid.\"', `url` = '\".$this->url.\"' WHERE `id` = \".$this->id.\";\") or die(\"Query failed with error: \".mysql_error());\n\t }\n\t \n }", "public function save():void;", "private static function save()\r\n {\r\n return self::getDoc()->save(self::$XML_SLIDER_SAVE);\r\n }", "public final function save() {\n }", "function save()\r\n {\r\n $GLOBALS['DB']->exec(\"INSERT INTO inventory_items (name) VALUES ('{$this->getName()}')\");\r\n $this->id = $GLOBALS['DB']->lastInsertId();\r\n }", "function getButtonText()\r\n\t{\r\n\t\tif ( isset($this->object_it) )\r\n\t\t{\r\n\t\t\treturn translate('Сохранить');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn translate('Создать');\r\n\t\t}\r\n\t}", "public function afterSave()\n\t{\n\t\t//annoying on every edit, move to a checkbox on form and handle in controller\n\t}", "public function Save()\n {\n }", "function manipulate_insert_button($buttons) {\n $cNip= $this->user->gNIP;\n $data['upload']='upload_custom_grid';\n $js = $this->load->view('js/standard_js',$data,TRUE);\n\n $iframe = '<iframe name=\"v3_study_literatur_ad_frame\" id=\"v3_study_literatur_ad_frame\" height=\"0\" width=\"0\"></iframe>';\n \n $save_draft = '<button onclick=\"javascript:save_draft_btn_multiupload(\\'v3_study_literatur_ad\\', \\' '.base_url().'processor/plc/v3_study_literatur_ad?draft=true \\',this,true )\" id=\"button_save_draft_v3_study_literatur_ad\" class=\"ui-button-text icon-save\" >Save as Draft</button>';\n $save = '<button onclick=\"javascript:save_btn_multiupload(\\'v3_study_literatur_ad\\', \\' '.base_url().'processor/plc/v3_study_literatur_ad?company_id='.$this->input->get('company_id').'&group_id='.$this->input->get('group_id').'modul_id='.$this->input->get('modul_id').' \\',this,true )\" id=\"button_save_submit_v3_study_literatur_ad\" class=\"ui-button-text icon-save\" >Save &amp; Submit</button>';\n\n $AuthModul = $this->lib_plc->getAuthorModul($this->modul_id);\n $arrTeam = explode(',',$this->team);\n $nipAuthor = explode(',', $AuthModul['vNip_author']);\n\n if( in_array($AuthModul['vDept_author'],$arrTeam ) || in_array($this->user->gNIP, $nipAuthor) ){\n\n $buttons['save'] = $iframe.$save_draft.$save.$js;\n }else{\n unset($buttons['save']);\n $buttons['save'] = '<span style=\"color:red;\" title=\"'.$AuthModul['vDept_author'].'\">You\\'re Dept not Authorized</span>';\n }\n \n \n return $buttons;\n }", "protected function afterSave()\n\t{\n\t\tparent::afterSave();\n\t\tif(!$this->status == 1){\n\t\t$title = $this->howtoTitle($this->id);\n\t\t$tags = $this->tagLinks();\n\t\t$title = CHtml::link('Created '.$title , array('/howto/' . $this->id . '/' . $title ) );\n\t\t$shortText = substr($this->content,0,160);\n\t\t$content = $shortText.\"...<br/>Tags:\";\n\t\tforeach($tags as $tag){\n\t\t\t$content .=\" \".$tag.\",\";\n\t\t}\n\t\tAction::newAction($content,$title);\n\t\t}\n\t\t\n\t}", "public function save() {\n return $this->returnCommand(['SAVE']);\n }", "public function saveData()\r\n {\r\n \r\n }", "public final function save()\n {\n }", "public function save()\n {\n if($this->changed) {\n Item::saveNewValues($this->id, $this->name, $this->status);\n } else {\n echo 'Nothing changed!';\n }\n }", "public function save(){\n return isset($this->id) ? $this->update() : $this->create();\n \n }", "protected function prepareButtons()\n\t{\n\t\tparent::prepareButtons();\n\t\t$this->xt->assign(\"save_button\", false);\n\t\t$this->xt->assign(\"view_page_button\", false );\n\t\t\n\t\t$this->xt->assign(\"updsel_button\", true);\n\t\t$this->xt->assign(\"updselbutton_attrs\", \"id=\\\"saveButton\".$this->id.\"\\\"\" );\n\t\t\n\t\t$label = str_replace( \"%n%\", $this->nSelected, \"Update %n% records\" );\n\t\t$this->xt->assign(\"update_selected\", $label );\n\t}", "function __tinypass_save_buttons( TPPaySettings $ps, $edit = false ) {\n\t?>\n\n\t<p>\n\t\t<input type=\"submit\" name=\"_Submit\" value=\"Save Changes\" tabindex=\"4\" class=\"button-primary\" />\n\t</p>\n\n<?php }", "function save()\n {\n $GLOBALS['DB']->exec(\"INSERT INTO stores (store_name) VALUES (\n '{$this->getStoreName()}'\n );\");\n\n $this->id = $GLOBALS['DB']->lastInsertId();\n }", "public function getSaveUrl()\n {\n $this->setData('form_action_url', 'save');\n return $this->getFormActionUrl();\n }", "public function save(){\r\n return isset($this->id) ? $this->update() : $this->create();\r\n }", "function save()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$post\t= JRequest::get('post');\n\t\t$cid\t= JRequest::getVar( 'cid', array(0), 'post', 'array' );\n\t\t$post['id'] = (int) $cid[0];\n\n\t\t$model = $this->getModel('weblink');\n\n\t\tif ($model->store($post)) {\n\t\t\t$msg = JText::_( 'Weblink Saved' );\n\t\t} else {\n\t\t\t$msg = JText::_( 'Error Saving Weblink' );\n\t\t}\n\n\t\t// Check the table in so it can be edited.... we are done with it anyway\n\t\t$model->checkin();\n\t\t$link = 'index.php?option=com_weblinks';\n\t\t$this->setRedirect($link, $msg);\n\t}", "public function getSaveUrl()\n {\n return $this->getUrl('*/*/save');\n }", "public function save() {\n\n }", "function save() {\n //save the added fields\n }", "public function getButton() {}", "public function save(){\r\n\t \t\treturn isset($this->id) ? $this->update() : $this->create();\r\n\t\t}", "public\tfunction\tsave()\n\t\t{\n\t\t}", "public function getSaveMethod() {}", "protected function _postSave()\r\n\t{\r\n\t}", "public function save(){\n\t\treturn isset($this->id)?$this->update():$this->create();\t\n\t}", "public function save()\n\t{\n\t\tparent::save();\n\t\t\n\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\t\t\n\t\t$this->db->query('UPDATE `'.$table_prefix.'indicator_lang` SET indicator_title = ?, indicator_description = ? WHERE indicator_id = ? AND locale = ?',\n\t\t\t$this->indicator_title, $this->indicator_description, $this->id, $this->locale\n\t\t);\n\t}", "public function savesubmit(){\n\t\t$this->autoRender = false;\n\t\t if($this->request->is('POST')){ \n\t\t\t //\n\t\t \n\t\t\t$this->Session->write('project.aftersave', 'sent');\n//\t\t\t$this->Session->write('brief.type', $this->name);\n\t\t\t$this->Session->write('brief.type', $this->params['controller']);\n\t\t\t$this->Session->write('brief.id', $this->Email->id);\n\t\t\t \n\t\t\t \n\t\t\t//echo 'aftersave';\t\n\t\t\t //$this->redirect(array('controller'=>'projects', 'action' => 'view', $this->Session->read('project.id') ));\n\n\t\t }\t\t\n\t}", "public function actionSave()\n\t{\n\t\t$redirect = parent::actionSave();\n\t\t\n\t\tif (!empty($redirect))\n\t\t{\n\t\t\t// send bookmark alert\n\t\t\t$postId = $this->_input->filterSingle('post_id', XenForo_Input::UINT);\n\t\t\t$bookmarksModel = $this->_getBookmarksModel();\n\t\t\t$bookmarksModel->sendBookmarkAlerts('post', $postId, 'content_edit', 'edit');\n\t\t}\n\t\t\n\t\treturn $redirect;\n\t}", "public function save(){\n\t\tglobal $wpdb;\n\t\t$wpdb->insert( $wpdb->prefix . 'cf_form_entry_values', $this->to_array() );\n\t\treturn (int) $wpdb->insert_id;\n\n\t}", "public function save()\n\t{\n\n\t\treturn parent::save();\n\t}", "protected function saveData()\n {\n // TODO: データ保存\n\n // 一次データ削除\n $this->deleteStore();\n\n drupal_set_message($this->t('The form has been saved.'));\n }", "public function onAfterSave();", "public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }", "public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function postSave() {}" ]
[ "0.720786", "0.69002706", "0.68441993", "0.6817233", "0.6794484", "0.6762061", "0.6723477", "0.6566381", "0.6566381", "0.64511377", "0.64470845", "0.64462084", "0.64462084", "0.6382585", "0.63739383", "0.63544965", "0.631375", "0.63132477", "0.63132477", "0.63124084", "0.63124084", "0.63124084", "0.63093615", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.6284192", "0.62828636", "0.6240744", "0.621762", "0.62168366", "0.6209574", "0.62050205", "0.6203505", "0.61939865", "0.61939865", "0.61926675", "0.61926675", "0.6190269", "0.6189267", "0.61578554", "0.61461294", "0.61329246", "0.61303073", "0.6108391", "0.6108036", "0.6107591", "0.6105952", "0.6090151", "0.6077979", "0.6072141", "0.6065961", "0.60656935", "0.60618967", "0.60481626", "0.6040761", "0.6028931", "0.60230464", "0.60224974", "0.60145956", "0.59907156", "0.5990597", "0.59720504", "0.59703314", "0.5970195", "0.5960366", "0.5947395", "0.5936243", "0.5926599", "0.5925037", "0.59174305", "0.59107596", "0.59072524", "0.5901938", "0.58929056", "0.5884209", "0.58624965", "0.58550596", "0.5836807", "0.58243775", "0.5823104", "0.58182824", "0.58181816", "0.5816202", "0.5814039", "0.5809003" ]
0.7074003
1
TODO: Add ID to "Done" button
public function clickDoneButton() { $this->_webui->clickButton(".btn.btn-default.btn-xs.pull-right.btn-dismiss"); sleep(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function markAsDoneAction() {\n\t\t$todo = new todo;\n\t\t$todo = $todo->Get($this->get['id']);\n\t\t$todo->done = 1;\n\t\t$todo->Save();\n\n\t\treturn $this->indexAction();\n\t}", "function clickDoneButton()\n {\n $this->browser->webui()->clickButton(\n WebDriverBy::cssSelector(\".btn.btn-default.btn-xs.pull-right.dismissButton\")\n );\n\n // TODO: Validate that the window has closed\n\n print(\"ACTION : Clicked DONE Button\".PHP_EOL);\n }", "public function doneAction()\n\t{\n\t\n\t}", "public function doneAction()\n {\n \n }", "public function getIdDone()\n {\n return $this->id_done;\n }", "public function done()\n {\n $this->setStatus(self::STATUS_DONE);\n }", "public function markAsDone() {\n\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_thread\n\t\t\tSET\tisDone = 1\n\t\t\tWHERE\tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "protected function prompt_done() {\n $this->prompt_info(\", done.\");\n }", "public function doneAction()\n {\n return array();\n }", "public function getDoneFlag()\r\n {\r\n return $this->doneFlag;\r\n }", "public function submitButton(){\n\t\t\n\t\t$this->addElement('button', 'bttnsubmit', array (\n\t\t\t\t'class' => 'btn blue ',\n\t\t\t\t'ignore'=>true,\n\t\t\t\t'type'=>'submit',\n \t\t\t\t'label'=>'<i class=\"fa fa-check\"></i> Save',\n\t\t\t\t'escape'=>false\n\t\t));\n\t\t$this->bttnsubmit->setDecorators(array('ViewHelper',array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' =>'form-actions text-right'))\t));\n\t\t\n\t}", "protected function prompt_all_done() {\n $this->prompt_info($this->MAIL_USER);\n $this->prompt_info(\"All done.\");\n }", "public function finished(){\r\n $this->session->set_userdata('referred_from', current_url());\r\n $data['tasks'] = $this->TaskModel->getFinishedTasks($this->userId);\r\n $data['taskTitle'] = \"Finished Tasks\";\r\n $data['base_url'] = $this->base_url;\r\n $data['title'] = \"ICT Cloud | Admin | Tasks\";\r\n\r\n $data['finish'] = false;\r\n $data['delete'] = false;\r\n\r\n $data['menu'] = \"\";\r\n\r\n foreach($this->menu['Menu'] as $m)\r\n {\r\n $data['menu'] .= '<li>';\r\n $data['menu'] .= '<a href=\"'.$m['AppMenuLink'].'\"><i class=\"fa '.$m['AppMenuIcon'].' fa-fw\"></i> '.$m['AppMenuName'].'</a>';\r\n $data['menu'] .= '</li>';\r\n }\r\n\r\n $data['formTaskName'] = $this->formTaskName;\r\n $data['formOptions'] = $this->formOptions;\r\n $data['formSubmit'] = $this->formSubmit;\r\n $data['formTaskDescription'] = $this->formTaskDescription;\r\n $data['formEndDate'] = $this->formEndDate;\r\n\r\n $data['Groups'] = $this->adminGroups;\r\n\r\n $this->load_view(\"Task/TaskList\", $data);\r\n }", "public function isComplete() {\n return $this->getDescription() == 'Done';\n }", "function common_footer($button = \"Submit Changes\")\r\n\t{\r\n\r\n\t\tglobal $IN, $INFO, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;\r\n\t\t$ibforums = Ibf::app();\r\n\r\n\t\t$ADMIN->html .= $SKIN->end_form($button);\r\n\r\n\t\t$ADMIN->html .= $SKIN->end_table();\r\n\r\n\t\t$ADMIN->output();\r\n\r\n\t}", "public function done(){\n\t\t$this->done=true;\n\t}", "protected function confirm_add()\n\t{\n\t\t$msg = 'Successfully added project ' . $this->fields['Title'] . '.';\n\t\treturn '<font color=\"green\">' . $msg . '</font><br>';\n\n\t}", "public function task_done($id) \n {\n $task = Task::find($id);\n $task->done = new DateTime();\n $task->save();\n return redirect()->route('home');\n }", "public function actionRegdone()\n\t{\n\t\t$this->render('regdone');\n\t}", "function setKeyWordDone($id, $done=true){\n\t\tglobal $db;\n\t\tif(!$done){$done=0;}\n\t\t$statement = $db->prepare('UPDATE key_word_list SET done=:done WHERE ID = :key_word');\n\t\t$statement->execute(array(':done'=>$done, ':key_word' => $id));\n\t}", "public function closeToDo()\n {\n $todos = Todo::where('type', 'maintenance')->where('type_id', $this->id)->where('status', '1')->get();\n foreach ($todos as $todo) {\n $todo->status = 0;\n $todo->done_at = Carbon::now();\n $todo->done_by = Auth::user()->id;\n $todo->save();\n }\n }", "function save_button()\n\t\t{\n\t\t\t$output = '<span class=\"ace_style_wrap\"><a href=\"#\" class=\"ace_button ace_button_inactive ace_submit\">Save all changes</a></span>';\n\t\t\treturn $output;\n\t\t}", "public function done() {\r\n\r\n\t\tdo_action( 'listeo_core_listing_submitted', $this->listing_id );\r\n\t\t$template_loader = new Listeo_Core_Template_Loader;\r\n\t\t$template_loader->set_template_data( \r\n\t\t\tarray( \r\n\t\t\t\t'listing' \t=> get_post( $this->listing_id ),\r\n\t\t\t\t'id' \t\t=> \t$this->listing_id,\r\n\t\t\t\t) \r\n\t\t\t)->get_template_part( 'listing-submitted' );\r\n\r\n\t}", "function getDoneTask(){\n $item = new RepairServiceModel();\n return $item->viewDoneTask();\n }", "protected function done()\n {\n }", "private function stepDone (SymfonyStyle $io)\n {\n $io->writeln(\"<fg=green>done.</>\");\n $io->newLine(2);\n }", "function checkSaveButtons() {\n if ($this->arrTableParameters['savedok'] || $this->arrTableParameters['saveandclosedok']) {\n $tce = GeneralUtility::makeInstance('t3lib_TCEmain');\n $tce->stripslashes_values=0;\n if (count($this->arrTableParameters['grps'])) {\n\t $arrSave['grps'] = $this->arrTableParameters['grps'];\n\t $arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = serialize($arrSave);\n } else {\n \t$arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = '';\n }\n $tce->start($arrData,array());\n\t $tce->process_datamap();\n if ($this->arrTableParameters['saveandclosedok']) {\n header('Location: ' . GeneralUtility::locationHeaderUrl($this->arrWizardParameters['returnUrl']));\n\t\t\t\texit;\n }\n }\n }", "function setUpdateConfirmElementToolbar()\n\t{\n\t JToolBarHelper::title(JText::_('UPDATEFIELDSTRUCTURE') , 'fabrik-element.png');\n\t JToolBarHelper::save('elementUpdate');\n\t\tJToolBarHelper::cancel('elementRevert');\n\t}", "public function setIdDone($id_done)\n {\n $this->id_done = $id_done;\n\n return $this;\n }", "public function addsButtons() {}", "protected function isWizardDone() {}", "function show()\r\n\t{\r\n\t\t?>\r\n\r\n\t\t<button class='textlayout' type=\"submit\" name=\"itemtoedit\" value=\"<?php echo $this->orderno ?>\" >\r\n\t\t\t<p>\r\n\t\t\t<span style='font-weight:bold'><?php echo $this->orderno . \". \" . $this->question ; ?></span>\r\n\t\t\t<span style='font-weight:normal'>(<?php echo $this->typeshort; ?>)</span><br>\r\n\t\t\t<span><?php $n = 1; foreach($this->answers as $answerobject){if ($n > 1){echo \", \";}$n ++;echo $answerobject->answer;}?></span>\r\n\t\t\t</p>\r\n\t\t</button><br>\r\n\t\t\r\n\t\t<?php \r\n\t}", "public function testIsMarkedDoneIfUndone()\n {\n $this->addTestFixtures();\n $id = $this->task->getId();\n $title = $this->task->getTitle();\n $this->logInAsUser();\n $this->client->request('GET', '/tasks/'.$id.'/toggle');\n\n $isDone = $this->task->getIsDone();\n\n $statusCode = $this->client->getResponse()->getStatusCode();\n $this->assertEquals(302, $statusCode);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertEquals(true, $isDone);\n $this->assertContains('Superbe! La tâche '.$title.' a bien été marquée comme faite.', $crawler->filter('div.alert.alert-success')->text());\n }", "function on_submit_button($button, $form) {\n\t\tif ($form['id'] != $this->form_id) {\n\t\t\treturn $button;\n\t\t}\n\t\treturn '';\n\t}", "protected function confirm_edit()\n\t{\n\t\t$msg = 'Successfully modified project ' . $this->fields['Title'] . '.';\n\t\treturn '<font color=\"green\">' . $msg . '</font><br>';\n\n\t}", "function getAll(){\n $stmt = $this->conn->prepare(\"SELECT * FROM tbltodo ORDER BY id DESC \");\n $stmt->execute();\n if($stmt->rowCount() >0){\n //Query di outputkan menjadi array asosiasi\n while ($row=$stmt->fetch(PDO::FETCH_ASSOC)){\n ?>\n <li>\n <h1> <?php print($row['title']); ?> </h1>\n <form method=\"post\">\n <?php\n if ($row['completed'] == 1){\n echo 'Status : Sudah Dikerjakan<br>'; \n }\n else{\n echo 'Status : Belum Dikerjakan<br>';\n echo \"<button type='submit' value={$row['id']} class='button' name='complete'> Selesai </button>\";\n }\n ?>\n <button type=\"submit\" value= <?php print($row['id']); ?> class=\"button\" name=\"edit\"> Edit </button>\n <button type=\"submit\" value= <?php print($row['id']); ?> class=\"delete-button\" name=\"delete\"> Hapus </button>\n </form>\n </li>\n <?php\n }\n }else {\n echo \"<h1> Tidak ada Kegiatan :(</h1>\";\n }\n }", "protected static function getSubmitButtons($args) {\r\n $r = '';\r\n global $indicia_templates;\r\n $r .= '<input type=\"submit\" class=\"' . $indicia_templates['buttonDefaultClass'] . '\" id=\"save-button\" value=\"'.lang::get('Submit').\"\\\" />\\n\";\r\n if (!empty($_GET['location_id'])) {\r\n //Don't display delete if in view only mode\r\n if (empty($_GET['summary_mode']) || $_GET['summary_mode']=='false') {\r\n // use a button here, not input, as Chrome does not post the input value\r\n $r .= '<button type=\"submit\" class=\"' . $indicia_templates['buttonWarningClass'] . '\" id=\"delete-button\" name=\"delete-button\" value=\"delete\" >'.lang::get('Delete').\"</button>\\n\";\r\n data_entry_helper::$javascript .= \"$('#delete-button').click(function(e) {\r\n if (!confirm(\\\"Are you sure you want to delete this location?\\\")) {\r\n e.preventDefault();\r\n return false;\r\n }\r\n });\\n\";\r\n }\r\n }\r\n return $r;\r\n }", "function form_content_buttons()\r\n {\r\n return $this->form_content_buttons_Confirm_Cancel() ;\r\n }", "function learn_press_course_lesson_complete_button() {\n\t\tlearn_press_get_template( 'content-lesson/complete-button.php' );\n\t}", "public function personal_task_done(Request $request)\n {\n $personal = Personal::find($request->id);\n $personal->status = 'Done';\n \n $personal->save();\n echo $this->index();\n }", "public function isDone()\n {\n return $this->result == self::RESULT_DONE;\n }", "public static function printFoot (){\n\t?>\t\t\n\t\t\t\t<p class='submit'>\n\t\t\t\t\t<input type='submit' name='Submit' value=\"<?php _e('Save changes') ?>\" class='button-primary' />\n\t\t\t\t</p>\t\t\t\t\n\t\t\t\t\n\t\t\t</form>\n\t\t</div>\n\t\t\n\t<?php\n\t}", "function renderSubmitButtons() {\n\t\t$output = '';\n\n\t\tif ($this->currentStep < count($this->steps) && count($this->steps) > 1 && $this->showNextButton) {\n\t\t\t$output .= '<input style=\"display:none;\" type=\"submit\" name=\"'.$this->prefixId.'[submitproceed]\" value=\"'.htmlspecialchars($this->LANG->sL($this->localLangLabels['renderSubmitButtons_proceed'])).'\" tabindex=\"1000\" />';\n\t\t\t$output .= '<input type=\"hidden\" name=\"'.$this->prefixId.'[currentstep]\" value=\"'.$this->currentStep.'\" />';\n\t\t}\n\t\tif ($this->showCancelButton) {\n\t\t\t$output .= '<input style=\"float:left;\" type=\"submit\" name=\"'.$this->prefixId.'[submitcancel]\" value=\"'.htmlspecialchars($this->LANG->sL($this->localLangLabels['renderSubmitButtons_cancel'])).'\" tabindex=\"1030\" />';\n\t\t}\n\t\tif ($this->currentStep > 1 && $this->showPreviousButton) {\n\t\t\t$output .= '<input style=\"float:left;\" type=\"submit\" name=\"'.$this->prefixId.'[submitback]\" value=\"'.htmlspecialchars($this->LANG->sL($this->localLangLabels['renderSubmitButtons_back'])).'\" tabindex=\"1020\" />';\n\t\t\t$output .= '<input type=\"hidden\" name=\"'.$this->prefixId.'[currentstep]\" value=\"'.$this->currentStep.'\" />';\n\t\t}\n\t\tif ($this->currentStep == count($this->steps) && $this->showNextButton) {\n\t\t\t$output .= '<input style=\"float:left;\" type=\"submit\" name=\"'.$this->prefixId.'[submitsubmit]\" value=\"'.htmlspecialchars($this->LANG->sL($this->localLangLabels['renderSubmitButtons_submit'])).'\" tabindex=\"1000\" />';\n\t\t}\n\t\tif ($this->currentStep < count($this->steps) && count($this->steps) > 1 && $this->showNextButton) {\n\t\t\t$output .= '<input style=\"float:left;\" type=\"submit\" name=\"'.$this->prefixId.'[submitproceed]\" value=\"'.htmlspecialchars($this->LANG->sL($this->localLangLabels['renderSubmitButtons_proceed'])).'\" tabindex=\"1010\" />';\n\t\t}\n\t\treturn '<div class=\"tx-frontendformslib-submitbuttons\">'.$output.'</div>';\n\t}", "public function displayFinished() \n {\n if ($this->has_finished) {\n return '<i style=\"font-size:25px;color:#449D44;\" class=\"fa fa-check\" aria-hidden=\"true\"></i>';\n } else {\n return '<i style=\"font-size:25px;color:#C9302C;\" class=\"fa fa-times\" aria-hidden=\"true\"></i>';\n }\n }", "function rt_button_delete($target)\n{\n return rt_ui_button('delete', $target, 'trash', array('method' => 'post', 'confirm' => 'Are you sure?'));\n}", "public function finish()\n {\n parent::finish();\n \n $form_entry_list_method = sprintf( 'get_%s_entry_list', $this->get_subject() );\n $session = lib::create( 'business\\session' );\n $db_user = $session->get_user();\n $db_role = $session->get_role();\n\n foreach( $this->get_record_list() as $record )\n {\n // determine who has worked on the form\n $typist_1 = 'n/a';\n $typist_1_submitted = false;\n $typist_2 = 'n/a';\n $typist_2_submitted = false;\n\n $form_entry_list = $record->$form_entry_list_method();\n $db_form_entry = current( $form_entry_list );\n if( $db_form_entry )\n {\n $typist_1 = $db_form_entry->get_user()->name;\n $typist_1_submitted = !$db_form_entry->deferred;\n }\n $db_form_entry = next( $form_entry_list );\n if( $db_form_entry )\n {\n $typist_2 = $db_form_entry->get_user()->name;\n $typist_2_submitted = !$db_form_entry->deferred;\n }\n\n // if both typists have submitted and this form is still in the list then there is a conflict\n $conflict = $typist_1_submitted && $typist_2_submitted;\n\n $this->add_row( $record->id,\n array( 'id' => $record->id,\n 'date' => $record->date,\n 'typist_1' => $typist_1,\n 'typist_1_submitted' => $typist_1_submitted,\n 'typist_2' => $typist_2,\n 'typist_2_submitted' => $typist_2_submitted,\n 'conflict' => $conflict ) );\n }\n\n $this->finish_setting_rows();\n }", "function submit_button($text = \\null, $type = 'primary', $name = 'submit', $wrap = \\true, $other_attributes = \\null)\n {\n }", "public function testIsMarkedUndoneIfDone()\n {\n $this->addTestFixtures();\n $id = $this->task->getId();\n $title = $this->task->getTitle();\n $this->task->setIsDone(true);\n $this->logInAsUser();\n $this->client->request('GET', '/tasks/'.$id.'/toggle');\n\n $isDone = $this->task->getIsDone();\n\n $statusCode = $this->client->getResponse()->getStatusCode();\n $this->assertEquals(302, $statusCode);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertEquals(false, $isDone);\n $this->assertContains('Superbe! La tâche '.$title.' a bien été marquée comme à faire.', $crawler->filter('div.alert.alert-success')->text());\n }", "public function exportButton ()\n\t{\n\t}", "public function setTaskDone()\n {\n // Simply unlink our task file.\n unlink($this->taskFilePath);\n }", "function form_content_buttons()\r\n {\r\n return $this->form_content_buttons_Delete_Cancel() ;\r\n }", "public function modifyOrder_finish(){\r\n // $cookie_id = $cookies -> read();\r\n // $Form = M('userinfo');\r\n // $condition_in['stuid'] = $cookie_id;\r\n // $data = $Form->where($condition_in)->find();\r\n // if (! $data['manager']) $this->redirect('/');\r\n $key = $_REQUEST['id'];\r\n $condition['id'] = $key;\r\n $form = M(\"orderinfo\");\r\n $data = $form->where($condition)->find();\r\n if ($_REQUEST['finish']) $data['finish'] = 1;\r\n $data['id'] = $key;\r\n $form->save($data);\r\n var_dump($data);\r\n //$this->display();\r\n }", "public function isDone(){\n\t\treturn $this->done;\n\t}", "public function getDone()\n {\n return $this->done;\n }", "private function act_tdone($raw) {\n\t\treturn \"<a class=\\\"todo-done\\\" data-done=\\\"{$raw['complete']}\\\" data-recid=\\\"{$raw['id']}\\\" href=\\\"#\\\">Mark Item Finished</a>\";\n\t}", "function __tinypass_save_buttons( TPPaySettings $ps, $edit = false ) {\n\t?>\n\n\t<p>\n\t\t<input type=\"submit\" name=\"_Submit\" value=\"Save Changes\" tabindex=\"4\" class=\"button-primary\" />\n\t</p>\n\n<?php }", "private function _orderDone($memID)\n\t{\n\t\tglobal $context;\n\n\t\t$sub_id = (int) $this->_req->query->sub_id;\n\n\t\t// Must exist but let's be sure...\n\t\tif (isset($context['current'][$sub_id]))\n\t\t{\n\t\t\t// What are the pending details?\n\t\t\t$current_pending = Util::unserialize($context['current'][$sub_id]['pending_details']);\n\n\t\t\t// Nothing pending, nothing to do\n\t\t\tif (!empty($current_pending))\n\t\t\t{\n\t\t\t\t$current_pending = array_reverse($current_pending);\n\t\t\t\tforeach ($current_pending as $id => $sub)\n\t\t\t\t{\n\t\t\t\t\t// Just find one and change it to payback\n\t\t\t\t\tif ($sub[0] == $sub_id && trim($sub[3]) === 'prepay')\n\t\t\t\t\t{\n\t\t\t\t\t\t$current_pending[$id][3] = 'payback';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Save the details back.\n\t\t\t\t$pending_details = serialize($current_pending);\n\t\t\t\tupdatePendingStatus($context['current'][$sub_id]['id'], $memID, $pending_details);\n\t\t\t}\n\t\t}\n\n\t\t// A simple thank you\n\t\t$context['sub_template'] = 'paid_done';\n\t}", "function editQuoteFinalStepAction()\n\t{\n\t\tif($_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest')\n\t\t{\n\t\t\t$quote_id=$this->_request->getParam('quote_id');\n\n\t\t\tif($quote_id)\n\t\t\t{\n\t\t\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t\t\t$quoteDetails=$quoteObj->getQuoteDetails($quote_id);\n\t\t\t\tif($quoteDetails)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t//Quote documents added to sesssion\n\t\t\t\t\t$files = \"\";\n\t\t\t\t\t$documents_path = explode(\"|\",$quoteDetails[0]['documents_path']);\n\t\t\t\t\t$documents_name = explode(\"|\",$quoteDetails[0]['documents_name']);\n\t\t\t\t\t$k =0;\n\t\t\t\t\tforeach($documents_path as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(file_exists($this->quote_documents_path.$documents_path[$k]) && !is_dir($this->quote_documents_path.$documents_path[$k]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$files .= '<div class=\"topset2\"><a href=\"/quote/download-document?type=quote&quote_id='.$quote_id.'&index='.$k.'\">'.utf8_encode($documents_name[$k]).'</a><span class=\"delete\" rel=\"'.$k.'_'.$quote_id.'\"> <i class=\"splashy-error_x\"></i></span> </div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\t\t\t\t\t$quoteDetails[0]['documents'] = $files;\n\n\n\t\t\t\t\t$this->_view->send_quote=$quoteDetails[0];\n\t\t\t\t\t$this->render(\"popup-edit-finalstep-details\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\t\n\t}", "function deleteCompleted() {\n\n if ( isset( $_POST['confirm'] ) ) {\n\n // User has confirmed deletion: delete the to-dos\n if ( !checkAuthToken() ) return;\n Todo::deleteCompletedForUser( User::getLoggedInUser() );\n header( \"Location: \" . APP_URL . \"?action=listTodos\" );\n\n } else {\n\n // User has not confirmed deletion yet: display the confirm dialog\n require( TEMPLATE_PATH . \"/deleteCompleted.php\" );\n }\n}", "function getButtonText()\r\n\t{\r\n\t\tif ( isset($this->object_it) )\r\n\t\t{\r\n\t\t\treturn translate('Сохранить');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn translate('Создать');\r\n\t\t}\r\n\t}", "function metaboxTabOutputSendtoeditor ( $tabid )\n\t{\n\t\techo '<p class=\"submit\">';\n\t\techo '<input type=\"button\" id=\"avhamazon_sendtoeditor\" name=\"' . $tabid . '\" value=\"' . __( 'Send to Editor', 'avhamazon' ) . '\" />';\n\t\techo '</p>';\n\t}", "protected function generateButtons() {}", "function actionComplete($id)\n {\n $order = $this->orderManager->find($id);\n\n if ($order->produkty_id == OrderManager::PRODUCT_HELIUM) {\n $this->setView('complete-helium');\n $this->template->order = $order;\n\n return;\n }\n\n $this->orderManager->completeConfirmedOrder($id);\n $this->flashMessage('Objednávka byla vyřízena.', 'success');\n\n if (!$this->isAjax()) {\n $ref = $this->getParameter('ref');\n if ($ref) {\n $this->redirect($ref);\n } else {\n $backlink = \"/kryo/orders?ordersGrid-id={$id}&do=ordersGrid-detail\";\n $backlink = $this->appendFlashMessage($backlink);\n\n $this->redirectUrl($backlink);\n }\n }\n }", "function wizardFooter() {\n global $LANG;\n $strOutput = '\n\t\t\t</table>\n\t\t\t<div id=\"c-saveButtonPanel\">\n <input type=\"image\" class=\"c-inputButton\" name=\"'.$this->strExtKey.'[savedok]\"'.IconUtility::skinImg($this->objDoc->backPath,'gfx/savedok.gif').BackendUtility::titleAltAttrib($LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc')).'\" />\n <input type=\"image\" class=\"c-inputButton\" name=\"'.$this->strExtKey.'[saveandclosedok]\"'.IconUtility::skinImg($this->objDoc->backPath,'gfx/saveandclosedok.gif').BackendUtility::titleAltAttrib($LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc')).'\" />\n <a href=\"#\" onclick=\"'.htmlspecialchars('jumpToUrl(unescape(\\''.rawurlencode($this->arrWizardParameters['returnUrl']).'\\')); return false;').'\"><img class=\"c-inputButton\"'.IconUtility::skinImg($this->objDoc->backPath,'gfx/closedok.gif').BackendUtility::titleAltAttrib($LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc')).'\" /></a>\n <input type=\"image\" class=\"c-inputButton\" name=\"_refresh\"'.IconUtility::skinImg($this->objDoc->backPath,'gfx/refresh_n.gif').BackendUtility::titleAltAttrib($LANG->getLL('forms_refresh',1)).'\" />\n\t\t\t</div>';\n return $strOutput;\n }", "function flueba_set_sachspende_done() {\n\tif (!isset($_POST['sachspende_id']))\n\t\treturn wp_die();\n\n\tprint_r($_POST['sachspende_id']);\n\tprint_r(update_field('done', '1', $_POST['sachspende_id']));\n\twp_die();\n}", "public function ajaxMarkAllTasksAsDone($id)\n\t{\n\t\t// Get current datetime\n\t\t$now = date('Y-m-d H:i:s');\n\n\t\t// Find todo by id\n\t\t$todo = Todo::find($id);\n\n\t\tif (!$todo) // Return error if todo is not found\n\t\t\treturn array('status' => 'ERROR', 'error' => 'Todo not found.');\n\n\t\t// For each of the tasks in todo, mark it as 'done'\n\t\tforeach($todo->tasks()->whereNull('done_at')->get() as $task) {\n\t\t\t$task->done_at = $now;\n\t\t\t$task->save();\n\t\t}\n\n\t\treturn array('status' => 'OK', 'result' => $todo);\n\t}", "function ModalFooter($formID, $saveurl = '', $cbSuccess = '', $savecaption = \"Save changes\", $cbPosted = '', $validate = '')\n{\n echo str_repeat(\"\\t\", 6).\"<div class=\\\"modal-footer\\\">\\n\";\n if(!empty($formID)) {\n echo str_repeat(\"\\t\", 7).\"<button type=\\\"button\\\" class=\\\"btn btn-sm btn-default\\\" data-dismiss=\\\"modal\\\">\".(stripos($savecaption, 'cancel') !== FALSE ? 'Abort' : 'Cancel').\"</button>\\n\";\n }\n if(!empty($formID) && !empty($saveurl)) {\n $script = \"submitForm('{$formID}', '{$saveurl}', { defErrorDlg: \".(empty($cbPosted) ? \"true\" : \"false\").\", defSuccessDlg: false, parseJSON: true, modal: true\";\n if(!empty($validate)) {\n $script .= \", validate: \".$validate;\n }\n if(!empty($cbSuccess)) {\n $script .= \", cbSuccess: \".$cbSuccess;\n }\n if(!empty($cbPosted)) {\n $script .= \", cbPosted: \".$cbPosted;\n }\n $script .= \" } );\";\n echo str_repeat(\"\\t\", 7).\"<button id=\\\"dlgConfirmationBtnSave\\\" type=\\\"button\\\" class=\\\"btn btn-sm btn-primary\\\" onclick=\\\"{$script}\\\">\".htmlspecialchars($savecaption).\"</button>\\n\";\n } elseif(!empty($saveurl)) {\n echo str_repeat(\"\\t\", 7).\"<button id=\\\"dlgConfirmationBtnSave\\\" type=\\\"button\\\" class=\\\"btn btn-sm btn-primary\\\" onclick=\\\"{$saveurl}\\\">\".htmlspecialchars($savecaption).\"</button>\\n\";\n } else {\n //No form, so just present a close button\n echo str_repeat(\"\\t\", 7).\"<button type=\\\"button\\\" class=\\\"btn btn-sm btn-info\\\" data-dismiss=\\\"modal\\\">Close</button>\\n\";\n }\n echo str_repeat(\"\\t\", 6).\"</div>\\n\";\n if(!empty($formID)) {\n jsFormValidation($formID, TRUE, 6, TRUE);\n }\n}", "function composeL1EditForm_buttonsDiv() {\n\n\n return;\n}", "function medigroup_mikado_comment_form_submit_button() {\n\n $comment_form_button = medigroup_mikado_get_button_html(array(\n 'html_type' => 'input',\n 'type' => 'solid',\n 'text' => esc_html__('Submit', 'medigroup'),\n 'input_name' => 'submit'\n ));\n\n return $comment_form_button;\n\n }", "function display_todos($items) {\n foreach ($items AS $todo):?>\n <div>\n <?=Form::checkbox(\n 'done', \n $todo->done, \n 'onclick=\"document.location.href=\\''.URL::create('todo', 'checkbox', array('id'=>$todo->id)).'\\'\"');?>\n \n <?=$todo->description;?>\n \n <?=$todo->project->name;?>\n \n <a href=\"<?= URL::create('todo', 'edit', array('id'=>$todo->id));?>\">Edit</a>\n <a \n href=\"<?= URL::create('todo', 'delete', array('id'=>$todo->id));?>\" \n onclick=\"return confirm('Are you sure you want to delete this entry: <?=$todo->description;?>');\"\n >\n Distroy\n </a>\n\n </div>\n <br />\n <? endforeach;\n}", "public function editcompleteAction() {\n\t\tPageTitle::setTitle($this->view, $this->_request);\n\t\t$session = new Zend_Session_Namespace('taeditcomplete');\n\t\tif (!$session->ta_id) {\n\t\t\t$this->_redirect('/teachingactivity/add');\n\t\t\treturn;\n\t\t}\n\t\t$this->view->ta_id = $session->ta_id;\n\t\tunset($session->ta_id);\n\t}", "function print_footer(){\n\t\techo '</div></div><div class=\"clear\"></div><div id=\"hana-footer\"><input type=\"hidden\" name=\"action\" value=\"save\" />\n\t\t\t <input type=\"submit\" value=\"Save Changes\" class=\"save-button\" />\n\t\t\t </div>\t\n\t\t\t</form></div>';\n\t}", "public function taskComplete(){\n $taskId = $_POST[\"taskId\"];\n\n $this->individualGroupModel->changeTaskCompletion($taskId, true);\n\n //redirect\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }", "function rt_button_edit($target)\n{\n return rt_ui_button('edit', $target, 'pencil');\n}", "function voyage_mikado_comment_form_submit_button() {\n\n $comment_form_button = voyage_mikado_get_button_html(array(\n 'html_type' => 'input',\n 'type' => 'solid',\n 'text' => esc_html__('Submit', 'voyage'),\n 'input_name' => 'submit'\n ));\n\n return $comment_form_button;\n\n }", "function ticket_detail_foot() { ?>\r\n<script>\r\n $(function() {\r\n $('.toggle-comments').click(function() {\r\n $('.comments').toggle();\r\n return false;\r\n });\r\n $('.btn-done').on('click', function() {\r\n if (!confirm(\"Mark this ticket as closed?\"))\r\n return false;\r\n \r\n var link = $(this);\r\n var ticketId = link.data('ticketId');\r\n $.post('<?php echo site_url('tickets/ajaxdone'); ?>', {id:ticketId}, function() {\r\n link.replaceWith($('<span class=\"label label-info\">closed</label>'));\r\n });\r\n return false;\r\n });\r\n });\r\n</script>\r\n<?php }", "function module_specific_buttons($cmid, $cmoptions) {\n global $OUTPUT;\n $params = array(\n 'type' => 'submit',\n 'name' => 'add',\n 'value' => $OUTPUT->larrow() . ' ' . get_string('addtoquiz', 'quiz'),\n );\n $cmoptions->hasattempts = false;\n if ($cmoptions->hasattempts) {// Prior attempts donít matter with IPAL.\n $params['disabled'] = 'disabled';\n }\n return html_writer::empty_tag('input', $params);\n}", "public function stepEnd($data, $form)\n {\n $btnPrev = $this->compileButtons($data['settings']);\n ?>\n <div class=\"ff-t-container ff-inner_submit_container ff-column-container ff_columns_total_2\">\n <div class=\"ff-t-cell ff-t-column-1\"><?php echo $btnPrev; ?></div>\n <div class=\"ff-t-cell ff-t-column-2\"><?php do_action('fluentform_render_item_submit_button', $form->fields['submitButton'], $form); ?></div>\n </div>\n </div></div></div>\n <?php\n }", "public function markComplete($id) {\n\n // Recover the task.\n $task = Task::find($id);\n\n // Verify it's actually recovered\n if(is_null($task)) {\n Session::flash('flash_message', 'Unable to locate task');\n return redirect('/tasks');\n }\n\n // Mark complete\n $task->complete = 1;\n\n // save\n $task->save();\n\n // Let the user know, get on with it.\n Session::flash('flash_message', 'Completed: '.$task->description);\n return redirect('/tasks');\n }", "function _displayFormConfirm($err='')\r\n\t{\r\n\t\t$dt = $this->_dt;\r\n\r\n\t\t$utpage = new utPage('draws');\r\n\t\t$content =& $utpage->getPage();\r\n\t\t$form =& $content->addForm('tDelDraws', 'draws', KID_DELETE);\r\n\r\n\t\t// Initialize the field\r\n\t\t$drawId = kform::getData();\r\n\t\tif ($err =='' && count($drawId))\r\n\t\t{\r\n\t\t\t$form->addHide(\"drawId\", $drawId);\r\n\t\t\t$form->addMsg('msgConfirmDel');\r\n\t\t\t$form->addBtn('btnDelete', KAF_SUBMIT);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif($err!='') $form->addWng($err);\r\n\t\t\telse $form->addWng('msgNeedDraws');\r\n\t\t}\r\n\t\t$form->addBtn('btnCancel');\r\n\t\t$elts = array('btnDelete', 'btnCancel');\r\n\t\t$form->addBlock('blkBtn', $elts);\r\n\r\n\t\t//Display the page\r\n\t\t$utpage->display();\r\n\t\texit;\r\n\t}", "function jabHtmlSubmitButton($caption, $id, $class=\"\", $name=\"\")\n{\n\tif ($name==\"\")\n\t\t$name=$id;\n\tif ($class!=\"\")\n\t\t$class=\" class=\\\"\".$class.\"\\\"\";\n\techo \"<input type=\\\"submit\\\" id=\\\"$id\\\" name=\\\"$name\\\" value=\\\"$caption\\\"/>\\n\";\n}", "function krnEmit_button_editSubmit($caption, $value) {\n // used twice in set security\n // submit for editing - so all are consistent - (design choices:Edit button - caption - caption button that looks like link)\n //?????????? if report should not be coded as button ??????????????????????\n //$cellClass = empty($cellClass) ? '' : ' class=\"'.$class.'\"';\n return '<button type=\"submit\" class=\"kcmKrn-button-editLink\" name=\"submit\" value=\"'.$value.'\">' . $caption . '</button>';\n}", "public function finishedAction()\n {\n }", "public function confirm()\n {\n $task = $this->getTask();\n $link = $this->getExternalTaskLink($task);\n\n $this->response->html($this->template->render('task_external_link/remove', array(\n 'link' => $link,\n 'task' => $task,\n )));\n }", "function load_button($fileid, $permType, $btnCaption, $cssStyle) { // 1, \"DELETE\", load_lang(\"DELETE\"), \"fancy-button-blue\"\n global $dbf;\n global $lang;\n \n if(empty($fileid)) { exit(\"Please insert the file id @ button.\"); }\n if(empty($permType)){ exit(\"Please insert the permission type value for the button.\"); }\n if(empty($btnCaption)) { $btnCaption=\"DEFAULT_BUTTON\"; }\n if(empty($cssStyle)) { $cssStyle=\"\"; }\n \n $sqlPerm = \"SELECT * FROM base_user_permission WHERE user_id='\".$_SESSION['user_id'].\"' \n AND file_id ='\".$fileid.\"' AND permission='\".$permType.\"'\";\n $dbf->query($sqlPerm);\n $dbf->next_record();\n \n $rows = $dbf->rowdata();\n if($permType != $rows['permission']) {\n //exit(\"Invalid permission type!\");\n return;\n } else {\n \n $theButton = \"<input type=\\\"submit\\\" name=\".$permType.\" value=\\\"$btnCaption\\\" class=\\\"$cssStyle\\\" />\";\n \n return $theButton;\n }\n }", "public function getSubmitButton()\n {\n return $this->submitButton;\n }", "function tac_form_submit_button( $button, $form ) {\n\treturn \"<button id='gform_submit_button_{$form['id']}'>Submit form</button>\";\n}", "function lbcb_print_option_buttons(){\n?>\n\t<input class=\"button-primary\" type=\"submit\" name=\"lbcb_options[save]\" id=\"lbcb_options[save]\" value=\"<?php _e( 'Save Options', 'lbcb_textdomain' ); ?>\"/>\n\t<input class=\"button-secondary\" type=\"submit\" name=\"lbcb_options[reset]\" id=\"lbcb_options[reset]\" value=\"<?php _e( 'Reset To Defaults', 'lbcb_textdomain' ); ?>\"/>\n\n<?php\n}", "public function clickSaveButton()\n {\n $this->_webui->clickButton('.btn.btn-xs.btn-info.pull-right.mr20.btn-save');\n\n sleep(1);\n }", "public function toggle()\n {\n $this->isDone = !$this->isDone;\n }", "function finish_form($force_stage = false)\n\t{\n\t\tglobal $e_forms;\n\t\tif($this->previous_steps)\n\t\t{\n\t\t\t$e_forms->add_hidden_data(\"previous_steps\", base64_encode(serialize($this->previous_steps)));\n\t\t}\n\t\t$e_forms->add_hidden_data(\"stage\", ($force_stage ? $force_stage : ($this->stage + 1)));\n\t}", "public function endForm()\r\n {\r\n echo '<div class=\"panel-footer\">\r\n <input type=\"submit\" class=\"btn btn-primary btn-sm\" value=\"Vote\" />\r\n </div>\r\n </form>';\r\n }", "public function submit()\n {\n $this->find('css', '.filter-update')->click();\n }", "function give_get_donation_form_submit_button( $form_id, $args = array() ) {\n\n\t$display_label_field = give_get_meta( $form_id, '_give_checkout_label', true );\n $display_label_field = apply_filters( 'give_donation_form_submit_button_text', $display_label_field, $form_id, $args );\n\t$display_label = ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) );\n\tob_start();\n\t?>\n\t<div class=\"give-submit-button-wrap give-clearfix\">\n\t\t<input type=\"submit\" class=\"give-submit give-btn\" id=\"give-purchase-button\" name=\"give-purchase\"\n\t\t value=\"<?php echo $display_label; ?>\" data-before-validation-label=\"<?php echo $display_label; ?>\"/>\n\t\t<span class=\"give-loading-animation\"></span>\n\t</div>\n\t<?php\n\treturn apply_filters( 'give_donation_form_submit_button', ob_get_clean(), $form_id, $args );\n}", "private function getDel()\n\t{\n\t\tif(!$this->aImg['sFilename'])\n\t\t\treturn '';\n\t\t\n\t\techo '<input type=\"button\" value=\"'.$this->TXT_BUTTON_DEL.'\" ';\n\t\techo 'onclick=\"delImg('.$this->aImg['albumId'].','.$this->aImg['id'].', \\''.$this->TXT_JS_PROMPT.'\\');\" ';\n\t\techo '/>';\n\t}", "function get_submit_button($text = '', $type = 'primary large', $name = 'submit', $wrap = \\true, $other_attributes = '')\n {\n }", "public function pendingAction()\n {\n $this->_layout->nav = 'payDue';\n }", "public function done();", "public function addTask()\n\t{\n\t\t// Output the HTML\n\t\t$this->editTask();\n\t}", "function admin_add_so_export_button($which)\n{\n global $typenow;\n if ('shop_order' === $typenow && 'top' === $which) {\n?>\n <input type=\"submit\" name=\"export_all_so\" class=\"button button-primary\" value=\"<?php _e('Export All'); ?>\" />\n<?php\n }\n}" ]
[ "0.720554", "0.6969985", "0.65293556", "0.65184945", "0.6437788", "0.62210166", "0.6139907", "0.60160226", "0.58567065", "0.58041406", "0.56461644", "0.5645433", "0.5610623", "0.5568733", "0.55642205", "0.55567676", "0.55518323", "0.5546954", "0.55460995", "0.5526766", "0.5521313", "0.5515842", "0.55058295", "0.5505462", "0.54985625", "0.5486342", "0.5485533", "0.5480696", "0.54734385", "0.54679096", "0.5450392", "0.5445504", "0.5420968", "0.541727", "0.53944135", "0.5388238", "0.5386351", "0.5384289", "0.53831613", "0.5381496", "0.53775644", "0.5354825", "0.53236485", "0.5317639", "0.531269", "0.5312304", "0.5310591", "0.5303092", "0.5301452", "0.52988833", "0.52930605", "0.5290054", "0.5288799", "0.52757806", "0.52746207", "0.526923", "0.52482057", "0.52358407", "0.5227815", "0.52273434", "0.52244544", "0.52242637", "0.52234715", "0.52186435", "0.5204529", "0.5191955", "0.51860315", "0.5183463", "0.5177945", "0.5176708", "0.517425", "0.51658607", "0.5153125", "0.51431394", "0.5139651", "0.5139229", "0.51380205", "0.51281476", "0.512397", "0.51231724", "0.512155", "0.51188046", "0.51170766", "0.51078457", "0.510106", "0.50942445", "0.5091649", "0.50910807", "0.50891864", "0.50759715", "0.50744975", "0.506533", "0.5060671", "0.5059109", "0.50392395", "0.5037065", "0.5027871", "0.5026081", "0.5025389", "0.50247395" ]
0.6894103
2
This method will get the route url get('route.name > /foo/bar') Route::get('route.name.here') output: /foo/bar
public static function get($route) { $path = preg_replace('/\:(.*)/', '', self::$routes[$route]['url']); $args = func_get_args(); if (count($args) > 1): unset($args[0]); foreach ($args as $arg): $path .= $arg . "/"; endforeach; $path = rtrim($path, '/'); endif; return ($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRoute();", "function get()\n {\n $route = substr($_SERVER['REQUEST_URI'], 1);\n // $route = explode('?', $slug)[0];\n $route = rtrim($route, \"/\");\n $matches = explode('/', $route);\n\n\n $route = $this->bind($matches);\n\n if ($route) {\n // print_r($route);\n return $route['body'];\n } else {\n set_http_code(404);\n return $this->getErrorPage('404');\n }\n }", "public function getWebRoute(): string;", "public function getRoute() : string\n {\n return $this->route;\n }", "private function getRoute(){\n\t}", "function getRouteName();", "public function getRoute()\n {\n }", "public function getRoute($name){ }", "public function get_route()\n {\n }", "function getRoute()\n{\n\t// Get the requested uri from the server exluding the domain name.\n\t$uri = strtok($_SERVER['REQUEST_URI'], '?');\n\n\t// Remove the site path from the uri so we only get the segments\n\t// that we actually want.\n\t$uri = str_replace(SITE_PATH, '', $uri);\n\n\treturn $uri;\n}", "abstract public function getRoute();", "public function getRouteName();", "public function getRoute(): string\n {\n return (string) $this->route;\n }", "public function getApiRoute(): string;", "function getCurrentRoute() {\n $santitizedUrl = ''; \n if (!empty($_GET['route'])) {\n $santitizedUrl = trim($_GET['route']);\n }\n \n return $this->getMatchingRoute($santitizedUrl);\n }", "public function getFullRoute();", "public function get()\n\t{\n\t\t\n\t\t$route = $this->__path;\n\t\t\n\t\tif( $this->__mapper )\n\t\t{\n\t\t\t\n\t\t\t$map = $this->__mapper->match($this->__path);\n\t\t\n\t\t\tif( $map )\n\t\t\t{\n\t\t\t\t$route = $map;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn self::sanetize($route);\n\t\t\n\t}", "public function url()\n {\n return $this->routeObject->url['uri'];\n }", "public static function route()\n {\n return self::$route;\n }", "public function getRoute(){\n return $this->route;\n }", "public function url(): string\n {\n return strtok($this->getUri(), '?');\n }", "public function get_url():string\n {\n return strtok($_SERVER[\"REQUEST_URI\"],'?');\n }", "public function getRoute($url);", "public function getPathInfo(): string\r\n {\r\n return $_GET['url'] ?? '/';\r\n }", "public function getConsoleRoute(): string;", "public function getRoute(): Route;", "function findRouteGet(array &$variaveis): string\n {\n $url = \"\";\n $path = \"\";\n $count = count($variaveis);\n for ($i = 0; $i < $count; $i++) {\n $path .= ($i > 0 ? \"/{$url}\" : \"\");\n $url = array_shift($variaveis);\n foreach (\\Config\\Config::getRoutesTo(\"get\" . $path) as $item) {\n if (file_exists($item . $url . \".php\"))\n return $item . $url . \".php\";\n }\n }\n\n return \"\";\n }", "function route_uri(): string\n{\n return RouteController::getCurrentRoute()['uri'] ?? '';\n}", "function getRoute() {\n\t\treturn $this->config()->route;\n\t}", "public function getUrl()\n {\n return trim(implode('/', $this->path), '/').$this->getParams();\n }", "public function getRoute()\r\n {\r\n return $this->route;\r\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function get_matched_route()\n {\n }", "function get($query) {\n\t\t$query = unsetTrailingSlash($query) ;\n\t\tforeach ($this->conf as $fromRoute => &$toRoute) {\n\t\t\tpreg_match_all('|^' . str_replace('\\\\*', '[a-z\\.0-9\\-\\'\\*\\(\\)\\_]{1,}', preg_quote($fromRoute)) . '$|i', $query, $m);\n\t\t\tif ($m && !empty($m[0])) {\n\t\t\t\t\n\t\t\t\t$tokenQuerys = explode('/', $query);\n\t\t\t\t\n\t\t\t\t$tokens = explode('/', $toRoute);\n\t\t\t\t\n\t\t\t\t$_tokens = array () ;\n\t\t\t\t\n\t\t\t\twhile ( $tok = array_pop( $tokens ) )\n\t\t\t\t{\n\t\t\t\t\tif ( $tok === '*' )\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_unshift($_tokens, array_pop($tokenQuerys) ) ;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tarray_unshift($_tokens, $tok);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn implode('/', $_tokens);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $query;\n\t}", "public function getBaseRouteName(): string;", "function route_url(string $route, array $params = [], string $amp = '&amp;') {\n return Micro::get(Router::class)->url($route, $params, $amp);\n }", "public function getURI()\t{\n\t\treturn $this->route;\n\t}", "function getRouteName() {\n \treturn $this->route_name;\n }", "public function get_url();", "public function url()\n {\n return explode('?' ,$this->uri)[0];\n }", "private function getUrl()\n {\n //echo $_GET['url'];\n if(isset($_GET['url']))\n {\n $url=rtrim($_GET['url'],'/');\n $url=filter_var($url,FILTER_SANITIZE_URL);\n $url=explode('/',$url);\n return $url;\n }\n }", "public function getRoute() {\n \n return $this->route;\n \n }", "public function getUrl() {\r\n\r\n // removing GET parameters from URL.\r\n return strtolower(rtrim(explode('?', $_SERVER['REQUEST_URI'], 2)[0], '/'));\r\n \r\n }", "public function getUrl(){\r\n if(isset($_GET['url'])){\r\n $url = rtrim($_GET['url'], '/');\r\n $url = filter_var($url, FILTER_SANITIZE_URL);\r\n $url = explode('/', $url);\r\n return $url;\r\n }\r\n }", "public function route() {\n\t\t$method = $_SERVER['REQUEST_METHOD'];\n\t\t$request = (isset($_SERVER['PATH_INFO'])) ? explode(\"/\", trim($_SERVER['PATH_INFO'], \"/\")) : \"\";\n\t\t\n\t\treturn $this->routeRequest($method, $request);\n\t}", "public function getUrl()\r\n {\r\n if (isset($_GET['url'])) {\r\n\r\n // remove the ending slash\r\n $url = rtrim($_GET['url'], '/');\r\n\r\n // removing any none url characters\r\n $url = filter_var($url, FILTER_SANITIZE_URL);\r\n\r\n // get url characters as an array using explode function\r\n $url = explode('/',$url);\r\n\r\n return $url;\r\n }\r\n }", "public function getRoute()\n {\n return $this->oauth_route;\n }", "public function path(): string\n {\n return str_replace('?', '', \"/{$this->route->uri()}\");\n }", "private function getURI()\n {\n\n if (!empty($_SERVER['REQUEST_URI'])) {\n\n $routeRule = trim($_SERVER['REQUEST_URI'], '/');\n\n // Get part of uri without GET request if it exist (ignore GET)\n if (preg_match('/\\?/', $routeRule)) {\n // get rule for router which based on request uri\n $routeRule = explode('?', $routeRule);\n $routeRule = array_shift($routeRule);\n // normalize route rule\n $routeRule = trim($routeRule, '/');\n }\n return $routeRule;\n }\n }", "public function getRoute()\n\t{\n\t\treturn $this->route;\n\t}", "public function getRoute() {\n\t\treturn $this->route;\n\t}", "protected function getUrl(){\n\n\t\t//retornando a url aonde o usuario está\n\t\treturn parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n\n\t}", "public function getURL()\n\t{\n $url = $this->_internal_request->get_normalized_http_url();\n \n if ( $this->getMethod() == KHttpRequest::GET ) \n {\n $url = $this->_internal_request->to_url();\n }\n \n\t\treturn $url;\n\t}", "public function getUrl()\n {\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'], '/');\n\n $url = filter_var($url, FILTER_SANITIZE_URL);\n\n $url = explode('/', $url);\n return $url;\n \n }\n }", "public static function getRoute() {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__);\n\n\t\t$route = (isset(self::$route_options['route'])) ? self::$route_options['route'] : null;\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $route);\n\t\t$route = self::_applyFilter(get_class(), __FUNCTION__, $route, array('event' => 'return'));\n\n\t\treturn $route;\n\t}", "public function url(): string\n {\n return Uri::current()->setPath($this->name)->setSlash(true)->toString();\n }", "protected function getUrl() {\n\t\treturn $this->getQueryParam ( self::URL_PARAM );\n\t}", "public function url(): string\n {\n return rtrim($this->request->getUriForPath('/'), '/');\n }", "abstract public function routeName();", "public static function getCurrentRoute() {\t\t\n\t\t$route = self::$controller.'/'.self::$method;\n\t\tif( !empty(self::$parameters) ) {\n\t\t\t$route .= '/'.implode('/', self::$parameters);\n\t\t}\n\t\t\n\t\treturn $route;\n\t}", "public function getRouteMatch();", "public function getRoute()\r\n {\r\n return $this->Route;\r\n }", "function getCurrentUrlFromRoutes()\n {\n $input = &SGL_Registry::singleton();\n $url = $input->getCurrentUrl();\n $currUrl = $url->toString();\n $baseUrl = $url->getBaseUrl($skipProto = false, $includeFc = false);\n return str_replace($baseUrl, '', $currUrl);\n }", "static function route($url)\n {\n return App::router()->extractRoute($url);\n }", "public static function route($param = '')\n {\n return static::$URL.$param;\n }", "public function getUrlAttribute()\n {\n return route('read', $this->slug);\n }", "public function getUrl(){\n $url = $_GET;\n $url = isset($_GET['url']) ? $_GET['url'] : null;\n $url = rtrim($url, '/');\n $url = FW_Security::cleanUrl($url);\n $url = filter_var($url, FILTER_SANITIZE_URL);\n \n $url = explode('/', $url);\n \n return $url;\n }", "protected function route()\n {\n return route($this->uri, $this->params);\n }", "function menuGetFirstUrlPart() {\n $request_uri = Slim_Http_Uri::getUri();\n $url_parts = explode('/', $request_uri);\n array_shift($url_parts);\n\n return '/'. $url_parts[0];\n}", "public function get_route($request_route) {\n\n\n if (array_key_exists($request_route[\"_method\"], $this->_routes)) {\n\n if (array_key_exists($request_route[\"_rule\"], $this->_routes[$request_route[\"_method\"]])) {\n return $this->_routes[$request_route[\"_method\"]][$request_route[\"_rule\"]];\n } else { // search for match routes\n\n foreach ($this->_routes[$request_route[\"_method\"]] as $_route) {\n\n if ($_route->_match) {\n\n $request_rule = explode(\"/\", trim($request_route[\"_rule\"], \"/\"));\n $permit_rule = explode(\"/\", trim($_route->_rule, \"/\"));\n\n if (count($request_rule) == count($permit_rule)) {\n $match = true;\n foreach ($request_rule as $index => $value) {\n\n if (($request_rule[$index] != $permit_rule[$index]) and ($permit_rule[$index] != ApplicationRoute::dynamical_segment)) {\n $match = false;\n break;\n }\n }\n if ($match) {\n\n $permit_match_rule = explode(\"/\", trim($_route->_match_rule, \"/\"));\n preg_match_all('@:([\\w]+)@', $_route->_match_rule, $segments, PREG_PATTERN_ORDER);\n $segments = $segments[0];\n\n // get methodları için locals'a yükle : değişkenler\n foreach ($segments as $segment) {\n if ($index = array_search($segment, $permit_match_rule)) {\n $_route->_locals[substr($segment, 1)] = $request_rule[$index];\n }\n }\n\n return $_route;\n }\n }\n }\n }\n }\n return null;\n //throw new ConfigurationException(\"Böyle bir yönlendirme mevcut değil\", $request_route[\"_method\"] . \":\" . $request_route[\"_rule\"]);\n }\n throw new ConfigurationException(\"Uzay çağında bizim henüz desteklemediğimiz bir method\", $request_route[\"_method\"]);\n }", "public function getUrl($route = '', $params = []);", "public function getCurrentRoute(){\n\n\t\t$route = $this->getRouter()->match();\n\t\tif($route){\n\t\t\treturn $route['name'];\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getURL();", "public function getURL();", "public function getUrl() {\n return $this->get(self::URL);\n }", "public function getUrl(){\n return $this->server->getUrl() . \"/\" . $this->name;\n \n }", "public function getURL(): string\n {\n return $this->http->getURL();\n }", "public function getRouteName()\n {\n $routeName = $this->getConfiguredRouteName();\n\n return trim($routeName, '/') . '/';\n }", "public function get(string $name){\n foreach($this->routes as $route){\n\t\t\tif($route->matchName($name))\n\t\t\t\treturn $route;\n\t\t}\n\t\treturn null;\n }", "public function &route(){\n return $this->__route;\n }", "private function getURL(){\n if(!empty($_SERVER['REQUEST_URI'])){\n return trim($_SERVER['REQUEST_URI'],'/');\n }\n }", "public function get_url(): string\n {\n return $this->get_url_internal();\n }", "function route_method(): string\n{\n return RouteController::getCurrentRoute()['method'] ?? '';\n}", "protected function generateGetRouteMethod()\n {\n return <<<EOF\n public function getRoute(\\$route)\n {\n if (!isset(self::\\$declaredRoutes[\\$route])) {\n return null;\n }\n \\$info = self::\\$declaredRoutes[\\$route];\n return new Route(\n \\$info['route'],\n \\$info['options'],\n \\$info['parent'],\n \\$info['routeRequirements']\n );\n }\nEOF;\n }", "public function get_router();", "public function getUrl($route = '') {\r\n\t\treturn $this->protocol.'://'.$this->host.$this->getUri($route);\r\n\t}", "public function getRoutePathAttribute()\n {\n return route($this->routeName(), $this);\n }", "public function getURL ();", "function route_class()\n{\n return str_replace('.', '-', Route::currentRouteName());\n}", "function route_pattern(): string\n{\n return RouteController::getCurrentRoute()['pattern'] ?? '';\n}", "public function get($name)\n {\n if(!$this->has($name)) {\n return null;\n }\n return $this->routes[$name];\n }", "public function routePath()\n {\n return config('maxolex.config.routes');\n }", "public static function route($param)\n {\n return static::$URL.$param;\n }", "public static function route($param)\n {\n return static::$URL.$param;\n }" ]
[ "0.70652175", "0.6989795", "0.67014694", "0.66860193", "0.6658499", "0.66563827", "0.66522086", "0.6586165", "0.6572178", "0.6560844", "0.6516989", "0.6498719", "0.64962393", "0.6460232", "0.6445047", "0.63655293", "0.6346924", "0.6297418", "0.6283409", "0.628159", "0.6221552", "0.62185293", "0.62139326", "0.6191613", "0.6172166", "0.615919", "0.6153371", "0.6147203", "0.6126319", "0.6125267", "0.61090505", "0.6077287", "0.6077287", "0.6077287", "0.6077287", "0.6077287", "0.6077287", "0.6077287", "0.604622", "0.5980843", "0.59733", "0.59711105", "0.5968453", "0.5957036", "0.59432393", "0.59418666", "0.59406966", "0.59373015", "0.5925434", "0.5914397", "0.5914357", "0.59007347", "0.5891597", "0.5887103", "0.587653", "0.5870311", "0.5857349", "0.5848726", "0.5844947", "0.5838122", "0.58370847", "0.58222175", "0.5816907", "0.58106786", "0.579088", "0.5788428", "0.5776878", "0.57747287", "0.57688195", "0.57498115", "0.5738547", "0.5732238", "0.57108676", "0.57069695", "0.57029366", "0.57006615", "0.5697236", "0.56930035", "0.56880116", "0.56880116", "0.56866115", "0.566929", "0.56661785", "0.5661952", "0.56606686", "0.56602705", "0.56577784", "0.56507295", "0.5640766", "0.5637203", "0.563122", "0.56289136", "0.5616331", "0.5614219", "0.56074476", "0.56048304", "0.5601954", "0.558761", "0.55832374", "0.55832374" ]
0.60363084
39
Redirect to a specific route if it is valid or uses the given string as route.
public static function redirect($route) { return header("location: {$route}"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setRedirectRoute($route, array $parameters = array(), $code = Codes::HTTP_FOUND);", "protected function redirect(array $route) {\n\t\tif (!isset($route['controller']) && !isset($route['action'])) throw new URIException(\"The given route isn't in valid format\"); \n\t\t$route += ['controller'=>'', 'action'=> '', 'params' => []];\n\t\tDrunk::needRoute(new Router($route['controller'], $route['action'], $route['params']));\n\t}", "abstract protected function redirectToRoute(string $route, array $parameters = [], int $status = 302): RedirectResponse;", "public function checkRedirectStringAndRedirect() {\n if($this->check404ModuleStatus() == 1) {\n $urlPart = $this->getUrlString();\n // Check if url part is empty or not,\n if (empty($urlPart)) {\n // Redirect user on root level \t\t\n $this->customRedirect('/', 'default');\n } else {\n // Get configured category suffix (we are considering that product/category/page all have same)\n $suffix = Mage::helper('catalog/category')->getCategoryUrlSuffix();\n $string = $this->trimSlash($urlPart);\n\n $plorp = substr(strrchr($string, '/'), 1);\n $string = $this->trimSlash(substr($string, 0, - strlen($plorp))) . $suffix;\n // Check string part is equal to suffix or not\n if ($string != $suffix) {\n // Redirect user according to url part\n $this->customRedirect($string, 'default');\n } else {\n // Redirect customer to base url \n $this->customRedirect('/', 'default');\n }\n }\n\t}\n }", "private function redirect( $route = '' )\n\t{\n\t\tif( !empty($route) )\n\t\t{\n\t\t\t$this->redirectTo($route); \n\t\t}\n\n\t\t// Have we even received a redirection command?\n\t\tif( empty($this->controller->redirect) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Prevent infinite loops, check if we are already on the page we can to redirect to.\n\t\tif( $this->controller->redirect == $this->controller->route )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Bye bye! See you on the other page!\n\t\theader('Location: ' . $this->controller->makeUrl( $this->controller->redirect ) );\n\t\texit;\n\t}", "public function redirect() {\n\t\tif ( is_404() ) {\n\t\t\t$redirects = $this->get_rewrite_rules();\n\t\t\t$matched_rule = false;\n\t\t\t$request = $this->get_request();\n\t\t\tforeach ( (array) $redirects as $match => $query ) {\n\t\t\t\tif ( preg_match(\"#^$match#\", $request, $matches) ||\n\t\t\t\t\tpreg_match(\"#^$match#\", urldecode($request), $matches) ) {\n\n\t\t\t\t\t// Got a match.\n\t\t\t\t\t$matched_rule = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( $matched_rule ) {\n\t\t\t\t$query = preg_replace(\"!^.+\\?!\", '', $query);\n\t\t\t\t$redirect = addslashes(WP_MatchesMapRegex::apply($query, $matches));\n\t\t\t\tif ( $redirect ) {\n\t\t\t\t\twp_redirect( $this->clean_url( home_url( \"?$redirect\" ) ), 301 );\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function redirect_to($string){\n\n\t\theader('Location:' .$string);\n\t}", "function redirectTo($route_name, $params = null, $options = null) {\n redirect_to(assemble_url($route_name, $params, $options));\n }", "function isValidRoute($route) {\n \n return $route == 'campus' ||\n $route == 'extended' ||\n $route == 'nathanBisk' ||\n $route == 'downtown';\n}", "public static function redirectUser(string $user)\n\t{\n\t\tif ($user === 'admin') {\n\t\t\tFunctions::redirect('Views/Admin/');\n\t\t} elseif ($user === 'patient') {\n\t\t\tFunctions::redirect('Views/Patient/');\n\t\t} elseif ($user === 'doctor' || $user === 'specialist') {\n\t\t\tFunctions::redirect('Views/Doctor/');\n\t\t}\n\t}", "function resolve($route)\n{\n $path = $_SERVER['PATH_INFO'] ?? '/';\n\n $route = '/^' . str_replace('/', '\\/', $route) . '$/';\n\n if (preg_match($route, $path, $params)) {\n return $params;\n }\n return false;\n}", "protected function redirectRoute($route, $data = [])\n\t{\n\t\treturn Redirect::route($route, $data);\n\t}", "public function handle($request, Closure $next)\n {\n if(str_replace(\"_\", \"\", $request->path()) != $request->path()){\n $new_route = str_replace($request->path(), str_replace(\"_\", \"-\",$request->path()), $request->fullUrl());\n \t\treturn Redirect::to($new_route, 301);\n }\n return $next($request);\n }", "function define_route($route)\n {\n return $route !== '#' ? route($route) : '#';\n }", "public function hasPermOrRedirect(string $pem_string, string $route_name = null): void {\n\t\tif (!$this->hasPermission($pem_string)) {\n\t\t\t$this->setPermissionErrorAlert('', $pem_string);\n\t\t\tif (!empty($route_name)) {\n\t\t\t\tredirect($route_name);\n\t\t\t} else {\n\t\t\t\tredirect()->back();\n\t\t\t}\n\t\t}\n\t}", "public function redirect($route = null)\n {\n $strUrl = $this->config['baseUrl'] . 'index.php';\n if (is_string($route)) {\n $strUrl .= '?action=' . $route;\n }\n header('Location: ' . $strUrl);\n exit;\n\n }", "function redirect(string $to)\n{\n URL::go($to);\n}", "public function SetRedirect ($redirectRouteName = NULL);", "public function redirect($uri, $requestType) {\r\n if (array_key_exists($uri, $this->routes[$requestType])) {\r\n return $this->callAction(\r\n ...explode('@', $this->routes[$requestType][$uri])\r\n );\r\n }\r\n throw new Exception(\"No route defined.\");\r\n }", "public function route()\n {\n $path = Url::getPath();\n\n // If no routes exist, set 404\n if (count($this->routes) == 0)\n {\n return;\n }\n\n // Check if exact match (cheap)\n if ((isset($this->routes[$path]))\n && (!$this->routes[$path]['is_regex']))\n {\n $this->dispatch($this->routes[$path]);\n exit;\n }\n\n // Loop through all routes and attempt to find a match. (expensive)\n foreach ($this->routes as $i => $route)\n {\n $matches = null;\n\n // If route found\n if (($route['is_regex'])\n && (preg_match($route['match'], $path, $matches)))\n {\n // Remove full match from array list\n array_shift($matches);\n\n $this->dispatch($route, $matches);\n exit;\n }\n }\n }", "public function redirectTo( $route, $force = false )\n\t{\n\t\tif( !Router::exists($route) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif( !$force && $route == $this->controller->route )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\theader('Location: ' . $this->controller->makeUrl( $route ) );\n\t\texit;\n\t}", "public function mustRedirect();", "public function redirect($route, $params = [])\n {\n // Generate a redirect url for a given named route\n $url = $GLOBALS['router']->generate($route, $params);\n header(\"Location: $url\");\n }", "public function redirect_to($route){\n header('location: '.$route);\n exit();\n }", "public function redirectToSteam(Request $request, ?string $redirectTo): RedirectResponse;", "abstract protected function redirectTo();", "public function setRedirect(string $string, ?string $context = null, ?string $view = null, ?string $action = null) {\n if(strpos($string, '://') != false || strpos($string, '/') === 0) {\n $this->redirect = $string;\n return;\n }\n $this->redirect = array(\n 'app' => $string,\n 'context' => $context,\n 'view' => $view,\n 'action' => $action\n );\n return;\n }", "public function setRedirect($route, $destination)\n {\n $this->app->get($route, function() use ($destination) {\n $this->app->redirect($destination);\n });\n }", "public function set_matched_route($route)\n {\n }", "function wp_validate_redirect($location, $fallback_url = '')\n {\n }", "abstract protected function redirect();", "public function route($originalUri, &$routed = false)\n\t{\n\t\t// Prepare\n\t\t$mappedUri = $originalUri;\n\n\t\t// Do google webmaster\n\t\t$mappedUri = $this->_routeGoogleWebmaster($mappedUri);\n\n\t\t// Do internal routes\n\t\tif (!empty($this->_routes)) {\n\t\t\t$mappedUri = preg_replace(array_keys($this->_routes), $this->_routes, $mappedUri);\n\t\t\t$mappedUri = preg_replace('/(\\/){2,}/', '/', $mappedUri);\n\t\t}\n\n\t\t// Return\n\t\t$routed = $originalUri == $mappedUri;\n\t\treturn $mappedUri;\n\t}", "public function route($string, $parameters = array())\n\t{\n\t\treturn route($string, $parameters);\n\t}", "private function matchRoute($route) {\n // Route match exactly with the url?\n if ($route === $this->url) {\n return true;\n }\n\n $regex = str_replace(['/', ')', ':word', ':num'], ['\\/', ')?', '[\\w_-]+', '[\\d-]+'], $route);\n if (preg_match('~^' . $regex . '$~', $this->url)) {\n return true;\n }\n return false;\n }", "public function redirect($path);", "private static function rerouteCheck()\n {\n if ( ! Session::isValid()) {\n if (Session::hasTrainer()) {\n // we have a trainer but not a student\n self::computeImpliedRoute();\n } else {\n (new LoginTemplate())->display();\n }\n }\n }", "function route($path=''){\r\n try {\r\n parent::route($path != '' ? $path : self::getEndPoint());\r\n } catch (Exception $e) {\r\n parent::route('help');\r\n }\r\n }", "protected function redirectToRoute($route, $parameters = [])\n {\n return Redirect::route($route, $parameters);\n }", "public function parse($route): ?string;", "protected function orRedirect()\n {\n if (!empty($this->data['redirect'])) {\n redirect($this->data['redirect']);\n }\n }", "function redirectToPage($route_name, $params = [])\n{\n $location = getPath($route_name, $params = []);\n\n if (empty($location)) {\n throw Exception('Page not found');\n }\n\n header(\"Location: $location\");\n exit;\n}", "protected function redirect($route = false, $space = false) {\n $url = (LANG_MODE) ? URL_LANG :URL;\n if($route){\n if($space){\n header(\"location:\".$url.$space.\"/\".$route);\n } else {\n header(\"location:\".$url.$route);\n }\n } else{\n header('location:'.$url);\n }\n }", "protected function redirectNotFound(){\r\n \theader('Location: '.BASE_URI.Routes::getUri('not_found'));\r\n }", "public function route($uri)\n\t{\n\t\t$routes = Inject::config('http.routes', array());\n\t\t\n\t\t// literal match, has highest priority\n\t\tif(isset($routes[$uri]))\n\t\t{\n\t\t\tInject::log('request', 'HTTP request routed to \"'.$routes[$uri].'\".', Inject::DEBUG);\n\t\t\t\n\t\t\treturn $routes[$uri];\n\t\t}\n\t\t\n\t\tforeach($routes as $key => $val)\n\t\t{\n\t\t\n\t\t\t// Trim slashes\n\t\t\t$key = trim($key, '/');\n\t\t\t$val = trim($val, '/');\n\t\t\t\n\t\t\tif(preg_match('#^'.$key.'$#u', $uri, $m))\n\t\t\t{\n\t\t\t\t// get parameters from the regex, step 1: clean it from junk\n\t\t\t\tforeach($m as $k => $v)\n\t\t\t\t{\n\t\t\t\t\t// skip numeric\n\t\t\t\t\tif(is_numeric($k))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($m[$k]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// step 2: assign\n\t\t\t\t$this->set_parameters($m);\n\t\t\t\t\n\t\t\t\tif(strpos($val, '$') !== false)\n\t\t\t\t{\n\t\t\t\t\t// regex routing\n\t\t\t\t\t$uri = preg_replace('#^'.$key.'$#u', $val, $uri);\n\t\t\t\t\techo \"'$uri'\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Standard routing\n\t\t\t\t\t$uri = $val;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tInject::log('request', 'HTTP request routed by regex to \"'.$uri.'\".', Inject::DEBUG);\n\t\t\t\t\n\t\t\t\t// A valid route has been found\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn str_replace('//', '/', $uri);\n\t}", "public function route()\n\t{\n\t\t/* [http|https]/[Ajax|]/[Get|Post|Delete|Put]/uri */\n\t\t$this->route = $this->route_raw = ($this->c->Request->is_https ? 'https' : 'http').'/'.($this->c->Request->is_ajax ? 'Ajax' : '').'/'.$this->c->Request->request.'/'.$this->c->Request->uri;\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preRouter();\n\n\t\t/* rewrite dispatch route */\n\t\tforeach ($this->c->router['routes'] as $regexpath => $switchto) {\n\t\t\tif (preg_match($regexpath, $this->route)) {\n\t\t\t\t/* we got a match */\n\t\t\t\t$this->route = preg_replace($regexpath, $switchto, $this->route);\n\t\t\t\t$this->route_matched = $regexpath;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->postRouter();\n\n\t}", "function R($route) {\n if (is_string($route)) {\n return Router::recognize($route);\n } elseif (is_array($route)) {\n return Router::generate($route);\n } else {\n throw new TypeError($route);\n }\n }", "protected function redirectTo()\n {\n if (Auth::user()->isBoardMember()) {\n return route('boardmember.index', [], false);\n } elseif (Auth::user()->isComplianceOfficer()) {\n return route('compliance.index', [], false);\n } else { // if (Auth::user()->isOwner()) \n return route('owner.index', [], false);\n }\n }", "function redirectTo($to, $allowDirect=true) {\n\t\tif (param('direct') && $allowDirect) {\n\t\t\t$direct = base64_decode(param('direct'));\n\t\t\tredirectTo(($direct ? $direct : param('direct')));\n\t\t}\n\n\t\tif (is_array($to)) {\n\t\t\t$to = routeUri($to);\n\t\t}\n\t\t\n\t\tredirectTo($to);\n\t}", "public function handle_routing( $continue ) {\n\n\t\t// Get the request path / URI.\n\t\t$request_path = $_SERVER['REQUEST_URI'] ?? '';\n\t\t$request_path = trim( $request_path, '/' ); // Remove leading/trailing slashes.\n\t\t$request_path = strtok( $request_path, '?' ); // Remove query string args.\n\n\t\t// Root sitemap.\n\t\tif ( preg_match( '{^sitemap_index.xml$}', $request_path ) ) {\n\t\t\t$this->handle_route_sitemap_root();\n\t\t}\n\n\t\t// Sitemap XSL which doesn't work otherwise for some reason.\n\t\tif ( preg_match( '{^main-sitemap.xsl$}', $request_path ) ) {\n\t\t\t$this->handle_route_sitemap_xsl();\n\t\t}\n\n\t\treturn $continue;\n\n\t}", "private function uri_reroute()\n {\n $match = false;\n\n $uri = parse_url($_SERVER['REQUEST_URI']);\n if (isset($uri['path']) && $uri['path'] !== \"/\") {\n $_ = preg_split(\"|/|\", $uri['path'], -1, PREG_SPLIT_NO_EMPTY);\n\n $i = 0;\n $route = null;\n $router = null;\n // while ($match === false) {\n // $path = $_[$i];\n\n // if (isset($this->configuration['ROUTES']['/' . $path])) {\n // $match = true;\n // $route = \"/$path\";\n // $router = $this->configuration['ROUTES']['/' . $path];\n // $this->route_map = $route;\n // }\n\n // if (isset($this->configuration['ROUTES'][$path])) {\n // $match = true;\n // $route = \"$path\";\n // $router = $this->configuration['ROUTES'][$path];\n // $this->route_map = $route;\n // }\n\n // ++$i;\n // }\n\n // unset($_);\n // unset($i);\n // unset($uri);\n // unset($path);\n\n if (isset($_) && is_array($_) && count($_) > 0) {\n $path = \"\";\n foreach ($_ as $k => $v) {\n $path .= \"/\" . $v;\n\n if (isset($this->configuration['ROUTES'][$path])) {\n $match = true;\n $route = \"$path\";\n $router = $this->configuration['ROUTES'][$path];\n $this->route_map = $route;\n\n // if(is_array($router['params'])){\n\n // }elseif($router['params'] == \"*\"){\n // break;\n // }\n\n break;\n }\n }\n }\n\n if (isset($router['controller'])) {\n $this->controller = $router['controller'];\n } else {\n $this->controller = \"main\";\n }\n\n if (isset($router['method'])) {\n $this->method = $router['method'];\n } else {\n $this->method = \"index\";\n }\n\n if (isset($router['action']) && isset($this->http)) {\n if (trim(strtolower($router['action'])) != strtolower($this->http->action)) {\n $this->http->http_error(403);\n }\n }\n \n if (isset($router['type']) && isset($router['type'])){\n if (trim(strtolower($router['type'])) == \"json\" && $this->http->type != \"json\"){\n $this->http->http_error(406, \"Form \" . $this->http->action . \" data is not json\");\n }\n }\n\n if (isset($router['params'])) {\n if (is_array($router['params'])) {\n $uri = preg_split(\"|/|\", str_replace($route, \"\", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY);\n\n if (is_array($router['params'])) {\n $_ = $router['params'];\n unset($router['params']);\n\n $router['params'][] = $_;\n unset($_);\n }\n\n $nums_params = count($router['params'][0]);\n\n if ($nums_params > 0) {\n foreach ($router['params'][0] as $k => $v) {\n $this->params[$v] = trim(urldecode($uri[$k]));\n }\n }\n\n $i = 0;\n $x = 0;\n while ($nums_params < $i) {\n if (isset($uri[$x]) && is_value($uri[$x])) {\n $this->params[$router['params'][$i]] = trim(urldecode($uri[$x]));\n ++$i;\n }\n ++$x;\n }\n\n } elseif ($router['params'] != \"*\") {\n return $this->http->http_error(404);\n }\n } else {\n $uri = preg_split(\"|/|\", str_replace($route, \"\", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY);\n\n if (count($uri) > 0) {\n return $this->http->http_error(404);\n }\n }\n\n unset($uri);\n unset($i);\n unset($x);\n unset($route);\n unset($router);\n }\n\n return $match;\n }", "function maybe_redirect_404()\n {\n }", "private function redirect(){\n\t\tredirect('browse/office_industrial');//default re-route\n\t}", "protected function checkRoute()\n {\n if (Router::current() === null) {\n return $this->error(404);\n }\n }", "public function checkRoute()\n\t{\n\t\tif(!self::$load):\n\t\t\thttp_response_code(404);\n\t\t\tdie('No route found');\n\t\tendif;\n\t}", "abstract protected function getRoute($destination);", "static function redirect($uri, array &$redirects) {\n\t\tforeach ($redirects as $from => $to) {\n\t\t\tif (strpos($uri, $from) === 0) {\n\t\t\t\t$goto = str_replace($from, $to, $uri);\n\t\t\t\tthrow new HttpResponse(301, 'Redirect', $goto);\n\t\t\t}\n\t\t}\n\t}", "public function route() {\n\t\t// Set the user.\n\t\t$user = $this->Router->getCurrentRoute(3);\n\t\tif (!empty($user)) {\n\t\t\tif (!$this->userSet($user)) {\n\t\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t\t$_SESSION['data'] = array(\n\t\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t\t'link' => 'management/users'\n\t\t\t\t);\n\t\t\t\tredirect(ABSURL . 'error');\n\t\t\t}\n\t\t}\n\n\t\t// Get the function mapped to the route.\n\t\t$function = $this->Router->mappedFunction();\n\t\t$this->$function();\n\t}", "public function get_error_route($route)\n\t{\n\t\t// See if override is defined\n\t\tif (empty($this->routes[$route])) {\n\t\t\t// No override to apply\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Return validated override path\n\t\treturn $this->validate_route($this->routes[$route]);\n\t}", "public function isRouteValid($route)\r\n {\r\n if (\"/\" === substr($route, 0, 1)) {\r\n return true;\r\n } else {\r\n $this->getRfMessages()->addError(\"The route should start with a '/'\");\r\n }\r\n\r\n return false;\r\n }", "public static function route();", "public function checkMatchTypeAndRedirect($rule) {\t\t\n $currentUrl = $this->getUrlString();\n if ($currentUrl && !empty($currentUrl)) {\n $matchType = trim($rule['match_type']);\n $match = trim($rule['match']);\n $destination = trim($rule['destination']);\n $redirect = trim($rule['redirect']);\n\n // full match redirection logic\n if ($matchType == 1) {\n $output = strcasecmp(trim($match), trim($currentUrl));\n if ($output == 0) {\n $this->customRedirect($destination, $redirect);\n } else {\n return true;\n } \n }\n\n // partial match redirection logic\n if ($matchType == 2) {\n if (preg_match(\"/\\b\" . trim($match) . \"\\b/i\", $currentUrl)) {\n $this->customRedirect($destination, $redirect);\n } else {\n return true;\n }\n }\n\n // advanced match redirection logic\n if ($matchType == 3) {\n if (preg_match(trim($match), trim($currentUrl))) {\n $this->customRedirect($destination, $redirect);\n } else {\n return true;\n }\n } \n }\n }", "public static function to($location = null) {\n // check if location is been find\n if ($location) {\n // if location is number like 404 redirect to 404.php, all number errors (pages) will be here\n if (is_numeric($location)) {\n switch ($location) {\n case 404:\n header('HTTP/1.0 404 Not Found');\n include 'includes/errors/404.php';\n exit();\n break;\n }\n }\n header('Location: ' . $location);\n exit();\n }\n }", "public function redirect($route, $action=null, $param=null)\n\t{\n $url = URL_ROOT;\n $url .= '/index.php';\n $url .= '?route=' . $route;\n $url .= is_null($action) ? '' : '&action=' . $action;\n $url .= is_null($param) ? '' : '&param=' . $param;\n\n\t\theader('Location: ' . $url);\n\t\texit;\n\t}", "function redirect_to( $location=NULL ){\n\t\tif($location != NULL){\n\t\t\theader(\"Location: {$location}\");\n\t\t\texit;\n\t\t}\n\t}", "function _validateRoute($route)\n {\n // Split on comma.\n $domains = explode(',', trim($route));\n\n foreach ($domains as $domain) {\n $domain = str_replace('@', '', trim($domain));\n if (!$this->_validateDomain($domain)) return false;\n }\n\n return $route;\n }", "public function redirect($location) {\n\t\tif(!empty($location)) {\n\t\t\theader('Location: '.$location);\n\t\t\texit;\n\t\t}\n\t}", "protected function matchRoute($route) { \n \n $req = $this->getRequest();\n \n if($req['method'] != $route['method']) { return false; } \n $regex = $this->convertRoutePathToRegex($route['path']);\n \n $matches = false;\n \n preg_match_all($regex['regex'],$req['path'],$matches);\n //var_dump($matches);\n \n if(count($matches[0]) > 0) {\n foreach($regex['variables'] as $i=>$v) {\n $route['params'][$v] = $matches[($i+1)][0];\n }\n return $route;\n }\n \n return false;\n \n }", "function redirect($destination) \n {\n\t // handle URL\n \tif (preg_match(\"/^http:\\/\\//\", $destination))\n \t\theader(\"Location: \" . $destination);\n\n \t// handle absolute path\n \telse if (preg_match(\"/^\\//\", $destination)) {\n \t\t$protocol = (@$_SERVER[\"HTTPS\"]) ? \"https\" : \"http\";\n \t\t$host = $_SERVER[\"HTTP_HOST\"];\n \t\theader(\"Location: $protocol://$host$destination\");\n }\n\n\t// handle relative path\n\telse {\n\t\t// adapted from http://www.php.net/header\n\t\t$protocol = (@$_SERVER[\"HTTPS\"]) ? \"https\" : \"http\";\n\t\t$host = $_SERVER[\"HTTP_HOST\"];\n\t\t$path = rtrim(dirname($_SERVER[\"PHP_SELF\"]), \"/\\\\\");\n\t\theader(\"Location: $protocol://$host$path/$destination\");\n\t}\n\n\t// exit immediately since we're redirecting anyway\n\texit;\n}", "public function setRoute($route)\r\n {\r\n // Handle images\r\n if (!$this->isImage($route) && !$this->isFile($route)) {\r\n // Route must follow a directory of a question inside the questions directory\r\n $curQuestionDir = $this->root.'/'.$route;\r\n if (!is_dir($curQuestionDir)) {\r\n throw new Exception('Question directory '.$curQuestionDir.' does not exists.');\r\n }\r\n if (!file_exists($curQuestionDir.'/bebras.js')) {\r\n throw new Exception('Question directory '.$curQuestionDir.' is not a task.');\r\n }\r\n \r\n // A question's route must end with a \"/\"\r\n if ($route[strlen($route) - 1] != '/') {\r\n throw new Exception('A question\\'s directory must end with a \"/\".');\r\n }\r\n $route = substr($route, 0, strlen($route) - 1);\r\n }\r\n \r\n $this->route = $route;\r\n }", "protected function redirectToIntended($else = '', $parameters = [])\n {\n if ( ! empty($else) )\n {\n $redirectElse = route($else, $parameters);\n }else{\n $redirectElse = route('home');\n }\n\n return Redirect::to(Session::get('url.intended', $redirectElse));\n }", "public function redirectTo($route_name, array $params = [])\n {\n $url = $this->neptune['router']->url($route_name, $params);\n\n return $this->redirect($url);\n }", "static function Sanitize_Route($route) {\n\t\t# remove slash if it exist at the end of the route\n\t\t$route = trim($route, '/'); \n\t\t# \t$route = (strpos($route, '/') ? explode('/', $route) : $route);\n\t\t$route = explode('/', $route);\n\t\treturn $route;\n\t}", "protected function redirectTo(String $routeName)\n {\n return $this->routeParser->urlFor($routeName);\n }", "public function handled($rt = '')\n {\n $uriSegmentsInThisRoute = explode('/', $this->urlToMatch);\n $uriSegmentsInRequestedRoute = explode('/', $rt);\n\n if (count($uriSegmentsInRequestedRoute) == count($uriSegmentsInThisRoute)) {\n $thisUrlUpToFirstDollarSign = explode('/$',$this->urlToMatch)[0];\n $numberOfSegmentsUpToFirstDollarSign = count( explode('/',$thisUrlUpToFirstDollarSign) );\n $theyMatch = true;\n for( $i=0; $i<$numberOfSegmentsUpToFirstDollarSign; $i++ ) {\n if ( strcmp($uriSegmentsInThisRoute[$i],$uriSegmentsInRequestedRoute[$i]) <> 0 ) {\n $theyMatch = false;\n break;\n }\n }\n\n if ( $theyMatch ) {\n if ($this->processMiddleWare()==true) {\n // have to explode these two again, in case middleware changed anything\n $uriSegmentsInThisRoute = explode('/',$this->urlToMatch);\n $uriSegmentsInRequestedRoute = explode('/', $rt);\n $NumberOfParams = count(explode('$',$this->urlToMatch)) - 1;\n $params = array();\n for ($i = count($uriSegmentsInThisRoute) - $NumberOfParams; $i < count($uriSegmentsInThisRoute); $i++) {\n $params[] = $uriSegmentsInRequestedRoute[$i];\n }\n \\ipinga\\log::ipinga('Route {'. $this->identifier .'} ('. $this->urlToMatch. ') fired!');\n self::launchController($this->controller, $this->method, $params);\n $this->fired = true;\n return true;\n } else {\n \\ipinga\\log::ipinga('Route {'. $this->identifier .'} middcleware refused');\n }\n }\n\n }\n\n return false;\n\n }", "public function match($routeString)\n {\n $uri = $this->request->getRequestPath();\n $regexRouteParam = '@:\\w[\\w\\d]*@';\n $priority = null;\n if (preg_match($regexRouteParam, $routeString)) {\n $regexRoute = preg_replace($regexRouteParam, '([^/]+)', $routeString);\n $regexRoute = '@^'.$regexRoute.'/?$@';\n $priority = 2;\n } else {\n $regexRoute = '@^'.$routeString.'/?$@';\n $priority = 1;\n }\n $arrayMatches = [];\n $match = preg_match($regexRoute, $uri, $arrayMatches);\n if ($match) {\n $this->setRouteParams($routeString, $arrayMatches);\n\n return $priority;\n }\n\n return false;\n }", "public function redirect($path):void;", "public static function isRouteValid()\n {\n global $Routes;\n $uri = $_SERVER['REQUEST_URI'];\n if (!in_array(explode('?', $uri)[0], $Routes, true)) {\n return 0;\n } else {\n return 1;\n }\n }", "static function route () {\n\t\tif (isset($_GET['path'])) {\n\t\t\t$get_path = $_GET['path'];\n\t\t}\n\t\telse {\n\t\t\t$get_path = '/';\n\t\t}\n\n\t\t// check if GET path has a match, show 404 by default if it does not\n\t\t$parameters = [];\n\t\t$controller_method = 'AppController::four_zero_four';\n\n\t\tforeach (self::$routes as $route) {\n\t\t\tif ($route['regex_path'] != '/') {\n\t\t\t\t$route['regex_path'] = trim($route['regex_path'], '/');\n\t\t\t}\n\n\t\t\tif (preg_match('|^'.$route['regex_path'].'$|i', $get_path, $parameters)) {\n\t\t\t\t// match found for GET path\n\t\t\t\tif ($route['auth_required'] == 'not_signed_in' && AppUser::is_signed_in()) {\n\t\t\t\t\t// auth required is not_signed_in and user is signed in, redirect to dashboard\n\t\t\t\t\tRedirector::redirect('dashboard');\n\t\t\t\t}\n\t\t\t\telse if ($route['auth_required'] == 'signed_in' && !AppUser::is_signed_in()) {\n\t\t\t\t\t// auth required is signed in and user is not signed in, redirect to sign in page\n\t\t\t\t\tRedirector::redirect('sign_in');\n\t\t\t\t}\n\n\t\t\t\tif ($route['permission_required'] == null || AppUser::has_permission($route['permission_required'])) {\n\t\t\t\t\t// set controller method if user has permission\n\t\t\t\t\t$controller_method = $route['controller_method'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// user does not have permission, redirect to index\n\t\t\t\t\tRedirector::redirect('/');\n\t\t\t\t}\n\n\t\t\t\t// remove first parameter as it is the GET path and not a value we want\n\t\t\t\tif (!empty($parameters)) {\n\t\t\t\t\tunset($parameters[0]);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// route to the corresponding controller method\n\t\tcall_user_func_array($controller_method, $parameters);\n\t}", "public function assignRoute(array $route);", "public static function isRouteValid() {\r\n global $Routes;\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n if (!in_array(explode('?',$uri)[0], $Routes)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n }", "function switchToCorrectLanguage($correct_url, $lang, $valid_url){\n if(!$correct_url || $lang == 'default'){\n $user_connected_from_georgia = false;\n if(isUserFromGeorgia() === true){\n $user_connected_from_georgia = true;\n }\n\n if(!$correct_url){\n $uri = $_SERVER['REQUEST_URI'];\n $uri_arr = explode('/',$uri);\n if(intval($uri_arr[1]) > 0){\n header(\"Location: \" . $valid_url['default'] .$uri_arr[1], true, 301);\n exit;\n }\n else{\n if($user_connected_from_georgia){\n header(\"Location: \" . $valid_url['ge'], true, 301);\n }\n else{\n header(\"Location: \" . $valid_url['en'], true, 301);\n }\n exit;\n }\n }\n else{\n if($user_connected_from_georgia){\n header(\"Location: \" . $valid_url['ge'], true, 301);\n }\n else{\n header(\"Location: \" . $valid_url['en'], true, 301);\n }\n exit;\n }\n }\n}", "function redirect_with_message(\n string $to,\n ?string $message = null,\n string $type = 'success'\n ): RedirectResponse {\n $bag = \\app('orchestra.messages');\n\n if (! empty($message)) {\n $bag->add($type, $message);\n }\n\n return \\redirect($to)->with('message', $bag->getMessages());\n }", "function findRoute($route = '') {\n $route = $route ? $route : FIRE_DEFAULT_ROUTE;\n return $this->_routes->get($route);\n }", "public function set_route($route)\n {\n }", "public function setRoute($route, $cb)\n\t{\n\t\t$this->routes[$route] = $cb;\n\t\n\t\treturn TRUE;\n\t}", "public static function redirectByName($url_name)\n {\n $routes = require 'routes.php';\n foreach ($routes as $url => $params) {\n if ($url_name == $params['name']) {\n self::redirect($url);\n }\n }\n }", "function redirect($uri = '/')\n{\n header('Location: ' . $uri);\n exit;\n}", "protected function parseRoute()\n { \n $matches = explode(\"/\", $this->route);\n\n $pattern = '/^([a-zA-Z0-9_-])+$/';\n \n if (preg_match($pattern, $matches[0])) {\n $this->controller = ucfirst(strtolower($matches[0]));\n }\n\n if (!empty($matches[1]) && preg_match($pattern, $matches[1])) {\n $this->action = $this->convert($matches[1]);\n }\n }", "function redirect($destination)\n {\n $host = $_SERVER[\"HTTP_HOST\"];\n\t\t$path = rtrim(dirname($_SERVER[\"PHP_SELF\"]), \"/\\\\\");\n\t\t\n\t\t// handle URL\n if (preg_match(\"/^http:\\/\\//\", $destination))\n header(\"Location: \" . $destination);\n\n // handle absolute path\n else if (preg_match(\"/^\\//\", $destination))\n header(\"Location: http://$host$destination\");\n\n // handle relative path\n else\n // adapted from http://www.php.net/header\n header(\"Location: http://$host$path/$destination\");\n\n // exit immediately since we're redirecting anyway\n exit;\n }", "public function redirectTo() {\n $role = Auth::user()->role_id; \n switch ($role) {\n case '1':\n return '/home-admin';\n break;\n case '2':\n return '/home-lecturer';\n break; \n case '3':\n return '/my-subjects';\n break; \n \n default:\n return '/home'; \n break;\n }\n }", "function redirect(string $location, array $param = []){\n $path_location = getURL($location, $param);\n // die(getURL($location, $param));\n header(\"Location: {$path_location}\");\n // return \"Location: {$path_location}\";\n}", "public static function setRoute(string $uri = '') {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $uri);\n\n\t\t$uri = self::_applyFilter(get_class(), __FUNCTION__, $uri, array('event' => 'args'));\n\t\t\n\t\tif (empty($uri)) {\n\t\t\t$uri = $_SERVER['REQUEST_URI'];\n\t\t}\n\n\t\tif (substr($uri, strlen($uri) - 1) === '/') {\n\t\t\t$uri = substr_replace($uri, '', strlen($uri) - 1);\n\t\t}\n\n\t\t$routes = array();\n\n\t\t$pos = @strpos($uri, '?');\n\n\t\tif ($pos !== false) {\n\t\t\t$uri = substr_replace($uri, '', $pos, strlen($uri));\n\t\t}\n\n\t\t$uri_parts = explode('/', $uri);\n\n\t\tforeach ($uri_parts as $key => $value) {\n\t\t\tif (empty($uri_parts[$key])) {\n\t\t\t\tunset($uri_parts[$key]);\n\t\t\t}\n\t\t}\n\n\t\t$uri_parts = array_values($uri_parts);\n\t\t$uri = '/' . implode('/', $uri_parts);\n\t\t\n\t\t$assigned_route = array();\n\t\t$default_route = array();\n\t\t$assigned_route_options = array('listen'=> '*');\n\t\t$default_route_options = array();\n\t\t\n\t\t$method = (isset($_SERVER['REQUEST_METHOD'])) ? $method = $_SERVER['REQUEST_METHOD'] : null;\n\t\t\n\t\tforeach (self::$routes as $route) {\n\t\t\t\n\t\t\tif(self::_isAllowRequest($route['listen'], $method)) {\n\t\t\t\t\n\t\t\t\t$reRule = preg_replace(self::$default_rule_replace, self::$default_route_replace, $route['rule']);\n\t\t\t\t$reRule = str_replace('/', '\\/', $reRule);\n\t\n\t\t\t\tif (preg_match('/' . $reRule . '/', $uri, $matches)) {\n\t\n\t\t\t\t\t$uri_match = '';\n\t\t\t\t\tforeach ($matches as $key => $value) {\n\t\t\t\t\t\tif (!Validator::isInteger($key)) {\n\t\t\t\t\t\t\t$uri_match .= '/' . $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}//end foreach\n\t\n\t\t\t\t\t$match_1 = str_replace($uri_match, '', $uri);\n\t\t\t\t\t$match_2 = str_replace($uri_match, '', $matches[0]);\n\t\n\t\t\t\t\tif ($match_1 === $match_2 && !empty($match_1)) {\n\t\t\t\t\t\t$assigned_route = $matches;\n\t\t\t\t\t\t$assigned_route_options = $route;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if ($match_1 === $match_2 && empty($match_1)) {\n\t\t\t\t\t\t$default_route = $matches;\n\t\t\t\t\t\t$default_route_options = $route;\n\t\t\t\t\t}\n\t\t\t\t}//end if prgrack mage\n\t\t\t}\n\t\t}//end first for\n\n\t\tif (!empty($assigned_route)) {\n\t\t\t$final_route = $assigned_route;\n\t\t\t$route_options = $assigned_route_options;\n\t\t\tif (!isset($final_route['route'])) {\n\t\t\t\t$final_route['route'] = $default_route;\n\t\t\t}\n\t\t\tif (!isset($route_options['route'])) {\n\t\t\t\t$route_options['route'] = $default_route;\n\t\t\t}\n\t\t} else {\n\t\t\t$final_route = $default_route;\n\t\t\t$route_options = $default_route_options;\n\t\t}\n\n\t\tself::$route_parameters = $final_route;\n\t\tself::$route_options = $route_options;\n\t\t\n\t\t$method = (isset($_SERVER['REQUEST_METHOD'])) ? $method = $_SERVER['REQUEST_METHOD'] : null;\n\t\t\n\t\tif(!isset($route_options['listen']) || (isset($route_options['listen']) && $route_options['listen'] == '*')) {\n\t\t\tself::$correct_request_method = true;\n\t\t} else {\n\t\t\t$listen = strtoupper($route_options['listen']);\n\t\t\t\n\t\t\tif(strpos($listen, $method )!== false) {\n\t\t\t\tself::$correct_request_method = true;\n\t\t\t} else {\n\t\t\t\tself::$correct_request_method = false;\n\t\t\t}\n\t\t}\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $final_route, $route_options);\n\n\t\tif(self::$correct_request_method) {\n\t\t\t\n\t\t\tif (!empty($route_options['activate_ssl']) && $route_options['activate_ssl'] && !self::isSecureConnection()) {\n\t\t\t\tself::activateSSL();\n\t\t\t} else if (!empty($route_options['deactivate_ssl']) && $route_options['deactivate_ssl'] && self::isSecureConnection()) {\n\t\t\t\tself::deactivateSSL();\n\t\t\t}\n\t\n\t\t\tif (!empty($route_options['redirect'])) {\n\t\t\t\tself::redirect($route_options['redirect']);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($route_options['callback'])) {\n\t\t\t\treturn call_user_func_array($route_options['callback'], array(new Request()));\n\t\t\t}\n\t\t}\n\n\t}", "public function handle($request, Closure $next)\n {\n\t\t$segments = $request->segments();\n\t\t$query = $request->query();\n\t\t\t\t\n\t\tif ($request->segment(1) !== \"admin\") \n\t\t{\n\t\t\t$locale = \"es\";\n\t\t\t\t\n\t\t\tif(Session::has('locale')){\t\t\n\t\t\t\t$locale = Session::get('locale');\n\t\t\t\tApp::setlocale($locale);\t\n\t\t\t\t\n\t\t\t\tif (substr($request->segment(1), 0, 3) === \"art\")\n\t\t\t\t\treturn $next($request);\n\t\t\t\t\n\t\t\t\t$localized_segments = $this->localize_segments($segments);\n\t\t\t\t\n\t\t\t\tif (count($segments) && strtoupper($locale) == \"ES\" && count($query)) {\n\t\t\t\t\treturn $this->redirect_ES($request, $localized_segments, $query);\n\t\t\t\t}\n\t\t\t\telse if (count($segments) && strtoupper($locale) == \"ES\") \n\t\t\t\t{\n\t\t\t\t\treturn $this->redirect_ES($request, $localized_segments, 0);\n\t\t\t\t}\n\t\t\t\telse if (count($segments) && count($query)) {\n\t\t\t\t\treturn $this->redirect_locale($request, $localized_segments, $locale, $query);\n\t\t\t\t}\n\t\t\t\telse if (count($segments)) {\n\t\t\t\t\treturn $this->redirect_locale($request, $localized_segments, $locale, $query);\n\t\t\t\t}\t\t\t\n\t\t\t\telse if ($locale !== \"es\")\n\t\t\t\t{\n\t\t\t\t\treturn redirect('/'.$locale);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($request->lang == NULL || $request->lang == \"es\") \n\t\t\t{\n\t\t\t\t$locale = \"es\";\n\t\t\t\tApp::setlocale($locale);\t\n\t\t\t}\t\t\t\n\t\t\telse if ($request->lang == \"en\")\n\t\t\t{\n\t\t\t\t$locale = \"en\";\n\t\t\t\tApp::setlocale($locale);\t\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t return abort(404);\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t}\n\t\treturn $next($request);\n }", "public function redirect();", "public function redirect();", "public function redirect();", "public function error301($redirectURI)\n {\n }", "function redirect_to( $location = NULL )\r\n {\r\n if ($location != NULL)\r\n {\r\n header(\"Location: {$location}\");\r\n exit;\r\n }\r\n }", "function redirect_to($location = null) {\n if($location != null) {\n header (\"location:{$location}\");\n exit;\n }\n}", "function redirect_to_referer($alternative = null) {\n $referer = get_referer();\n if(is_valid_url($referer)) {\n redirect_to($referer);\n } else {\n redirect_to($alternative);\n } // if\n }" ]
[ "0.61906576", "0.61858714", "0.60204786", "0.5860737", "0.585465", "0.5781032", "0.5761831", "0.57286525", "0.5673606", "0.5541214", "0.55350393", "0.5512371", "0.55004376", "0.5492179", "0.5479961", "0.5475638", "0.547173", "0.5465714", "0.54386806", "0.5405145", "0.5396484", "0.53865767", "0.5365544", "0.53445226", "0.53365946", "0.533375", "0.5325489", "0.5319468", "0.5317939", "0.5294347", "0.5292801", "0.5262891", "0.52556044", "0.52388823", "0.5182918", "0.51784074", "0.5161014", "0.51406926", "0.51207596", "0.51058096", "0.5102663", "0.5094661", "0.5091503", "0.50872284", "0.5062833", "0.5059354", "0.5056858", "0.50450736", "0.5032349", "0.50279135", "0.5025087", "0.50051713", "0.5000481", "0.49958074", "0.498916", "0.49857193", "0.49846956", "0.49751255", "0.49622715", "0.4953599", "0.49358773", "0.49317503", "0.49278504", "0.49261737", "0.4916201", "0.49036363", "0.49028054", "0.48990944", "0.48968822", "0.48961732", "0.4893675", "0.48935127", "0.48796046", "0.48774123", "0.48728877", "0.48705685", "0.48672548", "0.4865539", "0.48643544", "0.48414665", "0.484043", "0.48314878", "0.48296976", "0.48264033", "0.4824679", "0.48231936", "0.48197338", "0.48152682", "0.4813781", "0.4809673", "0.48065075", "0.48049", "0.4803595", "0.4802338", "0.4802338", "0.4802338", "0.4800053", "0.47974685", "0.47943386", "0.47938386" ]
0.52133805
34
Refresh after the number of seconds of wait to a route given as second parameter
public static function refresh($seconds, $route) { return header("refresh:{$seconds}; url='{$route}'"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function app_auto_refresh(int $delay)\n{\n header('Refresh: ' . $delay . '; ' . $_SERVER['REQUEST_URI']);\n}", "public function getRouteRefresh() {\n\t\treturn \"/refresh_\";\n\t}", "private function reload() {\r\n\r\n \t\t$timestamp = (int) (microtime(true) * 1000);\r\n\r\n \t\t// if the value is empty\r\n \t\tif ($this->NEXT_REQUEST_TIMESTAMP > $timestamp) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\t$this->load();\r\n \t}", "public function refresh() {\n\t\t$this->redirect( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '/' );\n\t}", "abstract protected function needRefresh();", "function meta_refresh($time, $url, $disable_cd_check = false)\n{\n\tglobal $template;\n\n\t$url = redirect($url, true, $disable_cd_check);\n\t$url = str_replace('&', '&amp;', $url);\n\n\t// For XHTML compatibility we change back & to &amp;\n\t$template->assign_vars(array(\n\t\t'META' => '<meta http-equiv=\"refresh\" content=\"' . $time . ';url=' . $url . '\" />')\n\t);\n\n\treturn $url;\n}", "public function refresh() {}", "function redirect($url,$delay) {\n\t\techo '<meta http-equiv=\"refresh\" content=\"'.$delay.';url='.$url.'\">'; \n\t}", "private function updateOperation() {\n sleep(1);\n }", "function refresh($cooldown){\r\n\t\techo(\"<meta http-equiv='refresh' content='0'>\"); \r\n\r\n\t}", "function refreshPage($tiempo,$url)\n{\n print \"<META HTTP-EQUIV=\\\"Refresh\\\" CONTENT=\\\"$tiempo; URL=$url\\\">\";\n if($tiempo==0)\n exit();\n}", "function DvRedirect($url, $time)\n{\n header('refresh:'.$time.';url='.$url);\n}", "function afterroute() {\r\n\r\n }", "public function setTimeOut($method){ }", "public function refresh(): void;", "function afterroute() {\n\t}", "public function timeout() {\n $data['header'] = $this->header;\n $this->load->view('report_timeout_v', $data);\n }", "function refreshTime(){\n\n global $refreshTime;\n getChannel();\n if ((getChannel()[Name] == 'SmartPolitech') || (getChannel()[Name] == 'NoticiasEpcc')){\n $refreshTime = 960;\n }\n return $refreshTime;\n}", "public function timeout();", "abstract public function refresh();", "public function refresh();", "public function refresh();", "public function refresh()\n {\n }", "function refresh();", "public function sleep() {}", "public function sleep();", "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "function wp_change_request_timeout($time) {\n return 10; //new number of seconds\n}", "public function test_refreshMessageTimeout() {\n\n }", "public function refreshLifetimeAction()\n {\n return $this->_forward('refreshLifetime', 'report_statistics');\n }", "function redirectHome($theMsg, $url = null, $seconds = 3){\n \n if($url === null)\n {\n $url = 'dashboard.php';\n \n } \n \n else\n {\n $url = isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '' ? $_SERVER['HTTP_REFERER'] : 'dashboard.php';\n }\n \n \n echo $theMsg;\n echo \"<div class='alert alert-info'>You Will Be Redirected To $url After $seconds Seconds.</div>\";\n \n header(\"refresh:$seconds;url=$url\");\n exit();\n \n}", "public function test_admin_restart_match()\n {\n $this->assertTrue($this->btwServer->adminRestartMatch());\n\n sleep(30);\n }", "public function sleep()\n {\n }", "public function __sleep();", "function goPageTimer($url, $timer)\n{\n echo '\n <script type=\"text/javascript\">window.setTimeout(\"location=(\\'' . $url . '\\');\",' . $timer . ');</script>\n ';\n}", "function redirectTo($theMsg, $url = null, $seconds = 3) {\n\n if ($url === null) {\n $url = 'index.php';\n } else {\n if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '' ) {\n $url = $_SERVER['HTTP_REFERER'];\n } else {\n $url = 'index.php';\n }\n }\n echo '<div class=\"container\">';\n echo $theMsg;\n echo \"<div class='alert alert-info'>Redirect After $seconds Seconds</div>\";\n echo '</div>';\n header(\"refresh:$seconds;url=$url\");\n\n exit();\n}", "public function redirect($url, $delay = 0)\n {\n $this->response->headers->set('Refresh', $delay . '; ' . $url);\n if ($delay === 0) {\n $this->setTemplate(false);\n }\n }", "function __sleep(){\n\n\t\t}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function setTimeout($timeout);", "protected final function reload() {\n\t\treturn $this->redirect(Router::getPath());\n\t}", "public static function getReloadTimeout() {\r\n return 60 * 10; // 10 minutes\r\n }", "public function getRouteRefreshTable() {\n\t\treturn \"/refreshTable\";\n\t}", "public function __sleep(){\n\n\t}", "function onAfterRoute()\n\t{\n\t\tif ($this->app->isAdmin())\n\t\t{\n\t\t\t$code = JRequest::getVar('code');\n\t\t\tif (isset($code))\n\t\t\t{\n\t\t\t\t$this->fetchRefreshToken($code);\n\t\t\t}\n\t\t}\n\n\t\t// Validate and, if needed, fetch a fresh access token\n\t\t$this->validateAccessToken();\n\n\t}", "function Refresh();", "public function __sleep ();", "function wait_for_change($time_min){\n\techo \"Waiting for $time_min minutes.\";\n\twhile(true){\n\t\tsleep(60);\n\t\t$time_min--;\n\t\tif($time_min == 0)\n\t\t\tbreak;\n\t\techo \".\";\n\t}\t\t\n\techo \"\\n\";\n}", "public function forceRefresh($value = true) {\n $this->refresh = $value;\n }", "public function realtime($params = []);", "public function getRefreshRate() { return 0; }", "public function setTimeout(int $timeout): void {}", "public function timeout($timeout);", "public function wait($wait = -1) {}", "static private function setTimer() {\n if(!self::$timer) {\n self::$timer = self::$loop->addPeriodicTimer(0, \\Closure::bind(function () {\n $this->tick();\n \n $queue = \\GuzzleHttp\\Promise\\queue();\n $handles = $this->handles;\n \n if($queue->isEmpty() && \\count($handles) === 0) {\n URLHelpers::stopTimer();\n }\n }, self::$handler, self::$handler));\n }\n }", "public function reload() {\n $this->init();\n redirect('./');\n }", "function redirectPage($Msg ,$url = null,$seconds = 3){\n if($url === null){\n $url = \"index.php\";\n $link = \"Home Page\";\n }else{\n if(isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '' ){\n $url = $_SERVER['HTTP_REFERER'];\n $link = 'previes Page';\n }else{\n $url = \"index.php\";\n $link = \"Home Page\";\n }\n }\n echo $Msg ;\n echo \"<div class = 'alert alert-info'> You will be redirect to $link after $seconds Seconds </div>\";\n header(\"Refresh:$seconds ; url=$url\");\n exit();\n}", "public function __sleep()\n {\n }", "public function iWait() {\n sleep(3);\n }", "function Respiro($inteiro){\n\t\tif($inteiro >= 90){\n\t\t\tsleep(2);\n\t\t\t$this->contador = 0;\n\t\t}\n\t}", "public function redirect($path, $params = false)\n\t{\n\t\tlist($seconds, $bool) = $params;\n\n\t\tif($bool):\n\t\t\theader(\"refresh:{$seconds};url=\".self::baseUrl().\"/\".$path);\n\t\telse:\n\t\t\theader(\"Location:\".self::baseUrl().\"/\".$path);\n\t\tendif;\t\n\t}", "function refresh($loc = null) {\n header('Location: ' . ($loc != null ? $loc : 'showAllPlaylists.php'));\n die();\n}", "public function selective_refresh_init()\n {\n }", "public static function sleep();", "function qt_refresh($protocol,$host,$uri,$auth)\n{\n $parms = array();\n $parms['grant_type'] = 'refresh_token';\n $parms['refresh_token'] = $auth;\n\n $encoding = 'URL';\n \n // Get time prior to request, may cause refresh slightly before expiration\n // -----------------------------------------------------------------------\n $granted = time();\n $result = qt_post($protocol,$host,$uri,$auth,$parms,$encoding);\n $res = json_decode($result);\n $headers = qt_curl_header('','',1);\n $code = qt_curl_code('',1);\n \n // Parse the returned details and assemble response\n // ------------------------------------------------\n $result = array();\n $result['code'] = $code;\n if ( $code > 200 )\n return $result;\n\n $result['access_token'] = $res->access_token;\n $result['access_renew'] = $res->refresh_token;\n $result['access_server'] = str_replace('https://','',$res->api_server);\n $result['access_type'] = $res->token_type;\n $result['access_seconds'] = $res->expires_in;\n $result['access_expire'] = $granted + $res->expires_in;\n $result['headers'] = $headers;\n\t\n return $result;\n}", "public function iWaitForSeconds($arg1) {\n sleep($arg1);\n }", "function Refresh(){\n $this->RefreshBy([\"legajo = \".$this->legajo]);\n }", "function PiG()\n\t{\n\t\tif(isset($_GET[\"maintainTime\"]))\n\t\t{\n\t\t\t$this->maintainTime = $_GET[\"maintainTime\"];\n\t\t}\n\t\t$this->time = time();\n\t\t\n\t\t$this->Poll();\n\t}", "public function refreshtitulosAction()\r\n {\r\n $titulos = new Application_Model_CambioTurno_CambioTurno($this->view->user);\r\n $this->_helper->json->sendJson($titulos->getTitulos());\r\n \r\n }", "public function setTimeout(int $timeout): void;", "private function wait(int $minutes) {\n echo \"waiting $minutes minute(s) ...\\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}", "function refreshIntervalHeader() {\n\t\techo \"<h3>\".__('Adjust cache update interval (student)', lepress_textdomain).\"</h3>\";\n\t}", "public function timeout($timesecs);", "function redirect($url,$time=0) {\r\n\techo \"<p>Transaction en cours</p>\";\r\n\techo \"<img src=\\\"images/ajax-loader.gif\\\" alt=\\\"loader\\\">\";\r\n\r\n\t// message de confirmation\r\n\techo(\"<script>alert(\\\"Commande effectuée !\\\")</script>\");\r\n\techo \"<meta http-equiv=\\\"refresh\\\" content=\\\"$time; URL=$url\\\" />\";\r\n\r\n\texit();\r\n}", "public function refresh ($blnReload = false) {\n $this->mctHut->refresh($blnReload);\n\t}", "function Refresh(){\n return $this->RefreshBy([\"ID_AVAL = \".$this->idAval]);\n }", "function _cache_refresh ($name = \"\") {\n\t\t$this->_cache_put($name);\n\t}", "public function singlePageRefresh($url) {\n try {\n $response = $this->httpClient->post(self::CM_SINGLE_PAGE_REFRESH_URL, [\n 'args' => [$url, ['force' => TRUE]],\n ]);\n } catch (\\Exception $exception) {\n $this->logger->critical(\"Clearing Shareaholic cache of a '$url' page failed. Connection failed.\");\n return;\n }\n\n $statusCode = $response->getStatusCode();\n if ($statusCode !== 200) {\n $this->logger->critical(\"Clearing Shareaholic cache of a '$url' page failed. Status code returned: $statusCode.\");\n }\n }", "public function reload() {\n\t\t$this->invoke(\"reload\");\n\t}", "function amwscp_add_xml_refresh_interval()\n{\n $current_delay = get_option('amwscpf_feed_delay');\n return array(\n 'refresh_interval' => array('interval' => $current_delay, 'display' => 'Amazon Feed refresh interval'),\n );\n}", "public function getSessionLifetimeTask()\n\t{\n\t\t$this->send([Config::get('lifetime')]);\n\t}", "function simulate() {\n $this->auth(SUPPORT_ADM_LEVEL);\n $simulate_id = $this->uri->segment(3);\n $this->_simulate($simulate_id);\n redirect('/mypage');\n }", "public function refreshSession() {}", "public function index(){\r\n $data = $this->common->getCommonData();\r\n \r\n $data['DirectorJS'] = '$(document).ready(function(){ Director.getUrl().timeCountdown(); });';\r\n \r\n $url = $this->input->get(\"url\", TRUE);\r\n $result = $this->db->select(\"id, count\")->from(\"redirects\")->where(\"url\", $url)->limit(1)->get()->result();\r\n $result = $result[0];\r\n $result->count = $result->count + 1;\r\n \r\n $this->db->where(\"id\", $result->id)->update(\"redirects\", array(\"count\" => $result->count));\r\n\r\n $this->parser->parse(\"crumbs/header\", $data);\r\n $this->parser->parse(\"director/home\", $data);\r\n $this->parser->parse(\"crumbs/footer\", $data);\r\n }" ]
[ "0.65511787", "0.60685563", "0.5654879", "0.563779", "0.5598207", "0.5540994", "0.55125666", "0.54841274", "0.546938", "0.5396969", "0.53563714", "0.5336272", "0.5303141", "0.52596986", "0.52052045", "0.51820076", "0.5181421", "0.5157877", "0.5157444", "0.5143645", "0.51230186", "0.51230186", "0.5120387", "0.50903934", "0.5085186", "0.5074738", "0.5058364", "0.5058364", "0.5058364", "0.5058364", "0.50542885", "0.50485784", "0.5038517", "0.500428", "0.49848685", "0.49812114", "0.49784583", "0.49773628", "0.49605525", "0.4946984", "0.49430153", "0.49382874", "0.49380088", "0.49380088", "0.49380088", "0.49380088", "0.49380088", "0.49380088", "0.49380088", "0.49380088", "0.4937794", "0.4937794", "0.4937794", "0.4937579", "0.49339026", "0.49173802", "0.49092284", "0.4895439", "0.48933128", "0.48870066", "0.48713073", "0.48597673", "0.4858976", "0.4850583", "0.4826791", "0.48258808", "0.48180175", "0.4808617", "0.47856122", "0.4779187", "0.4776579", "0.47739276", "0.47671837", "0.47639757", "0.47637334", "0.47592005", "0.47580564", "0.47488582", "0.4748405", "0.47472304", "0.47376394", "0.4737142", "0.47187284", "0.4706615", "0.46938625", "0.46754783", "0.4666411", "0.4662141", "0.46618268", "0.46591112", "0.46434712", "0.4619516", "0.46163842", "0.46114445", "0.46065697", "0.4599403", "0.45984146", "0.45973483", "0.4596826", "0.45895222" ]
0.67110145
0
Returns the references for the specified locale
public function getAll($locale) { $qb = $this->createQueryBuilder('r'); $qb->addSelect('t'); $qb->innerJoin('r.translations', 't'); $qb->andWhere('t.locale=:locale'); $qb->setParameter(':locale', $locale); return $qb->getQuery()->execute(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function localizedUris($locale)\n {\n return $this->repo()->getUris($locale);\n }", "abstract public function getTranslationIn(string $locale);", "abstract public function getTranslationIn(string $locale);", "abstract public function getTranslationIn(string $locale);", "public function getByLocale( $locale );", "public function getReferences() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('references'));\n return (is_array($result)) ? reset($result) : $result;\n }", "public function localeIndex();", "public function getReferences();", "public function getReferencesList(){\n return $this->_get(1);\n }", "public function getFieldDescriptors($locale);", "public function getTranslationsByLocale()\n {\n if (!($arColl = $this->getTranslations())) {\n\n return [];\n }\n $out = [];\n foreach ($arColl as $trans) {\n $out[$trans->getLocale()] = $trans;\n }\n\n return $out;\n }", "public function getLocalizedUrls();", "function get_list_of_locales($locale)\r\n\t{\r\n\t\t/* Figure out all possible locale names and start with the most\r\n\t\t * specific ones. I.e. for sr_CS.UTF-8@latin, look through all of\r\n\t\t * sr_CS.UTF-8@latin, sr_CS@latin, sr@latin, sr_CS.UTF-8, sr_CS, sr.\r\n\t\t */\r\n\t\t$locale_names = array();\r\n\t\t$lang = NULL;\r\n\t\t$country = NULL;\r\n\t\t$charset = NULL;\r\n\t\t$modifier = NULL;\r\n\t\tif ($locale) {\r\n\t\t\tif (preg_match(\"/^(?P<lang>[a-z]{2,3})\" // language code\r\n\t\t\t\t. \"(?:_(?P<country>[A-Z]{2}))?\" // country code\r\n\t\t\t\t. \"(?:\\.(?P<charset>[-A-Za-z0-9_]+))?\" // charset\r\n\t\t\t\t. \"(?:@(?P<modifier>[-A-Za-z0-9_]+))?$/\", // @ modifier\r\n\t\t\t\t$locale, $matches)) {\r\n\t\t\t\tif (isset($matches[\"lang\"]))\r\n\t\t\t\t\t$lang = $matches[\"lang\"];\r\n\t\t\t\tif (isset($matches[\"country\"]))\r\n\t\t\t\t\t$country = $matches[\"country\"];\r\n\t\t\t\tif (isset($matches[\"charset\"]))\r\n\t\t\t\t\t$charset = $matches[\"charset\"];\r\n\t\t\t\tif (isset($matches[\"modifier\"]))\r\n\t\t\t\t\t$modifier = $matches[\"modifier\"];\r\n\t\t\t\t\r\n\t\t\t\tif ($modifier) {\r\n\t\t\t\t\tif ($country) {\r\n\t\t\t\t\t\tif ($charset)\r\n\t\t\t\t\t\t\tarray_push($locale_names, \"${lang}_$country.$charset@$modifier\");\r\n\t\t\t\t\t\tarray_push($locale_names, \"${lang}_$country@$modifier\");\r\n\t\t\t\t\t} elseif ($charset)\r\n\t\t\t\t\t\tarray_push($locale_names, \"${lang}.$charset@$modifier\");\r\n\t\t\t\t\tarray_push($locale_names, \"$lang@$modifier\");\r\n\t\t\t\t}\r\n\t\t\t\tif ($country) {\r\n\t\t\t\t\tif ($charset)\r\n\t\t\t\t\t\tarray_push($locale_names, \"${lang}_$country.$charset\");\r\n\t\t\t\t\tarray_push($locale_names, \"${lang}_$country\");\r\n\t\t\t\t} elseif ($charset)\r\n\t\t\t\t\tarray_push($locale_names, \"${lang}.$charset\");\r\n\t\t\t\tarray_push($locale_names, $lang);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If the locale name doesn't match POSIX style, just include it as-is.\r\n\t\t\tif (!in_array($locale, $locale_names))\r\n\t\t\t\tarray_push($locale_names, $locale);\r\n\t\t}\r\n\t\treturn $locale_names;\r\n\t}", "protected function getReferences()\n {\n $extensions = $this->extensionRepository->findByHasSphinxDocumentation();\n $references = array();\n foreach ($extensions as $extension) {\n $typeLabel = $this->translate('extensionType_' . $extension->getInstallType());\n $references[$typeLabel]['EXT:' . $extension->getExtensionKey()] = sprintf('[%2$s] %1$s', $extension->getTitle(), $extension->getExtensionKey());\n }\n\n $this->signalSlotDispatcher->dispatch(\n __CLASS__,\n 'afterInitializeReferences',\n array(\n 'references' => &$references,\n )\n );\n\n foreach (array_keys($references) as $key) {\n asort($references[$key]);\n }\n\n return $references;\n }", "function getBooksPath($locale);", "public function findAllWithLocale($locale) \n {\n $queryBuilder = $this->createQueryBuilder('n');\n\n $queryBuilder\n ->orderBy('n.date_display', 'DESC')\n ;\n\n $query = $queryBuilder->getQuery();\n\n $query->setHint(\n Query::HINT_CUSTOM_OUTPUT_WALKER,\n 'Gedmo\\\\Translatable\\\\Query\\\\TreeWalker\\\\TranslationWalker'\n );\n\n $query->setHint(TranslatableListener::HINT_TRANSLATABLE_LOCALE, $locale);\n\n return $query->getResult();\n }", "public function findAllByLocale($locale = 'es'){\n $qb = $this->createQueryBuilder('a');\n $qb->select('a')\n //->from('FiterDefaultBundle:Articulo', 'o')\n ->orderBy('a.fechaPublicacion', 'DESC');\n \n\n // Use Translation Walker\n $query = $qb->getQuery();\n $query->setHint(\n \\Doctrine\\ORM\\Query::HINT_CUSTOM_OUTPUT_WALKER,\n 'Gedmo\\\\Translatable\\\\Query\\\\TreeWalker\\\\TranslationWalker'\n );\n // Force the locale\n $query->setHint(\n \\Gedmo\\Translatable\\TranslatableListener::HINT_TRANSLATABLE_LOCALE,\n //$locale\n 'es'\n );\n //fallback\n $query->setHint(\n \\Gedmo\\Translatable\\TranslatableListener::HINT_FALLBACK,\n 1\n );\n\n return $query->getResult();\n //return $query->getArrayResult();\n }", "public function getCountries($locale)\n {\n if (!empty($this->countries)) {\n return $this->countries;\n }\n\n $country_list_path = __DIR__.'/../../../umpirsky/country-list/country/icu/';\n $path = $country_list_path.$locale.'/country.php';\n\n // Does that locale exist\n if (file_exists($path)) {\n $countries = include $path;\n } else {\n // Fallback to English\n $countries = include $country_list_path.'en/country.php';\n }\n\n return $countries;\n }", "public function locale();", "public function getAllReferences()\n {\n\n return static::$references;\n\n }", "static public function getLocalesList()\r\n {\r\n /**\r\n * TODO It need to remove hard-coded language params and place them to config file for different implementations because\r\n * each implamentation can have different language settings\r\n */\r\n return Zend_Registry::get('cfg_translate_locales_xml');\r\n }", "public static function getRefundables($locale=1) {\r\n \r\n try {\r\n return Doctrine_Query::create ()->from ( 'DomainsTlds dt' )\r\n \t\t\t\t\t\t\t\t->leftJoin(\"dt.DomainsTldsData dtd WITH dtd.language_id = $locale\")\r\n \t\t\t\t\t\t\t\t->leftJoin('dt.Registrars r')\r\n \t\t\t\t\t\t\t\t->leftJoin('dt.Taxes t')\r\n \t\t\t\t\t\t\t\t->where('dt.isrefundable = ?', true)\r\n\t\t\t\t\t\t\t\t\t\t\t->addWhere('dt.isp_id = ?',Shineisp_Registry::get('ISP')->isp_id)\r\n \t\t\t\t\t\t\t\t->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\r\n } catch (Exception $e) {\r\n die ( $e->getMessage () );\r\n }\r\n }", "protected function getAllByLanguage($locale)\n {\n $contents = array();\n if (!empty($locale)) {\n $this->setTask(self::TASK_ALL_CONTENT_BY_LANG);\n $this->setLocales(array($locale));\n\n $query = $this->createQueryBuilder('t')\n ->select('t, r')\n ->leftJoin('t.resource', 'r');\n\n $this->setQueryParameters($query);\n\n $contents = $query->getQuery()->getResult();\n }\n return $contents;\n }", "public function getActiveLocales($locale = null)\n {\n $registeredLocales = $this->registry->getRegisteredLocales();\n\n if (empty($registeredLocales)) {\n return [];\n }\n elseif ($locale === null) {\n $translatedLocales = $registeredLocales;\n }\n else {\n if (strpos($locale, '_') > 0) {\n $displayCountryLocales = Intl::getLocaleBundle()->getLocaleNames($locale);\n $displayLgLocales = Intl::getLocaleBundle()->getLocaleNames(substr($locale, 0, strpos($locale, '_')));\n $displayLocales = array_merge($displayLgLocales, $displayCountryLocales);\n } else {\n $displayLocales = Intl::getLocaleBundle()->getLocaleNames($locale);\n }\n\n // time to return a translated locale\n $translatedLocales = array_map(\n function($element) use($displayLocales, $locale)\n {\n if (array_key_exists($element, $displayLocales)) {\n // perfect, we have the full translated locale\n return $displayLocales[$element];\n } elseif (strpos($element, '_') > 0) {\n // ow we don't, let's see if it's a locale containing the country\n list($lg, $country) = explode('_', $element);\n\n if (strpos($locale, '_') > 0) {\n // Yep! it's a full locale. Let's merge the translated countries for the full locale + his parent, the lg\n $displayCountriesChild = Intl::getRegionBundle()->getCountryNames($locale);\n $displayCountriesParent = Intl::getRegionBundle()->getCountryNames(substr($locale, 0, strpos($locale, '_')));\n $displayCountries = array_merge($displayCountriesParent, $displayCountriesChild);\n } else {\n // it's just a lg\n $displayCountries = Intl::getRegionBundle()->getCountryNames($locale);\n }\n\n if (array_key_exists($country, $displayCountries)) {\n // ok we do have a country translation, let's manually build the full translation string\n $displayCountry = $displayCountries[$country];\n $displayLg = Intl::getLanguageBundle()->getLanguageName($lg, null, $locale);\n\n return $displayLg . ' (' . $displayCountry . ')';\n } else {\n // I give up. I just return the received locale.\n return $element;\n }\n } else {\n return $element;\n }\n }, $registeredLocales\n );\n }\n return array_combine($registeredLocales, $translatedLocales);\n }", "protected function getAllByLanguage($locale)\n {\n $contents = array();\n if (!empty($locale)) {\n $this->setTask(self::TASK_ALL_CONTENT_BY_LANG);\n $this->setLocales(array($locale));\n\n $query = $this->createQueryBuilder('t')\n ->select('t, r, tr')\n ->leftJoin('t.resource', 'r');\n\n $this->setQueryParameters($query);\n\n $contents = $query->getQuery()->getArrayResult();\n }\n return $contents;\n }", "public function references()\n {\n return view('resources.references');\n }", "public function get_locales() {\n\t\t$existing_locales = Plugin::get_existing_locales();\n\n\t\t$locales = array();\n\t\tforeach ( $existing_locales as $locale ) {\n\t\t\t$locales[] = GP_Locales::by_slug( $locale );\n\t\t}\n\t\tusort( $locales, array( $this, '_sort_english_name_callback' ) );\n\t\tunset( $existing_locales );\n\n\t\t$contributors_count = Plugin::get_contributors_count();\n\t\t$translation_status = Plugin::get_translation_status();\n\n\t\t$this->tmpl( 'index-locales', get_defined_vars() );\n\t}", "public function getAllReferences()\n {\n $references = array();\n\n if ($this->headers->has('In-Reply-To')) {\n $references[] = $this->headers->get('In-Reply-To')->getFieldValue();\n }\n\n if ($this->headers->has('References')) {\n $values = explode(' ', $this->headers->get('References')->getFieldValue());\n $references = array_merge($references, $values);\n }\n\n return array_unique($references);\n }", "public function findManyTextsByLocale($locale, $offset = null, $limit = null);", "public function getLovLocale()\n\t{\n\t\t$locales['De'] = 'De';\n\t\t$locales['En'] = 'En';\n\t\t$locales['Fr'] = 'Fr';\n\t\treturn $locales;\n\t}", "public static function getLocaleList()\n {\n return collect(config('lang-detector.languages'))->map(function ($lang) {\n return [\n 'lang' => $lang,\n 'name' => self::getLocaleName($lang),\n 'name-orig' => self::getLocaleName($lang, $lang),\n ];\n });\n }", "function reference_from_page($pages)\n{\n\tglobal $db;\n\t\n\t$references = array();\n\t\n\t$sql = 'SELECT * from rdmp_reference_page_joiner WHERE PageID IN (' . join(\",\", $pages) . ')';\n\n\t$result = $db->Execute($sql);\n\tif ($result == false) die(\"failed [\" . __FILE__ . \":\" . __LINE__ . \"]: \" . $sql);\n\t\n\twhile (!$result->EOF) \n\t{\n\t\t$references[$result->fields['PageID']] = $result->fields['reference_id'];\n\t\t$result->MoveNext();\t\t\t\t\n\t}\t\n\t\n\t$references = array_unique($references);\n\t\n\treturn $references;\n}", "public function all(): Collection\n {\n return $this->localeCollection;\n }", "function wikir_pages_references($str)\n{\n $refs = array();\n $link_regexp = '/\\[\\[(.*?)\\]\\]/';\n preg_match_all($link_regexp, $str, $matches, PREG_SET_ORDER);\n foreach($matches as $match) $refs[] = $match[1];\n return $refs;\n}", "public function localeIndex()\n {\n return $this->localeIndex;\n }", "function getLocales() {\n\t\treturn array_keys($this->localeData);\n\t}", "private function parse_references()\n {\n if($html = Functions::lookup_with_cache($this->page['taxa_refs'], $this->download_options)) {\n if(preg_match_all(\"/im_field_taxonomic_name%3A(.*?)\\\"/ims\", $html, $arr)) {\n $total = count($arr[1]); $i = 0;\n // print_r($arr[1]); exit;\n foreach($arr[1] as $taxon_id) {\n $i++; echo \"\\ntaxon [$taxon_id]: $i of $total\\n\";\n $taxon_refs = self::get_taxon_refs($taxon_id);\n self::write_taxon_refs($taxon_refs, $taxon_id);\n // print_r($refs); exit(\"\\nstopx 100\\n\");\n // if($i == 1) break; //debug only\n }\n }\n }\n }", "public function getLocales(){\n $qb = $this->createQueryBuilder();\n $qb->module('system')->query('localelist');\n return $this->execute($qb);\n }", "private function getLocales(): Collection\n {\n return Site::all()->map(function ($locale, $key) {\n return $this->getLocale($key);\n })->pipe(function ($locales) {\n return $this->addData($locales);\n })->filter(function ($locale) {\n return $this->excludeCurrent($locale);\n })->values();\n }", "protected abstract function getTranslations();", "public function get_references()\n\t{\n\t\t$arr = array();\t// returned result\n\t\t$sql = \"SELECT * FROM refs WHERE issue_id = '{$this->id}'\";\n\t\t$this->db->execute_query($sql);\n\t\twhile($line = $this->db->fetch_line()) {\n\t\t\t$arr[] = $line;\n\t\t}\n\t\treturn $arr;\n\t}", "function acf_get_locale()\n{\n}", "protected function getSupportedLocales()\n {\n return Blog::getSupportedLocalesKeys();\n }", "public function localeContents()\n {\n $ref = defined('static::REF_KEY') ? static::REF_KEY : ($this->table??'data');\n return $this->hasOne('App\\\\Models\\\\MultiLanguageContent', 'ref_id', 'id')->where('ref', $ref)->where('locale', config('app.locale'));\n }", "abstract protected function getLocalizedSymbols(NumberFormat $numberFormat): array;", "public static function languages(string $locale = 'en') : Collection\n {\n return Collection::make(include __DIR__ . \"/../../../umpirsky/language-list/data/{$locale}/language.php\")->map(function ($lang) {\n return ucfirst($lang);\n });\n }", "public function findAllActiveWithLocale($locale) \n {\n $queryBuilder = $this->createQueryBuilder('n');\n\n $queryBuilder\n ->where('n.active = :active')\n ->setParameter('active', true)\n ->orderBy('n.date_display', 'DESC')\n ;\n\n $query = $queryBuilder->getQuery();\n\n $query->setHint(\n Query::HINT_CUSTOM_OUTPUT_WALKER,\n 'Gedmo\\\\Translatable\\\\Query\\\\TreeWalker\\\\TranslationWalker'\n );\n\n $query->setHint(TranslatableListener::HINT_TRANSLATABLE_LOCALE, $locale);\n\n return $query->getResult();\n }", "function getLocales() {\n\t\t\treturn $this->locales;\n\t\t}", "private function getHooksFromLocalDoc( $doc ) {\n\t\t\t$m = array();\n\t\t\t$content = file_get_contents( $doc );\n\t\t\tpreg_match_all( \"/\\n'(.*?)':/\", $content, $m );\n\t\t\treturn array_unique( $m[1] );\n\t}", "private function phpTranslations(string $locale): array\n {\n $path = lang_path($locale);\n\n return collect(File::allFiles($path))->mapWithKeys(function (\\SplFileInfo $file) use ($locale) {\n $key = str($file->getPathname())->replace([lang_path(), $locale, '.php'], '')->substr(2)->toString();\n $keyPath = explode('/', $key);\n $keyPath = array_reverse($keyPath);\n return [\n str($key)->replace('/', '.')->toString() => trans($key, [], $locale)\n ];\n })->undot()->toArray();\n }", "public function get_locale()\n {\n $locale = $this->fetchConfig('ml_locales', null, null, false, false);\n $currlang = $this->currlang();\n $output = array();\n \n return $locale[$currlang];\n }", "public function getAll()\n {\n return $this->getContainer()->getParameter('locales');\n }", "public function getReferenceIdsList(){\n return $this->_get(2);\n }", "public function getLocale();", "public function getLocale();", "public function getCountries(string $locale): array\n {\n if ($data = include __DIR__.'/data/'.strToLower($locale).'/country.php') {\n return $data;\n }\n\n return [];\n }", "protected function getLocales()\n {\n return \\localizer\\locales()->reduce(function ($ids, $locale) {\n $ids[] = $locale->id();\n\n return $ids;\n }, []);\n }", "public function getSupportedLocalesKeys();", "public function loc($mod){\n\n\t$loc = 'fr';\n\n\t$doc = new DOMDocument();\n\t$doc->preserveWhiteSpace = false;\n\t$doc->load(APP.'/module/core/config/language-'.$loc.'.xml');\n\n\t$items\t= array();\n\t$xpath \t= new DOMXPath($doc);\n\t$data\t= $xpath->query('/language/item');\n\n\tforeach($data as $e){\n\t\t$items[$e->getAttributeNode('key')->nodeValue] = utf8_decode($e->nodeValue);\n\t#\t$items[$e->getAttributeNode('key')->nodeValue] = $e->nodeValue;\n\t}\n\n\t# - - - - - - - - - - - - - - - - - - - - - - - -\t\n\n\t$xml = APP.'/module/'.$mod.'/config/language-'.$loc.'.xml';\n\n\tif(file_exists($xml)){\n\t\t$doc = new DOMDocument();\n\t\t$doc->preserveWhiteSpace = false;\n\t\t$doc->load($xml);\n\t\n\t\t$xpath \t= new DOMXPath($doc);\n\t\t$data\t= $xpath->query('/language/item');\n\t\n\t\tif($data->length > 0){\n\t\t\tforeach($data as $e){\n\t\t\t\t$items[$e->getAttributeNode('key')->nodeValue] = utf8_decode($e->nodeValue);\n\t\t\t#\t$items[$e->getAttributeNode('key')->nodeValue] = $e->nodeValue;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $items;\n}", "public function getFormattedReference() {\n\t\t$parser = $this->parseContent();\n\t\t$items = $parser->reference;\n\t\t$this->processReference($items);\n\t\treturn $items;\n\t}", "function getLocale();", "function get_translatable_documents($icl_post_types)\n {\n }", "public function getAllDomainsByLocale();", "public function getMultilingual();", "public function index($locale)\n {\n $this->checkLang($locale);\n\n return $this->sendResult('paginate 10 Countries',\n CountryResource::collection(Country::paginate(10)));\n }", "function GetLocalizedTexts()\n\t{\n\t\t$result = $this->sendRequest(\"GetLocalizedTexts\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "function getBook($name, $locale = null);", "public function getReferences()\n {\n return $this->references;\n }", "public function getReferences()\n {\n return $this->references;\n }", "public function getReferences()\n {\n return $this->references;\n }", "public function getLocalizedStringsList() {\n return $this->_get(1);\n }", "public function getLocales()\n {\n return $this->_locales;\n }", "function wp_get_available_translations()\n {\n }", "function getAll()\r\n\t\t{\r\n\t\t\treturn $this->lang;\r\n\t\t}", "public function getLocales()\n {\n return $this->locales;\n }", "public static function getHighlighted($locale=1) {\r\n $isp = Shineisp_Registry::get('ISP');\r\n \r\n try {\r\n $dq = Doctrine_Query::create ()->from ( 'DomainsTlds dt' )\r\n \t\t\t\t\t\t\t\t->leftJoin(\"dt.DomainsTldsData dtd WITH dtd.language_id = $locale\")\r\n \t\t\t\t\t\t\t\t->leftJoin('dt.Registrars r')\r\n \t\t\t\t\t\t\t\t->leftJoin('dt.Taxes t')\r\n \t\t\t\t\t\t\t\t->where('dt.ishighlighted = ?', true);\r\n\t\t\t\r\n\t\t\tif(!empty($isp)){\r\n \t$dq->addWhere('dt.isp_id = ?', $isp->isp_id);\r\n\t\t\t}else{\r\n\t\t\t\t$dq->addWhere('dt.isp_id = ?', Isp::getActiveISPID());\r\n\t\t\t}\r\n \t\r\n\t\t\treturn $dq->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\r\n } catch (Exception $e) {\r\n die ( $e->getMessage () );\r\n }\r\n }", "public function getLocale() {}", "public function findAllByLocale($locale, $filter = array());", "protected function loadLocale(): Collection\n {\n $cacheKey = 'laravel-i18n-locale-'.$this->getConfig('driver');\n $duration = $this->getConfig('cache_duration', 86400);\n $ttl = Carbon::now()->addSeconds($duration);\n\n if (!$this->getConfig('enable_cache')) {\n return app(RepositoryManager::class)->collect();\n }\n\n return \\Cache::remember($cacheKey, $ttl, function () {\n return app(RepositoryManager::class)->collect();\n });\n }", "function &getTranslations(){\n\t\tif ( isset( $this->_cache[__FUNCTION__]) ) return $this->_cache[__FUNCTION__];\n\t\t$tables =& $this->tables();\n\t\t$translations = array();\n\t\tforeach ( array_keys($tables) as $tablename){\n\t\t\t$translations = array_merge($translations, $tables[$tablename]->getTranslations());\n\t\t}\n\t\t$this->_cache[__FUNCTION__] =& $translations;\n\t\treturn $translations;\n\t\t\n\t}", "function getCompetingInterests($locale) {\r\n\t\treturn $this->getData('competingInterests', $locale);\r\n\t}", "public function translations() {\n return $this->client->get(self::$apiName, array());\n }", "public function get_reference_provider() {\n return array(\n array(self::SOURCE_URL),\n array(self::SOURCE_URL . '?foo=bar'),\n array('http://www.bbc.co.uk/news/av/world-europe-32925637'),\n array('http://www.bbc.co.uk/news/av/world-europe-32925637/sepp_blatter_disgrace'),\n );\n }", "public function findTranslations($document)\n {\n $result = array();\n if ($document) {\n $meta = $this->dm->getClassMetadata(get_class($document));\n $identifier = $meta->identifier;\n $documentId = $meta->getReflectionProperty($identifier)->getValue($document);\n \n $translationMeta = $this->getClassMetadata();\n $qb = $this->createQueryBuilder();\n $q = $qb->field('foreignKey')->equals($documentId)\n ->field('objectClass')->equals($meta->name)\n ->sort('locale', 'asc')\n ->getQuery();\n \n $q->setHydrate(false);\n $data = $q->execute();\n if ($data instanceof Cursor) {\n $data = $data->toArray();\n } \n if ($data && is_array($data) && count($data)) {\n foreach ($data as $row) {\n $result[$row['locale']][$row['field']] = $row['content'];\n }\n }\n }\n return $result;\n }", "public function getLanguageList();", "private function load_translations( $locale ) {\n\t\tglobal $l10n;\n\n\t\t$domains = $l10n ? array_keys( $l10n ) : array();\n\n\t\tload_default_textdomain( $locale );\n\n\t\tforeach ( $domains as $domain ) {\n\t\t\tif ( 'default' === $domain ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tunload_textdomain( $domain );\n\t\t\tget_translations_for_domain( $domain );\n\t\t}\n\t}", "public function getLocaleAwares()\n {\n return array( $this->getParagraphMapper() );\n }", "function cake_country_GetList($params = array(), $locale = \"en_US\") {\n return require(LIB_CAKE . \"Country/GetList.php\");\n}", "function supportedLocaleKeys(): array\n {\n return config('localized-routes.supported-locales');\n }", "public function getMessages($locale = null) {\n\t\treturn array();\n\t}", "public function getCurrentLocaleEntity();", "public function getReferenceSetsList(){\n return $this->_get(1);\n }", "public function __invoke($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo)\n {\n return array_values(\\StaticData::getCountries($args['locale']));\n }", "public function getLoader($locale);", "public function getTranslationsForLanguage($language);", "private function getGlossaryTerms(LocaleEntity $locale, TranslatableEntity $translatable): array\n {\n $result = [];\n $connection = $this->app->make(EntityManager::class)->getConnection();\n $maxGlossaryEntries = (int) self::MAX_GLOSSARY_ENTRIES;\n $rs = $connection->executeQuery(\n <<<EOT\nSELECT\n CommunityTranslationGlossaryEntries.id,\n CommunityTranslationGlossaryEntries.term,\n CommunityTranslationGlossaryEntries.type,\n CommunityTranslationGlossaryEntries.comments AS commentsE,\n CommunityTranslationGlossaryEntriesLocalized.translation,\n CommunityTranslationGlossaryEntriesLocalized.comments AS commentsEL,\n MATCH(CommunityTranslationGlossaryEntries.term) AGAINST (:search IN NATURAL LANGUAGE MODE) AS relevance\nFROM\n CommunityTranslationGlossaryEntries\n LEFT JOIN CommunityTranslationGlossaryEntriesLocalized\n ON CommunityTranslationGlossaryEntries.id = CommunityTranslationGlossaryEntriesLocalized.entry\n AND :locale = CommunityTranslationGlossaryEntriesLocalized.locale\nHAVING\n relevance > 0\nORDER BY\n relevance DESC,\n CommunityTranslationGlossaryEntries.term ASC\nLIMIT\n 0, {$maxGlossaryEntries}\n\nEOT\n ,\n [\n 'search' => $translatable->getText(),\n 'locale' => $locale->getID(),\n ]\n );\n while (($row = $rs->fetchAssociative()) !== false) {\n $result[] = [\n 'id' => (int) $row['id'],\n 'term' => $row['term'],\n 'type' => $row['type'],\n 'termComments' => $row['commentsE'],\n 'translation' => (string) $row['translation'],\n 'translationComments' => (string) $row['commentsEL'],\n ];\n }\n\n return $result;\n }", "public function load($locale)\n {\n if ($this->files->exists($full = \"{$this->path}/{$locale}/default.csv\")) {\n return $this->loadFileData($this->files->get($full));\n }\n return [];\n }", "public function getGlobals()\n {\n $locales = $this->registry->getRegisteredLocales();\n\n try {\n $locale = $this->requestStack->getCurrentRequest()->getLocale();\n } catch (\\Exception $e) {\n $locale = current($locales);\n }\n\n return [\n '_locale' => $locale,\n '_locales' => $locales\n ];\n }", "protected function getTranslationLocales()\n {\n foreach (Config::get('translation.locales') as $locale) {\n if ($locale != Config::get('translation.locale'))\n $this->locales[] = $locale;\n }\n }", "public function getLocaleManager();" ]
[ "0.63834786", "0.6006425", "0.6006425", "0.6006425", "0.59432894", "0.5880009", "0.5759425", "0.57545125", "0.5702035", "0.564575", "0.56391144", "0.55936146", "0.5502687", "0.5481837", "0.5475956", "0.546923", "0.5465394", "0.54647356", "0.5453201", "0.5443889", "0.54230607", "0.53966635", "0.5384925", "0.5384694", "0.53642905", "0.5296113", "0.52924407", "0.5284797", "0.5272346", "0.5266088", "0.5264417", "0.52486", "0.5241961", "0.5231147", "0.5228351", "0.52259666", "0.52172005", "0.5204842", "0.51998335", "0.5189264", "0.5149318", "0.51415086", "0.5139841", "0.51365876", "0.5131835", "0.5125946", "0.51182526", "0.51122856", "0.5106699", "0.5089623", "0.5071706", "0.50653315", "0.50649744", "0.50637954", "0.50637954", "0.50533056", "0.5048584", "0.5042517", "0.503937", "0.50392246", "0.50343174", "0.5010517", "0.50089943", "0.50071865", "0.50048226", "0.50031346", "0.50021625", "0.5001055", "0.5001055", "0.5001055", "0.49944317", "0.49927956", "0.49893123", "0.49854678", "0.4983182", "0.49763843", "0.49763232", "0.49735114", "0.49672768", "0.49607438", "0.49550647", "0.49532276", "0.4951737", "0.49510187", "0.49500015", "0.4949614", "0.49419618", "0.49325827", "0.4927566", "0.4925729", "0.48998502", "0.4896479", "0.4895985", "0.48888826", "0.48882848", "0.48760286", "0.48703325", "0.48685634", "0.48608366", "0.48544887" ]
0.50768286
50
/ Initialize action controller here
public function init() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init()\n {\n /* Initialize action controller here */\n }", "public function init()\n {\n /* Initialize action controller here */\n }", "protected function initializeController() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initAction()\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}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {\n\n\t}", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "protected function initializeAction() {\n\t\t$this->akismetService->setCurrentRequest($this->request->getHttpRequest());\n\t}", "public function __construct($controller,$action) {\n\t\tparent::__construct($controller, $action);\n\t\t\n\t}", "public function init()\n {\n $controller = $this->router->getController();\n $action = $this->router->getAction();\n $params = $this->router->getParams();\n\n $objController = registerObject($controller);\n\n call_user_func_array([$objController, $action], $params);\n }", "public function __construct($controller, $action) {\n parent::__construct($controller, $action); //parent is Controller.php\n }", "protected function initAction()\r\n {\r\n $return = false;\r\n\r\n // parse request URI\r\n $parts_url = parse_url(strtolower(trim($_SERVER['REQUEST_URI'], '/')));\r\n // @TODO: fix\r\n $parts_url_array = explode('/', $parts_url['path']);\r\n list($this->controllerName, $this->itemId) = $parts_url_array;\r\n\r\n // parse method\r\n $this->requestMethod = strtolower($_SERVER['REQUEST_METHOD']);\r\n\r\n switch ($this->requestMethod) {\r\n case 'get':\r\n // default actions for GET\r\n if ($this->controllerName == 'login' || $this->controllerName == 'logout') {\r\n $this->actionName = $this->controllerName;\r\n $this->controllerName = 'users';\r\n } elseif (is_null($this->itemId)) {\r\n $this->actionName = 'index';\r\n } else {\r\n $this->actionName = 'view';\r\n }\r\n break;\r\n case 'post':\r\n // default action for POST\r\n $this->actionName = 'add';\r\n break;\r\n case 'put':\r\n // default action for PUT\r\n $this->actionName = 'edit';\r\n break;\r\n case 'delete':\r\n // default action for DELETE\r\n $this->actionName = 'delete';\r\n break;\r\n }\r\n\r\n if (!$this->controllerName) {\r\n $this->controllerName = 'main';\r\n }\r\n if (!$this->actionName) {\r\n $this->actionName = 'index';\r\n }\r\n\r\n // get, check & requre class\r\n $className = sprintf('mob%s', ucfirst($this->controllerName));\r\n $className = 'pages\\\\' . $className;\r\n \r\n if (class_exists($className)) {\r\n //create a instance of the controller\r\n $this->controller = new $className();\r\n\r\n //check if the action exists in the controller. if not, throw an exception.\r\n $actionName = sprintf('action%s', ucfirst($this->actionName));\r\n if (method_exists($this->controller, $actionName) !== false) {\r\n $this->action = $actionName;\r\n // set request params\r\n if ($this->itemId) {\r\n $this->controller->setParams(array('id' => $this->itemId));\r\n }\r\n $this->controller->setRequestParams($this->requestMethod);\r\n\r\n $return = true;\r\n } else {\r\n $this->controller->httpStatusCode = HTTP_STATUS_METHOD_NOT_ALLOWED;\r\n// throw new \\Exception('Action is invalid.');\r\n }\r\n } else {\r\n $this->controller = new clsMobController();\r\n $this->controller->httpStatusCode = HTTP_STATUS_NOT_FOUND;\r\n// throw new \\Exception('Controller class is invalid.');\r\n }\r\n\r\n return $return;\r\n }", "public function __construct()\n {\n // Prepare the action for execution, leveraging constructor injection.\n }", "public function __construct() {\n // filter controller, action and params\n $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); // $_GET['url']\n $params = explode('/', trim($url, '/'));\n\n // store first and seccond params, removing them from params list\n $controller_name = ucfirst(array_shift($params)); // uppercase classname\n $action_name = array_shift($params);\n\n require_once APP . 'config.php';\n\n // default controller and action\n if (empty($controller_name)) {\n $controller_name = AppConfig::DEFAULT_CONTROLLER;\n }\n if (empty($action_name)) {\n $action_name = AppConfig::DEFAULT_ACTION;\n }\n\n // load requested controller\n if (file_exists(APP . \"Controller/$controller_name.php\")) {\n require CORE . \"Controller.php\";\n require CORE . \"Model.php\";\n require APP . \"Controller/$controller_name.php\";\n $controller = new $controller_name();\n\n // verify if action is valid\n if (method_exists($controller, $action_name)) {\n call_user_func_array(array($controller, $action_name), $params);\n $controller->render(\"$controller_name/$action_name\"); // skipped if already rendered\n } else {\n // action not found\n $this->notFound();\n }\n } else {\n // controller not found\n $this->notFound();\n }\n }", "public static function init() {\n\t\tself::setup_actions();\n\t}", "protected function initializeAction()\n\t{\n\t\tparent::init('Form');\n\t}", "public function initController()\n {\n $this->model = new AliveSettingServiceMeta();\n\n $this->middleware([\n\n ]);\n }", "public function init() {\n\n $this->jobs = new Hb_Jobs();\n if ($this->_request->getActionName() == 'view') {\n\n $this->_request->setActionName('index');\n }\n\n $this->searchParams = $this->_request->getParams();\n $this->view->searchParams = $this->searchParams;\n\n $this->view->actionName = $this->_request->getActionName();\n }", "protected function initializeAction()\n {\n $this->extKey = GeneralUtility::camelCaseToLowerCaseUnderscored('BwrkOnepage');\n /** @var LanguageAspect $languageAspect */\n $languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language');\n $this->languageUid = $languageAspect->getId();\n }", "protected function initializeAction()\n {\n parent::initializeAction();\n $this->customer = SubjectResolver::get()\n ->forClassName(Customer::class)\n ->forPropertyName('user')\n ->resolve();\n }", "public function initialize()\n {\n parent::initialize();\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Cookie');\n $this->cors();\n\n $currentController = $this->request->getParam('controller');\n // pr($currentController); die();\n if($currentController == 'Tenants'){\n $currentController = 'TenantUsers';\n }\n if($currentController == 'CorporateClients'){\n $currentController = 'CorporateClientUsers';\n // pr($currentController);die();\n }\n // $currentController = $this->request->params['controller'];\n $loginAction = $this->Cookie->read('loginAction');\n if(!$loginAction){\n $loginAction = ['controller' => $currentController,'action' => 'login'];\n }\n // pr($loginAction);die;\n $this->loadComponent('Auth',[\n 'loginAction' => ['controller' => $currentController,'action' => 'login'],\n 'authenticate' => [\n 'Form' =>\n [\n 'userModel' => $currentController,\n 'fields' => ['username' => 'email', 'password' => 'password']\n ]\n ],\n 'authorize'=> ['Controller'],\n 'loginAction' => $loginAction,\n 'loginRedirect' => $loginAction,\n 'logoutRedirect' => $loginAction \n\n ]);\n // $this->loadComponent('Auth', [\n\n // 'unauthorizedRedirect' => false,\n // 'checkAuthIn' => 'Controller.initialize',\n\n // // If you don't have a login action in your application set\n // // 'loginAction' to false to prevent getting a MissingRouteException.\n // 'loginAction' => false\n // ]);\n /*\n * Enable the following components for recommended CakePHP security settings.\n * see https://book.cakephp.org/3.0/en/controllers/components/security.html\n */\n }", "public function init() {\n\t\t$this->load_actions();\n\t}", "public function init()\r\n {\r\n\r\n /* Initialize action controller here */\r\n\r\n //=====================================must add in all Controller class constructor ===================================//\r\n if(defined('SITEURL')) $this->site_url = SITEURL;\r\n if(defined('SITEASSET')) $this->site_asset = SITEASSET;\r\n $this->view->site_url = $this->site_url;\r\n $this->view->site_asset = $this->site_asset;\r\n Zend_Loader::loadClass('Signup');\r\n Zend_Loader::loadClass('User');\r\n Zend_Loader::loadClass('Request');\r\n //Zend_Loader::loadClass('mailerphp');\r\n\t\t//Zend_Loader::loadClass('Permission');\r\n\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n Zend_Loader::loadClass('LoginAuth');\r\n $this->view->ob_LoginAuth = $this->sessionAuth = new LoginAuth();\r\n\r\n $this->sessionAuth->login_user_check();\r\n\r\n $this->sessionAuth->cookie_check();\r\n $this->view->server_msg = $this->sessionAuth->msg_centre();\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n unset($_SESSION['tranzgo_session']['export_list']);\r\n $this->view->ControllerName = $this->_request->getControllerName();\r\n $this->view->page_id = ($_SESSION['tranzgo_session']['role_id']==1)?'5':'7';\r\n //______________________________________must add in all Controller class constructor _____________________________________//\r\n\r\n\r\n }", "public function __construct() {\n\t\t\t$this->init_globals();\n\t\t\t$this->init_actions();\n\t\t}", "public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->resolution_summary = \"\";\n\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __init()\n\t{\n\t\t// This code will run before your controller's code is called\n\t}", "function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t\t$this->_actionModel = new Action_Model();//khoi tao class\n\t\t}", "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}", "protected function initializeAction() {\t\n\t\t$this->persdataRepository = t3lib_div::makeInstance('Tx_PtConference_Domain_Repository_persdataRepository');\n\t}", "public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->media_values = array(\n\t\t\t101 => Kohana::lang('ui_main.all'),\n\t\t\t102 => Kohana::lang('actionable.actionable'),\n\t\t\t103 => Kohana::lang('actionable.urgent'),\n\t\t\t104 => Kohana::lang('actionable.action_taken')\n\t\t);\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __construct() {\n\n list($null,$controller, $action, $id) = explode(\"/\", $_SERVER['PATH_INFO']);\n \n $this->urlValues['base'] = \"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n $this->urlValues['controller'] = $controller ? $controller : \"home\";\n $this->urlValues['action'] = $action;\n $this->urlValues['id'] = $id;\n\n $this->controllerName = strtolower($this->urlValues['controller']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['controller'])) . \"Controller\";\n\n if ($this->urlValues['action'] == \"\") {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['action'];\n }\n }", "protected function _initControllers()\n\t{\n\t\treturn;\n\t}", "public function init()\n {\n $this->vars['CRUD']['Object'] = $this;\n $this->kernel = kernel();\n\n // Dynamic initialization\n if (! $this->modelName) {\n $modelRefl = new ReflectionClass($this->modelClass);\n $this->modelName = $modelRefl->getShortName();\n }\n\n\n if (! $this->crudId) {\n $this->crudId = \\Phifty\\Inflector::getInstance()->underscore($this->modelName);;\n }\n if (! $this->templateId) {\n $this->templateId = $this->crudId;\n }\n\n // Derive options from request\n if ($request = $this->getRequest()) {\n if ($useFormControls = $request->param('_form_controls')) {\n $this->actionViewOptions['submit_btn'] = true;\n $this->actionViewOptions['_form_controls'] = true;\n }\n }\n\n $this->reflect = new ReflectionClass($this);\n $this->namespace = $ns = $this->reflect->getNamespaceName();\n\n // XXX: currently we use FooBundle\\FooBundle as the main bundle class.\n $bundleClass = \"$ns\\\\$ns\";\n if (class_exists($bundleClass)) {\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n } else {\n $bundleClass = \"$ns\\\\Application\";\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n }\n\n $this->vars['Handler'] = $this;\n $this->vars['Controller'] = $this;\n\n // anyway, we have the model classname, and the namespace, \n // we should be able to registerRecordAction automatically, so we don't have to write the code.\n if ($this->registerRecordAction) {\n $self = $this;\n $this->kernel->event->register('phifty.before_action',function() use($self) {\n $self->kernel->action->registerAction('RecordActionTemplate', array(\n 'namespace' => $self->namespace,\n 'model' => $self->modelName,\n 'types' => (array) $self->registerRecordAction\n ));\n });\n }\n\n\n $this->initPermissions();\n\n /*\n * TODO: Move this to before render CRUD page, keep init method simple\n\n if ( $this->isI18NEnabled() ) {\n $this->primaryFields[] = 'lang';\n }\n */\n $this->initNavBar();\n }", "public function _initialize()\n {\n $this->cate=CONTROLLER_NAME;\n }", "protected function initializeActionEntries() {}", "protected function initializeAction() {\n\t\t$this->feusers = $this->feusersRepository->findByUid( $GLOBALS['TSFE']->fe_user->user['uid'] ) ;\n\t\t$this->schule = $this->feusers->getSchule();\n\t\n\t\t$this->extKey = $this->request->getControllerExtensionKey();\n\t\t$this->extPath = t3lib_extMgm::extPath($this->extKey);\n\t\n\t\t$this->importClassFile = $this->extPath.'Classes/tmp/class.importtext.php';\n\t\t$this->importClass = 'ImportText';\n\t \n\t\tif ( $this->settings[pidAjaxContainerKlassenuebersicht] > 0) $this->pidAjaxContainerKlassenuebersicht = (int) $this->settings[pidAjaxContainerKlassenuebersicht];\n\t\n\t}", "public function init(){\r\n\t$this->_helper->_acl->allow('public',NULL);\r\n\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\r\n\t$this->_contexts = array('xml','json');\r\n\t$this->_helper->contextSwitch()\r\n\t\t->setAutoDisableLayout(true)\r\n\t\t->addActionContext('oneto50k',$this->_contexts)\r\n\t\t->addActionContext('index',$this->_contexts)\r\n\t\t->initContext();\r\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function initBaseController();", "public function init() {\n $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t\t$this->_helper->acl->allow('public',null);\n\t\t$this->_helper->contextSwitch()\n\t\t\t ->setAutoDisableLayout(true)\n\t\t\t ->addActionContext('index', array('xml','json'))\n ->initContext();\n\t}", "public function __construct()\n {\n // Call the CI_Controller constructor\n parent::__construct();\n }", "public function __construct()\n\t{\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function initAction() : object\n {\n /**\n * Show all movies.\n */\n $response = $this->app->response;\n return $response->redirect(\"cms/posts\");\n }", "protected function initializeAction() {\n\t\t$this->frontendUserRepository = t3lib_div::makeInstance('Tx_GrbFeusermanager_Domain_Repository_FrontendUserRepository');\n\t}", "public function contentControllerInit()\n\t{\n\t}", "protected function initializeAction()\n {\n parent::initializeAction();\n\n $query = GeneralUtility::_GET('q');\n if ($query !== null) {\n $this->request->setArgument('q', $query);\n }\n }", "public function __construct()\n {\n $this->setAction('index', array('idle', 'toggleEnabled', 'expunge'));\n }", "public static function init() {\n\t\t$_GET = App::filterGET();\n\t\t\n\t\t// Checken of er params zijn meegegeven\n\t\ttry {\n\t\t\tif (count($_GET) == 0) {\n\t\t\t\t$_GET[0] = '';\n\t\t\t}\n\t\t\t\n\t\t\t// Is de eerste param een controller ? Anders een pageView\n\t\t\tif (self::isController($_GET[0])) {\n\t\t\t\t$controllerName = self::formatAsController($_GET[0]);\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Er is sprake van een pageview\n\t\t\t\t$controllerName = 'PagesController';\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\t\n\t\t\t$action = self::getAction($controller);\n\t\t\t$controller->setAction($action);\n\n\t\t\t// Try to exec the action\n\t\t\ttry {\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(ActionDoesNotExistException $ex) {\n\n\t\t\t\techo $action;\n\t\t\t\t// Action bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidAction');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(MissingArgumentsException $ex) {\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('missingArguments');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\t\n\t\t\t// Try to render the view\n\t\t\ttry {\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\tcatch(ViewDoesNotExistException $ex) {\n\t\t\t\t// View bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidView');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t\t\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch(NoValidTemplateException $ex) {\n\t\t\techo 'Invalid template';\n\t\t}\n\t\tcatch(IsNotControllerException $ex) {\n\t\t\techo 'Controller not found';\n\t\t}\n\t}", "public function init()\r\n { \r\n //date_default_timezone_set('America/Phoenix');\r\n $ajaxContext = $this->_helper->getHelper('AjaxContext');\r\n\t$ajaxContext->addActionContext('list', 'html')\r\n ->addActionContext('edit', 'html')\r\n ->addActionContext('dashboard', 'html')\r\n ->addActionContext('handler', 'html')\r\n ->initContext();\r\n $auth = Zend_Auth::getInstance();\r\n $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\r\n $type = $this->getRequest()->getParam('type');\r\n if (!$auth->hasIdentity() && $action!='handler') {\r\n //echo \"THIS IS AN ERROR: \".$action;\r\n $this->_redirect('login', array('UseBaseUrl' => true));\r\n }\r\n }", "public function __construct()\n {\n $this->model = new MainModel();\n $this->params[\"pagination\"][\"totalItemsPerPage\"] = 5;\n view()->share ('controllerName', $this->controllerName);//đặt controllerName cho all action\n }", "public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function init() {\n $this->_temporizador = new Trf1_Admin_Timer ();\n $this->_temporizador->Inicio();\n\n /* Initialize action controller here */\n $this->view->titleBrowser = 'e-Sisad';\n }", "public function __construct()\n\t{\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "function __construct()\n {\n parent::Controller();\n }", "public function controller()\n\t{\n\t\n\t}", "public function init() {\n\t\t\t\t\t\t$this->view->controller = $this->_request->getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->action = $this->_request->getParam ( 'action' );\n\t\t\t\t\t\t$this->getLibBaseUrl = new Zend_View_Helper_BaseUrl ();\n\t\t\t\t\t\t$this->GetModelOrganize = new Application_Model_ModOrganizeDb ();\n\t\t\t\t\t\t$this->_helper->ajaxContext->addActionContext('deleteOrganisme1','json')->initContext();\n\t\t\t\t\t\t// call function for dynamic sidebar\n\t\t\t\t\t\t$this->_Categories = new Application_Model_ModCatTerm ();\n\t\t\t\t\t\t$parent_id = $this->_getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->secondSideBar = $this->_Categories->showCateParent ( $parent_id );\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public function initializeAction() {\t\t\n\t\t$this->contactRepository = t3lib_div::makeInstance('Tx_Addresses_Domain_Repository_ContactRepository');\t\n\t}", "public function init() {\n\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t$this->_helper->acl->allow('public',null);\n\t$this->_helper->contextSwitch()\n\t\t->setAutoDisableLayout(true)\n\t\t->addActionContext('index', array('xml','json'))\n\t\t->addActionContext('mint', array('xml','json'))\n\t\t->initContext();\n }", "public function __construct()\n {\n if (get_called_class() != 'ApplicationController') {\n $this->_set_default_layout();\n $this->_vars = new stdClass();\n $this->_init();\n }\n }", "public function initializeAction() {\n parent::initializeAction();\n $this->umDiv = new Tx_Magenerator_Domain_UserManagement_Div();\n }", "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 }", "public function actionInit()\n {\n $this->initRoles($this->roles);\n $this->initPermissions($this->permissions);\n $this->initDependencies($this->dependencies);\n }", "public function getControllerAction() {}", "public function __construct($action = '') {\n\t\t$this->app = Application::app();\n\t\t$this->setAction($action);\n\t}", "function initialize(Controller $controller) {\n $this->controller=&$controller;\n \t}", "public function __construct($controller, $action) {\n parent::__construct($controller, $action);\n $this->loadModel('Baskets');\n $this->loadModel('Orders');\n $this->loadModel('Messages');\n $this->loadModel('Products');\n\n if(Session::exists(BUYER_SESSION_NAME)) {\n $this->view->totalProductInBasket = $this->BasketsModel->countProductInBasket();\n $this->view->totalOrders = $this->OrdersModel->countSentOrder();\n $this->view->msgCount = $this->MessagesModel->unReadMessages();\n } elseif(Session::exists(STORE_SESSION_NAME)) {\n $this->view->msgCount = $this->MessagesModel->unReadMessages();\n $this->view->newOrders = $this->OrdersModel->newOrders(Session::get(STORE_SESSION_NAME));\n }\n\n $this->view->setLayout('details');\n }", "function initialize(Controller $controller) {\n $this->controller = $controller;\n }", "public function __construct() {\n if (isset($_GET['rc'])) {\n $this->url = rtrim($_GET['rc'], '/'); // We don't want no empty arg\n $this->args = explode('/', $this->url);\n }\n \n // Load index controller by default, or first arg if specified\n $controller = ($this->url === null) ? 'null' : array_shift($this->args);\n $this->controllerName = ucfirst($controller);\n\n // Create controller and call method\n $this->route();\n // Make the controller display something\n $this->controllerClass->render();\n }", "public function __construct() {\r\n\t\t\r\n\t\tSession::init();\n\t\tif (!Session::get('local'))\n\t\t\tSession::set('local', DEFAULT_LANGUAGE);\r\n\t\t\r\n\t\t$this->getUrl();\r\n\t\t\r\n\t\t//No controller is specified.\r\n\t\tif (empty($this->url[0])) {\r\n\t\t\t$this->loadDefaultController();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->loadCurrentController();\r\n\t\t$this->callControllerMethod();\r\n\r\n\t}", "public function __construct() {\n $this->urlValues = $_GET;\n if (!isset($this->urlValues['c'])) {\n $this->controllerName = \"home\";\n $this->controllerClass = \"HomeController\";\n } else {\n $this->controllerName = strtolower($this->urlValues['c']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['c'])) . \"Controller\";\n }\n \n if (!isset($this->urlValues['a'])) {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['a']; \n }\n }", "public function preAction() {\n $this->apiBrowser = new ApiBrowser();\n\n $basePath = $this->request->getBasePath();\n $this->namespaceAction = $basePath . '/namespace/';\n $this->classAction = $basePath . '/class/';\n $this->searchAction = $basePath . '/search';\n }", "function __construct($controller, $action)\n {\n global $inflect;\n\n $this->renderPage = true;\n $this->renderHeader = true;\n \t\n\t\t$this->requireUser = false;\n\t\t \n $this->_controller = ucfirst($controller);\n $this->_action = $action;\n \n $model = ucfirst($inflect->singularize($controller));\n $this->$model = new $model;\n\n $this->_template = new Template($controller, $action);\n }", "public function init()\n {\n $this->ctrlModel = new Admin_Model_Acl_ControllersActions();\n $this->dbCtrl = new Admin_Model_DbTable_Acl_ModuleController();\n }", "public function setup_actions() {}", "public function init(){\r\n\t\t$this->_data = $this->_request->getParams();\r\n $controller = $this->_data['controller']; //Get controller\r\n $action = $this->_data['action']; //Get action\r\n \r\n $loadfunction = new Default_Model_Common();\r\n foreach($loadfunction->loadFunction($controller) as $value){\r\n if($action == $value['action']){\r\n $load = new $value['model_load']();\r\n $this->view->$value['varname'] = $load->$value['function_load']();\r\n }\r\n }\r\n\r\n $this->view->lang = Zend_Registry::get(\"lang\"); //load language\r\n \r\n //List menu\r\n $listmenu = Zend_Registry::get(\"listmenu\");\r\n $this->view->listmenu = $listmenu;\r\n \r\n $this->view->selectaccount = ' class=\"selected\"';\r\n }", "function __construct() {\n\t\t\n\t\tparent::__construct();\n\t\t\n\t\t// skip the timestamp check for this app\n\t\tSession::check(true);\n\t\t$this->data[\"showActions\"] = true;\n\t\t$this->data[\"csrfToken\"] = CSRF::generateToken();\n\t\t\n\t}", "abstract public function getControllerAction();", "public function _construct($controller,$view){\r\n $this->controller = $controller;\r\n }", "public function initialize()\n { $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"notification\");\n }", "protected function __construct() {\n\t\t\tadd_action( 'init', array( $this, 'action__init' ), 11 );\n\t\t}", "public function init()\n {\n $this->ctrlActionModel = new Admin_Model_Acl_ControllersActions();\n $this->dbController = new Admin_Model_DbTable_Acl_ModuleController();\n $this->dbAction = new Admin_Model_DbTable_Acl_Action();\n }", "public function init()\n {\n $this->projectController->init();\n }", "function __construct() {\n\t\t\t$this->register_actions();\t\t\n\t\t\t$this->register_filters();\n\t\t}", "public function __construct() {\n // Call Module constructur\n parent::__construct();\n\n // Add additional route\n $this->_actions['GET']['/people/:id'] = 'people';\n }", "public function initialize()\n {\n $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"refund\");\n }", "function Controller()\n\t{\t\t\n\t\t$this->method = \"showView\";\n\t\tif (array_key_exists(\"method\", $_REQUEST))\n\t\t\t$this->method = $_REQUEST[\"method\"];\n\t\t\t\t\n\t\t$this->icfTemplating = new IcfTemplating();\n\t\t$this->tpl =& $this->icfTemplating->getTpl();\n\t\t$this->text =& $this->icfTemplating->getText();\t\t\n\t\t$this->controllerMessageArray = array();\n\t\t$this->pageTitle = \"\";\n\t\t$this->dateFormat = DateFormatFactory::getDateFormat();\n\t\t$this->controllerData =& $this->newControllerData();\n\t}", "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}", "function __construct($module,$controller,$action) {\n\t\t$this->action = $action;\n\t\t$this->controller = preg_replace('%Controller$%','',$controller);\n\t\t$this->module = $module;\n\n\t\t$jadeCacheDir = J::path(\"App/Cache/Jade/$this->module/$this->controller\");\n\t\t(is_dir($jadeCacheDir)) || mkdir($jadeCacheDir,0777,true);\n\t\t$this->cacheFile = J::path(\"$jadeCacheDir/$this->action.php\");\n\t\t$this->viewFile = J::path(\"App/Modules/$this->module/Views/$this->controller/$this->action.jade\");\n\t}", "public function __construct()\n {\n $url = $this->getUrl();\n // Look in controllers folder for first value and ucwords(); will capitalise first letter \n if (isset($url[0]) && file_exists('../app/controllers/' . ucwords($url[0]) . '.php')) {\n $this->currentController = ucwords($url[0]); // Setting the current controllers name to the name capitilised first letter\n unset($url[0]); \n }\n\n // Require the controller\n require_once '../app/controllers/' . $this->currentController . '.php';\n // Taking the current controller and instantiating the controller class \n $this->currentController = new $this->currentController;\n // This is checking for the second part of the URL\n if (isset($url[1])) {\n if (method_exists($this->currentController, $url[1])) { // Checking the seond part of the url which is the corresponding method from the controller class\n $this->currentMethod = $url[1];\n unset($url[1]);\n }\n }\n\n // Get params, if no params, keep it empty\n $this->params = $url ? array_values($url) : []; \n\n // Call a callback with array of params\n call_user_func_array([$this->currentController, $this->currentMethod], $this->params);\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->view = new ViewController();\t\t\n\t}", "public function __construct()\n {\n $this->controller = new Controller;\n $this->error_message = 'bad request or duplicate data';\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 }" ]
[ "0.89566046", "0.89566046", "0.82057846", "0.80040884", "0.80040884", "0.8004028", "0.7928566", "0.7802862", "0.7750365", "0.7750365", "0.7750365", "0.7750365", "0.7750365", "0.7741994", "0.76497424", "0.7542271", "0.7541656", "0.7458589", "0.7430627", "0.7382884", "0.73493266", "0.73307425", "0.7321889", "0.73055863", "0.7295852", "0.7274981", "0.72531754", "0.7246773", "0.7212456", "0.72057885", "0.71661454", "0.71535975", "0.7130195", "0.7116122", "0.70873964", "0.7080964", "0.7078719", "0.70654655", "0.7053619", "0.7048942", "0.7036025", "0.7028192", "0.6996098", "0.69914645", "0.6983108", "0.69822043", "0.6978827", "0.69710267", "0.69653803", "0.6934731", "0.69341296", "0.6926329", "0.692468", "0.69113386", "0.6909758", "0.6896174", "0.68904704", "0.6874338", "0.68700373", "0.68700373", "0.6862786", "0.6847179", "0.6844484", "0.68443036", "0.68056643", "0.6804595", "0.68018633", "0.67917275", "0.6769771", "0.676602", "0.6765842", "0.67582476", "0.67257833", "0.6721477", "0.6721169", "0.67196625", "0.67082113", "0.6707143", "0.6706214", "0.67023355", "0.6700337", "0.669937", "0.6695276", "0.66930395", "0.6692887", "0.6688026", "0.66866106", "0.66839683", "0.6674853", "0.6667438", "0.6658782", "0.66509074", "0.6642763", "0.66400504", "0.6634305", "0.6610988", "0.6610453", "0.66071516", "0.66062886", "0.6600459", "0.6599095" ]
0.0
-1
/ Default setup page
public function index() { $this->load->model('user_model'); if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } $this->load->view('layout/header'); $this->load->view('setup/index'); $this->load->view('layout/footer'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {\n // show setup page\n }", "protected function setupPage() {}", "public function admin_setup()\n\t{\n\t\t\n\t}", "function gettingStarted()\n {\n $data['$option'] = \"doc/gettingstarted\";\n $this->loadContent('doc/home', $data);\n }", "function displayMasterSetup($a_omit_init = false)\n\t{\n\t\t$this->tpl->addBlockFile(\"CONTENT\",\"content\",\"tpl.std_layout.html\", \"setup\");\n\t\t$this->tpl->setVariable(\"TXT_HEADER\", $this->lng->txt(\"basic_settings\"));\n\t\t$this->tpl->setVariable(\"TXT_INFO\",\n\t\t\t$this->lng->txt(\"info_text_first_install\").\"<br/>\".$this->lng->txt(\"info_text_pathes\"));\n\n\t\t$this->setButtonPrev(\"preliminaries\");\n\n\t\tif ($this->setup->isInstalled())\n\t\t{\n\t\t\t$this->setButtonNext(\"list\");\n\t\t}\n\n\t\tif (!$a_omit_init)\n\t\t{\n\t\t\t$this->initBasicSettingsForm(true);\n\t\t}\n\t\t$this->tpl->setVariable(\"SETUP_CONTENT\", \"<br>\".$this->form->getHTML().\"<br>\");\n\t}", "public function setupAction()\r\n {\r\n $all = $this->users->setup();\r\n\r\n $this->theme->setTitle(\"Questions has been setup\");\r\n $this->views->add('question/list-all', [\r\n 'users' => $all,\r\n 'title' => \"Questions has been setup\",\r\n ]);\r\n }", "public function DoDefault()\n\t\t{\n\t\t\t/*$template = Template::LoadTemplate(\"YageCMS.Core.Module.UserManager.Overview.Overview\",\"VIEW\");\n\t\t\tprint $template->VarDump(true);\n\t\t\treturn \"Hi\";*/\n\t\t\t\n\t\t\t\n\t\t\t/*\n\t\t\t$moduleViewSetup = ConfigurationManager::Instance()->GetParameter(\"YageCMS.Core.CustomSetup.Overview\",\"module-usermanager\");\n\t\t\t\n\t\t\tif(!$moduleViewSetup)\n\t\t\t{\n\t\t\t\t$moduleViewSetup = ConfigurationManager::Instance()->GetParameter(\"YageCMS.Core.DefaultSetup\");\n\t\t\t}\n\t\t\t\n\t\t\t$setup = SetupAccess::Instance()->GetByID($moduleViewSetup);\n\t\t\t\n\t\t\t$setup->AddToSection(\"YageCMS.Core.ModuleView\", $this);\n\t\t\t*/\n\t\t\t$output = $this->LoadSetup();\n\t\t\t\n\t\t\treturn $output;\n\t\t}", "public function defaultAction(){\n\t\t$pseudo = \"Test\";\n\n\t\t//Affiche moi la vue home;\n\t\t$installer = new installer;\n\t\tif(!$installer->checkInstall() xor file_exists('.env.prod')){\n\t\t\theader('location: /installer');\n\t\t}else{\n\t\t$page = new Page();\n\t\t$acceuil = $page->getpageaccueil();\n\t\tif(!empty($acceuil)){\n\t\t\t$view = new View(\"page\", \"front\");\n\t\t\t$view->assign(\"page\",$acceuil[0]);\n\t\t\t$articles = $page->getArticleByIdPage($acceuil[0][\"id\"]);\n\t\t\t$view->assign('articles',$articles);\n\t\t\t$view->assign(\"title\",$acceuil[0]['slug']);\n\t\t}\n\t\telse{\n\t\t\t$view = new View();\n\t\t\t$view->assign(\"title\",\"Votre site\");\n\t\t}\n\t\t\n\t}\n\n\t\t//envoyer le pseudo à la vue\n\t}", "public function index()\n\t{\n\t\t$this->set_page_title(_l('web_setup'));\n\t\t$data['settings'] = get_settings();\n\t\t$data['content'] = $this->load->view('admin/settings/index', $data, TRUE);\n\t\t$this->load->view('admin/layouts/index', $data);\n\t}", "function index()\n {\n\t$data = $this->page_settings('default', NULL, NULL, 'Users', 'users');\n\t$this->templates->backend($data);\n }", "public function setupPesto() {\n\t\t\t$this->redirect(\"po-setup.php\");\n\t\t}", "public function index() {\n\t\t$this->_check();\n\t\t$d['title_for_layout'] = __(\"Configuration test\");\n\t\t$this->set($d);\n\t\t\n\t\tif($this->request->is('post')) {\n\t\t\tif(isset($this->request->data['Install']['create'])) {\n\t\t\t\tCakeSession::write('Install.create', true);\n\t\t\t\t$this->redirect(array('action' => 'database'));\n\t\t\t} else {\n\t\t\t\tCakeSession::write('Install.create', false);\n\t\t\t\t$this->redirect(array('action' => 'connection'));\n\t\t\t}\n\t\t}\n\t}", "function displayStartup()\n\t{\n\t\t$this->tpl->addBlockFile(\"CONTENT\",\"content\",\"tpl.clientsetup.html\", \"setup\");\n\n\t\t$this->tpl->setVariable(\"TXT_INFO\",$this->lng->txt(\"info_text_first_client\"));\n\t\t$this->tpl->setVariable(\"TXT_HEADER\",$this->lng->txt(\"setup_first_client\"));\n\n\t\t$this->displayProcessPanel();\n\n\t\t$this->setButtonNext(\"ini\");\n\t}", "public function config_page() {\n\t\trequire HS_DOCS_API_DIR_PATH . 'admin/views/admin-page.php';\n\t}", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->fixHTML5();\n $output .= $this->registerCustomResources();\n $output .= '</head><body>';\n echo $output;\n }", "public function startup()\n\t{\n\t\tparent::startup();\n\t\t$this->instructions = array(\n\t\t\t'message' => null,\n\t\t\t'redirection' => 'Administration:'\n\t\t);\n\t}", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->registerResource('css', $this->cssResource);\n $output .= $this->registerResource('js', $this->jsResource);\n $output .= $this->fixHTML5();\n $output .= '</head><body>';\n echo $output;\n }", "public function redirect_overview_to_setup() : void {\n\t\t\tglobal $pagenow;\n\n\t\t\t// phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t\tif ( $pagenow === 'admin.php' && isset( $_GET['page'] ) && $_GET['page'] === self::OVERVIEW_PAGE_SLUG ) {\n\t\t\t\t$setup_slug = learndash_cloud_is_enabled() ? self::SETUP_SLUG_CLOUD : self::SETUP_SLUG;\n\n\t\t\t\twp_safe_redirect( admin_url( 'admin.php?page=' . $setup_slug ) );\n\t\t\t\texit();\n\t\t\t}\n\t\t}", "public function show_settings_page() : void {\n\t\t\t$stripe_connect_connected = Stripe_Connect::is_stripe_connected();\n\t\t\t$stripe_connect_activated = LearnDash_Settings_Section::get_section_setting( 'LearnDash_Settings_Section_Stripe_Connect', 'enabled' ) === 'yes';\n\t\t\t$stripe_connect_needs_activation = $stripe_connect_connected && ! $stripe_connect_activated;\n\t\t\t$stripe_connect_completed = $stripe_connect_connected && $stripe_connect_activated;\n\t\t\t$stripe_activation_url = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'page' => self::SETUP_SLUG,\n\t\t\t\t\t'action' => self::ACTIVATION_URL_SLUG,\n\t\t\t\t\t'nonce' => wp_create_nonce( self::ACTIVATION_URL_SLUG ),\n\t\t\t\t),\n\t\t\t\tadmin_url( 'admin.php' )\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Filters steps shown on setup page.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t *\n\t\t\t * @param array $steps List of steps with arguments.\n\t\t\t */\n\t\t\t$steps = apply_filters(\n\t\t\t\t'learndash_setup_steps',\n\t\t\t\tarray(\n\t\t\t\t\t'site_setup' => array(\n\t\t\t\t\t\t'class' => 'setup',\n\t\t\t\t\t\t'completed' => 'completed' === get_option( 'learndash_setup_wizard_status' ),\n\t\t\t\t\t\t'time_in_minutes' => 5,\n\t\t\t\t\t\t'url' => admin_url( 'admin.php?page=learndash-setup-wizard' ),\n\t\t\t\t\t\t'title' => __( 'Set up your site', 'learndash' ),\n\t\t\t\t\t\t'description' => __( 'This is where the fun begins.', 'learndash' ),\n\t\t\t\t\t\t'action_label' => __( 'Site & Course Details', 'learndash' ),\n\t\t\t\t\t\t'action_description' => __( 'Tell us a little bit about your site.', 'learndash' ),\n\t\t\t\t\t\t'icon_url' => LEARNDASH_LMS_PLUGIN_URL . '/assets/images/setup.png',\n\t\t\t\t\t\t'button_type' => 'arrow',\n\t\t\t\t\t\t'button_class' => '',\n\t\t\t\t\t\t'button_text' => '',\n\t\t\t\t\t),\n\t\t\t\t\t'design_setup' => array(\n\t\t\t\t\t\t'class' => 'design',\n\t\t\t\t\t\t'completed' => 'completed' === get_option( 'learndash_design_wizard_status' ),\n\t\t\t\t\t\t'time_in_minutes' => 5,\n\t\t\t\t\t\t'url' => admin_url( 'admin.php?page=learndash-design-wizard' ),\n\t\t\t\t\t\t'title' => __( 'Design your site', 'learndash' ),\n\t\t\t\t\t\t'description' => __( 'It\\'s all about appearances.', 'learndash' ),\n\t\t\t\t\t\t'action_label' => __( 'Select A Starter Template', 'learndash' ),\n\t\t\t\t\t\t'action_description' => __( 'Choose a design to start with and customize. This will overwrite your current theme, may add additional content and change settings on your site.', 'learndash' ),\n\t\t\t\t\t\t'icon_url' => LEARNDASH_LMS_PLUGIN_URL . '/assets/images/design.png',\n\t\t\t\t\t\t'button_type' => 'arrow',\n\t\t\t\t\t\t'button_class' => '',\n\t\t\t\t\t\t'button_text' => '',\n\t\t\t\t\t),\n\t\t\t\t\t'payment_setup' => array(\n\t\t\t\t\t\t'class' => 'payment',\n\t\t\t\t\t\t'completed' => $stripe_connect_completed,\n\t\t\t\t\t\t'time_in_minutes' => $stripe_connect_needs_activation ? null : 5,\n\t\t\t\t\t\t'url' => $stripe_connect_needs_activation ? $stripe_activation_url : Stripe_Connect::generate_connect_url(),\n\t\t\t\t\t\t'title' => __( 'Configure payment', 'learndash' ),\n\t\t\t\t\t\t'description' => __( 'Don\\'t leave money on the table.', 'learndash' ),\n\t\t\t\t\t\t'action_label' => __( 'Set Up Stripe', 'learndash' ),\n\t\t\t\t\t\t'action_description' => __( 'Charge credit cards and pay low merchant fees.', 'learndash' ),\n\t\t\t\t\t\t'icon_url' => LEARNDASH_LMS_PLUGIN_URL . '/assets/images/payment.png',\n\t\t\t\t\t\t'button_type' => 'button',\n\t\t\t\t\t\t'button_class' => 'button-stripe',\n\t\t\t\t\t\t'button_text' => $stripe_connect_needs_activation ? __( 'Activate', 'learndash' ) : __( 'Connect Stripe', 'learndash' ),\n\t\t\t\t\t),\n\t\t\t\t\t'documentation' => array(\n\t\t\t\t\t\t'class' => 'courses',\n\t\t\t\t\t\t'completed' => null,\n\t\t\t\t\t\t'time_in_minutes' => null,\n\t\t\t\t\t\t'url' => null,\n\t\t\t\t\t\t'title' => __( 'Manage your courses', 'learndash' ),\n\t\t\t\t\t\t'description' => __( 'Get your coursework set up for success.', 'learndash' ),\n\t\t\t\t\t\t'action_label' => null,\n\t\t\t\t\t\t'action_description' => null,\n\t\t\t\t\t\t'icon_url' => null,\n\t\t\t\t\t\t'button_type' => null,\n\t\t\t\t\t\t'button_class' => null,\n\t\t\t\t\t\t'button_text' => null,\n\t\t\t\t\t\t'content_path' => 'setup/components/content-documentation',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tSFWD_LMS::get_view(\n\t\t\t\t'setup/setup',\n\t\t\t\tarray(\n\t\t\t\t\t'steps' => $steps,\n\t\t\t\t\t'setup_wizard' => $this,\n\t\t\t\t\t'overview_video' => Help_Page::get_articles( 'overview_video' )[0],\n\t\t\t\t\t'overview_article' => Help_Page::get_articles( 'overview_article' )[0],\n\t\t\t\t),\n\t\t\t\ttrue\n\t\t\t);\n\t\t}", "protected function renderUserSetup() {}", "public function print_default_options_page() {\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\t\t\t<p>WPCampus settings require the Advanced Custom Fields PRO plugin. <a href=\"<?php echo admin_url( 'plugins.php' ); ?>\">Manage plugins</a></p>\n\t\t</div>\n\t\t<?php\n\t}", "public function renderSetupPage()\r\n\t{\r\n\t\tglobal $lang;\r\n\t\t// Instructions\r\n\t\t$html =\tRCView::p(array('style'=>'max-width:800px;'), \r\n\t\t\t\t\t\"{$lang['ws_53']} {$lang['ws_13']} {$lang['ws_54']} \" .\r\n\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'onclick'=>'ddpExplainDialog();', 'style'=>'text-decoration:underline;'), $lang['global_58'])\r\n\t\t\t\t);\r\n\t\t// If a POST request, process the submission and save it\r\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['map_fields'])) {\r\n\t\t\t$html .= $this->saveFieldMappings();\r\n\t\t}\r\n\t\t// Display tree of external fields for user to choose prior to mapping\r\n\t\tif ((!$this->isMappingSetUp() && !isset($_POST['select_fields'])) || isset($_GET['add_fields'])) {\r\n\t\t\t$html .= $this->renderExternalSourceFieldTree();\r\n\t\t}\r\n\t\t// Display table of mappable fields from external source\r\n\t\tif (!isset($_GET['add_fields'])) {\r\n\t\t\t$html .= $this->renderExternalSourceFieldTable();\r\n\t\t}\r\n\t\t// Return html\r\n\t\treturn RCView::div(array('style'=>'max-width:1000px;margin:20px 0;'), $html);\r\n\t}", "public function winespace_welcome_getting_started() {\n\t\trequire_once( get_template_directory() . '/inc/admin/welcome-screen/sections/getting-started.php' );\n\t}", "public function display_plugin_setup_page() {\n\t\tinclude_once( 'partials/nerd-wp-admin-display.php' );\n\t}", "function index() {\n\t\t$templateMgr =& TemplateManager::getManager();\n\t\t$this->setupTemplate();\n\t\t$templateMgr->display('management/tools/index.tpl');\n\t}", "public function initialize_settings_page()\n {\n }", "public function page_setup($baseurl) {\n global $PAGE, $SITE;\n\n // Set up the basic page info.\n $PAGE->set_url($baseurl);\n $displaystring = get_string('configuretitle', 'rlipexport_version1elis');\n $PAGE->set_title($SITE->shortname.': '.$displaystring);\n $PAGE->set_heading($SITE->fullname);\n\n // Use the default admin layout.\n $PAGE->set_pagelayout('admin');\n }", "function index() {\n\t\t$this->theme = $this->passedArgs['theme'];\n\t\t$this->layout = $this->passedArgs['layout'];\n\t}", "public function settingsPage() {\n require_once 'form.phtml';\n }", "public function home()\n {\n $this->privateAccess(true);\n //Set content type as html page\n $this->contentType(\n 'html',\n 'Management Proof',\n [\n $this->_assets_path . 'js/Core/datatables.min.js',\n $this->_assets_path . 'js/Apps/ManagementResults/home.js'\n ], [\n $this->_assets_path . 'css/Core/datatables.min.css'\n ]\n );\n\n //add management subject view\n include 'Apps/ManagementResults/view/home.php';\n\n }", "public function get_initial_page() {\n\t\treturn 'welcome-page';\n\t}", "public function general_settings_page() {\n include __DIR__ . \"/views/general_settings.php\";\n }", "function step1()\n\t{\n\t\t$this->load->view(\"registration/professional/header\");\n\t\t$this->load->view(\"registration/professional/index\");\n\t\t$this->load->view(\"registration/professional/footer\");\n\t}", "public function display_page() {\n include_once JPID_PLUGIN_DIR . 'includes/admin/pages/views/html-jpid-admin-settings-page.php';\n }", "function adminDefault() {\n\t\t// decide submit modes\n\t\t$GLOBALS['objCms']->initSubmitting(1,2); // save and save and close\n\t\n\t\t// initialize object content\n\t\t$this->content = new ContentFck();\n\t\t\n\t\t// load content corresponding to page\n\t\t$this->content->loadContent($GLOBALS['objPage']->id);\n\t\n\t\t// set script for form\n\t\t$this->content->initAdmin('full', 2);\n\t\t\n\t\t$this->setView('admin_form');\n\t\t\n\t}", "public function startup() {\n\t\tA('AdminInterface')->bind('GatherAdminPages', array(\n\t\t\t'Core Settings' => array(\n\t\t\t\t'config' => $this->config,\n\t\t\t\t'fields' => array(\n\t\t\t\t\tSETTING_DEFAULT_BASE_PATH => array( \n\t\t\t\t\t\t'title' => 'Base Path',\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'value' => $this->config->getConfigValue(SETTING_DEFAULT_BASE_PATH)),\n\t\t\t\t\tSETTING_SITE_URL => array(\n\t\t\t\t\t\t'title' => 'Base URL',\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'value' => $this->config->getConfigValue(SETTING_SITE_URL, '')),\t\n\t\t\t\t\tSETTING_ENVIRONMENT => array(\n\t\t\t\t\t\t'title' => 'Environment',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'values' => array(\"Development\" => ENV_DEVELOPMENT, \"Test\" => ENV_TEST, \"Production\" => ENV_PRODUCTION),\n\t\t\t\t\t\t'selected' => $this->config->getConfigValue(SETTING_ENVIRONMENT)),\n\t\t\t\t),\n\t\t\t)\n\t\t));\n\t}", "public function init_settings_page()\n\t\t{\n\n\t\t\t$this->template_header();\n\t\t\t$this->template_body();\n\t\t\t$this->template_footer();\n\n\t\t}", "public function settings_page() {\n\t\tinclude_once( dirname( __FILE__ ) . '/class-vendor-admin-settings.php' );\n\t\tVendor_Admin_Settings::output();\n\t}", "function index()\n {\n $data['$option'] = \"doc/welcome\";\n $this->loadContent('doc/home', $data);\n }", "public function outputSetupForm() {\n\t\t$this->_directFormHtml( 'webinarjamstudio' );\n\t}", "public function setup();", "public function setup();", "function index()\n {\n redirect(URL_SITE_SETTINGS);\n }", "public function index()\n {\n \n if ($this->config['db_name'] == NO_DATABASE)\n {\n $this->redirect(\"setup.php\");\n }\n \n else if ($this->custLoggedIn())\n {\n $this->redirect(\"mainPageCust.php\");\n } elseif ($this->ownerLoggedIn())\n {\n $this->redirect(\"mainPageOwner.php\");\n } else\n {\n $this->redirect(\"login.php\");\n }\n\n }", "public function setting_page() {\n\n\t\techo '<div class=\"wrap\">';\n\t\tsettings_errors();\n\n\t\t$this->setting->show_navigation();\n\t\t$this->setting->show_forms();\n\n\t\techo '</div>';\n\t}", "public function default()\n {\n global $controller,$alerts,$local,$view,$theme;\n $tmpFirst = null;\n if ($controller->argc > 0) {\n $tmpFirst = $controller->argv[0];\n $this->ifProfile($tmpFirst);\n }\n }", "public function pageDefault ()\n {\n\n\n $this->btnCmd ( \"GIT Pull\", 'gitPull', true, false, \"Arguements for git pull: ( origin dev / --all )\" );\n $this->btnCmd ( \"GIT Push\", 'gitPush', true, false, \"Arguements for git push: ( origin dev / --all )\" );\n $this->btnCmd ( \"GIT Status\", 'gitStatus' );\n $this->btnCmd ( \"GIT List Branches\", 'gitBranch' );\n $this->btnCmd ( \"GIT Add\", 'gitAdd', true, true, \"File: \" );\n $this->btnCmd ( \"GIT Commit\", 'gitCommit', true, true, \"Commit Message: \" );\n $this->btnCmd ( \"GIT Commit All\", 'gitCommitAll', true, true, \"Commit Message: \" );\n $this->btnCmd ( \"GIT Stash\", 'gitStash' );\n $this->btnCmd ( \"GIT Checkout Branch\", 'gitCheckout', true, true, \"Branch Name: \" );\n $this->btnCmd ( \"DB Dump\", 'dbDump', true, true, \"Filename (with .sql):\" );\n $this->btnCmd ( \"DB Import\", 'dbImport', true, true, \"Filename (with .sql):\" );\n $this->btnCmd ( \"Delete Database File\", 'fileDelete', true, true, \"Filename (with .sql):\" );\n $this->btnCmd ( \"Current Timestamp\", 'timestamp' );\n $this->btnCmd ( \"List SQL Files\", 'dbListFiles' );\n $this->btnCmd ( \"Delete ACF Category Meta\", 'deleteACF_CategoryMeta' );\n// $this->btnCmd ( \"Regenerate Missing Image Sizes\", 'regenImagesOutput' );\n $this->btnCmd ( \"PHP INFO\", 'phpinfo' );\n\n }", "public static function install()\n\t{\n\t\tmanpower_create_page_with_slug(MANPOWER_DEFAULT_CATALOG_SLUG);\n\t\tupdate_option('mp_catalog_slug', MANPOWER_DEFAULT_CATALOG_SLUG);\n\t\tupdate_option('mp_worker_slug', MANPOWER_DEFAULT_WORKER_SLUG);\t\t\n\t}", "public function page_setup(){\n add_menu_page( PLUGIN_NAME, PLUGIN_NAME, 'manage_options', sanitize_key(PLUGIN_NAME), array($this, 'admin_page'), $this->icon, 3 );\n }", "public function setupForm()\n {\n\n// if ($this->config['db_name'] != NO_DATABASE)\n // $this->redirect(\"login.php\");\n // login here?\n \n/* if ( !$this->ownerLoggedIn() )\n {\n $this->restricted();\n return;\n }\n*/\n require_once('views/SetupView.class.php'); \n \n $site = new SiteContainer($this->db);\n \n $sv = new SetupView();\n\n $site->printHeader();\n $site->printNav(\"owner\");\n $sv->printHtml();\n $site->printFooter(); \n }", "function rlip_manualrun_page_setup($baseurl, $plugin_display) {\n global $PAGE, $SITE;\n\n //set up the basic page info\n $PAGE->set_url($baseurl);\n $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));\n $displaystring = get_string('configuretitle', 'rlipexport_version1');\n $PAGE->set_title(\"$SITE->shortname: \".$displaystring);\n $PAGE->set_heading($SITE->fullname);\n\n //use the default admin layout\n $PAGE->set_pagelayout('admin');\n\n //add navigation items\n $PAGE->navbar->add(get_string('administrationsite'));\n $PAGE->navbar->add(get_string('plugins', 'admin'));\n $PAGE->navbar->add(get_string('blocks'));\n $PAGE->navbar->add(get_string('plugins', 'block_rlip'));\n $PAGE->navbar->add(get_string('rlipmanageplugins', 'block_rlip'), new moodle_url('/blocks/rlip/plugins.php'));\n $PAGE->navbar->add(get_string('runmanually', 'block_rlip'));\n\n //block css file\n $PAGE->requires->css('/blocks/rlip/styles.css');\n}", "public function index()\n\t{\n\t\t$this->load->database();\n\t\tif (!$this->db->initialize()) {\n\t\t\t$cnt = $this->load->view('setup/setup_advice','',TRUE);\n\t\t} elseif ($this->tables_exist()) {\n $cnt = $this->load->view('setup/setup_success', '', TRUE);\n\t\t} else {\n\t\t\t$this->load->library('form_validation');\n\n\t\t\t$this->form_validation->set_rules('title', 'Название сайта', 'required|max_length[100]|xss_clean|strip_tags');\n\t\t\t$this->form_validation->set_rules('subtitle', 'Описание сайта', 'required|max_length[100]|xss_clean|strip_tags');\n\t\t\t$this->form_validation->set_rules('adminemail', 'E-mail администратора', 'required|valid_email|max_length[100]');\n\t\t\t$this->form_validation->set_rules('adminpass', 'Пароль администратора', 'required|max_length[32]');\n\n\t\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\t\t$cnt = $this->load->view('setup/setup_form', array(\n\t\t\t\t\t'errors' => validation_errors($this->config->item('form_vld_err_before'), $this->config->item('form_vld_err_after')),\n\t\t\t\t), TRUE);\n\t\t\t} else {\n\t\t\t\t$query = file_get_contents('devdb_partsdbshop.sql');\n\n\t\t\t\t$query = preg_split(\"/-- [^\\n]+\\n/\", $query);\n\n\t\t\t\tforeach ($query as $item) {\n\t\t\t\t\t$item = trim(preg_replace('/-- ?.*\\n/', '', $item));\n\n\t\t\t\t\tif (!empty($item)) {\n\t\t\t\t\t\t$this->db->query($item);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->load->model('setup_helper_model', 'setup_helper', TRUE);\n\n\t\t\t\t$this->setup_helper->setup(p(array('title','subtitle','adminemail','adminpass'), TRUE), TRUE);\n\t\t\t\t$this->setup_helper->setup_sample_pages();\n\n\t\t\t\t$cnt = $this->load->view('setup/setup_success', '', TRUE);\n\t\t\t}\n\t\t}\n\n\t\t$this->load->view('setup/template', array('cnt' => $cnt));\n\n\t}", "private function setup()\r\n\t{ }", "public function init() {\n\t\t\theader('Location: ../install/index.php');\n\t\t}", "public function action_index()\r\n\t{\r\n\t\t$this->title = 'Welcome';\r\n\t\t$this->template->content = View::factory('index');\r\n\t}", "public function index()\n {\n return view('setting::install/step_1');\n }", "public function create_plugin_settings_page()\n {\n require_once 'views/settings.phtml';\n }", "function homepage_display() {\n add_meta_box('shiba2_homepage', 'オプション', 'func_ishomepage', 'page', 'normal', 'default');\n}", "public function setup_help_tab()\n {\n }", "public function action() {\n\n //check if needed values are given\n if(!$this->checkDefaultValues())\n $this->configWizard();\n\n //load a list of available installers\n $this->loadInstaller();\n\n //step one: needed php-values\n if(!isset($_GET[\"step\"]))\n $this->checkPHPSetting();\n\n\n elseif($_GET[\"step\"] == \"config\" || !$this->checkDefaultValues()) {\n $this->configWizard();\n }\n\n elseif($_GET[\"step\"] == \"loginData\") {\n $this->adminLoginData();\n }\n\n elseif($_GET[\"step\"] == \"modeSelect\") {\n $this->modeSelect();\n }\n\n elseif($_GET[\"step\"] == \"install\") {\n $this->createModuleInstalls();\n }\n\n elseif($_GET[\"step\"] == \"samplecontent\") {\n $this->installSamplecontent();\n }\n\n elseif($_GET[\"step\"] == \"finish\") {\n $this->finish();\n }\n }", "function bizpanda_sts_help_page($manager)\n\t{\n\t\trequire BZDA_STS_ADN_PLUGIN_DIR . '/admin/pages/howtouse/quick-start.php';\n\t}", "protected function setupTemplate() {\r\n \r\n }", "function homepage(){\n\t\trequire(TEMPLATES_PATH.\"/homepage.php\");\n\t}", "public function settings_page_init() {\n $this->registration();\n $this->sections();\n }", "function index()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //login check\n $this->__commonAdmin_LoggedInCheck();\n\n //uri - action segment\n $action = $this->uri->segment(4);\n\n //default page title\n $this->data['vars']['main_title'] = $this->data['lang']['lang_settings_company'];\n\n //re-route to correct method\n switch ($action) {\n case 'edit':\n $this->__editSettings();\n break;\n\n case 'view':\n $this->__viewSettings();\n break;\n\n default:\n $this->__viewSettings();\n }\n\n //css - active tab\n $this->data['vars']['css_active_tab_company'] = 'tab-active';\n\n //load view\n $this->__flmView('admin/main');\n\n }", "public function setup() {\n\t\t// set static properties in Kopa_Admin_Settings class\n\t\tKopa_Admin_Settings::get_settings_pages();\n\n\t\t/*\n\t\t * Make this theme available for translation.\n\t\t *\n\t\t * Translations can be added to the /languages/ directory.\n\t\t * If you're building a theme based on this theme,\n\t\t * change KOPA_DOMAIN constant value to the name \n\t\t * of your theme in functions.php\n\t\t */\n\t\tload_theme_textdomain( KOPA_DOMAIN, get_template_directory() . '/languages' );\n\n\t\t/**\n\t\t * Add custom layout feature\n\t\t * By default, just built-in post types and taxonomies have this feature\n\t\t * Built-in post types: post, page\n\t\t * Built-in taxonomies: category, post_tag\n\t\t * Use this filter hook 'kopa_custom_layout_arguments' to customize\n\t\t * this feature for custom post types and custom taxonomies\n\t\t */\n\t\tadd_theme_support( 'kopa_custom_layout', apply_filters( 'kopa_custom_layout_arguments', array(\n\t\t\tarray(\n\t\t\t\t'screen' => 'post',\n\t\t\t\t'taxonomy' => false,\n\t\t\t\t'layout' => 'post-layout',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'screen' => 'page',\n\t\t\t\t'taxonomy' => false,\n\t\t\t\t'layout' => 'page-layout',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'screen' => 'category',\n\t\t\t\t'taxonomy' => true,\n\t\t\t\t'layout' => 'blog-layout',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'screen' => 'post_tag',\n\t\t\t\t'taxonomy' => true,\n\t\t\t\t'layout' => 'blog-layout',\n\t\t\t),\n\t\t) ) );\n\t}", "public function setUp() : void\n {\n $this->setUpForm(new AboutYouForm());\n }", "public function indexAction ()\n {\n $this->_pageTitle = ['Admin Console'];\n }", "public function indexAction()\n {\n $this->tag->setTitle(__('Admin panel'));\n $this->siteDesc = __('Admin panel');\n }", "function displaySetup(& $tpl)\n {\n\n $return_string = '';\n\n\n $this->admin_auth_handler_->perm_->addLanguage('en', 'english', 'English language');\n $this->admin_auth_handler_->perm_->setCurrentLanguage('en');\n $app_id = $this->admin_auth_handler_->perm_->addApplication('HEM', 'Heuristic Evaluation Manager');\n if(PEAR::isError($app_id))\n {\n\t$return_string.= \"<pre>Adding App:\";\n\t$return_string.= var_export($app_id);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Application $app_id<br/>\";\n \n $area_id = $this->admin_auth_handler_->perm_->addArea($app_id, 'AREA', 'The Only Area');\n \n if(PEAR::isError($area_id))\n {\n\t$return_string.= \"<pre>Adding Area:\";\n\t$return_string.= var_export($area_id);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Area $area_id<br/>\"; \n \n\n $group_id_1 = $this->admin_auth_handler_->perm_->addGroup('evaluator', 'The Evaluators', TRUE, 'EVALUATOR');\n if(PEAR::isError($group_id_1))\n {\n\t$return_string.= \"<pre>Adding Area:\";\n\t$return_string.= var_export($group_id_1);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Group $group_id_1<br/>\"; \n\n $group_id_2 = $this->admin_auth_handler_->perm_->addGroup('manager', 'The Managers', TRUE, 'MANAGER');\n if(PEAR::isError($group_id_2))\n {\n\t$return_string.= \"<pre>Adding Area:\";\n\t$return_string.= var_export($group_id_2);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Group $group_id_2<br/>\"; \n\n $group_id_3 = $this->admin_auth_handler_->perm_->addGroup('admin', 'The Administrators', TRUE, 'ADMIN');\n if(PEAR::isError($group_id_3))\n {\n\t$return_string.= \"<pre>Adding Area:\";\n\t$return_string.= var_export($group_id_3);\n\t$return_string.= \"</pre>\";\n }\n else\n $return_string.= \"Added Group $group_id_3<br/>\"; \n\n\n\n $tpl->setCurrentBlock('main_block');\n \n $tpl->setVar('CONTENT', $return_string);\n \n $tpl->parseCurrentBlock();\n\n return 1;\n\n }", "public function Main() {\n $DB = DB::getInstance();\n $this->setConf($DB->getConfig());\n $this->setTitle($this->getConf()['title']);\n }", "public function index()\n {\n $this->data['pagebody'] = 'sign_up';\n\t$this->render();\n echo \"this is the most pointless thing I have ever done\";\n \n }", "public function actionIndex()\n\t{\n\t $this->pageTitle = 'Get Started';\n\t\t$this->render('index');\n\t}", "public function show_settings_page() : void {\n\t\t\t$categories = self::get_categories();\n\n\t\t\tSFWD_LMS::get_view(\n\t\t\t\t'support/help',\n\t\t\t\tarray(\n\t\t\t\t\t'categories' => $categories,\n\t\t\t\t),\n\t\t\t\ttrue\n\t\t\t);\n\t\t}", "public function initializePage()\n\t{\n\t\tadd_menu_page('Thema opties', 'Thema opties', 'manage_options', 'theme-options');\n\t}", "public function menu_page() {\n\t\tinclude EPT_PATH . 'views/troubleshoot.php';\n\t}", "function admin_index(){\r\r\n\t\t$this->layout='backend/backend';\r\r\n\t\t$this->set(\"title_for_layout\",SETTING);\r\r\n\t}", "protected function page_default () {\r\n\t\t$skeleton = new xhtml ('skeleton.basic');\r\n\t\t$skeleton->load();\r\n\t\t$content=\"\";\r\n\t\t/**\r\n\t\t * Fetch the body content template\r\n\t\t */\r\n\t\tif(config::get('locale')!='') {\r\n\t\t\t$body = new xhtml ('body.vidtuts.'.config::get('locale'));\r\n\t\t} else {\r\n\t\t\t$body = new xhtml ('body.vidtuts');\r\n\t\t}\r\n\t\t$body->load();\r\n\r\n\t\t/**\r\n\t\t * Fetch the translated terms\r\n\t\t */\r\n\t\t$query = \"SELECT \";\r\n\t\t$query.= \"`html` \";\r\n\t\t$query.= \"FROM \";\r\n\t\t$query.= \"`page_terms_translations` \";\r\n\t\t$query.= \"WHERE \";\r\n\t\t$query.= \"`locale`='\".config::get('locale').\"' \";\r\n\t\t$query.= \"LIMIT 1\";\r\n\r\n\t\t$result = database::query($query);\r\n\r\n\t\tif($result && mysql_error()=='' && mysql_num_rows($result) > 0) {\r\n\t\t\t$row = mysql_fetch_assoc($result);\r\n\r\n\t\t\t$date = date('d/m/Y');\r\n\r\n\t\t\t$content = str_replace('{{ date }}',$date,stripslashes($row['html']));\r\n\t\t}\r\n\r\n\t\t$body->assign('content',$content);\r\n \r\n\t\t/**\r\n\t\t * Fetch the page details\r\n\t\t */\r\n\t\t$page = new page('terms');\r\n\r\n\t\t/**\r\n\t\t * Build the output\r\n\t\t */\r\n\t\t$skeleton->assign (\r\n\t\t\tarray (\r\n\t\t\t\t'title'\t\t\t=> /*$page->title()*/'Video Tutorials',\r\n\t\t\t\t'keywords'\t\t=> $page->keywords(),\r\n\t\t\t\t'description'\t=> $page->description(),\r\n\t\t\t\t'body'\t\t\t=> $body\r\n\t\t\t)\r\n\t\t);\r\n \r\n\t\toutput::as_html($skeleton,true);\r\n \r\n\t}", "function displayFinishSetup()\n\t{\n\t\t$this->checkDisplayMode(\"finish_setup\");\n\t\t$this->no_second_nav = true;\n//echo \"<b>1</b>\";\n\t\tif ($this->validateSetup())\n\t\t{\n\t\t\t$txt_info = $this->lng->txt(\"info_text_finish1\").\"<br /><br />\".\n\t\t\t\t\"<p>\".$this->lng->txt(\"user\").\": <b>root</b><br />\".\n\t\t\t\t$this->lng->txt(\"password\").\": <b>homer</b></p>\";\n\t\t\t$this->setButtonNext(\"login_new\",\"login\");\n//echo \"<b>2</b>\";\n\t\t\t$this->setup->getClient()->reconnect();\t\t// if this is not done, the writing of\n\t\t\t\t\t\t\t\t\t\t\t// the setup_ok fails (with MDB2 and a larger\n\t\t\t\t\t\t\t\t\t\t\t// client list), alex 17.1.2008\n\t\t\t$this->setup->getClient()->setSetting(\"setup_ok\",1);\n//$this->setup->getClient()->setSetting(\"zzz\", \"Z\");\n//echo \"<b>3</b>\";\n\t\t\t$this->setup->getClient()->status[\"finish\"][\"status\"] = true;\n//echo \"<b>4</b>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$txt_info = $this->lng->txt(\"info_text_finish2\");\n\t\t}\n\n//echo \"<b>5</b>\";\n\t\t// output\n\t\t$this->tpl->addBlockFile(\"SETUP_CONTENT\",\"setup_content\",\"tpl.clientsetup_finish.html\", \"setup\");\n\t\t$this->tpl->setVariable(\"TXT_INFO\",$txt_info);\n\n\t\t$this->setButtonPrev(\"nic\");\n//echo \"<b>6</b>\";\n\t\t$this->checkPanelMode();\n//echo \"<b>7</b>\";\n\t}", "public function define_settings_page() {\n\t\t$this->hook_suffix = add_options_page(\n\t\t\t__( 'Top Story Options', 'top-story' ),\n\t\t\t__( 'Top Story', 'top-story' ),\n\t\t\t'manage_options',\n\t\t\t$this->menu_slug,\n\t\t\tarray( $this, 'option_page' )\n\t\t);\n\t}", "public function settingsPage()\n {\n include 'views/admin.php';\n }", "function register_initial_settings()\n {\n }", "private function add_default_options_page() {\n\n\t\tadd_menu_page(\n\t\t\tself::OPTIONS_TITLE,\n\t\t\tself::OPTIONS_MENU_TITLE,\n\t\t\tself::OPTIONS_USER_CAP,\n\t\t\tself::OPTIONS_MENU_SLUG,\n\t\t\t[ $this, 'print_default_options_page' ]\n\t\t);\n\t}", "function invokeDefaultPage() {\r\n require(\"controllers/IndexController.php\");\r\n $controller = new IndexController();\r\n $controller->index();\r\n }", "function adminDefault() {\n\t\t\n\t\t// load intro and options\n\t\t$this->content = new BlogPostIntro();\n\t\t$this->content->loadContent($GLOBALS['objPage']->id);\n\t\t\n\t\t// load confirmation\n\t\t$this->confirm = new CmsContent();\n\t\t$this->confirm->loadContent($GLOBALS['objPage']->id, 'confirm');\n\t\t\n\t\t// load no access message\n\t\t$this->noaccess = new CmsContent();\n\t\t$this->noaccess->loadContent($GLOBALS['objPage']->id, 'noaccess');\n\t\t\n\t\tif ($GLOBALS['confModule']['blog_post']['editor_full']) {\n\t\t\t$this->content->initAdmin('full',2);\n\t\t\t$this->confirm->initAdmin('full',2);\n\t\t\t$this->noaccess->initAdmin('full',2);\n\t\t} else {\n\t\t\t$this->content->initAdmin('Default',1);\n\t\t\t$this->confirm->initAdmin('Default',1);\n\t\t\t$this->noaccess->initAdmin('Default',1);\n\t\t}\n\t\t\n\t\t$this->data = new ContentBlogPost();\n\t\t$this->data->loadPostsList(true);\n\t\t\n\t\t// only if on page\n\t\t$GLOBALS['objCms']->initSubmitting(1,2); // save and save and close\n\n\t\t$this->baseLink = CMS_WWW_URI.'admin/special.php?module=blog';\n\t\t$this->setView('admin');\n\t\t\n\t}", "public function indexAction() {\r\n $this->view->title = 'Hello World !';\r\n $this->view->headTitle('Hello World !');\r\n }", "public function frontpage() {\n\t\t\n\t\t$this->set('page_title', 'Welcome'); // this is hardcoded for index page\n\t\t$this->render('index');\n\t}", "public function default($name_of_page,$action){\r\n\r\n self::get_view($name_of_page,$action);// this function (get_view) talk this parameter and using it to call it in the browser to get main_view page\r\n }", "public function setup_theme()\n {\n }", "public function admin_page() {\n echo $this->generateView('main', []);\n }", "function webbusiness_setup() {\n\n\t\t/**\n\t\t * Make theme available for translation\n\t\t */\n\t\tload_theme_textdomain('webbusiness', get_template_directory() . '/languages');\n\n\t\t/**\n\t\t * Add default posts and comments RSS feed links to head\n\t\t */\n\t\tadd_theme_support('automatic-feed-links');\n\n\t\t/**\n\t\t * This theme uses wp_nav_menu() in one location.\n\t\t */\n\t\tregister_nav_menus(array(\n\t\t\t'primary' => __('Primary Menu', 'webbusiness'),\n\t\t));\n\n\t\t/**\n\t\t * Enable support for Post Formats\n\t\t */\n\t\tadd_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link'));\n\t\t\n\t\t/**\n\t\t * Add full width\n\t\t */\n\t\tadd_theme_support('post-thumbnails'); \n\t\tadd_image_size('full-width', 940, 9999, FALSE);\n\t}", "public function index()\n {\n $this->setup_model->setup();\n header('location: ' . base_url() . 'index.php/user/login');\n }", "public function index() {\n $this->getView('navigation', array('pagename' => 'Welcome'));\n $this->getView('welcome');\n $this->getView('footer');\n }", "public function init()\n {\n\t\t$this->view->headTitle(Zend_Registry::get('Default Page Title'));\n\t\t$this->view->headTitle()->prepend('Partners');\n }", "function index()\n {\n //call some deafaults not to spoil template\n $data=$this->default_data();\n $this->template($data);\n\n }", "public function initPage() {}", "public function initPage() {}", "public function indexAction() {\n $this->view->title = 'Hello World !';\n $this->view->headTitle('Hello World !');\n }", "public function setup()\n {\t\t\n }", "public function setup()\n {\t\t\n }", "public function indexAction() {\n\t\t$this->view->title = \"Visualisations disponibles\";\n\t $this->view->headTitle($this->view->title, 'PREPEND');\n\t}" ]
[ "0.77339464", "0.73001194", "0.719739", "0.70814645", "0.70530313", "0.7044365", "0.7043841", "0.70348555", "0.6987461", "0.6977053", "0.69041973", "0.68844855", "0.68742687", "0.68688506", "0.68342024", "0.67652446", "0.6735043", "0.6726542", "0.6643878", "0.6641313", "0.66200155", "0.66127205", "0.6572365", "0.6570562", "0.6559981", "0.6542497", "0.6533729", "0.6522664", "0.6516279", "0.65035915", "0.6500345", "0.6499477", "0.6488017", "0.64841044", "0.6480253", "0.6477591", "0.6468611", "0.64626586", "0.64527875", "0.644884", "0.6442852", "0.6442852", "0.6442707", "0.6440335", "0.64371973", "0.6437006", "0.64342767", "0.6430948", "0.6427792", "0.6423537", "0.6421508", "0.64192486", "0.6406746", "0.639567", "0.6390006", "0.638725", "0.63867354", "0.6380118", "0.63673913", "0.636601", "0.6357246", "0.63521016", "0.6350181", "0.6346189", "0.6332154", "0.6324808", "0.63221", "0.63208735", "0.6320044", "0.6289492", "0.6283835", "0.62813646", "0.6277993", "0.6273249", "0.6272919", "0.6270527", "0.6269837", "0.62580645", "0.6257371", "0.6254748", "0.62515026", "0.62511915", "0.62500405", "0.62429184", "0.62322986", "0.6231131", "0.6218514", "0.62176484", "0.6212388", "0.62121826", "0.62107676", "0.6204626", "0.61979365", "0.6197478", "0.6197345", "0.6197324", "0.6197324", "0.61951655", "0.6178571", "0.6178571", "0.617763" ]
0.0
-1
Ensure that container constructor consumes all func arg rules and not only the first one
public function testConstructorLength() { $rule = new OrRule( new FalseRule(), new TrueRule() ); $this->assertTrue($rule->validate()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testConstructorContainer()\n {\n $rule = new AndRule(\n new TrueRule(),\n new OrRule(\n new FalseRule(),\n new TrueRule()\n ),\n new NotRule(\n new FalseRule()\n )\n );\n $this->assertTrue($rule->validate());\n }", "public function __construct() {\t\t\n\t\t$a = func_get_args();\n $i = func_num_args();\n\t\t\n if (method_exists($this, $f='__construct'.$i))\n call_user_func_array(array($this, $f), $a);\n\t}", "protected function __construct() {\n $a = func_get_args();\n $i = func_num_args();\n if (method_exists($this,$f='__construct'.$i) && $i>0) {\n call_user_func_array(array($this,$f),$a);\n }\n\t\telseif(method_exists($this,$f='__construct0')){\n\t\t\tcall_user_func_array(array($this,$f),array());\n\t\t}\n }", "private function __constrcut() { }", "function __construct()\n\t\t{\n\t\t\t$a = func_get_args();\n\t\t\t$i = func_num_args();\n\t\t\tif (method_exists($this,$f='__construct'.$i)) {\n\t\t\tcall_user_func_array(array($this,$f),$a);\n\t\t\t}\n\t\t}", "function __construct()\n\t\t{\n\t\t\t$a = func_get_args();\n\t\t\t$i = func_num_args();\n\t\t\tif (method_exists($this,$f='__construct'.$i)) {\n\t\t\t\tcall_user_func_array(array($this,$f),$a);\n\t\t\t}\n\t\t}", "public function __construct(\\Closure $func)\n {\n $params = (new \\ReflectionFunction($func))->getParameters();\n\n // Must have exactly 2 params\n if (2 != count($params)) {\n throw new \\Exception('Closure passed to Validator::__construct() is invalid: Must have exactly 2 parameters.');\n }\n\n // First must be 'input' and be of type pointybeard\\Helpers\\Cli\\Input\\AbstractInputType\n if ('input' != $params[0]->getName() || __NAMESPACE__.'\\AbstractInputType' != (string) $params[0]->getType()) {\n throw new \\Exception('Closure passed to Validator::__construct() is invalid: First parameter must match '.__NAMESPACE__.\"\\AbstractInputType \\$input. Provided with \".(string) $params[0]->getType().\" \\${$params[0]->getName()}\");\n }\n\n // Second must be 'context' and be of type pointybeard\\Helpers\\Cli\\Input\\AbstractInputHandler\n if ('context' != $params[1]->getName() || __NAMESPACE__.'\\AbstractInputHandler' != (string) $params[1]->getType()) {\n throw new \\Exception('Closure passed to Validator::__construct() is invalid: Second parameter must match '.__NAMESPACE__.\"\\AbstractInputHandler \\$context. Provided with \".(string) $params[1]->getType().\" \\${$params[1]->getName()}\");\n }\n\n $this->func = $func;\n }", "function __construct() {\n\t\t\t$a = func_get_args();\n\t\t\t$i = func_num_args();\n\t\t\tif (method_exists($this,$f='__construct'.$i)) {\n\t\t\t\tcall_user_func_array(array($this,$f),$a);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tparent::__construct();\n\t\t\t}\n\t\t}", "public function __construct()\n {\n //koji su mu prosledjeni\n $a = func_get_args();\n $i = func_num_args();\n $f = \"__construct\" . $i;\n if (method_exists($this, $f)) {\n call_user_func_array(array($this, $f), $a);\n\n }\n\n }", "public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}", "public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}", "public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}", "public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}", "public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}", "public function createObjectCanDoConstructorInjectionWithDifficultArguments() {\n\t\t$firstValue = \"Hir hier deser d'Sonn am, fu dem Ierd d'Liewen, ze schéinste Kirmesdag hannendrun déi.\";\n\t\t$secondValue = 'Oho ha halo\\' maksimume, \"io fari jeso naŭ plue\" om backslash (\\\\)nea komo triliono postpostmorgaŭ.';\n\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(1, $firstValue, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(2, $secondValue, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments', $objectConfiguration);\n\t\t$this->assertEquals($firstValue, $object->argument1, 'The first value (string with quotes) has not been constructor-injected although it should have been.');\n\t\t$this->assertEquals($secondValue, $object->argument2, 'The second value (string with double quotes and backslashes) has not been constructor-injected although it should have been.');\n\t}", "public function __construct()\n {\n // it's possible to add the css through the constructor as well ;)\n $arguments = func_get_args();\n if(func_num_args()) call_user_func_array(array($this, 'add'), $arguments);\n }", "public function testConstructor()\n\t{\n\t\t$params = array('param' => 'value');\n\n\t\t$container = new Container($params);\n\n\t\t$this->assertSame($params['param'], $container['param']);\n\t}", "public function validateArguments() {}", "public function __construct() {\n $numargs = func_num_args();\n if($numargs == 1){\n $this->constructById(func_get_arg(0));\n }\n elseif($numargs == 2){\n $this->constructByIdAvatar(func_get_arg(0), func_get_arg(1));\n }\n elseif($numargs == 5){\n $this->constructByInput(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4)); \n }\n else{\n throw new \\InvalidArgumentException('Incorrect number of arguments');\n }\n }", "public function testClosureWithNoArguments(): void\n {\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Rule test function must have at least one argument.');\n\n (new CustomRule(\n ['test'],\n function (): bool {\n return true;\n }\n ));\n }", "public function initializeControllerArgumentsBaseValidators() {}", "function __construct($rules = array()) {\n parent::__construct($rules);\n }", "abstract public function __construct(public callable $y, private ...$x);", "function cmfcConfiguratorStandAloneMultiAutoV1Base() {\n\t\t//$this->PEAR(get_class($this));\n\t\t$args = func_get_args();\n\t\tif (is_callable(array(&$this, \"__construct\")))\n\t\t\tcall_user_func_array(array(&$this, \"__construct\"), $args);\n\t}", "abstract protected function construct($params);", "public function __construct()\n\t{\n\t\t// then the array will be the collection's only element. We don't want\n\t\t// this behavior for Form_Columns because we want to quickly build\n\t\t// a column with an array of fields.\n\t\t$args = func_get_args();\n\t\tif(count($args) == 1 && is_array($args[0])){\n\t\t\tforeach($args[0] as $element){\n\t\t\t\t$this->add($element);\n\t\t\t}\n\t\t} else {\n\t\t\t// In all other cases, fall back to the parent constructor.\n\t\t\tcall_user_func_array(array('parent', '__construct'), $args);\n\t\t}\n\t}", "function __construct()\n {\n $argn = func_num_args();\n $argv = func_get_args();\n\n if (method_exists($this, $f='__construct'.$argn))\n {\n call_user_func_array(array($this,$f), $argv);\n }\n }", "public function __construct()\n {\n $this->processors = func_get_args();\n if (count($this->processors) == 1 && is_array($this->processors[0])) {\n $this->processors = $this->processors[0];\n }\n }", "public function __construct() {\n $this->instance = & get_instance();\n $this->_db = $this->instance->load->database('', TRUE);\n\n $args = func_get_args(); //get arguments passed to function\n $numArgs = func_num_args(); //get number of argumetns passed to function\n\n if ($numArgs == 1) {\n if (is_int($args[0])) {\n if (method_exists($this, $func = '__constructInt')) {\n call_user_func_array(array($this, $func), $args); //Call $func in this class with $args arguments\n }\n } else if (is_string($args[0])) {\n if (method_exists($this, $func = '__constructStr')) {\n call_user_func_array(array($this, $func), $args); //Call $func in this class with $args arguments\n }\n } else if (is_bool($args[0])) {\n if (method_exists($this, $func = '__constructBool')) {\n call_user_func_array(array($this, $func), $args); //Call $func in this class with $args arguments\n }\n }\n } else if ($numArgs > 1) {\n if (method_exists($this, $func = '__construct' . $numArgs)) {\n call_user_func_array(array($this, $func), $args); //Call $func in this class with $args arguments\n }\n }\n }", "public function __construct()\r\n {\r\n if(3 == func_num_args())\r\n {\r\n $this->compositeFault = func_get_arg(0);\r\n $this->customerSupport = func_get_arg(1);\r\n $this->servicePoints = func_get_arg(2);\r\n }\r\n }", "public function __construct()\n {\n parent::__construct($this->rules);\n }", "public function __construct()\n {\n $this->pluralRules = Pluralize::all();\n $this->singularRules = Singularize::all();\n $this->aplicator = new Rules();\n \n foreach (Irregularize::all() as $rule) {\n $this->irregularSingles[$rule[0]] = $rule[1];\n $this->irregularPlurals[$rule[1]] = $rule[0];\n }\n \n foreach (Uncountable::all() as $rule) {\n $this->addUncountableRule($rule);\n }\n }", "public function __construct() {\n\t\t\t\t$this->buildDbInterface();\n\t\t\t\t$in = func_get_args();\n\t\t\t\t$i = func_num_args();\n\t\t\t\tif (method_exists($this,$f='__construct'.$i)) {\n\t\t\t\t\tcall_user_func_array(array($this,$f),$in);\n\t\t\t\t} \n\t\t}", "abstract function __construct();", "public function __construct($argument1)\n {\n }", "public function __construct()\n {\n parent::__construct('callable');\n }", "private final function __construct() {}", "public function __construct()\n {\n if (5 == func_num_args()) {\n $this->serviceName = func_get_arg(0);\n $this->template = func_get_arg(1);\n $this->replicas = func_get_arg(2);\n $this->selector = func_get_arg(3);\n $this->volumeClaimTemplates = func_get_arg(4);\n }\n }", "public function getConstructorArguments() {}", "abstract protected function __construct();", "public function __construct()\n {\n $args = func_get_args();\n\n // if an array or object load using fromArray\n if (!empty($args[0]) && (Validate::isAssociativeArray($args[0]) || is_object($args[0]))) {\n $this->fromArray((array)$args[0]);\n }\n }", "public function badConstructorArgumentsProvider()\n {\n return $this->goodConstructorArgumentsProvider();\n }", "protected abstract function __construct();", "public function getCustomConstructor(): callable;", "abstract protected function validateFilterArguments($filters);", "public function __construct()\n {\n $this->factories = array_combine(\n [\n Container::class,\n ContainerInterface::class,\n DefaultContainer::class,\n ],\n array_fill(0, 3, function (Container $c) {\n return $c;\n })\n );\n }", "public function __construct()\n {\n $this->rulesets = [\n // Exact values\n function ($value) {\n return is_string($value) && isset($this->exactReplacements[$value])\n ? [$this, 'replaceExactValue']\n : null;\n },\n\n // Router (MVC applications)\n // We do not want to rewrite these.\n function ($value, array $keys) {\n $key = array_pop($keys);\n // Only worried about a top-level \"router\" key.\n return $key === 'router' && $keys === [] && is_array($value)\n ? [$this, 'noopReplacement']\n : null;\n },\n\n // service- and pluginmanager handling\n function ($value) {\n return is_array($value) && array_intersect_key(self::SERVICE_MANAGER_KEYS_OF_INTEREST, $value) !== []\n ? [$this, 'replaceDependencyConfiguration']\n : null;\n },\n\n // Array values\n function ($value, array $keys) {\n return $keys !== [] && is_array($value)\n ? [$this, 'processConfig']\n : null;\n },\n ];\n }", "function __construct($args)\n\t\t{\n\t\t\t$this->validateFields\t=\t$args;\n\t\t}", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->hard = func_get_arg(0);\n $this->scopes = func_get_arg(1);\n }\n }", "public function testConstructor()\n {\n $param = new PythoPhant_Reflection_FunctionParam('string', 'myVar', 'array()');\n $this->assertEquals('string', $param->getType());\n $this->assertEquals('myVar', $param->getName());\n $this->assertAttributeEquals('array()', 'default', $param);\n }", "protected function vedConstructArg(array $args = array()) {\n }", "function __construct($arg0 = null) {\n\t}", "public function createObjectCanDoConstructorInjectionWithArrays() {\n\t\t$someArray = array(\n\t\t\t'foo' => 'bar',\n\t\t\t199 => 837,\n\t\t\t'doo' => TRUE\n\t\t);\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(1, $someArray, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments', $objectConfiguration);\n\t\t$this->assertEquals($someArray, $object->argument1, 'The array has not been constructor-injected although it should have been.');\n\t}", "abstract public function __construct(Closure $callback);", "public function test_ClassResolver___construct_noparams() {\n $this->expectException(\\ArgumentCountError::class);\n $test = new \\FightTheIce\\Coding\\ClassResolver();\n }", "public function __construct($a, $b, $c = null, $d = null) {}", "public function autoWiringForConstructorInjectionRespectsAlreadyDefinedArguments() {\n\t\t$objectName = 'F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithSomeImplementationInjected';\n\t\t$this->mockObjectManager->expects($this->at(0))->method('getObject')->with('F3\\FLOW3\\Tests\\Object\\Fixture\\SomeInterface')->will($this->returnValue(new \\F3\\FLOW3\\Tests\\Object\\Fixture\\SomeImplementation));\n\t\t$this->mockReflectionService->expects($this->once())->method('getClassConstructorName')->with($objectName)->will($this->returnValue('__construct'));\n\t\t$constructorParameters = array(\n\t\t\t'argument1' => array(\n\t\t\t\t'position' => 0,\n\t\t\t\t'byReference' => FALSE,\n\t\t\t\t'array' => FALSE,\n\t\t\t\t'optional' => FALSE,\n\t\t\t\t'allowsNull' => FALSE,\n\t\t\t\t'class' => 'F3\\FLOW3\\Tests\\Object\\Fixture\\SomeInterface'\n\t\t\t),\n\t\t\t'argument2' => array(\n\t\t\t\t'position' => 1,\n\t\t\t\t'byReference' => FALSE,\n\t\t\t\t'array' => FALSE,\n\t\t\t\t'optional' => FALSE,\n\t\t\t\t'allowsNull' => FALSE,\n\t\t\t\t'class' => 'F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass'\n\t\t\t)\n\t\t);\n\t\t$this->mockReflectionService->expects($this->at(1))->method('getMethodParameters')->with($objectName, '__construct')->will($this->returnValue($constructorParameters));\n\n\t\t$injectedClassName = uniqid('Injected');\n\t\teval('namespace F3\\Virtual; class ' . $injectedClassName . ' extends \\F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass {}');\n\t\t$injectedClassName = 'F3\\Virtual\\\\' .$injectedClassName;\n\t\t$injectedClass = new $injectedClassName();\n\t\t$this->mockObjectManager->expects($this->at(1))->method('getObject')->with($injectedClassName)->will($this->returnValue($injectedClass));\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithSomeImplementationInjected');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(2, $injectedClassName, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_OBJECT)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject($objectName, $objectConfiguration);\n\t\t$this->assertSame($object->argument2, $injectedClass, 'Autowiring didn\\'t respect that the second constructor argument was already set in the object configuration!');\n\t}", "public function __construct(Container $container);", "public function __construct(Container $container);", "abstract public function __construct();", "abstract public function __construct();", "abstract public function __construct();", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->causes = func_get_arg(0);\n $this->message = func_get_arg(1);\n }\n }", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->events = func_get_arg(0);\n $this->attributes = func_get_arg(1);\n }\n }", "final private function __construct() {}", "final private function __construct() {}", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->clusterRole = func_get_arg(0);\n $this->literals = func_get_arg(1);\n }\n }", "public function hasCustomConstructor(): bool;", "public function __construct()\r\n {\r\n if(1 == func_num_args())\r\n {\r\n $this->capacityGroup = func_get_arg(0);\r\n }\r\n }", "public function parentConstructor()\n\t{\n\t\t$c = $this->extended;\n\t\twhile( $c !== NULL ){\n\t\t\tif( $c->constructor !== NULL )\n\t\t\t\treturn $c->constructor;\n\t\t\t$c = $c->extended;\n\t\t}\n\t\treturn NULL;\n\t}", "public function __construct()\n {\n $this->arguments = func_get_args();\n }", "public function __construct()\r\n\t{\r\n\t\techo \"Implements Function overloading\";\r\n\t}", "public function testConstructNullContainer()\n {\n $this->expectException(\\InvalidArgumentException::class);\n new CustomNotAllowedHandler(null);\n }", "public function __construct()\n {\n if (9 == func_num_args()) {\n $this->availableReplicas = func_get_arg(0);\n $this->latestVersion = func_get_arg(1);\n $this->observedGeneration = func_get_arg(2);\n $this->replicas = func_get_arg(3);\n $this->unavailableReplicas = func_get_arg(4);\n $this->updatedReplicas = func_get_arg(5);\n $this->conditions = func_get_arg(6);\n $this->details = func_get_arg(7);\n $this->readyReplicas = func_get_arg(8);\n }\n }", "public function testConstructorWithBadRegexps3()\n {\n $array = [\n '^/$' => ['cache' => true],\n '^/index/' => ['cache' => true],\n '^/article/' => ['cache' => false],\n '^/article/view/' => [\n 1 => true,\n 'cache_with_post_variables' => true,\n 'make_id_with_post_variables' => true,\n ]\n ];\n try {\n $test = new Zend_Cache_Frontend_Page(['regexps' => $array]);\n } catch (Exception $e) {\n return;\n }\n $this->fail('Zend_Cache_Exception was expected but not thrown');\n }", "private function extractConstructor($name, $callable = null) {\n $constructor_args = func_get_args();\n $numArgs = func_num_args();\n if(is_string($parsedName = $this->parseCallable($name)) &&\n (is_callable($parsedName) || method_exists($this,$parsedName))) {\n $callable = $parsedName;\n } \n \n if(is_null($callable)) {\n $callable = $name;\n array_shift($constructor_args);\n array_shift($constructor_args);\n } else {\n $this->name = $name;\n array_shift($constructor_args);\n }\n \n if($numArgs > 2 && !is_null($callable)) {\n array_shift($constructor_args);\n array_shift($constructor_args);\n } elseif($numArgs === 2 && $name !== $callable) {\n array_shift($constructor_args);\n } \n \n return [$callable, $constructor_args];\n }", "public function __construct()\n {\n if (1 == func_num_args()) {\n $this->insuranceTypesCount = func_get_arg(0);\n }\n }", "public function __construct()\n {\n if (5 == func_num_args()) {\n $this->capacity = func_get_arg(0);\n $this->description = func_get_arg(1);\n $this->gender = func_get_arg(2);\n $this->name = func_get_arg(3);\n $this->thingTypeId = func_get_arg(4);\n }\n }", "public function __construct($collection)\n\t{\n\t\t// Assign params\n\t\t$this->collection = $collection;\n\n\t\t// Compile if needed\n\t\t$this->collection->compile();\n\t}", "public static function make(Container $container, array $arguments = []): static;", "protected function construct(string $abstract) : Closure\n {\n $inspector = new ReflectionClass($abstract);\n\n if (($constructor = $inspector->getConstructor()) && ($dependencies = $constructor->getParameters())) {\n\n // if, and only if, a class has a constructor with parameters, we try to solve then\n // creating a resolving callback that in every call will recalculate all dependencies\n // for the given class, and offcourse, using a cached resolving callback if exists.\n\n return function (string $abstract, array $parameters) use ($inspector, $dependencies) {\n return $inspector->newInstanceArgs(\n $this->process($abstract, $parameters, $dependencies)\n );\n };\n }\n\n return function (string $abstract) {\n return new $abstract;\n };\n }", "public function __construct()\n {\n if (19 == func_num_args()) {\n $this->insurancePolicyId = func_get_arg(0);\n $this->travelDurationParam = func_get_arg(1);\n $this->passengersCount = func_get_arg(2);\n $this->birthDate = func_get_arg(3);\n $this->birthDatePersian = func_get_arg(4);\n $this->riskLevelDiscount = func_get_arg(5);\n $this->basePremium = func_get_arg(6);\n $this->allPremium = func_get_arg(7);\n $this->insuranceCompanyDiscountRate = func_get_arg(8);\n $this->insuranceCompanyDiscount = func_get_arg(9);\n $this->insuranceCentreDiscount = func_get_arg(10);\n $this->coupenDiscount = func_get_arg(11);\n $this->allDiscount = func_get_arg(12);\n $this->exchangePremium = func_get_arg(13);\n $this->travelRatePlanId = func_get_arg(14);\n $this->planTitle = func_get_arg(15);\n $this->travelInsurancePolicyExtendAges = func_get_arg(16);\n $this->travelInsurancePolicyExtendPassengers = func_get_arg(17);\n $this->zoneIds = func_get_arg(18);\n }\n }", "public function __construct()\n {\n if (11 == func_num_args()) {\n $this->valid = func_get_arg(0);\n $this->country = func_get_arg(1);\n $this->providerType = func_get_arg(2);\n $this->countryCode = func_get_arg(3);\n $this->hostname = func_get_arg(4);\n $this->providerDomain = func_get_arg(5);\n $this->city = func_get_arg(6);\n $this->providerWebsite = func_get_arg(7);\n $this->ip = func_get_arg(8);\n $this->region = func_get_arg(9);\n $this->providerDescription = func_get_arg(10);\n }\n }", "#[Pure]\n public function __construct() {}", "#[Pure]\n public function __construct() {}", "public function __construct()\n {\n parent::__construct();\n $this->rulesBirth = array(0, 1, 2, 3, 4);\n $this->rulesStayAlive = array(0, 1, 2, 3);\n }", "protected abstract function applyNoArg();", "public function testProperConstructor()\n {\n $router = new Router();\n $scope = function(Routeable $routeable){\n return $routeable->value;\n };\n\n $router->setScope($scope);\n\n $destinationResult = $this->destinationResult;\n\n $name = 'foo';\n $pattern = '(?<foo>foo)';\n $destination = function($foo) use ($destinationResult){\n return $destinationResult;\n };\n $data = ['foo'=>'foo'];\n $route = new Route($name, $pattern, $destination);\n $router->addRoute($route);\n\n $dispatcher = new Dispatcher($router);\n\n $rules = $dispatcher->getRules();\n\n $this->assertInternalType('array', $rules);\n $this->assertEmpty($rules);\n\n return $dispatcher;\n }", "protected function checkArguments($arguments)\n {\n foreach ($arguments as $arg) {\n if ($arg instanceof Closure) throw new InvalidArgumentException('Closure can\\'t be serialized');\n }\n }", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "public function __construct()\n {\n $array = $this->convertArgObjects(func_get_args());\n $fixed = end($array);\n\n if (is_array($array) && (bool)count(array_filter(array_keys($array), 'is_string'))) {\n throw new \\Exception(\"Associative array passed; Arrays must be numeric\");\n }\n $this->array = $array;\n if ($fixed == 'rso-non-fixed') {\n array_pop($this->array);\n } else {\n $this->createFixedArrayWithCount(count($array));\n }\n }", "public function __construct($arg = null)\n {\n }", "public function __construct(array $params = []);", "public function __construct(array $container)\n {\n $this->container = $container;\n }", "public function methodConstructor()\n {\n $this->called = true;\n return func_get_args();\n }" ]
[ "0.6271217", "0.5981488", "0.59591854", "0.5911709", "0.58464164", "0.58268595", "0.5799596", "0.5706361", "0.5669892", "0.566135", "0.566135", "0.566135", "0.566135", "0.566135", "0.56240714", "0.5479685", "0.54647183", "0.54619056", "0.54599017", "0.5445722", "0.5415207", "0.54136723", "0.5407702", "0.53792936", "0.53764665", "0.53622437", "0.53569484", "0.53417426", "0.5337009", "0.531802", "0.5304499", "0.5279229", "0.52184385", "0.520836", "0.5205281", "0.52026725", "0.51930124", "0.5187866", "0.51820177", "0.51781404", "0.51775044", "0.5172886", "0.51691186", "0.51539797", "0.5147536", "0.51453936", "0.513535", "0.5103586", "0.5094519", "0.50840604", "0.50761086", "0.50721055", "0.5067354", "0.50590396", "0.5049721", "0.5029074", "0.5025204", "0.50238574", "0.50238574", "0.5001303", "0.5001303", "0.5001303", "0.499087", "0.49822977", "0.49663597", "0.49663597", "0.49549434", "0.49532065", "0.49521634", "0.49497655", "0.4949444", "0.49384543", "0.49313822", "0.49236688", "0.49168128", "0.4913331", "0.49069452", "0.49068457", "0.49056077", "0.49013358", "0.48963454", "0.4891677", "0.488844", "0.48881316", "0.48881316", "0.48764446", "0.48656932", "0.48623943", "0.48528963", "0.48457107", "0.48457107", "0.48457107", "0.48457107", "0.48457107", "0.48457107", "0.484167", "0.4838608", "0.48334956", "0.4828241", "0.4824833" ]
0.48620182
88
Test creating a rule tree via constructor injection
public function testConstructorContainer() { $rule = new AndRule( new TrueRule(), new OrRule( new FalseRule(), new TrueRule() ), new NotRule( new FalseRule() ) ); $this->assertTrue($rule->validate()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function test__construct() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$this\n\t\t\t->object($objBuilder)\n\t\t\t->isNotNull($objBuilder)\n\t\t\t->isInstanceOf('LeftRightTreeTraversal\\TreeBuilder')\n\t\t;\n\n\t\t/*\n\t\t * Same test, with a custom config\n\t\t */\n\t\t$hashConfig = array(\n\t\t\t'key_left' \t\t=>\t'custom_left',\n\t\t\t'key_right'\t\t=>\t'custom_right',\n\t\t\t'key_id'\t\t=>\t'custom_id',\n\t\t\t'key_parent'\t=>\t'custom_parent'\n\t\t);\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder($hashConfig);\n\n\t\t$this\n\t\t\t->object($objBuilder)\n\t\t\t->isNotNull($objBuilder)\n\t\t\t->isInstanceOf('LeftRightTreeTraversal\\TreeBuilder')\n\t\t;\n\t}", "public function testConstruct()\n {\n $this->assertConstructor(\n [\n 'name' => 'nodeName',\n 'same:expressionLanguage' => $this->createMock(ExpressionLanguage::class),\n 'same:optionsResolverFactory' => $this->createMock(OptionsResolverFactoryInterface::class)\n ]\n );\n }", "public function testProperConstructor()\n {\n $router = new Router();\n $scope = function(Routeable $routeable){\n return $routeable->value;\n };\n\n $router->setScope($scope);\n\n $destinationResult = $this->destinationResult;\n\n $name = 'foo';\n $pattern = '(?<foo>foo)';\n $destination = function($foo) use ($destinationResult){\n return $destinationResult;\n };\n $data = ['foo'=>'foo'];\n $route = new Route($name, $pattern, $destination);\n $router->addRoute($route);\n\n $dispatcher = new Dispatcher($router);\n\n $rules = $dispatcher->getRules();\n\n $this->assertInternalType('array', $rules);\n $this->assertEmpty($rules);\n\n return $dispatcher;\n }", "public function test___construct() {\n\t\t}", "public function test___construct() {\n\t\t}", "public function __construct($rule)\n {\n $this->rule = $rule;\n }", "public function test__construct()\n {\n $obj = Solar::factory($this->_class);\n $this->assertInstance($obj, $this->_class);\n }", "public function test_build_a_leaf_instance_with_explicit_arguments() {\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\\\"$instanceName\\\": {\\\"class\\\": \\\"$value\\\",\\\"args\\\": [1, 2]}}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$instance = $obj->build($instanceName);\n\t\t\t$result1 = $instance->val1;\n\t\t\t$result2 = $instance->val2;\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$this->assertEquals(1, $result1);\n\t\t\t$this->assertEquals(2, $result2);\n\t\t}", "public function testInit() {\n $node = new Route\\RouteNodeArguments();\n $this->assertTrue($node instanceof Route\\RouteNodeArguments);\n }", "public function __construct($parentRule = 'Parent')\n {\n $this->_parentRule = $parentRule;\n }", "public function test__construct()\n {\n $obj = Solar::factory('Solar_Json');\n $this->assertInstance($obj, 'Solar_Json');\n }", "public function test__construct()\n {\n $obj = Solar::factory('Solar_Role_Adapter_Ldap');\n $this->assertInstance($obj, 'Solar_Role_Adapter_Ldap');\n }", "public function test__constructCallsLookAhead(): void\n {\n $token = $this->createTokenInterfaceDoubleBuilder()->getDouble();\n \n $lexerProphecy = $this->prophesize(LexerInterface::class);\n $lexerProphecy\n ->lookAhead(Argument::is(1))\n ->willReturn($token)\n ->shouldBeCalled();\n $lexer = $lexerProphecy->reveal();\n \n $sut = new Parser($lexer);\n }", "public function testInstantiation()\n {\n $this->fixture = new ValidationReport(\n array( // results\n new ValidationResult(\n $this->nodeFactory->createNamedNode('http://focusNode/'),\n $this->nodeFactory->createNamedNode('http://resultPath/'),\n new Severity('sh:Warning'),\n $this->nodeFactory->createNamedNode('sh:MinMaxCountConstraintComponent'),\n $this->nodeFactory->createNamedNode('http://value')\n )\n )\n );\n\n $this->assertTrue($this->fixture->conforms());\n }", "protected function setUp(): void {\n $this->object = new ConvertorRule();\n }", "public function test_constructor_called__correct()\n {\n $sut = new SEOLeadsEngine();\n $this->assertAttributeInstanceOf(\\Mustache_Engine::class, 'mustache', $sut);\n $this->assertAttributeInstanceOf(SEOFactory::class, 'factory', $sut);\n }", "protected function _construct()\n {\n $this->_init('magento_targetrule', 'rule_id');\n }", "protected function setUp()\n {\n $this->object1 = new \\Yana\\Security\\Data\\SecurityRules\\Rule('Group1', 'Role1', true);\n $this->object2 = new \\Yana\\Security\\Data\\SecurityRules\\Rule('Group2', 'Role2', false);\n $this->object3 = new \\Yana\\Security\\Data\\SecurityRules\\Rule('', '', false);\n }", "public function test_build_a_leaf_instance_without_arguments() {\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\\\"$instanceName\\\": {\\\"class\\\": \\\"$value\\\"}}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$instance = $obj->build($instanceName);\n\t\t\t$result = get_class($instance);\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$expected = \"aae\\\\std\\\\LeafStub\";\n\t\t\t$this->assertEquals($expected, $result);\n\t\t}", "public function test_build_a_non_singleton() {\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\\\"$instanceName\\\": {\\\"class\\\": \\\"$value\\\"}}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$instance1 = $obj->build($instanceName);\n\t\t\t$instance1->val1 = 1;\n\t\t\t$instance2 = $obj->build($instanceName);\n\t\t\t$instance2->val1 = 2;\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$this->assertEquals(1, $instance1->val1);\n\t\t}", "public function testConstructorAccessors() {\n\n\t\t/* @var \\com\\mohiva\\pyramid\\Node $node */\n\t\t$id = sha1(microtime(true));\n\t\t$code = mt_rand(1, 30);\n\t\t$line = mt_rand(1, 100);\n\t\t$path = sha1(microtime(true));\n\t\t$content = sha1(microtime(true));\n\t\t$attribute = sha1(microtime(true));\n\t\t$node = Phake::mock('\\com\\mohiva\\pyramid\\Node');\n\t\t$expression = new Expression($id, $code, $line, $path, $content, $attribute, $node);\n\n\t\t$this->assertSame($id, $expression->getId());\n\t\t$this->assertSame($code, $expression->getCode());\n\t\t$this->assertSame($line, $expression->getLine());\n\t\t$this->assertSame($path, $expression->getPath());\n\t\t$this->assertSame($content, $expression->getContent());\n\t\t$this->assertSame($attribute, $expression->getAttribute());\n\t\t$this->assertSame($node, $expression->getNode());\n\t}", "public function __construct(\\AcceptanceTester $I) {\r\n \\Page\\node\\Node::__construct($I, NM_COURSE);\r\n }", "public function test__construct()\n {\n $obj = Solar::factory('Solar_Form');\n $this->assertInstance($obj, 'Solar_Form');\n }", "public function testStatics(){\n\t\t$chain = PreParser::get_preparse_chain();\n\t\t$this->assertInternalType('array',$chain);\n\t\t$this->assertNotEmpty($chain);\n\t\tforeach($chain as $class){\n\t\t\t$instance = new $class();\n\t\t\t$this->assertInstanceOf('PreParser',$instance);\n\t\t}\n\n\t\t$chain = Parser::get_parse_chain();\n\t\t$this->assertInternalType('array',$chain);\n\t\t$this->assertNotEmpty($chain);\n\t\tforeach($chain as $class){\n\t\t\t$instance = new $class();\n\t\t\t$this->assertInstanceOf('Parser',$instance);\n\t\t}\n\t}", "public function test_ClassResolver___construct_noparams() {\n $this->expectException(\\ArgumentCountError::class);\n $test = new \\FightTheIce\\Coding\\ClassResolver();\n }", "public function __construct()\n {\n parent::__construct($this->rules);\n }", "abstract public function testConstructorAndProperties(): void;", "public function testCreation ()\n {\n $newInstance = new Noherczeg\\Breadcrumb\\Translator('en');\n $this->assertTrue(is_array($newInstance->dump()));\n\n $newInstance2 = new Noherczeg\\Breadcrumb\\Translator();\n $this->assertTrue(is_array($newInstance2->dump()));\n\n $newInstance3 = new Noherczeg\\Breadcrumb\\Translator(array('shold_translate' => 'to_this', 'this' => 'as_well'));\n $this->assertTrue(is_array($newInstance3->dump()));\n\n }", "public function __construct($tree)\n {\n $this->tree = $tree;\n $this->visitors = array();\n }", "public function test_build_a_singleton() {\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\\\"$instanceName\\\": {\\\"class\\\": \\\"$value\\\",\\\"static\\\":true}}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$instance1 = $obj->build($instanceName);\n\t\t\t$instance1->val1 = 1;\n\t\t\t$instance2 = $obj->build($instanceName);\n\t\t\t$instance2->val1 = 2;\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$this->assertEquals(2, $instance1->val1);\n\t\t}", "abstract protected function constructTestHelper();", "public function testProperConstructor()\n {\n $name = 'foo';\n $pattern = '(?<foo>foo)';\n $destination = function($foo){};\n $data = ['foo'=>'foo'];\n $route = new Route($name, $pattern, $destination);\n\n $this->assertEquals($name, $route->getName());\n $this->assertEquals($pattern, $route->getPattern());\n $this->assertSame($destination, $route->getDestination());\n $this->assertNotSame($data, $route->getData());\n\n return $route;\n }", "protected function setUp()\n {\n $this->object = new TreeAnalyser;\n }", "protected function setUp()\n {\n $this->object = new UnyRuleParser;\n }", "function __construct($rules = array()) {\n parent::__construct($rules);\n }", "public function testGetRulesBagReturnAnInstanceOfRuleBag()\n {\n $rules = [\n 'name' => 'alpha|length_max:10',\n ];\n $rulesBag = $this->ruleParse->run($rules);\n $this->assertInstanceOf(Sparta\\RulesBag::class, $rulesBag);\n $this->assertTrue($rulesBag->hasRulesFor('name'));\n $validators = $rulesBag->getRuleFor('name');\n $this->assertArrayHasKey('length_max', $validators);\n }", "public function buildRules(): void\n {\n }", "public function setUp() {\n $this->fixture= new TreeParser();\n }", "public function test_build_get_evaluated_without_args() {\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\n \\\"$instanceName\\\": {\n \\\"class\\\": \\\"$value\\\",\n \\\"args\\\": [\n 5\n ],\n \\\"evaluate\\\": \\\"getValue\\\"\n }\n}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$result = $obj->build($instanceName);\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$this->assertEquals(5, $result);\n\t\t}", "public function __construct() {\n //parent::__construct();\n\n $model = new AclModel();\n //$sections = new Sections();\n $privileges = new PrivilegesModel();\n $roles = new Roles();\n\n $this->recursiveRolesFill($roles->getTree());\n\n foreach($privileges->getResourcesArray() as $name)\n {\n $this->addResource($name);\n }\n\n foreach($model->getRules() as $rule)\n {\n $this->allow($rule->role, $rule->resource, $rule->privilege);\n }\n }", "public function testConstructor()\n {\n $class = new \\ReflectionClass(EditorInterface::class);\n $object = $class->newInstanceWithoutConstructor();\n $constructor = $class->getConstructor();\n $constructor->setAccessible(true);\n $constructor->invoke($object);\n\n $this->markTestAsPassed();\n }", "public function testConstructor()\n\t{\n\t\t$modes = [false,\n\t\t true];\n\t\t$types = [\n\t\t\tBuilder::TYPE_COMPANY,\n\t\t\tBuilder::TYPE_COMPANY,\n\t\t];\n\t\tforeach ($modes as $mode) {\n\t\t\tforeach ($types as $type) {\n\t\t\t\t$builder = new Builder($type, $mode);\n\t\t\t\t$this->assertEquals($type, $this->getProtectedMember($builder, 'recipient_type'));\n\t\t\t\t$this->assertEquals($mode, $this->getProtectedMember($builder, 'strict_mode'));\n\t\t\t}\n\t\t}\n\t}", "public function construct() {\n\n }", "public function __construct() {\n $manager = new ConditionManager(\\Drupal::service('container.namespaces'), \\Drupal::cache('discovery'), \\Drupal::moduleHandler());\n $this->condition = $manager->createInstance('entity_bundle:node');\n }", "public function test_create__invalid_class()\n {\n\n (new ElementFactory())->create(['attributes' => ['type' => ElementFactory::class, 'name' => '']]);\n }", "public function testConstruct()\n {\n $hostMock = $this->getMockBuilder(Host::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $workspace = new Workspace($hostMock);\n\n $this->assertAttributeSame($hostMock, 'host', $workspace);\n }", "public function testConstructorResource()\n {\n $model = new Catapult\\MockModel;\n $model = new \\stdClass;\n $model->schema = array(\n \"fields\" => array(\n \"id\"\t\n ),\n \"needs\" => array(\n \"id\"\t\n )\n );\n $model->id = \"__TEST__\";\n $model1 = Catapult\\Constructor::make($model);\n\n $this->assertEquals($model->id, $model1->id);\n }", "function __construct() {\n $this->name=\"myrules\";\n $this->title=\"Мои Правила\";\n $this->module_category=\"<#LANG_SECTION_OBJECTS#>\";\n $this->checkInstalled();\n}", "public function testIsInstanceOf()\n {\n $myClass = new GenresHasCategoriesRule([]);\n $this->assertInstanceOf(GenresHasCategoriesRule::class, $myClass);\n }", "public function construction()\n {\n $equalValidator = new stubEqualValidator(5);\n $equalValidator = new stubEqualValidator('foo');\n $equalValidator = new stubEqualValidator(true);\n $equalValidator = new stubEqualValidator(false);\n $equalValidator = new stubEqualValidator(null);\n }", "public function test_build_a_leaf_instance_with_configuration_value() {\n\t\t\t$confValName = \"value\";\n\t\t\t$confVal = \"testString\";\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\\\"$confValName\\\": \\\"$confVal\\\",\\\"$instanceName\\\": {\\\"class\\\": \\\"$value\\\",\\\"args\\\": [{\\\"dep\\\": \\\"$confValName\\\"}]}}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$instance = $obj->build($instanceName);\n\t\t\t$result = $instance->val1;\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$this->assertEquals($confVal, $result);\n\t\t}", "public function testConstruct()\n {\n try\n {\n $controlPositionTest = new ControlPosition();\n $this->fail('The class \"\\Ivory\\GoogleMapBundle\\Model\\Controls\\ControlPosition\" can not be instanciated.');\n }\n catch(\\Exception $e){}\n }", "public function testConstructor()\n\t{\n\t\t$params = array('param' => 'value');\n\n\t\t$container = new Container($params);\n\n\t\t$this->assertSame($params['param'], $container['param']);\n\t}", "public function construct()\n\t\t{\n\t\t}", "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 }", "public function createObjectCanDoSimpleConstructorInjection() {\n\t\t$injectedClassName = uniqid('Injected');\n\t\teval('namespace F3\\Virtual; class ' . $injectedClassName . '{}');\n\t\t$injectedClassName = 'F3\\Virtual\\\\' .$injectedClassName;\n\t\t$injectedClass = new $injectedClassName();\n\t\t$this->mockObjectManager->expects($this->once())->method('getObject')->with($injectedClassName)->will($this->returnValue($injectedClass));\n\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(1, $injectedClassName, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_OBJECT),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(2, 42, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(3, 'Foo Bar Skårhøj', \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments', $objectConfiguration);\n\n\t\t$injectionSucceeded = (\n\t\t\t$object->argument1 === $injectedClass &&\n\t\t\t$object->argument2 === 42 &&\n\t\t\t$object->argument3 === 'Foo Bar Skårhøj'\n\t\t);\n\t\t$this->assertTrue($injectionSucceeded, 'The class Injected class has not been (correctly) constructor-injected although it should have been.');\n\t}", "public function staticConstructor()\n {\n $this->assertInstanceOf('stubOrCriterion', stubOrCriterion::create());\n }", "public function __construct($ruleSet = array())\n {\n //setup the default rule set\n if(empty($ruleSet)) { \n $ruleSet = LancasterStemmer::getDefaultRuleSet();\n }\n \n $this->indexRules($ruleSet); \n //only get the english vowel checker\n $this->vowelChecker = VowelsAbstractFactory::factory(\"English\");\n }", "public function __construct() {\n// $group = new \\App\\Models\\Group;\n// $permission = new \\App\\Models\\Permission;\n// $this->repository = new \\App\\Repositories\\AclRepository($user, $group, $permission);\n// $this->faker = \\Faker\\Factory::create();\n }", "public function testInitialize()\n {\n $this->assertAttributeInstanceOf('phpDocumentor\\Descriptor\\Collection', 'parents', $this->fixture);\n $this->assertAttributeInstanceOf('phpDocumentor\\Descriptor\\Collection', 'constants', $this->fixture);\n $this->assertAttributeInstanceOf('phpDocumentor\\Descriptor\\Collection', 'methods', $this->fixture);\n }", "public function testChecklistFactory() {\n $checklist = factory(Checklist::class)->make();\n\n $this->assertTrue($checklist instanceof Checklist);\n }", "public function test_build_a_leaf_instance_with_mixed_values() {\n\t\t\t$confValName = \"value\";\n\t\t\t$confVal = \"testString\";\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\\\"$confValName\\\": \\\"$confVal\\\",\\\"$instanceName\\\": {\\\"class\\\": \\\"$value\\\",\\\"args\\\": [{\\\"dep\\\": \\\"$confValName\\\"},5]}}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$instance = $obj->build($instanceName);\n\t\t\t$result = $instance->val1;\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$this->assertEquals($confVal, $result);\n\t\t\t$this->assertEquals($instance->val2, 5);\n\t\t}", "public function testConstruct() {\n\n $this->assertEquals(63, ArgumentInterface::TYPE_ARRAY);\n $this->assertEquals(64, ArgumentInterface::TYPE_BOOLEAN);\n $this->assertEquals(30, ArgumentInterface::TYPE_DATE);\n $this->assertEquals(59, ArgumentInterface::TYPE_DOUBLE);\n $this->assertEquals(54, ArgumentInterface::TYPE_FLOAT);\n $this->assertEquals(78, ArgumentInterface::TYPE_INTEGER);\n $this->assertEquals(73, ArgumentInterface::TYPE_NUMBER);\n $this->assertEquals(55, ArgumentInterface::TYPE_OBJECT);\n $this->assertEquals(104, ArgumentInterface::TYPE_RESOURCE);\n $this->assertEquals(87, ArgumentInterface::TYPE_STRING);\n $this->assertEquals(116, ArgumentInterface::TYPE_TIMESTAMP);\n }", "public function testConstructor()\n {\n $color = new ConsoleColor();\n // Ensure that at least one style is already set so all branches get tested.\n $color->addTheme(Highlighter::TOKEN_DEFAULT, 'bg_light_red');\n\n $highlighter = new Highlighter($color);\n $themes = $color->getThemes();\n\n $this->assertNotEmpty($themes);\n $this->assertCount(7, $themes);\n }", "public function testCreateMyClass() {\n }", "public function __construct()\n {\n $this->rulesets = [\n // Exact values\n function ($value) {\n return is_string($value) && isset($this->exactReplacements[$value])\n ? [$this, 'replaceExactValue']\n : null;\n },\n\n // Router (MVC applications)\n // We do not want to rewrite these.\n function ($value, array $keys) {\n $key = array_pop($keys);\n // Only worried about a top-level \"router\" key.\n return $key === 'router' && $keys === [] && is_array($value)\n ? [$this, 'noopReplacement']\n : null;\n },\n\n // service- and pluginmanager handling\n function ($value) {\n return is_array($value) && array_intersect_key(self::SERVICE_MANAGER_KEYS_OF_INTEREST, $value) !== []\n ? [$this, 'replaceDependencyConfiguration']\n : null;\n },\n\n // Array values\n function ($value, array $keys) {\n return $keys !== [] && is_array($value)\n ? [$this, 'processConfig']\n : null;\n },\n ];\n }", "protected function setUp() {\t\t\r\n\t\t$this->object = new Expression();\r\n\t}", "public function __construct() {\n\n $this->inputmanager = new Validator();\n\n $this->config = $this->configuration();\n\n $this->validation = $this->validate(); \n\n }", "public function test_build_get_evaluated_primitive_args() {\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\n \\\"$instanceName\\\": {\n \\\"class\\\": \\\"$value\\\",\n \\\"args\\\": [\n 5\n ],\n \\\"evaluate\\\": {\n \\\"getValueSum\\\": [\n 5,\n 10\n ]\n }\n }\n}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$result = $obj->build($instanceName);\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$this->assertEquals(15, $result);\n\t\t}", "protected function setUp()\n {\n $this->object = new Children;\n }", "public function test___construct ( )\n {\n $subject = $this->getBuiltMock('Rx_Form_Abstract', array(\n 'setStandardDecorators', 'addPrefixPath', 'addElementPrefixPath'\n ));\n\n $subject->expects($this->once())->method('setStandardDecorators');\n $subject->expects($this->exactly(2))->method('addPrefixPath');\n $subject->expects($this->once())->method('addElementPrefixPath');\n\n $subject->__construct();\n\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance(['_getArgsForDefinition']);\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "public function __construct() {\n $this->analyzerURI = new AnalyzerURI();\n $this->analyzerInnerPath = new AnalyzerInnerPath();\n }", "public function testGetRules()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function setUp() {\n\n $this->oResolver= new reflection\\ResolverByReflection(new reflection\\resolveInterfaceByName\\ResolveInterfaceByNameFirstLetter());\n $aMap=array();\n $oL0ClassOne=&new layer0\\ClassOne(\" <b>Text Passed to The Instance created manually layer0->ClassOne</b>\");\n $aMap['layer2\\ClassOne']=&$oL0ClassOne;\n //$this->oResolverWithMap= new reflection\\ResolverByReflection(new reflection\\resolveInterfaceByName\\ResolveInterfaceByNameFirstLetter(),);\n\n }", "public function test__construct()\n {\n $obj = $this->_newStruct();\n $this->assertInstance($obj, 'Solar_Struct');\n }", "protected function construct(){\n\n }", "public function testValidatorSetConstructor()\n\t{\n\t\t$validatorSet = new ValidatorSet();\n\n\t\t$this->assertNotNull($validatorSet);\n\t}", "protected function setUp()\n {\n $this->object = new bison();\n }", "public function testInjectingDependenciesViaClassConstructor()\n {\n $translator = new Translator('path/to/languages/folder', 'fo');\n $this->assertEquals('path/to/languages/folder', $translator->getLangFilesPath());\n $this->assertEquals('fo', $translator->getLocale());\n }", "public function test_build_a_leaf_instance_with_alternate_naming() {\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae/std/LeafStub\";\n\t\t\t$json = \"{\\\"$instanceName\\\": {\\\"class\\\": \\\"$value\\\"}}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$instance = $obj->build($instanceName);\n\t\t\t$result = get_class($instance);\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$expected = \"aae\\\\std\\\\LeafStub\";\n\t\t\t$this->assertEquals($expected, $result);\n\t\t}", "public function testConstructor()\n {\n $renderer = $this->prophesize(TemplateRendererInterface::class);\n\n $errorHandler = new ErrorHandler($renderer->reveal());\n\n $this->assertAttributeInstanceOf(TemplateRendererInterface::class, 'templateRenderer', $errorHandler);\n }", "public function test_api_path_validation_ok_1()\n {\n new class() extends \\Kenashkov\\BillyDk\\BillyDk {\n public function __construct()\n {\n self::validate_api_path('/products');\n }\n };\n }", "public function testCreatePatrimonio()\n {\n }", "public function testCreateRuleGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testConstruct()\n {\n $data_from_collection = $this->data['monthly_collection'];\n $this->assertEquals(\n $data_from_collection['attributes']['plan_name'],\n $this->makePlan($data_from_collection)->get('plan_name')\n );\n\n $data_from_site = $this->data['monthly_site'];\n $this->assertEquals($data_from_site['name'], $this->makePlan($data_from_site)->get('name'));\n }", "public function testConstructor()\n {\n $param = new PythoPhant_Reflection_FunctionParam('string', 'myVar', 'array()');\n $this->assertEquals('string', $param->getType());\n $this->assertEquals('myVar', $param->getName());\n $this->assertAttributeEquals('array()', 'default', $param);\n }", "public function __construct(array $ruleSet)\n {\n $this->ruleSet = $ruleSet;\n }", "protected function setUp()\n {\n $this->index = new Index;\n $this->rule = new ComplementNaiveBayes('test');\n }", "public function testTrancheCanConstruct() : void\n {\n $this->assertInstanceOf('LendInvest\\Models\\Tranche', $this->tranche);\n }", "public function __construct()\n {\n $this->folderCreator = new FolderCreator();\n }", "protected function setUp()\n {\n $this->object = new StringExpr();\n }", "protected function setUp()\n\t{\n\t\t$this->object = new object('obj att');\n\n\t\t$this->sibling = new sibling('sibling att');\n\t\t$this->sibling2 = new sibling('sibling att2');\n\n\t\t$this->child = new child('child att');\n\t\t$this->child2 = new child('child att2');\n\n\t\t$this->parent_ = new parent_('parent_ att');\n\t}", "public function testConstruct()\n {\n $this->assertAttributeSame($this->doctrineRegistryMock, 'doctrineRegistry', $this->userFactory);\n $this->assertAttributeSame(User::class, 'userClass', $this->userFactory);\n $this->assertAttributeSame('username', 'usernameColumn', $this->userFactory);\n $this->assertAttributeSame($this->userRepositoryMock, 'userRepository', $this->userFactory);\n $this->assertAttributeSame($this->contactRepositoryMock, 'contactRepository', $this->userFactory);\n $this->assertAttributeSame($this->roleRepositoryMock, 'roleRepository', $this->userFactory);\n $this->assertAttributeSame($this->localizationManagerMock, 'localizationManager', $this->userFactory);\n $this->assertAttributeSame(array('uid' => 'username'), 'userPropertyMap', $this->userFactory);\n }", "public function test_build_call_setter_with_one_primitive_arg() {\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\\\"$instanceName\\\": {\\\"class\\\": \\\"$value\\\",\\\"setters\\\":[{\\\"setValue\\\":5}]}}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$instance = $obj->build($instanceName);\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$this->assertEquals(5, $instance->val1);\n\t\t}", "public function testRunRuleParser()\n {\n $rules = [\n 'var1' => 'alpha|between:min=10,max=100',\n 'var2' => 'email',\n 'var3' => 'alpha',\n ];\n $rulesBag = $this->ruleParse->run($rules);\n $this->assertInstanceOf(Sparta\\RulesBag::class, $rulesBag);\n $this->assertEquals($rulesBag, $this->ruleParse->getRulesBag());\n }", "public function testConstructor()\n {\n $services = [uniqid('key') => uniqid('val')];\n $cache = $this->createCacheContainer();\n $subject = $this->createInstance(['_setDataStore', '_setServiceCache']);\n $_subject = $this->reflect($subject);\n\n $subject->expects($this->exactly(1))\n ->method('_setDataStore')\n ->with($this->equalTo((object) $services));\n $subject->expects($this->exactly(1))\n ->method('_setServiceCache')\n ->with($cache);\n\n $subject->__construct($services, $cache);\n }", "public function __construct()\n {\n parent::__construct();\n $this->rulesBirth = array(0, 1, 2, 3, 4);\n $this->rulesStayAlive = array(0, 1, 2, 3);\n }", "abstract protected function construct($params);" ]
[ "0.70304364", "0.676181", "0.66080326", "0.6460071", "0.62236583", "0.62236583", "0.6215634", "0.6048498", "0.6047723", "0.59935254", "0.5992588", "0.5965784", "0.5893989", "0.5883927", "0.58747905", "0.5839561", "0.58342093", "0.5818476", "0.58051574", "0.5804716", "0.5781913", "0.5730605", "0.5718954", "0.56861526", "0.5643057", "0.56426156", "0.563094", "0.5630686", "0.5624739", "0.56069666", "0.56052715", "0.5589382", "0.5587244", "0.55838925", "0.55831265", "0.55815953", "0.55745757", "0.5544297", "0.5537957", "0.55320543", "0.55177414", "0.5507979", "0.5497033", "0.5480807", "0.5478496", "0.54697514", "0.5460673", "0.5457863", "0.54463583", "0.54396266", "0.5430463", "0.5416944", "0.5414607", "0.5412917", "0.5407167", "0.54047704", "0.54010105", "0.53990304", "0.53967685", "0.5395727", "0.5394504", "0.5385007", "0.5383483", "0.5372372", "0.53644603", "0.53600293", "0.53528976", "0.53408813", "0.53330904", "0.5330565", "0.5315048", "0.53147763", "0.5311172", "0.53097034", "0.5309696", "0.5307672", "0.5301461", "0.5280523", "0.52733696", "0.5269213", "0.5263845", "0.525761", "0.5253936", "0.5253347", "0.52446085", "0.52388936", "0.5238691", "0.5238174", "0.5236486", "0.52325654", "0.5218234", "0.52145535", "0.52120143", "0.5210554", "0.52059776", "0.5204586", "0.5202379", "0.5196436", "0.5193791", "0.5191312" ]
0.7122626
0
Test inversion of rule results with the NOT rule
public function testNotRule() { $rule = new NotRule(); $rule->addRule(new TrueRule()); $this->assertFalse($rule->validate()); $rule = $this->getRuleBuilder()->fromArray(array( 'false', ), 'not'); $this->assertTrue($rule->validate()); try { $rule = $this->getRuleBuilder()->fromArray(array( 'false', 'true', ), 'not'); } catch (\RuntimeException $e) { $rule = null; } $this->assertNull($rule); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lola_check_all_transitions_negated($check_name, $formula) {\n global $petrinet;\n foreach ($petrinet[\"transitions\"] as $transition) {\n $ret = lola_check_single_transition($check_name, $formula, $transition[\"id\"]);\n if ($ret->result) {\n debug(\"Single negated transition check \" . $check_name . \" for transition \" . $transition[\"id\"] . \" succeeded, returning false\");\n return new CheckResult(false, $ret->witness_path, $ret->witness_state);\n }\n }\n return new CheckResult(true, \"\", \"\");\n }", "public function negate()\n\t{\n\t\t$this->not_in = !$this->not_in;\n\t}", "function yy_r147(){ $this->_retvalue = new Stmt\\Expr('not', $this->yystack[$this->yyidx + 0]->minor); }", "public function shouldNotEqual($expected) {}", "function mNOT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$NOT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:111:3: ( 'not' ) \n // Tokenizer11.g:112:3: 'not' \n {\n $this->matchString(\"not\"); \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 shouldBeSkipped();", "public function shouldNotBe($expected) {}", "public function isIgnored(): bool;", "public function testXorRule()\n {\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'true',\n 'false'\n ), 'xor');\n $this->assertTrue($rule->validate());\n\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'false'\n ), 'xor');\n $this->assertFalse($rule->validate());\n\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'true',\n 'true'\n ), 'xor');\n $this->assertFalse($rule->validate());\n }", "public function shouldNotReturn($expected) {}", "function variant_not($variant) {}", "public function negate()\n\t{\n\t\tif($this->sWhere == '')\n\t\t{\n\t\t\t$this->sWhere = 'FALSE';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->sWhere = 'NOT (' . $this->sWhere . ')';\n\t\t}\n\t}", "public function globalVarConditionMatchesOnNotEqualExpression() {}", "public function globalVarConditionMatchesOnNotEqualExpression() {}", "function testIfnotWithoutRegex(){\n\t\t\n\t\t(new Param('email'))->filters()->ifnot('@', 'Email address should contain a @');\n\n\t\t$error = Param::get('email')->process(['email'=>'myemail.domain.com'])->error;\n\n\t\t$this->assertContains('should', $error);\n\n\t}", "public function negate(): self;", "public function isNot($model);", "function mNOT_EQUAL(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$NOT_EQUAL;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:713:3: ( '!=' ) \n // Tokenizer11.g:714: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 }", "abstract public function testInactiveExpression();", "protected function isUnchanged() {}", "public function testPassingCaseNoReturn(): void\n {\n $constraint = new DoctrineUnitOfWorkEmpty();\n $unitOfWork = new UnitOfWorkStub();\n\n $result = $constraint->evaluate($unitOfWork, '', false);\n\n self::assertTrue($result);\n }", "public function testIsFailure()\n\t{\n\t\t/* default value of a filter is false */\n\t\t$this->assertFalse($this->filter->isFailure());\n\t}", "public function testNonExistingFieldFlag()\n {\n $configNonExistingFieldReturnFalse = json_decode(sprintf(\n $this->regexpConfigStub,\n '/Beer/',\n 'noHaveLaa',\n 'false'\n ), true);\n\n $configNonExistingFieldReturnTrue = json_decode(sprintf(\n $this->regexpConfigStub,\n '/Beer/',\n 'noHaveLaa',\n 'true'\n ), true);\n\n $nonExistingFieldReturnFalseFilter = new Regexp($configNonExistingFieldReturnFalse);\n $nonExistingFieldReturnTrueFilter = new Regexp($configNonExistingFieldReturnTrue);\n\n $this->assertFalse($nonExistingFieldReturnFalseFilter->accept($this->logEvent));\n $this->assertTrue($nonExistingFieldReturnTrueFilter->accept($this->logEvent));\n }", "function o_ne($a, $b) {\n\t\t\treturn Obj::singleton()->notEqual($a, $b);\n\t\t}", "public function simulateDisabledMatchAllConditionsFailsOnFaultyExpression() {}", "public function simulateDisabledMatchAllConditionsFailsOnFaultyExpression() {}", "public function globalVarConditionDoesNotMatchOnNotEqualExpression() {}", "public function globalVarConditionDoesNotMatchOnNotEqualExpression() {}", "public function negate()\n {\n $this->_not = true;\n return $this;\n }", "public function testIsEvenPassNegativeODD()\n {\n \t$this->assertFalse(isEven(-5));\n }", "public function isNotUsing();", "public function shouldNotBeEqualTo($expected) {}", "public function isNot()\n {\n return $this->not;\n }", "public function isNot()\n {\n return $this->not;\n }", "public function validarLogicasNegocio($operacion){\n return;\n }", "public function validarLogicasNegocio($operacion){\n return;\n }", "public function TestFilterUserByStatusFalse()\n {\n $expected = $this->usersFilter->filterByStatus(\"authorized\",\"decline\");\n $this->assertFalse($expected);\n }", "public function isNotOk()\n {\n return ! $this->isOk();\n }", "function yy_r149(){$this->_retvalue = ' XOR '; }", "public function invert();", "public function hasDifference() {return !!$this->_calculateDifference();}", "static function logicalNot(PHPUnit_Framework_Constraint $constraint)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalNot', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "function not($predicate) : \\Closure\n{\n $predicate = predicate($predicate);\n return function (...$arguments) use ($predicate) {\n return !$predicate(...$arguments);\n };\n}", "public function isnot($input, $args) {\n $args = $this->getArgs($args);\n if (isset($args['value'])) {\n $this->setCondition(($input != $args['value']));\n }\n }", "function testIfnot(){\n\t\t#mdx:ifnot\n\t\tParam::get('date')->filters()->ifnot('/^\\d{4}-\\d{2}-\\d{2}$/','Date is expected to be in the format yyyy-mm-dd');\n\t\t$error = Param::get('date')->process(['date'=>'10/12/1992'])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains('yyyy', $error);\n\n\t}", "function negate() {\n static $negate = false;\n $negate = $negate ?: curry(function($x){\n return -$x;\n });\n return _apply($negate, func_get_args());\n}", "public function isInvertible(): bool\n {\n if (!array_key_exists(__METHOD__, $this->cache)) {\n $this->cache[__METHOD__] = $this->determinant() != 0.0;\n }\n return $this->cache[__METHOD__];\n }", "public function expressionListWithNotInIsConcatenatedWithAnd() {}", "public function testAssertNotEqualsWithDelta() {\n\t\tself::assertNotEqualsWithDelta( 2.3, 3.5, 0.5 );\n\t}", "public function not() {\n\t\t$this->not = '!';\n\t\treturn $this;\n\t}", "#[@test]\n public function withoutExpression() {\n $this->assertEquals(array(new TernaryNode(array(\n 'condition' => new VariableNode('i'),\n 'expression' => NULL,\n 'conditional' => new IntegerNode('2'),\n ))), $this->parse('\n $i ?: 2;\n '));\n }", "public function setNe($x) { $this->ne = $x; }", "public function fails() {\n return ! $this->passes();\n }", "public function TestFilterUserByBalanceFalse()\n {\n $expected = $this->usersFilter->filterByBalance(\"100\",\"280\",'320');\n $this->assertFalse($expected);\n }", "public function notEqualTo($value);", "public function fails()\n {\n return ! $this->passed;\n }", "public function testValidateRuleWhenEvaluationPass()\n {\n $value = 1;\n $validator = new Validator();\n $rule = $this->getMockRuleReturnFalse();\n $result = $validator->validate($value, $rule);\n $this->assertFalse($result);\n }", "public function should_not_be($expected = null)\n {\n $this->negated = true;\n return $this->should_be($expected);\n }", "public function logicalNot($constraint)\n {\n return $this->qomFactory->not($constraint);\n }", "function opposite()\n\t\t{\n\t\t\t$res = new Vector(array('dest' => new Vertex(array(\n\t\t\t\t'x' => -$this->_x,\n\t\t\t\t'y' => -$this->_y,\n\t\t\t\t'z' => -$this->_z\n\t\t\t))));\n\t\t\treturn ($res);\n\t\t}", "public function shouldNotBeLike($expected) {}", "public static function isNotIdentical($expected)\n {\n return self::logicalNot(self::isIdentical($expected));\n }", "public function testHasViolations_withNoViolations_isFalse() {\n $this->assertFalse($this->report->hasViolations());\n }", "public function testMaintenanceModeFalse()\n {\n $lock = $this->util->getMaintenanceLock();\n $lock->unlock();\n\n $result = $this->object->reverseMaintenanceMonitor();\n $this->assertTrue($result);\n }", "public function globalVarConditionMatchesOnNotEqualExpressionWithMultipleValues() {}", "public function globalVarConditionMatchesOnNotEqualExpressionWithMultipleValues() {}", "protected function _expressionNot($operation, $class, $method) {\n $this->_emitter->emit('!');\n $this->_processExpression($operation['left'], $class, $method);\n }", "protected function _expressionNot($operation, $class, $method) {\n $this->_emitter->emit_operator('!');\n $this->_processExpression($operation['left'], $class, $method);\n }", "function dry() {\n\t\treturn !$this->item;\n\t}", "public function test_isOverDrive_isNotOverDrive_returnFalse()\r\n\t{\r\n\t\t$this->service->source = \"aNonDummyOverDriveRecord\";\r\n\t\t$actual = $this->service->isOverDrive();\r\n\t\t$this->assertFalse($actual);\r\n\t}", "public function ruleMatchingPositiveWithoutRedirect()\n {\n $urlString = 'http://example.tld/foo/bar';\n $targetUrl = '/customer/account/login';\n\n // --- Scope Config\n $scopeConfig = $this->getScopeConfig();\n $scopeConfig->expects($this->once())\n ->method('getValue')\n ->with(\n LoginCheckInterface::MODULE_CONFIG_TARGET,\n ScopeInterface::SCOPE_STORE\n )\n ->willReturn($targetUrl);\n\n // --- StoreManager\n $storeManager = $this->getStoreManager();\n $storeManager->expects($this->never())\n ->method('getStore');\n\n // --- Context\n $url = $this->getUrl();\n $url->expects($this->once())\n ->method('getCurrentUrl')\n ->willReturn($urlString);\n\n $request = $this->getRequest();\n $request->expects($this->once())\n ->method('isPost')\n ->willReturn(false);\n\n $context = $this->getContext();\n $context->expects($this->once())\n ->method('getUrl')\n ->willReturn($url);\n $context->expects($this->once())\n ->method('getRequest')\n ->willReturn($request);\n\n // --- Response\n $responseHttp = $this->getResponseHttp();\n $responseHttp->expects($this->never())\n ->method('setNoCacheHeaders');\n $responseHttp->expects($this->never())\n ->method('setRedirect');\n $responseHttp->expects($this->never())\n ->method('sendResponse');\n\n // --- Whitelist Entries\n $whitelistEntityOne = $this->getMockBuilder(WhitelistEntry::class)\n ->disableOriginalConstructor()\n ->getMock();\n $whitelistEntityOne->expects($this->once())\n ->method('getStrategy')\n ->willReturn('default');\n $whitelistCollection = $this\n ->getMockBuilder(Collection::class)\n ->disableOriginalConstructor()\n ->getMock();\n $whitelistCollection->expects($this->once())\n ->method('getItems')\n ->willReturn([$whitelistEntityOne]);\n $whitelistRepository = $this->getWhitelistRepository();\n $whitelistRepository->expects($this->once())\n ->method('getCollection')\n ->willReturn($whitelistCollection);\n\n // --- Strategy\n $strategy = $this->createMock(StrategyInterface::class);\n $strategy->expects($this->once())\n ->method('isMatch')\n ->with('/foo/bar', $whitelistEntityOne)\n ->willReturn(true);\n\n $strategyManager = $this->getStrategyManager();\n $strategyManager->expects($this->once())\n ->method('get')\n ->with('default')\n ->willReturn($strategy);\n\n $loginCheck = new LoginCheck(\n $context,\n $this->getCustomerSession(),\n $this->getSession(),\n $storeManager,\n $scopeConfig,\n $whitelistRepository,\n $strategyManager,\n $this->getModuleCheck(),\n $responseHttp,\n $this->getPasswordResetHelper()\n );\n\n $loginCheck->execute();\n }", "private function isInverseMatch(): bool\n {\n return is_int($this->min) and is_int($this->max) and ($this->min > $this->max);\n }", "public function testIsValidFailOnRules()\n\t{\n\t\t/**\n\t\t * We don't ever expect the Blackbox_Data object to have a value set or unset inside of\n\t\t * Blackbox.\n\t\t */\n\t\t$data = $this->getMock('Blackbox_Data', array());\n\t\t$data->expects($this->never())->method('__set');\n\t\t$data->expects($this->never())->method('__unset');\n\n\t\t$rules = $this->getMock('Blackbox_StandardRule', array('isValid', 'runRule'));\n\t\t$rules->expects($this->once())->method('isValid')->will($this->returnValue(FALSE));\n\n\t\t$this->target->setRules($rules);\n\t\t$valid = $this->target->isValid($data, $this->state_data);\n\n\t\t$this->assertFalse($valid);\n\t}", "public function addNoResultsCheck()\n {\n $this->isResultCheck = false;\n return $this;\n }", "function check_excl_list($matches)\r\r\n {\r\r\n\r\r\n $check_allowed = $matches[2];\r\r\n\r\r\n $this->debug_info('Checking link \"' . $check_allowed . '\" VS exclusion list {' . var_export($this->options['exclude_links_'], 1) . '}');\r\r\n foreach ($this->options['exclude_links_'] as $val)\r\r\n if (stripos($check_allowed, $val) === 0) {\r\r\n $this->debug_info('In exclusion list (' . $val . '), not masking...');\r\r\n return $matches[0];\r\r\n }\r\r\n $this->debug_info('Not in exclusion list, masking...');\r\r\n return false;\r\r\n }", "public function isDeclined(): bool;", "public function testRuleAppliesTwiceToClassWithNotImportedDependencies()\n {\n $rule = $this->getRule();\n $rule->setReport($this->getReportMock(2));\n $rule->apply($this->getMethod());\n }", "public function testIsEvenPassNegativeEVEN()\n {\n \t$this->assertTrue(isEven(-4));\n }", "public function passes();", "public function testSkipIfTrue(): void\n {\n $this->skipIf(true);\n }", "public function negate() : self\n {\n $b = [];\n\n foreach ($this->a as $rowA) {\n $rowB = [];\n\n foreach ($rowA as $valueA) {\n $rowB[] = -$valueA;\n }\n\n $b[] = $rowB;\n }\n\n return self::quick($b);\n }", "function variant_neg($variant) {}", "public function validarLogicasNegocio($operacion){\n\t\t//print_r($this);die();\n\t\tif($this->esEquipamientoDeAlquiler['valor'] == '1'){\n\t\t\t$this->equipamientoDeAlquiler['obligatorio'] = TRUE;\n\t\t}else{\n\t\t\t$this->equipamientoDeAlquiler['obligatorio'] = FALSE;\n\t\t\t$this->equipamientoDeAlquiler['valor'] = null;\n\t\t}\n return $resultMessage;\n \t}", "abstract public function NonQuery($sql, $blnWarnNoChanges);", "public function assertFalse($check) {\r\n\t\t\r\n\t\tTestSuite::assertFalse($check);\r\n\t\t\r\n\t}", "public function doesNotEqual($value)\n {\n $this->operator = \"is_not_equal\";\n $this->value = $value;\n }", "function testFindWithoutResult() {\r\n $this->assertNull(\r\n \t$this->actionForwards->find(\"wrongKey\"), \"Found an forward where no one is expected!\"\r\n );\r\n }", "public function testisEvenNumberFail()\n {\n $result = $this->calculator->isEvenNumber(3);\n $this->assertFalse($result);\n }", "function testDoNotValidateReturnsInsteadOfValidates() {\n\t\t$TestNumberField = new TestNumberField();\n\t\t$_POST = array(\n\t\t\t'post_ID' => 1,\n\t\t\t'field_one' => 2,\n\t\t);\n\t\t$actual = array();\n\n\t\t// act\n\t\t$TestNumberField->fields['field_one']['do_not_validate'] = true;\n\t\t$TestNumberField->validate($_POST['post_ID'], $TestNumberField->fields['field_one'], $actual );\n\n\t\t// assert\n\t\t$this->assertTrue(empty($actual));\n\t}", "public function testNoFalsePositives()\n {\n $file = $this->sniffFile(__FILE__, '7.4');\n\n // No errors expected on the first 18 lines.\n for ($line = 1; $line <= 18; $line++) {\n $this->assertNoViolation($file, $line);\n }\n }", "public function validarLogicasNegocio($operacion){\n return $resultMessage;\n \t}", "public function testAssertNotEqualsCanonicalizing() {\n\t\t$this->assertNotEqualsCanonicalizing( [ 3, 2, 1 ], [ 2, 3, 4 ] );\n\t}", "public function fails()\n {\n return !$this->passes();\n }", "public function skipCriteria( $status = TRUE );", "function testSearchByCustomFieldWithNegation() {\n\t\t$this->setUrl('/search/advanced?r=per&q[per_900][op]=IS+NOT&q[per_900][value]=100');\n\t\t$this->app->go();\n\t\t$this->assertFalse(Flash::Instance()->hasErrors());\n\t\t$this->assertPattern('/id=\"qb_per_900\"/', $this->view->output);\n\t\t$this->assertPattern('/<th>Favourite Colour<\\/th>/', $this->view->output);\n\t\t$this->assertPattern('/<td>Blue<\\/td>/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('David Edwards', 'Greg Jones', 'Bob Smith'));\n\t}", "public function validarLogicasNegocio($operacion){\n return $resultMessage;\n }", "function negate() { # :: Num -> Num\n return -$this->value;\n }", "public function testValidateFalse(): void\n {\n $this->assertFalse($this->validate(false));\n }", "public function _isNot($model)\n {\n return ! $this->_is($model);\n }", "function mNOT_SIGN(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$NOT_SIGN;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:668:3: ( '!' ) \n // Tokenizer11.g:669:3: '!' \n {\n $this->matchChar(33); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }" ]
[ "0.66278315", "0.6223093", "0.6064134", "0.57122105", "0.5702052", "0.5674904", "0.55687404", "0.555494", "0.5550307", "0.5500415", "0.54908234", "0.54851496", "0.54568493", "0.5456521", "0.54147285", "0.53749377", "0.53638357", "0.5358693", "0.53454846", "0.5335941", "0.53202313", "0.5295176", "0.5286246", "0.5281563", "0.5278595", "0.5278485", "0.5276601", "0.5276601", "0.52586615", "0.52544135", "0.52510107", "0.52363175", "0.5212632", "0.5212632", "0.5210294", "0.5210294", "0.516259", "0.51623815", "0.51591873", "0.511835", "0.50979", "0.5090921", "0.5056079", "0.5047751", "0.5045636", "0.504108", "0.504017", "0.5038558", "0.5027249", "0.5024401", "0.501838", "0.50124246", "0.5007308", "0.50050354", "0.49958092", "0.4989032", "0.49864486", "0.49855894", "0.49842715", "0.4983796", "0.49783373", "0.49726802", "0.4970843", "0.49677995", "0.4958535", "0.49583733", "0.4946632", "0.4938915", "0.49215057", "0.49097624", "0.49069512", "0.49022034", "0.48944154", "0.48936012", "0.48875567", "0.48820943", "0.48785648", "0.48781195", "0.48755556", "0.4871054", "0.48594248", "0.48587266", "0.48564613", "0.48559943", "0.48527202", "0.48463318", "0.4844694", "0.4844133", "0.4840409", "0.48273185", "0.48262697", "0.48131517", "0.4811675", "0.48052338", "0.47999713", "0.47898236", "0.4785069", "0.47806385", "0.47789901", "0.4762222" ]
0.64131546
1
Test logical OR rule container
public function testOrRule() { $rule = $this->getRuleBuilder()->fromArray(array( 'false', 'true' ), 'or'); $this->assertTrue($rule->validate()); $rule = $this->getRuleBuilder()->fromArray(array( 'false', 'false' ), 'or'); $this->assertFalse($rule->validate()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isOr();", "static function logicalOr()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalOr', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "protected static function logicalOR(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('OR', $values);\n\t}", "public static function logicalOr(Matcher $matcher /*...*/)\n {\n return new Matcher\\LogicalOr(func_get_args());\n }", "public function testOrCondition() {\n\t\t$products = $this->productsManager->find(Q::orfilter(Attr::id()->eq(5), Attr::id()->eq(3)));\n\t\t$this->assertCount(2, $products);\n\t}", "public function containsOr()\n\t{\n\t\t$args = (new static(func_get_args()))->flattenIt();\n\n\t\t$found = $args->detect(function($value) {\n\t\t\treturn in_array($value, $this->attributes);\n\t\t});\n\n\t\treturn !is_null($found);\n\t}", "function yy_r146(){ $this->_retvalue = new Stmt\\Expr('or', $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); }", "function variant_or($left, $right) {}", "public function useOr()\n {\n $this->imploder = ' OR ';\n }", "public function orWhereComplex()\n {\n return $this->addComplexCondition('or', $this->conditions);\n }", "function orB($lhs = null, $rhs = null)\n{\n return call_user_func_array(__PRIVATE__::$instance[orB], func_get_args());\n}", "public function conditionalOrExpression(){\n try {\n // Sparql11query.g:382:3: ( conditionalAndExpression ( OR conditionalAndExpression )* ) \n // Sparql11query.g:383:3: conditionalAndExpression ( OR conditionalAndExpression )* \n {\n $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1301);\n $this->conditionalAndExpression();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:383:28: ( OR conditionalAndExpression )* \n //loop48:\n do {\n $alt48=2;\n $LA48_0 = $this->input->LA(1);\n\n if ( ($LA48_0==$this->getToken('OR')) ) {\n $alt48=1;\n }\n\n\n switch ($alt48) {\n \tcase 1 :\n \t // Sparql11query.g:383:29: OR conditionalAndExpression \n \t {\n \t $this->match($this->input,$this->getToken('OR'),self::$FOLLOW_OR_in_conditionalOrExpression1304); \n \t $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1306);\n \t $this->conditionalAndExpression();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop48;\n }\n } while (true);\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 function orFlag($or = null)\n {\n if(null === $or)\n {\n return $this->property('or');\n }\n return $this->property('or', (bool) $or);\n }", "public static function or_() {\n $result = new qti_variable('single', 'boolean', array('value' => false));\r\n $params = func_get_args();\n // Allow a single array as well as a parameter list\r\n if (count($params) == 1 && is_array($params[0])) {\r\n $params = $params[0];\r\n }\r\n foreach($params as $param) {\r\n if ($param->value) {\r\n $result->value = true;\r\n return $result;\r\n }\r\n }\r\n return $result;\n }", "public static function static_logicalOr($a = null, $b = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function testConstructorLength()\n {\n $rule = new OrRule(\n new FalseRule(),\n new TrueRule()\n );\n $this->assertTrue($rule->validate());\n }", "public function testBuildWhereWithOrComplex()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->whereOr(\n $this->getQuery()\n ->where('is_admin', 1)\n ->where(\n $this->getQuery()\n ->where('is_super_admin', 1)\n ->where('can_be_super_admin', 1)\n )\n )\n ;\n\n $this->assertSame(\n \"WHERE table1.id = '100' AND (is_admin = '1' OR (is_super_admin = '1' AND can_be_super_admin = '1'))\",\n $query->buildWhere()\n );\n }", "public function testBuildWhereWithOr()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->whereOr(\n $this->getQuery()\n ->where('is_admin', 1)\n ->where('is_super_admin', 1)\n )\n ;\n\n $this->assertSame(\n \"WHERE table1.id = '100' AND (is_admin = '1' OR is_super_admin = '1')\",\n $query->buildWhere()\n );\n }", "public function orWhere($operand, $operatorOrValue=null, $value=null);", "public function orConditions($data = array()) {\r\n $filter = $data['filter'];\r\n $condition = array(\r\n 'OR' => array(\r\n $this->alias . '.title LIKE' => '%' . $filter . '%',\r\n $this->alias . '.body LIKE' => '%' . $filter . '%',\r\n )\r\n );\r\n return $condition;\r\n }", "public function processOrCombination($collection, $conditions)\n {\n $fieldsConditions = [];\n $multiFieldsConditions = [];\n foreach ($conditions as $condition) {\n $attribute = $condition['attribute'];\n $cond = $condition['conditions'];\n $value = $condition['cvalue'];\n\n //ignore condition if value is null or empty\n if ($value == '' || $value == null) {\n continue;\n }\n\n if ($this->ruleType == self::REVIEW && isset($this->attributeMapForQuote[$attribute])) {\n $attribute = $this->attributeMapForOrder[$attribute];\n } elseif ($this->ruleType == self::ABANDONED && isset($this->attributeMapForOrder[$attribute])) {\n $attribute = $this->attributeMapForQuote[$attribute];\n } else {\n $this->productAttribute[] = $condition;\n continue;\n }\n\n if ($cond == 'null') {\n if ($value == '1') {\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = ['notnull' => true];\n continue;\n }\n $fieldsConditions[$attribute] = ['notnull' => true];\n } elseif ($value == '0') {\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = [$cond => true];\n continue;\n }\n $fieldsConditions[$attribute] = [$cond => true];\n }\n } else {\n if ($cond == 'like' || $cond == 'nlike') {\n $value = '%' . $value . '%';\n }\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = [$this->conditionMap[$cond] => $value];\n continue;\n }\n $fieldsConditions[$attribute]\n = [$this->conditionMap[$cond] => $value];\n }\n }\n /**\n * All rule conditions are combined into an array to yield an OR when passed\n * to `addFieldToFilter`. The exception is any 'like' or 'nlike' conditions,\n * which must be added as separate filters in order to have the AND logic.\n */\n if (!empty($fieldsConditions)) {\n $column = $cond = [];\n foreach ($fieldsConditions as $key => $fieldsCondition) {\n $type = key($fieldsCondition);\n if ($type == 'like' || $type == 'nlike') {\n $collection->addFieldToFilter(\n (string) $key,\n $fieldsCondition\n );\n } else {\n $column[] = (string) $key;\n $cond[] = $fieldsCondition;\n }\n if (!empty($multiFieldsConditions[$key])) {\n foreach ($multiFieldsConditions[$key] as $multiFieldsCondition) {\n $type = key($multiFieldsCondition);\n if ($type == 'like' || $type == 'nlike') {\n $collection->addFieldToFilter(\n (string) $key,\n $multiFieldsCondition\n );\n } else {\n $column[] = (string) $key;\n $cond[] = $multiFieldsCondition;\n }\n }\n }\n }\n if (!empty($column) && !empty($cond)) {\n $collection->addFieldToFilter(\n $column,\n $cond\n );\n }\n }\n return $this->processProductAttributes($collection);\n }", "public function testBuildWhereOnlyOr()\n {\n $query = $this->getQuery()\n ->whereOr(\n $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->where('is_admin', 1)\n )\n ;\n\n $this->assertSame(\n \"WHERE (table1.id = '100' OR table1.is_admin = '1')\",\n $query->buildWhere()\n );\n }", "public function orWhere($field, $operator, $value);", "public static function buildOr(array $criteria)\n {\n return new LogicalOr($criteria);\n }", "public function or()\n {\n $this->logicQueue = 'or';\n\n return $this;\n }", "public function createOr()\n {\n $o = new OrSelector();\n $this->appendSelector($o);\n\n return $o;\n }", "public function hasOrWhere()\n {\n return $this->_has('_orWhere');\n }", "public function orWhere()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n return $this->addOrWhereStack([$field => $value]);\n }", "public function testOrGroup() {\n $qry = new Query('comment');\n $qry->beginOr()\n ->addWhere('parentID', 1)\n ->addWhere('count', 0)\n ->end();\n\n $rows = $qry->exec(self::$db)->fetchAll();\n $this->assertEquals([1, 2, 3], array_column($rows, 'id'));\n }", "abstract public function getOrElse($else);", "public function orWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function testlOrSingleImpl()\n {\n $this->q->select( '*' )->from( 'query_test' )\n ->where( $this->e->lOr( $this->e->eq( 1, 1 ) ) );\n $stmt = $this->db->query( $this->q->getQuery() );\n $rows = 0;\n foreach ( $stmt as $row )\n {\n $rows++;\n }\n $this->assertEquals( 4, $rows );\n }", "public function whereOr($value) {\n\t$this->parseQuery->where('$or', $value);\n }", "public function testConstructorContainer()\n {\n $rule = new AndRule(\n new TrueRule(),\n new OrRule(\n new FalseRule(),\n new TrueRule()\n ),\n new NotRule(\n new FalseRule()\n )\n );\n $this->assertTrue($rule->validate());\n }", "function OrWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "public function whereOR()\n {\n $this->where_clause .= \" OR \";\n }", "public function orWhere($column, $operator = null, $value = null);", "public function testXorRule()\n {\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'true',\n 'false'\n ), 'xor');\n $this->assertTrue($rule->validate());\n\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'false'\n ), 'xor');\n $this->assertFalse($rule->validate());\n\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'true',\n 'true'\n ), 'xor');\n $this->assertFalse($rule->validate());\n }", "function or_where($key, $value = NULL, $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_where($key, $value, 'OR ', $escape);\r\n\t}", "public function orElse($alternative);", "public function orWhere(){\r\n\t\t$tb = call_user_func_array(array($this->mask(), 'orWhere'), func_get_args());\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function orWhere(...$args)\n {\n $this->addCondition('or', $args, $this->conditions);\n return $this;\n }", "function or_like($field, $match = '', $side = 'both')\r\n\t{\r\n\t\treturn $this->_like($field, $match, 'OR ', $side);\r\n\t}", "protected function _match()\n {\n // SMART/TNT\n $smart = $this->_smart();\n if( $this->name == 'smart' ) return in_array($this->args, $smart) ? true : false;\n // GLOBE/TM\n $globe = $this->_globe();\n if( $this->name == 'globe' ) return in_array($this->args, $globe) ? true : false;\n // SUN\n $sun = $this->_sun();\n if( $this->name == 'sun' ) return in_array($this->args, $sun) ? true : false;\n }", "public function orWhere(Array $restraints){\r\n $subclause = $this->where->addClause(\"or\");\r\n foreach($restraints as $rest){\r\n $this->__where_restraint($rest, $subclause);\r\n }\r\n return $this;\r\n }", "public function orBracketOpen()\n {\n return $this->bracketOpen('', 'OR ');\n }", "public function lOr(\n ComponentSpecification $specification1,\n ComponentSpecification $specification2\n ) : Specification\\OrSpecification {\n $args = func_get_args();\n $andSpec = new \\ReflectionClass('\\\\ElementTree\\\\Specification\\\\OrSpecification');\n\n return $andSpec->newInstanceArgs($args);\n }", "public function testOrWhere()\n {\n $query = (new WhereBuilder($this->mockConnection))->orWhere('field', 'op', 1);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'op',\n 'value' => 1,\n 'boolean' => 'or',\n ]\n ]\n ], $array);\n }", "public function orWhere() {\r\n\t\t$args = func_get_args();\r\n\t\tif (count($this->_wheres)) {\r\n\t\t\t$criteria = call_user_func_array(array($this->_wheres[count($this->_wheres)- 1], 'orWhere'), $args);\r\n\t\t} else {\r\n\t\t\t$statement = array_shift($args);\r\n\t\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t\t$this->_wheres[] = $criteria;\r\n\t\t}\r\n\t\treturn $criteria;\r\n\t}", "public function whereOrObject($objects) {\r\n\t\t$this->addWhereObject('OR', $objects);\r\n\t}", "public function or_where($key, $char = NULL)\r\n {\r\n return $this->_where($key, $char, 'OR ');\r\n }", "public function two()\n {\n $mockCriterionOne = $this->getMock('stubCriterion');\n $mockCriterionOne->expects($this->once())->method('toSQL')->will($this->returnValue('foo'));\n $this->assertSame($this->orCriterion, $this->orCriterion->addCriterion($mockCriterionOne));\n $mockCriterionTwo = $this->getMock('stubCriterion');\n $mockCriterionTwo->expects($this->once())->method('toSQL')->will($this->returnValue('bar'));\n $this->assertSame($this->orCriterion, $this->orCriterion->addCriterion($mockCriterionTwo));\n $this->assertTrue($this->orCriterion->hasCriterion());\n $this->assertEquals('(foo OR bar)', $this->orCriterion->toSQL());\n }", "protected function allowedLogicalOperators(): array\n {\n return [\n FieldCriteria::AND,\n FieldCriteria::OR,\n ];\n }", "public function orWhere($table,$column,$data = \"\");", "public function testItAppliesSecurityRulesANDORCombinedRed(): void\n {\n $request = (new ServerRequest('get', '/products'))\n ->withQueryParams(['server_token1' => 'key value']);\n\n $this->expectException(InvalidSecurity::class);\n $this->expectExceptionMessage('None of security schemas did match for Request [get /products]');\n\n $validator = (new ValidatorBuilder())->fromYaml($this->specSecurityANDORCombined)\n ->getServerRequestValidator();\n $validator->validate($request);\n }", "protected function _testAgainstConditionBlock(array $data)\n\t{\n\t\tforeach ($this->_conditionsBlock as $key => $modes) {\n\t\t\t\n\t\t\t// We don't test value if value is not setted (but we should)\n\t\t\tif (! isset($data[$key])) continue;\n\t\t\t\n\t\t\tforeach ($modes as $mode => $patterns) {\n\n\t\t\t\t/* condition status, needed for OR mode */\n\t\t\t\t$status = false;\n\t\t\t\t\n\t\t\t\tforeach ($patterns as $pattern) {\n\t\t\t\t\t\n\t\t\t\t\t$result = preg_match(\"/\" . $pattern . \"/i\", $data[$key]);\n\t\t\t\t\t//printf('%d -> %s preg %s -> %s<br/>', $key, $data[$key], $pattern, $result);\n\t\t\t\t\t\n\t\t\t\t\t/* in AND mode, any no-match returns failure */\n\t\t\t\t\tif ($mode == Backend\\Condition::MODE_AND && $result == 0) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* in OR mode, one match is enough */\n\t\t\t\t\tif ($mode == Backend\\Condition::MODE_OR && $result != 0) {\n\n\t\t\t\t\t\t$status = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($status == false && $mode == Backend\\Condition::MODE_OR) {\n\t\t\t\t\t\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function orWhere()\n {\n if ( func_num_args() == 2 )\n {\n list($field, $value) = func_get_args();\n $op = '=';\n }\n else\n {\n list($field, $op, $value) = func_get_args();\n }\n $this->appendWhere('OR', $field, $op, $value); \n return $this;\n }", "public function orWhereAcf(...$args)\n {\n $this->addAcfCondition('or', $args, $this->conditions);\n return $this;\n }", "function testDoesMatchingWithConditionsFunction() {\n $rule = new Rule(\".+\", \"test.php\", \"\");\n $rule->addCondition(new Condition('%{SERVER_ADMIN}', '[email protected]', ''));\n $rule->addCondition(new Condition('%{SERVER_PORT}', '=1337', ''));\n $result = $rule->rewrite($this->_request);\n $this->assertEquals(HTRouter::STATUS_NO_MATCH, $result->rc);\n $this->assertEquals(\"foo\", $this->_request->getFilename());\n\n // Rule matches, since [email protected] is correct, and we need OR\n $rule = new Rule(\".+\", \"test.php\", \"\");\n $rule->addCondition(new Condition('%{SERVER_ADMIN}', '[email protected]', '[OR]'));\n $rule->addCondition(new Condition('%{SERVER_PORT}', '=1337', ''));\n $result = $rule->rewrite($this->_request);\n// $this->assertEquals(HTRouter::STATUS_OK, $result->rc);\n// $this->assertEquals(\"/test.php\", $this->_request->getFilename());\n\n // Rule matches, since both conditions are true\n $rule = new Rule(\".+\", \"test.php\", \"\");\n $rule->addCondition(new Condition('%{SERVER_ADMIN}', '[email protected]', ''));\n $rule->addCondition(new Condition('%{SERVER_PORT}', '=80', ''));\n $result = $rule->rewrite($this->_request);\n $this->assertEquals(HTRouter::STATUS_OK, $result->rc);\n $this->assertEquals(\"/test.php\", $this->_request->getFilename());\n }", "public function orWhere($prop, $value = PDODBNULL, $operator = '='){\r\n return $this->where($prop,$value,$operator,'OR');\r\n }", "public function havingOR()\n {\n $this->having .= \" OR \";\n }", "public function allowed_group_any()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t$result = FALSE;\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ($k === TRUE OR $k == 'y')\n\t\t\t{\n\t\t\t\t$result = TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public static function orOp($left, $right)\n {\n self::checkParameter($left, $right);\n $f = self::checkMathFunc('or');\n $bignumber = $f || self::operIsBig($left, $right);\n if($f) {\n return $f($left, $right);\n } elseif($bignumber) {\n $len = self::bitLen($left, $right);\n return self::strBitOp($left, $right, $len, function ($l, $r) {\n return $l | $r;\n });\n }\n return $left | $right;\n }", "public function orOn(array|string $column, string $op = null, array|string $value = null): void\n {\n if (func_num_args() === 2) {\n $value = $op;\n $op = '=';\n }\n\n $this->on[] = [$column, $op, $value, 'OR'];\n }", "public function canUseAnyOf() {\n\t\t$loader = new DummySchemaLoader();\n\t\t$loader->lower = '{\n\t\t\t\"type\":\"integer\",\n\t\t\t\"minimum\":2,\n\t\t\t\"maximum\":3\n\t\t}';\n\t\t$loader->upper = '{\n\t\t\t\"type\":\"integer\",\n\t\t\t\"minimum\":3,\n\t\t\t\"maximum\":4\n\t\t}';\n\t\t$loader->either = '{\n\t\t\t\"anyOf\":[\n\t\t\t\t{\"$ref\":\"lower\"},\n\t\t\t\t{\"$ref\":\"upper\"}\n\t\t\t]\n\t\t}';\n\n\t\t$this->sut = new JSONSchemaBuilder($loader);\n\t\t$schema = $this->sut->build('either');\n\n\t\t$this->assertFalse($schema->validate('object'));\n\t\t$this->assertFalse($schema->validate(3.5));\n\t\t$this->assertFalse($schema->validate(TRUE));\n\t\t$this->assertFalse($schema->validate(new \\stdClass()));\n\t\t$this->assertFalse($schema->validate(array('a'=>123)));\n\t\t$this->assertFalse($schema->validate(NULL));\n\n\t\t// Below both.\n\t\t$this->assertFalse($schema->validate(1));\n\t\t// Matches lower schema.\n\t\t$this->assertTrue($schema->validate(2));\n\t\t// Matches both.\n\t\t$this->assertTrue($schema->validate(3));\n\t\t// Matches upper.\n\t\t$this->assertTrue($schema->validate(4));\n\t\t// Above both.\n\t\t$this->assertFalse($schema->validate(5));\n\t}", "function or_where_in($key = NULL, $values = NULL)\r\n\t{\r\n\t \treturn $this->_where_in($key, $values, FALSE, 'OR ');\r\n\t}", "public function orWhere($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_where, Predicate::EITHER, $field, $op, $value);\n }", "private function mergeOrWhere(){\n $wheres = $this->orWheres;\n if (count($wheres) == 1)\n return $wheres[0];\n $whereString = \"\";\n foreach ($wheres as $where){\n $whereString .= $where.\" OR \";\n }\n return rtrim($whereString, \" OR \");\n }", "public function containsOperators() {\n\t\t$pattern = [];\n\t\tforeach ( $this->wildcardingOperators as $op ) {\n\t\t\t$pattern[] = \"\\\\$op\";\n\t\t}\n\t\t$pattern = \"/\" . implode( '|', $pattern ) . \"/\";\n\n\t\tif ( preg_match( $pattern, $this->original ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Special operators should not be removable by config\n\t\tif ( strpos( $this->original, 'AND' ) || strpos( $this->original, 'OR' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function orWhere($where)\n {\n $where = $this->getQueryPart('where');\n $args = func_get_args();\n\n if ($where instanceof Composite && $where->getType() === Composite::TYPE_OR) {\n $where->addMultiple($args);\n } else {\n array_unshift($args, $where);\n $where = new Composite(Composite::TYPE_OR, $args);\n }\n\n return $this->add('where', $where, true);\n }", "public abstract function isAllowed($operation);", "public function logicalOr($constraint1)\n {\n if (is_array($constraint1)) {\n $resultingConstraint = array_shift($constraint1);\n $constraints = $constraint1;\n } else {\n $constraints = func_get_args();\n $resultingConstraint = array_shift($constraints);\n }\n\n if ($resultingConstraint === null) {\n throw new InvalidNumberOfConstraintsException('There must be at least one constraint or a non-empty array of constraints given.', 1268056289);\n }\n\n foreach ($constraints as $constraint) {\n $resultingConstraint = $this->qomFactory->_or($resultingConstraint, $constraint);\n }\n return $resultingConstraint;\n }", "public static function logicalXor(Matcher $matcher /*...*/)\n {\n return new Matcher\\LogicalXor(func_get_args());\n }", "public function addWhereGroup(bool $or = true) : void;", "public function has_or_relation()\n {\n }", "static function _OR($params1, $params2){\n /* del parametro 1 separa el campo del valor */\n $params_1 = explode('=', $params1);\n $campo1 = trim($params_1[0]);\n $var1 = trim($params_1[1]);\n\n /* del parametro 2 separa el campo del valor */\n $params_2 = explode('=', $params2);\n $campo2 = trim($params_2[0]);\n $var2 = trim($params_2[1]);\n\n if($campo1 != $campo2)\n throw new \\Exception('Unexpected error creating OR clause. The fields involved should be the same.');\n\n /* busca si existe el campo en el modelo en cuestion */\n if(aModels::findFieldModel($campo1) == 'STRING'){\n return \"(\". $campo1 . \"= '\" .(strip_tags($var1)). \"' {or} \". $campo2 . \"= '\" .(strip_tags($var2)) .\"')\";\n }else\n return '('. $params1 . ' {or} '. $params2 .')';\n }", "public function testOrWhereRaw()\n {\n $query = (new WhereBuilder($this->mockConnection))->orWhereRaw('field', 'op', 'COUNT(field1)');\n $array = $query->toArray();\n\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'op',\n 'value' => 'COUNT(field1)',\n 'boolean' => 'or',\n ]\n ]\n ], $array);\n $this->assertInstanceOf(Raw::class, $array['where'][0]['value']);\n }", "public function isOr($roles)\n {\n return !!$this->roles->whereIn('slug', (array)$roles)->count();\n }", "public function or_where_in($key = NULL, $values = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_where_in($key, $values, FALSE, 'OR ', $escape);\n\t}", "public function endOr()\n {\n $this->setDefaultOperator(null);\n return $this;\n }", "public function testOrWhereColumn()\n {\n $query = (new WhereBuilder($this->mockConnection))->orWhereColumn('field1', 'op', 'field2');\n $array = $query->toArray();\n\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field1',\n 'operator' => 'op',\n 'value' => 'field2',\n 'boolean' => 'or',\n ]\n ]\n ], $array);\n $this->assertInstanceOf(Column::class, $array['where'][0]['value']);\n }", "function _or( $value ) {\n\t\tif(strpos($this->prefixes, \"(\") === false)\n\t\t\t$this->prefixes .= \"(\";\n\t\tif(strpos($this->suffixes, \")\") === false)\n\t\t\t$this->suffixes .= \")\";\n\n\t\t$this->add(\")|(\");\n\t\tif($value)\n\t\t\t$this->add($value);\n\n\t\treturn $this;\n\n\t}", "function mOR(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$OR;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:611:3: ( '||' ) \n // Tokenizer11.g:612: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 or_not_group_start()\n\t{\n\t\treturn $this->group_start('NOT ', 'OR ');\n\t}", "function or_having($key, $value = '', $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_having($key, $value, 'OR ', $escape);\r\n\t}", "function _field_checkarray_or($fval) \n {\n return $this->_field_checkarray($fval, 1);\n }", "public function isAnd();", "public function testOrWhereSubQuery()\n {\n $query = (new WhereBuilder($this->mockConnection))->orWhereSubQuery(function (Select $select) {});\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'type' => 'subQuery',\n 'select' => [],\n 'boolean' => 'or',\n ]\n ]\n ], $array);\n }", "public function or_like($field, $match = '', $side = 'both', $escape = NULL)\n\t{\n\t\treturn $this->_like($field, $match, 'OR ', $side, '', $escape);\n\t}", "private function filterOr(Team $team, array $filters) : bool {\n\t\tforeach ($filters as $key => $value) {\n\t\t\tif (is_int($key)) {\n\t\t\t\t$key = 'and';\n\t\t\t}\n\t\t\tif (is_array($value)) {\n\t\t\t\tswitch (strtolower($key)) {\n\t\t\t\t\tcase 'and':\n\t\t\t\t\t\tif ($this->filterAnd($team, $value)) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'or':\n\t\t\t\t\t\tif ($this->filterOr($team, $value)) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Exception('Unknown opperand type \"'.$key.'\". Expected \"and\" or \"or\".');\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($value instanceof TeamFilter) {\n\t\t\t\tif ($value->validate($team, $this->getGroupsIds(), 'sum', $this->groups[0])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthrow new Exception('Filter ['.$key.'] is not an instance of TeamFilter class');\n\t\t}\n\t\treturn false;\n\t}", "public function logicalOperator($operator = null);", "public function add(/* Variable */) {\n return $this->derive(func_get_args(), 'OR');\n }", "static function logicalXor()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalXor', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "protected static function logicalAND(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('AND', $values);\n\t}", "public static function parse($globals){\n\t\t$scanner = $globals->curr_pkg->scanner;\n\t\t$r = self::e3($globals);\n\t\twhile( $scanner->sym === Symbol::$sym_or2 ){\n\t\t\t$scanner->readSym();\n\t\t\t$r = $r->booleanOr($globals->logger, $scanner->here(), self::e3($globals), \"or\");\n\t\t}\n\t\treturn $r;\n\t}", "public function orLike($column,$data,$wildCardPlacement);", "function configurationTestRules(&$deviceInfo, $ruleOverride = false) {\n if (is_string($ruleOverride)) $rules[] = $ruleOverride;\n else $rules = getSettingsValue(SETTING_CATEGORY_CONFIGMGMT, \"rules\",[]);\n\n foreach ($rules as $rule) {\n $rule = strtolower($rule);\n\n $a = explode(\" run \",$rule);\n $rLogic = $a[0];\n $rScript = isset($a[1])?$a[1]:\"not set\";\n //print_r($a);\n\n if ($rScript != \"\") {\n //parse the logic\n $logicPassed = true; //AND comparing this so it must start true\n foreach (explode(\" and \",$rLogic) as $rAnd) {\n $blockPassed = false; //OR comparing this so it must start false\n foreach (explode(\" or \",$rAnd) as $rOr) {\n //test the contains block\n $c = explode(\" contains \", $rOr);\n $c[0] = trim($c[0],' \"\\'');\n $devText = isset($deviceInfo[$c[0]])?strtolower($deviceInfo[$c[0]]):\"\";\n $devSearch = isset($c[1])?trim($c[1],' \"\\''):\"\";\n $test = ($devSearch==\"\")?false:is_numeric(strpos($devText,$devSearch));\n\n //see if we're testing an OR block or an AND block\n if (count($rOr)>0) $blockPassed = $blockPassed || $test; //we have an or statement\n else $blockPassed = $test;\n\n //echo \"[$rOr] = $blockPassed\\ndevText = [$devText]\\ndevSearch = [$devSearch]\";\n }\n $logicPassed = $logicPassed && $blockPassed;\n }\n\n //done testing logic, if we have a winner then lets return it\n if ($logicPassed) return trim($rScript);\n }\n\n }\n\n //no rules were found that matched, return nothing\n return \"\";\n\n}", "public function orConstraint(ConstraintInterface $constraint1,\n ConstraintInterface $constraint2);", "public function orClause()\n {\n if ($this->_hasDqlQueryPart('where')) {\n $this->_addDqlQueryPart('where', 'OR', true);\n }\n\n $this->_addDqlQueryPart('where', '(', true);\n\n $this->_startClause = true;\n\n return $this;\n }", "public function or_group_start()\n\t{\n\t\treturn $this->group_start('', 'OR ');\n\t}" ]
[ "0.7764997", "0.73263615", "0.7212945", "0.65953505", "0.6547403", "0.6541039", "0.6427818", "0.6359863", "0.6252859", "0.6169831", "0.60080785", "0.5965086", "0.5962326", "0.5929085", "0.5884612", "0.5790692", "0.57676154", "0.5754312", "0.5749105", "0.5728345", "0.5705428", "0.5657275", "0.56133735", "0.5578541", "0.55639416", "0.5535634", "0.54979396", "0.54826164", "0.5481742", "0.54614717", "0.5429113", "0.54125744", "0.5376045", "0.5362582", "0.5354541", "0.53457105", "0.53319955", "0.5324366", "0.5321636", "0.5313163", "0.5311048", "0.5301297", "0.5286023", "0.5285611", "0.5285193", "0.5279687", "0.5266887", "0.525802", "0.52537817", "0.52527976", "0.5249654", "0.5238864", "0.5220774", "0.52165484", "0.5199903", "0.519777", "0.5191381", "0.51828223", "0.51760346", "0.51697314", "0.5152728", "0.51459694", "0.51380515", "0.51363605", "0.5135177", "0.5103002", "0.51027435", "0.5091042", "0.5085991", "0.50738376", "0.5067923", "0.5067516", "0.50662583", "0.50616676", "0.50581294", "0.5037104", "0.5028503", "0.50268227", "0.5025067", "0.5019662", "0.5014968", "0.5011846", "0.50083834", "0.4997089", "0.49946246", "0.49943244", "0.49924192", "0.4973971", "0.49688572", "0.49643484", "0.4956744", "0.49562645", "0.4955073", "0.49155444", "0.4903772", "0.49018312", "0.48983496", "0.4895498", "0.48860642", "0.48678958" ]
0.74625754
1
Test logical AND rule container
public function testAndRule() { $rule = $this->getRuleBuilder()->fromArray(array( 'false', 'true' ), 'and'); $this->assertFalse($rule->validate()); $rule = $this->getRuleBuilder()->fromArray(array( 'true', 'true' ), 'and'); $this->assertTrue($rule->validate()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isAnd();", "protected static function logicalAND(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('AND', $values);\n\t}", "static function logicalAnd()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalAnd', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function conditionalAndExpression(){\n try {\n // Sparql11query.g:389:3: ( valueLogical ( AND valueLogical )* ) \n // Sparql11query.g:390:3: valueLogical ( AND valueLogical )* \n {\n $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1326);\n $this->valueLogical();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:390:16: ( AND valueLogical )* \n //loop49:\n do {\n $alt49=2;\n $LA49_0 = $this->input->LA(1);\n\n if ( ($LA49_0==$this->getToken('AND')) ) {\n $alt49=1;\n }\n\n\n switch ($alt49) {\n \tcase 1 :\n \t // Sparql11query.g:390:17: AND valueLogical \n \t {\n \t $this->match($this->input,$this->getToken('AND'),self::$FOLLOW_AND_in_conditionalAndExpression1329); \n \t $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1331);\n \t $this->valueLogical();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop49;\n }\n } while (true);\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 function wAnd()\n {\n $this->setDefaultOperator(PredicateSet::OP_AND);\n \n if (func_num_args()) {\n call_user_func_array([$this, 'condition'], func_get_args());\n $this->endAnd();\n }\n \n return $this;\n }", "function variant_and($left, $right) {}", "public function testConstructorContainer()\n {\n $rule = new AndRule(\n new TrueRule(),\n new OrRule(\n new FalseRule(),\n new TrueRule()\n ),\n new NotRule(\n new FalseRule()\n )\n );\n $this->assertTrue($rule->validate());\n }", "public static function logicalAnd(Matcher $matcher /*...*/)\n {\n return new Matcher\\LogicalAnd(func_get_args());\n }", "public static function and_() {\n $result = new qti_variable('single', 'boolean', array('value' => true));\n $params = func_get_args();\n // Allow a single array as well as a parameter list\r\n if (count($params) == 1 && is_array($params[0])) {\r\n $params = $params[0];\r\n }\r\n foreach($params as $param) {\n if (!$param->value) {\n $result->value = false;\n return $result;\n }\n }\n return $result;\n }", "public function testImplicitAnd()\n {\n $constraint = $this->parser->parse('benchmark: \"foobar\", subject: \"barfoo\", name: \"daniel\"');\n $this->assertEquals(\n new Composite(\n '$and',\n new Composite(\n '$and',\n new Comparison('$eq', 'benchmark', 'foobar'),\n new Comparison('$eq', 'subject', 'barfoo')\n ),\n new Comparison('$eq', 'name', 'daniel')\n ),\n $constraint\n );\n }", "public function andWhere($conditions);", "public function &havingConditions();", "function yy_r145(){ $this->_retvalue = new Stmt\\Expr('and', $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); }", "public static function buildAnd(array $criteria)\n {\n return new LogicalAnd($criteria);\n }", "public function andWhere($field, $operator, $value);", "public static function static_logicalAnd($a = null, $b = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "function mAND(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$AND;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:606:3: ( '&&' ) \n // Tokenizer11.g:607: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 simulateEnabledMatchAllConditionsSucceeds() {}", "public function simulateEnabledMatchAllConditionsSucceeds() {}", "public function whereAND()\n {\n $this->where_clause .= \" AND \";\n }", "public function isOr();", "public function andWhere(){\r\n\t\t$tb = call_user_func_array(array($this->mask(), 'where'), func_get_args());\r\n\t\treturn $this;\r\n\t}", "function addAnd($what,$was)\n{\n\tif (!empty($was)) return \"$was AND $what\"; else return $what;\n}", "public function isAndPosition($position) {\n if ($this->isNull($position)) {\n return false;\n }\n if ($this->dictionary->get(RestoDictionary::AND_MODIFIER, $this->words[$position]['word']) === 'and') {\n return true;\n }\n return false;\n }", "public function termsAndConditionAccpeted()\n\t{\n\n\t}", "public function hasAnyGroup(...$groups): bool;", "public function and()\n {\n $this->logicQueue = 'and';\n\n return $this;\n }", "protected function compileAnd()\n {\n if ($this->firstClause) {\n return '';\n }\n\n $operator = $this->and ? ' & ' : ' | ';\n\n return $operator;\n }", "public function havingAnd()\n {\n $this->having .= \" AND \";\n }", "public function createAnd()\n {\n $o = new AndSelector();\n $this->appendSelector($o);\n\n return $o;\n }", "public function assertAllTrue()\n {\n $bools = func_get_args();\n\n if (is_array(func_get_arg(0))) {\n $bools = func_get_arg(0);\n }\n\n return ! collect($bools)->contains(false);\n }", "public function lAnd(\n ComponentSpecification $specification1,\n ComponentSpecification $specification2\n ) : Specification\\AndSpecification {\n $args = func_get_args();\n $andSpec = new \\ReflectionClass('\\\\ElementTree\\\\Specification\\\\AndSpecification');\n\n return $andSpec->newInstanceArgs($args);\n }", "public function every(callable $predicate): bool;", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function andWhere($field, $predicate): self;", "public function containsOr()\n\t{\n\t\t$args = (new static(func_get_args()))->flattenIt();\n\n\t\t$found = $args->detect(function($value) {\n\t\t\treturn in_array($value, $this->attributes);\n\t\t});\n\n\t\treturn !is_null($found);\n\t}", "public function andar()\n {\n }", "public function is_true(&$params, $host_obj)\n\t\t{\n\t\t\tif (!array_key_exists('cart_items', $params))\n\t\t\t\tthrow new Phpr_ApplicationException('Error evaluating the cart item presence condition: the cart_items element is not found in the condition parameters.');\n\n\t\t\t$required_condition_value = true;\n\t\t\t$matches_found = null;\n\t\t\t$local_match = false;\n\n\t\t\tforeach ($params['cart_items'] as $item)\n\t\t\t{\n\t\t\t\t$params['product'] = $item->product;\n\t\t\t\t$params['item'] = $item;\n\t\t\t\t$params['current_price'] = $item->single_price_no_tax(false) - $item->get_sale_reduction();\n\t\t\t\t$params['quantity_in_cart'] = $item->quantity;\n\t\t\t\t$params['row_total'] = $item->total_price_no_tax();\n\t\t\t\t\n\t\t\t\tif (method_exists($item, 'get_om_record'))\n\t\t\t\t\t$params['om_record'] = $item->get_om_record();\n\n\t\t\t\t$subconditions_result = null;\n\t\t\t\t$result_found = false;\n\n\t\t\t\tforeach ($host_obj->children as $subcondition)\n\t\t\t\t{\n\t\t\t\t\t$subcondition_result = $subcondition->is_true($params) ? true : false;\n\n\t\t\t\t\tif ($host_obj->condition_type == 0) // ALL\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($subcondition_result !== $required_condition_value)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$subconditions_result = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} \n\t\t\t\t\t} else // ANY\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($subcondition_result === $required_condition_value && $host_obj->presence == 'found')\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($subcondition_result === $required_condition_value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$local_match = true;\n\n\t\t\t\t\t\tif ($subconditions_result !== null)\n\t\t\t\t\t\t\t$subconditions_result = $subconditions_result && true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$subconditions_result = true;\n\t\t\t\t\t} else\n\t\t\t\t\t\t$subconditions_result = false;\n\t\t\t\t}\n\n\t\t\t\tif ($host_obj->condition_type == 0 && $host_obj->presence == 'found' && $subconditions_result)\n\t\t\t\t\treturn true;\n\n\t\t\t\tif ($subconditions_result)\n\t\t\t\t\t$matches_found = true;\n\t\t\t}\n\n\t\t\tif ($host_obj->condition_type == 0 && $host_obj->presence == 'not_found' && !$matches_found)\n\t\t\t\treturn true;\n\n\t\t\tif ($host_obj->condition_type == 1 && $host_obj->presence == 'not_found' && !$local_match)\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}", "static function logicalOr()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalOr', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "function filter_words( $wordsInTisheet, $wordsToFilter, $andOperator )\n {\n $diff = array_diff( $wordsInTisheet, $wordsToFilter );\n\n if ( $andOperator )\n {\n if ( self::and_criteria_met( $diff, $wordsInTisheet, $wordsToFilter ) )\n return true;\n\n return false;\n }\n else \n {\n if ( self::or_criteria_met( $diff, $wordsInTisheet ) )\n return true;\n\n return false;\n }\n\n return false;\n }", "function AndWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "function consecutive(callable ...$predicates)\n{\n return function (...$arguments) use ($predicates) {\n foreach ($arguments as $index => $value) {\n if(!$predicates[$index]($value)) {\n return false;\n }\n }\n\n return true;\n };\n}", "public function conditionalOrExpression(){\n try {\n // Sparql11query.g:382:3: ( conditionalAndExpression ( OR conditionalAndExpression )* ) \n // Sparql11query.g:383:3: conditionalAndExpression ( OR conditionalAndExpression )* \n {\n $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1301);\n $this->conditionalAndExpression();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:383:28: ( OR conditionalAndExpression )* \n //loop48:\n do {\n $alt48=2;\n $LA48_0 = $this->input->LA(1);\n\n if ( ($LA48_0==$this->getToken('OR')) ) {\n $alt48=1;\n }\n\n\n switch ($alt48) {\n \tcase 1 :\n \t // Sparql11query.g:383:29: OR conditionalAndExpression \n \t {\n \t $this->match($this->input,$this->getToken('OR'),self::$FOLLOW_OR_in_conditionalOrExpression1304); \n \t $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1306);\n \t $this->conditionalAndExpression();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop48;\n }\n } while (true);\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 }", "protected function _match()\n {\n // SMART/TNT\n $smart = $this->_smart();\n if( $this->name == 'smart' ) return in_array($this->args, $smart) ? true : false;\n // GLOBE/TM\n $globe = $this->_globe();\n if( $this->name == 'globe' ) return in_array($this->args, $globe) ? true : false;\n // SUN\n $sun = $this->_sun();\n if( $this->name == 'sun' ) return in_array($this->args, $sun) ? true : false;\n }", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "private function expressionGen_AND($key, $value){\n \n $pattern = \"/\\|\\*\\|LIKE\\|\\*\\|/\";\n $pattern2 = \"/\\|\\*\\|NOT LIKE\\|\\*\\|/\";\n $pattern3 = \"/\\|\\*\\|NOT EQUAL\\|\\*\\|/\";\n \n for($i=0;$i<count($key);$i++){\n if ($i+1 == count($key)){\n if (preg_match($pattern, $value[$i])){\n $match = preg_split($pattern, $value[$i]);\n $str .= $key[$i].\" LIKE '\".$match[1].\"'\";\n }\n else if (preg_match($pattern2, $value[$i])){\n $match = preg_split($pattern2, $value[$i]);\n $str .= $key[$i].\" NOT LIKE '\".$match[1].\"'\";\n }\n else if (preg_match($pattern3, $value[$i])){\n $match = preg_split($pattern3, $value[$i]);\n $str .= $key[$i].\" != '\".$match[1].\"'\";\n } \n else{\n $str .= $key[$i].\"='\".$value[$i].\"'\"; \n }\n \n }\n else{\n if (preg_match($pattern, $value[$i])){\n $match = preg_split($pattern, $value[$i]);\n $str .= $key[$i].\" LIKE '\".$match[1].\"'\".\" AND \";\n }\n else if (preg_match($pattern2, $value[$i])){\n $match = preg_split($pattern2, $value[$i]);\n $str .= $key[$i].\" NOT LIKE '\".$match[1].\"'\".\" AND \"; \n }\n else if (preg_match($pattern3, $value[$i])){\n $match = preg_split($pattern3, $value[$i]);\n $str .= $key[$i].\" !='\".$match[1].\"'\".\" AND \"; \n }\n else{\n $str .= $key[$i].\"='\".$value[$i].\"'\".\" AND \"; \n }\n \n }\n }\n \n return $str;\n }", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "Function largearray_and($a, $b) {\r\n $indexes = min(count($a), count($b));\r\n $c = array();\r\n for ($i=0; $i<$indexes; $i++) {\r\n array_push($c, $a[$i] & $b[$i]);\r\n }\r\n return $c;\r\n}", "private function filterAnd(Team $team, array $filters) : bool {\n\t\tforeach ($filters as $key => $value) {\n\t\t\tif (is_array($value)) {\n\t\t\t\tif (is_int($key)) {\n\t\t\t\t\t$key = 'and';\n\t\t\t\t}\n\t\t\t\tswitch (strtolower($key)) {\n\t\t\t\t\tcase 'and':\n\t\t\t\t\t\tif (!$this->filterAnd($team, $value)) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'or':\n\t\t\t\t\t\tif (!$this->filterOr($team, $value)) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Exception('Unknown opperand type \"'.$key.'\". Expected \"and\" or \"or\".');\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($value instanceof TeamFilter) {\n\t\t\t\tif (!$value->validate($team, $this->getGroupsIds(), 'sum', $this->groups[0])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthrow new Exception('Filter ['.$key.'] is not an instance of TeamFilter class');\n\t\t}\n\t\treturn true;\n\t}", "public function hasPredicateMatched(){\n return $this->_has(1);\n }", "public function andWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function expressionListWithNotInIsConcatenatedWithAnd() {}", "private function truthValue($current_item, $mutual, $table, $negate, $xor, $xand) {\n if (!is_array($current_item)) {\n // see if translation table is given\n if ($table && isset($table[$current_item])) {\n $current_item = $table[$current_item];\n }\n // cast to string and lower case for easier comparison\n $v = strtolower(\"\".$current_item);\n if ($v == 'true' || $v == '1') {\n return !$negate;\n }\n return $negate;\n }\n // item is a list\n $a = array();\n // should we negate next item, was it a list or values\n $next_item_negate = FALSE;\n $next_item_xor = FALSE;\n $next_item_xand = FALSE;\n\n foreach ($current_item as $item) {\n // negation marker\n if ($item == -1) {\n $next_item_negate = TRUE;\n // xor marker\n } else if ($item == -2) {\n $next_item_xor = TRUE;\n // xand marker\n } else if ($item == -3) {\n $next_item_xand = TRUE;\n } else {\n $a[] = $this->truthValue($item, !$mutual, $table, $next_item_negate, $next_item_xor, $next_item_xand);\n // reset negation and xor\n $next_item_negate = FALSE;\n $next_item_xor = FALSE;\n $next_item_xand = FALSE;\n }\n }\n // is group AND / OR / XOR\n // take care of negation for the list result too\n if ($xor) {\n // if only one of the values is true, but not more\n if ($negate) {\n return !$this->one($a);\n }\n return $this->one($a);\n } else if ($xand) {\n // if any of the values is true, but not all\n if ($negate) {\n return !$this->some($a);\n }\n return $this->some($a);\n } else if ($mutual) {\n // if all values are true\n if ($negate) {\n return !$this->all($a);\n }\n return $this->all($a);\n } else {\n // if some of the values is true\n if ($negate) {\n return !$this->any($a);\n }\n return $this->any($a);\n }\n }", "function evaluateANDSeries($series, $msgOffset)\n {\n // 1 4 5\n $ret = 0;\n \n $ids = explode(' ', trim($series));\n foreach ($ids as $childId) {\n $result = $this->evaluateRule($childId, $msgOffset + $ret);\n\n if (0 == $result) {\n // This AND series failed, no characters consumed\n return 0;\n } else {\n $ret += $result;\n }\n }\n\n return $ret;\n }", "public function apply(&$values): bool;", "function asu_isearch_short_circuit_version() {\n return TRUE;\n}", "public function hasCondition();", "public function andWhere($where)\n {\n $where = $this->getQueryPart('where');\n $args = func_get_args();\n\n if ($where instanceof Composite && $where->getType() === Composite::TYPE_AND) {\n $where->addMultiple($args);\n } else {\n array_unshift($args, $where);\n $where = new Composite(Composite::TYPE_AND, $args);\n }\n\n return $this->add('where', $where, true);\n }", "public function and_having_open(){\n $this->_having[] = array('AND' => '(');\n\n return $this;\n }", "function conditions( $conds = array())\n\t{\n\t\t// if condition is empty, return true\n\t\tif ( empty( $conds )) return true;\n\t}", "public function containsOperators() {\n\t\t$pattern = [];\n\t\tforeach ( $this->wildcardingOperators as $op ) {\n\t\t\t$pattern[] = \"\\\\$op\";\n\t\t}\n\t\t$pattern = \"/\" . implode( '|', $pattern ) . \"/\";\n\n\t\tif ( preg_match( $pattern, $this->original ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Special operators should not be removable by config\n\t\tif ( strpos( $this->original, 'AND' ) || strpos( $this->original, 'OR' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static function andOp($left, $right)\n {\n self::checkParameter($left, $right);\n $f = self::checkMathFunc('and');\n $bignumber = $f || self::operIsBig($left, $right);\n if($f) {\n return $f($left, $right);\n } elseif($bignumber) {\n $len = self::bitLen($left, $right);\n return self::strBitOp($left, $right, $len, function ($l, $r) {\n return $l & $r;\n });\n }\n return $left & $right;\n }", "abstract function check();", "function in_array_any($needles, $haystack) {\n \n return !empty(array_intersect($needles, $haystack));\n\n}", "private function some($a) {\n return $this->any($a) && !$this->all($a);\n }", "function _checkCriteria(&$bean, &$focusRule) {\n\t\tif(!isset($focusRule['criteria'])) {\n\t\t\t$GLOBALS['log']->debug(\"********** SUGARROUTING: focusCriteria['criteria'] empty\");\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * matches criteria\n\t\t * We will force a return of TRUE if the \"any\" flag is checked and some criteria is satisfied.\n\t\t * We will force a return of FALSE if the \"all\" flag is checked and some criteria is NOT satisfied (catch-all).\n\t\t */\n\t\t$allCriteriaFilled = false;\n\n\t\tforeach($focusRule['criteria'] as $criteria) {\n\t\t\tif(is_array($criteria)) {\n\t\t\t\t$crit = $criteria['action'];\n\n\t\t\t\tswitch($crit['crit0']) {\n\t\t\t\t\tcase \"priority_high\":\n\t\t\t\t\tcase \"priority_normal\":\n\t\t\t\t\tcase \"priority_low\":\n\t\t\t\t\t\t$GLOBALS['log']->debug(\"********* SUGARROUTING: got priority criteria\");\n\t\t\t\t\t\t$flagged = ($bean->flagged == 1) ? 'priority_high' : 'priority_normal';\n\n\t\t\t\t\t\t// no match\n\t\t\t\t\t\tif($flagged != $crit['crit0']) {\n\t\t\t\t\t\t\tif($focusRule['all'] == true) {\n\t\t\t\t\t\t\t\t$GLOBALS['log']->debug(\"********** SUGARROUTING: 'ALL' flag found and crit field not matched: [ {$crit['crit0']} for bean of type {$bean->module_dir} ]\");\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif($focusRule['all'] == false) { // matched at least 1 criteria\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$allCriteriaFilled = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak; // end flag priority\n\n\t\t\t\t\tcase \"name\":\n\t\t\t\t\tcase \"from_addr\":\n\t\t\t\t\tcase \"to_addr\":\n\t\t\t\t\tcase \"cc_addr\":\n\t\t\t\t\tcase \"description\":\n\t\t\t\t\t\t$GLOBALS['log']->debug(\"********* SUGARROUTING: got match-type criteria [ {$crit['crit1']} ]\");\n $GLOBALS['log']->debug(\"********* SUGARROUTING: matching [ {$crit['crit2']} to {$bean->{$crit['crit0']}} ]\");\n\t\t\t\t\t\tswitch($crit['crit1']) {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Criteria for \"match\" type\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tcase \"match\":\n\t\t\t\t\t\t\t\t// make sure rule crit exists\n if (isset($bean->{$crit['crit0']})) {\n\t\t\t\t\t\t\t\t\t$regex = \"/{$crit['crit2']}/i\";\n $field = $bean->{$crit['crit0']};\n\n\t\t\t\t\t\t\t\t\tif(!preg_match($regex, $field)) {\n\t\t\t\t\t\t\t\t\t\tif($focusRule['all'] == true) {\n\t\t\t\t\t\t\t\t\t\t\t$GLOBALS['log']->debug(\"********** SUGARROUTING: 'ALL' flag found and crit field not matched: [ {$crit['crit0']} -> {$crit['crit2']} for bean of type {$bean->module_dir} ]\");\n\t\t\t\t\t\t\t\t\t\t\t$GLOBALS['log']->debug(\"********** SUGARROUTING: 'ALL' [ value: {$field} ] [ regex: {$regex} ]\");\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// got a match, return true if match 'any'\n\t\t\t\t\t\t\t\t\t\tif($focusRule['all'] == false) {\n\t\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$allCriteriaFilled = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$GLOBALS['log']->debug(\"********** SUGARROUTING: crit field not found: [ {$crit['crit0']} for bean of type {$bean->module_dir} ]\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Criteria for \"does not match\" type\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tcase \"notmatch\":\n if (isset($bean->{$crit['crit0']})) {\n\t\t\t\t\t\t\t\t\t$regex = \"/{$crit['crit2']}/i\";\n $field = $bean->{$crit['crit0']};\n\n\t\t\t\t\t\t\t\t\tif(preg_match($regex, $field)) {\n\t\t\t\t\t\t\t\t\t\t// got a match - we want to return a false flag\n\t\t\t\t\t\t\t\t\t\tif($focusRule['all'] == true) {\n\t\t\t\t\t\t\t\t\t\t\t$GLOBALS['log']->debug(\"********** SUGARROUTING: 'ALL' flag found and crit field not matched: [ {$crit['crit0']} -> {$crit['crit2']} for bean of type {$bean->module_dir} ]\");\n $GLOBALS['log']->debug(\"********** SUGARROUTING: 'ALL' [ value: {$bean->{$crit['crit0']}} ] [ regex: {$regex} ]\");\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// got a match, return true if match 'any'\n\t\t\t\t\t\t\t\t\t\tif($focusRule['all'] == false) {\n\t\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$allCriteriaFilled = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$GLOBALS['log']->debug(\"********** SUGARROUTING: crit field not found: [ {$crit['crit0']} for bean of type {$bean->module_dir} ]\");\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak; // end string matching\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Something went wrong...\n\t\t\t\t\t */\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$GLOBALS['log']->debug(\"********** SUGARROUTING: criteria for rule does not match any rule definitions: [ {$crit['crit0']} ]\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// match 'all' - if it gets this far, it has\n\t\treturn $allCriteriaFilled;\n\t}", "public function testQueryMust()\n {\n $index = new Index();\n $query = new Query($index);\n $query->queryMust([\n 'name.first' => 'jose',\n 'age >' => 29,\n 'or' => [\n 'tags in' => ['cake', 'php'],\n 'interests not in' => ['c#', 'java'],\n ],\n ]);\n\n $compiled = $query->compileQuery()->toArray();\n\n $must = $compiled['query']['bool']['must'];\n\n $expected = ['term' => ['name.first' => 'jose']];\n $this->assertEquals($expected, $must[0]);\n\n $expected = ['range' => ['age' => ['gt' => 29]]];\n $this->assertEquals($expected, $must[1]);\n\n $expected = ['terms' => ['tags' => ['cake', 'php']]];\n $this->assertEquals($expected, $must[2]['bool']['should'][0]);\n\n $expected = [\n 'bool' => [\n 'must_not' => [\n ['terms' => ['interests' => ['c#', 'java']]],\n ],\n ],\n ];\n $this->assertEquals($expected, $must[2]['bool']['should'][1]);\n\n $query->queryMust(function (QueryBuilder $builder) {\n return $builder->and(\n $builder->term('another.thing', 'value'),\n $builder->exists('stuff')\n );\n });\n\n $compiled = $query->compileQuery()->toArray();\n $must = $compiled['query']['bool']['must'];\n $must = $must[3]['bool']['must'];\n $expected = [\n ['term' => ['another.thing' => 'value']],\n ['exists' => ['field' => 'stuff']],\n ];\n $this->assertEquals($expected, $must);\n\n $query->queryMust(['name.first' => 'jose'], true);\n $compiled = $query->compileQuery()->toArray();\n $must = $compiled['query']['bool']['must'];\n $expected = ['term' => ['name.first' => 'jose']];\n $this->assertEquals([$expected], $must);\n }", "function where_and($conditions = array())\n {\n return $this->object->_where($conditions, 'AND');\n }", "public function treeLevelConditionMatchesMultipleValues() {}", "public function treeLevelConditionMatchesMultipleValues() {}", "public function setLogical(string $operator = self::AND): static;", "public function isIntersection() : bool\n {\n return $this->kind === '&';\n }", "public function postConditions($data = array(), $op = null, $bool = 'AND', $exclusive = false) {\n\t\tunset($data['_Token']);\n\t\t$registered = ClassRegistry::keys();\n\t\t$bools = array('and', 'or', 'not', 'and not', 'or not', 'xor', '||', '&&');\n\t\t$cond = array();\n\n\t\tif ($op === null) {\n\t\t\t$op = '';\n\t\t}\n\n\t\t$arrayOp = is_array($op);\n\t\tforeach ($data as $model => $fields) {\n\t\t\tif (is_array($fields)) {\n\t\t\t\tforeach ($fields as $field => $value) {\n\t\t\t\t\tif (is_array($value) && in_array(strtolower($field), $registered)) {\n\t\t\t\t\t\t$cond += (array)self::postConditions(array($field=>$value), $op, $bool, $exclusive);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// check for boolean keys\n\t\t\t\t\t\tif (in_array(strtolower($model), $bools)) {\n\t\t\t\t\t\t\t$key = $field;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$key = $model.'.'.$field;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// check for habtm [Publication][Publication][0] = 1\n\t\t\t\t\t\tif ($model == $field) {\n\t\t\t\t\t\t\t// should get PK\n\t\t\t\t\t\t\t$key = $model.'.id';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$fieldOp = $op;\n\n\t\t\t\t\t\tif ($arrayOp) {\n\t\t\t\t\t\t\tif (array_key_exists($key, $op)) {\n\t\t\t\t\t\t\t\t$fieldOp = $op[$key];\n\t\t\t\t\t\t\t} elseif (array_key_exists($field, $op)) {\n\t\t\t\t\t\t\t\t$fieldOp = $op[$field];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$fieldOp = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($exclusive && $fieldOp === false) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$fieldOp = strtoupper(trim($fieldOp));\n\t\t\t\t\t\tif (is_array($value) || is_numeric($value)) {\n\t\t\t\t\t\t\t$fieldOp = '=';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($fieldOp === 'LIKE') {\n\t\t\t\t\t\t\t$key = $key.' LIKE';\n\t\t\t\t\t\t\t$value = '%'.$value.'%';\n\t\t\t\t\t\t} elseif ($fieldOp && $fieldOp != '=') {\n\t\t\t\t\t\t\t$key = $key.' '.$fieldOp;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($value !== '%%') {\n\t\t\t\t\t\t\t$cond[$key] = $value;\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\tif ($bool != null && strtoupper($bool) != 'AND') {\n\t\t\t$cond = array($bool => $cond);\n\t\t}\n\n\t\treturn $cond;\n\t}", "protected function allowedLogicalOperators(): array\n {\n return [\n FieldCriteria::AND,\n FieldCriteria::OR,\n ];\n }", "function testDoesMatchingWithConditionsFunction() {\n $rule = new Rule(\".+\", \"test.php\", \"\");\n $rule->addCondition(new Condition('%{SERVER_ADMIN}', '[email protected]', ''));\n $rule->addCondition(new Condition('%{SERVER_PORT}', '=1337', ''));\n $result = $rule->rewrite($this->_request);\n $this->assertEquals(HTRouter::STATUS_NO_MATCH, $result->rc);\n $this->assertEquals(\"foo\", $this->_request->getFilename());\n\n // Rule matches, since [email protected] is correct, and we need OR\n $rule = new Rule(\".+\", \"test.php\", \"\");\n $rule->addCondition(new Condition('%{SERVER_ADMIN}', '[email protected]', '[OR]'));\n $rule->addCondition(new Condition('%{SERVER_PORT}', '=1337', ''));\n $result = $rule->rewrite($this->_request);\n// $this->assertEquals(HTRouter::STATUS_OK, $result->rc);\n// $this->assertEquals(\"/test.php\", $this->_request->getFilename());\n\n // Rule matches, since both conditions are true\n $rule = new Rule(\".+\", \"test.php\", \"\");\n $rule->addCondition(new Condition('%{SERVER_ADMIN}', '[email protected]', ''));\n $rule->addCondition(new Condition('%{SERVER_PORT}', '=80', ''));\n $result = $rule->rewrite($this->_request);\n $this->assertEquals(HTRouter::STATUS_OK, $result->rc);\n $this->assertEquals(\"/test.php\", $this->_request->getFilename());\n }", "public function testOrRule()\n {\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'true'\n ), 'or');\n $this->assertTrue($rule->validate());\n\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'false'\n ), 'or');\n $this->assertFalse($rule->validate());\n }", "public function filter($args = array(), $operator = 'AND')\n {\n }", "protected static function logicalOR(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('OR', $values);\n\t}", "public abstract function isSatisfiedBy($subject);", "public function testGoodFilter()\n {\n $tests = array(\n array(\n 'label' => __LINE__ .': simple match',\n 'filter' => P4Cms_Record_Filter::create()->add('field', 'value'),\n 'expression' => 'attr-field~=\\\\^value\\\\$'\n ),\n array(\n 'label' => __LINE__ .': match containing wildcards',\n 'filter' => P4Cms_Record_Filter::create()->add('field', '*value...'),\n 'expression' => 'attr-field~=\\\\^\\\\\\*value\\\\.\\\\.\\\\.\\\\$'\n ),\n array(\n 'label' => __LINE__ .': match containing regex characters',\n 'filter' => P4Cms_Record_Filter::create()->add('field', '$v?(a)l[u]e|^'),\n 'expression' => 'attr-field~=\\\\^\\\\\\\\\\$v\\\\\\?\\\\\\\\\\(a\\\\\\\\\\)l\\\\\\\\\\[u\\\\\\\\\\]e\\\\\\\\\\|\\\\\\\\\\^\\\\$'\n ),\n array(\n 'label' => __LINE__ .': match containing newline/return characters',\n 'filter' => P4Cms_Record_Filter::create()->add('field', \"va\\nl\\rue\"),\n 'expression' => \"attr-field~=\\^va\\\\\\\\\\\\\\n\" . \"l\\\\\\\\\\\\\\r\" .'ue\\\\$'\n ),\n array(\n 'label' => __LINE__ .': multi-field match',\n 'filter' => P4Cms_Record_Filter::create()\n ->add('field', 'value')\n ->add('foo', 'bar'),\n 'expression' => 'attr-field~=\\\\^value\\\\$ & attr-foo~=\\\\^bar\\\\$'\n ),\n array(\n 'label' => __LINE__ .': multi-value match',\n 'filter' => P4Cms_Record_Filter::create()\n ->add('field', 'value')\n ->add('foo', array('bar', 'bof')),\n 'expression' => 'attr-field~=\\\\^value\\\\$ & (attr-foo~=\\\\^bar\\\\$ | attr-foo~=\\\\^bof\\\\$)'\n ),\n array(\n 'label' => __LINE__ .': multi-value negated match',\n 'filter' => P4Cms_Record_Filter::create()\n ->add('field', 'value')\n ->add('foo', array('bar', 'bof'), '!='),\n 'expression' => 'attr-field~=\\\\^value\\\\$ &^ (attr-foo~=\\\\^bar\\\\$ | attr-foo~=\\\\^bof\\\\$)'\n ),\n array(\n 'label' => __LINE__ .': inverted match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_NOT_EQUAL\n ),\n 'expression' => '^attr-field~=\\\\^value\\\\$'\n ),\n array(\n 'label' => __LINE__ .': case-insensitive match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_EQUAL, null, true\n ),\n 'expression' => 'attr-field~=\\\\^[Vv][Aa][Ll][Uu][Ee]\\\\$'\n ),\n array(\n 'label' => __LINE__ .': regex match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_REGEX\n ),\n 'expression' => 'attr-field~=value'\n ),\n array(\n 'label' => __LINE__ .': regex match, case-sensitive',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=value'\n ),\n array(\n 'label' => __LINE__ .': regex match, with wildcards',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '.*value...', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=.*value...'\n ),\n array(\n 'label' => __LINE__ .': inverted regex match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_NOT_REGEX\n ),\n 'expression' => '^attr-field~=value'\n ),\n array(\n 'label' => __LINE__ .': regex match alternatives',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '(V|v)alue', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=\\\\(V\\\\|v\\\\)alue'\n ),\n array(\n 'label' => __LINE__ .': regex match square brackets',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '^[Vv]alue$', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=\\\\^[Vv]alue\\\\$'\n ),\n array(\n 'label' => __LINE__ .': regex match square brackets, nocase',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'va[lX]ue', P4Cms_Record_Filter::COMPARE_REGEX, null, true\n ),\n 'expression' => 'attr-field~=[Vv][Aa][LlXx][Uu][Ee]'\n ),\n array(\n 'label' => __LINE__ .': regex match square brackets, nocase, with escapes',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'va[lX\\\\]\\\\\\\\]ue', P4Cms_Record_Filter::COMPARE_REGEX, null, true\n ),\n 'expression' => 'attr-field~=[Vv][Aa][LlXx\\\\\\\\]\\\\\\\\\\\\\\\\][Uu][Ee]'\n ),\n array(\n 'label' => __LINE__ .': regex match question mark',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '^v?alue$', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=\\^v?alue\\$'\n ),\n array(\n 'label' => __LINE__ .': empty string match',\n 'filter' => P4Cms_Record_Filter::create()->add('field', ''),\n 'expression' => 'attr-field~=\\\\^\\\\$'\n ),\n array(\n 'label' => __LINE__ .': null match',\n 'filter' => P4Cms_Record_Filter::create()->add('field', null),\n 'expression' => 'attr-field~=\\\\^\\\\$'\n ),\n array(\n 'label' => __LINE__ .': simple contains match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'foo', P4Cms_Record_Filter::COMPARE_CONTAINS\n ),\n 'expression' => 'attr-field~=foo'\n ),\n array(\n 'label' => __LINE__ .': case-insensitive contains match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'foo', P4Cms_Record_Filter::COMPARE_CONTAINS, null, true\n ),\n 'expression' => 'attr-field~=[Ff][Oo][Oo]'\n ),\n array(\n 'label' => __LINE__ .': contains match with special chars',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'foo bar-', P4Cms_Record_Filter::COMPARE_CONTAINS\n ),\n 'expression' => 'attr-field~=foo\\ bar\\-'\n ),\n );\n\n foreach ($tests as $test) {\n $this->assertSame(\n $test['expression'],\n $test['filter']->getExpression(),\n $test['label']\n );\n }\n }", "public function whereAcf(...$args)\n {\n $this->addAcfCondition('and', $args, $this->conditions);\n return $this;\n }", "public function getPredicate();", "public function hasAllGroups(...$groups): bool;", "abstract public function is_have();", "public function and_on($c1, $op, $c2)\n {\n return $this->on($c1, $op, $c2);\n }", "abstract public function check();", "public static function or_() {\n $result = new qti_variable('single', 'boolean', array('value' => false));\r\n $params = func_get_args();\n // Allow a single array as well as a parameter list\r\n if (count($params) == 1 && is_array($params[0])) {\r\n $params = $params[0];\r\n }\r\n foreach($params as $param) {\r\n if ($param->value) {\r\n $result->value = true;\r\n return $result;\r\n }\r\n }\r\n return $result;\n }", "public function contains()\n {\n $args = func_get_args();\n return (bool) $this->intersect($args);\n }", "public function includes(): bool;", "function match_states($filters){\n\n //test and see if the ticked bits are as they are supposed to be.\n\n //if the states are ticked that means they are that filter is required.\n\n //notated means the description is not empty\n //categorised means from links where type=\"REFERENCE_IN_CATEGORY\" and from_id= the reference_id\n\n if($filters[STATE_NOTATED]){\n //has to be notated\n if(trim($this->description) == \"\"){\n return FALSE;\n }\n }\n\n if($filters[STATE_CATEGORISED]){\n //has to be categorised\n DB::db_query(\"categorised\", \n \"SELECT * \n FROM links \n WHERE type='\".LINK_REFERENCE_IN_CATEGORY.\"' \n AND from_id='\".$this->id.\"';\");\n if(DB::db_check_result(\"categorised\")){\n if(DB::db_num_rows(\"categorised\") < 1){\n return FALSE;\n }\n }\n }\n\n if($filters[STATE_LINKED]){\n //has to be have been linked\n DB::db_query(\"linked\", \n \"SELECT * \n FROM links \n WHERE (type='\".LINK_REFERENCE_CITES_REFERENCE.\"' \n OR type='\".LINK_REFERENCE_CITES_REFERENCE.\"')\n AND from_id='\".$this->id.\"';\");\n if(DB::db_check_result(\"linked\")){\n if(DB::db_num_rows(\"linked\") < 1){\n return FALSE;\n }\n }\n }\n\n if($filters[STATE_HASDOCUMENT]){\n //has to have a document associated with it\n DB::db_query(\"hasdocument\", \n \"SELECT * \n FROM documents\n WHERE reference_id='\".$this->id.\"';\");\n if(DB::db_check_result(\"hasdocument\")){\n if(DB::db_num_rows(\"hasdocument\") < 1){\n return FALSE;\n }\n }\n }\n\n return TRUE;\n\n }", "function get_condition()\r\n {\r\n $owner = $this->owner;\r\n\r\n $conds = array();\r\n $parent = $this->parent;\r\n $category = $parent->get_parameter(WeblcmsManager :: PARAM_CATEGORY);\r\n $category = $category ? $category : 0;\r\n $conds[] = new EqualityCondition(ContentObjectPublication :: PROPERTY_CATEGORY_ID, $category, ContentObjectPublication :: get_table_name());\r\n\r\n $type_cond = array();\r\n $types = array(Assessment :: get_type_name(), Survey :: get_type_name(), Hotpotatoes :: get_type_name());\r\n foreach ($types as $type)\r\n {\r\n $type_cond[] = new EqualityCondition(ContentObject :: PROPERTY_TYPE, $type);\r\n }\r\n $conds[] = new OrCondition($type_cond);\r\n $c = Utilities :: query_to_condition($this->query);\r\n if (! is_null($c))\r\n {\r\n $conds[] = $c;\r\n }\r\n return new AndCondition($conds);\r\n }", "final public static function and($field = '', $operator = '', $value = '', bool $valueIsFunction = false)\n {\n //add the condition\n if ($field == '' || $operator == '' || $value == '') {\n self::$query .= ' AND ';\n } else {\n if (!$valueIsFunction)\n self::$bindParams[] = [$field => $value];\n\n self::$query .= ' AND ' . $field . ' ' . $operator . ' ' . ($valueIsFunction ? $value : self::prepareBind([$field], true));\n }\n return (new static);\n }", "public function logicalAnd($constraint1)\n {\n if (is_array($constraint1)) {\n $resultingConstraint = array_shift($constraint1);\n $constraints = $constraint1;\n } else {\n $constraints = func_get_args();\n $resultingConstraint = array_shift($constraints);\n }\n\n if ($resultingConstraint === null) {\n throw new InvalidNumberOfConstraintsException('There must be at least one constraint or a non-empty array of constraints given.', 1268056288);\n }\n\n foreach ($constraints as $constraint) {\n $resultingConstraint = $this->qomFactory->_and($resultingConstraint, $constraint);\n }\n return $resultingConstraint;\n }", "public function assertQueryTrue($prop, ...$props)\n {\n global $wp_query;\n $all = array(\n 'is_404',\n 'is_admin',\n 'is_archive',\n 'is_attachment',\n 'is_author',\n 'is_category',\n 'is_comment_feed',\n 'is_date',\n 'is_day',\n 'is_embed',\n 'is_feed',\n 'is_front_page',\n 'is_home',\n 'is_month',\n 'is_page',\n 'is_paged',\n 'is_post_type_archive',\n 'is_posts_page',\n 'is_preview',\n 'is_robots',\n 'is_search',\n 'is_single',\n 'is_singular',\n 'is_tag',\n 'is_tax',\n 'is_time',\n 'is_trackback',\n 'is_year',\n );\n\n $props = array_merge((array)$prop, ...$props);\n\n foreach ($props as $true_thing) {\n $this->assertContains($true_thing, $all, \"{$true_thing}() is not handled by assertQueryTrue().\");\n }\n\n $passed = true;\n $not_false = $not_true = array(); // properties that were not set to expected values\n\n foreach ($all as $query_thing) {\n $result = is_callable($query_thing) ? $query_thing() : $wp_query->$query_thing;\n\n if (in_array($query_thing, $props, true)) {\n if (!$result) {\n $not_true[] = $query_thing;\n $passed = false;\n }\n } elseif ($result) {\n $not_false[] = $query_thing;\n $passed = false;\n }\n }\n\n $message = '';\n if (count($not_true)) {\n $message .= implode(', ', $not_true) . ' is expected to be true. ';\n }\n if (count($not_false)) {\n $message .= implode(', ', $not_false) . ' is expected to be false.';\n }\n $this->assertTrue($passed, $message);\n }", "public function and_having_open()\n {\n $this->_having[] = array('AND' => '(');\n\n return $this;\n }", "public function where(...$args)\n {\n $this->addCondition('and', $args, $this->conditions);\n return $this;\n }", "public function and_where_open()\n {\n $this->_where[] = array('AND' => '(');\n return $this;\n }", "public function iCheckForAnd($filter, $color )\n {\n $this->visit(\"/catalogsearch/result/?q=\" . $color);\n $this->clickLink($filter);\n \n }", "public function andClause()\n {\n if ($this->_hasDqlQueryPart('where')) {\n $this->_addDqlQueryPart('where', 'AND', true);\n }\n\n $this->_addDqlQueryPart('where', '(', true);\n\n $this->_startClause = true;\n\n return $this;\n }" ]
[ "0.76887393", "0.73466086", "0.7150239", "0.6608609", "0.6476244", "0.6384772", "0.62369454", "0.6224481", "0.6117457", "0.60457873", "0.60331917", "0.6002561", "0.59213495", "0.5826279", "0.572008", "0.5701629", "0.56992877", "0.56877637", "0.5686607", "0.5584749", "0.5555365", "0.5531815", "0.5520472", "0.55017036", "0.5439322", "0.5391797", "0.5390969", "0.53889257", "0.5378914", "0.537122", "0.5346408", "0.5334393", "0.5307299", "0.52997875", "0.52992755", "0.52979696", "0.5287985", "0.52760434", "0.52760327", "0.5256093", "0.52545065", "0.5243503", "0.52411014", "0.5240036", "0.5238701", "0.519814", "0.51640356", "0.5155262", "0.51501656", "0.5146215", "0.51460195", "0.51390946", "0.51371455", "0.51204896", "0.51104987", "0.50926244", "0.50824565", "0.507702", "0.50735974", "0.50590456", "0.5047772", "0.50444394", "0.5033225", "0.50309503", "0.5026102", "0.5022036", "0.50041294", "0.49996865", "0.49974373", "0.49841177", "0.49840003", "0.4980207", "0.49783868", "0.49758953", "0.49748114", "0.4960512", "0.495758", "0.4940865", "0.49138612", "0.49136397", "0.49083462", "0.48935115", "0.48881507", "0.48805422", "0.48770398", "0.48734185", "0.4873249", "0.48724398", "0.48642167", "0.48641476", "0.48573563", "0.48560357", "0.4847741", "0.48409885", "0.48409712", "0.48344457", "0.48302817", "0.48284912", "0.48209888", "0.48193136" ]
0.68841064
3
Test logical XOR rule container
public function testXorRule() { $rule = $this->getRuleBuilder()->fromArray(array( 'false', 'true', 'false' ), 'xor'); $this->assertTrue($rule->validate()); $rule = $this->getRuleBuilder()->fromArray(array( 'false', 'false' ), 'xor'); $this->assertFalse($rule->validate()); $rule = $this->getRuleBuilder()->fromArray(array( 'false', 'true', 'true' ), 'xor'); $this->assertFalse($rule->validate()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function logicalXor()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalXor', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "function variant_xor($left, $right) {}", "public function testXor()\n {\n $this->assertEquals(0x7998bfda, ChaCha20Block::xor(0x01020304, 0x789abcde));\n }", "function yy_r149(){$this->_retvalue = ' XOR '; }", "public static function static_logicalXor($a = null, $b = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public static function logicalXor(Matcher $matcher /*...*/)\n {\n return new Matcher\\LogicalXor(func_get_args());\n }", "public function xorDataProvider()\n {\n // A, B, expected result\n return [\n [[], [], []],\n [['a'], ['b'], ['a', 'b']],\n [['a', 'b'], ['b'], ['a']],\n [['a', 'b'], ['b', 'a'], []],\n ];\n }", "function xxor($x,$y) {\n return $x ^ $y;\n}", "public function isOr();", "private function xorOperation(string $message, string $key)\n\t{\n\t\tif (($length = strlen($message)) !== strlen($key)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$result = '';\n\n\t\tfor ($i=0; $i<$length; $i++) { \n\t\t\t$m = substr($message, $i, 1);\n\t\t\t$k = substr($key, $i, 1);\n\t\t\t$xorResult = (boolval($m) xor boolval($k));\n\t\t\t$bit = $xorResult ? '1' : '0';\n\t\t\t$result .= $bit;\n\t\t}\n\n\t\treturn $result;\n\t}", "private function truthValue($current_item, $mutual, $table, $negate, $xor, $xand) {\n if (!is_array($current_item)) {\n // see if translation table is given\n if ($table && isset($table[$current_item])) {\n $current_item = $table[$current_item];\n }\n // cast to string and lower case for easier comparison\n $v = strtolower(\"\".$current_item);\n if ($v == 'true' || $v == '1') {\n return !$negate;\n }\n return $negate;\n }\n // item is a list\n $a = array();\n // should we negate next item, was it a list or values\n $next_item_negate = FALSE;\n $next_item_xor = FALSE;\n $next_item_xand = FALSE;\n\n foreach ($current_item as $item) {\n // negation marker\n if ($item == -1) {\n $next_item_negate = TRUE;\n // xor marker\n } else if ($item == -2) {\n $next_item_xor = TRUE;\n // xand marker\n } else if ($item == -3) {\n $next_item_xand = TRUE;\n } else {\n $a[] = $this->truthValue($item, !$mutual, $table, $next_item_negate, $next_item_xor, $next_item_xand);\n // reset negation and xor\n $next_item_negate = FALSE;\n $next_item_xor = FALSE;\n $next_item_xand = FALSE;\n }\n }\n // is group AND / OR / XOR\n // take care of negation for the list result too\n if ($xor) {\n // if only one of the values is true, but not more\n if ($negate) {\n return !$this->one($a);\n }\n return $this->one($a);\n } else if ($xand) {\n // if any of the values is true, but not all\n if ($negate) {\n return !$this->some($a);\n }\n return $this->some($a);\n } else if ($mutual) {\n // if all values are true\n if ($negate) {\n return !$this->all($a);\n }\n return $this->all($a);\n } else {\n // if some of the values is true\n if ($negate) {\n return !$this->any($a);\n }\n return $this->any($a);\n }\n }", "function xorimg($imagick1, $imagick2){\n\t$iter1 = new ImagickPixelIterator($imagick1);\n\t$iter2 = new ImagickPixelIterator($imagick2);\n\t$count = 0;\n\n\tforeach ($iter1 as $pixelRow1){\n\t\tif (!$iter2->valid()){\n\t\t\tbreak; // make sure iter2 is still valid\n\t\t}\n\t\t$pixelRow2 = $iter2->current();\n\n\t\tforeach($pixelRow1 as $column=>$pixel1){\n\t\t\t$pixel2 = $pixelRow2[$column];\n\n\t\t\t$color1 = $pixel1->getColor();\n\t\t\t$color2 = $pixel2->getColor();\n\n\t\t\t$newcolor = array();\n\t\t\t$newR = $color1['r'] ^ $color2['r'];\n\t\t\t$newG = $color1['g'] ^ $color2['g'];\n\t\t\t$newB = $color1['b'] ^ $color2['b'];\n\t\t\t$pixel1->setColor(\"rgb($newR, $newG, $newB)\");\n\t\t\t$count++;\n\t\t}\n\t\t$iter2->next();\n\t\t$iter1->syncIterator();\n\t}\n\n\treturn $imagick1;\n}", "public function testConstructorContainer()\n {\n $rule = new AndRule(\n new TrueRule(),\n new OrRule(\n new FalseRule(),\n new TrueRule()\n ),\n new NotRule(\n new FalseRule()\n )\n );\n $this->assertTrue($rule->validate());\n }", "function repeatingKeyXOR($data, $key)\n{\n $dataLen = strlen($data);\n $keyLen = strlen($key);\n\n for ($i = 0; $i < $dataLen; $i++) {\n $data[$i] = $data[$i] ^ $key[$i % $keyLen];\n }\n\n return $data;\n}", "public function testOrRule()\n {\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'true'\n ), 'or');\n $this->assertTrue($rule->validate());\n\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'false'\n ), 'or');\n $this->assertFalse($rule->validate());\n }", "function break_repeating_key_XOR($args = NULL) {\n\n\n\tif ($args==NULL) {\n\t\treturn false;\n\t}\n\n\t// INIT PARAMETERS\n\t$kl_min = 2;\n\t$kl_max = 10;\n\tif (isset($args['kl_min'])) {\n\t\t$kl_min = $args['kl_min'];\n\t}\n\tif (isset($args['kl_max'])) {\n\t\t$kl_max = $args['kl_max'];\n\t}\n\n\t// Recupero il testo cifrato a seconda che venga passato direttamente\n\t// o sia passato l'url di un file\n\t$cypher = '';\n\tif ($args['file']!=NULL) {\n\t\t$lines = file($args['file'], FILE_IGNORE_NEW_LINES);\n\n\t\tset_time_limit(0);\n\t\tforeach($lines as $line) {\n\t\t\t$cypher .= $line;\n\t\t}\n\t\tset_time_limit(30);\n\t}\n\telse if ($args['string']) {\n\t\t$cypher = $args['string'];\n\t}\n\n\t//echo $cypher.\"<br><br>\";\n\n\t$cypher = $this->base64_to_hex($cypher);\n\t$array_norm_keylegth = array();\n\tfor ($keylength=2; $keylength <= 40; $keylength++) { \n\t\t$sum = 0;\n\t\t$keylength_byte = $keylength*2;\n\t\t//echo $keylength.\"<br>\";\n\t\tfor ($i=0; $i < 4; $i++) { \n\t\t\t$str1 = substr($cypher, ($keylength_byte*2)*$i, $keylength_byte);\n\t\t\t$str2 = substr($cypher, (($keylength_byte*2)*$i)+$keylength_byte, $keylength_byte);\n\t\t\t//echo \"#### \".$str1.\"<br>\";\n\t\t\t//echo \"#### \".$str2.\"<br>\";\n\t\t\t//echo \"#### \".$this->helper->hamming_distance($str1, $str2)/$keylength.\"<br><br>\";\n\t\t\t$sum = $sum + $this->helper->hamming_distance($str1, $str2)/$keylength_byte;\n\t\t}\n\n\t\t//echo \"######## \".$sum.\"<br>\";\n\t\t//echo \"######## \".($sum/4).\"<br>\".\"<br>\";\n\n\t\t//echo \"###################################<br><br>\";\n\t\t\n\t\t$array_norm_keylegth[] = array('norm_keylength' => $sum/4, 'keylength' => $keylength_byte);\n\t\t\n\t}\n\n\tusort($array_norm_keylegth, function($a, $b) {\n\t\t$el1 = $a['norm_keylength'];\n\t\t$el2 = $b['norm_keylength'];\n\n\t\tif ($el1 == $el2) return 0;\n\n\t\treturn ($el1 < $el2) ? -1 : 1;\n\t});\n\n\t//echo \"<pre>\";\n\t//print_r($array_norm_keylegth);\n\t//echo \"</pre>\";\n\n\t$keylength_candidata = $array_norm_keylegth[0]['keylength'];\n\n\t$array_blocchi_testo_keylength = $this->helper->unique_split_to_array($cypher, $keylength_candidata*2);\n\n\t//echo \"<pre>\";\n\t//print_r($array_blocchi_testo_keylength);\n\t//echo \"</pre>\";\n\n\t$array_string = array();\n\tfor ($i=0; $i<(($keylength_candidata*2)); $i += 2) { \n\t\t$partial_string = '';\n\t\tforeach ($array_blocchi_testo_keylength as $string) {\n\t\t\t$partial_string .= substr($string, $i, 2);\n\t\t}\n\t\t$array_string[] = $partial_string;\n\n\t\techo \"<pre>\";\n\t\tprint_r($this->single_byte_xor_cipher($partial_string, \n\t\t\t\t\t\t\t\t\t\t \t 16, \n\t\t\t\t\t\t\t\t\t\t \t array('min'=>0, 'max'=>255),\n\t\t\t\t\t\t\t\t\t\t \t array('total_letter'=>1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'first_letter'=>0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'second_letter'=>0)));\n\t\techo \"</pre>\";\n\n\t\techo \"<br>################################################</br>\";\n\t}/**/\n\n\techo \"<pre>\";\n\tprint_r($array_string);\n\techo \"</pre>\";\n\n\t// Controllo le ripetizioni di sottostrighe\n\t/*set_time_limit(0);\n\t$array_text = array();\n\n\t$dim_cypher = strlen($cypher);\n\t$occurences = array();\n\n\tfor ($i = floor($dim_cypher/2); $i>0; $i--) {\n\t\t$offset_sx = 0;\n\t\t$offset_dx = $dim_cypher-$i;\n\t\t$finito = false;\n\t\twhile ((($i <= $offset_sx)||($i<=$offset_dx))\n\t\t\t &&($offset_sx<=$dim_cypher)\n\t\t\t &&($offset_dx>=0)) {\n\n\t\t\t$text = substr($cypher, $offset_sx, $i);\n\n\t\t\t$occurences = $this->helper->strpos_all($cypher, $text);\n\t\t\tif (count($occurences)>1) {\n\t\t\t\t$finito = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$offset_sx++;\n\t\t\t$offset_dx--;\n\t\t}\n\n\t\tif ($finito) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tset_time_limit(30);\n\n\t/*echo $text.\"<br>\";\n\tprint_r($occurences);*/\n\n\n\t// Possibili keylengths e valutazione con distanza di hemming\n\t/*set_time_limit(0);\n\t$distance = $occurences[1] - $occurences[0];\n\t//echo \"<br>distance: \".$distance.\"<br>\";\n\n\t$keylengths = 0;\n\t$array_somme = array();\n\t$smaller_avarage_dist = 0;\n\t$guessed_keylength = 0;\n\tfor ($i=1; $i <= $distance; $i++) { \n\t\t//echo \"<br>#### distance%i: \".($distance%$i).\"<br>\";\n\t\tif (($distance%$i)==0) {\n\t\t\t$keylength = $distance/$i; // sottomultipli $distance\n\n\t\t\tif ($keylength>2) {\n\t\t\t\t//echo \"<br>######## keylengths: \".($keylengths).\"<br>\";\n\t\t\t\t$array_blocchi_testo = $this->helper->unique_split_to_array($cypher, $keylength);\n\t\t\t\t//print_r($array_blocchi_testo);\n\t\t\t\t$d_crypt = 0;\n\t\t\t\t$somma_d_crypt = 0;\n\t\t\t\tfor ($j=0; $j < count($array_blocchi_testo)-1; $j += 2) { \n\t\t\t\t\t$str1 = $array_blocchi_testo[$j];\n\t\t\t\t\t$str2 = $array_blocchi_testo[$j+1];\n\n\t\t\t\t\tif (strlen($str1) == strlen($str2)) {\n\t\t\t\t\t\t$d_crypt = $this->helper->hamming_distance($str1, $str2)/$keylength;\n\t\t\t\t\t}\n\n\t\t\t\t\t$somma_d_crypt = $somma_d_crypt + $d_crypt;\n\n\t\t\t\t}\n\t\t\t\t//echo \"<br>######## j-2\".($j-2).\"<br>\";\n\t\t\t\t$array_somme[] = array(\"avar_norm\"=>$somma_d_crypt/($j-2), \"keylength\"=>$keylength);\n\t\t\t}\n\t\t}\n\n\t}\n\tset_time_limit(30);\n\n\tusort($array_somme, function($a, $b) {\n\t\t$el1 = $a['avar_norm'];\n\t\t$el2 = $b['avar_norm'];\n\n\t\tif ($el1 == $el2) return 0;\n\n\t\treturn ($el1 < $el2) ? -1 : 1;\n\t});\n\n\t$keylength_candidata = $array_somme[0]['keylength'];\n\n\t$array_blocchi_testo_keylength = $this->helper->unique_split_to_array($cypher, $keylength_candidata);\n\n\t/*echo \"<pre>\";\n\tprint_r($array_blocchi_testo_keylength);\n\techo \"</pre>\";*/\n\n\t/*$array_string = array();\n\tfor ($i=0; $i<$keylength_candidata; $i++) { \n\t\t$partial_string = '';\n\t\tforeach ($array_blocchi_testo_keylength as $string) {\n\t\t\t$partial_string .= $string[$i];\n\t\t}\n\t\t$array_string[$i] = $this->base64_to_hex($partial_string);\n\n\t\techo \"<pre>\";\n\t\tprint_r($this->single_byte_xor_cipher($array_string[$i], \n\t\t\t\t\t\t\t\t\t\t \t 16, \n\t\t\t\t\t\t\t\t\t\t \t array('min'=>0, 'max'=>255),\n\t\t\t\t\t\t\t\t\t\t \t array('total_letter'=>1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'first_letter'=>0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'second_letter'=>0))[0]);\n\t\techo \"</pre>\";\n\n\t\techo \"<br>################################################</br>\";\n\t}\n\n\t/*echo \"<pre>\";\n\tprint_r($array_string);\n\techo \"</pre>\";*/\n\n}", "static function logicalOr()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalOr', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function testGetOperatorSigil0()\n{\n\n $actual = $this->bitwiseOr->getOperatorSigil();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "function simpleXor($InString, $Key) {\n\n // Initialise key array\n\n $KeyList = array();\n\n // Initialise out variable\n\n $output = \"\";\n\n \n\n // Convert $Key into array of ASCII values\n\n for($i = 0; $i < strlen($Key); $i++){\n\n $KeyList[$i] = ord(substr($Key, $i, 1));\n\n }\n\n\n\n // Step through string a character at a time\n\n for($i = 0; $i < strlen($InString); $i++) {\n\n // Get ASCII code from string, get ASCII code from key (loop through with MOD), XOR the two, get the character from the result\n\n // % is MOD (modulus), ^ is XOR\n\n $output.= chr(ord(substr($InString, $i, 1)) ^ ($KeyList[$i % strlen($Key)]));\n\n }\n\n\n\n // Return the result\n\n return $output;\n\n}", "public function operators();", "public function testIsSameParity()\n\t{\n\t\t$this->assertTrue(ParityGame\\isSameParity([2, 4, 6]));\n\t\t$this->assertTrue(ParityGame\\isSameParity([-1, 5, -23]));\n\n\t\t$this->assertFalse(ParityGame\\isSameParity([1, 2, 7, 11]));\n\t\t$this->assertFalse(ParityGame\\isSameParity([-21, 10, -4]));\n\t}", "public function testGetType0()\n{\n\n $actual = $this->bitwiseOr->getType();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public static function calculate(Expression $expr): Expression\n {\n $triangle = self::buildTriangle($expr->toVectorValuedFunction());\n\n $table = TruthTable::tabulate($expr);\n $rows = $table->getRows();\n\n $prev = null;\n\n foreach ($triangle as $i => $triangleRow) {\n if ($triangleRow[0]) {\n if ($prev === null) {\n $prev = self::buildConjunctives(array_values($rows[$i]), $table->getVariables());\n continue;\n }\n\n $prev = new BinaryExpression(\n self::buildConjunctives(array_values($rows[$i]), $table->getVariables()),\n BinaryOperators::XOR,\n $prev\n );\n }\n }\n\n return $prev;\n }", "public function xorWhere($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_where, Predicate::MAYBE, $field, $op, $value);\n }", "public function validarLogicasNegocio($operacion){\n return;\n }", "public function validarLogicasNegocio($operacion){\n return;\n }", "static function logicalNot(PHPUnit_Framework_Constraint $constraint)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalNot', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public static function evaluate_unary_logic($c, $operator) {\n switch($operator) {\n case SC_Survey_Flow::LO_NOT:\n return !$c;\n break;\n }\n\n return FALSE;\n }", "function comp($a,$b) {\n if ((count($a == count($b))) && ($a !== \"\")) { \n foreach ($a as $check) {\n // if !exists $a ~ $b\n if (!in_array($check*$check, $b)) {\n return false;\n }\n }\n return true;\n }\n return false;\n}", "private function imageXorOperation($keyImg, $messageImg)\n\t{\n\t\t$width = imagesx($keyImg);\n\t\t$height = imagesy($keyImg);\n\n\t\t$size = $width * $height;\n\n\t\t$result = \"\";\n\t\t$nullByteTest = \"\";\n\n\t\tfor ($i=0; $i<$size ; $i++) { \n\t\t\t$xCoord = $i % $width;\n\t\t\t$yCoord = (int)floor($i / $width);\n\n\t\t\t$keyIndex = imagecolorat($keyImg, $xCoord, $yCoord);\n\t\t\t$keyRgba = imagecolorsforindex($keyImg, $keyIndex);\n\t\t\t$keyR = $keyRgba['red'];\n\n\t\t\t$messageIndex = imagecolorat($messageImg, $xCoord, $yCoord);\n\t\t\t$messageRgba = imagecolorsforindex($messageImg, $messageIndex);\n\t\t\t$messageR = $messageRgba['red'];\n\n\t\t\t// We have four cases, they are summarized bellow (b is background value):\n\t\t\t// key, message, difference, xorResult\n\t\t\t// 1) b+1, b+0, 1, 1\n\t\t\t// 2) b+1, b+1, 0, 0\n\t\t\t// 3) b+0, b+0, 0, 0\n\t\t\t// 4) b+0, b+1, -1, 1\n\t\t\t// The xor result is the absolute value of the difference.\n\t\t\t$difference = $keyR - $messageR;\n\t\t\t$xorResult = abs($difference);\n\n\t\t\t// If we have a null byte, we consider that it is the end of the string (with reason).\n\t\t\tif ($i%8 == 0) {\n\t\t\t\tif ($nullByteTest == '00000000') {\n\t\t\t\t\t// Null byte is taken out of the result befor return\n\t\t\t\t\t$result = substr($result, 0, -8);\n\t\t\t\t\treturn $result;\n\t\t\t\t}\n\n\t\t\t\t$nullByteTest = \"\";\n\t\t\t}\n\n\t\t\t$nullByteTest .= (string)$xorResult;\n\t\t\t$result .= (string)$xorResult;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function testAddCommutative()\n {\n $this\n ->given(\n $a = $this->fromNative($this->randomNativeNumber())->toInteger(),\n $b = $this->fromNative($this->randomNativeNumber())->toReal(),\n $c = $this->fromNative($this->randomNativeNumber())->toDecimal()\n )\n ->then\n ->boolean(\n $a->add($b)->equals($b->add($a))\n )->isTrue()\n ->boolean(\n $a->add($c)->equals($c->add($a))\n )->isTrue()\n ->boolean(\n $b->add($c)->equals($c->add($b))\n )->isTrue()\n ;\n }", "public function bitXor(BitArray $x) {\n if($this->size() != $x->size()) {\n throw new Exception('Arguments must be of the same length');\n }\n \n foreach($this as $key => $value) {\n $this[$key] = $value ^ $x[$key];\n }\n \n return $this;\n }", "function o_ne($a, $b) {\n\t\t\treturn Obj::singleton()->notEqual($a, $b);\n\t\t}", "public function testNonsuppliedBitflagsAreLeftAlone()\n {\n $bit = new Formulaic\\Bitflag('superhero', [\n 'spidey' => 'Spiderman',\n 'hulk' => 'The Hulk',\n 'daredevil' => 'Daredevil',\n ]);\n $bit->setDefaultValue(['superman']);\n $bit->setValue(['hulk']);\n yield assert($bit->getValue()->hulk);\n yield assert(!isset($bit->getValue()->superman));\n }", "function simpleXor($InString, $Key) {\n // Initialise key array\n $KeyList = array();\n // Initialise out variable\n $output = \"\";\n \n // Convert $Key into array of ASCII values\n for($i = 0; $i < strlen($Key); $i++){\n $KeyList[$i] = ord(substr($Key, $i, 1));\n }\n\n // Step through string a character at a time\n for($i = 0; $i < strlen($InString); $i++) {\n // Get ASCII code from string, get ASCII code from key (loop through with MOD), XOR the two, get the character from the result\n // % is MOD (modulus), ^ is XOR\n $output.= chr(ord(substr($InString, $i, 1)) ^ ($KeyList[$i % strlen($Key)]));\n }\n\n // Return the result\n return $output;\n}", "function variant_or($left, $right) {}", "public function validarLogicasNegocio($operacion){\n\t\t//print_r($this);die();\n\t\tif($this->esEquipamientoDeAlquiler['valor'] == '1'){\n\t\t\t$this->equipamientoDeAlquiler['obligatorio'] = TRUE;\n\t\t}else{\n\t\t\t$this->equipamientoDeAlquiler['obligatorio'] = FALSE;\n\t\t\t$this->equipamientoDeAlquiler['valor'] = null;\n\t\t}\n return $resultMessage;\n \t}", "public function test_bool_variable_and_even_or_odd_method()\n {\n $parameter_one = 'first';\n $parameter_two = 'second';\n \n for ($i=0; $i<10; $i++)\n {\n $string = math::even_or_odd($parameter_one, $parameter_two);\n \n $this->assertInternalType('string', $string);\n $this->assertNotEmpty($string);\n \n if ($i % 2 == 0)\n {\n $this->assertEquals($string, $parameter_one);\n $this->assertNotEquals($string, $parameter_two);\n }\n else\n {\n $this->assertNotEquals($string, $parameter_one);\n $this->assertEquals($string, $parameter_two);\n }\n }\n }", "public function testNotRule()\n {\n $rule = new NotRule();\n $rule->addRule(new TrueRule());\n\n $this->assertFalse($rule->validate());\n\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n ), 'not');\n $this->assertTrue($rule->validate());\n\n\n try {\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'true',\n ), 'not');\n } catch (\\RuntimeException $e) {\n $rule = null;\n }\n $this->assertNull($rule);\n\n }", "function calc_checksum($cmd,$data){\n $xor_value = 0;\n $xor_value = $xor_value ^ $cmd;\n foreach($data as $byte) {\n $xor_value = $xor_value ^ $byte;\n }\n /*\n If value is less than 0x20 then add 0x20\n Eg If xor of CMD and DATA results in 0x0A then CHECKSUM = 0x2A\n */\n if ($xor_value < CHECKSUM_OFFSET) {\n $xor_value = $xor_value + CHECKSUM_OFFSET;\n }\n return $xor_value;\n}", "public function operatorNco()\n\t{\n\t\treturn $this->getValue() != $this->recordModel->get('assigned_user_id');\n\t}", "public function getTrueIterator();", "function _binxor($l, $r)\n {\n $x = (($l < 0) ? (float)($l + 4294967296) : (float)$l)\n ^ (($r < 0) ? (float)($r + 4294967296) : (float)$r);\n\n return (float)(($x < 0) ? $x + 4294967296 : $x);\n }", "public function validarLogicasNegocio($operacion){\n\t\t//print_r($this);die();\n\t\tif($this->esEmpleadoTemporario['valor'] == '1'){\n\t\t\t$this->empleadoTemporario['obligatorio'] = TRUE;\n\t\t}else{\n\t\t\t$this->empleadoTemporario['obligatorio'] = FALSE;\n\t\t\t$this->empleadoTemporario['valor'] = null;\n\t\t}\n return $resultMessage;\n \t}", "public function logicalOperator($operator = null);", "abstract public function get_operator();", "public function getCompound(): bool;", "function calc_checksum2($cmd1,$cmd2,$bytes){\n $xor_value = 0;\n $xor_value = $xor_value ^ $cmd1;\n $xor_value = $xor_value ^ $cmd2;\n foreach($bytes as $byte) {\n $xor_value = $xor_value ^ $byte;\n }\n /*\n If value is less than 0x20 then add 0x20\n Eg If xor of CMD and DATA results in 0x0A then CHECKSUM = 0x2A\n */\n if ($xor_value < CHECKSUM_OFFSET) {\n $xor_value = $xor_value + CHECKSUM_OFFSET;\n }\n return $xor_value;\n}", "protected static function logicalOR(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('OR', $values);\n\t}", "public function modif_boolbin() \r\n\t{\r\n\t\t$this->boolbin = abs($this->boolbin-1);\t\r\n\t}", "public function testConstructorLength()\n {\n $rule = new OrRule(\n new FalseRule(),\n new TrueRule()\n );\n $this->assertTrue($rule->validate());\n }", "public function logicalNot($constraint)\n {\n return $this->qomFactory->not($constraint);\n }", "private function getBinaryOperators()\n\t{\n\t\t// http://php.net/manual/en/language.operators.precedence.php\n\n\t\t// operator => array(precedence, associativity, [cast])\n\t\treturn array(\n\t\t\t'^' => array(60, self::RIGHT_ASSOC),\n\t\t\t'**' => array(60, self::RIGHT_ASSOC),\n\n\t\t\t'*' => array(40, self::LEFT_ASSOC),\n\t\t\t'/' => array(40, self::LEFT_ASSOC),\n\t\t\t'%' => array(40, self::LEFT_ASSOC),\n\n\t\t\t'+' => array(30, self::LEFT_ASSOC),\n\t\t\t'-' => array(30, self::LEFT_ASSOC),\n\t\t\t'.' => array(30, self::LEFT_ASSOC),\n\n\t\t\t'<' => array(20, self::NON_ASSOC),\n\t\t\t'<=' => array(20, self::NON_ASSOC),\n\t\t\t'>' => array(20, self::NON_ASSOC),\n\t\t\t'>=' => array(20, self::NON_ASSOC),\n\n\t\t\t'^=' => array(20, self::NON_ASSOC),\n\t\t\t'*=' => array(20, self::NON_ASSOC),\n\t\t\t'$=' => array(20, self::NON_ASSOC),\n\t\t\t'~' => array(20, self::NON_ASSOC),\n\n\t\t\t'<>' => array(10, self::NON_ASSOC),\n\t\t\t'==' => array(10, self::NON_ASSOC),\n\t\t\t'!=' => array(10, self::NON_ASSOC),\n\n\t\t\t'&&' => array(6, self::NON_ASSOC),\n\t\t\t'||' => array(5, self::NON_ASSOC),\n\t\t\t'AND' => array(4, self::NON_ASSOC),\n\t\t\t'XOR' => array(3, self::NON_ASSOC),\n\t\t\t'OR' => array(2, self::NON_ASSOC),\n\t\t);\n\t}", "function neparan($b)\n{\n if($b%2==0)\n {\n return false;\n }\n else\n {\n return true;\n }\n}", "function fixed_xor($str1, $str2, $bit=4) {\n\n\t$str1 = strtolower($str1);\n\t$str2 = strtolower($str2);\n\n\t$xor_hex = '';\n\tfor($i=0; $i<strlen($str1); $i++) {\n\t\t$char_str1_hex_to_bin = sprintf('%0'.$bit.'d', base_convert($str1[$i], 16, 2));\n\t\t$char_str2_hex_to_bin = sprintf('%0'.$bit.'d', base_convert($str2[$i], 16, 2));\n\n\t\t$xor_bin_partial = '';\n\t\tfor($j=0; $j<$bit; $j++) {\n\t\t\t$xor_bin_partial .= ($char_str1_hex_to_bin[$j] xor $char_str2_hex_to_bin[$j]) ? '1' : '0';\n\n\t\t\tif ((($j+1)%4) == 0) {\n\t\t\t\t$xor_hex .= base_convert($xor_bin_partial, 2, 16);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $xor_hex;\n}", "function _xorMerge($string, $key)\n {\n $hash = $this->hash($key);\n $str = '';\n for ($i = 0; $i < strlen($string); $i++) {\n $str .= substr($string, $i, 1) ^ substr($hash, ($i % strlen($hash)), 1);\n }\n\n return $str;\n }", "static private function champGaloisSum($a, $b){\n return $a ^ $b;\n }", "public function containsOperators() {\n\t\t$pattern = [];\n\t\tforeach ( $this->wildcardingOperators as $op ) {\n\t\t\t$pattern[] = \"\\\\$op\";\n\t\t}\n\t\t$pattern = \"/\" . implode( '|', $pattern ) . \"/\";\n\n\t\tif ( preg_match( $pattern, $this->original ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Special operators should not be removable by config\n\t\tif ( strpos( $this->original, 'AND' ) || strpos( $this->original, 'OR' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function isOdd($num){\r\n\treturn (is_numeric($num)&($num&1));\r\n}", "public static function ne(IInt32\\Type $x, Core\\Type $y) : IBool\\Type { // !=\n\t\t\treturn IBool\\Module::not(IInt32\\Module::eq($x, $y));\n\t\t}", "function lola_check_all_transitions_negated($check_name, $formula) {\n global $petrinet;\n foreach ($petrinet[\"transitions\"] as $transition) {\n $ret = lola_check_single_transition($check_name, $formula, $transition[\"id\"]);\n if ($ret->result) {\n debug(\"Single negated transition check \" . $check_name . \" for transition \" . $transition[\"id\"] . \" succeeded, returning false\");\n return new CheckResult(false, $ret->witness_path, $ret->witness_state);\n }\n }\n return new CheckResult(true, \"\", \"\");\n }", "protected function is_associative_commutative_operator($node) {\n return $node->type == qtype_preg_node::TYPE_NODE_ALT;\n }", "public static function ni(IInt32\\Type $x, Core\\Type $y) : IBool\\Type { // !==\n\t\t\treturn IBool\\Module::not(IInt32\\Module::id($x, $y));\n\t\t}", "protected function allowedLogicalOperators(): array\n {\n return [\n FieldCriteria::AND,\n FieldCriteria::OR,\n ];\n }", "protected function is_operator($node) {\n return !($node->type == qtype_preg_node::TYPE_LEAF_CHARSET\n || $node->type == qtype_preg_node::TYPE_LEAF_ASSERT\n || $node->type == qtype_preg_node::TYPE_LEAF_META\n || $node->type == qtype_preg_node::TYPE_LEAF_BACKREF\n || $node->type == qtype_preg_node::TYPE_LEAF_SUBEXPR_CALL\n || $node->type == qtype_preg_node::TYPE_LEAF_TEMPLATE\n || $node->type == qtype_preg_node::TYPE_LEAF_CONTROL\n || $node->type == qtype_preg_node::TYPE_LEAF_OPTIONS\n || $node->type == qtype_preg_node::TYPE_LEAF_COMPLEX_ASSERT);\n }", "function yy_r147(){ $this->_retvalue = new Stmt\\Expr('not', $this->yystack[$this->yyidx + 0]->minor); }", "public function isAnd();", "protected function BinaryXOR( $strBin1, $strBin2 )\n\t{\n\t\t$strBinaryFinal = '';\n\t\tfor( $intPos = 1 ; $intPos <= \\strlen( $strBin1 ) ; $intPos = $intPos + 1 )\n\t\t{\n\t\t\tswitch( substr( $strBin1, intval( $intPos ) - 1, 1 ) )\n\t\t\t{\n\t\t\t\tcase substr( $strBin2, intval( $intPos ) - 1, 1 ) :\n\t\t\t\t\t$strBinaryFinal = $strBinaryFinal . \"0\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\t$strBinaryFinal = $strBinaryFinal . \"1\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $strBinaryFinal;\n\t}", "public function getOperators()\n {\n return array(\n array(\n 'not' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'),\n '-' => array('precedence' => 500, 'class' => 'Twig_Node_Expression_Unary_Neg'),\n '+' => array('precedence' => 500, 'class' => 'Twig_Node_Expression_Unary_Pos'),\n ),\n array(\n 'or' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'and' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'b-or' => array('precedence' => 16, 'class' => 'Twig_Node_Expression_Binary_BitwiseOr', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'b-xor' => array('precedence' => 17, 'class' => 'Twig_Node_Expression_Binary_BitwiseXor', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'b-and' => array('precedence' => 18, 'class' => 'Twig_Node_Expression_Binary_BitwiseAnd', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '==' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '!=' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '<' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '>' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Greater', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '>=' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '<=' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'not in' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotIn', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'in' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_In', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '..' => array('precedence' => 25, 'class' => 'Twig_Node_Expression_Binary_Range', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '+' => array('precedence' => 30, 'class' => 'Twig_Node_Expression_Binary_Add', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '-' => array('precedence' => 30, 'class' => 'Twig_Node_Expression_Binary_Sub', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '~' => array('precedence' => 40, 'class' => 'Twig_Node_Expression_Binary_Concat', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '*' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mul', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '/' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Div', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '//' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_FloorDiv', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '%' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'is' => array('precedence' => 100, 'callable' => array($this, 'parseTestExpression'), 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n 'is not' => array('precedence' => 100, 'callable' => array($this, 'parseNotTestExpression'), 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),\n '**' => array('precedence' => 200, 'class' => 'Twig_Node_Expression_Binary_Power', 'associativity' => Twig_ExpressionParser::OPERATOR_RIGHT),\n ),\n );\n }", "static function checkNetworkRelativity($firstAddress, $firstNetmask, $secondAddress,\n $secondNetmask, $version = 0) {\n\n if ($firstAddress instanceof IPAddress) {\n if ($version == 0) {\n $version = $firstAddress->getVersion();\n }\n if ($version != $firstAddress->getVersion()) {\n return \"different version\";\n }\n $firstAddress = $firstAddress->getBinary();\n }\n\n if ($firstNetmask instanceof IPAddress) {\n if ($version != $firstNetmask->getVersion()) {\n return \"different version\";\n }\n $firstNetmask = $firstNetmask->getBinary();\n }\n\n if ($secondAddress instanceof IPAddress) {\n if ($version != $secondAddress->getVersion()) {\n return \"different version\";\n }\n $secondAddress = $secondAddress->getBinary();\n }\n\n if ($secondNetmask instanceof IPAddress) {\n if ($version != $secondNetmask->getVersion()) {\n return \"different version\";\n }\n $secondNetmask = $secondNetmask->getBinary();\n }\n\n $startIndex = (($version == 4) ? 3 : 0);\n $first = true;\n $second = true;\n for ($i = $startIndex; $i < 4; ++$i) {\n $and = ($firstNetmask[$i] & $secondNetmask[$i]);\n // Be carefull : php integers are 32 bits SIGNED.\n // Thus, checking equality must be done by XOR ...\n $first &= (($and ^ $firstNetmask[$i]) == 0);\n $second &= (($and ^ $secondNetmask[$i]) == 0);\n }\n\n if (!$first && !$second) {\n return \"?\";\n }\n\n if ($first && $second) {\n $result = \"equals\";\n $mask = &$firstNetmask;\n } else if ($first) {\n $result = \"first contains second\";\n $mask = &$firstNetmask;\n } else { // $second == true\n $result = \"second contains first\";\n $mask = &$secondNetmask;\n }\n\n for ($i = $startIndex; $i < 4; ++$i) {\n if ((($firstAddress[$i] & $mask[$i]) ^ ($secondAddress[$i] & $mask[$i])) != 0) {\n return \"different\";\n }\n }\n return $result;\n }", "function consecutive(callable ...$predicates)\n{\n return function (...$arguments) use ($predicates) {\n foreach ($arguments as $index => $value) {\n if(!$predicates[$index]($value)) {\n return false;\n }\n }\n\n return true;\n };\n}", "function orB($lhs = null, $rhs = null)\n{\n return call_user_func_array(__PRIVATE__::$instance[orB], func_get_args());\n}", "public static function get_operators($rule)\n {\n }", "public function setLogical(string $operator = self::AND): static;", "function yy_r128(){$this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; }", "public function getOperators()\n\t{\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'!' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t// precedence settings are copied from similar operators in Twig core extension\n\t\t\t\t'||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\n\t\t\t\t'eq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\n\t\t\t\t'ne' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'neq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'<>' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\n\t\t\t\t'===' => array('precedence' => 20, 'class' => '\\phpbb\\template\\twig\\node\\expression\\binary\\equalequal', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'!==' => array('precedence' => 20, 'class' => '\\phpbb\\template\\twig\\node\\expression\\binary\\notequalequal', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\n\t\t\t\t'gt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Greater', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'gte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'ge' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'lt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'lte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t\t'le' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\n\t\t\t\t'mod' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => \\Twig_ExpressionParser::OPERATOR_LEFT),\n\t\t\t),\n\t\t);\n\t}", "abstract protected function logicFilter($key, $valueK, $op, $v);", "protected abstract function getOperator();", "function xor_encrypt($string, $key)\n\t{\n\t\tfor ($a=0; $a < strlen($string); $a++)\n\t\t{\n\t\t\tfor ($b=0; $b < strlen($key); $b++)\n\t\t\t{\n\t\t\t\t$string[$a] = $string[$a]^$key[$b];\n\t\t\t}\n\t\t}\n\t\n\t\treturn $string; \n\t}", "function all(callable $callback, iterable $items) : bool\n{\n return !any(complement($callback), $items);\n}", "private function getUnaryOperators()\n\t{\n\t\treturn array(\n\t\t\t'-' => array(50, self::RIGHT_ASSOC),\n\t\t\t'+' => array(50, self::RIGHT_ASSOC),\n\t\t\t'!' => array(50, self::RIGHT_ASSOC),\n\t\t);\n\t}", "public function validarLogicasNegocio($operacion){\n return $resultMessage;\n \t}", "abstract public function is_correct( $a, $comparison_operator, $b );", "private function prefixExprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (expr) == (a ? b : c)\n // op (a ? b : c) != op a ? b : c in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (expr) == (a bop b)\n // op (a bop b) != op a bop b if\n if (UnaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if op (a) bop b == op a bop b\n return $this->prefixExprNeedsParentheses($op, $expr->getExpression1());\n }\n if ($expr instanceof UnaryOpExpression) {\n switch ($expr->getOperation()) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n // let (expr) == (a uop)\n // op (a uop) op != op a uop if\n return $op == UnaryOperators::PHP_CLONE_OP;\n }\n // let (expr) == (uop a)\n // op (uop a) == op uop a in all cases\n return false;\n }\n return false;\n }", "public function testConvertToBoolean() {\r\n $data = array(\r\n true => true,\r\n false => false,\r\n 'true' => true,\r\n 'false' => false,\r\n 'test' => true,\r\n 0 => false,\r\n '0' => false,\r\n 1 => true\r\n );\r\n\r\n foreach ($data as $value => $expected) {\r\n $this->assertSame($expected, $this->_utils->convertToBoolean($value));\r\n }\r\n }", "private function isValidUnaryOperator($value)\n\t{\n\t\treturn array_key_exists($value, $this->unary_operators);\n\t}", "public static function static_logicalOr($a = null, $b = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public abstract function isAllowed($operation);", "public function csc_match() {\n\n\t\treturn $this->get_csc_result() === self::CSC_MATCH;\n\t}", "public function xorHaving($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_having, Predicate::MAYBE, $field, $op, $value);\n }", "public function testRegon2()\n{\n\n // Traversed conditions\n // for (...) == false (line 40)\n // for (...) == true (line 44)\n // for (...) == false (line 44)\n // if ($checksum == 10) == false (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function test_chainedNoMask()\n {\n //signature\tsignaturesignature\t#Ђ#M#M#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ClassBroker.getClassWithoutMask:getServiceWithoutMask:#K#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\TestService.CLASS_NAME|?\n\n $testService = $this->classBroker->getClassWithoutMask(ServiceBroker::CLASS_NAME)->getServiceWithoutMask(TestService::CLASS_NAME);\n//signature\t#M#M#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ClassBroker.getClassWithoutMask.getServiceWithoutMask|#☘#M#M#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ClassBroker.getClassWithoutMask.getServiceWithoutMaskª#K#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\TestService.CLASS_NAME♣|#M#☘#M#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ClassBroker.getClassWithoutMaskª#K#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ServiceBroker.CLASS_NAME♣.getServiceWithoutMask\n $testService->run();\n }", "public function testIsComputed() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(0));\n\n\n\t\t$this->boolean($objBuilder->isComputed())->isFalse();\n\t\t$objBuilder->compute();\n\t\t$this->boolean($objBuilder->isComputed())->isTrue();\n\n\t\t/* * */\n\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$this->boolean($objBuilder->isComputed())->isFalse();\n\t\t$objBuilder->compute();\n\t\t$this->boolean($objBuilder->isComputed())->isFalse(); // an empty graph cannot be computed\n\t}", "function oddArray(array $array): int\n {\n $odd = 0;\n\n foreach($array as $number)\n {\n if($number & 1)\n {\n $odd++;\n }\n }\n\n return $odd;\n }", "public function testRegon3()\n{\n\n // Traversed conditions\n // for (...) == false (line 40)\n // for (...) == true (line 44)\n // for (...) == false (line 44)\n // if ($checksum == 10) == true (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function emptyFalseCase(): iterable\n {\n yield [['foo' => ['a', 'b']]];\n yield [['foo' => true]];\n yield [['foo' => 1]];\n yield [['foo' => -1]];\n yield [['foo' => '1']];\n yield [['foo' => '-1']];\n yield [['foo' => 'str']];\n yield [['foo' => 'true']];\n yield [['foo' => 'false']];\n yield [['foo' => new stdClass()]];\n }", "public function testRegon6()\n{\n\n // Traversed conditions\n // for (...) == true (line 40)\n // for (...) == false (line 40)\n // for (...) == true (line 44)\n // for (...) == false (line 44)\n // if ($checksum == 10) == false (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function expressionListWithNotInIsConcatenatedWithAnd() {}", "public static function or_() {\n $result = new qti_variable('single', 'boolean', array('value' => false));\r\n $params = func_get_args();\n // Allow a single array as well as a parameter list\r\n if (count($params) == 1 && is_array($params[0])) {\r\n $params = $params[0];\r\n }\r\n foreach($params as $param) {\r\n if ($param->value) {\r\n $result->value = true;\r\n return $result;\r\n }\r\n }\r\n return $result;\n }", "public function testOrCondition() {\n\t\t$products = $this->productsManager->find(Q::orfilter(Attr::id()->eq(5), Attr::id()->eq(3)));\n\t\t$this->assertCount(2, $products);\n\t}" ]
[ "0.70542306", "0.6796768", "0.6493458", "0.63636845", "0.6223751", "0.6161255", "0.6079877", "0.59898204", "0.5517666", "0.5402776", "0.53718126", "0.5317665", "0.5187056", "0.51767814", "0.51181215", "0.5091755", "0.5089368", "0.50859904", "0.5049944", "0.50069714", "0.4999974", "0.4946603", "0.49181175", "0.4900881", "0.4896333", "0.4896333", "0.48518533", "0.48231405", "0.4814417", "0.48066726", "0.47604483", "0.47597387", "0.4733202", "0.47321704", "0.4697465", "0.46702754", "0.46647793", "0.4660821", "0.46498317", "0.46474406", "0.4632148", "0.4618752", "0.4615127", "0.45841607", "0.4576102", "0.4573234", "0.45709136", "0.4563322", "0.4548563", "0.45476735", "0.45456982", "0.45445538", "0.45428476", "0.45415187", "0.45187053", "0.44920763", "0.44873968", "0.4476703", "0.44643787", "0.44626072", "0.44581968", "0.4455651", "0.44417605", "0.44352314", "0.44256178", "0.44246817", "0.441298", "0.44048613", "0.43891555", "0.4379165", "0.43508917", "0.4347875", "0.43423745", "0.4341836", "0.4339493", "0.4328669", "0.4327807", "0.43152118", "0.43106064", "0.42941865", "0.42911366", "0.42883608", "0.427814", "0.4262332", "0.42524448", "0.425153", "0.4246459", "0.4235799", "0.4229552", "0.42240366", "0.422098", "0.42208877", "0.42111787", "0.4199991", "0.4189454", "0.41886535", "0.41886348", "0.4180088", "0.41764668", "0.41749716" ]
0.7732247
0
Create the connection to Fishbowl
public function __construct($host, $port, $user, $pass) { $this->host = $host; $this->port = $port; $this->user = $user; $this->pass = base64_encode(md5($pass, true)); $this->id = fsockopen($this->host, $this->port); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function connect() {\n $fedora_user = new stdClass();\n $fedora_user->name = $this->config->fedora->username;\n $fedora_user->pass = $this->config->fedora->password;\n $this->fedora_connect = new FedoraConnection($fedora_user, $this->config->fedora->protocol . '://' . $this->config->fedora->host . ':' . $this->config->fedora->port . '/fedora');\n }", "function __construct() {\n $this->createConnection();\n }", "public function __construct() {\n $this->connection = $this->create_connection();\n }", "private function __construct()\n {\n $this->connect();\n }", "private function __construct(){\n\t\t$this->connection = new Connection();\n\t\t$this->connection\n\t\t\t->setHost(Stack::getInstance()->get('db_host'))\n\t\t\t->setUser(Stack::getInstance()->get('db_user'))\n\t\t\t->setPassword(Stack::getInstance()->get('db_pass'))\n\t\t\t->setDatabase(Stack::getInstance()->get('db_table'))\n\t\t\t->connect();\n\t}", "public abstract function Connect();", "function __construct()\n {\n $this->createConnection();\n\n }", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function __construct( )\n {\n $this->openConnection();\n }", "function __construct() {\n $this->_connect();\n }", "function __construct() {\n $this->open_connection();\n }", "protected function connect() {}", "function __construct()\n {\n $this->connect();\n }", "public function __construct()\n\t{\n\t\t$this->connectOpen();\n\t}", "public abstract function connect();", "public function connect() {\n $this->connection = AMQPStreamConnection($this->server_ip, $this->server_port, $this->username, $this->password);\n }", "private function initShopConnection()\n\t{\n\t\t$this->ftpConnection = new FtpConnector($this->shop->ftp_host, $this->shop->ftp_login, $this->shop->ftp_password);\n\t}", "function __construct()\n\t\t{\n\t\t\t$this->conn = $this->connect();\n\t\t}", "abstract public function connect();", "abstract public function connect();", "abstract public function connect();", "abstract public function connect();", "abstract public function connect();", "abstract public function connect();", "abstract public function connect();", "function __construct() {\n $connection= new Connection;\n $this->link = $connection->conect();\n }", "function __construct(){\n\n\t\t $this->connect() ;\n\t}", "function __construct(){\n $this->open_connection();\n }", "function _getConnection()\n {\n $this->_con = Pluf::db();\n }", "public function connect()\n {\n }", "public function connect()\n {\n }", "public function connect()\n {\n }", "abstract protected function connect();", "abstract protected function connect();", "abstract protected function connect();", "protected function connect() {\n $this->connection = 'resource';\n echo $this->name . ' connected '.\"<br>\" ;\n }", "public function createClient(){\n $config = new DBALConfiguration();\n $this->dbConnection = DBALDriverManager::getConnection($this->config, $config);\n }", "function __construct()\n {\n $this->facturama = new Facturama\\Client('chinamayoreo', 'Gameofthrones1');\n }", "function createConnection( ) {\n global $conn;\n // Create connection object\n $conn = new mysqli(SERVER_NAME, DBF_USER_NAME, DBF_PASSWORD);\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n } \n }", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "protected function connect()\n {\n $url = $this->createUrl(\"\");\n // create curl resource\n $this->connection = curl_init();\n\n // set url\n curl_setopt($this->connection, CURLOPT_URL, $url);\n\n //return the transfer as a string\n curl_setopt($this->connection, CURLOPT_RETURNTRANSFER, 1);\n\n }", "public function __construct()\n {\n $this->host = \"localhost\";\n $this->user = \"buttaubc_chantal\";\n $this->pass = \"Bfly357T\";\n $this->db = \"buttaubc_SIMPLONG\";\n\n ConnectI::connexion($this->host, $this->db, $this->user, $this->pass);\n\n }", "abstract function connect();", "public function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t\t$this->OpenConnect();\n\t\t}", "public static function makeConnection()\n {\n self::$connectionManager = new ConnectionManager();\n self::$connectionManager->addConnection([\n 'host' => self::$config['host'],\n 'user' => self::$config['user'],\n 'password' => self::$config['password'],\n 'dbname' => self::$config['dbname']\n ]);\n self::$connectionManager->bootModel();\n }", "public function createConnection() {\n // below code is used to create connection usinf Orientdb\n $client = new PhpOrient($this->config['host'],$this->config['port']);\n $client->username = $this->config['username'];\n $client->password = $this->config['password'];\n if(Cache::has('odb_session_token')) {\n $client->setSessionToken(Cache::get('odb_session_token'));\n\n }else {\n $client->setSessionToken(true);\n Cache::forever('odb_session_token',$client->getSessionToken());\n }\n if($client->connect()){\n $this->clusterMap= $client->dbOpen( $this->config['database'], $this->config['username'], $this->config['password']);\n }\n return $client;\n }", "function __construct() {\n\n // Setup SQL connection\n $this->mysqli = mysqli_connect(\"fdb21.awardspace.net\", \"3400555_koolkiwiana\", \"Di3zsx@?5@O,(S*2\", \"3400555_koolkiwiana\");\n }", "function createConection(){\n\n\t\tglobal $db_host;\n\t\tglobal $db_usr;\n\t\tglobal $db_pwd;\n\t\tglobal $db_name;\n\t\tglobal $db_port;\n\n\t\treturn pg_connect('user='.$db_usr.' password='.$db_pwd.' host= '.$db_host.' dbname = '.$db_name.' port = '.$db_port);\n\t}", "function getConnection();", "public function connect()\n {\n $this->connection->connect();\n }", "public function connect()\r\n {\r\n \techo 'asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfadsf';exit;\r\n try\r\n {\r\n\r\n \t$res\t= $this->getParameterHolder();\r\n\r\n \tprint_r($res);exit;\r\n\r\n // determine how to get our settings\r\n $method = $this->getParameter('method', 'normal');\r\n\r\n switch ($method)\r\n {\r\n case 'normal':\r\n // get parameters normally, and all are required\r\n $database = $this->getParameter('database', null);\r\n $hostspec = $this->getParameter('hostspec') ? $this->getParameter('hostspec') : ($this->getParameter('host') ? $this->getParameter('hostspec') : null);\r\n $password = $this->getParameter('password', null);\r\n $phptype = $this->getParameter('phptype', null);\r\n $username = $this->getParameter('username', null);\r\n $port = $this->getParameter('port', null);\r\n $encoding = $this->getParameter('encoding', null);\r\n\r\n $dsn = array('database' => $database,\r\n 'hostspec' => $hostspec,\r\n 'password' => $password,\r\n 'phptype' => $phptype,\r\n 'username' => $username,\r\n 'port' => $port,\r\n 'encoding' => $encoding);\r\n break;\r\n\r\n case 'dsn':\r\n $dsn = $this->getParameter('dsn');\r\n\r\n if ($dsn == null)\r\n {\r\n // missing required dsn parameter\r\n $error = 'Database configuration specifies method \"dsn\", but is missing dsn parameter';\r\n\r\n throw new sfDatabaseException($error);\r\n }\r\n\r\n break;\r\n\r\n case 'server':\r\n // construct a DSN connection string from existing $_SERVER values\r\n $dsn =& $this->loadDSN($_SERVER);\r\n\r\n break;\r\n\r\n case 'env':\r\n // construct a DSN connection string from existing $_ENV values\r\n $dsn =& $this->loadDSN($_ENV);\r\n\r\n break;\r\n\r\n default:\r\n // who knows what the user wants...\r\n $error = 'Invalid CreoleDatabase parameter retrieval method \"%s\"';\r\n $error = sprintf($error, $method);\r\n\r\n throw new sfDatabaseException($error);\r\n }\r\n\r\n // get creole class path\r\n $classPath = $this->getParameter('classpath');\r\n\r\n // include the creole file\r\n if ($classPath == null)\r\n {\r\n require_once('creole/Creole.php');\r\n }\r\n else\r\n {\r\n require_once($classPath);\r\n }\r\n\r\n // set our flags\r\n $noAssocLower = $this->getParameter('no_assoc_lower', false);\r\n $persistent = $this->getParameter('persistent', false);\r\n $compatAssocLower = $this->getParameter('compat_assoc_lower', false);\r\n $compatRtrimString = $this->getParameter('compat_rtrim_string', false);\r\n\r\n $flags = 0;\r\n $flags |= ($noAssocLower) ? Creole::NO_ASSOC_LOWER : 0;\r\n $flags |= ($persistent) ? Creole::PERSISTENT : 0;\r\n $flags |= ($compatAssocLower) ? Creole::COMPAT_ASSOC_LOWER : 0;\r\n $flags |= ($compatRtrimString) ? Creole::COMPAT_RTRIM_STRING : 0;\r\n\r\n // do the duuuurtay work, right thurr\r\n if ($flags > 0)\r\n {\r\n $this->connection = Creole::getConnection($dsn, $flags);\r\n }\r\n else\r\n {\r\n $this->connection = Creole::getConnection($dsn);\r\n }\r\n\r\n // get our resource\r\n $this->resource = $this->connection->getResource();\r\n }\r\n catch (SQLException $e)\r\n {\r\n // the connection's foobar'd\r\n throw new sfDatabaseException($e->toString());\r\n }\r\n }", "function __construct()\n {\n $con_obj = new ConnectionClass();\n $this->con = $con_obj->getConnection();\n }", "public function connect()\r\n\t{\r\n\t\t//$this->link = qracle_connect();\r\n\t}", "private function connect() {\r\n\t\tunset($this->dbLink);\r\n\t\t/* create connection to database host */\r\n\t\t// $dbLink = mysql_connect(\"mysql.localhost\", \"de88623\", \"proberaum1\");\r\n\t\t$dbLink = mysql_connect(\"localhost\", \"robert\", \"YMbHFY+On2\");\r\n\t\t/* select database */\r\n\t\tmysql_select_db(\"robert_www_parkdrei_de\");\r\n\t\t/* set link to database as a object attribute */\r\n\t\t$this->dbLink = $dbLink;\r\n\t}", "public function __construct(){\r\n $this->conn = $this->getConnection();\r\n }", "function createConnect()\r\n\t\t{\r\n\t\t$this->conn=mysql_pconnect($this->host,$this->user,$this->password);\r\n\t\tif(!is_resource($this->conn))\r\n\t\t\t{\r\n\t\t\t$this->errors=\"Could Not able to connect to the SQL Server.\";\r\n\t\t\t}\r\n\t\t$d = mysql_select_db($this->dbname, $this->conn);\r\n\t\tif(!is_resource($d))\r\n\t\t\t{\r\n\t\t\t$this->errors=\"Could Not able to Use database \".$this->dbname.\".\";\r\n\t\t\t}\r\n\t\t}", "public function __construct() {\n\t\t$this->db = pg_connect(\"host=localhost dbname='cdi13' user='cdi13' password='cdi13database'\");\n\t}", "public function __construct() {\n// $this->db['server'] = $args['server'];\n// $this->db['username'] = $args['username'];\n// $this->db['password'] = $args['password'];\n// $this->db['database'] = $args['database'];\n $this->open_connection();\n }", "final public function p_connect() {\n \t$this->connect('', '', '', '', true);\n \t}", "private function Connect() {\n $this->Conn = parent::getConn();\n $this->Create = $this->Conn->prepare($this->Create);\n }", "abstract public function getConnection();", "public function connect(): void;", "private function connect()\r\n {\r\n\r\n /**\r\n * A TENTATIVA DE CRIAR UM OBJETO COM A CONEXAO DO BANCO É FEITA\r\n */\r\n try {\r\n /**\r\n * SALVA NA VARIAVEL ESTATICA O OBJETO REFERENTE A CONEXÃO COM O BANCO.\r\n * AS VARIAVEIS QUE SAO USADAS PARA CONEXAO SÃO DA CLASSE PAI\r\n */\r\n self::$con = new PDO('mysql:host=' . $this->getHost() . ';dbname=' . $this->getDatabase() . '', $this->getUser(), $this->getPassword(), array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES 'utf8'\"));\r\n /**\r\n * DEFINE O TIPO DE MANIPULAÇÃO DE ERRO SERÁ USADO PELO PDO\r\n */\r\n self::$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n /**\r\n * CAPTURA O ERRO, SE GERADO\r\n */\r\n } catch (\\PDOException $error) {\r\n /**\r\n * O ERRO É IMPRESSO NA TELA\r\n */\r\n echo $error->getMessage();\r\n }\r\n }", "public function connect(): void\n {\n }", "private function __construct() {\r\n $this->dbName = self::$_dbname;\r\n $this->username = self::$_username;\r\n $this->password = self::$_password;\r\n $this->hostname = self::$_hostname; \r\n\t return $this->connect();\r\n }", "function create_connection(){\n\t\t$this->dbconn =& new DBConn();\r\n\t\tif($this->dbconn == NULL)\r\n\t\t\tdie('Could not create connection object');\n\t}", "public function __construct() {\n\t\t$this->db = MySQLConnectivity::get_instance();\n\t\t$this->conn = $this->db->get_connection(); \n\t}", "public function __construct() {\n\t\t$this->_dbhost\t\t= \"alexandrgmsperso.mysql.db\";\n\t\t$this->_dbname\t\t= \"alexandrgmsperso\";\n\t\t$this->_dbusername\t= \"alexandrgmsperso\";\n\t\t$this->_dbpassword\t= \"Alexandre2007\";\n\t\t$this->startConnection();\n\t}", "public function _Connect() {\t\t\n\t\tif($this->_connection) { $this->_Disconnect(); } \n\t\ttry {\t\t\t\n\t\t\t// GET CONFIGURATION\n\t\t\t$config = $this->_config;\n\t\t\tif(!$config) $this->_RenderError(XUXO_ERROR_CODE_004.': CONFIG IS NOT SET');\n\t\t\tif(!$config['USE']) return NULL;\t\t\t\n\t\t\t// GET PATH\n\t\t\tif ($a = Xuxo_Application::$_instance) {\n\t\t\t\t$path = $a->_GetBaseUrl(true).DIR_SEPARATOR.$config['HOST'];\n\t\t\t} else {\n\t\t\t\t$path = str_replace('\\\\',DIR_SEPARATOR,realpath(dirname(__FILE__))).$config['HOST'];\n\t\t\t}\n\t\t\t// CREATE PATH IF NOT EXISTED\n\t\t\tif(!file_exists($path)) { mkdir($path,0777); }\n\t\t\t// SET PERMISSION\n\t\t\t$this->_SetPermission($path);\n\t\t\t// GET SQLITE FILE\n\t\t\t$path .= DIR_SEPARATOR.$config['NAME'].\".sqlite\";\n\t\t\tif(!file_exists($path)) $this->_RenderError('SQLITE FILE DOES NOT EXIST','XUXO_ERROR_CODE_005');\n\t\t\t// CONNECTION\n\t\t\t$conndb = \"sqlite:\".$path;\t\t\t\n\t\t\t$this->_connection = new PDO($conndb);\n\t\t\tunset($conndb);\n\t\t\t// RETURN\n\t\t\tif (!$this->_connection) $this->_RenderError('FAIL TO CONNECT', 'XUXO_ERROR_CODE_004');\n\t\t\tif(!$this->_auto_commit && !$this->_begin) {\n\t\t\t\t$this->_connection->beginTransaction();\n\t\t\t\t$this->_begin = true;\n\t\t\t}\n\t\t\treturn $this->_connection;\n\t\t} catch (Exception $e) {\n\t\t\t$this->_RenderError('UNABLE TO CONNECT - '.$e->getMessage(), 'XUXO_ERROR_CODE_004');\n\t\t}\n\t}", "private function connect()\n\t{\n\t\t$connectionData = $this->app->file->requireFile('config.php');\n\t\t\n\t\textract($connectionData);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tstatic::$connection = new PDO('mysql:host=' . $server . ';dbname=' . $dbname, $dbuser, $dbpass);\n\t\t\t\n\t\t\tstatic::$connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);\n\t\t\t\n\t\t\tstatic::$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t\n\t\t\tstatic::$connection->exec('SET NAMES utf8');\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t{\n\t\t\tdie($e->getMessage());\n\t\t}\t\t\t\t\n\t}", "function establish_connection() {\n\t \t\tself::$db = Registry()->db = SqlFactory::factory(Config()->DSN);\n\t \t\tself::$has_update_blob = method_exists(self::$db, 'UpdateBlob');\n\t\t\treturn self::$db;\n\t\t}", "function __construct()\n\t{\n\t\t// Set connection and store it in self::$link\n\t\tself::$link = Connection::setConnect();\n\t}", "function __construct($connection,$ship){\n $this->db = $connection;\n $this->ship = $ship;\n }", "public function __construct()\n {\n $this -> connection = $this ->connecdatabase();\n }", "private function connect()\n {\n if ($this->configuration->get('db.connector') == 'PDO') {\n $dsn = \"mysql:host=\" . $this->configuration->get('db.host') . \";dbname=\" . $this->configuration->get('db.name');\n $options = array();\n $this->db = new PDO(\n $dsn, $this->configuration->get('db.username'), $this->configuration->get('db.password'), $options\n );\n } elseif ($this->configuration->get('db.connector') == 'mysqli') {\n $this->db = mysqli_connect(\n $this->configuration->get('db.host'), $this->configuration->get('db.username'), $this->configuration->get('db.password'), $this->configuration->get('db.name')\n );\n }\n }", "private function Connect(){\n $this->Conn = parent::getConn();\n $this->Create = $this->Conn->prepare($this->Create);\n }", "function __construct() {\n\n $this->dbserver = \"MYSQL5005.Smarterasp.net\";\n $this->username = \"9b0406_fm\";\n $this->password = \"vasusubramaniyam\";\n $this->dbname = \"db_9b0406_fm\";\n }", "function __construct() {\n parent::bdConnect();\n }", "public function __construct() {\n $db = new Connection();\n $this->conn = $db->connect();\n }", "public function __construct(){\n\t\treturn $this->conn = mysqli_connect(\"localhost\",\"root\",\"\",\"hcode_shop\");\n\n\t}" ]
[ "0.6757397", "0.668233", "0.66250664", "0.6612265", "0.65369177", "0.65150857", "0.65052325", "0.6505077", "0.6505077", "0.6505077", "0.6505077", "0.6505077", "0.6505077", "0.6505077", "0.6505077", "0.6505077", "0.6505077", "0.6505077", "0.64991874", "0.64906687", "0.6482048", "0.6456886", "0.6431103", "0.642122", "0.64158636", "0.63926494", "0.63890463", "0.6373946", "0.6372704", "0.6372704", "0.6372704", "0.6372704", "0.6372704", "0.6372704", "0.6372704", "0.6369746", "0.63613194", "0.6316894", "0.63086504", "0.6286066", "0.6286066", "0.6286066", "0.6281383", "0.6281383", "0.6281383", "0.62524086", "0.6242158", "0.6236378", "0.6228811", "0.62114173", "0.62114173", "0.62114173", "0.62114173", "0.62114173", "0.62114173", "0.62114173", "0.62114173", "0.62114173", "0.62114173", "0.62114173", "0.62114173", "0.61941963", "0.6181681", "0.6181394", "0.61763203", "0.6173359", "0.6162773", "0.6147474", "0.6143843", "0.6130026", "0.6129593", "0.6116656", "0.6112456", "0.61051625", "0.6104216", "0.60816294", "0.6068079", "0.6067762", "0.606738", "0.6064563", "0.6062138", "0.6061472", "0.6060076", "0.60426724", "0.60417473", "0.60260886", "0.6024863", "0.60198736", "0.6011049", "0.5997753", "0.59972703", "0.59907216", "0.59872466", "0.59849995", "0.59762317", "0.5968371", "0.5967444", "0.59666", "0.59615815", "0.59582794", "0.5944833" ]
0.0
-1
Save the customer information
public function saveCustomer($customerName = "Kevin", $customerNumber = "734", $active = "true", $address ="test", $city="amarillo", $zip="12345", $type="Main Office", $state = 'UT', $phone="800-555-5555", $email="email") { // Setup XML $xml = " <CustomerSaveRq>\n". " <Customer>\n". " <CustomerID>-1</CustomerID>\n". " <AccountID>-1</AccountID>\n". " <Status>Normal</Status>\n". " <DefPaymentTerms>COD</DefPaymentTerms>\n". " <DefShipTerms>Prepaid &amp; Billed</DefShipTerms>\n". " <TaxRate>None</TaxRate>\n". " <Name>{$customerName}</Name>\n". " <Number>{$customerNumber}</Number>\n". " <ActiveFlag>{$active}</ActiveFlag>\n". " <JobDepth>1</JobDepth>\n". " <Addresses>\n". " <Address>\n". " <ID>-1</ID>\n". " <AccountId>-1</AccountId>\n". " <Name>{$customerName}</Name>\n". " <Attn>{$customerName}</Attn>\n". " <Street>{$address}</Street>\n". " <City>{$city}</City>\n". " <Zip>{$zip}</Zip>\n". " <Default>true</Default>\n". " <Residential>false</Residential>\n". " <Type>{$type}</Type>\n". " <State>\n". " <Code>{$state}</Code>\n". " <CountryID>2</CountryID>\n". " </State>\n". " <Country>\n". " <ID>2</ID>\n". " <Name>UNITED STATES</Name>\n". " <Code>US</Code>\n". " </Country>\n". " <AddressInformationList>\n". " <AddressInformation>\n". " <ID>-1</ID>\n". " <Name>{$customerName}</Name>\n". " <Data>{$phone}</Data>\n". " <Default>true</Default>\n". " <Type>Main</Type>\n". " </AddressInformation>\n". " <AddressInformation>\n". " <ID>-1</ID>\n". " <Name>{$customerName}</Name>\n". " <Data>{$email}</Data>\n". " <Default>true</Default>\n". " <Type>Email</Type>\n". " </AddressInformation>\n". " </AddressInformationList>\n". " </Address>\n". " </Addresses>\n". " </Customer>\n". " </CustomerSaveRq>\n"; // Create request and pack $this->createRequest($xml); $len = strlen($this->xmlRequest); $packed = pack("N", $len); // Send and get the response fwrite($this->id, $packed, 4); fwrite($this->id, $this->xmlRequest); $this->getResponse(); // Set the result $this->setResult($this->parseXML($this->xmlResponse)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveCustomer($customer) {\n $customer->save();\n\n $customerAccount = $this->newCustomerAccount($customer->id);\n $customerAccount->save();\n\n $customer->sl_customer_account_id = $customerAccount->id;\n $customer->save();\n }", "public static function saveCustomer($data) {\n $objCustomer = new Customer();\n $objCustomer->setFirstname($data['firstname']);\n $objCustomer->setLastname($data[\"lastname\"]);\n $objCustomer->setEmail($data[\"email\"]);\n $objCustomer->setTelephone($data[\"telephone\"]);\n $objCustomer->setFax($data[\"fax\"]);\n $objCustomer->setPassword($data[\"password\"]);\n $objCustomer->setStoreId(1);\n $objCustomer->setSalt(\"\");\n $objCustomer->setCart(\"\");\n $objCustomer->setWishlist(\"\");\n $objCustomer->setNewsletter(0);\n $objCustomer->setAddressId(0);\n $objCustomer->setCustomerGroupId(1);\n $objCustomer->setIp($_SERVER['REMOTE_ADDR']);\n $objCustomer->setStatus(1);\n $objCustomer->setApproved(1);\n $objCustomer->setToken(\"\");\n $objCustomer->setDateAdded(date(\"Y-m-d H;i:s\"));\n\n $customerResult = $objCustomer->save(); // Save customer information\n\n $customerId = $objCustomer->getCustomerId();\n if($customerResult['success']){\n $objCustomerAddress = new CustomerAddress();\n $objCustomerAddress->setCustomerId($customerId);\n $objCustomerAddress->setFirstname($data[\"firstname\"]);\n $objCustomerAddress->setLastname($data[\"lastname\"]);\n $objCustomerAddress->setCompanyId($data[\"company\"]);\n $objCustomerAddress->setAddress1($data[\"address_1\"]);\n $objCustomerAddress->setAddress2($data[\"address_2\"]);\n $objCustomerAddress->setCity($data[\"city\"]);\n $objCustomerAddress->setPostcode($data[\"postcode\"]);\n $objCustomerAddress->setCountryId($data[\"country\"]);\n $objCustomerAddress->setZoneId($data[\"zone_id\"]);\n $objCustomerAddress->setTaxId(0);\n\n $result = $objCustomerAddress->save();// Save Customer Address information\n\n $addressId = $objCustomerAddress->getAddressId();\n\n $customerInfoObj = Customer::loadById($customerId);\n $objCustomer = new Customer();\n $objCustomer->setCustomerId($customerId);\n $objCustomer->setFirstname($customerInfoObj->getFirstname());\n $objCustomer->setLastname($customerInfoObj->getLastname());\n $objCustomer->setEmail($customerInfoObj->getEmail());\n $objCustomer->setTelephone($customerInfoObj->getTelephone());\n $objCustomer->setFax($customerInfoObj->getFax());\n $objCustomer->setPassword($customerInfoObj->getPassword());\n $objCustomer->setStoreId($customerInfoObj->getStoreId());\n $objCustomer->setSalt($customerInfoObj->getSalt());\n $objCustomer->setCart($customerInfoObj->getCart());\n $objCustomer->setWishlist($customerInfoObj->getWishlist());\n $objCustomer->setNewsletter($customerInfoObj->getNewsletter());\n $objCustomer->setAddressId($addressId);\n $objCustomer->setCustomerGroupId($customerInfoObj->getCustomerGroupId());\n $objCustomer->setIp($_SERVER['REMOTE_ADDR']);\n $objCustomer->setStatus($customerInfoObj->getStatus());\n $objCustomer->setApproved($customerInfoObj->getApproved());\n $objCustomer->setToken($customerInfoObj->getToken());\n $objCustomer->setDateAdded($customerInfoObj->getDateAdded());\n\n return $objCustomer->save(); // Save customer information\n }\n }", "public function save()\n\t{\n\t\tparent::save();\n\t\t\\IPS\\Widget::deleteCaches( 'donations', 'nexus' );\n\t\tstatic::recountCustomerFields();\n\t}", "public function storeCustomerData($obj){\n if($obj){\n Customer::create(array(\n 'name' => $obj-> name,\n 'address' => $obj-> address,\n 'checked' => $obj-> checked,\n 'description' => $obj-> description,\n 'interest' => $obj-> interest,\n 'date_of_birth' => $obj-> date_of_birth,\n 'email' => $obj-> email,\n 'account' => $obj-> account,\n 'credit_card' => $this->storeCreditCard($obj-> credit_card) \n ));\n }\n \n }", "public function save()\n {\n global $connection;\n //echo \"Im on the customers ->save()\";\n \n \n //if($this->customer_id == \"\")\n //{\n #set error handler\n #set exception handler\n #call stored procedures\n $SQLQuery = \"CALL customers_insert(\"\n . \":customer_firstName,\"\n . \":customer_lastName,\"\n . \":customer_address,\"\n . \":customer_city,\"\n . \":customer_province,\"\n . \":customer_postalCode,\"\n . \":customer_username,\"\n . \":customer_password);\";\n $PDOStatement = $connection->prepare($SQLQuery);\n $PDOStatement->bindParam(\":customer_firstName\", $this->customer_firstName);\n $PDOStatement->bindParam(\":customer_lastName\", $this->customer_lastName);\n $PDOStatement->bindParam(\":customer_address\", $this->customer_address);\n $PDOStatement->bindParam(\":customer_city\", $this->customer_city);\n $PDOStatement->bindParam(\":customer_province\", $this->customer_province);\n $PDOStatement->bindParam(\":customer_postalCode\", $this->customer_postalCode);\n $PDOStatement->bindParam(\":customer_username\", $this->customer_username); \n $PDOStatement->bindParam(\":customer_password\", $this->customer_password);\n $PDOStatement->execute();\n\n \n //}\n }", "public function store(CustomerFormRequest $request)\n {\n\n $customer = new Customer;\n \n \n\n $customer->name = $request->name;\n $customer->customer_type_id = $request->customer_type_id;\n $customer->company_id = $request->company_id;\n $customer->plate = $request->plate;\n $customer->active = $request->plate;\n \n $customer->save();\n \n \n Alert::success('Success Message customer added..')->persistent(\"Close\"); \n return Redirect::route('customer.index');\n \n \n }", "public function store(Request $request, Customer $customer)\n {\n \n $customer->name= $request->name; \n $customer->address= $request->address; \n $customer->telephone= $request->telephone; \n $customer->mobile= $request->mobile; \n $customer->email= $request->email; \n $customer->contact= $request->contact; \n\n $customer->proc_contact= $request->proc_contact; \n $customer->proc_telephone= $request->proc_telephone; \n $customer->proc_email= $request->proc_email; \n\n $customer->it_contact= $request->it_contact; \n $customer->it_telephone= $request->it_telephone; \n $customer->it_email= $request->it_email; \n\n $customer->feedback= $request->feedback; \n $customer->customer_response= $request->customer_response; \n $customer->followup1= $request->followup1; \n\n $customer->save(); \n return redirect('admin/customers')->with('success','Transaction created successfully!');\n }", "function save_customer_details( $params ) {\n\t\textract( $params );\n\n\t\t$qry = \"UPDATE cart \".\n\t\t\t\"SET customer_id='\".$user_no.\"', \".\n\t\t\t\"recipient='\".$firstname.\" \".$lastname.\"', \".\n\t\t\t\"email='\".$email.\"', \".\n\t\t\t\"address='\".$address.\"', \".\n\t\t\t\"town='\".$city.\"', \".\n\t\t\t\"postcode='\".$postcode.\"', \".\n\t\t\t\"county='\".$country.\"' \";\n\n\t\tif( !empty( $telephone ) )\n\t\t\t$qry.=\",telephone='\".$telephone.\"' \";\n\n\t\tif( !empty( $payment_method ) )\n\t\t\t$qry.=\",payment_method='\".$payment_method.\"' \";\n\n\t\tif( !empty( $comments ) )\n\t\t\t$qry.=\",comments='\".$comments.\"' \";\n\n\t\t$qry.=\"WHERE id='\".$cart_id.\"'\";\n\n\t\treturn $this->db->query( $qry );\n\t}", "function saveAction()\n {\n\t\t$params = $this->_request->getParams();\n \t$id=(int)$params[\"id\"];\n\t\t$name = $params[\"txtName\"];\n\t\t$address = $params[\"txtAddress\"];\n\t\t$email = $params[\"txtEmail\"];\n\t\t$phone = $params[\"txtPhone\"];\n\n\t\t$customers = new CustomersModel();\n\t\tif($id > 0)\n\t\t{\n\t\t\t$customers->updateCustomersById($id, $name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t} else {\n\t\t\t$customers->insertCustomers($name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t}\n }", "private function saveCustomer($customer){\n \n $customermodel = new CustomerModel();\n $customermodel->save($customer);\n return $this->insertID();\n }", "public function post() {\n\n parent::post();\n\n if(!$this->getStoreId()) {\n Mage::throwException('Please provide a Store ID.');\n }\n\n Mage::app()->setCurrentStore($this->getStoreId());\n\n $data = $this->getJsonPayload();\n\n $_customer = $data->customer;\n $email = (string)$_customer->email;\n\n $websiteId = Mage::app()->getStore()->getWebsiteId();\n $customerExists = Mage::helper('bakerloo_restful/sales')->customerExists($email, $websiteId);\n\n if($customerExists === false) {\n\n $password = substr(uniqid(), 0, 8);\n $customer = $this->helper('bakerloo_restful')->createCustomer($websiteId, $data, $password);\n\n if(isset($_customer->address) && is_array($_customer->address) && !empty($_customer->address)) {\n\n foreach($_customer->address as $address) {\n $address = array(\n 'firstname' => $address->firstname,\n 'lastname' => $address->lastname,\n 'email' => $email,\n 'is_active' => 1,\n 'street' => $address->street,\n 'street1' => $address->street,\n 'city' => $address->city,\n 'region_id' => $address->region_id,\n 'region' => $address->region,\n 'postcode' => $address->postcode,\n 'country_id' => $address->country_id,\n 'telephone' => $address->telephone,\n );\n\n $newAddress = Mage::getModel('customer/address');\n $newAddress->addData($address);\n $newAddress->setId(null)\n ->setIsDefaultBilling(true)\n ->setIsDefaultShipping(true);\n $customer->addAddress($newAddress);\n }\n }\n\n $customer->save();\n }\n else {\n Mage::throwException(Mage::helper('bakerloo_restful')->__(\"Customer already exists.\"));\n }\n\n return array('id' => (int)$customer->getId(),\n 'email' => $customer->getEmail(),\n 'store_id' => (int)$customer->getStoreId());\n }", "private function storeCustomer(CustomerRequest $request)\n {\n // set the address values and create\n $address_array = array_add(array_add($request->address, 'city_id', $request->city_id), 'location', $request->location);\n $address = Address::create($address_array);\n\n // set the customer values\n $customer_array = array_add(array_add($request->except('address', 'city_id', 'country_id', 'location'), 'address_id', $address->address_id), 'active', $request->has('active'));\n $customer =Customer::create($customer_array);\n }", "public function saveIdentDataForNewCustomer(Varien_Event_Observer $observer)\n {\n if (!Mage::getModel('postident/config')->isEnabled()) {\n return;\n }\n \n $quote = $observer->getEvent()->getOrder()->getQuote();\n $customer = $observer->getEvent()->getOrder()->getCustomer();\n $checkoutMethod = $quote->getCheckoutMethod();\n \n if (!is_null($quote)\n && !is_null($quote->getPostidentVerificationData())\n && $checkoutMethod != Mage_Sales_Model_Quote::CHECKOUT_METHOD_GUEST\n ) {\n $customer = Mage::Helper('postident/data')->saveIdentDataToCustomer($customer, $quote);\n \n //This updates the customer object in the session - ensures that it has the postident data\n Mage::getSingleton('customer/session')->setCustomer($customer);\n }\n }", "public function saveExtraRegistrationData($customerId)\n {\n if (isset($_POST['billing_first_name'])) {\n update_user_meta($customerId, 'billing_first_name', sanitize_text_field($_POST['billing_first_name']));\n }\n if (isset($_POST['billing_last_name'])) {\n update_user_meta($customerId, 'billing_last_name', sanitize_text_field($_POST['billing_last_name']));\n }\n if (isset($_POST['billing_address_1'])) {\n update_user_meta($customerId, 'billing_address_1', sanitize_text_field($_POST['billing_address_1']));\n }\n if (isset($_POST['billing_city'])) {\n update_user_meta($customerId, 'billing_city', sanitize_text_field($_POST['billing_city']));\n }\n if (isset($_POST['billing_postcode'])) {\n update_user_meta($customerId, 'billing_postcode', sanitize_text_field($_POST['billing_postcode']));\n }\n if (isset($_POST['billing_phone'])) {\n update_user_meta($customerId, 'billing_phone', sanitize_text_field($_POST['billing_phone']));\n }\n if (isset($_POST['billing_country'])) {\n update_user_meta($customerId, 'billing_country', sanitize_text_field($_POST['billing_country']));\n }\n }", "public function store(Customer $customer)\n\t{\n $input = array_except(Input::all(), array('_token') );\n $input['customer_id'] = $customer->id;\n \n // Use postal code-to-locality lookup to find city/state to standardize...\n if ( isset($input['postal_code']) ) {\n $location_data = array();\n try {\n $location_data = Utility::getLocalityFromPostalCode($input['postal_code']);\n } catch (\\Exception $ex) {\n if ( $ex->getCode() <> 100 ) // If we get an except OTHER THAN no data found, then pass it up.\n throw $ex;\n }\n if ( $location_data ) {\n $input['postal_code'] = $location_data['post code'];\n $input['city'] = $location_data['places'][0]['place name'];\n $input['state'] = $location_data['places'][0]['state abbreviation'];\n }\n }\n \n $address = new Address($input);\n \n if ( $address->save() ) {\n //return Redirect::route('customers.show', $customer)->with('message', 'Customer created.');\n //return Redirect::route('profile', array($customer->id))->with('message', 'Address created.');\n if ( Session::has('checkOutInProgress') && Session::get('checkOutInProgress') == TRUE ) {\n return Redirect::route('checkout');\n } elseif ( (Auth::check() && Auth::user()->admin_ind) ) {\n return Redirect::route('profile', array('id' => $customer->id));\n } else {\n return Redirect::route('products')->with('message', 'Click on \"Check Out\" button when you are ready to pay.');\n }\n } else {\n //return Redirect::route('customers.create')->withInput()->withErrors( $customer->errors() );\n return Redirect::route('customers.addresses.create', $customer->id)->withInput()->withErrors( $address->errors() );\n }\n\t}", "public function store(Request $request)\n {\n //Add New Customer Entry Start\n if($request->input('customer_name') != null){\n $add_Customer = New Customer([\n 'name' => $request->input('customer_name'),\n 'mobile' => $request->input('customer_mobile'),\n 'email' => $request->input('customer_email'),\n 'address' => $request->input('customer_address'),\n 'month' => date('M'),\n 'year' => date('Y'),\n ]); \n $add_Customer->save();\n return \\Redirect::back();\n }\n //Add New Customer Entry End\n\n\n //Edit Customer Entry Start\n if($request->input('edited_record_customer_name') != null){\n\n $requested_id = Customer::where('id','=',$request->input('edited_customer_id'))->first();\n\n $requested_id->name = $request->input('edited_record_customer_name');\n $requested_id->mobile = $request->input('edited_record_customer_mobile');\n $requested_id->email = $request->input('edited_record_customer_email');\n $requested_id->address = $request->input('edited_record_customer_address');\n $requested_id->save();\n return \\Redirect::back();\n }\n //Edit Customer Entry End\n \n //Delete Customer Entry Start\n if($request->input('delete_customer_id') != null){\n\n $delete_requested_id = Customer::where('id','=',$request->input('delete_customer_id'))->first();\n $delete_requested_id->delete();\n return \\Redirect::back(); \n }\n //Delete Customer Entry End\n\n\n\n\n\n\n }", "public function save()\n {\n $this->save_meta_value('_sim_city_main_info', $this->city_main_info);\n\n $this->save_meta_value('_sim_city_shops', $this->city_shops);\n }", "public function store(CustomerRequest $request)\n {\n $customers = new Customer;\n $customers->fill($request->all())->save();\n Session()->flash('alert-success','Customer Added Successfully');\n return redirect()->route('customers.index');\n }", "public function save_CustomerDetails($data) { /* this fun is used for save customer details */\n extract($data);\n $sqlnew = \"INSERT INTO customer_details(customer_name,customer_email,\"\n . \"customer_address,contact,bank_name,bank_address,\"\n . \"account_no,IFSC_no,MICR_no,PAN_no,joining_date,profit_for_odgreater,profit_for_odsmall,branch_name) \"\n . \"values ('$Input_CustomerName','$Input_CustomerEmail','$Input_CustomerAddress',\"\n . \"'$contact','$Input_Bank_name','$Input_Bank_Address',\"\n . \"'$Input_Bank_AccNo','$Input_Bank_IFSC_Code','$Input_Bank_MICR_Code',\"\n . \"'$Input_PAN_No',now(),'$Select_profitCategoryOne','$Select_profitCategoryTwo','$branch_name')\";\n $resultnew = $this->db->query($sqlnew);\n if ($resultnew) {\n $response = array(\n 'status' => 1,\n 'status_message' => 'Customer Details Inserted Successfully..!');\n } else {\n $response = array(\n 'status' => 0,\n 'status_message' => 'Customer Details Not Inserted Successfully...!');\n }\n return $response;\n }", "public function save()\n {\n $id = $this->input->post('customer_id');\n\n // store result query\n $customer = $this->customer_model->where('customer_id', $id)->get();\n\n // store post[] into array\n $customer_data = array(\n 'customer_id' => $id,\n 'customer_name' => $this->input->post('customer_name'),\n 'customer_contact' => $this->input->post('customer_contact'),\n 'customer_email' => $this->input->post('customer_email'),\n 'customer_pic' => $this->input->post('customer_pic'),\n 'customer_address' => $this->input->post('customer_address'),\n 'province_id' => $this->input->post('province_id')\n );\n\n // check if exist\n if ($customer) {\n try {\n // store proses kedalam variabel\n $customer_update = $this->customer_model->update($customer_data, 'customer_id');\n\n // cek jika berhasil diupdate\n if ($customer_update) {\n // set session temp message\n $this->pesan->berhasil('Data Customer berhasil diupdate.');\n } else {\n // set session temp message\n $this->pesan->gagal('Data Customer gagal diupdate.');\n }\n } catch (\\Exception $e) {\n // set session temp message\n $this->pesan->gagal('ERROR : ' . $e);\n }\n\n } else {\n try {\n // store proses kedalam variabel\n $customer_create = $this->customer_model->insert($customer_data);\n\n // check jika berhasil dibuat\n if ($customer_create) {\n // set session temp message\n $this->pesan->berhasil('Data Customer berhasil dibuat.');\n } else {\n // set session temp message\n $this->pesan->gagal('Data Customer gagal dibuat.');\n }\n } catch (\\Exception $e) {\n // set session temp message\n $this->pesan->gagal('ERROR : ' . $e);\n }\n\n }\n\n // redirect to Index\n redirect('customer');\n\n }", "public function customer_save($id = NULL)\n {\n if ($this->input->post())\n {\n if ($this->input->post('id'))\n {\n $this->MCustomers->update(trim($this->input->post('code')));\n }\n else\n {\n $ac_receivable = $this->MSettings->get_by_company_id($this->session->user_company);\n $chart = $this->MAc_charts->get_by_id($ac_receivable['ac_receivable']);\n $siblings = $this->MAc_charts->get_by_parent_id($ac_receivable['ac_receivable']);\n if (count($siblings) > 0)\n {\n $ac_code_temp = explode('.', $siblings['code']);\n $ac_last = count($ac_code_temp) - 1;\n $ac_new = (int) $ac_code_temp[$ac_last] + 10;\n $ac_code = $chart['code'] . '.' . $ac_new;\n }\n else\n {\n $ac_code = $chart['code'] . '.10';\n }\n\n $ac_id = $this->MAc_charts->account_create($ac_receivable['ac_receivable'], $ac_code, $this->input->post('name'));\n\n // $customer = $this->MCustomers->get_latest();\n // if ( count( $customer ) > 0 ) {\n // $code = (int) $customer['code'] + 1;\n // } else {\n // $code = 1001;\n // }\n $this->MCustomers->create(trim($this->input->post('code')), $ac_id);\n }\n\n $this->session->set_flashdata('success', 'Customer saved successfully.');\n redirect('inventory/customer-list', 'refresh');\n }\n else\n {\n $data['title'] = 'POS System';\n $data['menu'] = 'inventory';\n $data['content'] = 'admin/inventory/customer/save';\n $customer = $this->MCustomers->get_latest();\n if (count($customer) > 0)\n {\n $data['code'] = (int)$customer['code'] + 1;\n }\n else\n {\n $data['code'] = 1001;\n }\n $data['customer'] = $this->MCustomers->get_by_id($id);\n $data['privileges'] = $this->privileges;\n $this->load->view('admin/template', $data);\n }\n }", "public function save()\n {\n Session::clear(\"Checkout.PostageID\");\n \n // Extend our save operation\n $this->extend(\"onBeforeSave\");\n\n // Save cart items\n Session::set(\n \"Checkout.ShoppingCart.Items\",\n serialize($this->items)\n );\n\n // Save cart discounts\n Session::set(\n \"Checkout.ShoppingCart.Discount\",\n serialize($this->discount)\n );\n\n // Update available postage\n if ($data = Session::get(\"Form.Form_PostageForm.data\")) {\n $country = $data[\"Country\"];\n $code = $data[\"ZipCode\"];\n $this->setAvailablePostage($country, $code);\n }\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$v = Validator::make($input, Customer::$rules);\n\t\tif ($v->passes())\n\t\t{\t\t\n\t\t$customer = new Customer();\n\t\t$customer->phoneNo = $input['phoneNo'];\n\t\t$customer->address = $input['address'];\n\t\t$customer->name = $input['name'];\n\t\t$customer->cardNo = $input['cardNo'];\n\t\t$customer->secCode = $input['secCode'];\n\t\t$customer->cardName = $input['cardName'];\n\t\t$customer->expDate = $input['expDate'];\n\t\t$customer->save();\n\t\treturn View::make('createOrder')->withCustomer($customer);\n\t\t}\n\t\telse{\n\t\t\treturn Redirect::back()->withErrors($v);\n\t\t}\n\t}", "public function store(StoreConsumer $request)\n {\n //\n Customer::create([\n 'customer_name' => $request->input('customer_name'),\n 'customer_ktp' => $request->input('customer_ktp'),\n 'customer_ktp_expired' => $request->input('customer_ktp_expired'),\n 'customer_ktp_address' => $request->input('customer_ktp_address'),\n 'customer_city' => $request->input('customer_city'),\n 'customer_zipcode' => $request->input('customer_zipcode'),\n 'customer_current_address' => $request->input('customer_current_address'),\n 'customer_current_city' => $request->input('customer_current_city'),\n 'customer_current_zipcode' => $request->input('customer_current_zipcode'),\n 'customer_telp' => $request->input('customer_telp'),\n 'customer_mobile_number' => $request->input('customer_mobile_number'),\n 'customer_house_status' => $request->input('customer_house_status'),\n 'customer_length_of_stay' => $request->input('customer_length_of_stay'),\n 'customer_birth_place' => $request->input('customer_birth_place'),\n 'customer_birthdate' => Carbon::parse($request->input('kavling_start_date'))->format('Y-m-d H:i:s'),\n 'customer_maternal_status' => $request->input('customer_maternal_status'),\n 'customer_tanggungan' => $request->input('customer_tanggungan'),\n 'customer_npwp' => $request->input('customer_npwp'),\n 'customer_religion' => $request->input('customer_religion'),\n 'customer_gender' => $request->input('customer_gender'),\n 'customer_mother' => $request->input('customer_mother'),\n 'customer_address_mail' => $request->input('customer_address_mail'),\n 'mailing_address' => $request->input('mailing_address'),\n 'customer_reference_id' => $request->input('customer_reference_id'),\n 'customer_executive_id' => $request->input('customer_executive_id'),\n 'customer_supervisor_id' => $request->input('customer_supervisor_id'),\n 'customer_nip' => $request->input('customer_nip'),\n 'customer_job_title' => $request->input('customer_job_title'),\n 'customer_job_duration' => $request->input('customer_job_duration'),\n 'customer_office_id' => $request->input('customer_office_id'),\n 'customer_office_email' => $request->input('customer_office_email'),\n 'customer_income' => Comma::removeComma($request->input('customer_income')),\n 'customer_additional_income' => Comma::removeComma($request->input('customer_additional_income')),\n 'customer_family_income' => Comma::removeComma($request->input('customer_family_income')),\n 'customer_total_income' => Comma::removeComma($request->input('customer_total_income')),\n 'customer_routine_expenses' => Comma::removeComma($request->input('customer_routine_expenses')),\n 'customer_residual_income' => Comma::removeComma($request->input('customer_residual_income')),\n 'customer_installment_ability' => Comma::removeComma($request->input('customer_installment_ability')),\n ]);\n return redirect('/customer')->with('success', 'Successfull create customer');\n }", "public function insert_customer()\n {\n $this->permission->check_label('add_customer')->create()->redirect();\n\n $customer_id = generator(15);\n //Customer basic information adding.\n $data = array(\n 'customer_id' => $customer_id,\n 'customer_name' => $this->input->post('customer_name',TRUE),\n 'customer_mobile' => $this->input->post('mobile',TRUE),\n 'customer_email' => $this->input->post('email',TRUE),\n 'customer_short_address' => $this->input->post('address',TRUE),\n 'customer_address_1' => $this->input->post('customer_address_1',TRUE),\n 'customer_address_2' => $this->input->post('customer_address_2',TRUE),\n 'city' => $this->input->post('city',TRUE),\n 'state' => $this->input->post('state',TRUE),\n 'country' => $this->input->post('country',TRUE),\n 'zip' => $this->input->post('zip',TRUE),\n 'status' => 1\n );\n\n $result = $this->Customers->customer_entry($data);\n\n if ($result == TRUE) {\n $this->session->set_userdata(array('message' => display('successfully_added')));\n if (isset($_POST['add-customer'])) {\n redirect(base_url('dashboard/Ccustomer/manage_customer'));\n exit;\n } elseif (isset($_POST['add-customer-another'])) {\n redirect(base_url('dashboard/Ccustomer'));\n exit;\n }\n } else {\n $this->session->set_userdata(array('error_message' => display('already_exists')));\n redirect(base_url('dashboard/Ccustomer'));\n }\n }", "function saveCustomerId($customer_id){\n\n $where = array('userId'=>$this->session->userdata('userId'));\n $isUpdated = $this->common_model->updateFields(USERS, array('stripeCustomerId'=>$customer_id),$where);\n\n if($isUpdated){\n return TRUE;\n }\n\n }", "public function insert_customer()\n\t{\n\t\t$customer_id=$this->auth->generator(15);\n\n\t \t//Customer basic information adding.\n\t\t$data=array(\n\t\t\t'customer_id' \t\t=> $customer_id,\n\t\t\t'customer_name' \t=> $this->input->post('customer_name'),\n\t\t\t'customer_mobile' \t=> $this->input->post('mobile'),\n\t\t\t'customer_email' \t=> $this->input->post('email'),\n\t\t\t'customer_short_address' => $this->input->post('address'),\n\t\t\t'customer_address_1' => $this->input->post('customer_address_1'),\n\t\t\t'customer_address_2' => $this->input->post('customer_address_2'),\n\t\t\t'city' \t\t\t\t=> $this->input->post('city'),\n\t\t\t'state' \t\t\t=> $this->input->post('state'),\n\t\t\t'country' \t\t\t=> $this->input->post('country'),\n\t\t\t'zip' \t\t\t\t=> $this->input->post('zip'),\n\t\t\t'status' \t\t\t=> 1\n\t\t\t);\n\n\t\t$result=$this->Customers->customer_entry($data);\n\t\t\n\t\tif ($result == TRUE) {\t\t\n\t\t\t$this->session->set_userdata(array('message'=>display('successfully_added')));\n\t\t\tif(isset($_POST['add-customer'])){\n\t\t\t\tredirect(base_url('Ccustomer/manage_customer'));\n\t\t\t\texit;\n\t\t\t}elseif(isset($_POST['add-customer-another'])){\n\t\t\t\tredirect(base_url('Ccustomer'));\n\t\t\t\texit;\n\t\t\t}\n\t\t}else{\n\t\t\t$this->session->set_userdata(array('error_message'=>display('already_exists')));\n\t\t\tredirect(base_url('Ccustomer'));\n\t\t}\n\t}", "public function storeclient(CustomerRequest $request)\n {\n $customer = $request->all();\n\n // create customer account\n $customer = $this->customer->insert($customer);\n // return the resource just created\n return $this->customer->findBy(\"id\", $customer->id);\n }", "public function store(CustomerRequest $request)\n {\n \n $customer = Customer::create($request->all());\n \n if ($customer) {\n \n Session::flash('success', \"Registro #{$customer->id} salvo com êxito\");\n \n return redirect()->route('customers.index');\n }\n return redirect()->back()->withErrors(['error', \"Registo não foi salvo.\"]);\n }", "public function store(CustomerInfoCreateForm $request)\n {\n //\n }", "public function store(CustomerRequest $request)\n {\n if ($request->validated()) {\n $date = $request->date ? $request->date : Carbon::now();\n $customer = new Customer();\n $customer->category = $request->category;\n $customer->kyat = $request->kyat;\n $customer->pae = $request->pae;\n $customer->yway = $request->yway;\n $customer->loan = $request->loan;\n $customer->customer_name = $request->customerName;\n $customer->customer_address = $request->customerAddress;\n $customer->created_at = $date;\n $customer->updated_at = $date;\n $result = $customer->save();\n }\n if ($result) {\n return redirect()->route('customer.index')->with('status', 'New Customer was created successfully!');\n }\n }", "public function store(Request $request)\n {\n $customer_advance = new AdvanceSettlementCustomer(); \n $customer_advance->customer_id = isset($request->customer_id) ? ($request->customer_id) : 0;\n $customer_advance->voucher_no = isset($request->voucher_no) ? ($request->voucher_no) : 0;\n $customer_advance->receipt_date = isset($request->receipt_date) ? ($request->receipt_date) : 0;\n $customer_advance->advance_amount = isset($request->advance_amount) ? ($request->advance_amount) : 0; \n $customer_advance->remarks = isset($request->remark) ? ($request->remark) : 0;\n $customer_advance->created_by = isset($request->created_by) ? ($request->created_by) : 0;\n $customer_advance->updated_by = isset($request->updated_by) ? ($request->updated_by) : 0;\n if ($customer_advance->save()) {\n return Redirect::back()->with('success', 'Successfully created');\n } else {\n return Redirect::back()->with('failure', 'Something Went Wrong..!');\n }\n }", "public function store(Request $request)\n {\n\n \t$customer = Customer::find(Auth::user()->id);\n \t$customer->firstname = $request->input('firstname');\n \t$customer->lastname = $request->input('lastname');\n \t$customer->street = $request->input('street');\n \t$customer->housenum = $request->input('housenum');\n \t$customer->city = $request->input('city');\n \t$customer->postcode = $request->input('postcode');\n \t$customer->email = $request->input('email');\n \t$customer->save();\n\n\t return redirect()\n\t\t ->back()\n\t\t ->with('status', 'Benutzerdaten erfolgreich geändert');\n }", "public function store(Request $request, Customer $customer)\n {\n $customer->customer_name = $request->customer_name;\n $customer->email = $request->email;\n $customer->phone_no = $request->phone_no;\n $customer->address = $request->address;\n $customer->state_id = $request->state_id;\n $customer->status = $request->status;\n $customer->save();\n\n return redirect('admin/customer');\n }", "public function c_add()\n {\n\t\t$this->getC();\n $customer = $this->Customers->newEntity();\n if ($this->request->is('post')) {\n $customer = $this->Customers->patchEntity($customer, $this->request->data);\n if ($this->Customers->save($customer)) {\n $this->Flash->success('The customer has been saved.');\n return $this->redirect(['action' => 'c_index']);\n } else {\n $this->Flash->error('The customer could not be saved. Please, try again.');\n }\n }\n $this->set(compact('customer'));\n $this->set('_serialize', ['customer']);\n }", "private function saveData() {\n\n $dbConnection = dbconn::getConnectionBuild()->getConnection();\n date_default_timezone_set (\"America/Chicago\");\n\n if ($this->propertyId == 0) {\n // Insert a new row.\n $sqlStmt = \"INSERT INTO property (customer_id, tenant_first_name, tenant_last_name, address, city, \";\n $sqlStmt .= \"state, zip, phone, email, notes, created_by, last_modified_by, last_modified) \";\n $sqlStmt .= \"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) \";\n\n $stmtObj = $dbConnection->prepare($sqlStmt);\n if ($dbConnection->error) {\n echo $dbConnection->error;\n exit();\n }\n\n $currentDate = date('Y-m-d H:i:s');\n $stmtObj->bind_param(\"isssssssssiis\", $this->customerId, $this->firstName, $this->lastName, $this->address, $this->city,\n $this->state, $this->zip, $this->phone, $this->email, $this->notes, $this->employeeId,\n $this->employeeId, $currentDate);\n $stmtObj->execute();\n if ($dbConnection->error) {\n echo $dbConnection->error;\n exit();\n }\n $this->propertyId = $dbConnection->insert_id;\n } else {\n // Update existing row.\n $sqlStmt = \"UPDATE property SET customer_id = ?, tenant_first_name = ?, tenant_last_name = ?, address = ?, city = ?, \";\n $sqlStmt .= \"state = ?, zip = ?, phone = ?, email = ?, notes = ?, last_modified_by = ?, last_modified = ? \";\n $sqlStmt .= \"WHERE id = ? \";\n\n $currentDate = date('Y-m-d H:i:s');\n\n $stmtObj = $dbConnection->prepare($sqlStmt);\n $stmtObj->bind_param(\"isssssssssisi\", $this->customerId, $this->firstName, $this->lastName, $this->address, $this->city,\n $this->state, $this->zip, $this->phone, $this->email, $this->notes, $this->employeeId,\n $currentDate, $this->propertyId);\n $stmtObj->execute();\n }\n\n $this->statusMessage = \"Save successful: \" . date(\"h:i:s a\");\n\n }", "public function store(CustomerCreateRequest $request)\n {\n //\n $customer = $request->all();\n tbl_customer::create($customer);\n return redirect(route('customer.index'));\n }", "public function save()\n {\n \n global $connection;\n //echo \"Im on the purchases ->save()\";\n\n\n //if($this->customer_id == \"\")\n //{\n #set error handler\n #set exception handler\n #call stored procedures\n $SQLQuery = \"CALL purchases_insert(\"\n . \":fk_customer_id,\"\n . \":fk_product_id,\"\n . \":purchase_quantity,\"\n . \":purchase_price,\"\n . \":purchase_comment,\"\n . \":purchase_subtotal,\"\n . \":purchase_taxesAmount,\"\n . \":purchase_grandtotal);\";\n $PDOStatement = $connection->prepare($SQLQuery);\n $PDOStatement->bindParam(\":fk_customer_id\", $this->customer_id);\n $PDOStatement->bindParam(\":fk_product_id\", $this->product_id);\n $PDOStatement->bindParam(\":purchase_quantity\", $this->purchase_quantity);\n $PDOStatement->bindParam(\":purchase_price\", $this->purchase_price);\n $PDOStatement->bindParam(\":purchase_comment\", $this->purchase_comment);\n $PDOStatement->bindParam(\":purchase_subtotal\", $this->purchase_subtotal);\n $PDOStatement->bindParam(\":purchase_taxesAmount\", $this->purchase_taxesAmount);\n $PDOStatement->bindParam(\":purchase_grandtotal\", $this->purchase_grandTotal);\n \n $PDOStatement->execute(); \n }", "public function saveCustomer($user)\n {\n return Stripe\\Customer::create(array(\n 'description' => $user->id.\" \".$user->first_name.' '.$user->last_name,\n 'email' => $user->email\n ));\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"data_customer\",\n \"action\" => \"index\"\n ));\n }\n\n $_id = $this->request->getPost(\"kode_pemesan\");\n\n\n $data_customer = DataCustomer::findFirst(array(\n array(\n \"kode_pemesan\" => $_id\n\n )\n ));\n if (!$data_customer) {\n $this->flash->error(\"data_customer does not exist \" . $_id);\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"data_customer\",\n \"action\" => \"index\"\n ));\n }\n\n $data_customer->kode_pemesan = $this->request->getPost(\"kode_pemesan\");\n $data_customer->nama_pemesan = $this->request->getPost(\"nama_pemesan\");\n $data_customer->alamat = $this->request->getPost(\"alamat\");\n $data_customer->kabupaten = $this->request->getPost(\"kabupaten\");\n $data_customer->no_tlp = $this->request->getPost(\"no_tlp\");\n \n\n if (!$data_customer->save()) {\n\n foreach ($data_customer->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"data_customer\",\n \"action\" => \"edit\",\n \"params\" => array($data_customer->_id)\n ));\n }\n\n $this->flash->success(\"data_customer was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"data_customer\",\n \"action\" => \"index\"\n ));\n\n }", "function save_individual_customer_detail( $params ) {\n\t\textract( $params );\n\n\t\t$qry = \"UPDATE cart SET \";\n\t\t$qry.= $fieldname.\"='\".$value.\"' \";\n\t\t$qry.= \"WHERE id='\".$cart_id.\"' AND customer_id='\".$user_no.\"'\";\n\n\t\treturn $this->db->query( $qry );\n\t}", "public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }", "public function store(CreateCustomerRequest $request, Customer $customer)\n {\n // dd($request->all());\n $data = [\n 'first_name' => $request->first_name,\n 'last_name' => $request->last_name,\n 'phone_number' => $request->phone_number,\n 'password' => Hash::make('password'),\n ];\n $customer = $customer->create($data);\n Auth::guard('customer')->login($customer);\n Session::flash('flash_massage_type', 1);\n\n if(URL::previous() == route('singup')){\n return redirect()->route('profile')->withFlashMassage('تم انشاء الحساب بنجاح');\n }\n return redirect()->back()->withFlashMassage('تم انشاء الحساب بنجاح');\n }", "public function createCustomer($data = array()){\n\n $email = $data['account']['email'];\n\n /** @var $customer Mage_Customer_Model_Customer */\n $customer = Mage::getModel('customer/customer');\n\n // load user if exist\n $customer->setWebsiteId(Mage::app()->getStore()->getWebsiteId());\n $customer->loadByEmail($email);\n\n $isNew = true;\n if($customer->getId() > 0){\n $isNew = false;\n }\n\n if($isNew){\n $customer->setData($data['account']);\n }else{\n $customer->setFirstname($data['account']['firstname']);\n $customer->setLastname($data['account']['lastname']);\n }\n\n foreach (array_keys($data['address']) as $index) {\n $address = Mage::getModel('customer/address');\n\n $addressData = array_merge($data['account'], $data['address'][$index]);\n\n // Set default billing and shipping flags to address\n // TODO check if current shipping info is the same than current default one, and avoid create a new one.\n $isDefaultBilling = isset($data['account']['default_billing'])\n && $data['account']['default_billing'] == $index;\n $address->setIsDefaultBilling($isDefaultBilling);\n $isDefaultShipping = isset($data['account']['default_shipping'])\n && $data['account']['default_shipping'] == $index;\n $address->setIsDefaultShipping($isDefaultShipping);\n\n $address->addData($addressData);\n\n // Set post_index for detect default billing and shipping addresses\n $address->setPostIndex($index);\n\n $customer->addAddress($address);\n }\n\n // Default billing and shipping\n if (isset($data['account']['default_billing'])) {\n $customer->setData('default_billing', $data['account']['default_billing']);\n }\n if (isset($data['account']['default_shipping'])) {\n $customer->setData('default_shipping', $data['account']['default_shipping']);\n }\n if (isset($data['account']['confirmation'])) {\n $customer->setData('confirmation', $data['account']['confirmation']);\n }\n\n if (isset($data['account']['sendemail_store_id'])) {\n $customer->setSendemailStoreId($data['account']['sendemail_store_id']);\n }\n\n if($isNew){\n doLog('creating user');\n $customer\n ->setPassword($data['account']['password'])\n ->setForceConfirmed(true)\n ->save();\n $customer->cleanAllAddresses();\n }else{\n doLog('updating user');\n $customer->save();\n\t $customer->setConfirmation(null);\n\t $customer->save();\n }\n\n return $customer;\n }", "public function saveCustomerComment()\n {\n\t$comment = Mage::app()->getRequest()->getParam('comment', null);\n\tif($comment && strlen(trim($comment))) {\n\t $this->_checkoutSession->setData('customer_comment', $comment);\n\t} else {\n\t $this->_checkoutSession->unsetData('customer_comment');\n\t}\n }", "public function store(){\n \t$customer = Customer::create([\n \t\t'name' => request()->name,\n \t\t'phone' => request()->phone,\n 'idSucursal' => request()->idSucursal,\n \t]);\n\n if(request()->segment(1) == 'api'){\n return response()\n ->json([\"customer\"=>$customer],200);\n }\n else{\n \t return Redirect::to('customer');\n }\n }", "public function store(Request $request)\n {\n\n $checkCustomer = Customer::where('phone_number',$request->phone_number)->get();\n\n $saveCustomer = new Customer();\n $saveCustomer->name = $request->name;\n $saveCustomer->address = $request->address;\n $saveCustomer->phone_number = $request->phone_number;\n\n if ($checkCustomer->count() == 0) {\n try { \n $saveCustomer->save();\n } catch (\\Exception $e) {}\n\n }elseif($checkCustomer->count() == 1){\n $saveCustomer = $checkCustomer->last();\n }\n \n\n $update_sales_shift = MainSale::find($request->mainsales_id);\n\n if (empty($update_sales_shift->workshift_id)) {\n\n $update_sales_shift->workshift_id = $request->workshift_id;\n\n if (!empty($saveCustomer)) {\n\n $update_sales_shift->customer_id = $saveCustomer->id;\n }\n\n $update_sales_shift->save();\n }\n\n $pricetag = PriceTag::all()->where('id',$request->data)->last();\n if (empty($pricetag)) {\n echo \"The item price does not exist in the system\";\n return;\n }else{\n SalesController::save_sale($pricetag->stock_id,$request->size,$pricetag,$request->workshift_id,$update_sales_shift->id,$request->discount); \n\n }\n \n\n }", "public function store()\n {\n $this->validate();\n\n $cliente = Cliente::create([\n 'sexo_id' => $this->sexo_id,\n 'cedula' => $this->cedula,\n 'nombre_primero' => $this->nombre_primero,\n 'nombre_segundo' => $this->nombre_segundo,\n 'apellido_paterno' => $this->apellido_paterno,\n 'apellido_materno' => $this->apellido_materno,\n 'direccion' => $this->direccion,\n 'correo' => $this->correo,\n 'telefono' => $this->telefono,\n 'fecha_nacimiento' => $this->fecha_nacimiento,\n 'deuda' => $this->deuda,\n ]);\n\n $this->resetInput();\n $this->accion = 1;\n }", "public function store()\n\t{\n $input = Input::all();\n\n $validation = Validator::make($input, Customer::$rules);\n\n if ($validation->fails()) return Redirect::back()->withErrors($validation)->withInput();\n\n $customer = Customer::create($input);\n return Redirect::route('customers.index');\n\t}", "public function save($action = '', $data = '', $customer_id = ''){\n if($data !== '' && $action === 'new'){\n $result = $this->db->insert('customers_tb', $data);\n return $result;\n }else if($data !== '' && $action === 'existing'){\n $result = $this->db->where('customer_id', $customer_id)->update('customers_tb', $data);\n return $result;\n }\n }", "public function save()\n\t {\n\t\tif (isset($this->_advert->date) === true && isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$bigfile = new BigFile(\"base-\" . $this->_advert->phone, 10);\n\t\t\t$bigfile->addrecord($this->_advert->date);\n\t\t } //end if\n\n\t }", "public function store($customerId, Request $request)\n {\n $customer = $this->customer->ofSalesRep()->findOrFail($customerId);\n $back_route = $request->has('back_route') ? urldecode($request->input('back_route')) : '' ;\n\n $this->validate($request, Address::$rules);\n\n $address = $this->address->create($request->all());\n\n $customer->addresses()->save($address);\n\n return redirect($back_route)\n ->with('success', l('This record has been successfully created &#58&#58 (:id) ', ['id' => $address->id], 'layouts') . $request->input('alias'));\n }", "public function insertCustomer() {\n $svcReturn = true;\n\n try {\n\n $data = array(\n 'code' => 'I',\n 'firstname' => Input::get('firstname'),\n 'lastname' => Input::get('lastname'),\n 'password' => Hash::make(Input::get('password')),\n 'email' => Input::get('email'),\n 'address' => Input::get('address'),\n 'address2' => Input::get('address2'),\n 'address3' => Input::get('address3'),\n 'postcode' => Input::get('postcode'),\n 'city' => Input::get('city'),\n 'province' => Input::get('province'),\n 'home_no' => Input::get('home_no'),\n 'mobile_no' => Input::get('mobile_no'),\n 'grup' => Input::get('grup'),\n 'ip_address' => Request::getClientIp(),\n 'active' => Input::get('active'),\n );\n\n $customer = new Customer($data);\n $customer->save();\n } catch (RuntimeException $exc) {\n $svcReturn = false;\n echo $exc->getTraceAsString();\n }\n\n return $svcReturn;\n }", "private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }", "public function store()\n {\n $this->authorize('create', Customer::class);\n\n $this->validate(request(), [\n 'name' => 'required|string',\n 'telephone' => 'required|string',\n 'email' => 'required|string',\n 'address' => 'nullable|string',\n 'address_2' => 'nullable|string',\n 'city' => 'nullable|string',\n 'province' => 'nullable|string',\n 'country' => 'nullable|string',\n ]);\n\n return response()\n ->json(fractal()\n ->item(Customer::create(request()->all()), new CustomerTransformer())\n ->toArray());\n }", "public function store(Request $request)\n {\n\n try {\n //validation for input customer\n $this->validate($request,[\n \"customer_fname\"=>\"required|string|regex:/^[a-zA-Z\\s]+$/\",\n \"customer_lname\"=>\"required|string|regex:/^[a-zA-Z\\s]+$/\",\n \"address\"=>\"required|string\",\n \"birthdate\"=>\"required|date|before:-1 year\",\n \"contact_no\"=>\"required|numeric|digits:11\",\n \"email_add\"=>\"email|nullable\"\n \n ]);\n\n }catch(\\Illuminate\\Validation\\ValidationException $e){\n return redirect()->route('clerkcustomers.index')\n ->with('open-create-modal', true)\n ->withInput($request->all())\n ->withErrors($e->validator);\n }\n //code for storing data to the table(database)\n $newCustomer = new Customer;\n $newCustomer->customer_fname=$request->customer_fname;\n $newCustomer->customer_lname=$request->customer_lname;\n $newCustomer->address=$request->address;\n $newCustomer->birthdate=$request->birthdate;\n $newCustomer->contact_no=$request->contact_no;\n $newCustomer->email_add=$request->email_add;\n\n $newCustomer->save(); //saves all the data(s) besing filled from form\n session()->flash('notif',$newCustomer->customer_fname.' '. $newCustomer->customer_lname.' has been added successfully.'); //displaying notification for success storing into the database\n return redirect()->route('clerkcustomers.index'); //after storing to the databse ,will be redirected to the customer list\n }", "private function save(Customer $customer)\n {\n return CustomerModel::insert($customer);\n }", "public function store(Request $request)\n {\n $customer = Customer::create([\n 'last_name' => $request->last_name,\n 'first_name' => $request->first_name,\n 'birthdate' => $request->birthdate,\n 'street' => $request->street,\n 'house_number' => $request->house_number,\n 'postcode' => $request->postcode,\n 'city' => $request->city,\n 'telephone' => $request->telephone,\n 'email' => $request->email\n ]);\n }", "public function store(Request $request)\n {\n Customer2::create([\n 'name' => $request->name,\n 'phone' => $request->phone,\n 'customer_name' => $request->customer['payload']['name'] ,\n ]);\n }", "public function store(CustomerRequest $request)\n\t{\n $input = $request->all();\n //dd($input);\n\t\tCustomer::create($input);\n\n return redirect('customer');\n\t}", "public function save()\r\n {\r\n \r\n }", "public function store(Request $request)\n {\n // return $request->all();\n $validated = $request->validate([\n 'name' => 'required|max:255',\n 'email' => 'required|max:255',\n 'mobile_number' => 'required',\n \n ]);\n $currentDate = date('Y-m-d');\n $get_bonus = Bonus::where('user_type',1)->where('bonus_type',1)->where('status',1)->where('start_date','<=',$currentDate)->where('end_date','>=',$currentDate)->first();\n\n $fileName = Helper::imgProcess($request,'image',$request->name, '', 'images/customer', 'store', Customer::class); \n $data = $request->all();\n $data['customer_type'] = 1;\n $data['created_by_type'] = 3;\n DB::beginTransaction();\n $data['image'] = $fileName;\n $customer = Customer::create($data);\n \n \n \n \n $Customer_detail = CustomerDetail::create([\n 'customer_id' => $customer['id'],\n 'division_id' => $data['division_id'],\n 'district_id' => $data['district_id'],\n 'zone_id' => $data['zone_id'],\n 'address' => $data['address'],\n 'referral_id' => $customer['id'],\n 'coins' => 0,\n 'bonus_amounts' =>!empty($get_bonus->amount)? $get_bonus->amount:0,\n 'withdraw_amounts' => 0,\n ]);\n DB::commit();\n return response()->json([\n 'status' => 'success',\n 'message' => 'Customer has been created!',\n 'icon' => 'check',\n ]);\n // if($validated){\n // Customer::create($data);\n // return response()->json([\n // 'status' => 'success',\n // 'message' => 'Customer has been created!',\n // 'icon' => 'check',\n // ]);\n // }\n }", "public function getOrCreateCustomer();", "public function save()\n {\n }", "function addCustomer($customerDetailsAry)\n{\n}", "public function store(Request $request)\n {\n $customer = Customer::firstOrCreate($request->get('primary'));\n $customer->email = $request->get('email');\n $customer->save();\n\n $primary = Address::where('customer_id', $customer->id)->where('is_primary', 1)->first();\n if(isset($primary)) {\n //update\n $primary->fill($request->get('primary'));\n $primary->save();\n } else {\n // Create new\n $primary = new Address();\n $primary->is_primary = 1;\n $primary->customer_id = $customer->id;\n $primary->fill($request->get('primary'));\n $primary->save();\n }\n\n $billing = Address::where('customer_id', $customer->id)->where('is_billing', 1)->first();\n if(isset($billing)) {\n //update\n $billing->fill($request->get('primary'));\n $billing->save();\n } else {\n // Create new\n $billing = new Address();\n $billing->is_billing = 1;\n $billing->customer_id = $customer->id;\n $billing->fill($request->get('primary'));\n $billing->save();\n }\n\n $shipping = Address::where('customer_id', $customer->id)->where('is_shipping', 1)->first();\n if(isset($shipping)) {\n //update\n $shipping->fill($request->get('shipping'));\n $shipping->save();\n } else {\n // Create new\n $shipping = new Address();\n $shipping->is_shipping = 1;\n $shipping->customer_id = $customer->id;\n $shipping->fill($request->get('shipping'));\n $shipping->save();\n }\n\n return redirect(\"admin/customers\");\n }", "public function storeCustomer($data)\n {\n $data['user_parent_id'] = auth()->user()->id;\n return Customer::create($data);\n }", "public function store(Request $request)\n {\n $validatedData = $request->validate([\n 'denomination' => 'required|string|max:255',\n 'adresse' => 'required|string|max:255',\n 'code_postal' => 'required|string|max:255',\n 'ville' => 'required|string|max:255',\n 'siren' => 'string|max:255',\n 'activite' => 'required|string|max:255',\n 'nb_events' => 'required|integer',\n 'contact_nom' => 'required|string|max:255',\n 'contact_prenom' => 'required|string|max:255',\n 'contact_telephone' => 'required|string|max:255',\n 'contact_poste' => 'required|string|max:255',\n 'informations' => 'max:750'\n ]);\n\n $customer = new Customer;\n $customer->denomination = $request->denomination;\n $customer->adresse = $request->adresse;\n $customer->code_postal = $request->code_postal;\n $customer->activite = $request->activite;\n $customer->ville = $request->ville;\n $customer->siren = $request->siren;\n $customer->nb_events = $request->nb_events;\n $customer->contact_nom = $request->contact_nom;\n $customer->contact_prenom = $request->contact_prenom;\n $customer->contact_telephone = $request->contact_telephone;\n $customer->contact_poste = $request->contact_poste;\n $customer->informations = $request->informations;\n $customer->event_id = $request->event_id;\n $customer->save();\n\n return redirect('admin/Customer/index')->with('status', 'Le client a été correctement ajouté.');\n }", "public function saveData()\r\n {\r\n \r\n }", "public function addCustomer(Request $request)\n {\n //\n $data = new Customer;\n $data->customers_name = $request->name;\n $data->customers_email =$request->email;\n $data->password = md5($request->password);\n $data->phone = $request->phone;\n $data->save();\n Session::put('cus_id',$data->id);\n Session::put('cus_email',$data->customers_email);\n return redirect()->route('checkout.out');\n\n }", "function saveInfo()\n {\n $idUser = isset($_SESSION['idUser']) ? $_SESSION['idUser'] : '';\n $newName = isset($_POST['user-edit-name']) ? $_POST['user-edit-name'] : '';\n $newPhone = isset($_POST['user-edit-phone']) ? $_POST['user-edit-phone'] : '';\n $newAddress = isset($_POST['user-edit-address']) ? $_POST['user-edit-address'] : '';\n $resutl = $this->model->khachhang->updateUserInfo($idUser, $newName, $newAddress, $newPhone);\n if ($resutl) {\n $_SESSION['username'] = $newName;\n $_SESSION['phone'] = $newPhone;\n $_SESSION['address'] = $newAddress;\n $_SESSION['success-update-customer-info'] = 'Thay đổi thông tin thành công !';\n redirect('user/index');\n } else {\n $_SESSION['fail-update-customer-info'] = 'Thay đổi thông tin thất bại!';\n redirect('user/index');\n }\n }", "public function save(Request $request)\n {\n /* $this->validate($request, [\n 'name' => 'required|string',\n 'contact_no' => 'required|integer',\n ]); */\n \n $customer = new Customer();\n $customer->name = $request->name;\n $customer->contact_number = $request->contact_no;\n $customer->save();\n \n return $customer;\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(),[\n 'name' => 'required|min:2|max:150',\n //'email' => 'unique:users,email,' . $userId,\n //'email' => 'required|unique:customers,email',\n 'phone' => 'required|min:6|max:15',\n ]);\n\n\n if($validator->fails()){\n return redirect()->back()->withErrors($validator)->withInput();\n }\n\n $customercount = Customer::where('customer_type',2)->count();\n $customerid = Customer::orderBy('id','DESC')->where('customer_type',2)->first();\n\n $customer = New customer();\n\n if($customercount>0)\n {\n $customer->id_no = $customerid->id_no+1;\n }\n else{\n $customer->id_no = '1001';\n }\n\n $customer->name = $request->name;\n $customer->email = $request->email ;\n $customer->phone = $request->phone;\n $customer->phone_2 = $request->phone_2;\n $customer->address = $request->address ;\n $customer->notes = $request->notes;\n $customer->previous_due = $request->previous_due;\n $customer->previous_due_date = $request->previous_due_date;\n $customer->customer_type = $request->customer_type;\n $customer->verified = 1;\n $customer->is_admin = Auth::user()->id;\n $customer->save();\n\n $notification = array(\n 'message' => 'Successfully customer added!',\n 'alert-type' => 'success'\n );\n\n return redirect()->route('customer.index')->with($notification);\n }", "public function store(CustomerCreateRequest $request)\n {\n $customer = new Customer;\n $data = $request->all();\n $data['password'] = Hash::make($data['password']);\n $customer->fill($request->all());\n $customer->saveOrFail();\n return response()->json([\n 'message' => __('customers::customers.created'),\n ], 201);\n }", "public function store(Customer $customer, Request $request): \\Illuminate\\Http\\RedirectResponse\n {\n // Validates all the inputs from the Customer Create Page\n $inputs = request()->validate([\n 'brideforename' => ['required', 'string', 'max:255', 'alpha_dash'],\n 'bridesurname' => ['required', 'string', 'max:255', 'alpha_dash'],\n 'groomforename' => ['required', 'string', 'max:255', 'alpha_dash'],\n 'groomsurname' => ['required', 'string', 'max:255', 'alpha_dash'],\n 'telephone' => ['required', 'string', 'max:13'],\n 'email' => ['string', 'email', 'max:255'],\n 'address1' => ['string', 'max:255'],\n 'address2' => ['string', 'max:255'],\n 'townCity' => ['string', 'max:255'],\n 'county' => ['string', 'max:255'],\n 'postCode' => ['string', 'max:255'],\n ]);\n $customer->create($inputs);\n $request->session()->flash('message', 'Customer was Created... ');\n $request->session()->flash('text-class', 'text-success');\n return redirect()->route('customers.index');\n }", "public function verify_and_save(){\n\t\t//Filtering XSS and html escape from user inputs \n\t\textract($this->security->xss_clean(html_escape(array_merge($this->data,$_POST))));\n\n\t\t$state = (!empty($state)) ? $state : 'NULL';\n\n\t\t//Validate This customers already exist or not\n\t\t/*$query=$this->db->query(\"select * from db_customers where upper(customer_name)=upper('$customer_name')\");\n\t\tif($query->num_rows()>0){\n\t\t\treturn \"Sorry! This Customers Name already Exist.\";\n\t\t}*/\n\t\t$query2=$this->db->query(\"select * from db_customers where mobile='$mobile'\");\n\t\tif($query2->num_rows()>0 && !empty($mobile)){\n\t\t\treturn \"Sorry!This Mobile Number already Exist.\";;\n\t\t}\n\t\t\n\t\t$qs5=\"select customer_init from db_company\";\n\t\t$q5=$this->db->query($qs5);\n\t\t$customer_init=$q5->row()->customer_init;\n\n\t\t//Create customers unique Number\n\t\t$qs4=\"select coalesce(max(id),0)+1 as maxid from db_customers\";\n\t\t$q1=$this->db->query($qs4);\n\t\t$maxid=$q1->row()->maxid;\n\t\t$customer_code=$customer_init.str_pad($maxid, 4, '0', STR_PAD_LEFT);\n\t\t//end\n\n\t\t$query1=\"insert into db_customers(customer_code,customer_name,mobile,phone,email,\n\t\t\t\t\t\t\t\t\t\t\tcountry_id,state_id,city,postcode,address,opening_balance,\n\t\t\t\t\t\t\t\t\t\t\tsystem_ip,system_name,\n\t\t\t\t\t\t\t\t\t\t\tcreated_date,created_time,created_by,status,gstin,tax_number)\n\t\t\t\t\t\t\t\t\t\t\tvalues('$customer_code','$customer_name','$mobile','$phone','$email',\n\t\t\t\t\t\t\t\t\t\t\t'$country',$state,'$city','$postcode','$address','$opening_balance',\n\t\t\t\t\t\t\t\t\t\t\t'$SYSTEM_IP','$SYSTEM_NAME',\n\t\t\t\t\t\t\t\t\t\t\t'$CUR_DATE','$CUR_TIME','$CUR_USERNAME',1,'$gstin','$tax_number')\";\n\n\t\tif ($this->db->simple_query($query1)){\n\t\t\t\t$this->session->set_flashdata('success', 'Success!! New Customer Added Successfully!');\n\t\t return \"success\";\n\t\t}\n\t\telse{\n\t\t return \"failed\";\n\t\t}\n\t\t\n\t}", "public function addCustomer()\n\t{\n\t\tdate_default_timezone_set('Asia/Kolkata');\n $timestamp = date('Y-m-d H:i:s');\n \n $phone = $this->security->xss_clean($this->input->post('phone'));\n $name = substr($phone, -4);\n \n $phonecheck = $this->Common->get_details('customers',array('customer_phone'=>$phone));\n if($phonecheck->num_rows()>0)\n {\n $this->session->set_flashdata('alert_type', 'error');\n\t\t\t$this->session->set_flashdata('alert_title', 'Failed');\n\t\t\t$this->session->set_flashdata('alert_message', 'Mobile number already registered..!');\n\t\t\tredirect('admin/bill/retailBill');\n }\n else\n {\n \t $array = [\n \t\t\t\t\t\t\t'name_english' => 'Customer'.$name,\n \t\t\t\t\t\t\t'customer_phone' => $phone,\n \t\t\t\t\t\t\t'customer_image' => 'uploads/admin/customers/user.png',\n \t\t\t\t\t\t\t'status' => '1',\n \t\t\t\t\t\t\t'added_by' => 'admin',\n \t\t\t\t\t\t\t'timestamp' => $timestamp\n \t\t\t\t ];\n \t\tif ($this->Common->insert('customers',$array)) \n \t\t{\n \t\t\t$this->session->set_flashdata('alert_type', 'success');\n \t\t\t$this->session->set_flashdata('alert_title', 'Success');\n \t\t\t$this->session->set_flashdata('alert_message', 'New customer added..!');\n \t\t\tredirect('admin/bill/retailBill');\n \t\t}\n \t\telse \n \t\t{\n \t\t\t$this->session->set_flashdata('alert_type', 'error');\n \t\t\t$this->session->set_flashdata('alert_title', 'Failed');\n \t\t\t$this->session->set_flashdata('alert_message', 'Failed to add customer..!');\n \t\t\tredirect('retailer/bill/retailBill');\n \t\t}\n }\t\n\t}", "public final function save() {\n }", "public function save() {}", "public function save() {}", "public function save() {}", "public function save() {\n\t\t\t\n\t\t}", "public function store(CreateCustomerRequest $request)\n\t{\n\t\tCustomers::create($request->all());\n\t\treturn redirect('customer');\n\t}", "public function save()\n {\n $sql = new Sql();\n\n $results = $sql->select(\n \"CALL sp_orders_save(:idorder, :idcart, :iduser, :idstatus, :idaddress, :vltotal)\",\n [\n ':idorder'=>$this->getidorder(),\n ':idcart'=>$this->getidcart(),\n ':iduser'=>$this->getiduser(),\n ':idstatus'=>$this->getidstatus(),\n ':idaddress'=>$this->getidaddress(),\n ':vltotal'=>$this->getvltotal()\n ]\n );\n\n if (count($results) > 0) {\n $this->setData($results[0]);\n }\n }", "public function store(CustomerRequest $request)\n {\n //\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'firstname' => 'required|string|max:255',\n // 'lastname' => 'required|string|max:255',\n // 'email' => 'required|string|email|max:255|unique:customers',\n // 'phone' => 'required',\n ]);\n \n $customer = new Customer();\n $customer->firstname = $request->firstname;\n $customer->lastname = $request->lastname;\n $customer->email = $request->email;\n $customer->phone = $request->phone;\n $customer->save();\n\n\n return redirect()->route('customer.index')->with('success', \"New customer $request->firstname $request->lastname added\");\n }", "public function store() {\n $post_data = Input::all();\n $rules= array(\n 'cliente' => 'required',\n 'cel_contacto' => '',\n 'tipo_cliente' => '', //1.Directo 2.Servicio\n 'nit_cc' => '',\n 'empresa' => '',\n 'telefono' => '',\n 'direccion' => '',\n 'ciudad' => '',\n 'pais' => '',\n 'email' => '',\n 'pagina_web' => '',\n 'otro' => ''\n );\n\n $validate = Validator::make($post_data, $rules);\n if ($validate) {\n $post_data['users_id'] = Auth::user()->id;\n $customer = Customer::create($post_data);\n return View::make('workorder.create')->with('customer', $customer);\n }\n }", "public function store(Request $request)\n {\n $customer = new Customer();\n $customer->first_name=$request->input('first_name');\n $customer->last_name=$request->input('last_name');\n $customer->email=$request->input('email');\n $customer->contact_no=$request->input('contact_no');\n $customer->status=($request->input('status')!==null);\n $customer->ipaddress=$request->ip();\n $customer->save();\n return redirect('customer');\n }", "function add_customer()\n\t{\n\t\tglobal $db;\n\n\t\t$vals = array(\n\t\t\t'NULL',\n\t\t\t$this->preorderID,\n\t\t\tmysql_real_escape_string($this->customerinfo['fname']),\n\t\t\tmysql_real_escape_string($this->customerinfo['lname']),\n\t\t\t$this->customerinfo['amountdown'],\n\t\t\tNO\n\t\t);\n\n\t\t$sql = \"INSERT INTO preorder_customers VALUES ('\".implode(\"','\",$vals).\"')\";\n\t\tmysql_query($sql,$db);\n\t\t$this->error->mysql(__FILE__,__LINE__);\n\t}", "public function store(Customer $customer, Address $address)\n {\n $invoice = [\n 'customer_id' => $customer->id,\n 'address_id' => $address->id,\n 'description' => request('description'),\n 'cost_description' => request('cost_description'),\n 'cost' => request('cost')\n ];\n\n Invoice::create($invoice);\n }", "public function add_customer($data){\n\t\t\n\t\t\t$this->db->insert('customers',$data);\n\t\t\tredirect('Customer');\n\t\t\n\t}", "public function save()\n {\n $data = $this->read_file();\n\n if (( ! $data))\n {\n $data = array();\n }\n\n $data[$this->id] = array(\n 'id' => $this->id,\n 'email' => $this->email,\n 'firstname' => $this->firstname,\n 'lastname' => $this->lastname,\n 'password' => $this->password,\n 'token' => $this->token,\n 'logins' => $this->logins,\n );\n\n $this->write_file($data);\n }", "public function store()\n\t{\n\t\t$before_save_rules = array(\n\t\t\t'first_name'\t=> 'required|min:3',\n\t\t\t'last_name' \t=> 'required|min:3',\n\t\t\t'phone'\t\t\t=> 'required'\n\t\t);\n\n\t\t$user \t\t\t\t\t\t\t= new $this->user;\n $user->email \t\t\t\t\t= Input::get('email');\n $user->password \t\t\t\t= Input::get('password');\n $user->password_confirmation \t= Input::get('password');\n $user->confirmation_code \t\t= md5(uniqid(mt_rand(), true));\n $user->confirmed \t\t\t\t= 1;\n\n\t\t$customer \t\t\t\t= new $this->repo;\n\t\t$customer->first_name\t= Input::get('first_name');\n\t\t$customer->last_name\t= Input::get('last_name');\n\t\t$customer->phone\t\t= Input::get('phone');\n\n\t\t$validator = Validator::make(Input::all(), $before_save_rules);\n\n\t\tif ($validator->passes()) {\n\t\t\tif ($user->save()) {\n\t\t\t\t\t$customer->user_id \t\t= $user->id;\n\t\t\t\t\t$customer->save();\n\n\t\t\t\t\treturn $this->rest->response(201, $customer);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this->response->errorBadRequest($user->errors());\n\t\t}\n\n\t\treturn $this->response->errorBadRequest($validator->errors());\n\t}", "private function saveItem()\n {\n DB::beginTransaction();\n try\n {\n $customer = ( !empty(request()->json('id')) ) ? Customer::find(request()->json('id')) : new Customer();\n $customer->name = request()->json('name');\n $customer->contact = request()->json('contact');\n $customer->email = request()->json('email');\n $customer->phone = request()->json('phone');\n $customer->fax = request()->json('fax');\n $customer->address1 = request()->json('address1');\n $customer->address2 = request()->json('address2');\n $customer->city = request()->json('city');\n $customer->postal_code = request()->json('postal_code');\n $customer->province_id = request()->json('province_id');\n $customer->country_id = request()->json('country_id');\n $customer->active = ( !empty(request()->json('active')) ) ? true : false;\n $customer->save();\n \n //set customer id\n $customer_id = $customer->id;\n\n //add to warehouse client table if it was a popup and warehouse and client id's were sent in\n $warehouse_id = request()->json('warehouse_id');\n $client_id = request()->json('client_id');\n if ( !empty($warehouse_id) && !empty($client_id) )\n {\n $customer_client_warehouse = new CustomerClientWarehouse();\n $customer_client_warehouse->customer_id = $customer_id;\n $customer_client_warehouse->warehouse_id = $warehouse_id;\n $customer_client_warehouse->client_id = $client_id;\n $customer_client_warehouse->save();\n }\n else\n {\n /* Update client warehouse */\n //delete all current data\n CustomerClientWarehouse::where('customer_id', '=', $customer_id)->delete();\n\n //merge both lists and add\n $items = request()->json('client_warehouse_new', []);\n $items = array_merge($items, request()->json('client_warehouse', []));\n\n foreach( $items as $item )\n {\n $object = new CustomerClientWarehouse();\n $object->customer_id = $customer->id;\n $object->warehouse_id = $item['warehouse_id'];\n $object->client_id = $item['client_id'];\n $object->save();\n }\n }\n }\n catch(\\Exception $e)\n {\n //rollback since something failed\n DB::rollback();\n\n //log error so we can trace it if need be later\n Log::info(auth()->user());\n Log::error($e);\n\n //set error message. Don't send verbose error if not in debug mode\n $err_msg = ( env('APP_DEBUG') === true ) ? $e->getMessage() : 'SQL error. Please try again or report the issue to the admin.';\n\n //send back error\n $error_message = ['errorMsg' => 'The customer was not saved. Error: ' . $err_msg];\n\n return response()->json($error_message);\n }\n\n //if we got here, then everything worked!\n DB::commit();\n\n return response()->json($customer_id);\n }", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();" ]
[ "0.7357428", "0.73563224", "0.7269272", "0.7219316", "0.71492916", "0.690299", "0.68556327", "0.68530786", "0.6797456", "0.6783201", "0.6746828", "0.67001164", "0.669137", "0.6691266", "0.6675675", "0.6651309", "0.66199183", "0.660432", "0.66018665", "0.65976244", "0.6596507", "0.6532983", "0.65277755", "0.6517531", "0.6507801", "0.6483412", "0.64707106", "0.6383936", "0.637429", "0.6372509", "0.6365103", "0.6360061", "0.63590175", "0.63453496", "0.6342854", "0.63341874", "0.6323928", "0.6321515", "0.6312784", "0.6304027", "0.6294792", "0.62929475", "0.6292831", "0.6279803", "0.62773925", "0.6262397", "0.6251768", "0.6249406", "0.6213423", "0.6198548", "0.61981106", "0.61963093", "0.61958057", "0.6193932", "0.6191171", "0.6187788", "0.6186599", "0.61835486", "0.6183509", "0.6182517", "0.61764073", "0.6176307", "0.6175292", "0.6171341", "0.6168621", "0.616734", "0.6163595", "0.6163479", "0.6148546", "0.61450094", "0.6140545", "0.61393654", "0.61385685", "0.6135839", "0.6131966", "0.6129929", "0.6120763", "0.61145234", "0.611408", "0.611408", "0.61120844", "0.61005247", "0.60891247", "0.6074692", "0.6072692", "0.6066713", "0.6066526", "0.6066367", "0.60622907", "0.60599935", "0.60538644", "0.60491896", "0.6047146", "0.60468996", "0.6044621", "0.6044621", "0.6044621", "0.6044621", "0.6044621", "0.6044621" ]
0.66112953
17
Get list of SO's by location group
public function getSOList($LocationGroup = 'SLC') { // Parse XML $xml = "<GetSOListRq>\n<LocationGroup>{$LocationGroup}</LocationGroup>\n</GetSOListRq>\n"; // Create request and pack $this->createRequest($xml); $len = strlen($this->xmlRequest); $packed = pack("N", $len); // Send and get the response fwrite($this->id, $packed, 4); fwrite($this->id, $this->xmlRequest); $this->getResponse(); // Set the result $this->setResult($this->parseXML($this->xmlResponse)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGroups()\n\t{\t\t\n\t\t$groups = $this->tax_class->getTerms();\n\t\tforeach ($groups as &$group) \n\t\t{\n\t\t\t$key = md5($group->meta['location_address']);\n\t\t\t$cache = $this->getCache($key);\n\t\t\tif($cache)\n\t\t\t{\n\t\t\t\t$group->meta['location'] = $cache;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$group->meta['location'] = $this->getLatLngByAddress($group->meta['location_address']);\n\t\t\t}\n\t\t\t$this->setCache($key, $group->meta['location']);\n\t\t}\n\t\treturn $groups;\n\t}", "public function all_locations() {\n\t\t// Globals\n\t\tglobal $wpdb;\n\t\t\n\t\t// Load the location from the db\n\t\t$sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_locations` ORDER BY `location` ASC;\";\n\t\t$sqlret = $wpdb->get_results( $sql, ARRAY_A );\n\t\t\n\t\t// Set the return array\n\t\t$return = new StdClass();\n\t\t\n\t\t// Loop through each result and process\n\t\tforeach( $sqlret as $location ) {\n\t\t\t// Group IDs are stored as an array. Make sure it is actually an array.\n\t\t\t$location['groups'] = rpids_unserialize( $location['groups'] );\n\t\t\t\n\t\t\t// Add location info to an array\n\t\t\t$return->$location['id'] = new StdClass();\n\t\t\t$return->$location['id']->id = $location['id'];\n\t\t\t$return->$location['id']->name = $location['location'];\n\t\t\t$return->$location['id']->groups = (object) $location['groups'];\n\t\t\t$return->$location['id']->weather_id = $location['weather_id'];\n\t\t\t$return->$location['id']->layout_id = $location['layout_id'];\n\t\t}\n\t\t\n\t\t// Return everything as an object\n\t\treturn $return;\n\t}", "public function getListByLocation()\r\n {\r\n\t\tif (defined(\"WITH_SPHINX_TAGS\") && WITH_SPHINX_TAGS)\r\n\t\t{\r\n\t\t\t//$this->addFilter(\"entity_type\", 6, true); // exclude events from tag cloud\r\n $this->addFilter(\"entity_type\", 2); // get tags for groups Only\r\n\t\t\treturn parent::getList(\"name\", \"@count\");\r\n\t\t} else {\r\n\t\t\techo 3;exit;\r\n\t\t\tif ( $this->getGroupId() !== null ) {\r\n\t\t\t\t$this->addWhere('group_id = ?', $this->getGroupId());\r\n\t\t\t}\r\n\t\t\t$where = $this->getWhere();\r\n\t\t\tif ($where) $where = 'where '.$where;\r\n\t\t\t$fields = array();\r\n\t\t\tif ( $this->isAsAssoc() ) {\r\n\t\t\t\t$fields[] = ( $this->getAssocKey() === null ) ? 'name' : $this->getAssocKey();\r\n\t\t\t\t$fields[] = ( $this->getAssocValue() === null ) ? 'rating' : $this->getAssocValue();\r\n\t\t\t} else {\r\n\t\t\t\t$fields[] = 'id';\r\n\t\t\t}\r\n\t\t\t$fields = implode(', ', $fields);\r\n\t\t\t$limit = \"\";\r\n\t\t\tif ( $this->getCurrentPage() !== null && $this->getListSize() !== null ) {\r\n\t\t\t\t$limit = \"LIMIT \".(($this->getCurrentPage()-1) * $this->getListSize()) .\", \". $this->getListSize();\r\n\t\t\t}\r\n\t\t\t$order = \"\";\r\n\t\t\tif ( $this->getOrder() !== null ) {\r\n\t\t\t\t$order = \"ORDER BY \".$this->getOrder();\r\n\t\t\t}\r\n\r\n\t\t\t$query = \"SELECT distinct {$fields} FROM (\r\n\t#get groups tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 2 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t)\r\n\t\t\t)\r\n\tUNION\r\n\t#get documents tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 5 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t SELECT id FROM zanby_documents__items\r\n\t\t\t\t\t WHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t)\r\n\t\t\t )\r\n\tUNION\r\n\t#get members tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 1 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t SELECT user_id FROM zanby_groups__members\r\n\t\t\t\t\t WHERE group_id\r\n\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t)\r\n\t\t\t)\r\n\tUNION\r\n\t#get events tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 6 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t\tSELECT id FROM zanby_event__items\r\n\t\t\t\t\t\tWHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t\tIN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t)\r\n\t\t\t )\r\n\tUNION\r\n\t#get photos tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\tIN (\r\n\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t WHERE entity_type_id = 4 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t SELECT id from zanby_galleries__photos\r\n\t\t\t\t\t WHERE gallery_id\r\n\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT id FROM zanby_galleries__items\r\n\t\t\t\t\t\t\t WHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t\t\tSELECT group_id FROM `view_groups__locations` $where\r\n\t\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)\r\n\tUNION\r\n\t#get lists tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 20 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t\tSELECT id FROM zanby_lists__items\r\n\t\t\t\t\t\tWHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t\tIN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t)\r\n\t\t\t )\r\n\tUNION\r\n\t#get lists items tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\tIN (\r\n\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t WHERE entity_type_id = 21 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t SELECT id from zanby_lists__records\r\n\t\t\t\t\t WHERE list_id\r\n\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT id FROM zanby_lists__items\r\n\t\t\t\t\t\t\t WHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t\t\tSELECT group_id FROM `view_groups__locations` $where\r\n\t\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)\r\n\t)\r\n\tAS result {$order} {$limit}\";\r\n\r\n\t\t\t$items = $this->getTagListFromSQL($query);\r\n\t\t}\r\n return $items;\r\n }", "public function findAllWithLocations()\n {\n $query = $this->createQuery();\n $fieldName = ((bool)ConfigurationUtility::getExtensionConfiguration()['enableFilterCategories']) ? 'filter_categories' : 'categories';\n $query->statement('\n SELECT DISTINCT\n sys_category.*\n FROM\n sys_category\n JOIN\n sys_category_record_mm\n ON sys_category_record_mm.uid_local = sys_category.uid\n WHERE\n sys_category_record_mm.tablenames = \"tx_locationmanager_domain_model_location\" AND\n sys_category_record_mm.fieldname = \"' . $fieldName . '\"\n GROUP BY\n sys_category.uid\n ');\n return $query->execute();\n }", "public function getListings($location) {\r\n\r\n $stmt = NULL;\r\n $results = NULL;\r\n\r\n switch ($location) {\r\n\r\n case 'grid':\r\n\r\n $sql = \"SELECT t.pagetype AS type, c.id AS id, n.nickname AS nickname,\r\n IF(COUNT(c.id) > 0, TRUE, FALSE) AS validity, c.name AS name, u.url AS short_url,\r\n t.template_secure AS secure, c.slug AS slug, t.template_filename AS filename, c.id AS canonical,\r\n c.page_title AS title, c.meta_description AS meta_description, c.meta_keywords AS meta_keywords,\r\n c.page_heading AS heading, t.allow_target AS allow_target, t.requires_login AS requires_login,\r\n t.disallow_guests AS disallow_guests, c.sitemap_show AS visibility, c.sitemap_page_priority AS priority,\r\n c.sitemap_page_change_frequency AS change_frequency, c.* FROM bs_subcategories c JOIN bs_pagetypes t\r\n\t\t\t\t\t LEFT JOIN bs_page_urls u ON (u.id = c.canonical_page_url AND u.pagetype = t.pagetype AND u.pageid = c.id)\r\n\t\t\t\t\t LEFT JOIN bs_groupings grp ON (grp.id = c.grouping_id) LEFT JOIN bs_categories cat ON (cat.id = grp.category_id)\r\n\t\t\t\t\t LEFT JOIN bs_page_nicknames n ON (t.pagetype = n.pagetype AND c.id = n.pageid)\r\n\t\t\t\t\t WHERE cat.active = TRUE AND grp.active = TRUE AND c.active = TRUE AND grp.id = ? AND t.pagetype = 'subcategory'\r\n\t\t\t\t\t GROUP BY c.id ORDER BY c.position ASC, c.name ASC\";\r\n break;\r\n\r\n case 'sidebar':\r\n\r\n $sql = \"SELECT t.pagetype AS type, c.id AS id, n.nickname AS nickname, IF(COUNT(c.id) > 0, TRUE, FALSE) AS validity,\r\n c.name AS name, u.url AS short_url, t.template_secure AS secure, c.slug AS slug, t.template_filename AS filename,\r\n c.id AS canonical, c.page_title AS title, c.meta_description AS meta_description, c.meta_keywords AS meta_keywords,\r\n c.page_heading AS heading, t.allow_target AS allow_target, t.requires_login AS requires_login,\r\n t.disallow_guests AS disallow_guests, c.sitemap_show AS visibility, c.sitemap_page_priority AS priority,\r\n c.sitemap_page_change_frequency AS change_frequency, grp.accessory\r\n\t\t\t\t\t FROM bs_subcategories c JOIN bs_pagetypes t\r\n\t\t\t\t\t LEFT JOIN bs_page_urls u ON (u.id = c.canonical_page_url AND u.pagetype = t.pagetype AND u.pageid = c.id)\r\n\t\t\t\t\t LEFT JOIN bs_groupings grp ON (grp.id = c.grouping_id) LEFT JOIN bs_categories cat ON (cat.id = grp.category_id)\r\n\t\t\t\t\t LEFT JOIN bs_page_nicknames n ON (t.pagetype = n.pagetype AND c.id = n.pageid)\r\n\t\t\t\t\t WHERE cat.active = TRUE AND grp.active = TRUE AND c.active = TRUE AND grp.id = ? AND t.pagetype = 'subcategory'\r\n\t\t\t\t\t GROUP BY c.id ORDER BY c.name ASC\";\r\n break;\r\n }\r\n\r\n $stmt = Connection::getHandle()->prepare($sql);\r\n\r\n if( $stmt->execute(array ($this->getId())) ) {\r\n\r\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\r\n\r\n $results[] = $row;\r\n }\r\n }\r\n\r\n return $results;\r\n }", "public function getSubLocations(LocationInterface $location): iterable;", "public function get_inventory_by_location_summary()\n\t{\n\t\t$this->db->select(\n\t\t\t$this->datas_table.\".location_id, \".\n\t\t\t$this->locations_table.\".code, \".\n\t\t\t$this->locations_table.\".name, \".\n\t\t\t\"COUNT(\".$this->datas_table.\".location_id) AS total\"\n\t\t);\n\t\t$this->db->from($this->datas_table);\n\n\t\t// join categories table\n\t\t$this->db->join(\n\t\t\t$this->locations_table,\n\t\t\t$this->datas_table.'.location_id = '.$this->locations_table.'.id',\n\t\t\t'left');\n\n\t\t$this->db->where($this->datas_table.'.deleted', '0');\n\n\t\t$this->db->group_by($this->datas_table.'.location_id');\n\n\t\t$datas = $this->db->get();\n\t\treturn $datas;\n\t}", "function field_group_location_list($field_group){\n \n if(!acf_maybe_get($field_group, 'location'))\n return $field_group;\n \n foreach($field_group['location'] as &$or){\n \n foreach($or as &$and){\n \n if(!isset($and['value']))\n continue;\n \n // Post Type List\n if($and['param'] === 'post_type' && acfe_ends_with($and['value'], '_archive')){\n \n $and['param'] = 'post_type_list';\n $and['value'] = substr_replace($and['value'], '', -8);\n \n }\n \n // Taxonomy List\n elseif($and['param'] === 'taxonomy' && acfe_ends_with($and['value'], '_archive')){\n \n $and['param'] = 'taxonomy_list';\n $and['value'] = substr_replace($and['value'], '', -8);\n \n }\n \n }\n \n }\n \n return $field_group;\n \n }", "public function listAddressGroupings();", "public function getLocations(){\n $table = new Yourdelivery_Model_DbTable_Locations();\n $locationRows = $table->fetchAll(sprintf('companyId = %d AND deleted = 0' , $this->getId()));\n\n $locations = new SplObjectStorage();\n foreach($locationRows as $locationRow){\n try{\n $loc = new Yourdelivery_Model_Location($locationRow['id']);\n $locations->attach($loc);\n }catch(Yourdelivery_Exception_Database_Inconsistency $e){\n $this->logger->err(sprintf('Could not create location #', $locationRow['id']));\n continue;\n }\n }\n return $locations;\n }", "private function getStoreOpenings( $store ) {\n\t\t$result = null; \n\t\tforeach ( $this->data as $id => $location ) {\n\t\t\tif( $store === $id ) {\n\t\t\t\tforeach ( $location as $key => $value ) {\n\t\t\t\t\tif( $key === 'geöffnet' ) {\n\t\t\t\t\t\tforeach ( $value as $day => $openingHours ) {\n\t\t\t\t\t\t\t$result[ $day ] = $openingHours;\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\treturn $result;\n\t}", "function findAllLocations() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM locations;'));\r\n\r\n\t}", "public function getAllLocations()\n\t{\n\t\t$sCacheId = $this->cache()->set('gmap.locations');\n\t\n\t\tif (!($aRows = $this->cache()->get($sCacheId)))\n\t\t{\n\t\t\t$aRows = $this->database()->select('f.*, u.full_name, u.user_name, u.country_iso')\n\t\t\t\t->from(Phpfox::getT('gmap'), 'f')\t\t\n\t\t\t\t->join(Phpfox::getT('user'), 'u', 'u.user_id = f.user_id')\t\n\t\t\t\t->where('f.not_found = \\'0\\'')\n\t\t\t\t->execute('getSlaveRows');\n\t\t\t\t\n\t\t\t$this->cache()->save($sCacheId, $aRows);\n\t\t}\n\t\t\n\t\t$aOutput = array();\n\t\t\n\t\tif($aRows != null && is_array($aRows))\n\t\tforeach($aRows as $aRow)\n\t\t{\n\t\t\t$aOutput[$aRow['country_iso']][] = $aRow;\n\t\t}\n\t\treturn $aOutput;\n\t}", "public function findAllLocations(WP_REST_Request $request)\n {\n\n $args = [\n 'post_type' => 'session',\n 'status' => 'publish',\n 'posts_per_page' => -1,\n ];\n\n $query = new WP_Query($args);\n\n // one-liner to map the session object to an array of unique locations.\n // This needs to be revisited to see if WP_Query support getting this information\n // without having to iterate over every session post type.\n return array_values(\n array_unique(\n array_map(\n function (WP_Post $post): array {\n $session = new Session($post);\n $shortName = $session->getVenueShortname();\n $room = $session->getRoom();\n return [\n 'import_id' => str_replace([' ', '{', '}', '(', ')', '/', '\\\\', '@', ':'], '_', \"$shortName.$room\"),\n 'name' => \"$room, $shortName\",\n 'location_type' => 2\n ];\n },\n $query->get_posts()\n ),\n SORT_REGULAR)\n );\n\n }", "public function listLocations()\n {\n $response = $this->_performRequest(self::OP_LOCATIONS);\n\n \tif ($response->isSuccessful()) {\n\t\t\t$result = $this->_parseResponse($response);\n\n \t\tif (!$result->Location) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t if (count($result->Location) > 1) {\n \t\t $xmlServices = $result->Location;\n \t\t} else {\n \t\t $xmlServices = [$result->Location];\n \t\t}\n\n\t\t\t$services = [];\n\t\t\tif (!is_null($xmlServices)) {\n\n\t\t\t\tfor ($i = 0; $i < count($xmlServices); $i++) {\n\t\t\t\t\t$services[] = new Zend_Service_WindowsAzure_Management_LocationInstance(\n\t\t\t\t\t (string)$xmlServices[$i]->Name\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $services;\n\t\t} else {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n\t\t\tthrow new Zend_Service_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));\n\t\t}\n }", "public function getLocations(): array\n {\n $arrLocations = array();\n $objLocations = ContaoEstateManager\\ProviderModel::findAll();\n\n if ($objLocations === null)\n {\n return $arrLocations;\n }\n\n while ($objLocations->next())\n {\n $arrLocations[ $objLocations->id ] = $objLocations->postleitzahl . ' ' . $objLocations->ort . ' (' . $objLocations->firma . ')';\n }\n\n return $arrLocations;\n }", "public function list(StorableLocator $storableLocator): TypedGroup;", "function LocationDropdownList()\n\t{\t$loc_list = array();\n\t\t\n\t\tif ($locations = $this->GetLocations())\n\t\t{\tforeach ($locations as $location)\n\t\t\t{\t$loc_list[$location->id] = $location->details[\"loctitle\"];\n\t\t\t}\n\t\t}\n\t\t//print_r($this);\n\t\treturn $loc_list;\n\t}", "public function getall()\r\n {\r\n $locations = array();\r\n $count = 0;\r\n \r\n foreach($this->all() as $location)\r\n {\r\n $location = (array)$location;\r\n \r\n $locations[] = array('id' => $location['id'], 'name' => $location['name'],\r\n 'caption' => $location['caption'], 'description' => $location['description'],\r\n 'address' => $location['address'],\r\n 'contact' => $location['contact'],\r\n 'image1' => $location['image1'], 'image2' => $location['image2'],\r\n 'image3' => $location['image3'], 'image4' => $location['image4']);\r\n $count++;\r\n \r\n }\r\n \r\n if ($count > 0)\r\n {\r\n return $locations;\r\n }\r\n else\r\n {\r\n return null;\r\n } \r\n }", "public static function getTrackersByOs($os){\n $query = self::find()->select('tracking_id, tracker_name');\n if($os !== null)\n $query = $query->addInWhere('os_name',$os);\n return $query->groupBy('tracking_id,tracker_name')->all();\n\n }", "public function getListLoc()\n {\n $db = $this->dblocal;\n try\n {\n $stmt = $db->prepare(\"SELECT @rownum := @rownum + 1 AS urutan,t.* FROM m_location t, \n (SELECT @rownum := 0) r ORDER BY id_loc ASC\");\n $stmt->execute();\n $stat[0] = true;\n $stat[1] = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $stat;\n }\n catch(PDOException $ex)\n {\n $stat[0] = false;\n $stat[1] = $ex->getMessage();\n return $stat;\n }\n }", "public function findServiceGroups(): array;", "public function getAllByLocation($location, $subdomain)\n\t{\n $sql = sprintf('SELECT ats_jobs.*, users.subdomain\n\t\t\t\t\t\tFROM users\n\t\t\t\t\t\tINNER JOIN ats_jobs ON (users.id = ats_jobs.created_by)\n\t\t\t\t\t\tWHERE users.subdomain = %s\n\t\t\t\t\t\tAND ats_jobs.location = %s\n\t\t\t\t\t\tAND ats_jobs.closed = 0\n\t\t\t\t\t\tAND ats_jobs.deleted = 0\n\t\t\t\t\t\tORDER BY ats_jobs.modified_ts DESC',\n\t\t\t\t\t\t$this->_db->quote($subdomain),\n\t\t\t\t\t\t$this->_db->quote($location));\n\n return $this->_db->query($sql)->fetchAll();\n\t}", "public function byLocationsAction() {\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('group')) {\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('group_main', array(), 'sitetagcheckin_main_grouplocation');\n $this->_helper->content->setEnabled();\n } elseif (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('advgroup')) {\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('advgroup_main', array(), 'sitetagcheckin_main_groupbylocation');\n $this->_helper->content->setEnabled();\n } else {\n return $this->_forward('notfound', 'error', 'core');\n }\n }", "public function category_locations(){\n $categories = Category::withCount(['ads', 'adds'])->get();\n $locations = Location::withCount(['ads', 'adds'])->get();\n return response()->json([\n 'categories' => $categories,\n 'locations' => $locations,\n ]);\n }", "public function get_business_providers($service_id, $location_id) {\n $this->db->select('business_details.*,locations.suburb as area_name');\n $this->db->from('business_details');\n $this->db->join('services_business_mapping', 'services_business_mapping.business_id = business_details.id');\n $this->db->join('locations', 'business_details.suburb = locations.id');\n $this->db->join('services', 'services_business_mapping.services_id = services.id');\n $this->db->where('services.id', $service_id);\n $this->db->where('business_details.suburb', $location_id);\n $query = $this->db->get();\n $query_result = $query->result();\n $business_providers = array();\n\n foreach ($query_result as $key => $value) {\n $business_providers[$key]['details'] = $value;\n $gallery_query = $this->db->get_where('business_gallery', array('business_id' => $value->id));\n $gallery_query_result = $gallery_query->result();\n $business_providers[$key]['gallery'] = $gallery_query_result;\n }\n\n\n return $business_providers;\n }", "public static function getSimple( ) {\n\t\t$staffLocations = Client::request('staff/location');\n\n\t\t$staffLocations = array_map(function($location){\n\t\t\treturn $location['name'];\n\t\t}, $staffLocations);\n\n\t\treturn $staffLocations;\n\t}", "function getCardsInLocation($owner, $location, $ordered_by_age=false, $ordered_by_color=false) {\n $cards = self::getOrCountCardsInLocation(false, $owner, $location, $ordered_by_age, $ordered_by_color);\n if ($ordered_by_age || $ordered_by_color) {\n foreach($cards as $key => &$card_list) {\n $card_list = self::attachTextualInfoToList($card_list);\n }\n }\n else {\n $cards = self::attachTextualInfoToList($cards);\n }\n return $cards;\n }", "public function getAllLocations() {\n\t\t$query = $this->db->select(\"\n\t\t\tRoom.RoomID,\n\t\t\tRoomAbbr,\n\t\t\tRoomName,\n\t\t\tBuildingAbbr,\n\t\t\tRoom.IsApproved,\n\t\t\tBuilding.MapURL,\n\t\t\tOperators\")->\n\t\tfrom('Room')->\n\t\tjoin('Building', 'Building.BuildingID = Room.BuildingID')->\n\t\tjoin(\"\n\t\t\t(SELECT r.RoomID, GROUP_CONCAT(CONCAT(UserFname, ' ', UserLname)) AS Operators\n\t\t\tFROM User u\n\t\t\t\tJOIN UserRole ur ON u.UserID = ur.UserID\n\t\t\t\tJOIN UserRoom urm ON ur.UserRoleID = urm.UserRoleID\n\t\t\t\tJOIN Room r ON r.RoomID = urm.RoomID\n\t\t\tGROUP BY r.RoomID) AS other\", 'other.RoomID = Room.RoomID', 'left')->\n\t\tget();\n\n\t\treturn $query->result_array();\n\t}", "public function getSalesCenterLocations(Request $request)\n {\n $client_id = $request->client_id;\n $salescenter_id = $request->salescenter_id;\n if(Auth::user()->access_level == 'sales_center') {\n $salescenter_id = Auth::user()->salescenter_id;\n }\n\n $locations = Salescenterslocations::where('status','active')->orderBy('name');\n if(!empty($client_id)) {\n $locations->where('client_id',$client_id);\n }\n if(!empty($salescenter_id)) {\n $locations->where('salescenter_id',$salescenter_id);\n }\n /* check user has multiple locations */\n if (auth()->user()->hasMultiLocations()) {\n $locationIds = auth()->user()->locations->pluck('id');\n $locations->whereIn('id', $locationIds);\n }\n /* check location level restriction */\n if(Auth::user()->isLocationRestriction()) {\n $locationId = Auth::user()->location_id;\n $locations->where('id',$locationId);\n }\n $locations =$locations->get();\n $res_options = \"\";\n if(!empty($locations)){\n foreach($locations as $location){\n $res_options.=\"<option value=\\\"{$location->id}\\\" >\".$location->name.\"</option>\";\n }\n }\n $response = array(\n 'status' => 'success',\n 'options' => $res_options,\n );\n return \\Response::json($response);\n }", "protected function getGroupList() {}", "protected function getGroupList() {}", "public function get_locations()\n {\n $this->db->select('location_id,area');\n $query = $this->db->get($this->location);\n if ($query->num_rows() > 0) \n {\n return $query->result_array();\n }\n else\n {\n return FALSE;\n } \n \n }", "public static abstract function getGroupList();", "public function get_location_types()\n {\n return $this->retrieve('SELECT * FROM isys_obj_type WHERE isys_obj_type__container <> 0;');\n }", "public function &getGroupBy();", "private function get_multi_locations_per_ABCTEST($ABCTEST){\n\t\t$Systems = DataObject::get('EXAMPLE_CLASS',\"TESTID = '$ABCTEST'\");\n\t\t$locations = array();\n\t\tforeach ($Systems as $key => $system) {\n\t\t\tarray_push($locations, $this->get_single_location($system));\n\t\t}\n\t\treturn $locations;\n\t}", "public function equipementlocationListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"EquipementLocation\");//type array\n\t}", "public function findGroups() {\n\t\t\n\t}", "public function get_locations_officers()\n {\n $items = array();\n $scope = get_post('scope');\n \n if ($scope) {\n\n if ((int)$scope !== 1 && !get_post('location_code')) {\n\n $return_data = array(\n 'status' => false,\n 'message' => 'Location is required.'\n );\n\n } else {\n \n $departments = $this->getDepartment(get_post('keyword'));\n foreach ($departments as $department) {\n\n // get main department locations if has any\n // main has no sub department id\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'DepartmentID' => $department['id'],\n 'SubDepartmentID' => 0, \n 'LocationScope' => $scope\n );\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = get_post('location_code');\n }\n\n $location = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere, 'id', array(1));\n if (count($location)) {\n $location = $location[0];\n $location['officers'] = $this->departmentdb->getDepartmentOfficer($location['id'], 'DepartmentLocationID');\n } else {\n $location = false;\n }\n $department['location'] = $location;\n\n $subDepartments = array();\n foreach ($department['subDepartment'] as $subDepartment) {\n // get sub department locations if has any\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'DepartmentID' => $department['id'],\n 'SubDepartmentID' => $subDepartment['id'], \n 'LocationScope' => $scope\n );\n\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = get_post('location_code');\n }\n\n $location = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere, 'id', array(1));\n if (count($location)) {\n $location = $location[0];\n $location['officers'] = $this->departmentdb->getDepartmentOfficer($location['id'], 'DepartmentLocationID');\n } else {\n $location = false;\n }\n\n $subDepartment['location'] = $location;\n\n if (get_post('result_filter') == 1) {\n // all active\n if ($subDepartment['location'] != false && $subDepartment['location']['Status']) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 2) {\n // active with officer\n if ($subDepartment['location'] != false && $subDepartment['location']['Status'] && $subDepartment['location']['officers'] != false) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 3) {\n // active without officer\n if ($subDepartment['location'] != false && $subDepartment['location']['Status'] && $subDepartment['location']['officers'] == false) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 4) {\n // inactive\n if ($subDepartment['location'] == false || ($subDepartment['location'] != false && $subDepartment['location']['Status'] == 0)) {\n $subDepartments[] = $subDepartment;\n }\n } else {\n // show all\n $subDepartments[] = $subDepartment;\n }\n }\n\n $department['subDepartment'] = $subDepartments;\n\n $exclude = true;\n // if no sub department. also filter main department result\n if (get_post('result_filter') == 1) {\n // all active\n if ($department['location'] != false && $department['location']['Status']) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 2) {\n // active with officer\n if ($department['location'] != false && $department['location']['Status'] && $department['location']['officers'] != false) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 3) {\n // active without officer\n if ($department['location'] != false && $department['location']['Status'] && $department['location']['officers'] == false) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 4) {\n // inactive\n if ($department['location'] == false || ($department['location'] != false && $department['location']['Status'] == 0)) {\n $items[] = $department;\n $exclude = false;\n }\n } else {\n // show all\n $items[] = $department;\n $exclude = false;\n }\n\n if (count($subDepartments) && $exclude) {\n $department['hideParent'] = true;\n $items[] = $department;\n }\n\n }\n\n if (count($items)) {\n $return_data = array(\n 'status' => true,\n 'data' => $items\n );\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'No record found.'\n );\n }\n\n }\n\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'Scope is required.'\n );\n }\n\n response_json($return_data);\n }", "function getOrganismsList();", "public function get_locations() {\n $this->db->select('*');\n $this->db->from('locations');\n $query = $this->db->get();\n $query_result = $query->result();\n\n return $query_result;\n }", "public function getSitesWithGeoInfo() {\n //Note - we remove any site with 0,0 as it's location, as we have no\n //sites in the middle of the pacific ocean. We also remove sites with\n //invaid (too large) longs and lats (these are legacy values, new values\n // entered through the webportal have to be within expected range,\n // historical values may not)\n $dql = \"SELECT s\n FROM Site s\n JOIN s.certificationStatus c\n WHERE s.latitude IS NOT NULL\n AND s.longitude IS NOT NULL\n AND c.name != 'Closed'\n AND (s.latitude != 0 OR s.longitude != 0)\n AND s.latitude <= 90\n AND s.latitude >= -90\n AND s.longitude <= 180\n AND s.longitude >= -180\";\n\n $sites = $this->em\n ->createQuery($dql)\n ->getResult();\n\n return $sites;\n }", "public function listLocations(): ApiResponse\n {\n $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/locations')->auth('global');\n\n $_resHandler = $this->responseHandler()->type(ListLocationsResponse::class)->returnApiResponse();\n\n return $this->execute($_reqBuilder, $_resHandler);\n }", "public function get_locations_by_service($service_id) {\n $this->db->select('locations.id,business_details.suburb,locations.suburb as area_name');\n $this->db->from('business_details');\n $this->db->join('services_business_mapping', 'services_business_mapping.business_id = business_details.id');\n $this->db->join('locations', 'business_details.suburb = locations.id');\n $this->db->join('services', 'services_business_mapping.services_id = services.id');\n $this->db->where('services.id', $service_id);\n $this->db->group_by('business_details.suburb');\n $query = $this->db->get();\n $query_result = $query->result();\n foreach ($query_result as $key => $value) {\n $vendors = self::get_business_providers($service_id, $value->id);\n if (empty($vendors)) {\n unset($query_result[$key]);\n }\n }\n return $query_result;\n }", "function organizeAllByArea($allLocations) {\r\n $res = [];\r\n\t\t// Callbacks for map and reduce\r\n\t\tfunction mapFunction($location) \r\n\t\t{\r\n\t\t\treturn $location['area'];\r\n\t\t}\r\n\t\tfunction reduceFunction($allArea, $area)\r\n\t\t{\r\n\t\t\t$isPresent = in_array( $area, $allArea );\r\n\t\t\tif(!$isPresent) \r\n\t\t\t{ \r\n\t\t\t\tarray_push($allArea, $area); \r\n\t\t\t\treturn $allArea; \r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{ \r\n\t\t\t\treturn $allArea; \r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tforeach($allLocations as $city => $locations) {\r\n\t\t\t$mapped = array_map(\"mapFunction\", $locations);\r\n\t\t\t$reduced = array_reduce($mapped, \"reduceFunction\", []);\r\n\t\t\t$res[$city] = $reduced;\r\n\t\t}\r\n\t\treturn $res;\r\n }", "public function getLocations()\n {\n return $this->locations;\n }", "function get_locations() {\n $conn = database_connection();\n $sql = \"SELECT LOCATION_ID,INSTITUTION_ID ,LOCATION_NAME FROM CMS_GEM_CORE_MANAGEMNT.LOCATIONS WHERE IS_RECORD_DELETED = 'F'\"; //select data or insert data\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_arr = array();\n\n// while ($row = oci_fetch_assoc($query)) {\n// //print_r($row);\n// echo $row['LOCATION_ID'];\n// echo $row['INSTITUTION_ID'];\n// echo $row['LOCATION_NAME'];\n// echo \"-----<br>\";\n// foreach ($row as $item) { //echo $item;\n// }\n// }\n// \n// exit;\n\n\n\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n echo '<li><a href=\"#\" class=\"location\" location-id=\"' . $row['LOCATION_ID'] . '\">' . $row['LOCATION_NAME'] . '</a></li>';\n// $temp['loc_id']= $row['LOCATION_ID'];\n// $temp['inst_id']= $row['INSTITUTION_ID'];\n// $temp['loc_name']= $row['LOCATION_NAME'];\n //foreach ($row as $item) {\n //echo \"<li>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \"&nbsp;\") . \"</li>\";\n// if ($item !== null)\n// return $item;\n //}\n $result_arr[] = $temp;\n }\n\n\n return $result_arr;\n}", "function backyard_getListOfPOI($poiCategory) {\n global $backyardGeo;\n if (is_int($poiCategory)) {\n $poiCategorySecured = $poiCategory;\n } else {\n $poiCategorySecured = preg_replace(\"/[^0-9,]/\", '', $poiCategory);\n }\n //$query = \"SELECT * FROM `pichacky_poi` WHERE `category` =1 AND (`typ` ='Prodejna' OR `typ` ='Admin. budova + Prodejna') \";//@TODO přidat where category==1 neboť to jsou TMCZ objekty //@TODO .. rozlišit kategorie dle použité app, tj. jiné pro skauty a jiné pro T-Check, nyní pro skauty\n $query = \"SELECT * FROM `{$backyardGeo['table_name']}` WHERE `category` IN ( \" . $poiCategorySecured . \" )\";\n $listOfPOINearby = customMySQLQuery($query);\n if (!$listOfPOINearby) {\n my_error_log('No result for query ' . $query, 2, 11);\n }\n return $listOfPOINearby;\n}", "function SearchWorkshopPlace($where,$Result_Set,$Per_Page)\r\n{\r\n\t$index = 0;\r\n\t$res=\"\";\r\n\t$unique_res=\"\";\r\n\t\r\n\t\r\n\t$query = \"SELECT id FROM locations WHERE \";\r\n\tif ($where != \"\") $query .= \"location = '$where' \"; \r\n\telse $query .= \"location LIKE '%' \"; \r\n\t$query .= \"\tORDER BY rank DESC \";\r\n\t\r\n\tif (!$Result_Set) \r\n\t { \r\n\t $Result_Set=0; \r\n\t $query.=\" LIMIT $Result_Set, $Per_Page\"; \r\n\t }\r\n\telse\r\n\t\t { $query.=\" LIMIT $Result_Set, $Per_Page\"; } \r\n\t\r\n\t$result = mysql_query($query) or die(mysql_error());\r\n\twhile ($row = mysql_fetch_row($result))\r\n\t{\r\n\t\t$temp = $row[0];\r\n\t\t$res[$index++] = $temp; // get the current field\r\n\t}\r\n\t\r\n\tif ($res != \"\")\t//we found requested workshops\r\n\t{\r\n\t\t$res = array_unique($res); \t//remove duplicate workshops (so we wont show the same workshop more then one time) \r\n\t\t$index = 0;\r\n\t\t$col = \"id\";\r\n\t\t\r\n\t\t//get the workshope by their id that we found.\r\n\t\tforeach ($res as $selectedworkshop)\r\n\t\t{\t\r\n\t\t\t$query = \"SELECT * FROM locations WHERE $col=$selectedworkshop \";\r\n\t\t\t$result = mysql_query($query) or die(mysql_error());\r\n\t\t\twhile ($row = mysql_fetch_row($result))\r\n\t\t\t{\r\n\t\t\t\t$unique_res[$index++] = $row; // get the current field\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn $unique_res;\r\n\t\r\n\t\r\n\t\r\n}", "public function actionProximitycatlist($latitude, $longitude, $radius, $kind)\n {\n \n // clean term\n //$term = str_replace(',', '', $term);\n //$term = str_replace(' ', '', $term);\n //$term = str_replace(' ', '', $term);\n\t\n\t$url = \"http://ec2-54-204-2-189.compute-1.amazonaws.com/api/nearby\";\n\t$params = array('latitude' => $latitude, 'longitude' => $longitude, 'radius' => $radius, 'kind' => $kind);\n\t// Update URL to container Query String of Paramaters \n\t$url .= '?' . http_build_query($params);\n\t\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t$json = curl_exec($curl);\n\tcurl_close($curl);\n\t\t\n\t$return_array = json_decode($json);\n\t\t\n $location_service_rows = array(); \n \n\tif ($return_array) {\n $location_service_rows = $return_array->message->rows;\n\t}\n\t\t\n // Did we get some results?\n if(empty($location_service_rows)) {\n // No\n $this->_sendResponse(200, \n sprintf('No items where found.') );\n } else {\n // Prepare response\n $rows = array();\n foreach($location_service_rows as $row) {\n $id = $row->id;\n $name = $row->name;\n $address = $row->address->address;\n $address_extended = $row->address->address_extended;\n $po_box = $row->address->po_box;\n $locality = $row->address->locality;\n $region = $row->address->region;\n $post_town = $row->address->post_town;\n $admin_region = $row->address->admin_region;\n $postcode = $row->address->postcode;\n $country = $row->address->country;\n $tel = $row->address->tel;\n $fax = $row->address->fax;\n $neighbourhood = $row->address->neighbourhood;\n $website = $row->website;\n $email = $row->email;\n $category_ids = $row->category_ids;\n\t\t$category_labels = $row->category_labels;\n $status = $row->status;\n $chain_name = $row->chain_name;\n $chain_id = $row->chain_id;\n $row_longitude = $row->longitude;\n $row_latitude = $row->latitude;\n $abslongitude = $row->abslongitude;\n $abslatitude = $row->abslatitude;\n $distance = $row->distance;\n \n \n //$terms_array = explode(' ',$terms);\n //$match_count = 0;\n //foreach ($terms_array as $term) {\n //if(stripos($name, $term) !== false) {\n //$match_count = $match_count + 1;\n //}\n //if(stripos($category_labels, $term) !== false) {\n //$match_count = $match_count + 1;\n //}\n $match_count = 1;\n //}\n //$term_match_count = array('term_match_count' => $match_count);\n //array_push($row, $term_match_count);\n //$row['term_match_count'] = $match_count;\n $new_row = array(\n 'id' => $id,\n 'name' => $name,\n 'address' => $address,\n 'address_extended' => $address_extended,\n 'po_box' => $po_box,\n 'locality' => $locality,\n 'region' => $region,\n 'post_town' => $post_town,\n 'admin_region' => $admin_region,\n 'postcode' => $postcode,\n 'country' => $country,\n 'tel' => $tel,\n 'fax' => $fax,\n 'neighbourhood' => $neighbourhood,\n 'website' => $website,\n 'email' => $email,\n 'category_ids' => $category_ids,\n 'category_labels' => $category_labels,\n 'status' => $status,\n 'chain_name' => $chain_name,\n 'chain_id' => $chain_id,\n 'longitude' => $row_longitude,\n 'latitude' => $row_latitude,\n 'abslongitude' => $abslongitude,\n 'abslatitude' => $abslatitude,\n 'distance' => $distance,\n 'term_match_count' => $match_count\n );\n //if ($match_count > 0) {\n $rows[] = $new_row;\n //}\n } // end foreach location service row\n // Send the response\n $this->_sendResponse(200, CJSON::encode($rows));\n }\n }", "public function getGroups();", "public function getGroups();", "public function byLocation(string $location);", "function getTaxoGroups($logger, $fileStore)\n{\n $logger->debug(_('Appel de getTaxoGroups'));\n\n // Read taxo_groups file\n $response = file_get_contents(getenv('HOME') . '/' . $fileStore . '/taxo_groups_1.json');\n $data = json_decode($response, true);\n\n $taxoList = array();\n foreach ($data['data'] as $key => $value) {\n // $logger->trace(print_r($data['data'][$key], true));\n $taxo = $data['data'][$key];\n $logger->trace(_('Groupe taxonomique : ') . $taxo['id'] . ' = ' . $taxo['name'] . _(', access = ') . $taxo['access_mode']);\n if ($taxo['access_mode'] != 'none') {\n $logger->info(_('Taxon à télécharger : ') . $taxo['id'] . ' = ' . $taxo['name'] . _(', access = ') . $taxo['access_mode']);\n $taxoList[] = $taxo['id'];\n }\n }\n\n return $taxoList;\n}", "function get_location( $location = '' ) {\n\t\tglobal $wpdb;\n\t\t\n\t\ttry {\n\t\t\t// Sanitize\n\t\t\tif( $location != '' ) {\n\t\t\t\t$location = sanitize_text_field( $location );\n\t\t\t} else {\n\t\t\t\t//throw new Exception( 'Location ID not provided.' );\n return false;\n\t\t\t}\n\t\t\t\n\t\t\t// Select the location in the db\n\t\t\t$sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_locations` WHERE `id`='\" . $location . \"';\";\n\t\t\t$location = $wpdb->get_row( $sql, ARRAY_A );\n\t\t\t\n\t\t\t// Make sure the location exists\n\t\t\tif( $wpdb->num_rows == 0 ) {\n\t\t\t\tthrow new Exception( 'Location does not exist.' );\n\t\t\t}\n\t\t\t\n\t\t\t// Group IDs are stored as an array. Make sure it is actually an array.\n\t\t\t$location['groups'] = rpids_unserialize( $location['groups'] );\n\t\t\n\t\t\t$return = array(\n\t\t\t\t\"location\" => $location['location'],\n\t\t\t\t\"groups\" => $location['groups'],\n\t\t\t\t\"weather_id\" => $location['weather_id'],\n\t\t\t\t\"layout\" => $location['layout']\n\t\t\t);\n\t\t\t\n\t\t\treturn $return;\n\t\t\t\n\t\t} catch ( Exception $e ) {\n\t\t\treturn array(\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"message\" => $e->getMessage()\n\t\t\t);\n\t\t}\n\t}", "public function getEmployeesByLocationAndPosition(Request $request) \n {\n $location = $request->input('location');\n $position = $request->input('position');\n\n $employees = Employees::getEmployeesByLocationAndPosition($location, $position);\n\n $newArrayEmployees = [];\n foreach($employees as $key => $employee){\n $newArrayEmployees[$key] = $this->generateEmployeeData($employee);\n }\n\n $newArrayEmployeesSortedByLocation = [];\n foreach($newArrayEmployees as $key => $value){\n $newArrayEmployeesSortedByLocation[$value['l']][$value['cn']] = $value;\n }\n\n ksort($newArrayEmployeesSortedByLocation);\n\n return $newArrayEmployeesSortedByLocation;\n }", "public function getAllStores()\n {\n $sql = \"SELECT s.id, s.name, s.phone_number, s.address_id, a.province, a.city, a.district, a.address1, a.address2, \";\n $sql.= \"a.lat, a.lng FROM store as s, address as a \";\n $sql.= \"WHERE s.address_id=a.id\";\n $query = $this->db->prepare($sql);\n $query->execute();\n\n return $query->fetchAll();\n }", "public function getLocations()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Location (Linnworks API)');\n\t\t}", "public function index()\n {\n return IslandGroupResource::collection(IslandGroup::all());\n }", "public function get_location_objects($p_bContainer = true, $p_bInRack = true, $p_record_status = C__RECORD_STATUS__NORMAL)\n {\n $l_strSQL = \"SELECT * FROM isys_obj\n\t\t\tINNER JOIN isys_obj_type ON isys_obj__isys_obj_type__id = isys_obj_type__id\n\t\t\tINNER JOIN isys_catg_global_list ON isys_catg_global_list__isys_obj__id = isys_obj__id\n\t\t\tWHERE ((isys_obj_type__show_in_tree = 1) AND (isys_obj_type__status = \" . $this->convert_sql_int($p_record_status) . \")) \";\n\n if ($p_bContainer)\n {\n $l_strSQL .= \"AND isys_obj_type__container = 1 \";\n } // if\n\n if ($p_bInRack)\n {\n $l_strSQL .= \"AND isys_obj_type__show_in_rack = 1 \";\n } // if\n\n return $this->retrieve($l_strSQL . ';');\n }", "public function locations()\n {\n $data = $this->request('POST', 'api/v1/date/locations');\n return $data;\n }", "public function listLocations(Request $request)\n {\n// $docs = TourLocation::orderBy('id', 'DESC');\n// $docs = $docs->paginate($limit);\n// $total = $docs->total();\n// $data = [\n// 'docs' => TourLocationResource::collection($docs),\n// 'total' => $total,\n// ];\n// return $this->jsonApi(ResponseStatusCode::OK, __('flash.list_tour_location'), $data);\n }", "abstract protected function getGroupList() ;", "public function locations()\n {\n $locations = Locations::with('Countries:name')->get();\n // dd($locations);\n\n foreach ($locations as $location) {\n $sublocation = Locations::where('location_id', $location->sublocation_id)->get();\n $location['sublocations'] = $sublocation;\n }\n return view('setup.location.locations', compact('locations', 'sublocation'));\n }", "public function retrieveGroups()\n {\n return $this->start()->uri(\"/api/group\")\n ->get()\n ->go();\n }", "public function findAll()\n {\n return $this->em\n ->getRepository('App:Location')\n ->findAll()\n ;\n }", "public function locations()\n {\n return $this->morphMany(Location::class,'trackable','trackable_type','trackable_id','uuid');\n }", "public function AllMemberLocations(){\n $curGroup = Group::whereHas('members',function($q){\n $q->where('user_id',Auth::id());\n })->get();\n\n $curGroup = $curGroup->pluck('id');\n \n $keys = Array();\n //add in keys[] the id of all members of group\n $groupId = Group::with('members')->whereIn('id',$curGroup)->get();\n $groupMemberDetail = $groupId->pluck('members');\n $groupMemberDetailId = $groupMemberDetail->pluck('id');\n foreach($groupMemberDetail as $group){\n foreach($group as $id){\n $keys[] = $id->id;\n }\n }\n\n $keys = array_unique($keys);\n\n $information = User::with('information')->whereIn('id',$keys)->get();\n $information = $information->pluck('information');\n\n $devInfo = User::with('information')->whereHas('devices',function($q) use($keys){\n $q->whereIn('id',$keys);\n })->get();\n $devInfo = $devInfo->pluck('information');\n\n //return Response::json(['no'=>$user_noDevice]);\n $user_noDevice = User::whereDoesntHave('devices')->whereIn('id',$keys)->pluck('id')->toArray();\n $dev = User::has('devices')->whereIn('id',$keys)->pluck('id')->toArray();\n $locations = Array();\n foreach ($dev as $key => $id) {\n $locations[] = Location::where('device_id',$id)->orderBy('created_at', 'desc')->get(['latitude','longitude','device_id'])->first()->toArray();\n }\n \n $history = Array();\n \n foreach($user_noDevice as $id){\n $history[] = History::where('user_id',$id)->orderBy('created_at', 'desc')->get(['latitude','longitude','user_id'])->first()->toArray();\n }\n\n // return Response::json(['location'=>$locations,'historys'=>$history,'information'=>$information,'deviceInfo'=>$devInfo]); \n return Response::json(['information'=>$information,'deviceInfo'=>$devInfo,'location'=>$locations,'historys'=>$history]);\n }", "public function getGroups() {}", "function get_location_list ($perm = 1) \n{\n \n $query = 'SELECT * \n FROM locations \n WHERE permanent = '.$perm;\n $result = mysql_query ($query);\n while ($row = mysql_fetch_array($result)) $return[] = $row;\n return $return;\n}", "function getRegions() {\n global $myPDODB, $whereFilter;\n $output = array();\n\n $whereLocal = array();\n $whereClause = getWhereClause($whereLocal);\n\n $sql = \"SELECT r.name AS 'name', r.id AS 'id', COUNT( s.id ) AS 'number', 'region' AS 'type'\nFROM regions AS r\nJOIN countries AS c ON r.id = c.region_id\nJOIN students AS s ON c.id = s.destination_country \n$whereClause\nGROUP BY r.name\nORDER BY r.name;\";\n\n $sth = $myPDODB->prepare($sql);\n $result = $sth->execute();\n\n if ($result) {\n $regions = $sth->fetchAll(PDO::FETCH_ASSOC);\n\n foreach ($regions as $region) {\n // get the country details for each region\n $countries = getCountries($region['id']);\n array_push($output, array(\"item_id\" => $region['id'] * 100000, \"fixed\" => true, \"name\" => $region['name'], \"number\" => $region['number'], \"type\" => $region['type'], \"children\" => $countries));\n }\n }\n\n // add the regions to the output array\n return $output;\n}", "public function groups();", "public function groups();", "public function index(Request $request)\n {\n $this->authorize('locations.index', Location::class);\n\n return LocationResource::collection(Location::all());\n }", "public function GetDataGroup($storageLocation, $filter = null, $orderByFieldName = null, $maxRecordCount = null,\r\n\t$groupingField = null, $filterJoinLocations = null, $startOffset = 0)\r\n\t{\r\n\t\t$isTableName = ((!static::$_designateViewsByStringPrefix && $this->TableExists($storageLocation)) || (static::$_designateViewsByStringPrefix && (substr($storageLocation, 0, strlen(static::$_designateViewsByStringPrefix)) != static::$_designateViewsByStringPrefix)));\r\n\t\tif ($isTableName)\r\n\t\t{\r\n\t\t\tif ($filterJoinLocations && is_array($filterJoinLocations))\r\n\t\t\t{\r\n\t\t\t\t$sql = \"select `$storageLocation`.* from `$storageLocation`\";\r\n\r\n\t\t\t\tforeach ($filterJoinLocations as $filterJoinLocationName => $filterJoinLocationMatchColumn)\r\n\t\t\t\t{\r\n $filterJoinLocationNameParts = explode(\" \", $filterJoinLocationName);\r\n if (count($filterJoinLocationNameParts) > 1)\r\n {\r\n $sql .= \", `\".$filterJoinLocationNameParts[0].\"` \".$filterJoinLocationNameParts[1];\r\n } else {\r\n $sql .= \", `\".$filterJoinLocationNameParts[0].\"`\";\r\n }\r\n\r\n\t\t\t\t}\r\n\t\t\t\tif ($filter)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql .= \" where $filter\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql .= \" where 1=1 \";\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($filterJoinLocations as $filterJoinLocationName => $filterJoinLocationMatchColumn)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($filterJoinLocationName && $filterJoinLocationMatchColumn)\r\n\t\t\t\t\t{\r\n $filterJoinLocationNameParts = explode(\" \", $filterJoinLocationName);\r\n if (count($filterJoinLocationNameParts) > 1)\r\n {\r\n $joinAlias = $filterJoinLocationNameParts[1];\r\n } else {\r\n $joinAlias = $filterJoinLocationNameParts[0];\r\n }\r\n\t\t\t\t\t\tif (is_array($filterJoinLocationMatchColumn))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$sql .= \" and `$joinAlias`.`\" . $filterJoinLocationMatchColumn[0] . \"` =\r\n `$storageLocation`.`\" . $filterJoinLocationMatchColumn[1] . \"`\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$sql .= \" and `$joinAlias`.`$filterJoinLocationMatchColumn` =\r\n `$storageLocation`.`$filterJoinLocationMatchColumn`\";\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\tif ($groupingField)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (strstr($groupingField, \".\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sql .= \" group by $groupingField\";\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$sql .= \" group by `$storageLocation`.$groupingField\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($orderByFieldName)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (strstr($orderByFieldName, \".\") === false && ($orderByFieldName != \"rand()\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sql .= \" order by `$storageLocation`.$orderByFieldName\";\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$sql .= \" order by $orderByFieldName\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$sql = \"select * from `$storageLocation`\";\r\n\t\t\t\tif ($filter)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql .= \" where $filter\";\r\n\t\t\t\t}\r\n\t\t\t\tif ($groupingField)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql .= \" group by `$storageLocation`.$groupingField\";\r\n\t\t\t\t}\r\n\t\t\t\tif ($orderByFieldName)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql .= \" order by $orderByFieldName\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($maxRecordCount)\r\n\t\t\t{\r\n\t\t\t\t$sql.= \" limit $startOffset,$maxRecordCount\";\r\n\t\t\t}\r\n\t\t\t$this->_lastQuery = $sql;\r\n\t\t\treturn $this->GetRowsAsArray($sql);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//its not the name of a table so lets try it as a stored proc\r\n\t\t\treturn $this->GetRowsSpAsArray($storageLocation, $filter);\r\n\t\t}\r\n\t}", "public static function getCMSCategoriesByLocation($location, $id_shop = false)\n\t{\n\t}", "function getAll () {\n \\trigger_error(\"Deprecated.\", \\E_USER_ERROR);\n global $pdo;\n $sql = \"select a6_locations.*, \"\n . \"a6_people.person_name, \"\n . \"a6_people.provider_number, \"\n . \"a6_subject.subject_label \"\n . \"FROM a6_locations \"\n . \"JOIN a6_people on a6_locations.locationID = a6_people.locationID \"\n . \"JOIN a6_people_subject ON a6_people.personID = a6_people_subject.personID \"\n . \"JOIN a6_subject ON a6_people_subject.subjectID = a6_subject.subjectID \"\n . \"ORDER BY locationID DESC\";\n return $pdo->query($sql);\n }", "public function getLocationWithScrapingResults() { return Location::query()\n ->leftJoin('my_business_terms_scraping_results', 'locations.id', '=', 'my_business_terms_scraping_results.location_id')\n ->whereJsonDoesntContain('states', LocationState::HAS_PROBLEM)\n ->where('my_business_terms_scraping_results.fetched_at', '<=', Carbon::today()->subDays(7))\n ->oldest('my_business_terms_scraping_results.fetched_at')\n ->first();\n }", "public function get_fields_for_location( $location ) {\n\n\t\t$return = array();\n\n\t\tforeach ( $this->get_fields() as $field ) {\n\t\t\tif ( $location === $field['location'] ) {\n\t\t\t\t$return[ $field['name'] ] = $field;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\n\t}", "public static function location_listing($location_id,$limit = 15)\n {\n \n \n\n $query = \"SELECT id, category_id,created_by, title,description, url, featured_image, create_time,primary_phone,primary_email,\n\n (SELECT name FROM 9jb_locations WHERE 9jb_listings.city = 9jb_locations.id) AS city_name,\n (SELECT fa_icon FROM 9jb_categories WHERE 9jb_listings.category_id = 9jb_categories.id) AS icon,\n (SELECT color FROM 9jb_categories WHERE 9jb_listings.category_id = 9jb_categories.id) AS color,\n (SELECT title FROM 9jb_categories WHERE 9jb_listings.category_id = 9jb_categories.id) AS category_name,\n (SELECT name FROM 9jb_locations WHERE 9jb_listings.state = 9jb_locations.id) AS state_name,\n (SELECT count(*) FROM 9jb_reviews WHERE 9jb_reviews.listing_id = 9jb_listings.id) AS reviews\n\n FROM 9jb_listings\n WHERE (city = ? or state = ?) AND status='activated'\n ORDER BY create_time DESC LIMIT $limit \";\n\n return \\DB::select($query,[$location_id,$location_id]) ;\n }", "public function getLocations()\n {\n $conds = new CondsList();\n $conds->subjoin(new Param('post_type', '==', 'post'));\n $conds->subjoin(new Param('post_type', '==', 'page'));\n\n return $conds->toArray();\n }", "public function getShipmentWarehouseList();", "function getAllRoomsByBuilding(){\r\n $common = new \\Cars\\Data\\Common($this->app);\r\n $blds = $common->getBuildingAbbreviations();\r\n\r\n $output = array();\r\n foreach ($blds as $bld => $bldData) {\r\n $rooms = $common->getRoomsByBuilding($bldData[\"building_abbreviation\"]);\r\n foreach ($rooms as $room => $val) {\r\n $output[$bldData[\"building_abbreviation\"]][$val[\"room_number\"]] = $val;\r\n }\r\n }\r\n\r\n return $output;\r\n }", "public function getPlaces();", "public function getLocations(){\n\n return response()->json( $this->locations );\n\n }", "function getResults($lat, $long, $radius) {\n global $pdo;\n $sql = \"select a6_locations.*, \"\n . \"a6_people.person_name, \"\n . \"a6_people.personID, \"\n . \"a6_people.provider_number, \"\n . \"GROUP_CONCAT(a6_subject.subject_label SEPARATOR ', ') AS subject_label, \"\n . \"69.0 * SQRT(POW((FORMAT(latitude,4)-FORMAT($lat,4)),2) + POW((FORMAT(longitude, 4)-FORMAT($long,4)),2)) AS distance \"\n . \"FROM a6_locations \"\n . \"JOIN a6_people on a6_locations.locationID = a6_people.locationID \"\n . \"JOIN a6_people_subject ON a6_people.personID = a6_people_subject.personID \"\n . \"JOIN a6_subject ON a6_people_subject.subjectID = a6_subject.subjectID \"\n . \"GROUP BY a6_people.personID \"\n . \"HAVING distance < $radius \"\n . \"ORDER BY distance ASC, provider_number ASC\";\n return $pdo->query($sql);\n \n }", "public function retrive_nearby_locations(Request $request){\n\n $distance=100;\n $latitude=$request->latitude;\n $longitude=$request->longitude;\n $images=array();\n $result=array();\n\n /*echo 'SELECT locations.*,schools.*,school_images.image FROM locations,schools left join school_images on schools.id = school_images.id where locations.`id` = schools.location_id AND '.$distance.' >= ( ((ACOS( SIN( ('.$latitude.' * PI( ) /180 ) ) * SIN( (locations.latitude * PI( ) /180 ) ) + COS( ('.$latitude.' * PI( ) /180 )) * COS( (locations.latitude * PI( ) /180 )) * COS( (('.$longitude.' - locations.longitude) * PI( ) /180 )))) *180 / PI( )) *60 * 1.1515)';\n die();*/\n $results=DB::select(DB::raw('SELECT locations.*,schools.school_name,schools.id as school_id FROM locations,schools left join school_images on schools.id = school_images.id where locations.`id` = schools.location_id AND '.$distance.' >= ( ((ACOS( SIN( ('.$latitude.' * PI( ) /180 ) ) * SIN( (locations.latitude * PI( ) /180 ) ) + COS( ('.$latitude.' * PI( ) /180 )) * COS( (locations.latitude * PI( ) /180 )) * COS( (('.$longitude.' - locations.longitude) * PI( ) /180 )))) *180 / PI( )) *60 * 1.1515)'));\n\n $count=count($results);\n \n if($count > 8){\n $count = 8;\n }\n\n for($i=0; $i<$count; $i++){\n $result[]=$results[$i];\n }\n\n for($i=0; $i<$count; $i++){\n $images[$i]=$result[$i]->school_id;\n\n $images[$i]=School_image::where('school_id','=',$images[$i])->first();\n if(count($images[$i])){\n $images[$i]=$images[$i]->image;\n }else{\n $images[$i]=null;\n }\n }\n // print_r($images);\n // die();\n\n return response()->json(array(\n 'results' => $result,\n 'images' => $images\n ) ); \n }", "public function main_locations(){\n $locations = Location::whereNull('parent_id')->get();\n }", "public function getGroupsList(){\n return $this->_get(1);\n }", "public function index(Request $request)\n {\n $options = $this->sLocation->standardize_search($request);\n $list = $this->sLocation->find($options);\n if (isset($options['limit']) && $options['limit'] > 0) {\n $this->setPagination($this->sLocation->get_paginator()->toArray());\n }\n return $this->respondData('Locations list', $list);\n }", "public function getStoreList(){\n $storeList = $storeListUnique = [];\n if(!empty($this->products)){\n foreach ($this->products as $product) {\n foreach ($product->product->shop->shops as $shop) {\n foreach ($shop->stores as $store) {\n if(!in_array($store->id,$storeListUnique)){\n $storeList[$product->product_id][] = [\n 'store_address' => $store->addressStringTitle,\n 'store_id' => $store->id,\n 'product_id' => $product->product_id,\n 'shop_group_id' => $product->product->shop->id,\n ];\n $storeListUnique[] = $store->id;\n }\n }\n }\n }\n }\n return $storeList;\n }", "public function getGroups(): array;", "public function get_group_list($session_key, $sid)\n\t{\n if ($this->_checkSessionKey($session_key))\n {\n\t\t\t$surveyidExists = Survey::model()->findByPk($sid);\t\t \n\t\t\tif (!isset($surveyidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid surveyid', 22);\n\t\t \n\t\t\tif (hasSurveyPermission($sid, 'survey', 'read'))\n\t\t\t{\t\n\t\t\t\t$group_list = Groups::model()->findAllByAttributes(array(\"sid\"=>$sid)); \t\t \n\t\t\t\tif(count($group_list)==0)\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('No groups found', 39);\n\t\t\t\t\n\t\t\t\tforeach ($group_list as $group)\n\t\t\t\t{\n\t\t\t\t$aData[]= array('id'=>$group->primaryKey,'group_name'=>$group->attributes['group_name']);\n\t\t\t\t}\n\t\t\t\treturn $aData;\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\tthrow new Zend_XmlRpc_Server_Exception('No permission', 2); \t \n }\t\t\t\t\n\t}", "public function getLocationList($box_id,$start_date,$end_date){\r\n\t $where = 'a.box_id='.$box_id\r\n\t .\" and '\".$end_date.\"'>=b.start_date and '\".$start_date.\"'<=b.end_date and a.location_id!=0 and b.state!=2\";\r\n\t $data = $this->alias('a')\r\n\t ->field('a.location_id')\r\n\t ->join('savor_pub_ads b on a.pub_ads_id=b.id','left')\r\n\t ->where($where)\r\n\t ->select(); \r\n\t return $data;\r\n\t}", "public function albumbyLocationsAction() {\n\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('album')) {\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('album_main', array(), 'sitetagcheckin_main_albumlocation');\n $this->_helper->content->setEnabled();\n } /* elseif ( Engine_Api::_()->getDbtable( 'modules' , 'core' )->isModuleEnabled( 'advgroup' )) {\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('advgroup_main', array(), 'sitetagcheckin_main_groupbylocation');\n $this->_helper->content->setEnabled();\n } */ else {\n return $this->_forward('notfound', 'error', 'core');\n }\n }", "public function driver_location_list()\n {\n if (Auth::guest())\n {\n return redirect()->guest('admin/login');\n }\n else \n\t\t{\n if(!hasTask('admin/drivers'))\n\t\t\t{\n return view('errors.404');\n }\n $driver_location_list = DB::select('SELECT DISTINCT ON (\"driver_track_location\".\"driver_id\") \"driver_id\", \"driver_track_location\".\"id\", \"driver_track_location\".\"latitude\", \"driver_track_location\".\"longitude\",\"drivers\".\"first_name\",\"drivers\".\"last_name\",\"drivers\".\"driver_status\" FROM \"driver_track_location\" join \"drivers\" on \"drivers\".\"id\"=\"driver_track_location\".\"driver_id\" order by \"driver_track_location\".\"driver_id\",\"driver_track_location\".\"id\" desc');\n\t\t\tforeach($driver_location_list as $key=>$drivers)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$driver_location_list[$key]->orders = DB::select('SELECT \"orders\".\"id\",\"orders\".\"total_amount\",\"users\".\"name\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM \"driver_orders\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin \"drivers\" on \"drivers\".\"id\"=\"driver_orders\".\"driver_id\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin \"orders\" on \"orders\".\"id\"=\"driver_orders\".\"order_id\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin \"users\" on \"users\".\"id\"=\"orders\".\"customer_id\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE \"drivers\".\"id\" = '.$drivers->driver_id.'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\torder by \"orders\".\"id\" desc limit 2');\n\t\t\t}\n SEOMeta::setTitle('Manage Drivers Location - '.$this->site_name);\n SEOMeta::setDescription('Manage Drivers Location - '.$this->site_name);\n return view('admin.drivers.location_list')->with('driver_location_list',$driver_location_list);\n }\n }", "public function getGroupsList(){\n return $this->_get(3);\n }", "function get_uc_groups_by_school_geography( $geographic_type = '', $school_id = '', $activity_id = false, $check_ell = false, $check_at_risk = false, $grade = 'all', $post_status = 'publish', $school_year = false ) {\n\n\t$classes_to_search = get_uc_classes_by_school_geography( $geographic_type, $school_id, $check_ell, $check_at_risk, $grade, $post_status );\n\n\t$args = array(\n\t\t'post_type' => 'uc_group',\n\t\t'post_status' => $post_status,\n\t\t'posts_per_page' => -1,\n\t\t'meta_query' => array(\n\t\t\t'relation' => 'AND'\n\t\t),\n\t);\n\n\t$class_args = array(\n\t\t'key' => 'class',\n\t\t'compare' => 'IN',\n\t\t'value' => array(),\n\t);\n\n\tif ( $school_year ) {\n\t\t$school_year_array = get_school_year( $school_year );\n\t\t$args['date_query'] = array(\n\t\t\tarray(\n\t\t\t\t'after' => $school_year_array['start'],\n\t\t\t\t'before' => $school_year_array['end'],\n\t\t\t\t'inclusive' => true,\n\t\t\t)\n\t\t);\n\t}\n\n\tforeach ( $classes_to_search as $class_to_search ) {\n\t\t$class_args['value'][] = $class_to_search['value'];\n\t}\n\t$args['meta_query'][] = $class_args;\n\tif ( $activity_id ) {\n\t\t$args['meta_query'][] = array(\n\t\t\t'relation' => 'OR',\n\t\t\tarray(\n\t\t\t\t'key' => 'default_group',\n\t\t\t\t'value' => '0',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'key' => 'default_group',\n\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t),\n\t\t);\n\t}\n\t$wp_posts = get_posts( $args );\n\n\t$result = array();\n\tforeach ($wp_posts as $post) {\n\t\tif ( $activity_id ) {\n\t\t\t$signup = get_post_meta( $post->ID, 'signup', true );\n\t\t\t$signup_activity = get_post_meta( $signup, 'activity', true );\n\t\t\tif ( $signup_activity == $activity_id ) {\n\t\t\t\t$result[] = array('value' => $post->ID, 'label' => $post->post_title);\n\t\t\t}\n\t\t} else {\n\t\t\t$result[] = array('value' => $post->ID, 'label' => $post->post_title);\n\t\t}\n\t}\n\treturn $result;\n}", "static function topLocations(): Array\n {\n return static::whereNull(\"id_parent\")->orderBy(\"name\")->get();\n }" ]
[ "0.6448998", "0.63617736", "0.63432306", "0.6173446", "0.5886566", "0.5883038", "0.5780492", "0.57054776", "0.56658375", "0.56591964", "0.55755407", "0.55111146", "0.55110687", "0.546118", "0.54394937", "0.5425999", "0.541794", "0.53901446", "0.53532434", "0.5331348", "0.5319088", "0.53068334", "0.52989393", "0.5296456", "0.52785486", "0.5276368", "0.5251502", "0.52467734", "0.5242899", "0.52399457", "0.5215687", "0.5215687", "0.52033234", "0.5200123", "0.5183551", "0.51463336", "0.51364124", "0.51347196", "0.51276416", "0.5121349", "0.5120691", "0.50976634", "0.5094195", "0.5080204", "0.5076487", "0.5073754", "0.5069357", "0.50683343", "0.5065076", "0.5058578", "0.505398", "0.5053648", "0.5053648", "0.50522166", "0.5047276", "0.50349736", "0.5007612", "0.5006985", "0.5002478", "0.5001196", "0.5000917", "0.4999587", "0.49980527", "0.49968746", "0.4977426", "0.49746442", "0.49716777", "0.49709734", "0.49668127", "0.49609676", "0.49609312", "0.49512848", "0.49511874", "0.49511874", "0.49478993", "0.4947668", "0.49379715", "0.49335322", "0.49309662", "0.49132428", "0.49075678", "0.49072215", "0.48997316", "0.48988834", "0.48983875", "0.4893163", "0.4887223", "0.48864967", "0.48812896", "0.487089", "0.48682347", "0.48578876", "0.48564503", "0.4853731", "0.48513234", "0.4850835", "0.48458076", "0.48426405", "0.48414403", "0.4838447" ]
0.5990868
4
Loads SO for a given number
public function getSO($number = '50032') { // Parse XML $xml = "<LoadSORq>\n<Number>{$number}</Number>\n</LoadSORq>\n"; // Create request and pack $this->createRequest($xml); $len = strlen($this->xmlRequest); $packed = pack("N", $len); // Send and get the response fwrite($this->id, $packed, 4); fwrite($this->id, $this->xmlRequest); $this->getResponse(); // Set the result $this->setResult($this->parseXML($this->xmlResponse)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadSeries(){\n $series = new Series();\n\n if($this->id == -1 || empty($this->databasePath))\n return $series;\n\n \n $sqlQuery = 'SELECT S.* FROM books_series_link BSL, series S WHERE BSL.series= S.id and BSL.book='.$this->id;\n\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n $series->add(Serie::_createFromRow($this->databasePath, $row));\n \n return $series;\n }", "public function get($num)\n {\n }", "public function show($number){\n\n $this->init();\n $this->model->isLogged();\n\n switch ($number){\n case 500:\n $this->load(self::class, [\n \"number\" => 500,\n \"key\" => '7213bb37097483eb265422318f20eb9f',\n \"module\" => '<div data-dedipass=\"7213bb37097483eb265422318f20eb9f\" data-dedipass-custom=\"\"></div>'\n ]);\n $_SESSION['key'] = \"7213bb37097483eb265422318f20eb9f\";\n break;\n case 1000:\n $this->load(self::class, [\n \"number\" => 1000,\n \"key\" => '017e994287e7dc64eb85f91566f0f0a8',\n \"module\" => '<div data-dedipass=\"017e994287e7dc64eb85f91566f0f0a8\" data-dedipass-custom=\"\"></div>'\n ]);\n $_SESSION['key'] = \"017e994287e7dc64eb85f91566f0f0a8\";\n break;\n default:\n header('Location: /shop/register');\n break;\n }\n }", "private function getInstance($number = null)\n {\n $number = !empty($number) ? $number : 0;\n\n return isset(config(\"apiwha.instances\")[$number])\n ? config(\"apiwha.instances\")[$number]\n : config(\"apiwha.instances\")[0];\n\n }", "function get_string_number($num) {\n // TODO: Add simple hashing [check array, add if not already there]\n $this->load_tables();\n $meta = $this->ORIGINALS[$num];\n $length = $meta[0];\n $offset = $meta[1];\n $this->STREAM->seekto($offset);\n $data = $this->STREAM->read($length);\n return (string)$data;\n }", "function load_stamina( &$data ) {\n $stamina_path = read_config_option( 'stamina_path' );\n $stamina_ext = read_config_option( 'stamina_ext' );\n $stamina_max = read_config_option( 'stamina_max' );\n $path = cat_file( $stamina_path, $data[\"id\"]. '.'. $stamina_ext );\n $data[\"stamina\"] = $stamina_max;\n $data[\"maxstamina\"] = $stamina_max;\n $data[\"staminadate\"] = time();\n \n if ( file_exists( $path ) == false ) {\n return false;\n }\n\n $contents = file_get_contents( $path );\n rtrim( $contents );\n \n $tmp = explode( \"<>\", $contents );\n \n $data[\"stamina\"] = $tmp[0];\n $data[\"maxstamina\"] = $tmp[1];\n $data[\"staminadate\"] = $tmp[2];\n}", "function getSoId($so_name)\n\t{\n\t\tglobal $log;\n $log->info(\"in getSoId \".$so_name);\n\t\tglobal $adb;\n\t\tif($so_name != '')\n\t\t{\n\t\t\t$sql = \"select salesorderid from ec_salesorder where subject='\".$so_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$so_id = $adb->query_result($result,0,\"salesorderid\");\n\t\t}\n\t\treturn $so_id;\n\t}", "function load();", "function get_translation_number($num) {\n // get a string with particular number\n // TODO: Add simple hashing [check array, add if not already there]\n $this->load_tables(true);\n $meta = $this->TRANSLATIONS[$num];\n $length = $meta[0];\n $offset = $meta[1];\n $this->STREAM->seekto($offset);\n $data = $this->STREAM->read($length);\n return (string)$data;\n }", "function v1_get_id_insarpixel($dd_sar_id, $number) {\n\t\n\t// If parameters are empty\n\tif (empty($dd_sar_id) || empty($number)) {\n\t\treturn NULL;\n\t}\n\t\n\t// Connect to DB\n\tinclude \"php/include/db_connect.php\";\n\t\n\t// Create SQL query\n\t$sql=\"SELECT dd_srd_id FROM dd_srd WHERE dd_sar_id='\".mysql_real_escape_string($dd_sar_id).\"' AND dd_srd_numb='\".mysql_real_escape_string($number).\"'\";\n\t\n\t// Query DB\n\t$result=mysql_query($sql) or die(mysql_error());\n\t\n\t// Get result\n\t$row=mysql_fetch_array($result);\n\t\n\treturn $row['dd_srd_id'];\n\t\n}", "public abstract function load();", "public function getLoad();", "public function load($name);", "public function loadTheInstance();", "public function inScadenza($num) {\n $FAsta= USingleton::getInstance('FAsta');\n $tmp= $FAsta->inScadenza($num);\n \n if($tmp != false){\n for($i=0;$i<count($tmp);$i++) {\n $ris[]=$FAsta->load($tmp[$i]->getIdAsta());\n }\n\t\t\t return $ris;\n }\n\t\t\t\n else{\n return $ris=null;\n }\n }", "abstract public function load();", "abstract public function load();", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "abstract public function load($qty, $from = 0);", "public static function load(int $id);", "public function getNextNumRef($soc)\n {\n global $db, $langs, $conf;\n $langs->load(\"orders\");\n\n if (! empty($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER))\n {\n $mybool = false;\n\n $file = $conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER.'.php';\n $classname=$conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER;\n\n // Include file with class\n $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);\n\n foreach ($dirmodels as $reldir) {\n\n $dir = dol_buildpath($reldir.\"core/modules/supplier_order/\");\n\n // Load file with numbering class (if found)\n $mybool|=@include_once $dir.$file;\n }\n\n if ($mybool === false) {\n dol_print_error('', \"Failed to include file \".$file);\n return '';\n }\n\n $obj = new $classname();\n $numref = $obj->getNextValue($soc, $this);\n\n if ( $numref != \"\")\n {\n return $numref;\n }\n else\n\t\t\t{\n $this->error = $obj->error;\n return -1;\n }\n }\n else\n\t\t{\n $this->error = \"Error_COMMANDE_SUPPLIER_ADDON_NotDefined\";\n return -2;\n }\n }", "function load() {\n\n\t}", "public function loadISBN(){\n $sqlQuery = 'SELECT I.val FROM identifiers I , books B WHERE I.type=\"ISBN\" AND B.id = I.book AND B.id='.$this->id;\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n return $row['val'];\n return \"\";\n }", "public function _loadRealInstance() {}", "public static function load() {\n self::initialLoad();\n self::vendor();\n self::loadLibs();\n //registra o SLP AUTO LOAD\n spl_autoload_register(array('\\wow\\Loader','autLoad'));\n }", "function load()\n {\n }", "private function loadSiteId() {\r\n\t\tif (function_exists ( 'get_option' ) && get_option ( $this->const_option_fraxion_site_id ) != false) {\r\n\t\t\t$this->fraxion_site_id = get_option ( $this->const_option_fraxion_site_id );\r\n\t\t} else {\r\n\t\t\t$this->fraxion_site_id = NULL;\r\n\t\t}\r\n\t}", "public function load_1($var) {\r\n\t\tif (is_int($var)) {\r\n\t\t\t$result = $this->get(self::table, $var);\r\n\t\t\treturn $this->clean($result[0]);\r\n\t\t}\r\n\t\telseif (is_array($var)) {\r\n\t\t\t$result = $this->multiLoad_1(array($var));\r\n\t\t\treturn $result[0];\r\n\t\t}\r\n\t}", "public function load($id){\r\n\t\t$sql = 'SELECT * FROM power_base_station WHERE station_id = ?';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t$sqlQuery->setNumber($id);\r\n\t\treturn $this->getRow($sqlQuery);\r\n\t}", "protected abstract function getWorkPackage($number);", "public function load($source);", "public function loadById()\n {\n // $this->soals = DB::select('select * from soals where id_ulangan = ?', [$this->id_ul]);\n // $this->ed_soal = $this->soals[0]->soal;\n // $this->pilA = $this->soals[0]->pilihan_a;\n // $this->pilB = $this->soals[0]->pilihan_b;\n // $this->pilC = $this->soals[0]->pilihan_c;\n // $this->pilD = $this->soals[0]->pilihan_d;\n // $this->pilE = $this->soals[0]->pilihan_e;\n // $this->kunci_jawaban = $this->soals[0]->kunci_jawaban;\n // if ($this->soals[0]->poin != null) {\n // $this->poin = $this->soals[0]->poin;\n // }\n // dd($this->soals[0]->soal);\n // foreach ($this->soals as $s) {\n // $this->soal = $s->soal;\n // $this->pilA = $s->pilihan_a;\n // $this->pilB = $s->pilihan_b;\n // $this->pilC = $s->pilihan_c;\n // $this->pilD = $s->pilihan_d;\n // $this->pilE = $s->pilihan_e;\n // $this->kunci_jawaban = $s->kunci_jawaban;\n // if ($s->poin != null) {\n // $this->poin = $s->poin;\n // }\n // }\n // return $soals;\n }", "public function getNumber();", "function getPage($strana = 1) {\n\t\tif (isset($this->obsah[$strana]))\n\t\t\treturn $this->obsah[$strana];\n return new Obsah(array(\"cislo_id\" => $this->id, \"strana\" => $strana));\n }", "function getPage($strana = 1) {\n\t\tif (isset($this->obsah[$strana]))\n\t\t\treturn $this->obsah[$strana];\n return new Obsah(array(\"cislo_id\" => $this->id, \"strana\" => $strana));\n }", "abstract protected function loadStrategy($type);", "function wpcom_vip_require_lib( $slug ) {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n\n if ( !preg_match( '|^[a-z0-9/_.-]+$|i', $slug ) ) {\n\t\ttrigger_error( \"Cannot load a library with invalid slug $slug.\", E_USER_ERROR );\n\t\treturn;\n\t}\n\t$basename = basename( $slug );\n\t$lib_dir = WP_CONTENT_DIR . '/plugins/lib';\n\t$choices = array(\n\t\t\"$lib_dir/$slug.php\",\n\t\t\"$lib_dir/$slug/0-load.php\",\n\t\t\"$lib_dir/$slug/$basename.php\",\n\t);\n\tforeach( $choices as $file_name ) {\n\t\tif ( is_readable( $file_name ) ) {\n\t\t\trequire_once $file_name;\n\t\t\treturn;\n\t\t}\n\t}\n\ttrigger_error( \"Cannot find a library with slug $slug.\", E_USER_ERROR );\n}", "public static function getByNumber($number)\n {\n return self::whereOrderNumTunn($number)\n ->first();\n }", "public static function loadService($service) {\n\t\t$class = ucfirst($service).'Service';\n\t\trequire(SITE_ROOT.'/services/'.$service.'/'.$class.'.php');\n\t\t$serviceObj = new $class();\n\t\treturn $serviceObj;\n\t}", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function _loadService($service, $data)\n {\n //$this->_options['url2'] = WSGENCIP;\n //$this->_options['url3'] = WSCRYPTAB;\n \n switch($service){ \n case 'GenerarCIPMod1': $url = $this->_options['url2'];break; \n case 'BlackBox': $url = $this->_options['url3']; \n break; \n default : $url = $this->_options['url']; break;\n } \n\n try{\n \n $soap = new \\SoapClient($url); \n//var_dump($soap); echo '<br><br>';\n $info = $soap->$service($data); \n return $info;\n } catch (Exception $e){ var_dump($e);\n return false;\n }\n }", "function we_load($from=LOAD_MAID_DB){\n\t\twe_binaryDocument::we_load($from);\n\t}", "public function find ($givenNumber)\n {\n $req = new FortieRequest();\n $req->method('GET');\n $req->path($this->basePath)->path($givenNumber);\n\n return $this->send($req->build());\n }", "public static function loadWorker($params)\n\t{\n\t\t\n\t\trequire_once(\"workers/$params.php\");\n\t\t$alias=str_replace('SHIN_', '', $params);\n\t\t$alias=str_replace('_worker', '', $alias);\n\t\t\n\t\tif(!isset(self::$_workers[$alias])){\n\t\t\tself::$_workers[$alias] = new $params();\n\t\t}\n\t}", "public function load_1($var) {\n\t\tif (is_int($var)) {\n\t\t\t$result = $this->get(self::table, $var);\n\t\t\treturn $this->clean($result[0]);\n\t\t}\n\t\telseif (is_array($var)) {\n\t\t\t$result = (array)$this->multiLoad_1(array($var));\n\t\t\treturn $result[0];\n\t\t}\n\t}", "function load_sample($filename){\n\n\t$path = SAMPLE_DIR . $filename . SAMPLE_EXT;\n\n\tif(is_readable($path)){\n\t\treturn file_get_contents($path);\n\t}\n}", "function load($rid)\n {\n }", "public static function stockReadOne() {\n $stock_id = $_GET['id'];\n $results = ModelStock::getOne($stock_id);\n\n // ----- Construction chemin de la vue\n include 'config.php';\n $vue = $root . '/app/view/stock/viewAll.php';\n require ($vue);\n }", "public function loadByUrl($url);", "public function getHandle($no)\n {\n if (is_object($no) and isset($no->Id)) {\n return $no;\n }\n\n return $this->client\n ->Quotation_FindByNumber([\n 'number'=>$no,\n ])\n ->Quotation_FindByNumberResult;\n }", "public static function load_from_db() {\n // Sanitize $view;\n $view = isset($_GET['view']) ? (integer) $_GET['view'] : 0;\n $view = $view ? $view : false;\n System::$instances = db_get($view);\n }", "public function __load();", "function load()\n{\n\t\n}", "function getObjectFromObjectID($url,$o_id){\n\t\t$object = json_decode(file_get_contents($url.'objects/'.$o_id));\n\t\treturn $object;\n\t}", "function fetchObject ($version, $noOfObjects) {\n\n // Fetch object with an ID anywhere between 0 and the maximum\n $content = file_get_contents($version . \"?t=objekt&oges=\" . rand(0, $noOfObjects). \"&output=json\");\n\n // If no error was returned, return decoded contents; else run the function again\n if ($content != errorMsg) return json_decode($content, True);\n else return fetchObject ($version, $noOfObjects);\n\n}", "public static function loadById(?int $id);", "public function load($className);", "function getObjectFromStreamID($id) {\n\t\t$url = 'https://hestia.speckle.works/api/';\n\t\t$data = json_decode(file_get_contents($url.'streams/'.$id));\n\t\techo '<h2>GH Object: '.$data->resource->name.'</h2>';\n\t\t\n\t\t// get number of objects...\n\t\t$o_len = count($data->resource->layers);\n\t\t\n\t\t// get a list of the objects...\n\t\t\n\t\tfor ($x = 0; $x < $o_len; $x++) \n\t\t{\n\t\t\tgetSubObject($url,$data,$x);\n\t\t}\n\t\techo '<br>';\n\t}", "public function load($id){\n\t\t$sql = 'SELECT * FROM cbt_soal_siswa WHERE id_soal_siswa = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->set($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);" ]
[ "0.5242366", "0.50811344", "0.49460033", "0.48375", "0.47370535", "0.47128862", "0.4707274", "0.46813342", "0.46627095", "0.46470162", "0.46289974", "0.4620826", "0.4614079", "0.46085113", "0.4598162", "0.45809907", "0.45809907", "0.45700136", "0.45700136", "0.45700136", "0.45700136", "0.45641086", "0.45546713", "0.45455694", "0.4531875", "0.45036596", "0.4501804", "0.44886658", "0.44886163", "0.44885567", "0.44677335", "0.44589135", "0.44394746", "0.44310963", "0.44305846", "0.4424194", "0.44123876", "0.44123876", "0.44077563", "0.4405697", "0.44056892", "0.44025978", "0.4400097", "0.4400097", "0.4400097", "0.4400097", "0.4400097", "0.4400097", "0.4400097", "0.4400097", "0.4400097", "0.4400097", "0.4400097", "0.4400097", "0.4400097", "0.43935224", "0.438923", "0.43878007", "0.43845385", "0.4376407", "0.43702716", "0.43508476", "0.434027", "0.43391094", "0.43343696", "0.43255442", "0.43200758", "0.4312175", "0.429958", "0.4299385", "0.42950866", "0.4294806", "0.42865717", "0.42862535", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428", "0.4274428" ]
0.6350256
0
Saves a Sales Order with items
public function saveSO() { // Setup XML $xml = "<FbiXml>". " <Ticket>". " <Key></Key>". " </Ticket>". "<FbiMsgsRq>". " <SOSaveRq>\n". " <SalesOrder>\n". " <Salesman>admin</Salesman>\n". " <Number>60312</Number>\n". " <Status>10</Status>\n". " <Carrier>Will Call</Carrier>\n". " <FirstShipDate>2016-08-29T00:00:00</FirstShipDate>\n". " <CreatedDate>2016-08-29T00:00:00</CreatedDate>\n". " <IssuedDate>2016-08-29T16:48:56</IssuedDate>\n". " <TaxRatePercentage>0.0625</TaxRatePercentage>\n". " <TaxRateName>Utah</TaxRateName>\n". " <ShippingTerms>Prepaid </ShippingTerms>\n". " <PaymentTerms>COD</PaymentTerms>\n". " <CustomerContact>Beach Bike</CustomerContact>\n". " <CustomerName>Beach Bike</CustomerName>\n". " <FOB>Origin</FOB>\n". " <QuickBooksClassName>Salt Lake City</QuickBooksClassName>\n". " <LocationGroup>AYC</LocationGroup>\n". " <BillTo>\n". " <Name>test</Name>\n". " <AddressField>555 Suntan Ave.</AddressField>". " <City>Santa Barbara</City>". " <Zip>93101</Zip>". " </BillTo>\n". " <Ship>\n". " <Name>test</Name>\n". " <AddressField>555 Suntan Ave.</AddressField>". " <Zip>93101</Zip>". " <Country>US</Country>". " <State>California</State>". " </Ship>\n"; //foreach ($data['soitems'] AS $key=>$value) { $xml .=" <SalesOrderItem>\n <ID>-1</ID>\n <ProductNumber>00-KIN-APPHDR-057</ProductNumber>\n <SOID>94</SOID>\n <Description>Battery Pack</Description> <Taxable>true</Taxable>\n <Quantity>1</Quantity>\n <ProductPrice>-95.00</ProductPrice> <TotalPrice>-95.00</TotalPrice> <UOMCode>ea</UOMCode> <ItemType>20</ItemType>\n <QuickBooksClassName>Salt Lake City</QuickBooksClassName>\n <NewItemFlag>false</NewItemFlag>\n <LineNumber>2</LineNumber> </SalesOrderItem>\n"; //} $xml .=" </SalesOrder>\n". "<IssueFlag>false</IssueFlag>". "<IgnoreItems>false</IgnoreItems>". "</SOSaveRq>\n". "</FbiMsgsRq>"; // Create request and pack $this->createRequest($xml); $len = strlen($this->xmlRequest); $packed = pack("N", $len); // Send and get the response fwrite($this->id, $packed, 4); fwrite($this->id, $this->xmlRequest); $this->getResponse(); // Set the result $this->setResult($this->parseXML($this->xmlResponse)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saving(Order $Order)\n {\n //code...\n }", "public function add_sales_order() {\n\t\t$values=array(\"customer_name\"=>$_POST['customer_name'],\"product_id\"=>$_POST['inv_id'],\"sell_price\"=>$_POST['selling_price'],\"sell_date\"=>$_POST['selling_date'],\"prod_qty\"=>$_POST['selling_qty'],\"comments\"=>$_POST['comments']);\n\t\tif($this->insert(\"sales_order\",$values)) {\t\t\t\t\t\t\n\t\t\t$result=$this->runQuery('getAll','select max(id) as so_id from sales_order');\n\t\t\techo '{\"salesOrderList\":{\"updateFlag\":false,\"item\":'.json_encode($result).'}}';\n\t\t}\n\t\telse\n\t\t\techo 'Error while inserting sales tbl';\n\t}", "public function saveOrder()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$modelUserCart = $this->getModel('usercart');\n\n\t\t$modelUserCart->storeUserOrder();\n\t\t$modelUserCart->sendOrderMail();\n\t\t$modelUserCart->emptyCart();\n\t\t$params = $app->getParams('com_simpleshop');\n\t\t$return_url = $params->get('return_url');\n\n\n\t\t$app->redirect($return_url);\n\n\t}", "function persistOrder(User $user, Order $order, array $orderItems);", "private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }", "public function store(Request $request) {\n $data = new ItemOrder();\n $data->table_number = $request->table_number;\n $data->user_name = $request->user_name;\n $data->staff_id = auth()->user()->id;\n $data->order_number = generate_order_number();\n \n $data->save();\n $orderId = $data->id;\n\n foreach($request->order_details as $val) {\n $detailObj = new ItemOrderDetail();\n $detailObj->order_id = $orderId;\n $detailObj->item_id = $val['item_id'];\n $detailObj->quantity = $val['quantity'];\n $detailObj->price = $val['price'];\n $detailObj->final_price = $val['price'] * $val['quantity'];\n\n $detailObj->save();\n }\n\n $data->save();\n\n return redirect()->route('orders')->with('success', 'Order added successfully.');\n }", "public function saved(Order $Order)\n {\n //code...\n }", "public function storeOrder($request);", "function saveorder()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$cid \t= JRequest::getVar( 'cid', array(), 'post', 'array' );\n\t\t$order \t= JRequest::getVar( 'order', array(), 'post', 'array' );\n\t\tJArrayHelper::toInteger($cid);\n\t\tJArrayHelper::toInteger($order);\n\n\t\t$model = $this->getModel('weblink');\n\t\t$model->saveorder($cid, $order);\n\n\t\t$msg = JText::_( 'New ordering saved' );\n\t\t$this->setRedirect( 'index.php?option=com_weblinks', $msg );\n\t}", "public function saveAction()\n {\n $field = '';\n $this->_initOrder();\n if (Mage::registry('current_order')->getCustomerId() != Mage::getSingleton('customer/session')->getCustomerId()) {\n $this->getResponse()->setBody('Error');\n exit;\n }\n\n /*\n * decide what form submitted: product field || order field\n * product fields have field names like: \"amProduct_%orderItemID%_%fieldID%\"\n */\n $productSubmit = strpos($this->getRequest()->getPost('field'), 'amProduct_') !== FALSE ? 1 : 0;\n // process product fields\n if ($productSubmit) {\n // extract all data from POST (stored value like \"xyz_orderItemID_FieldCode\"\n $itemData = explode('_', $this->getRequest()->getPost('field'), 3);\n $itemId = $itemData[1];\n $code = $itemData[2];\n\n // load product item data\n $fieldModel = Mage::getModel('amorderattach/field')->load($code, 'code');\n $field = Mage::getModel('amorderattach/order_products')->load($itemId, 'order_item_id');\n\n if ($fieldModel->getId()) {\n // triggering on save new row if OrderItemId is not set\n if (!$field->getOrderItemId()) {\n $field->setOrderItemId($itemId);\n }\n\n $this->itemCode = $fieldModel->getItemCode($itemId);\n } else {\n die('Error on filed load: no such field found');\n }\n } else {\n $fieldModel = Mage::getModel('amorderattach/field')->load($this->getRequest()->getPost('field'), 'code');\n if ($fieldModel->getId()) {\n // load order item data\n $field = Mage::getModel('amorderattach/order_field')->load(Mage::registry('current_order')->getId(), 'order_id');\n $code = $this->getRequest()->getPost('field');\n $this->itemCode = $code;\n\n // triggering on save new row if OrderItemId is not set\n if (!$field->getOrderId()) {\n $field->setOrderId(Mage::registry('current_order')->getId());\n }\n } else {\n die('Error on filed load: no such field found');\n }\n }\n\n if ('date' == $code) {\n if ($this->getRequest()->getPost('value')) {\n $data = $this->getRequest()->getPost();\n $valueToFilter = $this->_filterDates($data, array('value'));\n $itemValue = date('Y-m-d', strtotime($valueToFilter['value']));\n } else {\n $itemValue = null;\n }\n } else {\n $itemValue = $this->getRequest()->getPost('value');\n }\n // set data\n $this->itemValue = $itemValue;\n $field->setData($code, $itemValue);\n\n // save if customer can edit\n if ('edit' == $fieldModel->getCustomerVisibility()) {\n $field->save();\n } else {\n die('Error on field save: no privileges for action');\n }\n\n\n Mage::register('current_attachment_order_field', $field); // required for renderer\n $this->_sendResponse($fieldModel);\n }", "public function store(SavePurchaseOrderRequest $request)\n {\n $po = new PurchaseOrder();\n $po->fill($request->toArray());\n $po->save();\n\n return redirect()->route('po.index');\n }", "abstract protected function saveItems();", "private function saveOrder()\n {\n $this->paymentInterface->setMethod(self::PAYMENT_METHOD);\n $this->magentoOrderId = $this->quoteManagement->placeOrder($this->quoteId, $this->paymentInterface);\n /** @var \\Magento\\Sales\\Api\\Data\\OrderInterface magentoOrder */\n $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId);\n\n if ($this->magentoOrderId == '') {\n throw new \\Exception(self::PMO_ERR_MSG);\n }\n }", "protected function saveOrderItems($items, $order_id, $currency_rate) {\n foreach ($items as $id => $item) {\n $order_items = new OrderItems(); // creating OrderItems() object inside foreach, because we need...\n $order_items->order_id = $order_id; // ...to insert several records into order_items table - single record for each item\n $order_items->product_id = $id;\n $order_items->name = $item['name'];\n $order_items->price = round($item['price'] * $currency_rate, 2);\n $order_items->qty_item = $item['qty'];\n $order_items->sum_item = round($item['qty'] * $item['price'] * $currency_rate, 2);\n $order_items->save();\n }\n }", "public function store(Request $request)\n {\n $orders = $request->order;\n if(!$orders){ \n return response()->json(['status' => 'NOK', 'msg' => 'The order is empty please add items to the order!']); \n }\n $orderId = $request->orderId;\n try{\n DB::beginTransaction();\n foreach($orders as $order){\n $array = explode('_', $order['id']);\n $item = new OrderItem;\n $item->order_id = $orderId;\n $item->item_type = $array[0];\n if($item->item_type == 'drink'){\n $item->drink_id = $array[1];\n }else{\n $item->meal_id = $array[1];\n }\n $item->amount = $order['amount'];\n $item->price = $order['price'];\n $item->save();\n }\n DB::commit();\n return response()->json(['status' => 'OK']);\n }catch(Exception $e){\n DB::rollback();\n return response()->json(['status' => 'NOK', 'msg' => 'Something went wrong on server please try again']);\n }\n }", "public function saveCartItems() {\n $order_id = $this->_order->check_cart($this->_auth->id);\n //echo '<pre>';\n //var_dump($this->_items);\n \n $order_data = array('user_id' => $this->_auth->id, 'order_status'=>'incomplete', 'ip'=>$_SERVER[\"REMOTE_ADDR\"],\n 'items' => serialize($this->_items)\n );\n //udpate order table\n if ($order_id) {\n $order_data['date_modified'] = date(\"Y-m-d H:i:s\");\n $this->_order->update($order_data, $order_id);\n } else {\n $order_data['date_added'] = date(\"Y-m-d H:i:s\");\n $order_id = $this->_order->save($order_data);\n }\n // echo $order_id; \n }", "function save_order(){\n\tif( ! current_user_can( 'order_posts' ) ){\n\t\twp_send_json_error( 'Oooops, you haven\\'t got the permission to do that' );\n\n\t\treturn;\n\t}\n\t$ordered_ids = $_POST[ 'id_array' ];\n\t$position = 1;\n\tforeach( $ordered_ids as $id ){\n\t\tupdate_post_meta( (int) $id, 'post_order', $position );\n\t\t$position ++;\n\t}\n}", "public function store(Request $request)\n {\n $itemids = $request->id;\n foreach ($itemids as $itemid) {\n $transaction = new Transaction;\n $transaction->owner_id = Auth::user()->id;\n $transaction->order_id = $request->get('order_id');\n $transaction->item_id = $itemid;\n $transaction->item_name = $request->item_name[$itemid];\n $transaction->item_price = $request->item_price[$itemid];\n $transaction->quantity = $request->quantity[$itemid];\n $transaction->save();\n }\n $this->sendMessage();\n return redirect('order/' . $request->order_id . '/index');\n }", "public function store(Request $request)\n {\n $user_id = auth()->user()->id;\n $users_id = User::find($user_id);\n\n //Audit Trail\n $auditTrail = AuditTrail::create([\n 'action' => 'Created Sales Order',\n 'action_by' => $users_id->name,\n ]);\n \n\n if(!Session::has('cartSalesOrder')) {\n return view('salesorder.create')->with('users_id',$users_id);\n } else {\n\n $oldSalesOrderCart = Session::get('cartSalesOrder');\n $salesOrderCart = new CartSalesOrder($oldSalesOrderCart);\n $products = $salesOrderCart->items;\n\n $totalPrice = 0;\n\n foreach($products as $product) {\n $totalPrice += $product['qty']*$product['unitPrice'];\n }\n \n $salesOrder = new SalesOrder;\n $salesOrder->statuses_id = 1;\n $salesOrder->status = \"pending\";\n $salesOrder->date = $salesOrderCart->date;\n $salesOrder->remarks = $salesOrderCart->remarks;\n $salesOrder->audit_trails_id = $auditTrail->id;\n $salesOrder->users_id=$user_id;\n $salesOrder->totalQuantity=$salesOrderCart->totalQty;\n $salesOrder->totalPrice=$totalPrice;\n $salesOrder->save();\n\n foreach($products as $product) {\n $salesOrderList = new SalesOrderList;\n $salesOrderList->sales_order_id =$salesOrder['id'];\n $salesOrderList->products_id = $product['item']['id'];\n $salesOrderList->quantity=$product['qty'];\n $salesOrderList->subtotal=$product['qty']*$product['unitPrice'];\n $salesOrderList->save();\n }\n Session::forget(\"cartSalesOrder\");\n }\n\n return redirect('/salesorder')->with('success', 'Sales Order Created');\n }", "public function store(OrderRequest $request)\n {\n $order = new Order;\n $order->cid = $request->cid;\n $order->charges = $request->charges;\n $order->subtotal = $request->subtotal;\n $order->total = $request->total;\n $order->name = $request->customer['name'];\n $order->email = $request->customer['email'];\n $order->contact = $request->customer['contact'];\n $order->device_token = $request->device_token;\n $order->created = $request->created;\n $order->save();\n\n $order_id= $order->id;\n foreach ($request->orders as $key => $value) {\n $orderDetail = new OrderDetail;\n $orderDetail->order_id = $order_id;\n $orderDetail->orderNumber = $value['orderNumber'];\n $orderDetail->truckName = $value['truckName'];\n $orderDetail->created = $value['created'];\n $orderDetail->save();\n\n $order_detail_id= $orderDetail->id;\n foreach ($value['items'] as $key => $value) {\n $item = new Item;\n $item->order_detail_id = $order_detail_id;\n $item->description = $value['description'];\n $item->display_name = $value['display_name'];\n $item->f_id = $value['f_id'];\n $item->p_id = $value['p_id'];\n $item->price = $value['price'];\n $item->quantity = $value['quantity'];\n $item->total = $value['total'];\n $item->save();\n }\n }\n return response([\n 'status'=>1,\n 'message'=>'Order Added Successfully!'\n ],Response::HTTP_CREATED);\n }", "function add_sales_order(&$order)\n{\n\tglobal $loc_notification, $path_to_root, $Refs;\n\n\tbegin_transaction();\n\thook_db_prewrite($order, $order->trans_type);\n\t$order_no = get_next_trans_no($order->trans_type);\n\t$del_date = date2sql($order->due_date);\n\t$order_type = 0; // this is default on new order\n\t$total = $order->get_trans_total();\n\t$sql = \"INSERT INTO \".TB_PREF.\"sales_orders (order_no, type, debtor_no, trans_type, branch_code, customer_ref, reference, comments, ord_date,\n\t\torder_type, ship_via, deliver_to, delivery_address, contact_phone,\n\t\tfreight_cost, from_stk_loc, delivery_date, payment_terms, total)\n\t\tVALUES (\" .db_escape($order_no) . \",\" .db_escape($order_type) . \",\" . db_escape($order->customer_id) .\n\t\t \", \" .db_escape($order->trans_type) . \",\" .db_escape($order->Branch) . \", \".\n\t\t\tdb_escape($order->cust_ref) .\",\". \n\t\t\tdb_escape($order->reference) .\",\". \n\t\t\tdb_escape($order->Comments) .\",'\" . \n\t\t\tdate2sql($order->document_date) . \"', \" .\n\t\t\tdb_escape($order->sales_type) . \", \" .\n\t\t\tdb_escape($order->ship_via).\",\" . \n\t\t\tdb_escape($order->deliver_to) . \",\" .\n\t\t\tdb_escape($order->delivery_address) . \", \" .\n\t\t\tdb_escape($order->phone) . \", \" . \n\t\t\tdb_escape($order->freight_cost) .\", \" . \n\t\t\tdb_escape($order->Location) .\", \" .\n\t\t\tdb_escape($del_date) . \",\" .\n\t\t\tdb_escape($order->payment) . \",\" .\n\t\t\tdb_escape($total). \")\";\n\n\tdb_query($sql, \"order Cannot be Added\");\n\n\t$order->trans_no = array($order_no=>0);\n\n\tif ($loc_notification == 1)\n\t{\n\t\tinclude_once($path_to_root . \"/inventory/includes/inventory_db.inc\");\n\t\t$st_ids = array();\n\t\t$st_names = array();\n\t\t$st_num = array();\n\t\t$st_reorder = array();\n\t}\n\tforeach ($order->line_items as $line)\n\t{\n\t\tif ($loc_notification == 1 && is_inventory_item($line->stock_id))\n\t\t\t$loc = calculate_reorder_level($order->Location, $line, $st_ids, $st_names, $st_num, $st_reorder); \n\n\t\t$sql = \"INSERT INTO \".TB_PREF.\"sales_order_details (order_no, trans_type, stk_code, description, unit_price, quantity, discount_percent) VALUES (\";\n\t\t$sql .= $order_no . \",\".$order->trans_type .\n\t\t\t\t\",\".db_escape($line->stock_id).\", \"\n\t\t\t\t.db_escape($line->item_description).\", $line->price,\n\t\t\t\t$line->quantity,\n\t\t\t\t$line->discount_percent)\";\n\t\tdb_query($sql, \"order Details Cannot be Added\");\n\n\t// Now mark quotation line as processed\n\t\tif ($order->trans_type == ST_SALESORDER && $line->src_id)\n\t\t\tupdate_parent_line(ST_SALESORDER, $line->src_id, $line->qty_dispatched); // clear all the quote despite all or the part was ordered\n\t} /* inserted line items into sales order details */\n\tadd_audit_trail($order->trans_type, $order_no, $order->document_date);\n\t$Refs->save($order->trans_type, $order_no, $order->reference);\n\n\thook_db_postwrite($order, $order->trans_type);\n\tcommit_transaction();\n\n\tif ($loc_notification == 1 && count($st_ids) > 0)\n\t\tsend_reorder_email($loc, $st_ids, $st_names, $st_num, $st_reorder);\n\treturn $order_no;\n}", "public function store(Request $request)\n {\n $lorealOrders = $this->getLorealOrderQuery();\n $firstOrder = $lorealOrders->first();\n $newOrder = new Order;\n $newOrder->supplier = $firstOrder->supplier;\n $newOrder->order_date = Carbon::now();\n $newOrder->status = 'Draft';\n $newOrder->item_count = $lorealOrders->count();\n $newOrder->save();\n\n foreach ($lorealOrders as $lorealOrder) {\n try {\n $product = Product::where('id', $lorealOrder->id)->firstOrFail();\n\n $orderItem = new OrderItem;\n $orderItem->order()->associate($newOrder);\n $orderItem->product()->associate($product);\n $orderItem->supplier = $product->supplier;\n $orderItem->display_name = $product->display_name;\n $orderItem->supplier_product_name = $product->order_name;\n $orderItem->supplier_sequence = $product->supplier_sequence;\n $orderItem->max_stock = $product->current_max_stock;\n $orderItem->available_stock = $product->current_stock_available;\n $orderItem->order_amount = $lorealOrder->ORDER_AMOUNT;\n $orderItem->cost_price = $product->current_cost_price;\n $orderItem->total_price = ($product->current_cost_price * $lorealOrder->ORDER_AMOUNT);\n $orderItem->save();\n } catch (Exception $e) {\n echo 'Message : ' . $e->getMessage() . PHP_EOL;\n }\n }\n\n $orders = Order::all();\n return view('order.index', compact('orders'));\n }", "public function store(SaleOrdersRequest $request)\n {\n // dd($request->all());\n\n // $request->validate([\n // 'customerID' => 'min:1',\n // 'productID' => 'required|array',\n // 'productID.*' => 'required',\n // 'quantity' => 'required|array|min:1',\n // 'quantity.*' => 'required|numeric|min:1',\n // 'quantity' => 'required|array|min:1',\n // 'quantity.*' => 'required|numeric|min:1',\n // ]);\n\n $input['customerID'] = $request['customerID'];\n $input['saleorderDate'] = $request['saleorderDate'];\n $input['total'] = $request['total'];\n $input['description'] = $request['description'];\n $input['userID'] = $user = session('user')[0]->userID;\n $order_id = SaleOrders::create($input)->id;\n\n $newOrderID = DB::table('saleorders')\n ->orderBy('orderID', 'DESC')->first()->orderID;\n\n // dd($newOrderID);\n if ($request->all()) {\n $i = 1;\n foreach ($request->input('productID') as $key => $value) {\n if ($value == \"0\") {\n continue;\n }\n $detail['orderID'] = $newOrderID;\n $detail['productID'] = $value;\n $detail['quantity'] = $request['quantity'][$key];\n $detail['price'] = $request['price'][$key];\n $detail['tax'] = $request['tax'][$key];\n $detail['subtotal'] = $request['subtotal'][$key];\n $detail['discount'] = $request['discount'][$key];\n $detail['amount'] = $request['amount'][$key];\n\n SaleOrderDetails::create($detail);\n $i++;\n\n }\n }\n if ($request->all()) {\n return redirect()->route('saleorders.index')->with('success', \"Created new Sale Order successfully!\");\n }\n }", "static public function SaveOrder() {\n $order = new self();\n $order->uid = Session::get('user_id');\n $order->total = 0;\n foreach (Cart::getContent()->toArray() as $item) {\n $order->total += $item['price'] * $item['quantity'];\n }\n $order->order_data = serialize(Cart::getContent()->toArray());\n $order->status = \"New\";\n $order->save();\n $order_id = DB::table('orders')->latest()->first()->id;\n /* saving order_id in session, used to redirect the user to order details page on user page after submitting checkout */\n Session::put('last_order', $order_id);\n /* clear cart, ready for a new order */\n Cart::clear();\n return true;\n }", "public function store(Request $request)\n {\n $input = $request->all();\n $order_item = new OrderItem;\n $order_item->qty = $request->input('qty');\n $order_item->order_id = $request->input('order_id');\n $order_item->product_id = $request->input('product_id');\n $order_item->save();\n return redirect('admin/orderItem')->with('message', 'Data berhasil ditambahkan!');\n }", "public function update_sales_order() {\n\t\t$rowIndex = $_POST['row_index'];\n\t\t$values=array(\"customer_name\"=>$_POST['customer_name'],\"product_id\"=>$_POST['inv_id'],\"sell_price\"=>$_POST['selling_price'],\"sell_date\"=>$_POST['selling_date'],\"prod_qty\"=>$_POST['selling_qty'],\"comments\"=>$_POST['comments']);\n\t\t$where =array(\"id\"=>$_POST['so_id']);\n\t\tif($this->update(\"sales_order\",$values,$where)) {\t\t\t\n\t\t\techo '{\"salesOrderList\":{\"updateFlag\":true,\"rowIndex\":'.$rowIndex.'}}';\n\t\t}\n\t\telse\n\t\t\techo 'Error while updating';\n\t}", "public function submitAction() {\n $id = $this->getRequest()->getParam('id');\n $model = Mage::getModel('inventorypurchasing/purchaseorder_draftpo')->load($id);\n try {\n $model->createPurchaseOrders();\n $model->delete();\n Mage::getSingleton('vendors/session')->addSuccess($this->helper()->__('New purchase orders has been added.'));\n $this->_redirect('vendors/inventory_purchaseorders');\n } catch (Exception $e) {\n $model->rollBackPO();\n Mage::getSingleton('vendors/session')->addError($this->helper()->__('An error has been occurred when adding new purchase orders. Please try again.'));\n Mage::getSingleton('vendors/session')->addError($e->getMessage());\n $this->_redirect('*/*/viewpo', array('id' => $id));\n }\n }", "public function save_tracking_items( $order_id, $tracking_items ) {\n\t\tif ( version_compare( WC_VERSION, '3.0', '<' ) ) {\n\t\t\tupdate_post_meta( $order_id, '_wc_shipment_tracking_items', $tracking_items );\n\t\t} else {\n\t\t\t$order = new WC_Order( $order_id );\n\t\t\t$order->update_meta_data( '_wc_shipment_tracking_items', $tracking_items );\n\t\t\t$order->save_meta_data();\n\t\t}\n\t}", "public function saveSimpleOrder() {\n\t\t//negate action from $_POST\n\t\tunset( $_POST['action'] );\n\n\t\t//separate order related data and loopable meta data\n\t\t$data['order_title'] = isset($_POST['order_title']) ? $_POST['order_title'] : null;\n\t\t$data['order_slug'] = isset($_POST['order_slug']) ? $_POST['order_slug'] : null;\n\t\t$data['parent_order_id'] = isset($_POST['parent_order_id']) ? $_POST['parent_order_id'] : null;\n\t\t$data['order_id'] = isset($_POST['order_id']) ? $_POST['order_id'] : null;\n\t\tif(empty($data['order_id']) && !empty($_SESSION['order']['wp_order_id'])) {\n\t\t\t$data['order_id'] = $_SESSION['order']['wp_order_id'];\n\t\t}\n\n\t\t$data['order_status'] = isset($_POST['order_status']) ? $_POST['order_status'] : null;\n\n\t\t$metaData['seq_number'] = isset($_POST['seq_number']) ? $_POST['seq_number'] : null;\n\n\t\t//Time to unset these variables from $_POST to keep only loopable data in $_POST\n\t\tunset( $_POST['order_title'] );\n\t\tunset( $_POST['order_slug'] );\n\t\tunset( $_POST['parent_order_id'] );\n\t\tunset( $_POST['order_id'] );\n\t\tunset( $_POST['order_status'] );\n\t\tunset( $_POST['seq_number'] );\n\n\t\t//now $_POST will have only the parameters which are ready to be saved, make sure to use same names which are in advance custom fields\n\t\tlist( $order, $wpError ) = saveAnbOrderInWp( $data, $_POST, $metaData );\n\t\t$errors = $wpError->get_error_messages();\n\t\t$response = null;\n\t\tif ( count( $errors ) > 0 ) {\n\t\t\t//its an error so send response appropriatly\n\t\t\t$response['success'] = false;\n\t\t\t$response['errors'] = $errors;\n\t\t} elseif ( $order > 0 ) {\n\t\t\t$response['success'] = true;\n\t\t} else {\n\t\t\t$response['success'] = 'no-update';\n\t\t}\n\t\techo json_encode( $response );\n\t\twp_die();\n\t}", "public function saveAction() {\n if (!$data = $this->getRequest()->getPost()) {\n $this->_redirect('*/*/index');\n }\n $productData = $this->_prepareDataForDraftPO($data);\n $model = Mage::getModel('inventorypurchasing/purchaseorder_draftpo')\n ->load($this->getRequest()->getParam('id'))\n ->setData('product_data', $productData);\n try {\n $model->save();\n Mage::getSingleton('vendors/session')\n ->addSuccess(Mage::helper('inventorypurchasing')->__('Data has been saved.'));\n return $this->_redirect('*/*/view', array('id' => $model->getId()));\n } catch (Exception $ex) {\n Mage::getSingleton('vendors/session')->addError($ex->getMessage());\n return $this->_redirect('*/*/view', array('id' => $model->getId()));\n }\n }", "public function saveDataAftersaveAction() {\n $result = array();\n $error = true;\n $userId = Mage::helper('webpos/permission')->getCurrentUser();\n $isInvoice = Mage::helper('webpos/permission')->canManageOrder($userId, $this->getRequest()->getParam('order_id'));\n $orderId = $this->getRequest()->getParam('order_id');\n $order = Mage::getModel('sales/order')->load($orderId);\n $create_shipment = $this->getRequest()->getParam('create_shipment');\n $create_invoice = $this->getRequest()->getParam('create_invoice');\n $invoice_error = '';\n $invoice_message = '';\n $shipment_error = '';\n $shipment_message = '';\n\n\n if ($isInvoice == false) {\n $result['message'] = $this->__(\"Access denied! You don't have the permission to process this action.\");\n $result['error'] = true;\n $this->getResponse()->setBody(Zend_Json::encode($result));\n return;\n }\n //end vietdq\n if ($orderId && $order && $order->getId()) {\n $result['error'] = false;\n if ($create_invoice) {\n try {\n $invoice = $this->_initInvoice($orderId);\n if ($invoice) {\n if (!empty($data['capture_case'])) {\n $invoice->setRequestedCaptureCase($data['capture_case']);\n }\n $invoice->register();\n $invoice->setEmailSent(true);\n $invoice->getOrder()->setCustomerNoteNotify(true);\n $invoice->getOrder()->setIsInProcess(true);\n $transactionSave = Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder());\n\n $shipment = false;\n if ((int) $invoice->getOrder()->getForcedDoShipmentWithInvoice()) {\n $shipment = $this->_prepareShipment($invoice);\n if ($shipment) {\n $shipment->setEmailSent($invoice->getEmailSent());\n $transactionSave->addObject($shipment);\n }\n }\n\n $transactionSave->save();\n if (Mage::helper('webpos/customer')->isEnableAutoSendEmail('invoice')) {\n $template_invoice = Mage::helper('webpos/customer')->getWebposEmailTemplate('invoice');\n if (isset($template_invoice['guest']) && $template_invoice['guest'] != '') {\n Mage::app()->getStore()->setConfig(Mage_Sales_Model_Order_Invoice::XML_PATH_EMAIL_GUEST_TEMPLATE, $template_invoice['guest']);\n }\n if (isset($template_invoice['customer']) && $template_invoice['customer'] != '') {\n Mage::app()->getStore()->setConfig(Mage_Sales_Model_Order_Invoice::XML_PATH_EMAIL_TEMPLATE, $template_invoice['customer']);\n }\n $invoice->sendEmail($order->getCustomerEmail(), '');\n }\n $invoice_error = false;\n $invoice_message = $this->__('The invoice has been created.');\n } else {\n $invoice_error = true;\n $invoice_message = $this->__('The invoice is not exist');\n }\n } catch (Mage_Core_Exception $e) {\n $invoice_error = true;\n $invoice_message = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $invoice_error = true;\n $invoice_message = $this->__('Unable to save the invoice.');\n }\n }\n\n if ($create_shipment) {\n try {\n $shipment = $this->_initShipment($orderId);\n if ($shipment) {\n $shipment->register();\n $shipment->setEmailSent(true);\n $shipment->getOrder()->setCustomerNoteNotify(true);\n $this->_saveShipment($shipment);\n if (Mage::helper('webpos/customer')->isEnableAutoSendEmail('shipment')) {\n $shipment->sendEmail($order->getCustomerEmail());\n }\n $shipment_error = false;\n $shipment_message = $this->__('The shipment has been created.');\n } else {\n $shipment_error = true;\n $shipment_message = $this->__('An error occurred while creating shipment.');\n }\n } catch (Mage_Core_Exception $e) {\n $shipment_error = true;\n $shipment_message = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $shipment_error = true;\n $shipment_message = $this->__('An error occurred while creating shipment.');\n }\n }\n } else {\n $result['error'] = true;\n $result['message'] = $this->__('The order does not exist');\n $this->getResponse()->setBody(Zend_Json::encode($result));\n return;\n }\n\n $result['create_invoice'] = $create_invoice;\n $result['create_shipment'] = $create_shipment;\n if ($create_shipment && $create_invoice && !$invoice_error && !$shipment_error) {\n $result['apply_message'] = $this->__('The invoice and shipment have been created.');\n } else {\n if ($create_invoice) {\n // $result['create_invoice'] = $create_invoice;\n $result['invoice_error'] = $invoice_error;\n $result['invoice_message'] = $invoice_message;\n }\n if ($create_shipment) {\n // $result['create_shipment'] = $create_shipment;\n $result['shipment_error'] = $shipment_error;\n $result['shipment_message'] = $shipment_message;\n }\n }\n $result['createCustomerForm'] = $this->getLayout()->createBlock('webpos/customer')\n ->setTemplate('webpos/webpos/createcustomer.phtml')\n ->toHtml();\n $result['totals'] = $this->getLayout()->createBlock('webpos/cart_totals')\n ->setTemplate('webpos/webpos/review/totals.phtml')\n ->toHtml();\n $this->getResponse()->setBody(Zend_Json::encode($result));\n }", "public function saveAction()\n {\n $tab = '';\n \n \n $pPoOrderId = $this->getRequest()->getPost('po_order_id');\n \n //get input parametre from the webpage.\n $order = Mage::getModel('purchase/order')->load($pPoOrderId);\n\n $order->setPurchaseRep(Mage::getSingleton('admin/session')->getUser()->getUsername());\n \n if ($this->getRequest()->getPost('order_eta')){\n $order->setOrderEta($this->getRequest()->getPost('order_eta'));\n }else{\n $order->setOrderEta(null);\n }\n $order->setPaymentTerms($this->getRequest()->getPost('payment_term_id'));\n $order->setShippingMethod($this->getRequest()->getPost('shipping_method_id'));\n \n $order->setComments($this->getRequest()->getPost('comments'));\n $order->setStoreId($this->getRequest()->getPost('store_id'));\n \n $order->setShippingName($this->getRequest()->getPost('shipping_name'));\n $order->setShippingCompany($this->getRequest()->getPost('shipping_company'));\n $order->setShippingStreet1($this->getRequest()->getPost('shipping_street1'));\n $order->setShippingStreet2($this->getRequest()->getPost('shipping_street2'));\n $order->setShippingCity($this->getRequest()->getPost('shipping_city'));\n $order->setShippingState($this->getRequest()->getPost('shipping_state'));\n $order->setShippingZipcode($this->getRequest()->getPost('shipping_zipcode'));\n $order->setShippingCountry($this->getRequest()->getPost('shipping_country'));\n $order->setShippingTelephone1($this->getRequest()->getPost('shipping_telephone1'));\n $order->setShippingTelephone2($this->getRequest()->getPost('shipping_telephone2'));\n $order->setShippingFax($this->getRequest()->getPost('shipping_fax'));\n $order->setShippingEmail($this->getRequest()->getPost('shipping_email'));\n $order->setShippingType($this->getRequest()->getPost('shipping_type')); \n// $order->setShippingSalesOrderId(\"\"); \n if($this->getRequest()->getPost('po_shipping_type')==\"so\")\n $order->setShippingSalesOrderId($this->getRequest()->getPost('po_shipping_so_num')); \n else\n $order->setShippingSalesOrderId(\"\"); \n \n $order->save(); \n \n $purchaseOrderId = $order->getId();\n \n \n //Process information from \"review product\" tab page\n foreach ($order->getOrderItems() as $item)\n {\n\n $itemId = $item->getId();\n \n if ($this->getRequest()->getPost('delete_'.$itemId) == 1)\n {\n $vOldQty = $item->getProductQty();\n $vProductQty = 0;\n $item->delete();\n }\n else \n {\n $receivedQty =$item->getQtyReceipted(); \n $vOldQty = $item->getProductQty();\n $vProductQty = $this->getRequest()->getPost('product_qty_'.$itemId);\n\n if (!(($vProductQty < $receivedQty) || ($vOldQty < $receivedQty))){ \n $item->setPurchaseOrderId($purchaseOrderId);\n $item->setProductId($this->getRequest()->getPost('product_id_'.$itemId));\n $item->setProductName($this->getRequest()->getPost('product_name_'.$itemId));\n \n //$item->setpop_supplier_ref($this->getRequest()->getPost('pop_supplier_ref_'.$item->getId()));\n \n $item->setProductQty($vProductQty);\n $item->setProductPrice($this->getRequest()->getPost('product_price_'.$itemId));\n $item->setSubtotal($item->getProductQty() * $item->getProductPrice());\n $item->setTotal($item->getSubtotal() + $item->getTax() + $item->getAdjustFee());\n $item->save();\n\n $vendorProduct = Mage::getModel(\"purchase/vendorproduct\")\n ->loadByProductId($order->getVendorId() , $item->getProductId());\n $vendorProduct->setVendorSku($this->getRequest()->getPost('vendor_sku_'.$itemId))\n ->setUnitCost($item->getProductPrice())\n ->save();\n }else {\n Mage::getSingleton('adminhtml/session')->addWarning($this->__('not updated for %s: new qty[%s] less than received qty [%s]', $item->getProductName(), $vProductQty, $receivedQty)); \n $vProductQty = $vOldQty;\n } \n\n } \n //process update qty when order had been send to vendor\n if ((($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_WAITING_FOR_DELIVERY) \n ||($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_PARTIALLY_RECEIVED))\n && ($vOldQty != $vProductQty)){\n \n Mage::dispatchEvent('purchase_order_refresh_poqty', \n array('po_order_id' => $purchaseOrderId,\n 'po_product_id' => $item->getProductId(), \n 'po_product_qty_old' => $vOldQty,\n 'po_product_qty_new' => $vProductQty));\n\n } \n\n }\n\n\n \n //process information from \"Add product\" tab page, check if we have to add products\n if ($this->getRequest()->getPost('add_product') != '')\n {\n $productsToAdd = Mage::helper('purchase')->decodeInput($this->getRequest()->getPost('add_product'));\n foreach($productsToAdd as $key => $value)\n {\n //retrieves values\n $productId = $key;\n $qty = $value['qty'];\n if ($qty == '')\n $qty = 1;\n \n //add product\n $order->addItems($productId, $qty);\n \n //process update qty when order had been send to vendor\n if (($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_WAITING_FOR_DELIVERY)\n ||($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_PARTIALLY_RECEIVED)){\n \n Mage::dispatchEvent('purchase_order_refresh_poqty', \n array('po_order_id' => $purchaseOrderId,\n 'po_product_id' => $productId, \n 'po_product_qty_old' => 0,\n 'po_product_qty_new' => $qty));\n\n }\n \n }\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Products added'));\n $tab = 'tab_products';\n $order->resetOrderItems();\n \n }\n \n $orderSubtotal = 0.0000;\n //$orderTotal = 0.0000;\n foreach ($order->getOrderItems() as $item)\n {\n $orderSubtotal += $item->getSubtotal();\n //$orderTotal += $item->getTotal();;\n //Update vendor_product's vendor sku, cost...etc,.\n Mage::dispatchEvent('purchase_order_update_vendor_product', array('po_order_item'=>$item));\n }\n $order->setSubtotal($orderSubtotal)\n ->setTotal($orderSubtotal + $order->getTax() + $order->getAdjustFee() + $order->getShippingPrice())\n ->save();\n \n //Process information from \"send to vendor\" tab page.\n $notifyFlag = $this->getRequest()->getPost('send_to_customer');\n if ($notifyFlag == 1)\n {\n $order->notifyVendor($this->getRequest()->getPost('email_comment'));\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Vendor notified'));\n\n //update Po_qty in stockitem.\n foreach ($order->getOrderItems() as $item)\n {\n Mage::dispatchEvent('purchase_order_refresh_poqty', \n array('po_order_id' => $order->getId(),\n 'po_product_id' => $item->getProductId(), \n 'po_product_qty_old' => 0,\n 'po_product_qty_new' => $item->getProductQty()));\n }\n\n }\n \n if (($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_WAITING_FOR_DELIVERY)\n ||($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_PARTIALLY_RECEIVED) ){\n Mage::dispatchEvent('purchase_order_refresh_status', \n array('po_order' => $order)); \n }\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Purchase order successfully Saved'));\n \n $this->_redirect('purchase/orders/edit/po_order_id/'.$order->getOrderId().'/tab/'.$tab);\n \n }", "public function save()\n {\n $sql = new Sql();\n\n $results = $sql->select(\n \"CALL sp_orders_save(:idorder, :idcart, :iduser, :idstatus, :idaddress, :vltotal)\",\n [\n ':idorder'=>$this->getidorder(),\n ':idcart'=>$this->getidcart(),\n ':iduser'=>$this->getiduser(),\n ':idstatus'=>$this->getidstatus(),\n ':idaddress'=>$this->getidaddress(),\n ':vltotal'=>$this->getvltotal()\n ]\n );\n\n if (count($results) > 0) {\n $this->setData($results[0]);\n }\n }", "public function order_save(Request $request)\n {\n if (!(\\Session::has('total') && (\\Session::get('total') > 0)))\n {\n alert()->error(__('Error'), __('No item in order'));\n return redirect()->route(auth()->user()->position . '.order.create');\n }\n\n $request->validate([\n \"vessel_name\" => 'required|min:2|max:255',\n ]);\n\n $product_list = $this->order_to_array();\n $this->update_price(true);\n\n $order = new Order();\n $order->total_price = $request->session()->get('total');\n $order->vessel_name = $request->vessel_name;\n $order->customer_id = auth()->user()->customer_id;\n $order->status_id = 1;\n $order->user_id = auth()->user()->id;\n $order->save();\n\n $order->product()->attach($product_list);\n $order->statusDate()->attach([\n 'status_id' => 1\n ]);\n\n \\Session::forget('total');\n \\Session::forget('order');\n\n alert()->success(__('Success'), __('Add new order success'));\n return redirect()->route(auth()->user()->position . '.order.index');\n }", "public function store(Request $request)\n {\n \n $data_array = json_decode($request->data_string);\n $total = 0;\n\n foreach ($data_array as $data) {\n $total += $data->price * $data->qty;\n }\n\n $order = new Order;\n $order->voucherno = uniqid();\n $order->orderdate = date('Y-m-d');\n $order->note = $request->note;\n $order->total = $total;\n $order->phone = $request->phone;\n $order->address = $request->address;\n $order->user_id = Auth::id();\n $order->save();\n\n foreach ($data_array as $data) {\n $order->items()->attach($data->id,['qty' => $data->qty]);\n }\n\n return 'Order Successfully!';\n }", "public static function storeOrderItem($orderId,$item)\n {\n try{\n DB::table('order_items')\n ->insert([\n 'order_id'=>$orderId,\n 'item_id'=>$item->id,\n 'quantity'=>$item->quantity,\n 'price'=>$item->price\n ]);\n }\n catch(QueryException $e){\n return false;\n }\n }", "public function save(array $items)\n {\n }", "private function saveRecord(): void\r\n {\r\n $this->order->add_meta_data('_moloni_sent', $this->document_id);\r\n $this->order->save();\r\n }", "public function save_items_order() {\n\t\n\t\t\tparse_str( $_REQUEST[ 'order' ], $order );\n\t\n\t\t\techo update_post_meta( intval( $_REQUEST[ 'gallery_id' ] ), 'items_order', $order );\n\t\n\t\t\texit;\n\t\t}", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"salesorderlinedetail\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $TxnLineID = $this->request->getPost(\"TxnLineID\");\n $salesorderlinedetail = Salesorderlinedetail::findFirstByTxnLineID($TxnLineID);\n\n if (!$salesorderlinedetail) {\n $this->flash->error(\"salesorderlinedetail does not exist \" . $TxnLineID);\n\n $this->dispatcher->forward([\n 'controller' => \"salesorderlinedetail\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $salesorderlinedetail->setTxnlineid($this->request->getPost(\"TxnLineID\"));\n $salesorderlinedetail->setItemrefListid($this->request->getPost(\"ItemRef_ListID\"));\n $salesorderlinedetail->setItemrefFullname($this->request->getPost(\"ItemRef_FullName\"));\n $salesorderlinedetail->setDescription($this->request->getPost(\"Description\"));\n $salesorderlinedetail->setQuantity($this->request->getPost(\"Quantity\"));\n $salesorderlinedetail->setUnitofmeasure($this->request->getPost(\"UnitOfMeasure\"));\n $salesorderlinedetail->setOverrideuomsetrefListid($this->request->getPost(\"OverrideUOMSetRef_ListID\"));\n $salesorderlinedetail->setOverrideuomsetrefFullname($this->request->getPost(\"OverrideUOMSetRef_FullName\"));\n $salesorderlinedetail->setRate($this->request->getPost(\"Rate\"));\n $salesorderlinedetail->setRatepercent($this->request->getPost(\"RatePercent\"));\n $salesorderlinedetail->setClassrefListid($this->request->getPost(\"ClassRef_ListID\"));\n $salesorderlinedetail->setClassrefFullname($this->request->getPost(\"ClassRef_FullName\"));\n $salesorderlinedetail->setAmount($this->request->getPost(\"Amount\"));\n $salesorderlinedetail->setInventorysiterefListid($this->request->getPost(\"InventorySiteRef_ListID\"));\n $salesorderlinedetail->setInventorysiterefFullname($this->request->getPost(\"InventorySiteRef_FullName\"));\n $salesorderlinedetail->setSerialnumber($this->request->getPost(\"SerialNumber\"));\n $salesorderlinedetail->setLotnumber($this->request->getPost(\"LotNumber\"));\n $salesorderlinedetail->setSalestaxcoderefListid($this->request->getPost(\"SalesTaxCodeRef_ListID\"));\n $salesorderlinedetail->setSalestaxcoderefFullname($this->request->getPost(\"SalesTaxCodeRef_FullName\"));\n $salesorderlinedetail->setInvoiced($this->request->getPost(\"Invoiced\"));\n $salesorderlinedetail->setIsmanuallyclosed($this->request->getPost(\"IsManuallyClosed\"));\n $salesorderlinedetail->setOther1($this->request->getPost(\"Other1\"));\n $salesorderlinedetail->setOther2($this->request->getPost(\"Other2\"));\n $salesorderlinedetail->setCustomfield1($this->request->getPost(\"CustomField1\"));\n $salesorderlinedetail->setCustomfield2($this->request->getPost(\"CustomField2\"));\n $salesorderlinedetail->setCustomfield3($this->request->getPost(\"CustomField3\"));\n $salesorderlinedetail->setCustomfield4($this->request->getPost(\"CustomField4\"));\n $salesorderlinedetail->setCustomfield5($this->request->getPost(\"CustomField5\"));\n $salesorderlinedetail->setCustomfield6($this->request->getPost(\"CustomField6\"));\n $salesorderlinedetail->setCustomfield7($this->request->getPost(\"CustomField7\"));\n $salesorderlinedetail->setCustomfield8($this->request->getPost(\"CustomField8\"));\n $salesorderlinedetail->setCustomfield9($this->request->getPost(\"CustomField9\"));\n $salesorderlinedetail->setCustomfield10($this->request->getPost(\"CustomField10\"));\n $salesorderlinedetail->setCustomfield11($this->request->getPost(\"CustomField11\"));\n $salesorderlinedetail->setCustomfield12($this->request->getPost(\"CustomField12\"));\n $salesorderlinedetail->setCustomfield13($this->request->getPost(\"CustomField13\"));\n $salesorderlinedetail->setCustomfield14($this->request->getPost(\"CustomField14\"));\n $salesorderlinedetail->setCustomfield15($this->request->getPost(\"CustomField15\"));\n $salesorderlinedetail->setIdkey($this->request->getPost(\"IDKEY\"));\n $salesorderlinedetail->setGroupidkey($this->request->getPost(\"GroupIDKEY\"));\n \n\n if (!$salesorderlinedetail->save()) {\n\n foreach ($salesorderlinedetail->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"salesorderlinedetail\",\n 'action' => 'edit',\n 'params' => [$salesorderlinedetail->getTxnlineid()]\n ]);\n\n return;\n }\n\n $this->flash->success(\"salesorderlinedetail was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"salesorderlinedetail\",\n 'action' => 'index'\n ]);\n }", "public function store(Request $request)\n {\n $items = collect(json_decode($request->items, true));\n\n //create matching order_id for items on same order.\n $order_id = strtoupper(md5(time() . auth()->user()->email));\n\n //loop through each item.\n foreach ($items as $item) {\n $item['order_id'] = $order_id;\n\n $note = $item['note'] ?? null;\n unset($item['note']);\n\n //insert into db.\n $new = auth()->user()->stores()->create($item);\n\n if (!$new) {\n auth()->user()->stores()->where('order_id', $order_id)->delete();\n throw new Exception('An Unknown error has occured', 1);\n }\n\n if ($note) {\n $new->notes()->create([\n 'order_id' => $order_id,\n 'note' => $note,\n 'user_id' => auth()->user()->id,\n ]);\n }\n }\n\n return ['success' => true];\n\n }", "public function store(Request $request)\n {\n $data = $request->all();\n try {\n $orderItem = OrderItem::create([\n 'item_id' => $data['item_id'],\n 'order_id' => $data['order_id'],\n 'quantity'=> $data['quantity'],\n 'notes'=> $data['notes']\n ]); \n } catch (\\Exception $exception) {\n return response()->json([\"error\" => \"Record not created successfully!\"], 406);\n }\n \n if (sizeof($data['extras_id']) <= 0) {\n $extra = Extra::find(0);\n $orderItem->extras()->attach($extra);\n }\n else {\n foreach($data['extras_id'] as $extra_id){\n $extra = Extra::find($extra_id);\n $orderItem->extras()->attach($extra);\n }\n }\n\n $orderItemExtras = $orderItem->with('extras')->find($orderItem->id);\n return response()->json($orderItemExtras, 201, ['Content-type'=> 'application/json; charset=utf-8'], JSON_UNESCAPED_UNICODE);\n }", "public function store(Request $request)\n {\n // dd($request);\n DB::transaction(function () use ($request) {\n $shop_arr = json_decode($request->data);\n // dd($shop_arr);\n // return 'Success';\n\n // insert Orders\n $order = new Order;\n $order->orderdate = date('Y-m-d');\n $order->voucherno = time();\n $order->total = $request->total;\n $order->note = '';\n $order->status = 0;\n $order->user_id = Auth::id();\n $order->save();\n\n // insert item_order\n foreach ($shop_arr as $item) {\n $order->items()->attach($item->id, ['qty' => $item->qty]);\n }\n });\n\n return 'success';\n }", "public function store()\n\t{\n\t\t$order = new Order();\n\n\t\t$items = json_decode(Input::get('items', []), true);\n\n\t\tforeach($items as &$item) {\n\t\t\t$id = $item['reference']['id'];\n\t\t\t$model = Product::find($id);\n\t\t\t$item['name'] = $model->name;\n\t\t\t$item['unit_price'] = $model->price;\n\t\t\t$item['total_price_including_tax'] = ceil($model->price * $model->vatgroup->amount * $item['quantity']);\n\t\t\t$item['total_price_excluding_tax'] = ceil($model->price * $item['quantity']);\n\t\t\t$item['type'] = 'physical';\n\t\t\t$item['discount_rate'] = 0;\n\t\t\t$item['tax_rate'] = (int) abs((1 - $model->vatgroup->amount) * 100);\n\t\t}\n\n\t\t$order->items = $items;\n\n\t\t# determine shipping type\n\t\t$total = $order->getTotal();\n\t\t$weight = $order->getWeight();\n\t\tif ($weight <= 1000) {\n\t\t\t$shippingType = 'mail';\n\t\t\t$shippingCost = 39;\n\t\t}else {\n\t\t\t$shippingType = 'service-pack';\n\t\t\t$shippingCost = 99;\n\t\t}\n\n\t\t# free shipping?\n\t\tif ($total >= 800) {\n\t\t\t$shippingCost = 0;\n\t\t}\n\n\t\t# add shipping\n\t\t$items = $order->items;\n\t\t$items[] = [\n\t\t\t'discount_rate' => 0,\n\t\t\t'name' => $shippingType,\n\t\t\t'quantity' => 1,\n\t\t\t'reference' => null,\n\t\t\t'tax_rate' => 0,\n\t\t\t'total_price_excluding_tax' => $shippingCost,\n\t\t\t'total_price_including_tax' => $shippingCost,\n\t\t\t'total_tax_amount' => 0,\n\t\t\t'type' => 'shipping_fee',\n\t\t\t'unit_price' => $shippingCost,\n\t\t];\n\t\t$order->items = $items;\n\n\t\t# set user\n\t\t$order->user_id = Input::get('user_id');\n\n\t\t# set shipping & billing addresses\n\t\t$order->billing_address = [\n\t\t\t'given_name' => $order->user->firstname,\n\t\t\t'family_name' => $order->user->lastname,\n\t\t\t'street_address' => null,\n\t\t\t'postal_code' => null,\n\t\t\t'city' => null,\n\t\t\t'country' => null,\n\t\t\t'email' => $order->user->email,\n\t\t\t'phone' => null,\n\t\t];\n\t\t$order->shipping_address = $order->billing_address;\n\n\t\t# set locale etc\n\t\t$order->locale = 'nb-no';\n\t\t$order->purchase_country = 'no';\n\t\t$order->purchase_currency = 'nok';\n\n\t\t# set total\n\t\t$order->total_price_including_tax = $order->getTotal();\n\n\t\t$total = 0;\n\t\tforeach($order->items as $item) {\n\t\t\t$total += $item['total_price_excluding_tax'];\n\t\t}\n\t\t$order->total_price_excluding_tax = $total;\n\n\t\t# total tax amount\n\t\t$tax = 0;\n\t\tforeach($order->items as $item) {\n\t\t\t$tax += $item['total_price_including_tax'] - $item['total_price_excluding_tax'];\n\t\t}\n\t\t$order->total_tax_amount = $tax;\n\n\t\t$order->status = 'unprocessed';\n\n\t\t# save\n\t\t$order->save();\n\n\t\t# redirect to edit that order now\n\t\treturn Redirect::to(route('admin.orders.edit', $order->id));\n\t}", "public function store(ValidateOrdersStore $request)\n {\n $order = $request->validated();\n $order['user_id'] = Auth::user()['id'];\n $order['payment_amount'] = $order['quantity'] * Product::findOrFail($order['product_id'])->price;\n\n Order::create($order);\n\n return redirect()->route('orders.index');\n }", "public function save_order() {\n$customer = array(\n'nama' => $this->input->post('nama'),\n'email' => $this->input->post('email'),\n);\n// And store user information in database.\n$cust_id = $this->Shop_model->insert_customer($customer);\n\n$order = array(\n'pelanggan' => $cust_id\n);\n\n$ord_id = $this->Shop_model->insert_order($order);\n\n\nforeach ($this->cart->contents() as $item):\n$order_detail = array(\n'order_id' => $ord_id,\n'produk' => $item['id'],\n'qty' => $item['qty'],\n'harga' => $item['price']\n);\n\n// Insert product imformation with order detail, store in cart also store in database.\n\n$cust_id = $this->Shop_model->insert_order_detail($order_detail);\nendforeach;\n\n\nredirect('shop');\n\n }", "public function ___orderSaved(PadOrder $order) {\n }", "private function _store(Yourdelivery_Model_Inventory $item) {\n $request = $this->getRequest();\n $form = new Yourdelivery_Form_Administration_Inventory_Create();\n if ($form->isValid($request->getPost())) {\n\n if (!$this->_subChecks($form)) {\n return;\n }\n\n $values = $form->getSubForm('item')->getValues();\n $values['item']['printerNextDate'] = date('Y-m-d H:i:s', strtotime($values['item']['printerNextDate']));\n $item->setData($values['item']);\n $item->save();\n\n //store all the stati for creation \n $item->addComment('needs', $form->getSubform('status')->getValue('statusCommentNeeds'), $form->getSubform('status')->getValue('statusNeeds'), $this->session->admin->getId());\n $item->addComment('printer', $form->getSubform('status')->getValue('statusCommentPrinterCost'), $form->getSubform('status')->getValue('statusPrinterCost'), $this->session->admin->getId());\n $item->addComment('website', $form->getSubform('status')->getValue('statusCommentWebsite'), $form->getSubform('status')->getValue('statusWebsite'), $this->session->admin->getId());\n $item->addComment('flyer', $form->getSubform('status')->getValue('statusCommentFlyer'), $form->getSubform('status')->getValue('statusFlyer'), $this->session->admin->getId());\n $item->addComment('terminal', $form->getSubform('status')->getValue('statusCommentTerminal'), $form->getSubform('status')->getValue('statusTerminal'), $this->session->admin->getId());\n\n $this->_redirect('administration_inventory/overview');\n }\n else {\n $this->view->post = $request->getPost();\n $this->error($form->getMessages());\n $this->error(__b(\"Konnte Posten nicht anlegen\"));\n }\n }", "public function store(Request $request)\n {\n \n /* Note: please try improving the code below if possible for production */\n //------------------------------------------------------------------------//\n\n\n //Finding the requested item for the order \n $item = Item::findOrFail( request('item_id') );\n \n //Getting the Quanitiy & customer's name\n $qty = request('qty');\n $customer_name = request('customer_name');\n $total = $item->price * $qty; //Calculating the total\n \n // Checks if the order is already paid for or not\n if(request('paid') == null) $paid=0;\n else $paid = 1;\n\n //getting the first Order line object (if any)\n $first = Order_line::orderBy('id', 'desc')->first();\n \n //Checking whether our table is empty or has record \n if($first == null) $order_line = 1;\n else $order_line = $first->id + 1 ; \n\n //Inserting the new order to the database\n Order::create([\n \"customer_name\" => $customer_name,\n \"price\" => $item->price,\n \"order_lines_id\" => $order_line,\n \"paid\" => $paid\n ]);\n\n //Retrevieng the last order for the order ID\n $order_id = Order::orderBy('id', 'desc')->first()->id;\n\n //Inserting the orderLine\n Order_line::create([\n 'id' => $order_line,\n 'order_id' => $order_id,\n 'item_id' => $item->id,\n 'price' => $total,\n 'qty' => $qty\n ]);\n\n // Returning back to the index page\n return redirect('orders');\n }", "public function save()\n {\n // Quantity is reset to 1 if it's not specified, so make sure it's included\n if (count($this->updatedFields) AND !in_array('Quantity', $this->updatedFields)) {\n $this->updatedFields[] = 'Quantity';\n }\n\n // Need to save custom fields first\n $this->saveCustom();\n parent::save();\n }", "function saveOrder($item) {\n $data = json_encode($item->data);\n $this->db->executeQuery(\"delete from payment_order where itemid = '\" . $item->itemid . \"'\");\n $dt = date('Y-m-d H:i:s');\n $user = db_fetch_array($this->db->executeQuery(\"select * from registration where id = '\" . $item->userid . \"'\"));\n $qry = \"insert into payment_order ( id, orderid, userid, amount, itemid, itemname, itemdescription, payfor, data, paymentway, datetime, auction_id) values(null, '\" . $item->orderid . \"','\" . $item->userid . \"','\" . $item->amount . \"','\" . $item->itemid . \"','\" . addslashes($item->itemname) . \"','\" . addslashes($item->itemdescription) . \"','\" . addslashes($item->payfor) . \"','$data','\" . $item->paymentway . \"','$dt', '\" . $item->itemid . \"')\";\n $this->db->executeQuery($qry);\n\t$this->db->executeQuery(\"CREATE TABLE IF NOT EXISTS `tax_records` ( `id` int(11) NOT NULL auto_increment, `invoiceid` varchar(250) default NULL, `userid` int(20) NOT NULL, `tax` decimal(20, 2) NOT NULL default '0.00', `state` varchar(200) default null, `country` varchar(200) default null, PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;\");\n\t$this->db->executeQuery(\"alter table tax_records add column st_tax decimal(20, 2) not null default '0.00'\");\n\t$this->db->executeQuery(\"insert into tax_records values(null, '\" . $item->orderid . \"','\" . $item->userid . \"', '\" . number_format($item->data->tax1,2) . \"', '$user[delivery_state]', '$user[delivery_country]', '\" . number_format($item->data->tax2,2) . \"')\");\n \t echo db_error();\n }", "public function saveOrder()\n {\n $this->validate();\n $this->_initKlarnaCheckout(false, false);\n\n try {\n if (($merchantCheckboxMethod = $this->_helper->getCheckoutConfig('merchant_checkbox')) != -1) {\n $this->_helper->dispatchMerchantCheckboxMethod(\n $merchantCheckboxMethod, array(\n 'quote' => $this->getQuote(),\n 'klarna_quote' => $this->getKlarnaQuote(),\n 'checked' => (bool)$this->getKlarnaCheckout()->getData('merchant_requested/additional_checkbox')\n )\n );\n }\n\n $checkboxes = $this->getKlarnaCheckout()->getData('merchant_requested/additional_checkboxes');\n if (!empty($checkboxes)) {\n $this->_helper->dispatchMultipleCheckboxesEvent(\n $this->getKlarnaCheckout()->getData('merchant_requested/additional_checkboxes'),\n $this->getQuote(),\n $this->getKlarnaQuote()\n );\n }\n } catch (Mage_Core_Exception $e) {\n Mage::logException($e);\n // Don't stop order from saving just because the checkbox processing failed\n }\n\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n Mage::dispatchEvent(\n 'kco_checkout_save_order_before', array(\n 'checkout' => $this\n )\n );\n\n /**\n * For older versions of Magento state cannot be removed as a requirement\n * for shipping which is necessary in some countries.\n *\n * This checks if the Magento version is below 1.7 and disabled address validation\n */\n if (version_compare(Mage::getVersion(), '1.7.0', '<')) {\n $this->getQuote()->getBillingAddress()->setShouldIgnoreValidation(true);\n if (!$this->getQuote()->isVirtual()) {\n $this->getQuote()->getShippingAddress()->setShouldIgnoreValidation(true);\n }\n }\n\n $service = Mage::getModel('sales/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n /** @var Mage_Sales_Model_Order $order */\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent(\n 'checkout_type_kco_save_order_after', array(\n 'order' => $order,\n 'quote' => $this->getQuote()\n )\n );\n\n if ($order->getCanSendNewEmailFlag()) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession\n ->setLastOrderId($order->getId())\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => array())\n );\n\n return $order;\n }", "public function store(StoreOrderItem $request)\n {\n $reqOrderItem = $request->only([\n 'product_id', 'order_id', 'notes'\n ]);\n $orderItem = OrderItem::create($reqOrderItem);\n return new OrderItemResource($orderItem);\n }", "public function saveTemporaryOrder()\r\n {\r\n $order = Shopware()->Modules()->Order();\r\n\r\n $order->sUserData = $this->View()->sUserData;\r\n $order->sComment = isset($this->session['sComment']) ? $this->session['sComment'] : '';\r\n $order->sBasketData = $this->View()->sBasket;\r\n $order->sAmount = $this->View()->sBasket['sAmount'];\r\n $order->sAmountWithTax = !empty($this->View()->sBasket['AmountWithTaxNumeric']) ? $this->View()->sBasket['AmountWithTaxNumeric'] : $this->View()->sBasket['AmountNumeric'];\r\n $order->sAmountNet = $this->View()->sBasket['AmountNetNumeric'];\r\n $order->sShippingcosts = $this->View()->sBasket['sShippingcosts'];\r\n $order->sShippingcostsNumeric = $this->View()->sBasket['sShippingcostsWithTax'];\r\n $order->sShippingcostsNumericNet = $this->View()->sBasket['sShippingcostsNet'];\r\n $order->bookingId = Shopware()->System()->_POST['sBooking'];\r\n $order->dispatchId = $this->session['sDispatch'];\r\n $order->sNet = $this->View()->sUserData['additional']['show_net'];\r\n\r\n $order->sDeleteTemporaryOrder();\t// Delete previous temporary orders\r\n $order->sCreateTemporaryOrder();\t// Create new temporary order\r\n }", "public function Save($item)\n {\n $item->Save();\n }", "public function store(Request $request)\n {\n $this->validateData($request);\n\n $user = Auth::user();\n $input = $request->all();\n\n $address = $input['district'] .', '. $input['division'] . ', ' . $input['zip_code'];\n\n unset($input['district']);\n unset($input['division']);\n unset($input['zip_code']);\n\n $input['user_id'] = $user['id'];\n $input['books'] = Cart::count();\n $input['bill'] = Cart::total();\n\n $input['address'] = $input['address'] . ', ' . $address;\n\n $order = Order::create($input);\n\n foreach(Cart::content() as $book){\n\n Book::where('id', $book->id)->increment('sales', $book->qty);\n\n OrderItem::create(['order_id' => $order->id, 'book_id' => $book->id, 'quantity' => $book->qty, 'subtotal' => ($book->qty * $book->price)]);\n }\n\n Cart::destroy();\n\n Session::flash('success_order', 'Order Successfull');\n\n return redirect()->route('order-details', [$order->slug])->with(compact('order'));\n }", "public function store(OrderRequest $request)\n\t{\n $order = new Order($request->all());\n $order->tracking_id = mt_rand(100, 999999);\n $order->save();\n\n $this->attachProducts($order, $request);\n\n return redirect()->route('orders.index');\n\t}", "public function save() {\r\n /** probably we should add a timestamp, Item ID and stuff */\r\n $stored_data = json_encode(array($this->name, $this->status), JSON_UNESCAPED_UNICODE);\r\n $this->db_write(\"objects\", \"Item_s11n\", $stored_data);\r\n print ($stored_data);\r\n }", "function saveOrderLineItem($data)\n {\n\n if (!vmAccess::manager('orders.edit')) {\n return false;\n }\n\n $table = $this->getTable('order_items');\n\n //Done in the table already\n VmConfig::importVMPlugins('vmpayment');\n $_dispatcher = JDispatcher::getInstance();\n $_returnValues = $_dispatcher->trigger('plgVmOnUpdateOrderLineShipment', array($data));\n foreach ($_returnValues as $_retVal) {\n if ($_retVal === false) {\n // Stop as soon as the first active plugin returned a failure status\n return;\n }\n }\n\n $_returnValues = $_dispatcher->trigger('plgVmOnUpdateOrderLinePayment', array($data));\n foreach ($_returnValues as $_retVal) {\n if ($_retVal === false) {\n // Stop as soon as the first active plugin returned a failure status\n return;\n }\n }\n $table->bindChecknStore($data);\n return true;\n }", "function setOrderSend($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "function save_sales($office, $sale_id)\n {\n $sale_data = array(\n 'sale_time' => date('Y-m-d', strtotime($this->input->post('date'))),\n 'customer_id' => $this->input->post('customer_id') ? $this->input->post('customer_id') : null,\n 'employee_id' => $this->input->post('employee_id'),\n 'commisioner_id' => $this->input->post('commissioner_id')==''?NULL:$this->input->post('commissioner_id'),\n 'commision_price' => $this->input->post('commissioner_price'),\n 'deposit' => $this->input->post('deposit_price'),\n 'comment' => $this->input->post('comment'),\n 'show_comment_on_receipt' => $this->input->post('show_comment_on_receipt') ? 1 : 0\n );\n \n if ($this->Sale->update($sale_data, $sale_id))\n {\n echo json_encode(array('success'=>true,'message'=>lang('sales_successfully_updated')));\n }\n else\n {\n echo json_encode(array('success'=>false,'message'=>lang('sales_unsuccessfully_updated')));\n }\n }", "public function saveAction()\n {\n $items = $this->getRequest()->getPost('results');\n $action = $this->getRequest()->getPost('action');\n\n $msg = Mage::getModel('barcodescanner/save')->saveProducts($items, $action);\n\n $this->getResponse()->setBody(json_encode($msg));\n }", "public function store(Request $request)\n {\n $first_name = $request->get('first_name');\n $last_name = $request->get('last_name');\n $phone = $request->get('phone');\n $email = $request->get('email');\n $total = $request->get('total');\n $location = $request->get('location');\n $restaurant_id = $request->get('restaurant_id');\n $items = $request->get('items');\n $remarks = $request->get('remarks');\n $delivery_time=$request->get('delivery_time');\n $delivery_fee=$request->get('delivery_fee');\n if (!$remarks) {\n $remarks = \"\";\n }\n $delivery = $request->get('delivery');\n if (!$first_name | !$last_name | !$phone | !$total | !$location | !$restaurant_id | !$items) {\n return Response()->json([\n 'error' => [\n 'message' => \"please provide first_name,last_name,phone,location,total,restaurant_id, and items\"\n ]\n ], 422);\n }\n try {\n $order = Order::create(['first_name' => $first_name, 'last_name' => $last_name, 'phone' => $phone,\n 'email' => $email, 'total' => $total, 'location' => $location, 'delivery' => $delivery, 'remarks' => $remarks,\n 'delivery_time'=>$delivery_time,'delivery_fee'=>$delivery_fee]);\n $restaurant = Restaurant::find($restaurant_id);\n //TODO: attach items;\n $order->items()->attach($items);\n $restaurant->orders()->save($order);\n } catch (Exception $e) {\n return Response()->json([\n 'error' => 'Something went wrong',\n ], 500);\n }\n return Response()->json([\n 'message' => 'Order Created Successfully',\n 'data' => $order\n ], 202);\n }", "public function store(Request $request)\n {\n $items = Item::all();\n\n $stock = new AddStock;\n $stock->nama_sbu = $request->nama_sbu;\n $stock->as_date = $request->as_date;\n $stock->as_number = $request->as_number;\n $stock->description = $request->description;\n $stock->save();\n foreach ($items as $i) {\n $id_item = $i->id;\n $detailStock = new AddStockDetail;\n $detailStock->id_item = $id_item;\n $detailStock->as_number = $request->as_number;\n $detailStock->add_stock = $request->$id_item;\n $detailStock->save();\n }\n return redirect('add-stock');\n }", "function save($order_id = 0) {\n\tif ($order_id) {\n\t $this->order_id = $order_id;\n\t}\n\n\t$this->update_records(\"order_id\");\n\tparent::save();\n }", "public function store(Request $request)\n {\n \n $order = new Order;\n $order->id_Uzsakymas = $request->input('id_Uzsakymas');\n $order->uzsakytos_prekes_pavadinimas = $request->input('uzsakytos_prekes_pavadinimas');\n $order->uzsakymo_kiekis = $request->input('uzsakymo_kiekis');\n $order->uzsakymo_kaina = $request->input('uzsakymo_kaina');\n $order->uzsakymo_suma = $request->input('uzsakymo_suma');\n $order->pristatymo_data = $request->input('pristatymo_data');\n $order->fk_Pirkejasid_Pirkejas = $request->input('fk_Pirkejasid_Pirkejas');\n $order->fk_Sutartisid_Sutartis = $request->input('fk_Sutartisid_Sutartis');\n $order->save();\n\n return redirect('/orders');\n\n }", "public function saveOrder()\n {\n $this->validate();\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n /**\n * @var TM_FireCheckout_Model_Service_Quote\n */\n $service = Mage::getModel('firecheckout/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent('checkout_type_onepage_save_order_after',\n array('order'=>$order, 'quote'=>$this->getQuote()));\n\n /**\n * a flag to set that there will be redirect to third party after confirmation\n * eg: paypal standard ipn\n */\n $redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();\n /**\n * we only want to send to customer about new order when there is no redirect to third party\n */\n $canSendNewEmailFlag = true;\n if (version_compare(Mage::helper('firecheckout')->getMagentoVersion(), '1.5.0.0', '>=')) {\n $canSendNewEmailFlag = $order->getCanSendNewEmailFlag();\n }\n if (!$redirectUrl && $canSendNewEmailFlag) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession->setLastOrderId($order->getId())\n ->setRedirectUrl($redirectUrl)\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n // add recurring profiles information to the session\n $profiles = $service->getRecurringPaymentProfiles();\n if ($profiles) {\n $ids = array();\n foreach ($profiles as $profile) {\n $ids[] = $profile->getId();\n }\n $this->_checkoutSession->setLastRecurringProfileIds($ids);\n // TODO: send recurring profile emails\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles)\n );\n\n return $this;\n }", "public function store(Request $request)\n {\n \n $Sales = $request->Sales;\n foreach ($Sales as $key => $value) {\n $SalesAndDistribution = new SalesAndDistribution;\n $SalesAndDistribution->kodami_product_id = (int) $value[\"product_id\"];\n $SalesAndDistribution->vendor_id = (int) $value[\"vendor_id\"];\n $SalesAndDistribution->price = (int) str_replace(\",\", \"\", $value[\"price\"]);\n $SalesAndDistribution->valid_date = date(\"Y-m-d\", strtotime($value[\"valid_until\"]));\n $SalesAndDistribution->min_order = (int) $value[\"min_order\"];\n\n $SalesAndDistribution->save();\n \n }\n\n return redirect('/salesAndDistribution');\n }", "public function store(Request $request)\n {\n //dd($request->all());\n $this->validate($request,[\n\n 'customer_id'=>'required',\n 'payment_type'=>'required',\n 'subtotal'=>'required',\n 'payment'=>'required'\n ]);\n\n $saleItems = SaleTemp::all();\n //dd($saleItems);\n if(empty($saleItems->toArray())) {\n notify()->error(\"Please Add some Items to create sale!\",\"Error\");\n return back();\n }\n\n $sales = new Sale;\n $sales->customer_id = $request->customer_id;\n $sales->user_id = Auth::user()->id;\n $sales->payment_type = $request->payment_type;\n $discount = $request->discount;\n $discount_percent = $request->discount_percent;\n $subtotal = $request->subtotal;\n $sales->uuid = $this->realUniqId();\n \n\n $total_discount = $discount + ($discount_percent * $subtotal)/100;\n $sales->discount = $total_discount;\n $tax = $sales->tax = ($subtotal*0)/100;\n $total = $sales->grand_total = $subtotal + $tax - $total_discount;\n //insert payment data in the payment table\n $payment = $sales->payment = $request->payment;\n $dues= $sales->dues = $total - $payment;\n if ($dues > 0) {\n $sales->status = 0;\n } else {\n $sales->status = 1;\n }\n $sales->save();\n\n $customer = Customers::findOrFail($sales->customer_id);\n $customer->prev_balance = $customer->prev_balance + $sales->dues;\n $customer->update();\n if ($request->payment > 0) {\n $payment = new SalePayment;\n $paid = $payment->payment = $request->payment;\n $payment->dues = $total - $paid;\n $payment->payment_type = $request->payment;\n $payment->comments = $request->comments;\n $payment->sale_id = $sales->id;\n $payment->user_id = Auth::user()->id;\n $payment->save();\n }\n \n foreach ($saleItems as $value) {\n $saleItemsData = new SaleItem;\n $saleItemsData->sale_id = $sales->id;\n $saleItemsData->uuid = $sales->uuid;\n $saleItemsData->product_id = $value->product_id;\n $saleItemsData->cost_price = $value->cost_price;\n $saleItemsData->selling_price = $value->selling_price;\n $saleItemsData->quantity = $value->quantity;\n $saleItemsData->total_cost = $value->total_cost;\n $saleItemsData->total_selling = $value->total_selling;\n $saleItemsData->save(); \n //process inventory\n $products = Product::find($value->product_id);\n if ($products->type == 1) {\n $inventories = new Inventory;\n $inventories->product_id = $value->product_id;\n $inventories->user_id = Auth::user()->id;\n $inventories->in_out_qty = -($value->quantity);\n $inventories->remarks = 'SALE' . $sales->id;\n $inventories->save();\n //process product quantity\n $products->quantity = $products->quantity - $value->quantity;\n $products->save();\n } \n }\n\n //delete all data on SaleTemp model\n SaleTemp::truncate();\n $itemssale = SaleItem::where('sale_id', $saleItemsData->sale_id)->get();\n // notify()->success(\"You have successfully added sales!\",\"Success\");\n return view('sales.complete')\n ->with('sales', $sales)\n ->with('saleItemsData', $saleItemsData)\n ->with('saleItems', $itemssale);\n }", "public function store(StoreItem $request)\n {\n $item = new Item();\n\n $item = app(ItemService::class)->setItemAttributes($item, $request);\n\n $item->save();\n\n $shops = $request->get('item_shops');\n\n if ( empty($shops) ) {\n if (!$item->is_boss_item) {\n $item->shops()->attach(1);\n }\n }\n else {\n foreach ($shops as $shop_id) {\n $item->shops()->attach($shop_id);\n }\n }\n\n return redirect(route('items.show', ['id' => $item->id]), 201);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'item_id' => 'required|exists:items,id',\n 'sale_id' => 'required|exists:sales,id',\n 'amount' => 'required',\n ]);\n $itemSale = new ItemSale($request->all());\n $itemSale->save();\n flash('Línea creada correctamente');\n return redirect()->route('itemSales.index');\n\n\n\n }", "public function store(Request $request)\n {\n $invoice = new Invoice();\n $invoice->user_id = $request->user()->id;\n $invoice->address = $request->address;\n $invoice->total = $request->total;\n $invoice->save();\n\n foreach($request->products as $product){\n $invoiceDetail = new InvodeDetail();\n $invoiceDetail->invoice_id = $invoice->id;\n $invoiceDetail->product_id = $product['id'];\n $invoiceDetail->qty = $product['qty'];\n $invoiceDetail->amount = $product['amount'];\n $invoiceDetail->save();\n }\n return response()->json(['message' => 'Order Sent','code' => 200]);\n }", "public function save(Request $request)\n {\n $request->validate([\n\t\t\t'order_date' => 'required',\n\t\t\t'order_detail' => 'required',\n\t\t\t'order_type' => 'required',\n\t\t 'customer_id' => 'required',\n\t\t 'total_amount' => 'required',\n\t\t 'advance_amount' => 'required',\n\t\t\t\n\t\t]);\n\t\t$model = new order;\n $model->order_date = $request->post('order_date');\n\t\t$model->order_detail = $request->post('order_detail');\n\t\t$model->order_type = $request->post('order_type');\n\t\t$model->customer_id = $request->post('customer_id');\n $model->total_amount = $request->post('total_amount');\n\t\t$model->advance_amount = $request->post('advance_amount');\n $model->status = 1;\n $model->save();\n\n $request->session()->flash('msg', 'Record Added Successful');\n return redirect('admin/order/list');\n }", "public function save(): void\n {\n $this->session?->put('shop.cart', $this->toArray());\n }", "public function saveOrder(Request $request)\n {\n $the_sales = new sales;\n $id_us = Auth::user()->id;\n $cliva = new Iva;\n $empresa = new Empresaa;\n $e_reliva = $empresa->select()->where('id', '=', 1)->first();\n $e_valiva = $cliva->select()->where('id', '=', $e_reliva->iva_id)->first();\n $e_iv = $e_valiva->iva;\n $e_valor = $e_iv + 100;\n $e_obtnvl = $e_valor / 100;\n\n $total = 0;\n $ivaporcentaje = $e_iv;\n $cart = \\Session::get('cart');\n\n foreach ($cart as $item) {\n $total += $item->pre_ven * $item->cantt;\n }\n\n $sub = $total / $e_obtnvl;\n $iva = $sub - $total;\n\n $iva = str_replace('-', '', $iva);\n\n if ($total > 70) {\n $var = '8';\n $message = 'Su pedido fue realizado con éxito, su factura será enviada a su correo electrónico';\n //guardar en ventas\n } else {\n $var = '1';\n $message = 'Su pedido fue realizado con éxito, por favor espere su aprovación';\n }\n\n\n $date = Carbon::now();\n $date->timezone = new \\DateTimeZone('America/Guayaquil');\n //$date = $date->format('Y/m/d');\n $date = $date->format('d/m/Y');\n $date2 = Carbon::now();\n\n $order = Pedido::create([\n 'subtotal' => $sub,\n 'total' => $total,\n 'iva' => $iva,\n 'entrega' => $request->get('entrega'),\n 'ubiclg' => $request->get('lat'),\n 'ubiclt' => $request->get('long'),\n 'date' => $date,\n 'users_id' => $id_us,\n 'status_id' => $var,\n 'paymethods_id' => $request->get('id'),\n 'porc' => $ivaporcentaje,\n 'created_at' => $date2,\n 'rango' => $date2,\n ]);\n\n\n foreach ($cart as $product) {\n $this->saveOrderItem($product, $order->id);\n }\n\n //ACTUALIZA INVENTARIO\n $this->actualizaInventario($order->id);\n\n if ($var == 8) {\n $factura = $this->generanumerofactura();\n $claveacceso = $this->generaclaveacceso($factura);\n $verificador = $this->generaDigitoModulo11($claveacceso);\n $codigogenerado = $claveacceso . '' . $verificador . '';\n $sale = sales::create(\n [\n 'pedido_id' => $order->id,\n 'numfactura' => $factura,\n 'claveacceso' => $codigogenerado,\n ]);\n //Genera XML\n //$sales = $the_sales->select()->where('claveacceso', '=', $codigogenerado)->first();\n\n if ($generado = $this->generaXml($order->id)) {\n $firmado = $this->firmarXml($codigogenerado); \n } else {\n \\DB::table('sales')->where('pedido_id', $order->id)->update(['gen_xml' => '0']);\n }\n\n }\n $rutai = public_path();\n $ruta = str_replace(\"\\\\\", \"//\", $rutai);\n $rutaPdf = $ruta . \"\\\\archivos\\\\pdf\\\\\";\n\n \\Session::flash('flash_message', $message);\n $empresaa = new Empresaa;\n $dt_empress = $empresaa->select()->first();\n $client = new client;\n $perfil = $client->select()->where('users_id', '=', $id_us)->first();\n $itemCar = new ItemPedido;\n $cartord = $itemCar->select()->where('pedido_id', '=', $order->id)->first();\n $cartord = \\Session::get('cart');\n $cartordaux = $order->select()->where('id', '=', $order->id)->first();\n /*dd($cartordaux);*/\n //$this->revisarXml($codigogenerado)\n //Queue::later(180, $this->retorno($codigogenerado));\n $codigogenerado = '0';\n $this->notificarPedidoAdministrador($order);\n $this->notificarClientePedido($order);\n return view('store.partials.detallsale', compact('order', 'dt_empress', 'perfil', 'cartord', 'cartordaux', 'codigogenerado', 'rutaPdf', 'e_iv'));\n }", "private function saveOrderItems(array $data, int $orderID) :bool\n {\n extract($data);\n\n $query = \"INSERT INTO customer_order_items(\n\t\t\t customer_order_item_count,\n\t\t\t customer_order_item_price,\n\t\t\t customer_order_id,\n\t\t\t product_id\n\t\t\t ) VALUES (\n\t\t\t \t:item_count,\n :product_rate,\n :order_id,\n :product_id\n )\";\n\n if (!$this->query($query, array(\n \"item_count\" => $item_count,\n \"product_rate\" => $product_rate,\n \"order_id\" => $orderID,\n \"product_id\" => $product_id\n ))) {\n $this->logger::warning(\"Query failed while trying to add (INSERT) cart items to order items of order ($orderID) and customer ($customerID)\");\n $this->setError(\"QUERY_FAILED\");\n return false;\n }\n\n return true;\n }", "public function save(Request $request)\n {\n $validData = $this->validate($request, [\n 'boxes' => 'required|integer|max:255',\n 'first_name' => 'required|max:255',\n 'surname' => 'required|max:255',\n 'email' => 'required|email',\n 'address' => 'required|max:255',\n 'city' => 'required|max:255',\n 'postcode' => 'required|max:10',\n ]);\n\n $orderedBox = $this->createOrderService->getOrderedBoxDetails(\n $request->input('boxes')\n );\n\n // use CreateOrder service to dispatch order to the warehouse\n $this->createOrderService->sendOrder(\n $this->createOrderService->formatOrderOutput(\n $request->all(),\n $orderedBox\n )\n );\n\n // store order and order items in the database with Models provided\n $order = new Order();\n $order->fill([\n 'user_id' => Auth::user()->id,\n 'total_cost' => $orderedBox->price\n ]);\n\n $order->save();\n\n $orderItem = new OrderItem();\n $orderItem->fill([\n 'order_id' => $order->id,\n 'box_id' => $orderedBox->id\n ]);\n\n $orderItem->save();\n\n // update box quantity in the database with CreateOrder::updateBoxQuantity()\n $this->createOrderService->updateBoxQuantity(\n $orderedBox->id,\n 1\n );\n\n // display 'thank you' message saying what was ordered\n return view('order-thank-you', [\n 'customerOrder' => $order\n ]);\n }", "public function store(CreateOrderRequest $request)\n {\n $input = $request->all();\n $order = $this->orderRepository->create($input);\n\n Flash::success(__('messages.saved', ['model' => __('models/orders.singular')]));\n\n return redirect(route('orders.index'));\n }", "public function CreatePOS(Request $request)\n {\n $this->authorizeForUser($request->user('api'), 'Sales_pos', Sale::class);\n\n request()->validate([\n 'client_id' => 'required',\n 'warehouse_id' => 'required',\n 'payment.amount' => 'required',\n ]);\n\n $item = \\DB::transaction(function () use ($request) {\n $helpers = new helpers();\n $role = Auth::user()->roles()->first();\n $view_records = Role::findOrFail($role->id)->inRole('record_view');\n $order = new Sale;\n\n $order->is_pos = 1;\n $order->date = Carbon::now();\n $order->Ref = app('App\\Http\\Controllers\\SalesController')->getNumberOrder();\n $order->client_id = $request->client_id;\n $order->warehouse_id = $request->warehouse_id;\n $order->tax_rate = $request->tax_rate;\n $order->TaxNet = $request->TaxNet;\n $order->discount = $request->discount;\n $order->shipping = $request->shipping;\n $order->GrandTotal = $request->GrandTotal;\n $order->statut = 'completed';\n $order->user_id = Auth::user()->id;\n\n $order->save();\n\n $data = $request['details'];\n foreach ($data as $key => $value) {\n\n $unit = Unit::where('id', $value['sale_unit_id'])\n ->first();\n $orderDetails[] = [\n 'date' => Carbon::now(),\n 'sale_id' => $order->id,\n 'sale_unit_id' => $value['sale_unit_id'],\n 'quantity' => $value['quantity'],\n 'product_id' => $value['product_id'],\n 'product_variant_id' => $value['product_variant_id'],\n 'total' => $value['subtotal'],\n 'price' => $value['Unit_price'],\n 'TaxNet' => $value['tax_percent'],\n 'tax_method' => $value['tax_method'],\n 'discount' => $value['discount'],\n 'discount_method' => $value['discount_Method'],\n ];\n\n if ($value['product_variant_id'] !== null) {\n $product_warehouse = product_warehouse::where('warehouse_id', $order->warehouse_id)\n ->where('product_id', $value['product_id'])->where('product_variant_id', $value['product_variant_id'])\n ->first();\n\n if ($unit && $product_warehouse) {\n if ($unit->operator == '/') {\n $product_warehouse->qte -= $value['quantity'] / $unit->operator_value;\n } else {\n $product_warehouse->qte -= $value['quantity'] * $unit->operator_value;\n }\n $product_warehouse->save();\n }\n\n } else {\n $product_warehouse = product_warehouse::where('warehouse_id', $order->warehouse_id)\n ->where('product_id', $value['product_id'])\n ->first();\n if ($unit && $product_warehouse) {\n if ($unit->operator == '/') {\n $product_warehouse->qte -= $value['quantity'] / $unit->operator_value;\n } else {\n $product_warehouse->qte -= $value['quantity'] * $unit->operator_value;\n }\n $product_warehouse->save();\n }\n }\n }\n\n SaleDetail::insert($orderDetails);\n\n $sale = Sale::findOrFail($order->id);\n // Check If User Has Permission view All Records\n if (!$view_records) {\n // Check If User->id === sale->id\n $this->authorizeForUser($request->user('api'), 'check_record', $sale);\n }\n\n try {\n\n $total_paid = $sale->paid_amount + $request['amount'];\n $due = $sale->GrandTotal - $total_paid;\n\n if ($due === 0.0 || $due < 0.0) {\n $payment_statut = 'paid';\n } else if ($due != $sale->GrandTotal) {\n $payment_statut = 'partial';\n } else if ($due == $sale->GrandTotal) {\n $payment_statut = 'unpaid';\n }\n\n if($request['amount'] > 0){\n if ($request->payment['Reglement'] == 'credit card') {\n $Client = Client::whereId($request->client_id)->first();\n Stripe\\Stripe::setApiKey(config('app.STRIPE_SECRET'));\n\n $PaymentWithCreditCard = PaymentWithCreditCard::where('customer_id', $request->client_id)->first();\n if (!$PaymentWithCreditCard) {\n // Create a Customer\n $customer = \\Stripe\\Customer::create([\n 'source' => $request->token,\n 'email' => $Client->email,\n ]);\n\n // Charge the Customer instead of the card:\n $charge = \\Stripe\\Charge::create([\n 'amount' => $request['amount'] * 100,\n 'currency' => 'usd',\n 'customer' => $customer->id,\n ]);\n $PaymentCard['customer_stripe_id'] = $customer->id;\n\n } else {\n $customer_id = $PaymentWithCreditCard->customer_stripe_id;\n $charge = \\Stripe\\Charge::create([\n 'amount' => $request['amount'] * 100,\n 'currency' => 'usd',\n 'customer' => $customer_id,\n ]);\n $PaymentCard['customer_stripe_id'] = $customer_id;\n }\n\n $PaymentSale = new PaymentSale();\n $PaymentSale->sale_id = $order->id;\n $PaymentSale->Ref = app('App\\Http\\Controllers\\PaymentSalesController')->getNumberOrder();\n $PaymentSale->date = Carbon::now();\n $PaymentSale->Reglement = $request->payment['Reglement'];\n $PaymentSale->montant = $request['amount'];\n $PaymentSale->change = $request['change'];\n $PaymentSale->notes = $request->payment['notes'];\n $PaymentSale->user_id = Auth::user()->id;\n $PaymentSale->save();\n\n $sale->update([\n 'paid_amount' => $total_paid,\n 'payment_statut' => $payment_statut,\n ]);\n\n $PaymentCard['customer_id'] = $request->client_id;\n $PaymentCard['payment_id'] = $PaymentSale->id;\n $PaymentCard['charge_id'] = $charge->id;\n PaymentWithCreditCard::create($PaymentCard);\n\n // Paying Method Cash\n } else {\n\n PaymentSale::create([\n 'sale_id' => $order->id,\n 'Ref' => app('App\\Http\\Controllers\\PaymentSalesController')->getNumberOrder(),\n 'date' => Carbon::now(),\n 'Reglement' => $request->payment['Reglement'],\n 'montant' => $request['amount'],\n 'change' => $request['change'],\n 'notes' => $request->payment['notes'],\n 'user_id' => Auth::user()->id,\n ]);\n\n $sale->update([\n 'paid_amount' => $total_paid,\n 'payment_statut' => $payment_statut,\n ]);\n }\n }\n\n } catch (Exception $e) {\n return response()->json(['message' => $e->getMessage()], 500);\n }\n\n return $order->id;\n\n }, 10);\n\n return response()->json(['success' => true, 'id' => $item]);\n\n }", "public function sSaveOrder()\n {\n $this->sComment = stripslashes($this->sComment);\n $this->sComment = stripcslashes($this->sComment);\n\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ?: '0';\n\n if ($this->isTransactionExist($this->bookingId)) {\n return false;\n }\n\n // Insert basic-data of the order\n $orderNumber = $this->sGetOrderNumber();\n $this->sOrderNumber = $orderNumber;\n\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n if ($this->isTaxFree($this->sSYSTEM->sUSERGROUPDATA['tax'], $this->sSYSTEM->sUSERGROUPDATA['id'])) {\n $net = '1';\n } else {\n $net = '0';\n }\n\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n } else {\n $dispatchId = '0';\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n\n $partner = $this->getPartnerCode(\n $this->sUserData['additional']['user']['affiliate']\n );\n\n $ip = Shopware()->Container()->get('shopware.components.privacy.ip_anonymizer')\n ->anonymize(\n (string) Shopware()->Container()->get('request_stack')->getCurrentRequest()->getClientIp()\n );\n\n $orderParams = [\n 'ordernumber' => $orderNumber,\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => (float) $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => (float) $this->sShippingcostsNumericNet,\n 'invoice_shipping_tax_rate' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 0 : $this->sBasketData['sShippingcostsTax'],\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'changed' => new Zend_Db_Expr('NOW()'),\n 'status' => 0,\n 'cleared' => 17,\n 'paymentID' => $this->getPaymentId(),\n 'transactionID' => (string) $this->bookingId,\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $partner,\n 'temporaryID' => (string) $this->uniqueID,\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'remote_addr' => $ip,\n 'deviceType' => $this->deviceType,\n 'is_proportional_calculation' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 1 : 0,\n ];\n\n $orderParams = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterParams',\n $orderParams,\n ['subject' => $this]\n );\n\n try {\n $this->db->beginTransaction();\n $affectedRows = $this->db->insert('s_order', $orderParams);\n $orderID = $this->db->lastInsertId();\n $this->db->commit();\n } catch (Exception $e) {\n $this->db->rollBack();\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s :%s', $_SERVER['HTTP_HOST'], $e->getMessage()),\n 0,\n $e\n );\n }\n\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s : No rows affected or no order id created.', $_SERVER['HTTP_HOST']),\n 0\n );\n }\n\n try {\n $paymentData = Shopware()->Modules()->Admin()\n ->sGetPaymentMeanById($this->getPaymentId(), Shopware()->Modules()->Admin()->sGetUserData());\n $paymentClass = Shopware()->Modules()->Admin()->sInitiatePaymentClass($paymentData);\n if ($paymentClass instanceof \\ShopwarePlugin\\PaymentMethods\\Components\\BasePaymentMethod) {\n $paymentClass->createPaymentInstance(\n $orderID,\n $this->sUserData['additional']['user']['id'],\n $this->getPaymentId()\n );\n }\n } catch (\\Exception $e) {\n //Payment method code failure\n }\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterAttributes',\n $this->orderAttributes,\n [\n 'subject' => $this,\n 'orderID' => $orderID,\n 'orderParams' => $orderParams,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_attributes', $orderID);\n $attributes = $this->attributeLoader->load('s_order_attributes', $orderID);\n unset($attributes['id'], $attributes['orderID']);\n\n $esdOrder = null;\n foreach ($this->sBasketData['content'] as $key => $basketRow) {\n $basketRow = $this->formatBasketRow($basketRow);\n\n $preparedQuery = '\n INSERT INTO s_order_details\n (orderID,\n ordernumber,\n articleID,\n articleordernumber,\n price,\n quantity,\n name,\n status,\n releasedate,\n modus,\n esdarticle,\n taxID,\n tax_rate,\n ean,\n unit,\n pack_unit,\n articleDetailID\n )\n VALUES (%d, %s, %d, %s, %f, %d, %s, %d, %s, %d, %d, %d, %f, %s, %s, %s, %d)\n ';\n\n $sql = sprintf(\n $preparedQuery,\n $orderID,\n $this->db->quote((string) $orderNumber),\n $basketRow['articleID'],\n $this->db->quote((string) $basketRow['ordernumber']),\n $basketRow['priceNumeric'],\n $basketRow['quantity'],\n $this->db->quote((string) $basketRow['articlename']),\n 0,\n $this->db->quote((string) $basketRow['releasedate']),\n $basketRow['modus'],\n $basketRow['esdarticle'],\n $basketRow['taxID'],\n $basketRow['tax_rate'],\n $this->db->quote((string) $basketRow['ean']),\n $this->db->quote((string) $basketRow['itemUnit']),\n $this->db->quote((string) $basketRow['packunit']),\n $basketRow['additional_details']['articleDetailsID']\n );\n\n $sql = $this->eventManager->filter('Shopware_Modules_Order_SaveOrder_FilterDetailsSQL', $sql, [\n 'subject' => $this,\n 'row' => $basketRow,\n 'user' => $this->sUserData,\n 'order' => ['id' => $orderID, 'number' => $orderNumber],\n ]);\n\n // Check for individual voucher - code\n if ($basketRow['modus'] == 2) {\n //reserve the basket voucher for the current user.\n $this->reserveVoucher(\n $basketRow['ordernumber'],\n $this->sUserData['additional']['user']['id'],\n $basketRow['articleID']\n );\n }\n\n if ($basketRow['esdarticle']) {\n $esdOrder = true;\n }\n\n try {\n $this->db->executeUpdate($sql);\n $orderdetailsID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf(\n 'Shopware Order Fatal-Error %s :%s',\n $_SERVER['HTTP_HOST'],\n $e->getMessage()\n ), 0, $e);\n }\n\n $this->sBasketData['content'][$key]['orderDetailId'] = $orderdetailsID;\n\n // Save attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterDetailAttributes',\n $attributeData,\n [\n 'subject' => $this,\n 'basketRow' => $basketRow,\n 'orderdetailsID' => $orderdetailsID,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderdetailsID);\n $detailAttributes = $this->attributeLoader->load('s_order_details_attributes', $orderdetailsID);\n unset($detailAttributes['id'], $detailAttributes['detailID']);\n $this->sBasketData['content'][$key]['attributes'] = $detailAttributes;\n\n // Update sales and stock\n if ($basketRow['priceNumeric'] >= 0) {\n $this->refreshOrderedVariant(\n $basketRow['ordernumber'],\n $basketRow['quantity']\n );\n }\n\n // For esd-products, assign serial number if needed\n // Check if this product is esd-only (check in variants, too -> later)\n if ($basketRow['esdarticle']) {\n $basketRow = $this->handleESDOrder($basketRow, $orderID, $orderdetailsID);\n\n // Add assignedSerials to basketcontent\n if (!empty($basketRow['assignedSerials'])) {\n $this->sBasketData['content'][$key]['serials'] = $basketRow['assignedSerials'];\n }\n }\n } // For every product in basket\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_ProcessDetails', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n ]);\n\n // Save Billing and Shipping-Address to retrace in future\n $this->sSaveBillingAddress($this->sUserData['billingaddress'], $orderID);\n $this->sSaveShippingAddress($this->sUserData['shippingaddress'], $orderID);\n\n $this->sUserData = $this->getUserDataForMail($this->sUserData);\n\n $details = $this->getOrderDetailsForMail(\n $this->sBasketData['content']\n );\n\n $variables = [\n 'sOrderDetails' => $details,\n 'billingaddress' => $this->sUserData['billingaddress'],\n 'shippingaddress' => $this->sUserData['shippingaddress'],\n 'additional' => $this->sUserData['additional'],\n 'sShippingCosts' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sShippingcosts) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmount' => $this->sAmountWithTax ? $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmountWithTax) . ' ' . $this->sBasketData['sCurrencyName'] : $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmount) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNumeric' => $this->sAmountWithTax ? $this->sAmountWithTax : $this->sAmount,\n 'sAmountNet' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sBasketData['AmountNetNumeric']) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNetNumeric' => $this->sBasketData['AmountNetNumeric'],\n 'sTaxRates' => $this->sBasketData['sTaxRates'],\n 'ordernumber' => $orderNumber,\n 'sOrderDay' => date('d.m.Y'),\n 'sOrderTime' => date('H:i'),\n 'sComment' => $this->sComment,\n 'attributes' => $attributes,\n 'sEsd' => $esdOrder,\n ];\n\n if ($dispatchId) {\n $variables['sDispatch'] = $this->sSYSTEM->sMODULES['sAdmin']->sGetPremiumDispatch($dispatchId);\n }\n if ($this->bookingId) {\n $variables['sBookingID'] = $this->bookingId;\n }\n\n // Completed - Garbage basket / temporary - order\n $this->sDeleteTemporaryOrder();\n\n $this->db->executeUpdate(\n 'DELETE FROM s_order_basket WHERE sessionID=?',\n [$this->getSession()->offsetGet('sessionId')]\n );\n\n $confirmMailDeliveryFailed = false;\n try {\n $this->sendMail($variables);\n } catch (\\Exception $e) {\n $confirmMailDeliveryFailed = true;\n $email = $this->sUserData['additional']['user']['email'];\n $this->logOrderMailException($e, $orderNumber, $email);\n }\n\n // Check if voucher is affected\n $this->sTellFriend();\n\n if ($this->getSession()->offsetExists('sOrderVariables')) {\n $variables = $this->getSession()->offsetGet('sOrderVariables');\n $variables['sOrderNumber'] = $orderNumber;\n $variables['confirmMailDeliveryFailed'] = $confirmMailDeliveryFailed;\n $this->getSession()->offsetSet('sOrderVariables', $variables);\n }\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_OrderCreated', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n 'orderNumber' => $orderNumber,\n ]);\n\n return $orderNumber;\n }", "public function store(Request $request)\n {\n $quantities = $request->input('quantity', []);\n $date = now()->toDateString();\n $time = now()->toTimeString();\n $purchaseOrder = PurchaseOrder::create([\n 'supplier_id' => $request->get('supplier_id'),\n \"date\" => $date,\n \"time\" => $time,\n \"status\" => PurchaseOrders::PENDING\n ]);\n foreach ($quantities as $itemId => $quantity) {\n if ($quantity > 0) {\n $purchaseOrder->items()->attach([$itemId => [\"quantity\" => $quantity]]);\n }\n }\n $this->dispatch(new SendPurchaseOrder($purchaseOrder->id));\n return ResponseHelper::createSuccess(\"Purchase Orders\", []);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'customer' => 'required',\n 'total' => 'required',\n 'itemdetail.*' => 'required',\n 'qty.*' => 'required',\n ]);\n\n $order = $this->model->create([\n 'user_id' => auth()->user()->id,\n 'customer' => $request->customer,\n 'total' => $request->total,\n ]);\n\n for ($i = 0; $i < count($request->itemdetail); $i++) {\n $order->orderDetails()->create([\n 'item_detail_id' => $request->itemdetail[$i],\n 'qty' => $request->qty[$i],\n 'sub_total' => $request->subtotal[$i],\n ]);\n $detail = ItemDetail::with('ingredients')->find($request->itemdetail[$i]);\n foreach ($detail->ingredients as $key => $ingredient) {\n $usedIngredient = Ingredient::find($ingredient->id);\n $stock = $ingredient->stock;\n $used = $ingredient->pivot->amount_ingredient * $request->qty[$i];\n $nowStock = $stock - $used;\n $usedIngredient->update(['stock' => $nowStock]);\n // dd($ingredient->stock);\n };\n // dd($detail->ingredients->first()->id);\n };\n\n return redirect($this->redirect);\n }", "public function store(Request $request)\n {\n $purchaseinfo=new PurchaseInfo();\n $purchaseinfo->supplier_id=$request->supplierid;\n $purchaseinfo->payment_type=$request->payment_type;\n //return ($purchaseinfo->payment_type);\n $purchaseinfo->grandtotal=$request->grandtotal;\n\n if($purchaseinfo->save()){\n \n\n $items=$request->itemid;\n $name=$request->name;\n $quan=$request->quan;\n $total=$request->total;\n //$count=0;\n // foreach ($item as $i) {\n // $purchase=new Purchase();\n // $purchase->item_id=$i;\n\n \n\n // $purchase->item_name=$name[$count];\n\n // $purchase->description=$request->description;\n\n // $purchase->quantity=$quan[$count];\n\n // $purchase->total=$total[$count];\n \n // $purchase->save();\n // ++$count;\n // }\n\n \n \n\n for($i=0;$i<count($items);$i++){ \n $purchase = new Purchase();\n $purchase->purchase_id=$purchaseinfo->id;\n $purchase->item_id = $items[$i];\n $purchase->description=$request->description;\n \n $purchase->item_name=$name[$i];\n \n $purchase->pquantity=$quan[$i];\n $purchase->total=$total[$i];\n \n $purchase->save();\n $item=Item::find($items[$i]);\n $item->quantity =$item->quantity+$quan[$i];\n if($item->quantity < $quan[$i] ){\n //stop saling items\n /*return confirm(\"No item to sale\");*/\n //return false;\n }\n $item->save(); \n \n \n }\n }\n\n\n}", "public function store(Request $request)\n {\n $this->validate($request, [\n 'service' => 'required',\n 'issue' => 'required'\n\n ]);\n\n //create Post\n $orders = new Order;\n $orders->user_id = auth()->user()->id;\n $account = Account::find($request->id);\n $orders->account()->associate($account);\n $orders->issue = $request->input('issue');\n $orders->save();\n\n return redirect ('/orders')->with('success', 'Order Created');\n\n\n }", "function saveOrder() {\n\t\t$mainframe = JFactory::getApplication();\n\t\t// Check for request forgeries\n\t\tdefined('_JEXEC') or die('Invalid Token');\n\t\t$db = JFactory::getDBO();\n\t\t$cid = clm_core::$load->request_array_int('cid');\n\t\t$option = clm_core::$load->request_string('option', '');\n\t\t$section = clm_core::$load->request_string('section', '');\n\t\t\t\t\t\t\t\t\n\t\t$total = count($cid);\n\t\t$order = clm_core::$load->request_array_int('order');\n\t\t$row = JTable::getInstance('saisons', 'TableCLM');\n\t\t$groupings = array();\n\t\t// update ordering values\n\t\tfor ($i = 0;$i < $total;$i++) {\n\t\t\t$row->load((int)$cid[$i]);\n\t\t\t// track categories\n\t\t\t//$groupings[] = $row->id;\n\t\t\t$groupings[] = 0;\n\n\t\t\tif ($row->ordering != $order[$i]) {\n\t\t\t\t$row->ordering = $order[$i];\n\t\t\t\tif (!$row->store()) {\n\t\t\t\t\t$this->setMessage($db->getErrorMsg(), 'error');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// execute updateOrder for each parent group\n\t\t$groupings = array_unique($groupings);\n\t\tforeach ($groupings as $group) {\n\t\t\t$row->reorder('id = ' . (int)$group);\n\t\t}\n\t\t$this->setMessage(JText::_('CLM_NEW_ORDERING_SAVED'));\n\t\t$this->setRedirect('index.php?option=' . $option . '&section=' . $section);\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'total' => 'required|min:0',\n 'id_discount' => 'numeric'\n ]);\n $id_order = 'Orders-00001';\n $cek_order = Order::find($id_order);\n if($cek_order){\n $cek_order = Order::select('id')->orderBy('created_at','desc')->first();\n $id_order = $cek_order->id;\n $id_order++;\n }\n\n $order = new Order([\n 'id' => $id_order,\n 'total' => $request->get('total'),\n 'id_discount' => $request->get('id_discount'),\n ]);\n $order->save();\n return new OrderInsertResource($order);\n\n\n }", "public function store(OrderStoreRequest $request)\n {\n $order = new Order();\n $order->fill($request->all());\n $order->products_json = $order->convertProductsJsonToOrder($request->products_json);\n $order->status = 'not paid';\n\n $intent = $order->stripePay();\n $order->payment = $intent->id;\n $order->amount = $request->amount;\n\n $order->save();\n\n return response()->json(['client_key' => $intent->client_secret]);\n }", "public function store(Request $request)\n {\n Salesquote::create($request->all());\n return redirect('/salesquotes')->with('success', 'Salesquote Added!');\n }", "public function store($order)\n\t{\n $part = Request::json('part');\n \n if(!isset($part)){\n return Error::show(1);\n }\n \n $insert = $this->standingOrders->insertItem($part, $order);\n if(isset($insert)){\n return Response::json(array(\n 'message' => $insert\n ));\n }\n else{\n return Error::show(1);\n }\n\t}", "public function store(OrderRequest $request)\n {\n // validate the request\n $validated = $request->validated();\n\n // get the selected items\n $items = $validated['items'];\n\n // create the new order\n $order = Order::create([\n 'table' => $validated['table'],\n ]);\n\n // attach items\n foreach ($items as $item) {\n $order->items()->attach($item['id'], [\n 'amount' => $item['amount'],\n 'notes' => $item['notes'] ?? null,\n ]);\n }\n\n return new OrderResource(Order::with('items')->findOrFail($order->id));\n }", "public function store(Requests\\StoreItemRequest $request)\n {\n // $input = $request->all();\n // dd($input);\n // $item = new Item;\n // $item->name = $input['name'];\n // $item->unit = $input['unit'];\n // $item->description = $input['description'];\n // $item->save();\n \t\tItem::create($request->all());\n return redirect()->route('items.index')\n \t\t\t\t\t\t\t\t ->with('success', 'Item created successfully.');\n }", "public function store(StoreOrder $request)\n {\n $params = $request->all();\n $order = $this->orderService->create($params);\n\n return json_encode($order);\n }", "public function store(Request $request)\n {\n {\n $client = Member::find($request->client);\n $divisi = [];\n $sales = [\n 'name' => $client['sales'][0]['name'],\n 'detail' => $client['sales'][0]['detail'][count($client['sales'][0]['detail']) - 1],\n ];\n\n if (isset($request->divisi)) {\n $get_divisi = $client['divisi'][(int)$request->divisi];\n $get_divisi['index'] = (int)$request->divisi;\n $divisi = [\n $get_divisi,\n ];\n $sales = [\n '_id' => $client['divisi'][(int) $request->divisi]['sales'][0]['_id'],\n 'name' => $client['divisi'][(int) $request->divisi]['sales'][0]['name'],\n 'detail' => $client['divisi'][(int) $request->divisi]['sales'][0]['detail'][0],\n ];\n }\n\n $so = new SalesOrder();\n $so->code = $this->generateSO();\n $so->client = [\n $client->toArray(),\n ];\n $so->sales = [$sales];\n $so->divisi = $divisi;\n $so->billing = $request->billing;\n $so->shipping = $client['shipping_address'][(int) $request->shipping]['address'];\n $so->TOP = $request->TOP;\n\n if ($request->whiteLabel == ''){\n $so->white_label = 'Tidak';\n }else{\n $so->white_label = 'Ya';\n }\n\n $deliverys=Carriers::where('_id', $request->delivery)->get();\n $so->delivery = $deliverys->toArray();\n\n if ($request->packkayu == '') {\n $so->pack_kayu = 'Tidak';\n }else{\n $so->pack_kayu = 'Ya';\n /*$so->pack_kayu = $request->packkayu;*/\n }\n\n $so->notes = $request->notes;\n $arrProduct = [];\n $total_kg = 0;\n $total_realisasi = 0;\n foreach ($request->arrProduct as $key) {\n $product = Product::find($request->input('product' . $key));\n $total_kg = $total_kg + (((double) $request->input('total' . $key)) * 1000);\n $total_realisasi = $total_realisasi + (((double) $request->input('realisasi' . $key)) * 1000);\n $arrProduct[] = [\n \"product_id\" => $product['_id'],\n \"name\" => $product['name'] . \" - \" . $product['type'],\n \"product_detail\" => [$product->toArray()],\n \"package\" => $request->input('package' . $key),\n \"quantity\" => $request->input('quantity' . $key),\n \"weight\" => (double) $request->input('weight' . $key),\n \"total\" => ((double) $request->input('total' . $key)) * 1000,\n \"realisasi\" => ((double) $request->input('realisasi' . $key)) * 1000,\n \"tunggu\" => null,\n \"petugas_produksi\" => null,\n \"petugas_qc\" => null,\n \"status_produksi\" => null,\n \"mulai_proses\"=>null,\n \"selesai_proses\"=>null,\n \"tgl_pass\"=>null,\n \"tgl_reject\"=>null,\n \"note_reject\"=>null\n ];\n }\n $so->products = $arrProduct;\n $so->total_product = count($request->arrProduct);\n $so->total_kg = $total_kg;\n $so->total_realisasi = $total_realisasi;\n\n /*$checks=user::where('_id', $request->check)->get();\n $so->check=$checks->toArray();\n\n $produksis=user::where('_id', $request->produksi)->get();\n $so->produksi=$produksis->toArray();*/\n\n $so->status = \"order\";\n\n $so->save();\n\n if($request->targetUrl){\n return redirect('/')->with('toastr', 'order');\n }else{\n return redirect()->route('sales-order.index')->with('toastr', 'order');\n }\n\n /*return dd($so);*/\n }\n }", "public function store(Request $request)\n {\n $supplierorders = new Orders($request->all());\n $supplierorders -> order_date = now();\n $supplierorders -> order_arrive = $request -> order_limit_date;\n $supplierorders -> status = $request -> order_status;\n $supplierorders -> supplier_id = $request -> supplier;\n $supplierorders -> matrix_house_id = $request -> matrix_house;\n\n //dd($supplierorders);\n $supplierorders ->save();\n //dd('Orden creada');\n return redirect()->route('supplierorder.index');\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Order::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tOrder::create($data);\n\n\t\treturn Redirect::route('admin.orders.index');\n\t}", "public function store(StoreOrderRequest $request)\n {\n //Input received from the request\n $input = $request->except(['_token']);\n //Create the model using repository create method\n $this->repository->create($input);\n //return with successfull message\n return redirect()->route('admin.orders.index')->withFlashSuccess(trans('alerts.backend.orders.created'));\n }", "public function save() {\n $page = 'basket';\n $newbasket = $_POST;\n\n for($i = 0; $i<sizeof($newbasket['id']); $i++) {\n if ($newbasket['quantity'][$i] <= 0)\n unset($_SESSION['user']['basket'][$newbasket['id'][$i]]);\n else\n $_SESSION['user']['basket'][$newbasket['id'][$i]]['quantity'] = $newbasket['quantity'][$i];\n }\n\n //if the user wants to pay\n if($_POST['pay']) {\n $this->pay();\n header(\"Location: ./index.php?ctrl=basket&action=pay\");\n }\n else\n header(\"Location: ./index.php?ctrl=basket&action=consult\");\n\n require('./View/default.php');\n }", "public function addOrderedItemsToStock($order)\r\n {\r\n \t$nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\r\n \t$isCustomStockManagementEnabled = Mage::getModel('paymentsensegateway/direct')->getConfigData('customstockmanagementenabled');\r\n\t\t\r\n \tif($nVersion >= 1410 &&\r\n \t\t$isCustomStockManagementEnabled)\r\n \t{\r\n\t \t$items = $order->getAllItems();\r\n\t\t\tforeach ($items as $itemId => $item)\r\n\t\t\t{\r\n\t\t\t\t// ordered quantity of the item from stock\r\n\t\t\t\t$quantity = $item->getQtyOrdered();\r\n\t\t\t\t$productId = $item->getProductId();\r\n\t\t\t\t\r\n\t\t\t\t$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\r\n\t\t\t\t$stockManagement = $stock->getManageStock();\r\n\t\t\t\t\r\n\t\t\t\tif($stockManagement)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stock->setQty($stock->getQty() + $quantity);\r\n\t\t\t\t\t$stock->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t}\r\n }", "public function store(Request $request)\n {\n $order = Auth::user()->orders()->create($request->except('catalogue') + [\n 'ordNo' => uniqid('ord-'),\n 'status' => 'pending'\n ]);\n\n $order->catalogue()->attach(array_reduce(\n explode(',', $request->catalogue), function ($carry, $next) {\n list($id, $quantity) = explode(':', $next);\n return $carry + [intval($id) => ['quantity' => $quantity]];\n },\n []\n ));\n\n Mail::to(config('mail.admin.address'))->send(new NewOrderMail($order));\n\n return redirect()->route('customer.order.show', $order);\n }", "private function storePurchaseOrder() {\n return $this->json('POST', 'api/pch_purchase_order', $this->tempJson);\n }", "public function store(OrderRequest $request, Order $model)\n {\n $user = Auth::user();\n\n $product = Product::find(request()->product_id);\n $order = new Order();\n $order['product_id'] = $product->id;\n $order['sku'] = $product->sku;\n $order['order_date'] = date('Y-m-d');\n $order['quantity'] = request()->selected_quantity;\n $totalQtys = request()->selected_quantity;\n $total_seller_qty = 0;\n $total_buyer_qty = 0;\n for($i=0; $i < $totalQtys; $i++){\n $total_seller_qty += $product->selling_price;\n $total_buyer_qty += $product->buying_price;\n }\n $order['price'] = $total_seller_qty;\n $order['profit'] = $total_seller_qty - $total_buyer_qty;\n $order['user_id'] = $user->id;\n \n $order->save(); \n \n return redirect()\n ->route('orders.create')\n ->withStatus('Order successfully Added.');\n }" ]
[ "0.7077204", "0.7058806", "0.70355624", "0.7013302", "0.7002516", "0.69565934", "0.6924895", "0.6820649", "0.6781784", "0.67737675", "0.66718173", "0.66254985", "0.66124856", "0.6605389", "0.6587599", "0.655393", "0.65169644", "0.6491994", "0.64840305", "0.6481085", "0.64481634", "0.64212984", "0.64109415", "0.63924295", "0.6360084", "0.6351761", "0.6338074", "0.6322558", "0.63144827", "0.62996924", "0.6296779", "0.62915754", "0.627724", "0.62771314", "0.6272815", "0.62719244", "0.62496865", "0.6216776", "0.6205117", "0.6199519", "0.61840934", "0.6172526", "0.6165664", "0.61624306", "0.61426777", "0.6124763", "0.61220294", "0.6116122", "0.6116032", "0.6109197", "0.61065525", "0.6098832", "0.60947865", "0.60916936", "0.6079012", "0.6078383", "0.6062421", "0.6055244", "0.60547197", "0.60478085", "0.6046868", "0.6045888", "0.60308856", "0.6029743", "0.6022975", "0.60190755", "0.6016159", "0.60112727", "0.6006713", "0.60057855", "0.60048264", "0.60010314", "0.60001236", "0.59993166", "0.5994516", "0.59858346", "0.5981874", "0.59806347", "0.598004", "0.5971239", "0.59654146", "0.59626496", "0.59600323", "0.59558195", "0.595092", "0.5945664", "0.5941606", "0.59319323", "0.59296125", "0.5927482", "0.59260434", "0.5925215", "0.59251887", "0.59208786", "0.5917885", "0.59120274", "0.5896452", "0.5895339", "0.5893306", "0.58918667", "0.5885936" ]
0.0
-1
Get part information. Can be search by either PartNum or UPC
public function getPart($partNum, $upc) { // Setup xml $xml = "<PartGetRq>\n"; if (!is_null($partNum)) { $xml .= "<Number>{$partNum}</Number>\n"; } else { $xml .= "<Number>{$upc}</Number>\n"; } $xml .= "</PartGetRq>\n"; // Create request and pack $this->createRequest($xml); $len = strlen($this->xmlRequest); $packed = pack("N", $len); // Send and get the response fwrite($this->id, $packed, 4); fwrite($this->id, $this->xmlRequest); $this->getResponse(); // Set the result $this->setResult($this->parseXML($this->xmlResponse)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_available_parts($part_id, $version) {\n // Database connection \n $conn = database_connection();\n\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND SERIAL_NUMBER LIKE '%\" . $version . \"%' AND IS_RECORD_DELETED = 'F' AND PART_ID not in (select PART_ID from CMS_GEM_CORE_CONSTRUCT.PHYSICAL_PARTS_TREE) ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\"; //select data or insert data \n\n\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_arr = array();\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n echo '<li><a href=\"#\" class=\"availablepart\" >' . $row['SERIAL_NUMBER'] . '</a></li>';\n\n// $temp['man_id']= $row['MANUFACTURER_ID'];\n// $temp['man_name']= $row['MANUFACTURER_NAME'];\n// $result_arr[] = $temp;\n }\n return 1;\n}", "abstract public function get($part = null);", "public function show_part()\n {\n $input = JFactory::getApplication()->input;\n\n $group = $input->get('group');\n $part = $input->get('part');\n $element = $input->get('element');\n $scope = $input->get('scope');\n\n $ecrPart = EcrProjectHelper::getPart($group, $part, $element, $scope);\n\n if( ! $ecrPart)\n {\n return;\n }\n\n if(method_exists($ecrPart, 'info'))\n {\n $info = $ecrPart->info();\n\n if( ! get_class($info) == 'EcrProjectPart')\n {\n echo 'Part info must be a EcrProjectPart class.. not : ';\n echo get_class($info);\n\n return;\n }\n\n echo $info->format('erm', 'add');\n }\n else\n {\n echo '<div style=\"color: blue; font-weight: bold; text-align:center;\">'\n .ucfirst($group).' - '.ucfirst($part)\n .'</div>';\n }\n\n //-- Additional request vars\n echo '<input type=\"hidden\" name=\"group\" value=\"'.$group.'\" />';\n echo '<input type=\"hidden\" name=\"part\" value=\"'.$part.'\" />';\n\n //-- Additional options from part file\n echo $ecrPart->getOptions();\n }", "private function get_data( $part = '' ) {\n\n\t\t$basic = array(\n\t\t\t'id' => $this->id,\n\t\t\t'type' => $this->report_type,\n\t\t\t'recipient' => $this->recipient_id,\n\t\t);\n\t\t$fields = array_merge( $basic, (array) $this->comment, (array) $this->meta );\n\n\t\tif ( empty( $part ) )\n\t\t\treturn $fields;\n\t\telseif ( isset( $fields[ $part ] ) )\n\t\t\treturn $fields[ $part ];\n\t}", "private function get($part)\n {\n return $this->parts[$part];\n }", "public function getVendorPartNumber(): string\n {\n return $this->vendorPartNumber;\n }", "function get_available_parts_nohtml_noversion($part_id) {\n // Database connection \n $conn = database_connection();\n\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND IS_RECORD_DELETED = 'F' AND PART_ID not in (select PART_ID from CMS_GEM_CORE_CONSTRUCT.PHYSICAL_PARTS_TREE) ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\"; //select data or insert data \n\n\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_arr = array();\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n// echo '<li><a href=\"#\" class=\"availablepart\" >' . $row['SERIAL_NUMBER'] . '</a></li>';\n\n $temp['SERIAL_NUMBER'] = $row['SERIAL_NUMBER'];\n $result_arr[] = $temp;\n }\n return $result_arr;\n}", "private function getPart($part)\n {\n $result = null;\n\n $array_part = preg_replace('/.*\\[(.*)\\]/', '$1', $part);\n $filters = explode('|',$array_part);\n $array_part = $filters[0]; // Temporary fix for future filters, now only first row will be returned\n\n $part = preg_replace('/\\[.*\\]/', '', $part);\n\n if (is_object($this->result) && property_exists($this->result, $part)) {\n if (preg_match('/\\=/', $array_part)) {\n list($name, $value) = explode('=', $array_part);\n foreach ($this->result->$part as $key => $item) {\n $d = self::load($item);\n if ($d->get($name) == $value) {\n $result = $item;\n break;\n }\n }\n } elseif ($array_part != $part && is_array($this->result->$part)) {\n if (ctype_digit($array_part)) {\n $array = $this->result->$part; // 5.6 compatibility issue\n $result = $array[$array_part];\n }\n } else {\n $result = $this->result->$part;\n }\n }\n return $result;\n }", "public function getExtraAvailParts($sender, $param)\n\t{\n\t\t$html = \"No parts found!\";\n\t\ttry{\n\t\t\tif(!isset($param->CallbackParameter->selectedIds) || (($selectedId = $param->CallbackParameter->selectedIds) == '') )\n\t\t\t\tthrow new Exception(\"Please select a request first!\");\n\n\t\t\t$request = Factory::service(\"FacilityRequest\")->get($selectedId);\n\t\t\tif(!$request instanceof FacilityRequest)\n\t\t\t\tthrow new Exception(\"Invalid facility request id provided(={$selectedId})!\");\n\n\n\t\t\t$partType = $request->getPartType();\n\t\t\t$hotMessage = $partType->getAlias(PartTypeAliasType::ID_HOT_MESSAGE);\n\n\t\t\t$goodParts = 1;\n\t\t\tif(isset($param->CallbackParameter->goodParts))\n\t\t\t{\n\t\t\t\t$goodParts = $param->CallbackParameter->goodParts;\n\t\t\t}\n\n\t\t\t$compatibleParts = false;\n\t\t\tif(isset($param->CallbackParameter->compatibleParts))\n\t\t\t{\n\t\t\t\t$compatibleParts = $param->CallbackParameter->compatibleParts;\n\t\t\t}\n\t\t\t$result = $this->_getAvailableParts($request->getPartType()->getId(), false, $goodParts, $compatibleParts);\n\n\t\t\t$html = \"<table class='ResultDataList'>\";\n\t\t\tif($hotMessage)\n\t\t\t{\n\t\t\t\t$html .= \"<tr><td>\". PartTypeLogic::showHotMessageDetail($hotMessage, '', false, false) . \"</td></tr>\";\n\t\t\t}\n\n\t\t\t$html .= \"<tr>\";\n\t\t\tif($compatibleParts)\n\t\t\t\t$html .= \"<td><a href='javascript: void(0);' onClick='pageJs.viewAvailList(\\\"\" . $selectedId . \"\\\", \\\"\" . $this->showAvailListBtn->getUniqueID() . \"\\\", \\\"\" . $goodParts . \"\\\", true)'>View Compatible Parts from \" . $this->_ownerWarehouse->getName() . \"</a></td>\";\n\t\t\telse\n\t\t\t\t$html .= \"<td><a href='javascript: void(0);' onClick='pageJs.viewAvailList(\\\"\" . $selectedId . \"\\\", \\\"\" . $this->showAvailListBtn->getUniqueID() . \"\\\", \\\"\" . $goodParts . \"\\\", false)'>View Parts from \" . $this->_ownerWarehouse->getName() . \"</a></td>\";\n\n\t\t\t$html .= \"<td style='float:right'><input type='image' src='/themes/images/mail.gif' onclick='return pageJs.email(\\\"\" . $selectedId . \"\\\", \\\"\" . $this->showEmailPanelBtn->getUniqueID() . \"\\\", this);' title='Send an email'/></td>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"<table>\";\n\n\t\t\tif($compatibleParts)\n\t\t\t\t$html .= PartTypeLogic::showCompatiblePartTypeDetail($partType);\n\t\t\telse\n\t\t\t\t$html .= \"<div><br><b>Part Details : </b>\".$partType->getAlias().\" - \".$partType->getName().\"</div><br>\";\n\n\t\t\tif(count($result)=== 0)\n\t\t\t{\n\t\t\t\t$html .= \"<br><b style='color:red'>No parts found!</b>\";\n\t\t\t\t$this->responseLabel->Text = $html;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$html .= \"<table class='ResultDataList'>\";\n\t\t\t$html .= \"<thead>\";\n\t\t\t$html .= \"<tr>\";\n\t\t\t$html .= \"<th>Warehouse</th>\";\n\t\t\tif($compatibleParts){$html .= \"<th>PartCode</th>\";}\n\t\t\t$html .= \"<th>Status</th>\";\n\t\t\t$html .= \"<th>Qty</th>\";\n\t\t\t$html .= \"<th>Reserved For</th>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"</thead>\";\n\t\t\t$html .= \"<tbody>\";\n\t\t\t$rowNo =0;\n\t\t\t$total = 0;\n\t\t\t$previousState = \"\";\n\t\t\tforeach($result as $r)\n\t\t\t{\n\t\t\t\tif(!($warehouse = Factory::service(\"Warehouse\")->get($r['warehouseId'])) instanceof Warehouse)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif($previousState==\"\" || $previousState!= $r['stateName'])\n\t\t\t\t{\n\t\t\t\t\t$colspan=($compatibleParts?'5':'4');\n\t\t\t\t\t$html .= \"<tr><td colspan=\".$colspan.\" style='color:white;background:black'><b>\" . $r['stateName'] . \"</b></td></tr>\";\n\t\t\t\t}\n\n\t\t\t\t$warehouseName = $warehouse;\n\t\t\t\t$index = strpos ($warehouse, \"|\");\n\t\t\t\tif($index > 0)\n\t\t\t\t{\n\t\t\t\t\t$warehouseName = substr($warehouse , 0, $index);\n\t\t\t\t}\n\n\t\t\t\t$html .= \"<tr class='\" . ($rowNo++ % 2 === 0 ? \"ResultDataListItem\" : \"ResultDataListAlterItem\") . \"' >\";\n\t\t\t\t$html .= \"<td>\" . $warehouseName . \"</td>\";\n\t\t\t\tif($compatibleParts)\n\t\t\t\t{\n\t\t\t\t\t$partcode = Factory::service('PartType')->get($r['partTypeId'])->getAlias();\n\t\t\t\t\t$html .= \"<td>\".$partcode.\"</td>\";\n\t\t\t\t}\n\n\t\t\t\t$html .= \"<td>{$r['status']}</td>\";\n\t\t\t\t$html .= \"<td>{$r['qty']}</td>\";\n\t\t\t\t$html .= \"<td>{$r['fieldTaskId']}</td>\";\n\t\t\t\t$html .= \"</tr>\";\n\t\t\t\t$total +=$r['qty'];\n\t\t\t\t$previousState = $r['stateName'];\n\t\t\t}\n\t\t\t$html .= \"</tbody>\";\n\t\t\t$html .= \"<tfoot>\";\n\t\t\t$html .= \"<tr>\";\n\t\t\t$html .= \"<td>Total</td>\";\n\t\t\t$html .= \"<td>&nbsp;</td>\";\n\t\t\tif($compatibleParts){$html .= \"<td>&nbsp;</td>\";}\n\t\t\t$html .= \"<td>$total</td>\";\n\t\t\t$html .= \"<td>&nbsp;</td>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"</tfoot>\";\n\t\t\t$html .= \"</table>\";\n\t\t}\n\t\tcatch(Exception $ex)\n\t\t{\n\t\t\t$html = $this->_getErrorMsg($ex->getMessage());\n\t\t}\n\n\t\t$this->responseLabel->Text = $html;\n\t}", "function get_part_ID($part_id, $version = NULL) {\n\n // Database connection \n $conn = database_connection();\n\n //Query string\n if ($version == NULL) {\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $part_id . \"' ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc \"; //select data or insert data\n } else {\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND SERIAL_NUMBER LIKE '%\" . $version . \"%' ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\"; //select data or insert data \n }\n // Execute query \n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_rec = 0;\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n\n foreach ($row as $item) {\n //echo \"<li>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \"&nbsp;\") . \"</li>\";\n if ($item !== null)\n $result_rec = $item;\n }\n }\n if ($result_rec !== 0) {\n //echo $result_rec ;\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE SERIAL_NUMBER='\" . $result_rec . \"'\"; //select data or insert data\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_rec = 0;\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n\n foreach ($row as $item) {\n //echo \"<li>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \"&nbsp;\") . \"</li>\";\n if ($item !== null)\n return $item;\n }\n }\n }\n else {\n return 0;\n }\n}", "public function getPostcodePart($part = IAddress::POSTCODE_PART_ONE);", "abstract public function __get($part);", "function get_available_parts_nohtml($part_id, $version) {\n global $ROOT_PART_ID;\n // Database connection \n $conn = database_connection();\n\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND SERIAL_NUMBER LIKE '%\" . $version . \"%' AND PART_ID not in (select PART_ID from CMS_GEM_CORE_CONSTRUCT.PHYSICAL_PARTS_TREE WHERE PART_PARENT_ID != '\".$ROOT_PART_ID.\"') ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\"; //select data or insert data \n\n\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_arr = array();\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n// echo '<li><a href=\"#\" class=\"availablepart\" >' . $row['SERIAL_NUMBER'] . '</a></li>';\n\n $temp['SERIAL_NUMBER'] = $row['SERIAL_NUMBER'];\n $result_arr[] = $temp;\n }\n return $result_arr;\n}", "function get_part_by_ID($part_id) {\n\n // Database connection \n $conn = database_connection();\n\n $sql = \"SELECT PART_ID,SERIAL_NUMBER,NAME_LABEL,BARCODE,RECORD_INSERTION_USER, COMMENT_DESCRIPTION,RECORD_INSERTION_TIME,MANUFACTURER_ID, LOCATION_ID FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE SERIAL_NUMBER='\" . $part_id . \"'\"; //select data or insert data\n // Execute query \n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result = array();\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n $result[] = $row;\n }\n\n if (!empty($result[0]['LOCATION_ID'])) {\n $sql1 = \"SELECT LOCATION_NAME FROM CMS_GEM_CORE_MANAGEMNT.LOCATIONS WHERE LOCATION_ID ='\" . $result[0]['LOCATION_ID'] . \"'\";\n $query1 = oci_parse($conn, $sql1);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr1 = oci_execute($query1);\n\n while ($row = oci_fetch_array($query1, OCI_ASSOC + OCI_RETURN_NULLS)) {\n\n $result[0]['LOCATION_ID'] = $row['LOCATION_NAME'];\n }\n }\n if (!empty($result[0]['MANUFACTURER_ID'])) {\n $sql2 = \"SELECT MANUFACTURER_NAME FROM CMS_GEM_CORE_CONSTRUCT.MANUFACTURERS WHERE MANUFACTURER_ID ='\" . $result[0]['MANUFACTURER_ID'] . \"'\";\n $query2 = oci_parse($conn, $sql2);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr2 = oci_execute($query2);\n while ($row = oci_fetch_array($query2, OCI_ASSOC + OCI_RETURN_NULLS)) {\n\n $result[0]['MANUFACTURER_ID'] = $row['MANUFACTURER_NAME'];\n }\n }\n\n //print_r($result);\n return $result;\n}", "public function findInventoryByPart($partno) {\n\n $query = $this->getEntityManager()\n ->createQuery('\n SELECT\n s.rackno, s.diecode, s.heatcode, s.inqty, s.onhold,\n m.dano, m.partno, m.batchno, m.indate,\n l.shipdate\n FROM\n CIRBundle:SumitomoSub s\n JOIN\n s.main m\n JOIN\n s.log l\n WHERE\n m.partno = :partno\n ')->setParameter('partno', $partno);\n\n try {\n return $query->getResult();\n } catch(\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n }\n }", "public function partvsmotor_get(){\n $param = array();\n \n if($this->get(\"part_number\")){\n $param[\"PART_NUMBER\"] = $this->get(\"part_number\");\n }\n if($this->get(\"kd_typemotor\")){\n $param[\"KD_TYPEMOTOR\"] = $this->get(\"kd_typemotor\");\n }\n if($this->get(\"part_deskripsi\")){\n $param[\"PART_DESKRIPSI\"] = $this->get(\"part_deskripsi\");\n }\n $search=\"\";\n if($this->get(\"keyword\")){\n $param=array();\n $search=array(\n \"PART_NUMBER\" => $this->get(\"keyword\"),\n \"PART_DESKRIPSI\" => $this->get(\"keyword\")\n );\n }\n $this->Main_model->set_search_criteria($search);\n $this->Main_model->set_statusdata($this->get('row_status'));\n $custom=\"\";\n if($this->get(\"custom\")){\n $this->Main_model->set_customcriteria($this->get(\"custom\"));\n }\n $this->Main_model->set_orderby($this->get(\"orderby\"));\n $this->Main_model->set_groupby($this->get(\"groupby\"));\n $this->Main_model->set_groupby_text($this->get(\"groupby_text\"));\n $this->Main_model->set_selectfield($this->get('field'));\n $this->Main_model->set_offset($this->get(\"offset\"));\n $this->Main_model->set_recordlimit($this->get(\"limit\"));\n $this->Main_model->set_jointable($this->get(\"jointable\"));\n\n $this->resultdata(\"PART_VS_TYPEMOTOR\",$param);\n }", "private static function getPart($connection, $messageNumber, $partNumber, $encoding) {\n \t\n \t$data = imap_fetchbody($connection, $messageNumber, $partNumber);\n\n \tswitch($encoding) {\n \t\tcase 0: return $data; // QUOTED_PRINTABLE\n \t\tcase 1: return quoted_printable_decode($data); // 8BIT\n \t\tcase 2: return self::decodeBinary ($data); // BINARY\n \t\tcase 3: return base64_decode($data); // BASE64\n \t\tcase 4: return quoted_printable_decode($data); // QUOTED_PRINTABLE\n \t\tcase 5: return $data; // OTHER\n \t}\n \t\n \t\n }", "function get_attached_parts($part_id) {\n\n global $VFAT2_TO_GEB;\n global $OPTOHYBRID_TO_GEB;\n global $GEB_TO_READOUT;\n global $READOUT_TO_CHAMBER;\n global $FRAME_TO_CHAMBER;\n global $DRIFT_TO_CHAMBER;\n global $FOIL_TO_CHAMBER;\n global $CHAMBER_KIND_OF_PART_NAME;\n global $DRIFT_KIND_OF_PART_NAME;\n global $FOIL_KIND_OF_PART_NAME;\n global $READOUT_KIND_OF_PART_NAME;\n global $FRAME_KIND_OF_PART_NAME;\n global $VFAT_KIND_OF_PART_NAME;\n global $OPTOHYBRID_KIND_OF_PART_NAME;\n global $GEB_KIND_OF_PART_NAME;\n global $CHAMBER_TO_SUPER_CHAMBER;\n\n // Database connection \n $conn = database_connection();\n\n $sql = \"select PART_ID, RELATIONSHIP_ID from CMS_GEM_CORE_CONSTRUCT.PHYSICAL_PARTS_TREE where PART_PARENT_ID='\" . $part_id . \"' AND IS_RECORD_DELETED = 'F'\"; //select data or insert data \n\n\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_arr = array();\n\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n\n // foil -> chamber\n if ($row['RELATIONSHIP_ID'] === $FOIL_TO_CHAMBER) {\n $serialarr = getSerialById($row['PART_ID']);\n $serial = $serialarr[0]['SERIAL_NUMBER'];\n echo '<li class=\"list-group-item\" style=\"white-space:nowrap\"><label> GEM Foil:</label> <a href=\"show_gem.php?id=' . $serial . '\">' . $serial . '</a> <a style=\"color: red; padding-left:4em \" href=\"javascript:void(0);\" class=\"detach\" id=\"' . $serial . '\" kind=\"' . $FOIL_KIND_OF_PART_NAME . '\"><span aria-hidden=\"true\" class=\"glyphicon glyphicon-resize-full\"></span> Detach <span aria-hidden=\"true\" class=\"glyphicon glyphicon-remove\"></span></a> </li>';\n }\n // Drift -> chamber\n else if ($row['RELATIONSHIP_ID'] === $DRIFT_TO_CHAMBER) {\n $serialarr = getSerialById($row['PART_ID']);\n $serial = $serialarr[0]['SERIAL_NUMBER'];\n echo '<li class=\"list-group-item\" style=\"white-space:nowrap\"><label> Drift:</label> <a href=\"show_drift.php?id=' . $serial . '\">' . $serial . '</a> <a style=\"color: red; padding-left:4em \" href=\"javascript:void(0);\" class=\"detach\" id=\"' . $serial . '\" kind=\"' . $DRIFT_KIND_OF_PART_NAME . '\"><span aria-hidden=\"true\" class=\"glyphicon glyphicon-resize-full\"></span> Detach <span aria-hidden=\"true\" class=\"glyphicon glyphicon-remove\"></span></a> </li>';\n }\n // Frame -> chamber\n else if ($row['RELATIONSHIP_ID'] === $FRAME_TO_CHAMBER) {\n $serialarr = getSerialById($row['PART_ID']);\n $serial = $serialarr[0]['SERIAL_NUMBER'];\n echo '<li class=\"list-group-item\" style=\"white-space:nowrap\"><label> Frame:</label> <br> <a href=\"show_frame.php?id=' . $serial . '\">' . $serial . '</a> <a style=\"color: red; padding-left:4em \" href=\"javascript:void(0);\" class=\"detach\" id=\"' . $serial . '\" kind=\"' . $FRAME_KIND_OF_PART_NAME . '\"><span aria-hidden=\"true\" class=\"glyphicon glyphicon-resize-full\"></span> Detach <span aria-hidden=\"true\" class=\"glyphicon glyphicon-remove\"></span></a> </li>';\n }\n\t // Readout -> chamber\n else if ($row['RELATIONSHIP_ID'] === $READOUT_TO_CHAMBER) {\n $serialarr = getSerialById($row['PART_ID']);\n $serial = $serialarr[0]['SERIAL_NUMBER'];\n echo '<li class=\"list-group-item\" style=\"white-space:nowrap\"><label> Readout:</label> <br> <a href=\"show_readout.php?id=' . $serial . '\">' . $serial . '</a> <a style=\"color: red; padding-left:4em \" href=\"javascript:void(0);\" class=\"detach\" id=\"' . $serial . '\" kind=\"' . $READOUT_KIND_OF_PART_NAME . '\"><span aria-hidden=\"true\" class=\"glyphicon glyphicon-resize-full\"></span> Detach <span aria-hidden=\"true\" class=\"glyphicon glyphicon-remove\"></span></a> </li>';\n }\n // geb -> readout\n else if ($row['RELATIONSHIP_ID'] === $GEB_TO_READOUT) {\n $serialarr = getSerialById($row['PART_ID']);\n $serial = $serialarr[0]['SERIAL_NUMBER'];\n echo '<li class=\"list-group-item\" style=\"white-space:nowrap\"><label> GEB:</label> <a href=\"show_geb.php?id=' . $serial . '\">' . $serial . '</a> <a style=\"color: red; padding-left:4em \" href=\"javascript:void(0);\" class=\"detach\" id=\"' . $serial . '\" kind=\"' . $GEB_KIND_OF_PART_NAME . '\"><span aria-hidden=\"true\" class=\"glyphicon glyphicon-resize-full\"></span> Detach <span aria-hidden=\"true\" class=\"glyphicon glyphicon-remove\"></span></a> </li>';\n }\n // optohybrid -> geb\n else if ($row['RELATIONSHIP_ID'] === $OPTOHYBRID_TO_GEB) {\n $serialarr = getSerialById($row['PART_ID']);\n $serial = $serialarr[0]['SERIAL_NUMBER'];\n echo '<li class=\"list-group-item\" style=\"white-space:nowrap\"><label> Optohybrid:</label> <a href=\"show_opto.php?id=' . $serial . '\">' . $serial . '</a> <a style=\"color: red; padding-left:4em \" href=\"javascript:void(0);\" class=\"detach\" id=\"' . $serial . '\" kind=\"' . $OPTOHYBRID_KIND_OF_PART_NAME . '\"><span aria-hidden=\"true\" class=\"glyphicon glyphicon-resize-full\"></span> Detach <span aria-hidden=\"true\" class=\"glyphicon glyphicon-remove\"></span></a> </li>';\n }\n // vfat -> geb\n else if ($row['RELATIONSHIP_ID'] === $VFAT2_TO_GEB) {\n $serialarr = getSerialById($row['PART_ID']);\n $serial = $serialarr[0]['SERIAL_NUMBER'];\n echo '<li class=\"list-group-item\" style=\"white-space:nowrap\"><label> VFAT:</label> <a href=\"show_vfat.php?id=' . $serial . '\">' . $serial . '</a> <a style=\"color: red; padding-left:4em \" href=\"javascript:void(0);\" class=\"detach\" id=\"' . $serial . '\" kind=\"' . $VFAT_KIND_OF_PART_NAME . '\"><span aria-hidden=\"true\" class=\"glyphicon glyphicon-resize-full\"></span> Detach <span aria-hidden=\"true\" class=\"glyphicon glyphicon-remove\"></span></a> </li>';\n }\n // Chamber -> Super Chamber\n else if($row['RELATIONSHIP_ID'] === $CHAMBER_TO_SUPER_CHAMBER){\n $serialarr = getSerialById($row['PART_ID']);\n $serial = $serialarr[0]['SERIAL_NUMBER'];\n echo '<li class=\"list-group-item\" style=\"white-space:nowrap\"><label> Chamber:</label> <a href=\"show_chamber.php?id=' . $serial . '\">' . $serial . '</a> <a style=\"color: red; padding-left:4em \" href=\"javascript:void(0);\" class=\"detach\" id=\"' . $serial . '\" kind=\"' . $CHAMBER_KIND_OF_PART_NAME . '\"><span aria-hidden=\"true\" class=\"glyphicon glyphicon-resize-full\"></span> Detach <span aria-hidden=\"true\" class=\"glyphicon glyphicon-remove\"></span></a> </li>';\n }\n }\n return 1;\n}", "public function getAvailParts($sender, $param)\n\t{\n\t\t$html = \"No parts found!\";\n\t\ttry\n\t\t{\n\t\t\tif(!isset($param->CallbackParameter->selectedIds) || (($selectedId = $param->CallbackParameter->selectedIds) == '') )\n\t\t\t\tthrow new Exception(\"Please select a request first!\");\n\n\t\t\t$request = Factory::service(\"FacilityRequest\")->get($selectedId);\n\t\t\t$partType = $request->getPartType();\n\t\t\t$hotMessage = $partType->getAlias(PartTypeAliasType::ID_HOT_MESSAGE);\n\n\t\t\tif(!$request instanceof FacilityRequest)\n\t\t\t\tthrow new Exception(\"Invalid facility request id provided(={$selectedId})!\");\n\n\t\t\t$goodParts = 1;\n\t\t\tif(isset($param->CallbackParameter->goodParts))\n\t\t\t{\n\t\t\t\t$goodParts = $param->CallbackParameter->goodParts;\n\t\t\t}\n\t\t\t$compatibleParts = false;\n\t\t\tif(isset($param->CallbackParameter->compatibleParts))\n\t\t\t{\n\t\t\t\t$compatibleParts = $param->CallbackParameter->compatibleParts;\n\t\t\t}\n\n\t\t\t$result = $this->_getAvailableParts($partType->getId(), true, $goodParts, $compatibleParts);\n\t\t\t$html = \"\";\n\n\t\t\t$html .= \"<table class='ResultDataList'>\";\n\n\t\t\tif($hotMessage)\n\t\t\t{\n\t\t\t\t$html .= \"<tr><td>\". PartTypeLogic::showHotMessageDetail($hotMessage, '', false, false) . \"</td></tr>\";\n\t\t\t}\n\n\t\t\t$html .= \"<tr>\";\n\t\t\tif($compatibleParts)\n\t\t\t\t$html .= \"<td><a href='javascript: void(0);' onClick='pageJs.viewAvailListOtherStores(\\\"\" . $selectedId . \"\\\", \\\"\" . $this->showExtraAvailListBtn->getUniqueID() . \"\\\",\\\"\" . $goodParts . \"\\\",true)'>View Compatible Parts from other Locations</a></td>\";\n\t\t\telse\n\t\t\t\t$html .= \"<td><a href='javascript: void(0);' onClick='pageJs.viewAvailListOtherStores(\\\"\" . $selectedId . \"\\\", \\\"\" . $this->showExtraAvailListBtn->getUniqueID() . \"\\\",\\\"\" . $goodParts . \"\\\",false)'>View Parts from other Locations</a></td>\";\n\n\t\t\t$html .= \"<td style='float:right'><input type='image' src='/themes/images/mail.gif' onclick='return pageJs.email(\\\"\" . $selectedId . \"\\\", \\\"\" . $this->showEmailPanelBtn->getUniqueID() . \"\\\", this);' title='Send an email'/></td>\";\n\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"<table>\";\n\n\t\t\tif($compatibleParts)\n\t\t\t\t$html .= PartTypeLogic::showCompatiblePartTypeDetail($partType);\n\t\t\telse\n\t\t\t\t$html .= \"<div><br><b>Part Details : </b>\".$partType->getAlias().\" - \".$partType->getName().\"</div><br>\";\n\n\t\t\tif(count($result)=== 0)\n\t\t\t{\n\t\t\t\t$html .= \"<br><b style='color:red'>No parts found!</b>\";\n\t\t\t\t$this->responseLabel->Text = $html;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$html .= \"<table class='ResultDataList'>\";\n\t\t\t$html .= \"<thead>\";\n\t\t\t$html .= \"<tr>\";\n\t\t\t$html .= \"<th>Warehouse</th>\";\n\t\t\tif($compatibleParts){$html .= \"<th>Partcode</th>\";}\n\t\t\t$html .= \"<th>Status</th>\";\n\t\t\t$html .= \"<th>Qty</th>\";\n\t\t\t$html .= \"<th>Reserved For</th>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"</thead>\";\n\t\t\t$html .= \"<tbody>\";\n\t\t\t$rowNo =0;\n\t\t\t$total = 0;\n\t\t\tforeach($result as $r)\n\t\t\t{\n\t\t\t\tif(!($warehouse = Factory::service(\"Warehouse\")->get($r['warehouseId'])) instanceof Warehouse)\n\t\t\t\tcontinue;\n\n\t\t\t\t$html .= \"<tr class='\" . ($rowNo++ % 2 === 0 ? \"ResultDataListItem\" : \"ResultDataListAlterItem\") . \"' >\";\n\t\t\t\t$html .= \"<td>\" . $warehouse->getBreadCrumbs() . \"</td>\";\n\t\t\t\tif($compatibleParts)\n\t\t\t\t{\n\t\t\t\t\t$partcode = Factory::service('PartType')->get($r['partTypeId'])->getAlias();\n\t\t\t\t\t$html .= \"<td>\".$partcode.\"</td>\";\n\t\t\t\t}\n\t\t\t\t$html .= \"<td>{$r['status']}</td>\";\n\t\t\t\t$html .= \"<td>{$r['qty']}</td>\";\n\t\t\t\t$html .= \"<td>{$r['fieldTaskId']}</td>\";\n\t\t\t\t$html .= \"</tr>\";\n\t\t\t\t$total +=$r['qty'];\n\t\t\t}\n\t\t\t$html .= \"</tbody>\";\n\t\t\t$html .= \"<tfoot>\";\n\t\t\t$html .= \"<tr>\";\n\t\t\t$html .= \"<td>Total</td>\";\n\t\t\t$html .= \"<td>&nbsp;</td>\";\n\t\t\tif($compatibleParts){$html .= \"<td>&nbsp;</td>\";}\n\t\t\t$html .= \"<td>$total</td>\";\n\t\t\t$html .= \"<td>&nbsp;</td>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"</tfoot>\";\n\t\t\t$html .= \"</table>\";\n\t\t}\n\t\tcatch(Exception $ex)\n\t\t{\n\t\t\t$html = $this->_getErrorMsg($ex->getMessage());\n\t\t}\n\t\t$this->responseLabel->Text = $html;\n\t}", "public function getCittaPartenza() {\n if (isset($_REQUEST['citta_partenza'])) {\n return $_REQUEST['citta_partenza'];\n } else\n return 0;\n }", "function fetch_car_spare_part($model, $part = false)\n {\n $this->db->where('ref_publish', 1);\n\n if ($model && !$part) {\n $this->db->distinct()->select('id_ref_spare_part,ref_spare_part')->where_in('id_type', array($model));\n }\n\n if ($model && $part) {\n $this->db->select('id_car_spare_part,spare_part,thumb')->where_in('id_type',\n array($model))->where_in('id_ref_spare_part', array($part));\n }\n\n $sp = $this->db->get('view_car_spare_parts');\n\n if ($sp->num_rows() > 0) {\n $sp = $sp->result_array();\n foreach ($sp as $n => $g) {\n if ($part) {\n $thumb = ($g['thumb'] != '' && file_exists('./uploads/spare_part/' . $g['thumb'])) ? base_url() . 'uploads/spare_part/' . $g['thumb'] : '';\n $sp[$n]['thumb'] = $thumb;\n }\n }\n\n } else {\n $sp = false;\n }\n return $sp;\n }", "function get_list_part_ID($part_id) {\n\n // Database connection \n $conn = database_connection();\n\n $sql = \"SELECT PART_ID,SERIAL_NUMBER,RECORD_INSERTION_USER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND IS_RECORD_DELETED = 'F'\"; //select data or insert data\n // Execute query \n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result = array();\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n $result[] = $row;\n foreach ($row as $item) {\n \n }\n }\n\n return $result;\n}", "public function getpDiskAndpPartFromDev($dev, &$pDisk, &$pPart, $ignoreMD = false)\n\t{\n// \t\tprint(\"<h2>INgetpDiskAndpPartFromDev($dev)</h2>\");\n\t\n\t\t/*\n\t\t\t$dev = '/dev/sda1' => $pDisk = '/dev/sda', $pPart = 1;\n\t\t\t$dev = '/dev/md0' => $pDisk = '/dev/md0', $pPart = false;\n\t\t\t$dev = '/dev/nvme0n1' => $pDisk = '/dev/nvme0n1', $pPart = false;\n\t\t\t$dev = '/dev/nvme0n1p1' => $pDisk = '/dev/nvme0n1', $pPart = 1;\n\t\t*/\n\t\t\n\t\t// Check, if it is a MD (where the number is part of the dev and not a partition)\n\t\tif ((strpos($dev,\"md\") !== false) && !$ignoreMD)\n\t\t{\n\t\t\t$pDisk = $dev;\n\t\t\t$pPart = false;\n\t\t}\n\t\telseif (strpos($dev,\"nvme\") !== false)\n\t\t{\n\t\t\t// Check, if it is the whole NVMe disk\n\t\t\tif (preg_match('/nvme[0-9]+n[1-9]+$/', $dev) === 1)\n\t\t\t{\n\t\t\t\t$pDisk = $dev;\n\t\t\t\t$pPart = false;\n\t\t\t}\n\t\t\t// Check, if it's an NVMe partition\n\t\t\telseif (preg_match('/nvme[0-9]+n[1-9]+p[1-9]+$/', $dev) === 1)\n\t\t\t{\n\t\t\t\t// $dev = '/dev/nvme0n1p1'\n\t\t\t\t\n\t\t\t\t// Remove /dev/nvme0n1p\n\t\t\t\t$pDisk = preg_replace('°p[0-9]+$°', '', $dev);\n\t\t\t\t$pPart = preg_replace('°.*/nvme[0-9]+n[1-9]+p°', '', $dev);\n// \t\t\t\tprint(\"<h2>OUTgetpDiskAndpPartFromDev($dev, &$pDisk, &$pPart</h2>\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Split the disk dev from the part number\n\t\t\t$temp = preg_split('/[0-9]/',$dev);\n\t\t\t$pDisk = $temp[0];\n\t\t\t$pPart = str_replace($temp[0],\"\",$dev);\n\n\t\t\t// If there is no number in the dev => $pPart = false\n\t\t\tif (empty($pPart))\n\t\t\t\t$pPart = false;\n\t\t}\n\t}", "private function getPartInstanceFromBarcode($barcode, $bl, &$errorBL = \"\")\n\t{\n\t\t$pi = null;\n\t\t$isNonSerialised = false;\n\t\t$isSerialised = false;\n\n\t\ttry {\n\t\t\t$isNonSerialised = BarcodeService::validateBarcode($barcode,BarcodeService::BARCODE_REGEX_CHK_PART_TYPE);\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{}\n\n\t\ttry {\n\t\t\t$isSerialised = BarcodeService::validateBarcode($barcode,BarcodeService::BARCODE_REGEX_CHK_PART_INSTANCE);\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{}\n\n\t\t//if BP\n\t\tif($isNonSerialised)\n\t\t{\n\t\t\t//check for BL\n\t\t\tif($bl==='')\n\t\t\t\t$errorBL = \"Invalid BL.Please Check the BL and try again.\";\n\n\t\t\tif(!$errorBL)\n\t\t\t{\n\t\t\t\tif($bl>\"\")\n\t\t\t\t{\n\t\t\t\t\t$warehouse = Factory::service('Warehouse')->getWarehouseByLocationBarcode($bl);\n\t\t\t\t\tif(!$warehouse instanceof Warehouse)\n\t\t\t\t\t\t$errorBL = \"Invalid BL.Please Check the BL and try again.\";\n\t\t\t\t}\n\n\t\t\t\t//get PartInstance based on BL\n\t\t\t\t$pis = Factory::service(\"PartInstance\")->searchPartInstanceByBarcodeAndPartcode($barcode, $barcode, null, 30, $warehouse, false, true);\n\t\t\t\tforeach ($pis as $pi)\n\t\t\t\t{\n\t\t\t\t\t//only un-reserved parts\n\t\t\t\t\tif (!$pi->getFacilityRequest() instanceof FacilityRequest)\n\t\t\t\t\t\treturn $pi;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($isSerialised)\n\t\t{\n\t\t\t$pi = Factory::service(\"PartInstance\")->searchPartInstanceByBarcodeAndPartcode($barcode, $barcode, null, 30, null, false, true);\n\t\t\tif($pi && count($pi)>0)\n\t\t\t{\n\t\t\t\treturn $pi[0];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "protected function getvPartBypPart($vDisk, $pPart)\n\t{\n\t\tfor ($vPart = 0; $vPart < $this->getPartAmount($vDisk); $vPart++)\n\t\t\tif ($this->getPartitionNumber($vDisk, $vPart) == $pPart)\n\t\t\t\treturn($vPart);\n\t\n\t\treturn(false);\n\t}", "function qa_request_part($part)\n{\n\t$parts = explode('/', qa_request());\n\treturn @$parts[$part];\n}", "function list_parts($kindId) {\n// Database connection \n $conn = database_connection();\n \n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $kindId . \"' AND IS_RECORD_DELETED = 'F' \" ;\n\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_arr = array();\n\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n\n echo '<option>' . $row['SERIAL_NUMBER'] . '</option>';\n \n \n }\n return 1;\n \n}", "public function selectPart() {\n if( ( $statement = $this->pdo->query( 'SELECT * FROM `partie` ') )!==false ) {\n if( ( $datas = $statement->fetchAll( \\PDO::FETCH_ASSOC ) )!==false ) {\n return $datas;\n }\n }\n return false;\n }", "public function get_message_part($uid, $part = 1, $o_part = null, $print = null, $fp = null, $skip_charset_conv = false) {\n\n // Retrieve message record\n $message_metadata = $this->get_message_record($uid);\n if (!$message_metadata) {\n // not found\n return FALSE;\n }\n\n // ACLs check ('read' grant required )\n $ACLs = $this->_get_acl(NULL, $message_metadata['mailbox_idnr']);\n if (!is_array($ACLs) || !in_array(self::ACL_READ_FLAG, $ACLs)) {\n // Unauthorized!\n return FALSE;\n }\n\n // Get mime content\n $mime = $this->fetch_part_lists($message_metadata['physmessage_id']);\n\n // Decode raw message\n $mime_decoded = $this->decode_raw_message($mime->header . $mime->body);\n if (!$mime_decoded) {\n return FALSE;\n }\n\n // Get message body\n $body = $this->get_message_part_body($mime_decoded, $part);\n\n if ($print) {\n // Print message!\n echo $body;\n }\n return $body;\n }", "public function getRsrvdParts($sender, $param)\n\t{\n\t\t$html = \"No parts found!\";\n\t\ttry\n\t\t{\n\t\t\tif(!isset($param->CallbackParameter->selectedIds) || count($selectedIds = ($param->CallbackParameter->selectedIds)) === 0)\n\t\t\t\tthrow new Exception(\"Please select a request first!\");\n\n\t\t\t$requestId = $selectedIds[0];\n\t\t\t$request = Factory::service(\"FacilityRequest\")->get($requestId);\n\t\t\tif(!$request instanceof FacilityRequest)\n\t\t\t\tthrow new Exception(\"Invalid facility request id provided(=$requestId)!\");\n\n\t\t\t//find all reserved part instances\n\t\t\t$pis = Factory::service(\"PartInstance\")->findByCriteria(\"pi.facilityRequestId = $requestId\");\n\n\t\t\t$html = \"<table class='ResultDataList'>\";\n\t\t\t$html .= \"<thead>\";\n\t\t\t$html .= \"<tr>\";\n\t\t\t$html .= \"<th width='20%'>Barcode</th>\";\n\t\t\t$html .= \"<th>Comments</th>\";\n\t\t\t$html .= \"<th width='8%'>Qty</th>\";\n\t\t\t$html .= \"<th width='5%'>&nbsp</th>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"</thead>\";\n\t\t\t$html .= \"<tbody>\";\n\t\t\t$html .= \"<tr class='ResultDataListAlterItem' resrpartpan='reservedTr'>\";\n\n\t\t\tif(!in_array($request->getStatus(), FacilityRequest::getStatusesAllowResvPI()))\n\t\t\t\t$html .= \"<td colspan=4 style='color: red; font-weight: bold;'>The status(`\" . $request->getStatus() . \"`) of the selected request does not allow reservation of parts!</td>\";\n\t\t\telse if(!Factory::service(\"FacilityRequest\")->checkOwnership($request, $this->getOwnerWarehouse()))\n\t\t\t\t$html .= \"<td colspan=4 style='color: red; font-weight: bold;'>You don't have access to this request.You need to own the request to proceed.</td>\";\n\t\t\telse\n\t\t\t{\n\t\t\t\t$html .= \"<td><input PlaceHolder='Barcode' resrpartpan='reservedSerialNoSearch' onkeydown=\\\"pageJs.enterEvent(event, $(this).up('tr[resrpartpan=reservedTr]').down('input[resrpartpan=reservedAddBtn]'));\\\"/>\n\t\t\t\t</br>\n\t\t\t\t</br>BL:\n\t\t\t\t<input id='BLNo' PlaceHolder='Barcode:BL' resrpartpan='reservedBLNoSearch' onkeydown=\\\"pageJs.enterEvent(event, $(this).up('tr[resrpartpan=reservedTr]').down('input[resrpartpan=reservedAddBtn]'));\\\"/>\n\t\t\t\t</td>\";\n\t\t\t\t$html .= \"<td>\n\t\t\t\t</br>\n\t\t\t\t(Limit text to 120 Characters)<input PlaceHolder='Comments' resrpartpan='reservedComments' style='width: 98%;'/>\n\t\t\t\t</br>\n\t\t\t\t</td>\";\n\t\t\t\t$html .= \"<td><input id='reservedQty' resrpartpan='reservedQty' value='1' style='width: 30px;'/></th>\";\n\t\t\t\t$html .= \"<td>\";\n\t\t\t\t$html .= \"<input resrpartpan='reservedAddBtn' type='button' value='Add' Onclick=\\\"pageJs.reservePI('$requestId', '\" . $this->rsvPartBtn->getUniqueID() . \"', '\" . $this->unRsvPartBtn->getUniqueID() . \"', this,'\" . $this->checkPartBtn->getUniqueID() .\n\t\t\t\t\"','\" . $this->checkPartType->getClientId() . \"','\" . $this->checkPartErrors->getClientId() . \"','\" . $this->errorBL->getClientId() . \"');\\\"/>\";\n\t\t\t\t$html .= \"<input resrpartpan='bpregex' type='hidden' value='\" . BarcodeService::getBarcodeRegex(BarcodeService::BARCODE_REGEX_CHK_PART_TYPE, null, '^', '$') . \"' />\";\n\t\t\t\t$html .= \"<input resrpartpan='partregex' type='hidden' value='\" . BarcodeService::getBarcodeRegex(BarcodeService::BARCODE_REGEX_CHK_PART, null, '^', '$') . \"' />\";\n\t\t\t\t$html .= \"</td>\";\n\t\t\t}\n\t\t\t$html .= \"</tr>\";\n\t\t\t$rowNo =0;\n\t\t\t$total = 0;\n\t\t\tforeach($pis as $pi)\n\t\t\t{\n\t\t\t\t$piQty = ($pi->getPartType()->getSerialised()==1)? 1:$pi->getQuantity();\n\t\t\t\t$barcode = ($pi->getPartType()->getSerialised()==1)? $pi->getAlias(PartInstanceAliasType::ID_SERIAL_NO):$pi->getPartType()->getAlias(PartTypeAliasType::ID_BP);\n\t\t\t\t$html .= \"<tr rsvdPIId=\\\"\" . $pi->getId() . \"\\\" class='\" . ($rowNo++ % 2 === 0 ? \"ResultDataListItem\" : \"ResultDataListAlterItem\") . \"' >\";\n\t\t\t\t$html .= \"<td>\" . $barcode . \"</td>\";\n\t\t\t\t$html .= \"<td>\" . $pi->getWarehouse()->getBreadCrumbs() . \"</td>\";\n\t\t\t\t$html .= \"<td>\".intval($piQty).\"</td>\";\n\t\t\t\t$html .= \"<td>\";\n\t\t\t\t$html .= \"<input type='image' src='/themes/images/delete_mini.gif' onClick=\\\"pageJs.unresrvPI('$requestId', '\" . $this->unRsvPartBtn->getUniqueID() . \"', this);\\\"/>\";\n\t\t\t\t$html .= \"</td>\";\n\t\t\t\t$html .= \"</tr>\";\n\t\t\t\t$total += intval($piQty);\n\t\t\t}\n\t\t\t$html .= \"</tbody>\";\n\t\t\t$html .= \"<tfoot>\";\n\t\t\t$html .= \"<tr>\";\n\t\t\t$html .= \"<td>Total</td>\";\n\t\t\t$html .= \"<td>&nbsp;</td>\";\n\t\t\t$html .= \"<td><span resrpartpan='reservedTotalQty'>$total</span></td>\";\n\t\t\t$html .= \"<td>&nbsp;</td>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"</tfoot>\";\n\t\t\t$html .= \"</table>\";\n\n \t\t\tif($this->checkFieldTaskHasAllReservationsFulfilled($request->getFieldTask()))\n \t\t\t{\n \t\t\t\t$html .= \"<select id='titleActionListDropDown'>\";\n \t\t\t\t$html .= \"<option value='pushToAvail' class='fieldtaskoptons'>Push Field Task Avail</option>\";\n \t\t\t\t$html .= \"</select>\";\n \t\t\t\t$html .= \"<input id='titleActionListBtn' value='Go' onclick=\\\"return pageJs.pushFTWrapper($('titleActionListDropDown').value, '\" . $this->changeFTStatusBtn->getUniqueID() . \"',\" . $requestId . \"); return false;\\\" type='button'>\";\n \t\t\t}\n\t\t}\n\t\tcatch(Exception $ex)\n\t\t{\n\t\t\t$html = $this->_getErrorMsg($ex->getMessage());\n\t\t}\n\t\t$this->responseLabel->Text = $html;\n\t}", "function getSerialById($id) {\n\n // Database connection \n $conn = database_connection();\n\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE PART_ID='\" . $id . \"'\"; //select data or insert data\n // Execute query \n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result = array();\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n $result[] = $row;\n }\n return $result;\n}", "public function rsvPart($sender, $param)\n\t{\n\t\t$result = array();\n\t\t$errors = array();\n\t\ttry\n\t\t{\n\t\t\tif(!isset($param->CallbackParameter->selectedIds) || count($selectedIds = ($param->CallbackParameter->selectedIds)) === 0)\n\t\t\t\tthrow new Exception(\"Please select a request first!\");\n\n\t\t\t$request = Factory::service(\"FacilityRequest\")->get($selectedIds[0]);\n\n\t\t\tif(!$request instanceof FacilityRequest)\n\t\t\t\tthrow new Exception(\"Invalid facility request id provided(={$selectedIds[0]})!\");\n\n\t\t\t$result['requestId'] = $selectedIds[0];\n\n\t\t\tif(count($resrvInfo = ($param->CallbackParameter->resrvInfo)) === 0)\n\t\t\t\tthrow new Exception(\"Please no resrvd part info passed in!\");\n\n\t\t\t$result['barcode'] = isset($resrvInfo->barcode) ? trim($resrvInfo->barcode) : '';\n\t\t\t$result['BL'] = isset($resrvInfo->BL) ? trim($resrvInfo->BL) : '';\n\t\t\t$result['qty'] = isset($resrvInfo->qty) ? trim($resrvInfo->qty) : '';\n\n\t\t\tif($result['barcode'] === '' )\n\t\t\t\tthrow new Exception(\"Barcode needed!\");\n\n\t\t\tif(!is_numeric($result['qty']))\n\t\t\t\tthrow new Exception(\"Invalid qty(={$result['qty']}) provided!\");\n\n\n\t\t\t$pi = Factory::service(\"PartInstance\")->get($this->partInstanceId->Value);\n\n\t\t\tif(!$pi instanceof PartInstance)\n\t\t\t\tthrow new Exception(\"No part instance found for '{$result['barcode']}'!!\");\n\n\t\t\t$comments = \"\";\n\t\t\tif(isset($resrvInfo->comments) && $resrvInfo->comments)\n\t\t\t{\n\t\t\t\t$comments = $resrvInfo->comments;\n\t\t\t}\n\n\t\t\t$result['piId'] = $pi->getId();\n\t\t\t$result['warehouse'] = $pi->getWarehouse()->getBreadCrumbs();\n\t\t\t$this->_ownerWarehouse = $this->getOwnerWarehouse();\n\n\t\t\tif ($this->_reportServerRedirectEnabled)\n\t\t\t\tDao::prepareNewConnection(Dao::DB_MAIN_SERVER); //reconnect to main server, if redirection is ON\n\n\t\t\tFactory::service(\"FacilityRequest\")->reservePI($request, $pi, $this->_ownerWarehouse, $comments,$result['qty']);\n\t\t}\n\t\tcatch(Exception $ex)\n\t\t{\n\t\t\t$errors[] = $this->_getErrorMsg($ex->getMessage());\n\t\t}\n\n\t\tif ($this->_reportServerRedirectEnabled)\n\t\t\tDao::prepareNewConnection(Dao::DB_REPORT_SERVER); //reconnect to report server, if redirection is ON\n\n\t\tif (empty($errors))\n\t\t\t$result['requests'] = $this->_getData(false,null ,$totalRows, 'slaEnd', 'asc', $selectedIds);\n\n\t\t$this->responseLabel->Text = htmlentities(Core::getJSONResponse($result, $errors));\n\n\t}", "public function getPart($name)\n {\n if (array_key_exists($name, $this->parts)) {\n return $this->parts[$name];\n }\n }", "public function getPart($what = null) {\n if (!$what) {\n return $this->_parts;\n } else {\n return isset($this->_parts[$what]) ? $this->_parts[$what] : null;\n }\n }", "public function show(StockItem $stockItem, Part $part)\n {\n if (!$stockItem) {\n return response()->json(['message' => 'The stock item doesn\\'t exist!'], 409);\n }\n if (!$part) {\n return response()->json(['message' => 'The part doesn\\'t exist!'], 409);\n }\n\n $serialOrBatchNumCol = null;\n $serialOrBatchNumColOrder = null;\n if ($stockItem->component_type == ComponentTypeEnum::EXPENDABLE) {\n $serialOrBatchNumCol = \"parts.batch_num as batch_num\";\n $serialOrBatchNumColOrder = \"parts.batch_num\";\n } else {\n $serialOrBatchNumCol = \"parts.serial_num as serial_num\";\n $serialOrBatchNumColOrder = \"parts.serial_num\";\n }\n\n $partVal = Part::join('users as users', function ($q) {\n $q->where('users.id', '=', auth()->user()->id);\n })\n ->join('stock_items', 'stock_items.id', '=', 'parts.stock_item_id')\n ->leftJoin('quantity_units', 'quantity_units.id', '=', 'parts.quantity_unit_id')\n ->leftJoin('aircraft_types', 'aircraft_types.id', '=', 'parts.aircraft_type_id')\n ->leftJoin('aircrafts', 'aircrafts.aircraft_type_id', '=', 'aircraft_types.id')\n ->join('a_t_a_chapters', 'a_t_a_chapters.id', '=', 'stock_items.a_t_a_chapter_id')\n ->join('owners', 'owners.id', '=', 'parts.owner_id')\n ->where('parts.id', $part->id)\n ->orderBy($serialOrBatchNumColOrder, 'asc')\n ->select([\n 'parts.id as id',\n $serialOrBatchNumCol,\n\n 'parts.quantity_alarm as quantity_alarm',\n 'parts.quantity_unit_id as quantity_unit_id',\n\n 'parts.note as note',\n\n 'parts.is_depleted as is_depleted',\n\n 'stock_items.component_category as component_category',\n 'stock_items.component_type as component_type',\n\n 'aircraft_types.id as aircraft_type_id',\n 'aircraft_types.name as aircraft_type_name',\n 'parts.aircraft_id as aircraft_id',\n 'parts.parent_part_id as parent_part_id',\n\n 'owners.id as owner_id',\n 'owners.name as owner_name',\n\n 'a_t_a_chapters.id as a_t_a_chapter_id',\n 'a_t_a_chapters.code as a_t_a_chapter_code',\n 'a_t_a_chapters.name as a_t_a_chapter_name',\n\n 'stock_items.id as stock_idem_id',\n 'stock_items.name as name',\n 'stock_items.init_part_num as init_part_num',\n\n DB::raw(\"convert_tz(parts.created_at, 'UTC', users.timezone) as created_at\"),\n DB::raw(\"convert_tz(parts.updated_at, 'UTC', users.timezone) as updated_at\"),\n ])->first();\n\n if (!$partVal) {\n return response()->json(['message' => 'The part doesn\\'t exist!'], 409);\n }\n\n return response()->json($partVal, 200);\n }", "function view_part_list()\n{\n\tinclude 'storedInfo.php';\n\tini_set('display_errors', 'On');\n\t\t\t\n\t$mysqli = new mysqli(\"oniddb.cws.oregonstate.edu\", \"jonesmi-db\", $myPassword, \"jonesmi-db\");\n\tif ($mysqli->connect_errno) \n\t{\n\t\techo \"Failed to connect to MySQL: (\" . $mysqli->connect_errno . \") \" . $mysqli->connect_error;\n\t} else \n\t{\n\t\t//echo \"connection worked!<br><br>\";\n\t} \n\tif (!($stmt = $mysqli->prepare(\"SELECT MissingPiece.element_num, MissingPiece.part_desc, LibraryUsers.userName \n\t\tFROM LibraryUsers\n\t\tINNER JOIN UserMissing ON LibraryUsers.id = UserMissing.uid\n\t\tINNER JOIN MissingPiece ON MissingPiece.id = UserMissing.pid\"))) \n\t{\n\t\techo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t}\n\tif (!$stmt->execute()) \n\t{\n\t\techo \"Execute failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t}\n\n\t$out_quantity = NULL;\n\t$out_element_num = NULL;\n\t$out_part_desc = NULL;\n\t$out_userName = NULL;\n\n\tif (!$stmt->bind_result($out_element_num, $out_part_desc, $out_userName)) \n\t{\n\t\techo \"Binding output parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\n\t}\n\t\n\t$display_string = \"<table style = 'text-align:center;' border = '1'> <tr> <th> Element Number </th><th> Part Description </th> <th> Requestor </th>\";\n\n\t\t// Insert a new row in the table for each person returned\n\t\twhile($stmt -> fetch())\n\t\t{\n\t\t\t$display_string .= \"<tr>\";\n\t\t\t$display_string .= \"<td>\".$out_element_num.\"</td>\";\n\t\t\t$display_string .= \"<td>\".$out_part_desc.\"</td>\";\n\t\t\t$display_string .= \"<td>\".$out_userName.\"</td>\";\n\t\t\t$display_string .= \"</tr>\";\n\t\t}\n\t$display_string .= \"</table>\";\n\techo $display_string;\n\t$mysqli->close();\n}", "private function getpart($mbox,$mid,$p,$partno)\n\t{\n\t\t\n\t\t// DECODE DATA\n\t\t$data = ($partno) ?\n\t\timap_fetchbody($mbox,$mid,$partno): // multipart\n\t\timap_body($mbox,$mid); // simple\n\t\n\t\t// Any part may be encoded, even plain text messages, so check everything.\n\t\tif\t($p->encoding==4)\n\t\t\t$data = quoted_printable_decode($data);\n\t\telseif ($p->encoding==3)\n\t\t$data = base64_decode($data);\n\t\n\t\t// PARAMETERS\n\t\t// get all parameters, like charset, filenames of attachments, etc.\n\t\t$params = array();\n\t\tif ($p->parameters)\n\t\t\tforeach ($p->parameters as $x)\n\t\t\t$params[strtolower($x->attribute)] = $x->value;\n\t\tif ($p->dparameters)\n\t\t\tforeach ($p->dparameters as $x)\n\t\t\t$params[strtolower($x->attribute)] = $x->value;\n\t\n\t\t// ATTACHMENT\n\t\t// Any part with a filename is an attachment,\n\t\t// so an attached text file (type 0) is not mistaken as the message.\n\t\tif ($params['filename'] || $params['name']) {\n\t\t\t// filename may be given as 'Filename' or 'Name' or both\n\t\t\t$filename = ($params['filename'])? $params['filename'] : $params['name'];\n\t\t\t// filename may be encoded, so see imap_mime_header_decode()\n\t\t\t$fname = tempnam(null,'blog-file-');\n\t\t\t$file = fopen($fname,'w');\n\t\t\tfwrite($file,$data);\n\t\t\tfclose($file);\n\t\t\tchmod($fname,0644);\n\t\n\t\t\t$this->filenames[] = array('filename'=>$fname,'name'=>$filename);\n\t\t}\n\t\n\t\t// TEXT\n\t\tif ($p->type==0 && $data) {\n\t\t\t// Messages may be split in different parts because of inline attachments,\n\t\t\t// so append parts together with blank row.\n\t\t\tif (strtolower($p->subtype)=='plain')\n\t\t\t\t$this->text.= trim($data) .\"\\n\\n\";\n\t\t\telse\n\t\t\t\t$this->html.= $data .\"<br><br>\";\n\t\t\t$charset = $params['charset']; // assume all parts are same charset\n\t\t}\n\t\n\t\t// EMBEDDED MESSAGE\n\t\t// Many bounce notifications embed the original message as type 2,\n\t\t// but AOL uses type 1 (multipart), which is not handled here.\n\t\t// There are no PHP functions to parse embedded messages,\n\t\t// so this just appends the raw source to the main message.\n\t\telseif ($p->type==2 && $data) {\n\t\t\t$this->text.= $data.\"\\n\\n\";\n\t\t}\n\t\n\t\t// SUBPART RECURSION\n\t\tif ($p->parts) {\n\t\t\tforeach ($p->parts as $partno0=>$p2)\n\t\t\t\t$this->getpart($mbox,$mid,$p2,$partno.'.'.($partno0+1)); // 1.2, 1.2.1, etc.\n\t\t}\n\t}", "public function getpart($mbox,$mid,$p,$partno) \n\t{\n\t global $htmlmsg,$plainmsg,$charset,$attachments;\n\n\t $mbox = $this->connection;\n\n\t // DECODE DATA\n\t $data = ($partno)?\n\t imap_fetchbody($mbox,$mid,$partno,FT_PEEK): // multipart\n\t imap_body($mbox,$mid,FT_PEEK); // simple\n\t // Any part may be encoded, even plain text messages, so check everything.\n\t if ($p->encoding==4)\n\t $data = quoted_printable_decode($data);\n\t elseif ($p->encoding==3)\n\t $data = base64_decode($data);\n\n\t // PARAMETERS\n\t // get all parameters, like charset, filenames of attachments, etc.\n\t $params = array();\n\t if (isset($p->parameters) && $p->parameters)\n\t foreach ($p->parameters as $x)\n\t $params[strtolower($x->attribute)] = $x->value;\n\t if (isset($p->dparameters) && $p->dparameters)\n\t foreach ($p->dparameters as $x)\n\t $params[strtolower($x->attribute)] = $x->value;\n\n\t // ATTACHMENT\n\t // Any part with a filename is an attachment,\n\t // so an attached text file (type 0) is not mistaken as the message.\n\t /*if ( (isset($params['filename']) && $params['filename']) || (isset($params['name']) && $params['name']) ) {\n\t // filename may be given as 'Filename' or 'Name' or both\n\t $filename = ($params['filename'])? $params['filename'] : $params['name'];\n\t // filename may be encoded, so see imap_mime_header_decode()\n\t $attachments[$filename] = $data; // this is a problem if two files have same name\n\t }*/\n\n\t // TEXT\n\t if ($p->type==0 && $data) {\n\t // Messages may be split in different parts because of inline attachments,\n\t // so append parts together with blank row.\n\t if (strtolower($p->subtype)=='plain')\n\t $plainmsg .= trim($data) .\"\\n\\n\";\n\t else\n\t $htmlmsg .= $data .\"<br><br>\";\n\t $charset = $params['charset']; // assume all parts are same charset\n\t }\n\n\t // EMBEDDED MESSAGE\n\t // Many bounce notifications embed the original message as type 2,\n\t // but AOL uses type 1 (multipart), which is not handled here.\n\t // There are no PHP functions to parse embedded messages,\n\t // so this just appends the raw source to the main message.\n\t elseif ($p->type==2 && $data) {\n\t $plainmsg .= $data.\"\\n\\n\";\n\t }\n\n\t // SUBPART RECURSION\n\t if (isset($p->parts) && $p->parts) {\n\t foreach ($p->parts as $partno0=>$p2)\n\t $this->getpart($mbox,$mid,$p2,$partno.'.'.($partno0+1)); // 1.2, 1.2.1, etc.\n\t }\n\t}", "public function getDataPartenza() {\n if (isset($_REQUEST['data_partenza'])) {\n return $_REQUEST['data_partenza'];\n } else\n return 0;\n }", "public function get ( $category, $part = null )\n\t{\n\t\t$return = null;\n\t\tif ( $part )\n\t\t{\n\t\t\t$return = (isset( $this->userInfo[ $category ][ $part ] ) ? $this->userInfo[ $category ][ $part ] : null);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$return = (isset( $this->userInfo[ $category ] ) ? $this->userInfo[ $category ] : null);\n\t\t}\n\t\treturn $return;\n\t}", "public function getInvQty($partNum) {\n \t// Setup xml\n \t$xml = \"<InvQtyRq>\\n<PartNum>{$partNum}</PartNum>\\n</InvQtyRq>\\n\";\n\t\t\n // Create request and pack\n\t\t$this->createRequest($xml);\n $len = strlen($this->xmlRequest);\n $packed = pack(\"N\", $len);\n\n // Send and get the response\n fwrite($this->id, $packed, 4);\n fwrite($this->id, $this->xmlRequest);\n $this->getResponse();\n\n // Set the result\n $this->setResult($this->parseXML($this->xmlResponse));\n }", "public function dsn_part($part) {\n\t\tif ( isset($this->dsn_parsed[$part]) ) {\n\t\t\treturn $this->dsn_parsed[$part];\n\t\t}\n\t}", "function get_available_parts_nochild($part_id, $version, $relationID = \"NA\") {\n // Database connection \n $conn = database_connection();\n global $GEB_KIND_OF_PART_ID;\n global $VFAT2_TO_GEB;\n global $OPTOHYBRID_TO_GEB;\n\n // as GEB has 25 childs not only 1 ( 24 VFAT & 1 OptoHybrid ) we need to FILTER GEBs and create a specific Query for it\n if ($part_id == $GEB_KIND_OF_PART_ID) {\n // Filtering GEBs that has less than 24 VFATS childs\n if ($relationID != \"NA\" && $relationID == $VFAT2_TO_GEB) {\n $sql = \"SELECT PART_ID , SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS P1\n WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND SERIAL_NUMBER LIKE '%\" . $version . \"%' AND IS_RECORD_DELETED = 'F'\n AND (select COUNT(PART_PARENT_ID) from CMS_GEM_CORE_CONSTRUCT.PHYSICAL_PARTS_TREE WHERE PART_PARENT_ID = P1.PART_ID AND RELATIONSHIP_ID ='\".$relationID.\"' ) < 24\n ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\";\n }\n // Filtering GEBs that has less than 1 OptoHybrid Child\n if ($relationID != \"NA\" && $relationID == $OPTOHYBRID_TO_GEB) {\n $sql = \"SELECT PART_ID , SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS P1\n WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND SERIAL_NUMBER LIKE '%\" . $version . \"%' AND IS_RECORD_DELETED = 'F'\n AND (select COUNT(PART_PARENT_ID) from CMS_GEM_CORE_CONSTRUCT.PHYSICAL_PARTS_TREE WHERE PART_PARENT_ID = P1.PART_ID AND RELATIONSHIP_ID ='\".$relationID.\"' ) < 1\n ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\";\n }\n } \n // Other part Like Readout ( has only one GEB child ) so check will be only on confirming that \n // there is no current entry for this Readout in Tree table as a parent (i.e: can attatch child to it)\n else { \n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND IS_RECORD_DELETED = 'F' AND SERIAL_NUMBER LIKE '%\" . $version . \"%' AND PART_ID not in (select PART_PARENT_ID from CMS_GEM_CORE_CONSTRUCT.PHYSICAL_PARTS_TREE) ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\"; //select data or insert data \n }\n\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_arr = array();\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n echo '<li><a href=\"#\" class=\"availablepart\" >' . $row['SERIAL_NUMBER'] . '</a></li>';\n\n// $temp['man_id']= $row['MANUFACTURER_ID'];\n// $temp['man_name']= $row['MANUFACTURER_NAME'];\n// $result_arr[] = $temp;\n }\n return 1;\n}", "public function part()\n {\n return $this->belongsTo('App\\Part', 'id_part')->first();\n }", "public function getPartieId()\n\t{\n\t\treturn $this->partie_id;\n\t}", "protected function readPart()\n {\n $tmpSize = \"\";\n\n while(($read = (string)$this->read(1)) != \"\\n\") {\n $tmpSize .= $read;\n\n if ($this->eof()) {\n return null;\n }\n }\n\n $size = hexdec(trim($tmpSize));\n\n if ($size > 0) {\n $part = $this->read($size);\n } else {\n $part = \"\";\n }\n\n while($this->read(1) != \"\\n\") {\n if ($this->eof()) {\n return null;\n }\n }\n\n return $part;\n }", "public function getParts(Request $request)\n {\n /*$item = \\App\\WorkItem::find($request->get('item'));\n\n if(!is_null($item))\n $res['res'] = $item->parts()->whereNotIn('id', $request->get('selected'))->pluck('part', 'id');\n else\n $res['res'] = null;*/\n if($request->has('selected'))\n $res['res'] = \\App\\Part::whereNotIn('id', $request->get('selected'))\n ->orderBy('part')\n ->pluck('id', 'part');\n else\n $res['res'] = \\App\\Part::orderBy('part')->pluck('id', 'part');\n\n return $res; \n }", "public function executePart(sfWebRequest $request) {\n \t$cat_slug = $request->getParameter('cat_slug');\n \t$cat_id = LWS::getCategoryPk($cat_slug);\n \t$part_no = LWS::unencode($request->getParameter('part_no'));\n \t$part = PartFactory::make(array('cat_id' => $cat_id, 'part_no' => $part_no));\n \t$this->param = array();\n \t$this->param['cat_id'] = $cat_id;\n \t$this->param['part'] = $part->getDetails();\n \t// If I opt to move this whole piece of TR logic to TRPart by passing in the sfUser object\n \t// Then I'd have to update the constructor for all DAO's to include an optional construction\n \t// parameter. Unless I can get it from within the TRPart.\n \tif($cat_id == 'tr' && (str_replace('/frontend_dev.php','', parse_url($request->getReferer(), PHP_URL_PATH)) == '/electrical-transformers/select')) {\n \t\t/*\n \t\t * See if user has stored voltages in session (they should unless an error occured).\n \t\t * Use these instead of DB values since the selection tool allows for reversing \n \t\t * input/output voltages.\n \t\t */\n \t\tif($this->getUser()->hasAttribute('tr_volt_order')) {\n \t\t\t// session value has form [chosen input]:[chosen output]\n \t\t\t$volts = explode(':', $this->getUser()->getAttribute('tr_volt_order'));\n \t\t\t//print_r($volts); die();\n \t\t\t// Remember that TRPart (and all Part DAO's) uses an Alias to store field values\n \t\t\t$this->param['part']['Primary Voltage'] = $volts[0];\n \t\t\t$this->param['part']['Secondary Voltage'] = $volts[1];\n \t\t\t// removing these does not allow the user to move back and forth in the selection tool\n \t\t\t//$this->getUser()->getAttributeHolder()->remove('tr_volt_order');\n \t\t}\n \t}\n \t/*\n \t * Two options for dealing with lowercase part numbers in URLs:\n \t * A: Just throw a 404 for these requests\n \t * B: Show the page, but use a <link> canonical tag\n \t */\n \t$this->forward404Unless($part_no == strtoupper($part_no)); // Option A\n \t/* B:\n \tif($part_no != strtoupper($part_no)) {\n \t\t$pn = $request->getParameter('part_no');\n \t\t$url = str_replace($pn, strtoupper($pn), $request->getUri());\n \t\t$this->getResponse()->setSlot('links', \"<link rel='canonical' href='{$url}' />\");\n \t}\n \t*/\n \t$this->forward404Unless($this->param['part']);\n \t$this->param['part']['part_no'] = $part_no;\n \t$this->param['part']['db_fields'] = $part->getDbFields();\n \t$this->param['h1Txt'] = $part->getH1Txt();\n \t$this->param['store'] = $part->getPricing();\n \t$this->param['category'] = LWS::getCategoryName($cat_slug);\n \t$this->param['manuf_route'] = $cat_id . '_manuf';\n \t/*\n \t * doing this for now since changing the route's name would involve updating more files\n \t * this is necessary because at some point adam wanted to change 'transformers'\n \t * to 'electrical-transformers'. should clean it up later to remove this conditional statement.\n \t */\n \t$this->param['cat_route'] = str_replace('-', '_', $cat_slug);\n \t$this->param['meta_keywords'] = $part->getMetaKeywords();\n \t$this->param['shipping_needed'] = (($this->param['store'] != 'emptyStore') && ($cat_id == 'cb')) ? true : false;\n \t$response = $this->getResponse();\n $response->setSlot('body_class', 'part');\n $response->setSlot('body_id', str_replace('-', '_', $cat_slug));\n \t$response->setTitle($part->getPageTitle());\n \treturn sfView::SUCCESS;\n }", "private static function getFilenameFromPart($part) {\n \n \t$filename = '';\n \t\n \tif($part->ifdparameters) {\n \t\tforeach($part->dparameters as $object) {\n \t\t\tif(strtolower($object->attribute) == 'filename') {\n \t\t\t\t$filename = $object->value;\n \t\t\t}\n \t\t}\n \t}\n \n \tif(!$filename && $part->ifparameters) {\n \t\tforeach($part->parameters as $object) {\n \t\t\tif(strtolower($object->attribute) == 'name') {\n \t\t\t\t$filename = $object->value;\n \t\t\t}\n \t\t}\n \t}\n \t\n \treturn $filename;\n \t\n }", "function your_parts()\n{\n\tinclude 'storedInfo.php';\n\tini_set('display_errors', 'On');\n\t$user_name = $_SESSION['username'];\n\t\n\t$mysqli = new mysqli(\"oniddb.cws.oregonstate.edu\", \"jonesmi-db\", $myPassword, \"jonesmi-db\");\n\tif ($mysqli->connect_errno) \n\t{\n\t\techo \"Failed to connect to MySQL: (\" . $mysqli->connect_errno . \") \" . $mysqli->connect_error;\n\t} else \n\t{\n\t\t//echo \"connection worked!<br><br>\";\n\t} \n\tif (!($stmt = $mysqli->prepare(\"SELECT MissingPiece.element_num, MissingPiece.part_desc\n\tFROM LibraryUsers\n\tINNER JOIN UserMissing ON LibraryUsers.id = UserMissing.uid\n\tINNER JOIN MissingPiece ON MissingPiece.id = UserMissing.pid\n\tWHERE LibraryUsers.userName = ?\"))) \n\t{\n\t\techo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t}\n\tif(!($stmt->bind_param(\"s\",$user_name))){\n\techo \"Bind failed: \" . $stmt->errno . \" \" . $stmt->error;\n}\n\tif (!$stmt->execute()) \n\t{\n\t\techo \"Execute failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t}\n\n\t$out_quantity = NULL;\n\t$out_element_num = NULL;\n\t$out_part_desc = NULL;\n\t$out_userName = NULL;\n\n\tif (!$stmt->bind_result($out_element_num, $out_part_desc)) \n\t{\n\t\techo \"Binding output parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\n\t}\n\t\n\t$display_string = \"<table style = 'text-align:center;' border = '1'> <tr> <th> Element Number </th><th> Part Description </th>\";\n\n\t\t// Insert a new row in the table for each person returned\n\t\twhile($stmt -> fetch())\n\t\t{\n\t\t\t$display_string .= \"<tr>\";\n\t\t\t$display_string .= \"<td>\".$out_element_num.\"</td>\";\n\t\t\t$display_string .= \"<td>\".$out_part_desc.\"</td>\";\n\t\t\t$display_string .= \"</tr>\";\n\t\t}\n\t$display_string .= \"</table>\";\n\techo $display_string;\n\t$mysqli->close();\n}", "static function retrieve_parties_fftt( $licence )\n { \n\tglobal $gCms;\n\t$db = cmsms()->GetDb();\n\t$ping = cms_utils::get_module('Ping');\n\t//require_once(dirname(__FILE__).'/function.calculs.php');\n\t$saison_courante = $ping->GetPreference('saison_en_cours');\n\t$now = trim($db->DBTimeStamp(time()), \"'\");\n\t$aujourdhui = date('Y-m-d');\n\t$designation = \"\";\n\t$annee_courante = date('Y');\n\t$lignes = 0; //on instancie le nb de lignes 0 par défaut\n\t\n\t//les classes\n\t$service = new Servicen;\n\t$spid_ops = new spid_ops;\n\t\n\t$page = \"xml_partie_mysql\";\n\t$var = \"licence=\".$licence;\n\t$lien = $service->GetLink($page, $var);\n\t$xml = simplexml_load_string($lien,'SimpleXMLElement', LIBXML_NOCDATA);\n\t\n\tif($xml === FALSE)\n\t{\n\t\t$array = 0;\n\t\t$lignes = 0;\n\t\t$message = \"Service coupé ou pas de résultats disponibles\"; \n\t\t$status = 'Echec';\n\t\t$designation.= $message;\n\t\t$action = \"mass_action\";\n\t\tping_admin_ops::ecrirejournal($status, $designation,$action);\n\t}\n\telse\n\t{\n\t\t$array = json_decode(json_encode((array)$xml), TRUE);\n\t\tif(isset($array['partie']))\n\t\t{\n\t\t\t$lignes = count($array['partie']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$lignes = 0;\n\t\t}\n\t\t\n\t\t//var_dump($xml);\n\t}\n\t\t\n\t\t\n\t\t$i = 0;\n\t\t$compteur = 0;\n\t\tforeach($xml as $cle =>$tab)\n\t\t{\n\t\t\t$compteur++;\n\n\t\t\t$licence = (isset($tab->licence)?\"$tab->licence\":\"\");\n\t\t\t$advlic = (isset($tab->advlic)?\"$tab->advlic\":\"\");\n\t\t\t$vd = (isset($tab->vd)?\"$tab->vd\":\"\");\n\n\t\t\t\tif ($vd =='V')\n\t\t\t\t{\n\t\t\t\t\t$vd = 1;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$vd = 0;\n\t\t\t\t}\n\n\t\t\t$numjourn = (isset($tab->numjourn)?\"$tab->numjourn\":\"0\");\n\n\t\t\t\tif(is_array($numjourn))\n\t\t\t\t{\n\t\t\t\t\t$numjourn = '0';\n\t\t\t\t}\n\t\t\t$nj = (int) $numjourn;\n\t\t\t\n\t\t\t$codechamp = (isset($tab->codechamp)?\"$tab->codechamp\":\"\");\n\n\t\t\t//on essaie de déterminer le nom de cette compet ?\n\t\t\t//$query = \"SELECT * FROM \".cms_db_prefix().\"module_ping_type_competition WHERE code_compet = ?\";\n\n\t\t\t$dateevent = (isset($tab->date)?\"$tab->date\":\"\");\n\t\t\t$chgt = explode(\"/\",$dateevent);\n\t\t\t//on va en déduire la saison\n\t\t\tif($chgt[1] < 7)\n\t\t\t{\n\t\t\t\t//on est en deuxième phase\n\t\t\t\t//on sait donc que l'année est la deuxième année\n\t\t\t\t$annee_debut = ($chgt[2]-1);\n\t\t\t\t$annee_fin = $chgt[2];\n\n\t\t\t}\n\t\t\telseif($chgt[1]>=7)\n\t\t\t{\n\t\t\t\t//on est en première phase\n\t\t\t\t$annee_debut = $chgt[2];\n\t\t\t\t$annee_fin = ($chgt[2]+1);\n\t\t\t}\n\t\t\t$saison = $annee_debut.\"-\".$annee_fin;\n\t\t\t$date_event = $chgt[2].\"-\".$chgt[1].\"-\".$chgt[0];\n\t\t\t//echo \"la date est\".$date_event;\n\n\t\t//\t$date_event = conv_date_vers_mysql($dateevent);\n\t\t\t$advsexe = (isset($tab->advsexe)?\"$tab->advsexe\":\"\");\n\t\t\t//$advnompre = mysqli_real_escape_string($link,(isset($tab->advnompre)?\"$tab->advnompre\":\"\"));\n\t\t\t$advnompre =(isset($tab->advnompre)?\"$tab->advnompre\":\"\");\n\t\t\t$pointres = (isset($tab->pointres)?\"$tab->pointres\":\"\");\n\t\t\t$coefchamp = (isset($tab->coefchamp)?\"$tab->coefchamp\":\"\");\n\t\t\t$advclaof = (isset($tab->advclaof)?\"$tab->advclaof\":\"\");\n\t\t\t$idpartie = (isset($tab->idpartie)?\"$tab->idpartie\":\"\");\n\t\t\t\n\t\t\t$add_fftt = $spid_ops->add_fftt($saison,$licence, $advlic, $vd, $nj, $codechamp, $date_event, $advsexe, $advnompre, $pointres, $coefchamp, $advclaof,$idpartie);\n\t\t\t\n\t\t\t\n\t\t}\n\t\treturn $compteur;\n\n }", "function emscvupload_get_template_part( $slug, $name = null, $atts=array(), $load = true ) {\n\t// Execute code for this part\n\tdo_action( 'get_template_part_' . $slug, $slug, $name );\n\n\t// Setup possible parts\n\t$templates = array();\n\tif ( isset( $name ) )\n\t\t$templates[] = $slug . '-' . $name . '.php';\n\t$templates[] = $slug . '.php';\n\n\t// Allow template parts to be filtered\n\t$templates = apply_filters( 'emscvupload_get_template_part', $templates, $slug, $name );\n\n\t// Return the part that is found\n\treturn emscvupload_locate_template( $templates, $load, false, $atts );\n}", "protected function getDevBypDiskpPart($pDisk, $pPart)\n\t{\n\t\tif ($this->isNVMe($pDisk) && is_numeric($pPart))\n\t\t\t$pDisk .= 'p';\n\t\treturn($pDisk.$pPart);\n\t}", "public function getInfoPart(){\n\t\t$codigoAlterno = $this->input->post('cod_alter');\n\t\t$jsonInfoParte = array();\n\t\tif($codigoAlterno == \"\" || $codigoAlterno == NULL){\n\t\t\t$jsonInfoParte['response_code'] = \"201\";\n\t\t\t$jsonInfoParte['response_msg'] = \"El codigo alterno esta vacio =(!\";\n\t\t}else{\n\t\t\t\n\t\t\t$parteInfo = $this->CatalogoAlmacen_model->getParteByCod($codigoAlterno);\n\t\t\tif(!is_null($parteInfo)){\n\t\t\t\t$jsonInfoParte['response_code'] = \"200\";\n\t\t\t\t$jsonInfoParte['response_msg'] = 'operacion exitosa';\n\t\t\t\t$jsonInfoParte['infoParte'] = $parteInfo;\n\n\t\t\t\t$idParte = $jsonInfoParte['infoParte']->Id_Parte;\n\t\t\t\t$jsonInfoParte['proveedores'] = $this->CatalogoAlmacen_model->getRelProv($codigoAlterno);\n\t\t\t\t$jsonInfoParte['ubicaciones'] = $this->CatalogoAlmacen_model->getRelUbic($idParte);\n\t\t\t}else{\n\t\t\t\t$jsonInfoParte['idPart'] = $this->genIdNext('B');\n\t\t\t\t$jsonInfoParte['response_code'] = \"201\";\n\t\t\t\t$jsonInfoParte['response_msg'] = 'no se encontro informacion';\n\t\t\t}\n\t\t}\n\t\techo json_encode($jsonInfoParte);\n\t}", "protected function partHandle($part)\n {\n // Separate content from headers\n $part = ltrim($part, \"\\r\\n\");\n\n [$rawHeaders, $content] = explode(\"\\r\\n\\r\\n\", $part, 2);\n\n $content = substr($content, 0, strlen($content) - 2);\n // Parse the headers list\n $rawHeaders = explode(\"\\r\\n\", $rawHeaders);\n\n return compact('rawHeaders', 'content');\n }", "public function show(InternalPartOrder $internalPartOrder, $id)\n {\n $ipo = InternalPartOrder::find($id);\n return $ipo;\n }", "public function edit_part()\n {\n $input = JFactory::getApplication()->input;\n\n try\n {\n //-- Get the project\n $project = EcrProjectHelper::getProject();\n }\n catch(Exception $e)\n {\n EcrHtml::message($e);\n\n parent::display();\n\n return;\n }\n\n $group = $input->get('group');\n $part = $input->get('part');\n $element = $input->get('element');\n $scope = $input->get('scope');\n\n if( ! $ecrPart = EcrProjectHelper::getPart($group, $part, $element, $scope, true))\n {\n echo '<h4 style=\"color: red;\">PART not found</h4>';\n\n return;\n }\n\n if( ! method_exists($ecrPart, 'edit'))\n {\n echo '<h4 style=\"color: red;\">EDIT function not found</h4>';\n\n return;\n }\n\n if( ! isset($ecrPart->key)\n || ! isset($project->autoCodes[$ecrPart->key]))\n {\n echo '<h4 style=\"color: red;\">No AutoCode found</h4>';\n\n return;\n }\n\n if(method_exists($ecrPart, 'info'))\n {\n $info = $ecrPart->info();\n\n if( ! get_class($info) == 'EcrProjectPart')\n {\n echo 'Part info must be a EcrProjectPart class.. not : ';\n echo get_class($info);\n\n return;\n }\n\n echo $info->format('erm', 'edit');\n }\n else\n {\n echo '<div style=\"color: blue; font-weight: bold; text-align:center;\">'\n .ucfirst($group).' - '.ucfirst($part)\n .'</div>';\n }\n\n //-- Additional request vars\n echo '<input type=\"hidden\" name=\"group\" value=\"'.$group.'\" />';\n echo '<input type=\"hidden\" name=\"part\" value=\"'.$part.'\" />';\n\n echo $ecrPart->edit($project->autoCodes[$ecrPart->key]);\n }", "static public function ctrShowParts($item, $value, $order){\n\t\t$table = \"parts\";\n\t\t$answer = PartsModel::mdlShowParts($table, $item, $value, $order);\n\t\treturn $answer;\n\t}", "public function getIdPartita() {\n \tif (isset($_REQUEST['id_partita'])) {\n \t\treturn $_REQUEST['id_partita'];\n \t} else\n \t\treturn false;\n }", "public function find_message_parts($struct, $number, $type='text', $subtype=false, $parts=array()) {\n\t\tif (!is_array($struct) || empty($struct)) {\n\t\t\treturn $parts;\n\t\t}\n\t\tforeach ($struct as $id => $vals) {\n\t\t\tif ($number && $id == $number) {\n\t\t\t\t$vals['number'] = $id;\n\t\t\t\t$parts[] = $vals;\n\t\t\t}\n\t\t\telseif (!$number && isset($vals['type']) && $vals['type'] == $type) {\n\t\t\t\tif ($subtype) {\n\t\t\t\t\tif ($subtype == $vals['subtype']) {\n\t\t\t\t\t\t$vals['number'] = $id;\n\t\t\t\t\t\t$parts[] = $vals;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$vals['number'] = $id;\n\t\t\t\t\t$parts[] = $vals;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (empty($res) && isset($vals['subs'])) {\n\t\t\t\t$this->find_message_parts($vals['subs'], $number, $type, $subtype, $parts);\n\t\t\t}\n\t\t}\n\t\treturn $parts;\n\t}", "public function getDetails($parcel) {\n $conn = $this->getConnection();\n $getQuery = \"SELECT noofdwellin, occdate, yearbuilt, yearrem, effage, bathrooms, constclass, fireplace, heating, ac, carstor2, porchsqft,\n decksqft, Deckcover, Patiosqft, Patiocover, Poolsqft, Grflsqft, Upflsqft, Lwrflsqftu, Bsmtflsqfu,\n Atticsqftu FROM resichar where parcel = :parcel\";\n $q = $conn->prepare($getQuery);\n $q->bindParam(\":parcel\", $parcel);\n $q->execute();\n return reset($q->fetchAll());\n }", "function getpartcomments(Request $request) {\n // get part comments\n $this->validate($request, [\n 'part_id' => 'required|integer',\n ]);\n\n $partcomments = DB::table('partcomments')\n ->leftJoin('users', 'users.id', '=', 'partcomments.user_id')\n ->select('partcomments.*', 'users.propic', 'users.name')\n ->where('partcomments.part_id', $request->part_id)\n ->get();\n\n return response()->json(['success'=>true, 'partcomments'=>$partcomments]);\n }", "public function index()\n {\n $parts=Part::get();\n return PartResource::collection($parts);\n }", "public function getPathPart($part)\n\t{\n $path_parts = pathinfo($this->getFullPath());\n return array_key_exists($part, $path_parts)? $path_parts[$part]: '';\n // dirname, basename, extension, filename\n // see http://php.net/manual/en/function.pathinfo.php\n\t}", "private function getProductInformation()\r\n {\r\n \r\n // if product is repairable get the repair agents details as well as products and suppliers\r\n if ($this->claimType == \"repair-warranty\" || $this->claimType == \"repair-no-warranty\" || \r\n $this->claimType == \"repair-no-transaction\")\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplierRepairAgent_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n // if the product is not repairable grab the product information and supplier information only\r\n else\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplier_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n }", "public function getParts()\n\t{\n\t\treturn $this->parts;\n\t}", "public function get_message_part($uid, $message_part=0, $peek=false, $max=false, &$maxReached=false) {\n//\t\t$this->clean($uid, 'uid');\n//\n//\t\t$peek_str = $peek ? '.PEEK' : '';\n//\n//\t\tif (empty($message_part)) {\n//\t\t\t$command = \"UID FETCH $uid BODY\".$peek_str.\"[]\\r\\n\";\n//\t\t}\n//\t\telse {\n//\t\t\t//$this->clean($message_part, 'msg_part');\n//\t\t\t$command = \"UID FETCH $uid BODY\".$peek_str.\"[$message_part]\\r\\n\";\n//\t\t}\n//\t\t$this->send_command($command);\n//\n//\t\t$result = $this->get_response($max, true);\n//\n//\t\t$status = $this->check_response($result, true, false);\n//\n//\t\t$res = '';\n//\t\tforeach ($result as $vals) {\n//\t\t\tif ($vals[0] != '*') {\n//\t\t\t\tcontinue;\n//\t\t\t}\n//\t\t\t$search = true;\n//\t\t\tforeach ($vals as $v) {\n//\t\t\t\tif ($v != ']' && !$search) {\n//\t\t\t\t\t$res = trim(preg_replace(\"/\\s*\\)$/\", '', $v));\n//\t\t\t\t\tbreak 2;\n//\t\t\t\t}\n//\t\t\t\tif (stristr(strtoupper($v), 'BODY')) {\n//\t\t\t\t\t$search = false;\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n//\t\treturn $res;\n\n\t\t$str = '';\n\t\t$this->get_message_part_start($uid,$message_part, $peek);\n\t\twhile ($line = $this->get_message_part_line()) {\n\t\t\t$str .= $line;\n\t\t}\n\t\treturn $str;\n\t}", "public static function getPart($group, $part, $element, $scope, $edit = false)\n {\n $subDir =($edit) ? DS.'data' : '';\n\n $path = ECRPATH_PARTS.$subDir.DS.$group.DS.$part;\n $fileName = $path.DS.'part.php';\n\n if( ! JFile::exists($fileName))\n {\n EcrHtml::message(array(jgettext('File not found'), $fileName), 'error');\n\n return null;\n }\n\n require_once $fileName;\n\n $className = 'part'.ucfirst($group).ucfirst($part);\n\n if( ! class_exists($className))\n {\n EcrHtml::message(array(jgettext('Class not found'), $className), 'error');\n\n return null;\n }\n\n $part = new $className($element, $scope, $path);\n\n return $part;\n }", "public function get_message_part_start($uid, $message_part=0, $peek=false) {\n\t\t$this->clean($uid, 'uid');\n\n\t\t$peek_str = $peek ? '.PEEK' : '';\n\n\t\tif (empty($message_part)) {\n\t\t\t$command = \"UID FETCH $uid BODY\".$peek_str.\"[]\\r\\n\";\n\t\t}\n\t\telse {\n\t\t\t//$this->clean($message_part, 'msg_part');\n\t\t\t$command = \"UID FETCH $uid BODY\".$peek_str.\"[$message_part]\\r\\n\";\n\t\t}\n\t\t$this->send_command($command);\n\t\t$result = fgets($this->handle);\n\t\t\n\t\t$size = false;\n\t\tif (preg_match(\"/\\{(\\d+)\\}\\r\\n/\", $result, $matches)) {\n\t\t\t$size = $matches[1];\n\t\t}\n\n//\t\tif(!$size)\n//\t\t\treturn false;\n\n\t\t$this->message_part_size=$size;\n\t\t$this->message_part_read=0;\n\n//\t\t\\GO::debug(\"Part size: \".$size);\n\t\treturn $size;\n\t}", "public function parts_name()\n {\n $names = $this->insp_model->get_parts();\n echo json_encode($names);\n //return $names;\n }", "public function render(){\n\n\t\t$part = $this->arguments['part'];\n\t\t$trailer = $this->arguments['trailer'];\n\n\t\t$partAssembled = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\KcHumbaurProducts\\Domain\\Repository\\PartReferenceRepository');\n\t\t$partAssembledArray;\n\t\t/*if (is_array($parts) || is_object($parts)){\n\t\t\tforeach($parts as $part){\n\t\t\t\t$partAssembledArray[] = $partAssembled->findIfAssembled($part->getUid(), $trailer->getUid());\n\t\t\t}\n\t\t}*/\n\t\t$partAssembledArray[] = $partAssembled->findIfAssembled($part->getUid(), $trailer->getUid());\n\t\treturn $partAssembled->searchForAssembled('1', $partAssembledArray);\n\t}", "protected function getPartProcessor($type)\n {\n return $this->getProcessor(self::PART_PROCESSOR_KEY, $type);\n }", "protected function getPartProcessor($type)\n {\n return $this->getProcessor(self::PART_PROCESSOR_KEY, $type);\n }", "protected function part($part)\n {\n ['rawHeaders' => $rawHeaders, 'content' => $content] = $this->partHandle($part);\n\n return $this->dataHandle(\n $this->headers($rawHeaders),\n $content\n );\n }", "public function get_parts() {\n return $this->parts;\n }", "function part($name, $type) {\r\n\t\t$return_value = false;\r\n\t\t$name = (string) $name;\r\n\t\t$type = $this->data_type($type);\r\n\r\n\t\tif ($type != '') {\r\n\t\t\t$return_value = '<part name=\"' . $name . '\" type=\"' . $type . '\" />';\r\n\t\t} // end: if\r\n\r\n\t\treturn $return_value;\r\n\t}", "function tep_get_prid($uprid) {\n $pieces = explode('{', $uprid);\n\n return $pieces[0];\n }", "public function getParts()\n {\n return $this->parts;\n }", "public function getParts()\n {\n return $this->parts;\n }", "function matching_parts()\n{\n\tinclude 'storedInfo.php';\n\tini_set('display_errors', 'On');\n\t$part_match = $_POST['same_LegoPart'];\n\t\n\t$mysqli = new mysqli(\"oniddb.cws.oregonstate.edu\", \"jonesmi-db\", $myPassword, \"jonesmi-db\");\n\tif ($mysqli->connect_errno) \n\t{\n\t\t//echo \"Failed to connect to MySQL: (\" . $mysqli->connect_errno . \") \" . $mysqli->connect_error;\n\t} else \n\t{\n\t\t//echo \"connection worked!<br><br>\";\n\t} \n\tif (!($stmt = $mysqli->prepare(\"SELECT MissingPiece.element_num, MissingPiece.part_desc, LibraryUsers.userName\n\tFROM LibraryUsers\n\tINNER JOIN UserMissing ON LibraryUsers.id = UserMissing.uid\n\tINNER JOIN MissingPiece ON MissingPiece.id = UserMissing.pid\n\tWHERE MissingPiece.element_num = ?\"))) \n\t{\n\t\techo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t}\n\tif(!($stmt->bind_param(\"i\",$part_match)))\n\t{\n\t\techo \"Bind failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t}\n\tif (!$stmt->execute()) \n\t{\n\t\techo \"Execute failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t}\n\n\t$out_quantity = NULL;\n\t$out_element_num = NULL;\n\t$out_part_desc = NULL;\n\t$out_userName = NULL;\n\n\tif (!$stmt->bind_result($out_element_num, $out_part_desc, $out_userName)) \n\t{\n\t\techo \"Binding output parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\n\t}\n\t\n\t$display_string = \"<table style = 'text-align:center;' border = '1'> <tr> <th> Element Number </th><th> Part Description </th><th> Requestor</th></tr>\";\n\n\t\t// Insert a new row in the table for each person returned\n\t\twhile($stmt -> fetch())\n\t\t{\n\t\t\t$display_string .= \"<tr>\";\n\t\t\t$display_string .= \"<td>\".$out_element_num.\"</td>\";\n\t\t\t$display_string .= \"<td>\".$out_part_desc.\"</td>\";\n\t\t\t$display_string .= \"<td>\".$out_userName.\"</td>\";\n\t\t\t$display_string .= \"</tr>\";\n\t\t}\n\t$display_string .= \"</table>\";\n\techo $display_string;\n\t$stmt->close();\n\n}", "protected function getPartHeaderRaw($part)\r\n\t{\r\n\t\treturn $this->getData($part['starting-pos'], $part['starting-pos-body']);\r\n\t}", "function list_chambers() {\n\n // Database connection \n $conn = database_connection($kindId);\n global $CHAMBER_KIND_OF_PART_ID;\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $CHAMBER_KIND_OF_PART_ID . \"' AND IS_RECORD_DELETED = 'F'\"; //select data or insert data\n //$sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $kindId . \"' AND IS_RECORD_DELETED = 'F'\"; //select data or insert data\n // Execute query \n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result = array();\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n echo '<li><a class=\"foils\" href=\"#\"> ' . $row['SERIAL_NUMBER'] . '</a></li>';\n }\n return 1;\n}", "function contactus($pid)\n{\n\t$cname=mysql_fetch_array(mysql_query(\"select contact_us_desc from manage_property where pid='$pid'\"));\n\treturn $cname['contact_us_desc'];\n}", "private function fetch_part_lists($physmessage_id, $part = NULL) {\n\n /*\n * Cached content exists?\n */\n// $cache_key = \"RAW_MESSAGE_{$physmessage_id}_{$part}\";\n// $raw_message_cached = $this->get_cache($cache_key);\n// if (is_object($raw_message_cached)) {\n// return $raw_message_cached;\n// }\n\n $query = \" SELECT dbmail_partlists.part_depth, dbmail_partlists.is_header, dbmail_mimeparts.data \"\n . \" FROM dbmail_partlists \"\n . \" INNER JOIN dbmail_mimeparts on dbmail_partlists.part_id = dbmail_mimeparts.id \"\n . \" WHERE dbmail_partlists.physmessage_id = {$this->dbmail->escape($physmessage_id)} \";\n\n if (strlen($part) > 0) {\n $query .= \" AND dbmail_partlists.part_id = {$this->dbmail->escape($part)} \";\n }\n\n $query .= \" ORDER BY dbmail_partlists.part_key, dbmail_partlists.part_order ASC \";\n\n $result = $this->dbmail->query($query);\n\n $mimeParts = array();\n while ($row = $this->dbmail->fetch_assoc($result)) {\n $mimeParts[] = $row;\n }\n\n $depth = 0;\n $prevdepth = 0;\n $finalized = false;\n $is_header = true;\n $prev_header = true;\n $got_boundary = false;\n $prev_boundary = false;\n $prev_is_message = false;\n $is_message = false;\n $boundary = '';\n $blist = array();\n $index = 0;\n $header = '';\n $body = '';\n $newline = \"\\r\\n\";\n\n foreach ($mimeParts as $mimePart) {\n\n $depth = $mimePart['part_depth'];\n $is_header = $mimePart['is_header'];\n $blob = $mimePart['data'];\n\n if ($is_header) {\n $prev_boundary = $got_boundary;\n\n $is_message = preg_match('~content-type:\\s+message/rfc822\\b~i', $blob);\n }\n\n $got_boundary = false;\n\n $matches = array();\n //$pattern = '~^content-type:\\s+.*;(\\r?\\n\\s.*)*\\s+boundary=\"?([a-z0-9\\'()+_,-./:=\\?\\\\s]*)\"?~mi';\n $pattern = '~^content-type:\\s+.*;(\\r?\\n\\s.*)*\\s+boundary=\"?([a-z0-9\\'()+_,-./:=\\?\\s]*)\"?~mi';\n if ($is_header && preg_match($pattern, $blob, $matches)) {\n list(,, $boundary) = $matches;\n $got_boundary = true;\n $blist[$depth] = trim($boundary);\n }\n\n /*\n * Code to handle the end of a mime part\n * \n * Testing if:\n * - Previous part was initial part\n * - This part is deeper than the previous (otherwise this part is finalized and the boundary is scrapped)\n * - If a Boundary has been found\n */\n while (($prevdepth > 0) && ($prevdepth - 1 >= $depth) && $blist[$prevdepth - 1]) {\n $body .= $newline . \"--\" . $blist[$prevdepth - 1] . \"--\" . $newline;\n unset($blist[$prevdepth - 1]);\n $prevdepth--;\n $finalized = true;\n }\n\n if (($depth > 0) && (!empty($blist[$depth - 1]))) {\n $boundary = $blist[$depth - 1];\n }\n\n\n /*\n * Code to handle the end of the body\n */\n if ($is_header && (!$prev_header || $prev_boundary || ($prev_header && $depth > 0 && !$prev_is_message))) {\n //if ($is_header && (!$prev_header || $prev_boundary || ($prev_header && $depth > 0 && $prev_is_message))) {\n if ($prevdepth > 0) {\n $body .= $newline;\n }\n $body .= \"--\" . $boundary . $newline;\n }\n\n /*\n * Let's handle what we have in the BLOB\n * \n */\n if ($is_header && $depth == 0) {\n $header .= $blob;\n } else {\n $body .= $blob;\n }\n\n $body .= $newline;\n\n /*\n * Saving stuff for next iteration\n */\n $prevdepth = $depth;\n $prev_header = $is_header;\n $prev_is_message = $is_message;\n $index++;\n }\n\n if ($index > 2 && $boundary && !$finalized) {\n $body .= $newline . \"--\" . $boundary . \"--\" . $newline;\n }\n\n $response = new stdClass();\n $response->header = $header;\n $response->body = $body;\n\n /*\n * Store cached content\n */\n// $this->update_cache($cache_key, $response);\n\n return $response;\n }", "public function getPart(string $location, int $offset, ?int $limit = null): string;", "abstract protected function extractProductDetail();", "function findName($part) {\n\t\t$name_cut = explode(\" \", $part, 2)[0];\n\t\t$name_cut = explode(\">\", $name_cut, 2)[0];\n\t\t$name_cut = explode(\"\\n\", $name_cut, 2)[0];\n\t\t$name_cut = preg_replace('/\\s+/', '', $name_cut);\n\t\t$name_cut = strtolower(str_replace('/', '', $name_cut));\n\t\treturn $name_cut;\n\t}", "public function getProductDataByUid($searchUid, $appUuid)\n {\n $headers = [];\n $headers[] = \"Content-Type: application/json\";\n $curlCall = curl_init();\n curl_setopt($curlCall, CURLOPT_URL, $this::BASE_URL_REST_SERVICE . $appUuid . \"/\" . $searchUid);\n curl_setopt($curlCall, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curlCall, CURLOPT_HTTPGET, true);\n curl_setopt($curlCall, CURLOPT_HTTPHEADER, $headers);\n $result = curl_exec($curlCall);\n if (curl_errno($curlCall)) {\n return null;\n } else {\n $result = json_decode($result, true);\n return $result;\n }\n }", "public function detail_sparepart($link_produk){\n\t\treturn $this->get_sparepart_by_link($link_produk);\n\t}", "public function checkPartAJAX($id, $pid, $part){\n $query = \"\n SELECT\n `structure_data`.`part`\n FROM\n `structure`,\n `structure_data`\n WHERE\n `structure`.`pid` = '\".$pid.\"' &&\n `structure`.`id` NOT IN ('\".$id.\"') &&\n `structure_data`.`part` = '\".$part.\"' &&\n `structure`.`id` = `structure_data`.`id`\n \";\n\n if(mysql_num_rows(mysql_query($query)) > 0){\n return 'false';\n }else{\n return 'true';\n };\n }", "public function findPartBySerialOrBatchNum(StockItem $stockItem, $serialOrBatchNum)\n {\n if (!$stockItem) {\n return response()->json(['message' => 'The stock item doesn\\'t exist!'], 409);\n }\n\n $serialOrBatchNumCol = null;\n if ($stockItem->component_type == ComponentTypeEnum::EXPENDABLE) {\n $serialOrBatchNumCol = \"batch_num\";\n } else {\n $serialOrBatchNumCol = \"serial_num\";\n }\n\n $part = Part::where('stock_item_id', $stockItem->id)\n ->where($serialOrBatchNumCol, $serialOrBatchNum)\n ->first();\n\n if (!$part) {\n return response()->json(['message' => 'The part doesn\\'t exist!'], 409);\n }\n\n return response()->json($part, 200);\n }", "public function part()\n {\n return $this->belongsTo(Part::class);\n }", "public function setVendorPartNumber(string $vendorPartNumber): self\n {\n $this->vendorPartNumber = $vendorPartNumber;\n\n return $this;\n }", "public function decodePart(Email $email, $part, $part_number = false)\n {\n $options = ($this->mark_as_read) ? FT_UID : FT_UID | FT_PEEK;\n\n if ($part_number) {\n $data = imap_fetchbody(\n $this->stream(),\n $email->id(),\n $part_number,\n $options\n );\n } else {\n $data = imap_body($this->stream(), $email->id(), $options);\n }\n\n switch ($part->encoding) {\n case 1:\n $data = imap_utf8($data);\n break;\n\n case 2:\n $data = imap_binary($data);\n break;\n\n case 3:\n $data = imap_base64($data);\n break;\n\n case 4:\n $data = quoted_printable_decode($data);\n break;\n }\n\n $params = array();\n if (isset($part->parameters)) {\n foreach ($part->parameters as $param) {\n $params[strtolower($param->attribute)] = $param->value;\n }\n }\n\n if (isset($part->dparameters)) {\n foreach ($part->dparameters as $param) {\n $params[strtolower($param->attribute)] = $param->value;\n }\n }\n\n // is this part an attachment\n $attachment_id = false;\n $is_attachment = false;\n\n if (\n isset($part->disposition)\n && in_array(strtolower($part->disposition), array('attachment', 'inline'))\n && $part->subtype != 'PLAIN'\n ) {\n $is_attachment = true;\n $attachment_type = strtolower($part->disposition);\n\n if ($attachment_type == 'inline') {\n $is_inline_attachment = true;\n $attachment_id = isset($part->id) ? trim($part->id, \" <>\") : false;\n } else {\n $is_inline_attachment = false;\n $attachment_id = rand();\n }\n }\n\n // if there is an attachment\n if ($is_attachment) {\n $file_name = false;\n\n if (isset($params['filename'])) {\n $file_name = $params['filename'];\n } elseif (isset($params['name'])) {\n $file_name = $params['name'];\n }\n\n if ($file_name) {\n $file_name = $attachment_id . '-' . $file_name;\n\n $attachment = new EmailAttachment();\n $attachment->setId($attachment_id);\n $attachment->setName($file_name);\n\n if ($is_inline_attachment) {\n $attachment->setType('inline');\n } else {\n $attachment->setType('attachment');\n }\n\n if ($this->save_attachments) {\n $attachment->setFilePath(\n $this->attachment_dir . DIRECTORY_SEPARATOR . $attachment->name()\n );\n\n if ($this->attachment_dir && $attachment->filePath()) {\n if (!file_exists($attachment->filePath())) {\n file_put_contents($attachment->filePath(), $data);\n }\n }\n } else {\n //$attachment->setAttachmentContent($data);\n }\n\n $email->addAttachment($attachment);\n }\n } else {\n // if the charset is set, convert to our encoding UTF-8\n if (!empty($params['charset'])) {\n $data = $this->convertEncoding($data, $params['charset']);\n }\n\n // part->type = 0 is TEXT or TYPETEXT\n if (isset($part->type)) {\n if ($part->type == 0) {\n // subpart is either plain text or html version\n if (strtoupper($part->subtype) == 'PLAIN') {\n $email->setPlain($data);\n } else {\n $email->setHTML($data);\n }\n\n // part->type = 2 is MESSAGE\n } elseif ($part->type == 2) {\n $email->setPlain($data);\n }\n }\n }\n\n // rerun for additional parts\n if (!empty($part->parts)) {\n foreach ($part->parts as $subpart_number => $subpart) {\n if ($part->type == 2 && $part->subtype == 'RFC822') {\n $this->decodePart($email, $subpart, $part_number);\n } else {\n $this->decodePart($email, $subpart, $part_number . '.' . ($subpart_number + 1));\n }\n }\n }\n\n return trim($data);\n }", "function get_product_name($pid){\n\t$products = \"scart_products\"; // products table\n\t$serial = \"bookid\"; // products key\n\t$name = \"book_name\"; // products name\n\t$result=mysql_query(\"select $name from $products where $serial=$pid\")\n or die (\"Query $products and pid - $pid - failed error message: \\\"\" . mysql_error () . '\"');\n\t$row=mysql_fetch_array($result);\n\treturn $row[$name];\n}", "function fusion_wc_get_template_part( $slug, $name = '' ) {\n\t\tif ( function_exists( 'wc_get_template_part' ) ) {\n\t\t\twc_get_template_part( $slug, $name );\n\t\t} elseif ( function_exists( 'woocommerce_get_template_part' ) ) {\n\t\t\twoocommerce_get_template_part( $slug, $name );\n\t\t}\n\t}", "function listarPartidaEjecucion(){\n\t\t$this->procedimiento='pre.ft_partida_ejecucion_sel';\n\t\t$this->transaccion='PRE_PAREJE_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tipo_cc','id_tipo_cc','int4');\n\t\t\n\t\t$this->capturaCount('total_egreso_mb','numeric');\n\t\t$this->capturaCount('total_ingreso_mb','numeric');\n\t\t$this->capturaCount('total_monto_anticipo_mb','numeric');\n\t\t$this->capturaCount('total_monto_desc_anticipo_mb','numeric');\n\t\t$this->capturaCount('total_monto_iva_revertido_mb','numeric');\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_partida_ejecucion','int4');\n\t\t$this->captura('id_int_comprobante','int4');\n\t\t$this->captura('id_moneda','int4');\n $this->captura('moneda','varchar');\n\t\t$this->captura('id_presupuesto','int4');\n $this->captura('desc_pres','varchar');\n $this->captura('codigo_categoria','varchar');\n\t\t$this->captura('id_partida','int4');\n $this->captura('codigo','varchar');\n $this->captura('nombre_partida','varchar');\n\t\t$this->captura('nro_tramite','varchar');\n\t\t$this->captura('tipo_cambio','numeric');\n\t\t$this->captura('columna_origen','varchar');\n\t\t$this->captura('tipo_movimiento','varchar');\n\t\t$this->captura('id_partida_ejecucion_fk','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('fecha','date');\n\t\t$this->captura('egreso_mb','numeric');\n\t\t$this->captura('ingreso_mb','numeric');\n\t\t$this->captura('monto_mb','numeric');\n\t\t$this->captura('monto','numeric');\n\t\t$this->captura('valor_id_origen','int4');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\t\t\n\t\t$this->captura('id_tipo_cc','int4');\n\t\t$this->captura('desc_tipo_cc','varchar');\n\t\t\n\t\t$this->captura('nro_cbte','varchar');\n\t\t$this->captura('id_proceso_wf','int4');\n\t\t\n\t\t$this->captura('monto_anticipo_mb','numeric');\n\t\t$this->captura('monto_desc_anticipo_mb','numeric');\n\t\t$this->captura('monto_iva_revertido_mb','numeric');\n\t\t\n\t\t$this->captura('glosa1','varchar');\t\t\n\t\t$this->captura('glosa','varchar');\n\t\t\n\t\t$this->captura('cantidad_descripcion','numeric');\n\n $this->captura('total_pago','numeric');\n $this->captura('desc_contrato','varchar');\n $this->captura('obs','varchar');\n $this->captura('tipo_ajuste_formulacion','varchar'); //#41\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function fs_get_template_parts( $parts = array() ) {\r\n\tforeach ( $parts as $part ) {\r\n\t\tget_template_part( $part );\r\n\t};\r\n}", "protected function getPartitionNumber($vDisk, $vPart, $return = null)\n\t{\n\t\t// On RAIDs there is nor partition number\n\t\tif ($this->isDiskRaid($vDisk))\n\t\t\treturn('');\n\t\n\t\treturn($this->fdiskGetProperty($this->wantedPartitioning[$vDisk][$vPart]['nr'], \"ERROR: \\$this->wantedPartitioning[$vDisk][$vPart]['nr'] not set.\", $return));\n\t}", "public function get_drive_info($drive)\n {\n clearos_profile(__METHOD__, __LINE__);\n \n try {\n $shell = new Shell();\n $args = '-i ' . $drive;\n $options['validate_exit_code'] = FALSE;\n $options['env'] = 'LANG=en_US';\n $shell->execute(self::CMD_SMARTCTL, $args, TRUE, $options);\n $retval = $shell->get_output();\n } catch (Exception $e) {\n //do nothing\n }\n\n foreach ($retval as $line) {\n if (preg_match('/SMART support is/', $line)) {\n $line2 = \" \".$line;\n $pieces = explode(\":\", $line2);\n $support = trim($pieces[1]);\n if(preg_match('/Available/', $support))\n $output['available'] = TRUE;\n if(preg_match('/Enabled/', $support))\n $output['enabled'] = TRUE;\n }\n if (preg_match('/Device supports SMART/', $line)) {\n $output['available'] = TRUE;\n if (preg_match('/and is Enabled/', $line))\n $output['enabled'] = TRUE;\n }\n if (preg_match('/Model Family/', $line)) {\n $line2 = \" \".$line;\n $pieces = explode(\":\", $line2);\n $value = trim($pieces[1]);\n $output['model'] = $value;\n }\n if (preg_match('/Device Model/', $line)) {\n $line2 = \" \".$line;\n $pieces = explode(\":\", $line2);\n $value = trim($pieces[1]);\n $output['device'] = $value;\n } \n if (preg_match('/Serial Number/', $line)) {\n $line2 = \" \".$line;\n $pieces = explode(\":\", $line2);\n $value = trim($pieces[1]);\n $output['serial'] = $value;\n }\n if (preg_match('/User Capacity/', $line)) {\n $line2 = \" \".$line;\n $line2 = preg_replace('/\\s+/m', \"|\", $line);\n $pieces = explode(\"|\", $line2);\n $value = preg_replace('/,/', '', $pieces[2]);\n $output['capacity'] = round($value/(1000*1000*1000));\n }\n }\n return $output;\n }" ]
[ "0.63410145", "0.6182517", "0.61764985", "0.60918325", "0.6057426", "0.5983155", "0.5972876", "0.5933482", "0.5907702", "0.5903215", "0.58501124", "0.58047414", "0.57543623", "0.5741276", "0.57096606", "0.57059246", "0.56646955", "0.5619997", "0.56184435", "0.5578696", "0.5560452", "0.5524327", "0.5513238", "0.5488828", "0.5480965", "0.54745865", "0.5471861", "0.54224235", "0.54030293", "0.5392433", "0.5369306", "0.536512", "0.5322198", "0.53204316", "0.5314571", "0.5314203", "0.53059727", "0.52804416", "0.52780706", "0.5260294", "0.5258403", "0.5233364", "0.5196546", "0.51814044", "0.51540273", "0.51362205", "0.5130573", "0.5128595", "0.512781", "0.5118207", "0.5115135", "0.50859123", "0.5080111", "0.50675625", "0.5046822", "0.5033206", "0.49989906", "0.49953005", "0.499156", "0.49834514", "0.49739674", "0.49703324", "0.4960675", "0.4926849", "0.49182928", "0.4918291", "0.49126667", "0.48935935", "0.48885545", "0.48727158", "0.48670885", "0.4841494", "0.4841494", "0.4840784", "0.4834113", "0.48332474", "0.4832194", "0.48268142", "0.48268142", "0.48055255", "0.48044235", "0.47941235", "0.47888783", "0.47870037", "0.47788706", "0.47724965", "0.47714716", "0.4762817", "0.47576115", "0.47570002", "0.47496822", "0.4747808", "0.47413236", "0.4738946", "0.47366247", "0.47360447", "0.47242576", "0.4692736", "0.46827194", "0.46792144" ]
0.7160516
0
Get inventory quantity information for a part $param string $partNum
public function getInvQty($partNum) { // Setup xml $xml = "<InvQtyRq>\n<PartNum>{$partNum}</PartNum>\n</InvQtyRq>\n"; // Create request and pack $this->createRequest($xml); $len = strlen($this->xmlRequest); $packed = pack("N", $len); // Send and get the response fwrite($this->id, $packed, 4); fwrite($this->id, $this->xmlRequest); $this->getResponse(); // Set the result $this->setResult($this->parseXML($this->xmlResponse)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findInventoryByPart($partno) {\n\n $query = $this->getEntityManager()\n ->createQuery('\n SELECT\n s.rackno, s.diecode, s.heatcode, s.inqty, s.onhold,\n m.dano, m.partno, m.batchno, m.indate,\n l.shipdate\n FROM\n CIRBundle:SumitomoSub s\n JOIN\n s.main m\n JOIN\n s.log l\n WHERE\n m.partno = :partno\n ')->setParameter('partno', $partno);\n\n try {\n return $query->getResult();\n } catch(\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n }\n }", "public function getQty();", "public function getQty();", "public function getQuantity();", "public function getQuantity();", "public function getQuantity();", "public function getPart($partNum, $upc) {\n \t// Setup xml\n \t$xml = \"<PartGetRq>\\n\";\n \tif (!is_null($partNum)) {\n \t\t$xml .= \"<Number>{$partNum}</Number>\\n\";\n \t} else {\n \t\t$xml .= \"<Number>{$upc}</Number>\\n\";\n \t}\n \t$xml .= \"</PartGetRq>\\n\";\n\t\t\n // Create request and pack\n\t\t$this->createRequest($xml);\n $len = strlen($this->xmlRequest);\n $packed = pack(\"N\", $len);\n\n // Send and get the response\n fwrite($this->id, $packed, 4);\n fwrite($this->id, $this->xmlRequest);\n $this->getResponse();\n\n // Set the result\n $this->setResult($this->parseXML($this->xmlResponse));\n }", "function in($code=\"\", $category=\"\", $qty=0, $nominal=\"\", $desc=\"\", $type=INVENTORY_TYPE, $warehouse=0)\n {\n $product = $this->m_product->getdata_detail(array(\"product_variant_code\"=>$code));\n\n if($code==\"\" || $category==\"\" || $qty==\"\" || $nominal==\"\" || $product->num_rows()!=1)\n {\n die(\"parameter insert inventory harus di lengkapi, item code : $code, category : $category\");\n }\n\n $data = $this->getdata(array(\"inventory_item_code\"=>$code, \"inventory_categories\"=>$category),1,\"\",\"inventory_id\",\"desc\");\n\n // jika tidak ada item ini di inventory maka tidak perlu kalkulasi stock_awal, average_nominal dll\n if($data->num_rows()!=1)\n {\n $stock_awal = 0;\n $nominal_awal = 0;\n $nominal_average = $nominal;\n $total_qty = $qty;\n $total_nominal = $nominal*$qty;\n }\n else {\n // hitung average\n for($a=0;$a<($qty+$data->row()->inventory_total_stock_now);$a++)\n {\n if($a<$qty)\n {\n $avr[] = $nominal;\n }\n else {\n $avr[] = $data->row()->inventory_average_nominal_now_per_item;\n }\n }\n\n $nominal_average = array_sum($avr)/($qty+$data->row()->inventory_total_stock_now);\n $stock_awal = $data->row()->inventory_total_stock_now;\n $nominal_awal = $data->row()->inventory_total_nominal_now;\n $total_qty = $data->row()->inventory_total_stock_now+$qty;\n $total_nominal = $data->row()->inventory_total_nominal_now+($nominal*$qty);\n }\n\n // set nama product\n if($product->row()->product_variant_type==\"\" || $product->row()->product_variant_value==\"\")\n {\n $name = $product->row()->product_name;\n }\n else {\n $name = $product->row()->product_name.\" - \".$product->row()->product_variant_type.\" - \".$product->row()->product_variant_value;\n }\n\n // set log inventory\n if($desc==\"\")\n {\n $desc = \"insert by \".$this->session->userdata('username');\n }\n\n $data_insert = array(\n \"inventory_item_code\" => $code,\n \"inventory_name\" => $name,\n \"inventory_categories\" => $category,\n \"inventory_item_type\" => $type,\n \"inventory_operator\" => \"in\",\n \"inventory_qty\" => $qty,\n \"inventory_nominal_per_item\" => $nominal,\n \"inventory_total_nominal\" => $nominal*$qty,\n \"inventory_stock_awal\" => $stock_awal,\n \"inventory_nominal_stock_awal\" => $nominal_awal,\n \"inventory_average_nominal_now_per_item\" => $nominal_average,\n \"inventory_total_stock_now\" => $total_qty,\n \"inventory_total_nominal_now\" => $total_nominal,\n \"inventory_warehouse_id\" => $warehouse,\n \"inventory_date_craeted\" => date('Y-m-d H:i:s'),\n \"inventory_log\" => $desc,\n );\n $this->db->insert('inventory', $data_insert);\n return $this->db->insert_id();\n }", "public static function GetQuantity($INVOICEDID,$incomingInvTyp)\r\n\t{\r\n\t\t$Query = \"SELECT qty FROM incominginventory WHERE incoming_inventory_id = $INVOICEDID\";\r\n \r\n //comment by gajendra\r\n //~ if($incomingInvTyp == \"E\")\r\n //~ {\r\n //~ $Query = \"SELECT ExciseQty FROM incominginventory WHERE entryDId = $INVOICEDID\";\r\n //~ }\r\n //~ else if($incomingInvTyp == \"N\")\r\n //~ {\r\n //~ $Query = \"SELECT NonExciseQty FROM incominginventory WHERE entryDId = $INVOICEDID\";\r\n //~ }\r\n //echo $Query;\r\n //end\r\n $Result = DBConnection::SelectQuery($Query);\r\n $Row = mysql_fetch_array($Result, MYSQL_ASSOC);\r\n $Qty = empty($Row['qty'])?'0':$Row['qty'];\r\n //comment by gajendra\r\n //~ if($incomingInvTyp == \"E\")\r\n //~ {\r\n //~ $Qty = $Row['ExciseQty'];\r\n //~ }\r\n //~ else if($incomingInvTyp == \"N\")\r\n //~ {\r\n //~ $Qty = $Row['NonExciseQty'];\r\n //~ }\r\n //end\r\n return $Qty;\r\n\t}", "public function actionWalmartproductinventoryinfo()\n {\n $sku = false;\n $productdata = \"add sku on url like ?sku=product_sku\";\n if (isset($_GET['sku'])) {\n $sku = $_GET['sku'];\n }\n $merchant_id = MERCHANT_ID;\n $config = Data::getConfiguration($merchant_id);\n $walmartHelper = new Walmartapi($config['consumer_id'], $config['secret_key']);\n if ($sku) {\n $productdata = $walmartHelper->getInventory($sku);\n }\n\n print_r($productdata);\n die;\n }", "public static function checkStock($partId,$quantitySelected) {\n $stocks = Stock::find()->where(['part_id' => $partId])->andWhere(['>','quantity','0'])->all();\n $data = array();\n $quantityNeeded = $quantitySelected;\n foreach ($stocks as $stock){\n $stockId = $stock->id;\n /* if quantity needed already fulfilled */\n if ( $quantityNeeded > 0 ) {\n $data['stock_id'][] = $stockId;\n $stockQuantity = $stock->quantity;\n /* if st_qty is enough for stock out */\n if ( $stockQuantity >= $quantityNeeded ) {\n /* A :: stock 11 .... selected 10 */\n /* deduct stock quantity see how much left */\n $stockQuantity -= $quantityNeeded;\n\n /* set how many quantity of stock used for this stock id */\n $data['quantity_used'][] = $quantityNeeded;\n\n /* set quantity to zero as the stock is already enough */\n $quantityNeeded = 0;\n /* A :: stockQuantity become 1 */\n\n\n } else if ( $stockQuantity < $quantityNeeded) {\n /* B :: stock 10 .... selected 11 */\n /* see how many more stock needed */\n $quantityNeeded -= $stockQuantity;\n\n /* set how many quantity of stock used for this stock id */\n $data['quantity_used'][] = $stockQuantity;\n \n /* set stockQuantity to zero as all the stock will be used for the needed */\n $stockQuantity = 0;\n /* A :: stockQuantity become 0 */\n }\n\n $data['stock_quantity'][] = $stockQuantity;\n\n }\n }\n \n return $data;\n }", "public function show(StockItem $stockItem, Part $part)\n {\n if (!$stockItem) {\n return response()->json(['message' => 'The stock item doesn\\'t exist!'], 409);\n }\n if (!$part) {\n return response()->json(['message' => 'The part doesn\\'t exist!'], 409);\n }\n\n $serialOrBatchNumCol = null;\n $serialOrBatchNumColOrder = null;\n if ($stockItem->component_type == ComponentTypeEnum::EXPENDABLE) {\n $serialOrBatchNumCol = \"parts.batch_num as batch_num\";\n $serialOrBatchNumColOrder = \"parts.batch_num\";\n } else {\n $serialOrBatchNumCol = \"parts.serial_num as serial_num\";\n $serialOrBatchNumColOrder = \"parts.serial_num\";\n }\n\n $partVal = Part::join('users as users', function ($q) {\n $q->where('users.id', '=', auth()->user()->id);\n })\n ->join('stock_items', 'stock_items.id', '=', 'parts.stock_item_id')\n ->leftJoin('quantity_units', 'quantity_units.id', '=', 'parts.quantity_unit_id')\n ->leftJoin('aircraft_types', 'aircraft_types.id', '=', 'parts.aircraft_type_id')\n ->leftJoin('aircrafts', 'aircrafts.aircraft_type_id', '=', 'aircraft_types.id')\n ->join('a_t_a_chapters', 'a_t_a_chapters.id', '=', 'stock_items.a_t_a_chapter_id')\n ->join('owners', 'owners.id', '=', 'parts.owner_id')\n ->where('parts.id', $part->id)\n ->orderBy($serialOrBatchNumColOrder, 'asc')\n ->select([\n 'parts.id as id',\n $serialOrBatchNumCol,\n\n 'parts.quantity_alarm as quantity_alarm',\n 'parts.quantity_unit_id as quantity_unit_id',\n\n 'parts.note as note',\n\n 'parts.is_depleted as is_depleted',\n\n 'stock_items.component_category as component_category',\n 'stock_items.component_type as component_type',\n\n 'aircraft_types.id as aircraft_type_id',\n 'aircraft_types.name as aircraft_type_name',\n 'parts.aircraft_id as aircraft_id',\n 'parts.parent_part_id as parent_part_id',\n\n 'owners.id as owner_id',\n 'owners.name as owner_name',\n\n 'a_t_a_chapters.id as a_t_a_chapter_id',\n 'a_t_a_chapters.code as a_t_a_chapter_code',\n 'a_t_a_chapters.name as a_t_a_chapter_name',\n\n 'stock_items.id as stock_idem_id',\n 'stock_items.name as name',\n 'stock_items.init_part_num as init_part_num',\n\n DB::raw(\"convert_tz(parts.created_at, 'UTC', users.timezone) as created_at\"),\n DB::raw(\"convert_tz(parts.updated_at, 'UTC', users.timezone) as updated_at\"),\n ])->first();\n\n if (!$partVal) {\n return response()->json(['message' => 'The part doesn\\'t exist!'], 409);\n }\n\n return response()->json($partVal, 200);\n }", "function product_get_qty( $object, $field_name, $request ) {\n\treturn get_post_meta( $object[ 'id' ], 'product_qty', true );\n}", "function get_available_parts($part_id, $version) {\n // Database connection \n $conn = database_connection();\n\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND SERIAL_NUMBER LIKE '%\" . $version . \"%' AND IS_RECORD_DELETED = 'F' AND PART_ID not in (select PART_ID from CMS_GEM_CORE_CONSTRUCT.PHYSICAL_PARTS_TREE) ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\"; //select data or insert data \n\n\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_arr = array();\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n echo '<li><a href=\"#\" class=\"availablepart\" >' . $row['SERIAL_NUMBER'] . '</a></li>';\n\n// $temp['man_id']= $row['MANUFACTURER_ID'];\n// $temp['man_name']= $row['MANUFACTURER_NAME'];\n// $result_arr[] = $temp;\n }\n return 1;\n}", "public function getQuantity() \n {\n return $this->_fields['Quantity']['FieldValue'];\n }", "public function getQuantity()\n\t{\n\t\treturn $this->getKeyValue('quantity'); \n\n\t}", "public function add_inventory($productName,$quantity){\r\n // math\r\n $conn = new mysqli($GLOBALS['servername'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);\r\n $preSql = \"Select quantity from inventory where productName = '$productName'\";\r\n $preResult = $conn->query($preSql);\r\n $preRow = $preResult->fetch_assoc();\r\n $total = $preRow[\"quantity\"] + $quantity;\r\n // query\r\n $sql = \"Update inventory SET quantity = '$total' WHERE productName = '$productName'\";\r\n $conn->query($sql);\r\n }", "function out($code=\"\", $category=\"\", $qty=0, $desc=\"\", $type=INVENTORY_TYPE, $warehouse=0)\n {\n $product = $this->m_product->getdata_detail(array(\"product_variant_code\"=>$code));\n\n // $data = $this->getdata(array(\"inventory_item_code\"=>$code, \"inventory_categories\"=>$category, \"inventory_operator\"=>\"in\"),1,\"\",\"inventory_id\",\"desc\");\n $data = $this->getdata(array(\"inventory_item_code\"=>$code, \"inventory_categories\"=>$category),1,\"\",\"inventory_id\",\"desc\");\n\n if($code==\"\" || $category==\"\" || $qty==\"\" || $product->num_rows()!=1 || $data->num_rows()!=1)\n {\n die(\"parameter out inventory harus di lengkapi, item code : $code, category : $category\");\n }\n\n // jika tidak ada item ini di inventory maka tidak perlu kalkulasi stock_awal, average_nominal dll\n if($data->num_rows()==1)\n {\n $nominal_average = $data->row()->inventory_average_nominal_now_per_item;\n $stock_awal = $data->row()->inventory_total_stock_now;\n $nominal_awal = $data->row()->inventory_total_nominal_now;\n $total_qty = $data->row()->inventory_total_stock_now - $qty;\n $total_nominal = $data->row()->inventory_total_nominal_now - ($data->row()->inventory_average_nominal_now_per_item*$qty);\n }\n\n // set nama product\n if($product->row()->product_variant_type==\"\" || $product->row()->product_variant_value==\"\")\n {\n $name = $product->row()->product_name;\n }\n else {\n $name = $product->row()->product_name.\" - \".$product->row()->product_variant_type.\" - \".$product->row()->product_variant_value;\n }\n\n // set log inventory\n if($desc==\"\")\n {\n $desc = \"insert by \".$this->session->userdata('username');\n }\n\n $data_insert = array(\n \"inventory_item_code\" => $code,\n \"inventory_name\" => $name,\n \"inventory_categories\" => $category,\n \"inventory_item_type\" => $type,\n \"inventory_operator\" => \"out\",\n \"inventory_qty\" => $qty,\n \"inventory_nominal_per_item\" => $nominal_average,\n \"inventory_total_nominal\" => $nominal_average*$qty,\n \"inventory_stock_awal\" => $stock_awal,\n \"inventory_nominal_stock_awal\" => $nominal_awal,\n \"inventory_average_nominal_now_per_item\" => $nominal_average,\n \"inventory_total_stock_now\" => $total_qty,\n \"inventory_total_nominal_now\" => $total_nominal,\n \"inventory_warehouse_id\" => $warehouse,\n \"inventory_date_craeted\" => date('Y-m-d H:i:s'),\n \"inventory_log\" => $desc,\n );\n $this->db->insert('inventory', $data_insert);\n return $this->db->insert_id();\n }", "public function getQty()\n\t{\n\t\treturn $this->qty;\n\t}", "public static function stockOut($partId,$quantitySelected) {\n $stocks = Stock::find()->where(['part_id' => $partId])->andWhere(['>','quantity','0'])->all();\n $data = array();\n $quantityNeeded = $quantitySelected;\n foreach ($stocks as $stock){\n $stockId = $stock->id;\n\n /* if quantity needed already fulfilled */\n if ( $quantityNeeded > 0 ) {\n $data['stock_id'][] = $stockId;\n $stockQuantity = $stock->quantity;\n /* if st_qty is enough for stock out */\n if ( $stockQuantity >= $quantityNeeded ) {\n /* A :: stock 11 .... selected 10 */\n /* deduct stock quantity see how much left */\n $stockQuantity -= $quantityNeeded;\n\n /* set how many quantity of stock used for this stock id */\n $data['quantity_used'][] = $quantityNeeded;\n\n /* set quantity to zero as the stock is already enough */\n $quantityNeeded = 0;\n /* A :: stockQuantity become 1 */\n\n\n } else if ( $stockQuantity < $quantityNeeded) {\n /* B :: stock 10 .... selected 11 */\n /* see how many more stock needed */\n $quantityNeeded -= $stockQuantity;\n\n /* set how many quantity of stock used for this stock id */\n $data['quantity_used'][] = $stockQuantity;\n \n /* set stockQuantity to zero as all the stock will be used for the needed */\n $stockQuantity = 0;\n /* A :: stockQuantity become 0 */\n }\n\n /* AB :: update stock quantity */\n $updateStock = Stock::find()->where(['id' => $stockId])->one();\n $updateStock->quantity = $stockQuantity;\n $updateStock->save();\n $data['stock_quantity'][] = $stockQuantity;\n\n }\n }\n \n return $data;\n }", "public function getQuantity()\n {\n $channelInventorySourceIds = $this->channel->inventory_sources->where('status', 1)->pluck('id');\n\n $qty = 0;\n\n foreach ($this->product->inventories as $inventory) {\n if (is_numeric($channelInventorySourceIds->search($inventory->inventory_source_id))) {\n $qty += $inventory->qty;\n }\n }\n\n $orderedInventory = $this->product->ordered_inventories\n ->where('channel_id', $this->channel->id)->first();\n\n if ($orderedInventory) {\n $qty -= $orderedInventory->qty;\n }\n\n return $qty;\n }", "public function getQty()\r\n {\r\n return $this->qty;\r\n }", "public function get_quantity(){\n\t\treturn $this->quantity;\n\t}", "public function getStockInfo() {\n //Fetch the product model \n $product = $this->getProduct();\n\n //Get the quantity from the product model \n $stock = $this->stockRegistry->getStockItem($product->getId());\n\n //Retun stock quantity here \n return $stock->getQty();\n }", "public function getQty()\n {\n return $this->qty;\n }", "public function itemsIn($product, $quantity,$supplier, $warehouse)\n {\n\n \n $conf = new ConfigurationManager($this->container);\n $to = $warehouse->getInventoryAccount();\n $from = $supplier->getInventoryAccount();\n \n return $this->itemTransfer($product, $quantity, $from, $to);\n }", "private function getNumber($qty)\n {\n if (!is_numeric($qty)) {\n return $this->format->getNumber($qty);\n }\n\n return $qty;\n }", "public function getQuantityByUnit()\n {\n return $this->quantity_by_unit;\n }", "public static function stockOutByPartId($partId,$quantityIssued) {\n $stocks = Stock::find()->where(['part_id' => $partId])->andWhere(['>','quantity','0'])->all();\n $data = array();\n foreach ($stocks as $stock){\n $stockId = $stock->id;\n /* if quantity needed already fulfilled */\n if ( $quantityIssued > 0 ) {\n $data['stock_id'][] = $stockId;\n $stockQuantity = $stock->quantity;\n /* if st_qty is enough for stock out */\n if ( $stockQuantity >= $quantityIssued ) {\n /* A :: stock 11 .... selected 10 */\n /* deduct stock quantity see how much left */\n $stockQuantity -= $quantityIssued;\n\n /* set how many quantity of stock used for this stock id */\n $data['qty_issued'][] = $quantityIssued;\n\n /* set quantity to zero as the stock is already enough */\n $quantityIssued = 0;\n /* A :: stockQuantity become 1 */\n } else if ( $stockQuantity < $quantityIssued) {\n /* B :: stock 10 .... selected 11 */\n /* see how many more stock needed */\n $quantityIssued -= $stockQuantity;\n\n /* set how many quantity of stock used for this stock id */\n $data['qty_issued'][] = $stockQuantity;\n \n /* set stockQuantity to zero as all the stock will be used for the needed */\n $stockQuantity = 0;\n /* A :: stockQuantity become 0 */\n }\n /* AB :: update stock quantity */\n $updateStock = Stock::find()->where(['id' => $stockId])->one();\n $updateStock->quantity = $stockQuantity;\n $updateStock->save();\n $data['stock_quantity'][] = $stockQuantity;\n }\n }\n \n return $data;\n }", "abstract public function load($qty, $from = 0);", "abstract public function getOriginalQty();", "public function getQuantityInStock()\n\t{\n\t\treturn $this->getKeyValue('quantity_in_stock'); \n\n\t}", "public function rsvPart($sender, $param)\n\t{\n\t\t$result = array();\n\t\t$errors = array();\n\t\ttry\n\t\t{\n\t\t\tif(!isset($param->CallbackParameter->selectedIds) || count($selectedIds = ($param->CallbackParameter->selectedIds)) === 0)\n\t\t\t\tthrow new Exception(\"Please select a request first!\");\n\n\t\t\t$request = Factory::service(\"FacilityRequest\")->get($selectedIds[0]);\n\n\t\t\tif(!$request instanceof FacilityRequest)\n\t\t\t\tthrow new Exception(\"Invalid facility request id provided(={$selectedIds[0]})!\");\n\n\t\t\t$result['requestId'] = $selectedIds[0];\n\n\t\t\tif(count($resrvInfo = ($param->CallbackParameter->resrvInfo)) === 0)\n\t\t\t\tthrow new Exception(\"Please no resrvd part info passed in!\");\n\n\t\t\t$result['barcode'] = isset($resrvInfo->barcode) ? trim($resrvInfo->barcode) : '';\n\t\t\t$result['BL'] = isset($resrvInfo->BL) ? trim($resrvInfo->BL) : '';\n\t\t\t$result['qty'] = isset($resrvInfo->qty) ? trim($resrvInfo->qty) : '';\n\n\t\t\tif($result['barcode'] === '' )\n\t\t\t\tthrow new Exception(\"Barcode needed!\");\n\n\t\t\tif(!is_numeric($result['qty']))\n\t\t\t\tthrow new Exception(\"Invalid qty(={$result['qty']}) provided!\");\n\n\n\t\t\t$pi = Factory::service(\"PartInstance\")->get($this->partInstanceId->Value);\n\n\t\t\tif(!$pi instanceof PartInstance)\n\t\t\t\tthrow new Exception(\"No part instance found for '{$result['barcode']}'!!\");\n\n\t\t\t$comments = \"\";\n\t\t\tif(isset($resrvInfo->comments) && $resrvInfo->comments)\n\t\t\t{\n\t\t\t\t$comments = $resrvInfo->comments;\n\t\t\t}\n\n\t\t\t$result['piId'] = $pi->getId();\n\t\t\t$result['warehouse'] = $pi->getWarehouse()->getBreadCrumbs();\n\t\t\t$this->_ownerWarehouse = $this->getOwnerWarehouse();\n\n\t\t\tif ($this->_reportServerRedirectEnabled)\n\t\t\t\tDao::prepareNewConnection(Dao::DB_MAIN_SERVER); //reconnect to main server, if redirection is ON\n\n\t\t\tFactory::service(\"FacilityRequest\")->reservePI($request, $pi, $this->_ownerWarehouse, $comments,$result['qty']);\n\t\t}\n\t\tcatch(Exception $ex)\n\t\t{\n\t\t\t$errors[] = $this->_getErrorMsg($ex->getMessage());\n\t\t}\n\n\t\tif ($this->_reportServerRedirectEnabled)\n\t\t\tDao::prepareNewConnection(Dao::DB_REPORT_SERVER); //reconnect to report server, if redirection is ON\n\n\t\tif (empty($errors))\n\t\t\t$result['requests'] = $this->_getData(false,null ,$totalRows, 'slaEnd', 'asc', $selectedIds);\n\n\t\t$this->responseLabel->Text = htmlentities(Core::getJSONResponse($result, $errors));\n\n\t}", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getTotalQtyOrdered();", "public function getExtraAvailParts($sender, $param)\n\t{\n\t\t$html = \"No parts found!\";\n\t\ttry{\n\t\t\tif(!isset($param->CallbackParameter->selectedIds) || (($selectedId = $param->CallbackParameter->selectedIds) == '') )\n\t\t\t\tthrow new Exception(\"Please select a request first!\");\n\n\t\t\t$request = Factory::service(\"FacilityRequest\")->get($selectedId);\n\t\t\tif(!$request instanceof FacilityRequest)\n\t\t\t\tthrow new Exception(\"Invalid facility request id provided(={$selectedId})!\");\n\n\n\t\t\t$partType = $request->getPartType();\n\t\t\t$hotMessage = $partType->getAlias(PartTypeAliasType::ID_HOT_MESSAGE);\n\n\t\t\t$goodParts = 1;\n\t\t\tif(isset($param->CallbackParameter->goodParts))\n\t\t\t{\n\t\t\t\t$goodParts = $param->CallbackParameter->goodParts;\n\t\t\t}\n\n\t\t\t$compatibleParts = false;\n\t\t\tif(isset($param->CallbackParameter->compatibleParts))\n\t\t\t{\n\t\t\t\t$compatibleParts = $param->CallbackParameter->compatibleParts;\n\t\t\t}\n\t\t\t$result = $this->_getAvailableParts($request->getPartType()->getId(), false, $goodParts, $compatibleParts);\n\n\t\t\t$html = \"<table class='ResultDataList'>\";\n\t\t\tif($hotMessage)\n\t\t\t{\n\t\t\t\t$html .= \"<tr><td>\". PartTypeLogic::showHotMessageDetail($hotMessage, '', false, false) . \"</td></tr>\";\n\t\t\t}\n\n\t\t\t$html .= \"<tr>\";\n\t\t\tif($compatibleParts)\n\t\t\t\t$html .= \"<td><a href='javascript: void(0);' onClick='pageJs.viewAvailList(\\\"\" . $selectedId . \"\\\", \\\"\" . $this->showAvailListBtn->getUniqueID() . \"\\\", \\\"\" . $goodParts . \"\\\", true)'>View Compatible Parts from \" . $this->_ownerWarehouse->getName() . \"</a></td>\";\n\t\t\telse\n\t\t\t\t$html .= \"<td><a href='javascript: void(0);' onClick='pageJs.viewAvailList(\\\"\" . $selectedId . \"\\\", \\\"\" . $this->showAvailListBtn->getUniqueID() . \"\\\", \\\"\" . $goodParts . \"\\\", false)'>View Parts from \" . $this->_ownerWarehouse->getName() . \"</a></td>\";\n\n\t\t\t$html .= \"<td style='float:right'><input type='image' src='/themes/images/mail.gif' onclick='return pageJs.email(\\\"\" . $selectedId . \"\\\", \\\"\" . $this->showEmailPanelBtn->getUniqueID() . \"\\\", this);' title='Send an email'/></td>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"<table>\";\n\n\t\t\tif($compatibleParts)\n\t\t\t\t$html .= PartTypeLogic::showCompatiblePartTypeDetail($partType);\n\t\t\telse\n\t\t\t\t$html .= \"<div><br><b>Part Details : </b>\".$partType->getAlias().\" - \".$partType->getName().\"</div><br>\";\n\n\t\t\tif(count($result)=== 0)\n\t\t\t{\n\t\t\t\t$html .= \"<br><b style='color:red'>No parts found!</b>\";\n\t\t\t\t$this->responseLabel->Text = $html;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$html .= \"<table class='ResultDataList'>\";\n\t\t\t$html .= \"<thead>\";\n\t\t\t$html .= \"<tr>\";\n\t\t\t$html .= \"<th>Warehouse</th>\";\n\t\t\tif($compatibleParts){$html .= \"<th>PartCode</th>\";}\n\t\t\t$html .= \"<th>Status</th>\";\n\t\t\t$html .= \"<th>Qty</th>\";\n\t\t\t$html .= \"<th>Reserved For</th>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"</thead>\";\n\t\t\t$html .= \"<tbody>\";\n\t\t\t$rowNo =0;\n\t\t\t$total = 0;\n\t\t\t$previousState = \"\";\n\t\t\tforeach($result as $r)\n\t\t\t{\n\t\t\t\tif(!($warehouse = Factory::service(\"Warehouse\")->get($r['warehouseId'])) instanceof Warehouse)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif($previousState==\"\" || $previousState!= $r['stateName'])\n\t\t\t\t{\n\t\t\t\t\t$colspan=($compatibleParts?'5':'4');\n\t\t\t\t\t$html .= \"<tr><td colspan=\".$colspan.\" style='color:white;background:black'><b>\" . $r['stateName'] . \"</b></td></tr>\";\n\t\t\t\t}\n\n\t\t\t\t$warehouseName = $warehouse;\n\t\t\t\t$index = strpos ($warehouse, \"|\");\n\t\t\t\tif($index > 0)\n\t\t\t\t{\n\t\t\t\t\t$warehouseName = substr($warehouse , 0, $index);\n\t\t\t\t}\n\n\t\t\t\t$html .= \"<tr class='\" . ($rowNo++ % 2 === 0 ? \"ResultDataListItem\" : \"ResultDataListAlterItem\") . \"' >\";\n\t\t\t\t$html .= \"<td>\" . $warehouseName . \"</td>\";\n\t\t\t\tif($compatibleParts)\n\t\t\t\t{\n\t\t\t\t\t$partcode = Factory::service('PartType')->get($r['partTypeId'])->getAlias();\n\t\t\t\t\t$html .= \"<td>\".$partcode.\"</td>\";\n\t\t\t\t}\n\n\t\t\t\t$html .= \"<td>{$r['status']}</td>\";\n\t\t\t\t$html .= \"<td>{$r['qty']}</td>\";\n\t\t\t\t$html .= \"<td>{$r['fieldTaskId']}</td>\";\n\t\t\t\t$html .= \"</tr>\";\n\t\t\t\t$total +=$r['qty'];\n\t\t\t\t$previousState = $r['stateName'];\n\t\t\t}\n\t\t\t$html .= \"</tbody>\";\n\t\t\t$html .= \"<tfoot>\";\n\t\t\t$html .= \"<tr>\";\n\t\t\t$html .= \"<td>Total</td>\";\n\t\t\t$html .= \"<td>&nbsp;</td>\";\n\t\t\tif($compatibleParts){$html .= \"<td>&nbsp;</td>\";}\n\t\t\t$html .= \"<td>$total</td>\";\n\t\t\t$html .= \"<td>&nbsp;</td>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"</tfoot>\";\n\t\t\t$html .= \"</table>\";\n\t\t}\n\t\tcatch(Exception $ex)\n\t\t{\n\t\t\t$html = $this->_getErrorMsg($ex->getMessage());\n\t\t}\n\n\t\t$this->responseLabel->Text = $html;\n\t}", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity(): float;", "public function setQty($qty);", "protected function get_kit_quantity() {\n return $this->kit_quantity;\n }", "public function checkQuantity($productHash, $qty)\n {\n $product = $this->entityManager->getRepository(Product::class)->findOneBy(['hash' => $productHash]);\n\n $data['maxQty'] = $product->getQty();\n if ($product->getQty() >= $qty) {\n $data['status'] = true;\n return $data;\n }\n\n $data['status'] = false;\n return $data;\n }", "public function get_qty() {\n\t\treturn get_post_meta( $this->get_id(), 'qty', true );\n\t}", "public function findPrice($tourId, $qty);", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantityAvailable(): int;", "public function getQuantity()\n {\n return $this->_quantity;\n }", "public function getProductQuantity()\n {\n }", "private function get($part)\n {\n return $this->parts[$part];\n }", "public function getQuantity(){\n return $this->quantity;\n }", "public function productquantity() {\n\n $this->checkPlugin();\n\n if ($_SERVER['REQUEST_METHOD'] === 'PUT') {\n //update products\n $requestjson = file_get_contents('php://input');\n $requestjson = json_decode($requestjson, true);\n\n if (!empty($requestjson) && count($requestjson) > 0) {\n $this->updateProductsQuantity($requestjson);\n } else {\n $this->response->setOutput(json_encode(array('success' => false)));\n }\n } else {\n $json['success'] = false;\n $json['error'] = \"Invalid request method, use PUT method.\";\n $this->sendResponse($json);\n }\n }", "protected function _getItemQtys() {\n /**\n * Inilize shipment data\n */\n $data = $this->getRequest ()->getParam ( 'shipment' );\n /**\n * Prepare shipment qtys\n */\n if (isset ( $data ['items'] )) {\n $qtys = $data ['items'];\n } else {\n $qtys = array ();\n }\n /**\n * Return shipment qty\n */\n return $qtys;\n }", "public function calculateQtyToShip();", "public function update_product_inventory()\n\t{\n\t\t/* Prepare statement */\n\t\tif (!$stmt_product_info = $this->mysqli->prepare('SELECT \n\t\tproduct.out_of_stock,\n\t\tproduct.out_of_stock_enabled,\n\t\tIF(product_variant.id IS NOT NULL,product_variant.qty,product.qty) AS qty\n\t\tFROM\n\t\tproduct \n\t\tLEFT JOIN\n\t\tproduct_variant\n\t\tON\n\t\t(product.id = product_variant.id_product AND product_variant.id = ?)\n\t\tWHERE\n\t\tproduct.id = ?\t\t\n\t\tAND\n\t\tproduct.track_inventory=1\n\t\tLIMIT 1')) throw new Exception('An error occured while trying to prepare get product track inventory info statement.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\t\n\t\t\n\t\t/* Prepare statement */\n\t\tif (!$stmt_upd_product_variant = $this->mysqli->prepare('UPDATE \n\t\tproduct_variant \n\t\tSET\n\t\tqty = ?,\n\t\tactive = ?\n\t\tWHERE\n\t\tid = ?')) throw new Exception('An error occured while trying to prepare update product variant qty statement.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\n\t\t\n\t\t/* Prepare statement */\n\t\tif (!$stmt_upd_product = $this->mysqli->prepare('UPDATE \n\t\tproduct\n\t\tSET\n\t\tqty = ?,\n\t\tactive = ?\n\t\tWHERE\n\t\tid = ?')) throw new Exception('An error occured while trying to prepare update product qty statement.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\t\t\n\t\t\n\t\t/* Prepare statement */\n\t\tif (!$stmt_option_info = $this->mysqli->prepare('SELECT \n\t\tout_of_stock\n\t\tFROM\n\t\toptions\n\t\tWHERE\n\t\tid = ?\n\t\tAND\n\t\ttrack_inventory=1\n\t\tLIMIT 1')) throw new Exception('An error occured while trying to prepare get options track inventory info.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\t\t\n\t\t\n\t\t/* Prepare statement */\n\t\tif (!$stmt_upd_option = $this->mysqli->prepare('UPDATE \n\t\toptions\n\t\tSET\n\t\tqty = IF(qty <= ?,0,qty - ?)\n\t\tWHERE\n\t\tid = ?')) throw new Exception('An error occured while trying to prepare update options qty statement.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\n\t\t\n\t\t$products = $this->get_products();\t\t\t\t\n foreach ($products as $row_product) {\n // Update Sub_product ELSE Update Product\n\t\t\tif (sizeof($row_product['sub_products'])) {\n foreach ($row_product['sub_products'] as $row_sub_product) {\n\t\t\t\t\t// sub product qty multipled by parent product qty\n\t\t\t\t\t$qty = $row_product['qty']*$row_sub_product['qty'];\n\t\t\t\t\t\n\t\t\t\t\tif (!$stmt_product_info->bind_param(\"ii\",$row_sub_product['id_product_variant'], $row_sub_product['id_product'])) throw new Exception('An error occured while trying to bind params to get product info statement.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\n\n\t\t\t\t\t/* Execute the statement */\n\t\t\t\t\t$stmt_product_info->execute();\n\t\t\t\t\t\n\t\t\t\t\t/* store result */\n\t\t\t\t\t$stmt_product_info->store_result();\t\t\n\t\t\t\t\t\n\t\t\t\t\tif ($stmt_product_info->num_rows) {\t\t\t\t\n\t\t\t\t\t\t/* bind result variables */\n\t\t\t\t\t\t$stmt_product_info->bind_result($out_of_stock,$out_of_stock_enabled,$qty_remaining);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$stmt_product_info->fetch();\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$qty_in_stock = $qty_remaining-$qty;\n\t\t\t\t\t\tif ($qty_in_stock < 0) $qty_in_stock = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$active = $out_of_stock_enabled && $qty_in_stock == $out_of_stock ? 0:1;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($row_sub_product['id_product_variant']){\n\t\t\t\t\t\t\tif (!$stmt_upd_product_variant->bind_param(\"iii\", $qty_in_stock, $active,$row_sub_product['id_product_variant'])) throw new Exception('An error occured while trying to bind params to update product variant qty statement.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Execute the statement */\n\t\t\t\t\t\t\tif (!$stmt_upd_product_variant->execute()) throw new Exception('An error occured while trying to update product variant qty.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif (!$stmt_upd_product->bind_param(\"iii\", $qty_in_stock, $active,$row_sub_product['id_product'])) throw new Exception('An error occured while trying to bind params to update product qty statement.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Execute the statement */\n\t\t\t\t\t\t\tif (!$stmt_upd_product->execute()) throw new Exception('An error occured while trying to update product qty.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n }else{\n\t\t\t\t// product qty\n\t\t\t\t$qty = $row_product['qty'];\n\t\t\t\t\n\t\t\t\tif (!$stmt_product_info->bind_param(\"ii\", $row_product['id_product_variant'], $row_product['id_product'])) throw new Exception('An error occured while trying to bind params to get product info statement.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\n\n\t\t\t\t/* Execute the statement */\n\t\t\t\t$stmt_product_info->execute();\n\t\t\t\t\n\t\t\t\t/* store result */\n\t\t\t\t$stmt_product_info->store_result();\t\t\n\t\t\t\t\n\t\t\t\tif ($stmt_product_info->num_rows) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t/* bind result variables */\n\t\t\t\t\t$stmt_product_info->bind_result($out_of_stock,$out_of_stock_enabled, $qty_remaining);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$stmt_product_info->fetch();\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$qty_in_stock = $qty_remaining-$qty;\n\t\t\t\t\tif ($qty_in_stock < 0) $qty_in_stock = 0;\n\t\t\t\t\t\n\t\t\t\t\t$active = $out_of_stock_enabled && $qty_in_stock == $out_of_stock ? 0:1;\n\t\t\t\t\t\n\t\t\t\t\tif($row_product['id_product_variant']){\n\t\t\t\t\t\tif (!$stmt_upd_product_variant->bind_param(\"iii\", $qty_in_stock, $active,$row_product['id_product_variant'])) throw new Exception('An error occured while trying to bind params to update product variant qty statement.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* Execute the statement */\n\t\t\t\t\t\tif (!$stmt_upd_product_variant->execute()) throw new Exception('An error occured while trying to update product variant qty.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif (!$stmt_upd_product->bind_param(\"iii\",$qty_in_stock, $active,$row_product['id_product'])) throw new Exception('An error occured while trying to bind params to update product qty statement.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* Execute the statement */\n\t\t\t\t\t\tif (!$stmt_upd_product->execute()) throw new Exception('An error occured while trying to update product qty.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\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\t\n // Update Options\n\t\t\tif(sizeof($this->get_product_options($row_product['id']))){\n $options = $this->get_product_options($row_product['id']);\n foreach ($options as $row_product_option_group) { \n foreach ($row_product_option_group['options'] as $row_product_option) {\n\t\t\t\t\t\t// sub product qty multipled by parent product qty\n\t\t\t\t\t\t$qty = $row_product['qty']*$row_product_option['qty'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!$stmt_option_info->bind_param(\"i\", $row_product_option['id_options'])) throw new Exception('An error occured while trying to bind params to get option info statement.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\n\t\t\n\t\t\t\t\t\t/* Execute the statement */\n\t\t\t\t\t\t$stmt_option_info->execute();\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* store result */\n\t\t\t\t\t\t$stmt_option_info->store_result();\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($stmt_option_info->num_rows) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* bind result variables */\n\t\t\t\t\t\t\t$stmt_option_info->bind_result($out_of_stock);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$stmt_option_info->fetch();\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!$stmt_upd_option->bind_param(\"iii\", $qty, $qty,$row_product_option['id_options'])) throw new Exception('An error occured while trying to bind params to update option qty statement.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Execute the statement */\n\t\t\t\t\t\t\tif (!$stmt_upd_option->execute()) throw new Exception('An error occured while trying to update option qty.'.\"\\r\\n\\r\\n\".$this->mysqli->error);\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n }\n }\n \t}\n\t\t\n\t\t$stmt_product_info->close();\n\t\t$stmt_upd_product_variant->close();\n\t\t$stmt_upd_product->close();\n\t\t$stmt_option_info->close();\n\t\t$stmt_upd_option->close();\n\t\t\t\t\t\t\t\t\t\t\t\n\t}", "function set_qty_item( $params ) {\n\t\textract( $params );\n\n\t\t$this->db->query( \"LOCK TABLES cart_items WRITE, stock WRITE\" );\n\n\t\t// Changing the current qty means putting back first the previous qty to stock then removing the new one\n\t\t$aqty = $this->db->query( \"SELECT qty, sku FROM cart_items WHERE id='\".$id.\"'\" )->row_array();\n\t\t$this->db->query( \"UPDATE stock SET qty=qty+{$aqty['qty']}-\".$qty.\" WHERE sku='{$aqty['sku']}'\" );\n\n\t\t$res = $this->db->query( \"UPDATE cart_items SET qty='\".$qty.\"' WHERE id='\".$id.\"' AND user='\".$user_no.\"'\" );\n\n\t\t$this->db->query( \"UNLOCK TABLES\" );\n\t\treturn $res;\n\t}", "public function getQuantity(): ?int;", "public function getAdditionalBundleQty($args)\n {\n $repo = $this->entityManager->getRepository('ZSELEX_Entity_Bundle');\n $qty = $args ['qty'];\n $type = $args ['type'];\n $shop_id = $args ['shop_id'];\n\n $additional = $repo->getAll(array(\n 'entity' => 'ZSELEX_Entity_ServiceBundle',\n 'where' => array(\n 'a.bundle_type' => 'additional',\n 'a.shop' => $shop_id\n ),\n 'joins' => array(\n 'JOIN a.bundle b'\n ),\n 'fields' => array(\n 'a.quantity',\n 'b.bundle_id'\n )\n ));\n\n // echo \"<pre>\"; print_r($additional); echo \"</pre>\"; exit;\n // $qty = 0;\n if ($additional) {\n foreach ($additional as $key) {\n\n $additional_qty = $repo->get(array(\n 'entity' => 'ZSELEX_Entity_BundleItem',\n 'where' => array(\n 'a.servicetype' => $type,\n 'a.bundle' => $key ['bundle_id']\n ),\n 'fields' => array(\n 'a.qty',\n 'a.qty_based'\n )\n ));\n //echo \"<pre>\"; print_r($additional_qty); echo \"</pre>\"; exit;\n // if ($additional_qty) {\n if ($additional_qty && $additional_qty ['qty_based']) {\n $qty += $additional_qty ['qty'] * $key ['quantity'];\n }\n }\n }\n\n //echo \"qty :\".$qty; exit;\n\n return $qty;\n }", "function get_inventory_onhand($pcservno){\n\t$oConn = get_coneccion(\"CIA\");\n\t$lcsqlcmd = \"SELECT aradjt.cservno,\n\t\t\t\t\t sum(aradjt.nqty) as nqty\n\t\t\t\t FROM aradjm\n\t\t\t\t left outer join aradjt on aradjm.cadjno = aradjt.cadjno\n\t\t\t\t left outer join arserm on arserm.cservno = aradjt.cservno\n\t\t\t\t left outer join arcate on arcate.ccateno = aradjm.ccateno AND arcate.ctypecate = 'A'\n\t\t\t\t where arserm.lupdateonhand = true AND \n\t\t\t\t \t aradjm.lvoid = false and \n\t\t\t\t\t aradjt.cservno = '$pcservno' \n\t\t\t\t group by 1\n\t\t\t\t union all \n\t\t\t\t SELECT arinvt.cservno,\n\t\t\t\t\t\tsum(arinvt.nqty * -1) as nqty\n\t\t\t\tFROM arinvc\n\t\t\t\tLEFT OUTER JOIN arinvt on arinvc.cinvno = arinvt.cinvno\n\t\t\t\tLEFT OUTER JOIN arserm on arserm.cservno = arinvt.cservno\n\t\t\t\tleft outer join artcas on artcas.cpaycode = arinvc.cpaycode\n\t\t\t\twhere arserm.lupdateonhand = true and\n\t\t\t\t\t arinvc.lvoid = false and \n\t\t\t\t\t arinvt.cservno = '$pcservno' \n\t\t\t\tgroup by 1\n\t\t\t\";\t\n\t// determinando cuanto producto queda segun el caso \n\t$lnqty = 0;\n\t$lcresult = mysqli_query($oConn,$lcsqlcmd);\n\twhile($lnrowqty = mysqli_fetch_assoc($lcresult)){\n\t\t$lnqty += $lnrowqty[\"nqty\"];\t\n\t}\n\techo $lnqty;\n\t\n\t/*\t\n\t$lcResult = mysqli_query($oConn,$lcsqlcmd); // $oConn->query($lcSqlCmd);\n\t// convirtiendo estos datos en un array asociativo\n\t$ldata = mysqli_fetch_assoc($lcResult);\n\t// convirtiendo este array en archivo jason.\n\t$jsondata =json_encode($ldata,true);\n\t// retornando objeto json\n\techo $jsondata;\n\t*/\n}", "public function updateKitInventory() {\n\t\textract($this->request->data);\n\t\t//this->request->data contains\n\t\t//array(\n\t\t//\t'pullQty' => '1',\n\t\t//\t'itemId' => '90',\n\t\t//\t'rowId' => '52d08471-8838-4330-b765-00ed47139427',\n\t\t//\t'onHand' => 'undefined',\n\t\t//\t'mode' => 'pull'\n\t\t//)\n\t\t//setup return array\n\t\t$orderItemType = $this->Item->OrderItem->field('catalog_type', array('id' => $rowId));\n\t\tif($orderItemType & (ON_DEMAND | INVENTORY_KIT)){\n\t\t\t$orderItemCatId = $this->Item->OrderItem->field('catalog_id', array('id' => $rowId));\n\t\t\t$this->requestAction(array('controller' => 'Catalogs', 'action' => 'kitAdjustment', $orderItemCatId, abs($pullQty), $orderItemType));\n\t\t\t$onHand = $this->Item->field('quantity', array('id' => $itemId));\n\t\t}\n\t\treturn $onHand;\n\t}", "public function hookActionUpdateQuantity($params)\n\t{\n\t\t$context = Context::getContext();\n $id_shop = (int)$context->shop->id;\n $id_lang = (int)$context->language->id;\n\n $shop_name = strval(Configuration::get('PS_SHOP_NAME'));\n $shop_email = strval(Configuration::get('PS_SHOP_EMAIL'));\n $id_product = (int)$params['id_product'];\n $id_product_attribute = (int)$params['id_product_attribute'];\n $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang);\n $quantity = (int)$params['quantity'];\n\n // Prepares the variables used in the email template\n $templateVars = array(\n \t\t'{shop_name}' => $shop_name,\n \t\t'{shop_email}' => $shop_email,\n \t\t'{id_product}' => $id_product,\n \t\t'{product_name}' => $product_name,\n \t\t'{quantity}' => $quantity\n );\n\n // Checks if the module is on \n if(!Configuration::get('MYMOD_EMAILS') == false)\n {\t\n \t// Sends the email notification to '$shop_email'\n\t\t\tMail::send($id_lang,\n\t\t 'stock_notification',\n\t\t 'Stock Update',\n\t\t $templateVars,\n\t\t $shop_email,\n\t\t null,\n\t\t null,\n\t\t null,\n\t\t null,\n\t\t null,\n\t\t 'mails/'\n\t\t );\n\t\t}\n\t}", "public function getAvailParts($sender, $param)\n\t{\n\t\t$html = \"No parts found!\";\n\t\ttry\n\t\t{\n\t\t\tif(!isset($param->CallbackParameter->selectedIds) || (($selectedId = $param->CallbackParameter->selectedIds) == '') )\n\t\t\t\tthrow new Exception(\"Please select a request first!\");\n\n\t\t\t$request = Factory::service(\"FacilityRequest\")->get($selectedId);\n\t\t\t$partType = $request->getPartType();\n\t\t\t$hotMessage = $partType->getAlias(PartTypeAliasType::ID_HOT_MESSAGE);\n\n\t\t\tif(!$request instanceof FacilityRequest)\n\t\t\t\tthrow new Exception(\"Invalid facility request id provided(={$selectedId})!\");\n\n\t\t\t$goodParts = 1;\n\t\t\tif(isset($param->CallbackParameter->goodParts))\n\t\t\t{\n\t\t\t\t$goodParts = $param->CallbackParameter->goodParts;\n\t\t\t}\n\t\t\t$compatibleParts = false;\n\t\t\tif(isset($param->CallbackParameter->compatibleParts))\n\t\t\t{\n\t\t\t\t$compatibleParts = $param->CallbackParameter->compatibleParts;\n\t\t\t}\n\n\t\t\t$result = $this->_getAvailableParts($partType->getId(), true, $goodParts, $compatibleParts);\n\t\t\t$html = \"\";\n\n\t\t\t$html .= \"<table class='ResultDataList'>\";\n\n\t\t\tif($hotMessage)\n\t\t\t{\n\t\t\t\t$html .= \"<tr><td>\". PartTypeLogic::showHotMessageDetail($hotMessage, '', false, false) . \"</td></tr>\";\n\t\t\t}\n\n\t\t\t$html .= \"<tr>\";\n\t\t\tif($compatibleParts)\n\t\t\t\t$html .= \"<td><a href='javascript: void(0);' onClick='pageJs.viewAvailListOtherStores(\\\"\" . $selectedId . \"\\\", \\\"\" . $this->showExtraAvailListBtn->getUniqueID() . \"\\\",\\\"\" . $goodParts . \"\\\",true)'>View Compatible Parts from other Locations</a></td>\";\n\t\t\telse\n\t\t\t\t$html .= \"<td><a href='javascript: void(0);' onClick='pageJs.viewAvailListOtherStores(\\\"\" . $selectedId . \"\\\", \\\"\" . $this->showExtraAvailListBtn->getUniqueID() . \"\\\",\\\"\" . $goodParts . \"\\\",false)'>View Parts from other Locations</a></td>\";\n\n\t\t\t$html .= \"<td style='float:right'><input type='image' src='/themes/images/mail.gif' onclick='return pageJs.email(\\\"\" . $selectedId . \"\\\", \\\"\" . $this->showEmailPanelBtn->getUniqueID() . \"\\\", this);' title='Send an email'/></td>\";\n\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"<table>\";\n\n\t\t\tif($compatibleParts)\n\t\t\t\t$html .= PartTypeLogic::showCompatiblePartTypeDetail($partType);\n\t\t\telse\n\t\t\t\t$html .= \"<div><br><b>Part Details : </b>\".$partType->getAlias().\" - \".$partType->getName().\"</div><br>\";\n\n\t\t\tif(count($result)=== 0)\n\t\t\t{\n\t\t\t\t$html .= \"<br><b style='color:red'>No parts found!</b>\";\n\t\t\t\t$this->responseLabel->Text = $html;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$html .= \"<table class='ResultDataList'>\";\n\t\t\t$html .= \"<thead>\";\n\t\t\t$html .= \"<tr>\";\n\t\t\t$html .= \"<th>Warehouse</th>\";\n\t\t\tif($compatibleParts){$html .= \"<th>Partcode</th>\";}\n\t\t\t$html .= \"<th>Status</th>\";\n\t\t\t$html .= \"<th>Qty</th>\";\n\t\t\t$html .= \"<th>Reserved For</th>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"</thead>\";\n\t\t\t$html .= \"<tbody>\";\n\t\t\t$rowNo =0;\n\t\t\t$total = 0;\n\t\t\tforeach($result as $r)\n\t\t\t{\n\t\t\t\tif(!($warehouse = Factory::service(\"Warehouse\")->get($r['warehouseId'])) instanceof Warehouse)\n\t\t\t\tcontinue;\n\n\t\t\t\t$html .= \"<tr class='\" . ($rowNo++ % 2 === 0 ? \"ResultDataListItem\" : \"ResultDataListAlterItem\") . \"' >\";\n\t\t\t\t$html .= \"<td>\" . $warehouse->getBreadCrumbs() . \"</td>\";\n\t\t\t\tif($compatibleParts)\n\t\t\t\t{\n\t\t\t\t\t$partcode = Factory::service('PartType')->get($r['partTypeId'])->getAlias();\n\t\t\t\t\t$html .= \"<td>\".$partcode.\"</td>\";\n\t\t\t\t}\n\t\t\t\t$html .= \"<td>{$r['status']}</td>\";\n\t\t\t\t$html .= \"<td>{$r['qty']}</td>\";\n\t\t\t\t$html .= \"<td>{$r['fieldTaskId']}</td>\";\n\t\t\t\t$html .= \"</tr>\";\n\t\t\t\t$total +=$r['qty'];\n\t\t\t}\n\t\t\t$html .= \"</tbody>\";\n\t\t\t$html .= \"<tfoot>\";\n\t\t\t$html .= \"<tr>\";\n\t\t\t$html .= \"<td>Total</td>\";\n\t\t\t$html .= \"<td>&nbsp;</td>\";\n\t\t\tif($compatibleParts){$html .= \"<td>&nbsp;</td>\";}\n\t\t\t$html .= \"<td>$total</td>\";\n\t\t\t$html .= \"<td>&nbsp;</td>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"</tfoot>\";\n\t\t\t$html .= \"</table>\";\n\t\t}\n\t\tcatch(Exception $ex)\n\t\t{\n\t\t\t$html = $this->_getErrorMsg($ex->getMessage());\n\t\t}\n\t\t$this->responseLabel->Text = $html;\n\t}", "public function getQuantity(): int\n {\n return $this->quantity;\n }", "public function testGetQtyOf()\n {\n $qtyTomato = $this->recipe->fetchQuantityOf('tomato');\n $this->assertEquals(0.5, $qtyTomato->getAmount());\n $this->assertEquals('kg', $qtyTomato->getUnit()->getSymbol());\n $qtySalt = $this->recipe->fetchQuantityOf('salt');\n $this->assertEquals(0.2, $qtySalt->getAmount());\n $this->assertEquals('kg', $qtySalt->getUnit()->getSymbol());\n $qtyPotato = $this->recipe->fetchQuantityOf('potato');\n $this->assertNull($qtyPotato);\n }", "public function getRsrvdParts($sender, $param)\n\t{\n\t\t$html = \"No parts found!\";\n\t\ttry\n\t\t{\n\t\t\tif(!isset($param->CallbackParameter->selectedIds) || count($selectedIds = ($param->CallbackParameter->selectedIds)) === 0)\n\t\t\t\tthrow new Exception(\"Please select a request first!\");\n\n\t\t\t$requestId = $selectedIds[0];\n\t\t\t$request = Factory::service(\"FacilityRequest\")->get($requestId);\n\t\t\tif(!$request instanceof FacilityRequest)\n\t\t\t\tthrow new Exception(\"Invalid facility request id provided(=$requestId)!\");\n\n\t\t\t//find all reserved part instances\n\t\t\t$pis = Factory::service(\"PartInstance\")->findByCriteria(\"pi.facilityRequestId = $requestId\");\n\n\t\t\t$html = \"<table class='ResultDataList'>\";\n\t\t\t$html .= \"<thead>\";\n\t\t\t$html .= \"<tr>\";\n\t\t\t$html .= \"<th width='20%'>Barcode</th>\";\n\t\t\t$html .= \"<th>Comments</th>\";\n\t\t\t$html .= \"<th width='8%'>Qty</th>\";\n\t\t\t$html .= \"<th width='5%'>&nbsp</th>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"</thead>\";\n\t\t\t$html .= \"<tbody>\";\n\t\t\t$html .= \"<tr class='ResultDataListAlterItem' resrpartpan='reservedTr'>\";\n\n\t\t\tif(!in_array($request->getStatus(), FacilityRequest::getStatusesAllowResvPI()))\n\t\t\t\t$html .= \"<td colspan=4 style='color: red; font-weight: bold;'>The status(`\" . $request->getStatus() . \"`) of the selected request does not allow reservation of parts!</td>\";\n\t\t\telse if(!Factory::service(\"FacilityRequest\")->checkOwnership($request, $this->getOwnerWarehouse()))\n\t\t\t\t$html .= \"<td colspan=4 style='color: red; font-weight: bold;'>You don't have access to this request.You need to own the request to proceed.</td>\";\n\t\t\telse\n\t\t\t{\n\t\t\t\t$html .= \"<td><input PlaceHolder='Barcode' resrpartpan='reservedSerialNoSearch' onkeydown=\\\"pageJs.enterEvent(event, $(this).up('tr[resrpartpan=reservedTr]').down('input[resrpartpan=reservedAddBtn]'));\\\"/>\n\t\t\t\t</br>\n\t\t\t\t</br>BL:\n\t\t\t\t<input id='BLNo' PlaceHolder='Barcode:BL' resrpartpan='reservedBLNoSearch' onkeydown=\\\"pageJs.enterEvent(event, $(this).up('tr[resrpartpan=reservedTr]').down('input[resrpartpan=reservedAddBtn]'));\\\"/>\n\t\t\t\t</td>\";\n\t\t\t\t$html .= \"<td>\n\t\t\t\t</br>\n\t\t\t\t(Limit text to 120 Characters)<input PlaceHolder='Comments' resrpartpan='reservedComments' style='width: 98%;'/>\n\t\t\t\t</br>\n\t\t\t\t</td>\";\n\t\t\t\t$html .= \"<td><input id='reservedQty' resrpartpan='reservedQty' value='1' style='width: 30px;'/></th>\";\n\t\t\t\t$html .= \"<td>\";\n\t\t\t\t$html .= \"<input resrpartpan='reservedAddBtn' type='button' value='Add' Onclick=\\\"pageJs.reservePI('$requestId', '\" . $this->rsvPartBtn->getUniqueID() . \"', '\" . $this->unRsvPartBtn->getUniqueID() . \"', this,'\" . $this->checkPartBtn->getUniqueID() .\n\t\t\t\t\"','\" . $this->checkPartType->getClientId() . \"','\" . $this->checkPartErrors->getClientId() . \"','\" . $this->errorBL->getClientId() . \"');\\\"/>\";\n\t\t\t\t$html .= \"<input resrpartpan='bpregex' type='hidden' value='\" . BarcodeService::getBarcodeRegex(BarcodeService::BARCODE_REGEX_CHK_PART_TYPE, null, '^', '$') . \"' />\";\n\t\t\t\t$html .= \"<input resrpartpan='partregex' type='hidden' value='\" . BarcodeService::getBarcodeRegex(BarcodeService::BARCODE_REGEX_CHK_PART, null, '^', '$') . \"' />\";\n\t\t\t\t$html .= \"</td>\";\n\t\t\t}\n\t\t\t$html .= \"</tr>\";\n\t\t\t$rowNo =0;\n\t\t\t$total = 0;\n\t\t\tforeach($pis as $pi)\n\t\t\t{\n\t\t\t\t$piQty = ($pi->getPartType()->getSerialised()==1)? 1:$pi->getQuantity();\n\t\t\t\t$barcode = ($pi->getPartType()->getSerialised()==1)? $pi->getAlias(PartInstanceAliasType::ID_SERIAL_NO):$pi->getPartType()->getAlias(PartTypeAliasType::ID_BP);\n\t\t\t\t$html .= \"<tr rsvdPIId=\\\"\" . $pi->getId() . \"\\\" class='\" . ($rowNo++ % 2 === 0 ? \"ResultDataListItem\" : \"ResultDataListAlterItem\") . \"' >\";\n\t\t\t\t$html .= \"<td>\" . $barcode . \"</td>\";\n\t\t\t\t$html .= \"<td>\" . $pi->getWarehouse()->getBreadCrumbs() . \"</td>\";\n\t\t\t\t$html .= \"<td>\".intval($piQty).\"</td>\";\n\t\t\t\t$html .= \"<td>\";\n\t\t\t\t$html .= \"<input type='image' src='/themes/images/delete_mini.gif' onClick=\\\"pageJs.unresrvPI('$requestId', '\" . $this->unRsvPartBtn->getUniqueID() . \"', this);\\\"/>\";\n\t\t\t\t$html .= \"</td>\";\n\t\t\t\t$html .= \"</tr>\";\n\t\t\t\t$total += intval($piQty);\n\t\t\t}\n\t\t\t$html .= \"</tbody>\";\n\t\t\t$html .= \"<tfoot>\";\n\t\t\t$html .= \"<tr>\";\n\t\t\t$html .= \"<td>Total</td>\";\n\t\t\t$html .= \"<td>&nbsp;</td>\";\n\t\t\t$html .= \"<td><span resrpartpan='reservedTotalQty'>$total</span></td>\";\n\t\t\t$html .= \"<td>&nbsp;</td>\";\n\t\t\t$html .= \"</tr>\";\n\t\t\t$html .= \"</tfoot>\";\n\t\t\t$html .= \"</table>\";\n\n \t\t\tif($this->checkFieldTaskHasAllReservationsFulfilled($request->getFieldTask()))\n \t\t\t{\n \t\t\t\t$html .= \"<select id='titleActionListDropDown'>\";\n \t\t\t\t$html .= \"<option value='pushToAvail' class='fieldtaskoptons'>Push Field Task Avail</option>\";\n \t\t\t\t$html .= \"</select>\";\n \t\t\t\t$html .= \"<input id='titleActionListBtn' value='Go' onclick=\\\"return pageJs.pushFTWrapper($('titleActionListDropDown').value, '\" . $this->changeFTStatusBtn->getUniqueID() . \"',\" . $requestId . \"); return false;\\\" type='button'>\";\n \t\t\t}\n\t\t}\n\t\tcatch(Exception $ex)\n\t\t{\n\t\t\t$html = $this->_getErrorMsg($ex->getMessage());\n\t\t}\n\t\t$this->responseLabel->Text = $html;\n\t}", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function updateCartQuantity()\n {\n if(isset($_GET[\"quantity\"]) && $_GET[\"quantity\"] > 0) {\n $_SESSION[\"products\"][$_GET[\"update_quantity\"]][\"product_qty\"] = $_GET[\"quantity\"];\n }\n\n $total_product = count($_SESSION[\"products\"]);\n die(json_encode(['products' => $total_product]));\n }", "public function getQuantity()\n {\n return parent::getQuantity();\n }", "public function getQuantity()\n {\n return isset($this->quantity) ? $this->quantity : null;\n }", "public function getQuantity(): int|null;", "public function getRowsQty();", "public function getAvailableQuantityValue()\n {\n return $this->readWrapperValue(\"available_quantity\");\n }", "function get_part_ID($part_id, $version = NULL) {\n\n // Database connection \n $conn = database_connection();\n\n //Query string\n if ($version == NULL) {\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $part_id . \"' ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc \"; //select data or insert data\n } else {\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND SERIAL_NUMBER LIKE '%\" . $version . \"%' ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\"; //select data or insert data \n }\n // Execute query \n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_rec = 0;\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n\n foreach ($row as $item) {\n //echo \"<li>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \"&nbsp;\") . \"</li>\";\n if ($item !== null)\n $result_rec = $item;\n }\n }\n if ($result_rec !== 0) {\n //echo $result_rec ;\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE SERIAL_NUMBER='\" . $result_rec . \"'\"; //select data or insert data\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_rec = 0;\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n\n foreach ($row as $item) {\n //echo \"<li>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \"&nbsp;\") . \"</li>\";\n if ($item !== null)\n return $item;\n }\n }\n }\n else {\n return 0;\n }\n}", "public function get_item_content($it_num, $stage);", "public function setAvailableQuantityValue($var)\n {\n $this->writeWrapperValue(\"available_quantity\", $var);\n return $this;}", "function getQtyAllDetails($pid, $qty) {\n $profileName = array('Allgroup', 'Guest');\n $this->db->select('p3.tier_qty, p3.tier_price');\n $this->db->from('profilegroup p1');\n $this->db->join('profilegroup_config p2', 'p1.id = p2.profile_id', 'INNER');\n $this->db->join('tier_price p3', 'p3.tier_profile_id = p2.profile_id', 'INNER');\n $this->db->where('p3.tier_product_id', intval($pid));\n $this->db->where('p3.tier_qty <=', intval($qty));\n $this->db->where('p2.profileconfig_ref', 'TIERPRICING');\n $this->db->where('p2.profileconfig_value', 1);\n $this->db->where_in('p1.profile_name', $profileName);\n $this->db->group_by('p3.tier_id');\n $this->db->order_by('p3.tier_qty', 'DESC');\n $query = $this->db->get();\n //die($this->db->last_query());\n if ($query->num_rows() > 0) {\n return $query->row_array();\n }\n return false;\n }", "public function getVendorPartNumber(): string\n {\n return $this->vendorPartNumber;\n }", "public static function getSerialNumberInStockByPartner($id_partner, $stock_name, $serial_number)\r\n {\r\n $db = MsSQL::getConnection();\r\n\r\n $sql = \"SELECT\r\n sgt.serial_number\r\n FROM site_gm_stocks sgt\r\n INNER JOIN tbl_Users tu \r\n ON sgt.site_account_id = tu.site_gs_account_id\r\n INNER JOIN site_gm_users sgu \r\n ON sgu.id = tu.site_gs_account_id\r\n WHERE sgu.site_account_id = :id_user\r\n AND stock_name = :stock_name\r\n AND sgt.serial_number = :serial_number\";\r\n\r\n $result = $db->prepare($sql);\r\n $result->bindParam(':id_user', $id_partner, PDO::PARAM_INT);\r\n $result->bindParam(':stock_name', $stock_name, PDO::PARAM_STR);\r\n $result->bindParam(':serial_number', $serial_number, PDO::PARAM_STR);\r\n $result->execute();\r\n return $result->fetch(PDO::FETCH_ASSOC);\r\n }", "public function hasQty($tourId, $qty);", "public function getTargetInventoryQuantity()\n {\n return $this->targetInventoryQuantity;\n }", "public function retrieve_inventory()\n {\n if (Authenticate::is_player()) {\n if (isset($_POST['token']) && Authenticate::is_valid_token($_POST['token'])) {\n $this->model_product = Product::getInstance();\n $this->model_material = Material::getInstance();\n $this->model_asset = Asset::getInstance();\n\n $product = $this->model_product->get_player_product();\n $material = $this->model_material->get_player_material();\n $asset = $this->model_asset->get_player_asset();\n\n $binding = array(\n \"result_var\" => \"session_ready\",\n \"product_var\" => json_encode($product, JSON_PRETTY_PRINT),\n \"material_var\" => json_encode($material, JSON_PRETTY_PRINT),\n \"asset_var\" => json_encode($asset, JSON_PRETTY_PRINT)\n );\n\n binding_data($binding);\n } else {\n transport(\"error404\");\n }\n } else {\n $binding = array(\"result_var\" => \"no_session\");\n binding_data($binding);\n }\n }", "public function getInventoryProcess() {\n return $this->params['inventoryProcess'];\n }", "protected function QtyInStock() {\n\treturn $this->GetFieldValue('QtyInStock');\n }", "public function getAvailableQuantity()\n {\n return $this->available_quantity;\n }", "function get_available_parts_nohtml_noversion($part_id) {\n // Database connection \n $conn = database_connection();\n\n $sql = \"SELECT SERIAL_NUMBER FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE KIND_OF_PART_ID='\" . $part_id . \"' AND IS_RECORD_DELETED = 'F' AND PART_ID not in (select PART_ID from CMS_GEM_CORE_CONSTRUCT.PHYSICAL_PARTS_TREE) ORDER BY SUBSTR(SERIAL_NUMBER, -4) asc\"; //select data or insert data \n\n\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_arr = array();\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n// echo '<li><a href=\"#\" class=\"availablepart\" >' . $row['SERIAL_NUMBER'] . '</a></li>';\n\n $temp['SERIAL_NUMBER'] = $row['SERIAL_NUMBER'];\n $result_arr[] = $temp;\n }\n return $result_arr;\n}", "abstract public function grabReportList( $quantity );", "public function hookactionUpdateQuantity($params)\n {\n $id_product = (int)$params['id_product'];\n $id_product_attribute = (int)$params['id_product_attribute'];\n \n $context = Context::getContext();\n $id_shop = (int)$context->shop->id;\n $id_lang = (int)$context->language->id;\n $product = new Product($id_product, false, $id_lang, $id_shop, $context);\n \n if (empty($product)) {\n return;\n }\n \n $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang);\n $product_has_attributes = $product->hasAttributes();\n $productInfo = array(\n 'product_name' => $product_name,\n 'product_id' => $id_product\n );\n $check_oos = ($product_has_attributes && $id_product_attribute)\n || (!$product_has_attributes && !$id_product_attribute);\n $product_quantity = (int)$params['quantity'];\n if (Module::isInstalled('mailalerts')) {\n // For out of stock notification to admin\n $isActivate = $this->isRulesetActive('out_of_stock_alerts');\n if ($check_oos\n && $product->active == 1\n && $isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity <= $this->outStock) {\n $legendstemp = $this->replaceProductLegends(\n $isActivate[0]['template'],\n $productInfo\n );\n // Use send SMS API here\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $this->adminMobile\n );\n \n $this->sendSMSByAPI($postAPIdata);\n Onehopsmsservice::onehopSaveLog('OutStock', $legendstemp, $this->adminMobile);\n }\n \n // For back in stock\n $isActivate = $this->isRulesetActive('back_of_stock_alerts');\n if ($isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity > 0) {\n $bosSql = 'SELECT DISTINCT adr.phone_mobile, oos.id_customer';\n $bosSql .= ' FROM '._DB_PREFIX_. 'mailalert_customer_oos as oos';\n $bosSql .= ' INNER JOIN '._DB_PREFIX_. 'address as adr ON oos.id_customer = adr.id_customer';\n $bosSql .= ' WHERE oos.id_product = \"' . (int)$id_product . '\" AND deleted = 0';\n $bosResults = Db::getInstance()->ExecuteS($bosSql);\n \n if ($bosResults) {\n foreach ($bosResults as $customerVal) {\n $customerInfo = array(\n 'id_customer' => $customerVal['id_customer'],\n 'phone_mobile' => $customerVal['phone_mobile']\n );\n $legendstemp = $this->replaceProductCustomerLegends(\n $isActivate[0]['template'],\n $customerInfo,\n $productInfo\n );\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n // Use send SMS API here\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $customerVal['phone_mobile']\n );\n $this->sendSMSByAPI($postAPIdata);\n $delQuery = 'DELETE FROM ' . _DB_PREFIX_ . 'mailalert_customer_oos';\n $delQuery .= ' WHERE id_customer = \"' . (int)$customerVal['id_customer'] . '\"';\n Db::getInstance()->execute($delQuery);\n Onehopsmsservice::onehopSaveLog('BackStock', $legendstemp, $customerVal['phone_mobile']);\n }\n }\n }\n }\n }", "public function showProductQty(){\n $sId = session_id();\n $query = \"SELECT * FROM tbl_cart WHERE sId = '$sId'\";\n $select_result = $this->db->select($query);\n\n if ($select_result) {\n $row = mysqli_num_rows($select_result);\n return $row;\n //return $select_result;\n }else {\n return 0;\n }\n\n }", "function editInventory()\n\t{\n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from product_inventory_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$output=$obj->records[0];\n\t\t\t\n\t\t\treturn $output;\n\t\t}\n\t}", "function ju_assert_qty_supported(P $p):void {ju_assert(\n\tju_pt_has_qty($t = $p->getTypeId()), \"Products of type `$t` do not have a quantity.\"\n);}", "function WselectSerialNumberForItemByID($OrderID,$item_id,$sku){\r\n\t\t\t $strSQLQuery = \"select SerialNumbers from p_order_item where OrderID='\".$OrderID.\"' and item_id='\".$item_id.\"' and sku='\".$sku.\"'\";\r\n\t\t\t return $this->query($strSQLQuery, 1);\r\n\t\t }", "function get_itemidbyrecno($recno, $debug = false) {\n\t\t$q = (new QueryBuilder())->table('itemsearch');\n\t\t$q->field('itemid');\n\t\t$q->where('recno', $recno);\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\treturn $sql->fetchColumn();\n\t\t}\n\t}" ]
[ "0.6660462", "0.6132399", "0.6132399", "0.6004119", "0.6004119", "0.6004119", "0.59469104", "0.58763176", "0.58225596", "0.5746147", "0.5618265", "0.5595219", "0.5588948", "0.55698216", "0.55632305", "0.5552674", "0.55480206", "0.55139685", "0.5500972", "0.5496082", "0.5488134", "0.54881155", "0.5485927", "0.5481762", "0.547322", "0.544781", "0.5396244", "0.5376596", "0.5372908", "0.5368951", "0.5365728", "0.53366846", "0.53335685", "0.5316826", "0.5314889", "0.5314098", "0.53025866", "0.5284007", "0.5277604", "0.5275793", "0.52585876", "0.5249527", "0.5234021", "0.52313083", "0.52313083", "0.52313083", "0.52313083", "0.52313083", "0.52313083", "0.52313083", "0.52313083", "0.52313083", "0.52313083", "0.52313083", "0.52232134", "0.52113956", "0.52110267", "0.5209416", "0.5205755", "0.52030927", "0.5192689", "0.5189012", "0.5188563", "0.51872647", "0.51752084", "0.51710266", "0.5161712", "0.51590955", "0.5142956", "0.5130114", "0.51267844", "0.5113674", "0.51025075", "0.5100914", "0.50958097", "0.50947315", "0.50893736", "0.5067854", "0.5065512", "0.5054418", "0.50458235", "0.5044331", "0.50354254", "0.50338554", "0.50262135", "0.5013665", "0.5005778", "0.49950534", "0.49821556", "0.49790165", "0.49710175", "0.4952385", "0.49444827", "0.49444675", "0.49441853", "0.49384677", "0.49305287", "0.49230403", "0.4919144", "0.49188152" ]
0.8221353
0
Get tax rate list
public function getTaxRates() { // Parse XML $xml = "<TaxRateGetRq></TaxRateGetRq>\n"; // Create request and pack $this->createRequest($xml); $len = strlen($this->xmlRequest); $packed = pack("N", $len); // Send and get the response fwrite($this->id, $packed, 4); fwrite($this->id, $this->xmlRequest); $this->getResponse(); // Set the result $this->setResult($this->parseXML($this->xmlResponse)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTaxRate();", "public function getTaxRates(){\n $taxRates = [];\n foreach ($this->data as $taxRate) {\n $newTaxRate = [];\n $newTaxRate['accounting_id'] = IndexSanityCheckHelper::indexSanityCheck('TaxType', $taxRate);\n $newTaxRate['code'] = IndexSanityCheckHelper::indexSanityCheck('TaxType', $taxRate);\n $newTaxRate['name'] = IndexSanityCheckHelper::indexSanityCheck('Name', $taxRate);\n $newTaxRate['tax_type_id'] = IndexSanityCheckHelper::indexSanityCheck('TaxType', $taxRate);\n $newTaxRate['rate'] = IndexSanityCheckHelper::indexSanityCheck('EffectiveRate', $taxRate);\n $newTaxRate['is_asset'] = IndexSanityCheckHelper::indexSanityCheck('CanApplyToAssets', $taxRate);\n $newTaxRate['is_equity'] = IndexSanityCheckHelper::indexSanityCheck('CanApplyToEquity', $taxRate);\n $newTaxRate['is_expense'] = IndexSanityCheckHelper::indexSanityCheck('CanApplyToExpenses', $taxRate);\n $newTaxRate['is_liability'] = IndexSanityCheckHelper::indexSanityCheck('CanApplyToLiabilities', $taxRate);\n $newTaxRate['is_revenue'] = IndexSanityCheckHelper::indexSanityCheck('CanApplyToRevenue', $taxRate);\n array_push($taxRates, $newTaxRate);\n }\n\n return $taxRates;\n }", "public function getTaxList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_tax');\r\n\t\t$this->db->where('tax_status', '1');\t\t\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "public function getExternalTaxRate();", "public function getTaxes()\n {\n $t = TransModPPM::getInstance();\n return [\n ['id' => 'N', 'name' => $t->ld('Without VAT')],\n ['id' => 'Y', 'name' => $t->ld('With VAT')],\n ];\n }", "public function getTaxcharges()\n {\n return $this->taxcharges;\n }", "public function getTaxes() {\n return $this->taxes;\n }", "public function tax()\n {\n return $this->getCartSessionCollection()->map(function($item, $key) {\n return (($item['price'] * $item['quantity']) / 100) * $this->config->get('cart.tax_rate');\n })->reduce(function($carry, $item) {\n return $carry + $item;\n });\n }", "public function getTaxList($type ='Both'){\n\t \n\t \t\t$this->db->select(\"TS.tax_id, TS.tax_per, TS.tax_type\");\n\t\t\t$this->db->from(\"tax_structure AS TS\");\n\t\t\t//$this->db->where(\"TS.tax_type\",'Active');\n\t\t\tif($type == 'Both'){\n\t\t\t\t$this->db->where_in('TS.tax_type', array('CST','VAT'));\n\t\t\t}else{\n\t\t\t\t$this->db->where('TS.tax_type', 'Excise');\n\t\t\t}\n\t\t\t$this->db->where(\"TS.status\",'Active');\n\t\t\t$query_tax_array = $this->db->get();\n\t\t\t//echo $this->db->last_query();die;\n\t\t\tif($query_tax_array->num_rows()>0)\n\t\t\t{\n\t\t\t\treturn $query_tax_array->result_array();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t \n\t }", "function getReceiptTax()\n\t{\n\t\tglobal $db;\n\n\t\t$query = 'SELECT t.tax_desc AS \"Tax\", rt.tax_rate AS \"Tax Rate\", rt.tax_value AS \"Tax Value\"\n\t\tFROM '.receipt_tax_table.' rt JOIN '.tax_table.' t USING (tax_id) \n\t\tWHERE rt.receipt_id = '.$this->receipt_id.' \n\t\tORDER BY rt.tax_sequence';\n\t\t$result = $db->query($query);\n\n\t\tif(!$result)\n\t\t{\n\t\t\t$err_info = $db->errorInfo();\n\t\t\techo $err_info[2];\n\t\t\terror_log('Function : getReceiptTax, Class : receipt, '.$err_info[2]);\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr = $result->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t\treturn $arr;\n\t}", "public static function getRates() {\n $result = self::get(self::getPath('rates'));\n \n Return $result;\n }", "public function addTaxRate()\n {\n $this->taxRates[] = [\n 'id' => null,\n 'name' => null,\n 'priority' => count($this->taxRates) + 1,\n 'amounts' => $this->taxClasses->map(function ($taxClass) {\n return [\n 'id' => null,\n 'tax_class_id' => $taxClass->id,\n 'tax_class_name' => $taxClass->name,\n 'percentage' => 0,\n ];\n })->toArray(),\n ];\n }", "public function getTaxInvoiced();", "public function getTaxes()\n {\n return isset($this->Taxes) ? $this->Taxes : null;\n }", "function ciniki_taxes_typeList(&$ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'locations'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Locations'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'taxes', 'private', 'checkAccess');\n $rc = ciniki_taxes_checkAccess($ciniki, $args['tnid'], 'ciniki.taxes.typeList'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n $modules = $rc['modules'];\n\n $rsp = array('stat'=>'ok', 'active'=>array(), 'inactive'=>array());\n\n //\n // Get the list of active tax types, with current tax rates\n //\n $strsql = \"SELECT ciniki_tax_types.id, \"\n . \"ciniki_tax_types.name, \"\n . \"ciniki_tax_types.flags, \"\n . \"ciniki_tax_type_rates.rate_id AS rate_id, \"\n . \"ciniki_tax_rates.name AS rate_name \"\n . \"\";\n if( ($modules['ciniki.taxes']['flags']&0x01) > 0 ) {\n $strsql .= \", IFNULL(ciniki_tax_locations.name, '') AS rate_location \";\n } else {\n $strsql .= \", '' AS rate_location \";\n }\n $strsql .= \"FROM ciniki_tax_types \"\n . \"LEFT JOIN ciniki_tax_type_rates ON (ciniki_tax_types.id = ciniki_tax_type_rates.type_id \"\n . \"AND ciniki_tax_type_rates.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_tax_rates ON (ciniki_tax_type_rates.rate_id = ciniki_tax_rates.id \"\n . \"AND ciniki_tax_rates.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND ciniki_tax_rates.start_date < UTC_TIMESTAMP \"\n . \"AND (ciniki_tax_rates.end_date = '0000-00-00 00:00:00' \"\n . \"OR ciniki_tax_rates.end_date > UTC_TIMESTAMP()) \"\n . \") \";\n if( ($modules['ciniki.taxes']['flags']&0x01) > 0 ) {\n $strsql .= \"LEFT JOIN ciniki_tax_locations ON (\"\n . \"ciniki_tax_rates.location_id = ciniki_tax_locations.id \"\n . \"AND ciniki_tax_locations.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \";\n }\n $strsql .= \"WHERE ciniki_tax_types.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND (ciniki_tax_types.flags&0x01) = 0 \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.taxes', array(\n array('container'=>'types', 'fname'=>'id', 'name'=>'type',\n 'fields'=>array('id', 'name', 'flags')),\n array('container'=>'rates', 'fname'=>'rate_id', 'name'=>'rate',\n 'fields'=>array('id'=>'rate_id', 'name'=>'rate_name', 'location'=>'rate_location')),\n// 'fields'=>array('id', 'name', 'flags', 'rate_ids', 'rates'),\n// 'idlists'=>array('rate_ids'), 'lists'=>array('rates')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['types']) ) {\n $rsp['active'] = $rc['types'];\n// foreach($rsp['active'] as $tid => $type) {\n// $rsp['active'][$tid]['type']['rate_text'] = '';\n// foreach($type['type']['rates'] as $rid => $rate) {\n// $rsp['active'][$tid]['type']['rate_text'] .= ($rsp['active'][$tid]['type']['rate_text']!=''?'<br/>':'');\n// if( ($modules['ciniki.taxes']['flags']&0x01) > 0 ) {\n// $rsp['active'][$tid]['type']['rate_text'] .= $rate['rate']['location'] . ' - ';\n// }\n// }\n// }\n }\n\n //\n // Get the list of inactive tax types\n //\n $strsql = \"SELECT ciniki_tax_types.id, \"\n . \"ciniki_tax_types.name, \"\n . \"ciniki_tax_types.flags, \"\n . \"ciniki_tax_type_rates.rate_id AS rate_ids, \"\n . \"ciniki_tax_rates.name AS rates \"\n . \"\";\n if( ($modules['ciniki.taxes']['flags']&0x01) > 0 ) {\n $strsql .= \", IFNULL(ciniki_tax_locations.name, '') AS rate_location \";\n } else {\n $strsql .= \", '' AS rate_location \";\n }\n $strsql .= \"FROM ciniki_tax_types \"\n . \"LEFT JOIN ciniki_tax_type_rates ON (ciniki_tax_types.id = ciniki_tax_type_rates.type_id \"\n . \"AND ciniki_tax_type_rates.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_tax_rates ON (ciniki_tax_type_rates.rate_id = ciniki_tax_rates.id \"\n . \"AND ciniki_tax_rates.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND ciniki_tax_rates.start_date < UTC_TIMESTAMP \"\n . \"AND (ciniki_tax_rates.end_date = '0000-00-00 00:00:00' \"\n . \"OR ciniki_tax_rates.end_date > UTC_TIMESTAMP()) \"\n . \") \";\n if( ($modules['ciniki.taxes']['flags']&0x01) > 0 ) {\n $strsql .= \"LEFT JOIN ciniki_tax_locations ON (\"\n . \"ciniki_tax_rates.location_id = ciniki_tax_locations.id \"\n . \"AND ciniki_tax_locations.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \";\n }\n $strsql .= \"WHERE ciniki_tax_types.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND (ciniki_tax_types.flags&0x01) = 1 \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.taxes', array(\n array('container'=>'types', 'fname'=>'id', 'name'=>'type',\n 'fields'=>array('id', 'name', 'flags')),\n array('container'=>'rates', 'fname'=>'rate_id', 'name'=>'rate',\n 'fields'=>array('id'=>'rate_id', 'name'=>'rate_name', 'location'=>'rate_location')),\n// 'fields'=>array('id', 'name', 'flags', 'rate_ids', 'rates'),\n// 'idlists'=>array('rate_ids'), 'lists'=>array('rates')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['types']) ) {\n $rsp['inactive'] = $rc['types'];\n }\n\n //\n // If locations specified, get the list of known locations\n //\n if( isset($args['locations']) && $args['locations'] == 'yes' ) {\n $strsql = \"SELECT id, code, name \"\n . \"FROM ciniki_tax_locations \"\n . \"WHERE ciniki_tax_locations.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.taxes', array(\n array('container'=>'locations', 'fname'=>'id', 'name'=>'location',\n 'fields'=>array('id', 'code', 'name')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['locations']) ) {\n $rsp['locations'] = $rc['locations'];\n } else {\n $rsp['locations'] = array();\n }\n }\n\n return $rsp;\n}", "public function getRates()\n {\n # Convert the rates to a key / value array:\n return json_decode( json_encode($this->rates), true );\n }", "public function getTaxRefunded();", "public function getTaxedPrice();", "public function getTaxRate()\r\n {\r\n return $this->item->getParentObject()->getOrder()->getProxy()->getTaxRate();\r\n }", "public static function getRates() : array\n {\n return self::$rates;\n }", "public function getTaxes()\n {\n return $this->hasMany(Tax::className(), ['sales_gl_acc_id' => 'account_id']);\n }", "public function getTaxRates($basket)\r\n {\r\n $result = array();\r\n\r\n if (!empty($basket['sShippingcostsTax'])) {\r\n $basket['sShippingcostsTax'] = number_format(floatval($basket['sShippingcostsTax']),2);\r\n\r\n $result[$basket['sShippingcostsTax']] = $basket['sShippingcostsWithTax']-$basket['sShippingcostsNet'];\r\n if (empty($result[$basket['sShippingcostsTax']])) unset($result[$basket['sShippingcostsTax']]);\r\n } elseif ($basket['sShippingcostsWithTax']) {\r\n $result[number_format(floatval(Shopware()->Config()->get('sTAXSHIPPING')),2)] = $basket['sShippingcostsWithTax']-$basket['sShippingcostsNet'];\r\n if (empty($result[number_format(floatval(Shopware()->Config()->get('sTAXSHIPPING')),2)])) unset($result[number_format(floatval(Shopware()->Config()->get('sTAXSHIPPING')),2)]);\r\n }\r\n\r\n\r\n if (empty($basket['content'])) {\r\n ksort($result, SORT_NUMERIC);\r\n return $result;\r\n }\r\n\r\n foreach ($basket['content'] as $item) {\r\n\r\n if (!empty($item[\"tax_rate\"])) {\r\n\r\n } elseif (!empty($item['taxPercent'])) {\r\n $item['tax_rate'] = $item[\"taxPercent\"];\r\n } elseif ($item['modus'] == 2) {\r\n // Ticket 4842 - dynamic tax-rates\r\n $resultVoucherTaxMode = Shopware()->Db()->fetchOne(\r\n \"SELECT taxconfig FROM s_emarketing_vouchers WHERE ordercode=?\r\n \", array($item[\"ordernumber\"]));\r\n // Old behaviour\r\n if (empty($resultVoucherTaxMode) || $resultVoucherTaxMode == \"default\") {\r\n $tax = Shopware()->Config()->get('sVOUCHERTAX');\r\n } elseif ($resultVoucherTaxMode == \"auto\") {\r\n // Automatically determinate tax\r\n $tax = $this->basket->getMaxTax();\r\n } elseif ($resultVoucherTaxMode == \"none\") {\r\n // No tax\r\n $tax = \"0\";\r\n } elseif (intval($resultVoucherTaxMode)) {\r\n // Fix defined tax\r\n $tax = Shopware()->Db()->fetchOne(\"\r\n SELECT tax FROM s_core_tax WHERE id = ?\r\n \", array($resultVoucherTaxMode));\r\n }\r\n $item['tax_rate'] = $tax;\r\n } else {\r\n // Ticket 4842 - dynamic tax-rates\r\n $taxAutoMode = Shopware()->Config()->get('sTAXAUTOMODE');\r\n if (!empty($taxAutoMode)) {\r\n $tax = $this->basket->getMaxTax();\r\n } else {\r\n $tax = Shopware()->Config()->get('sDISCOUNTTAX');\r\n }\r\n $item['tax_rate'] = $tax;\r\n }\r\n\r\n if (empty($item['tax_rate']) || empty($item[\"tax\"])) continue; // Ignore 0 % tax\r\n\r\n $taxKey = number_format(floatval($item['tax_rate']), 2);\r\n\r\n $result[$taxKey] += str_replace(',', '.', $item['tax']);\r\n }\r\n\r\n ksort($result, SORT_NUMERIC);\r\n\r\n return $result;\r\n }", "protected function syncTaxRates()\n {\n $this->taxRates = $this->taxZone->taxRates()->get()->map(function ($taxRate) {\n return [\n 'id' => $taxRate->id,\n 'name' => $taxRate->name,\n 'priority' => $taxRate->priority,\n 'amounts' => $this->taxClasses->map(function ($taxClass) use ($taxRate) {\n $amount = $taxRate->taxRateAmounts->first(function ($amount) use ($taxClass) {\n return $amount->tax_class_id == $taxClass->id;\n });\n\n return [\n 'id' => $amount?->id,\n 'tax_class_id' => $taxClass->id,\n 'tax_class_name' => $taxClass->name,\n 'percentage' => $amount->percentage ?? 0,\n ];\n })->toArray(),\n ];\n })->toArray();\n }", "public function getTax()\n\t{\n\t\treturn $this->getKeyValue('Tax'); \n\n\t}", "public function getTax()\n {\n return $this->tax;\n }", "public function getRates()\n {\n return $this->_rates;\n }", "public function getFullTaxInfo()\n {\n $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;\n $taxClassAmount = $this->_getCalculatedTaxes();\n $shippingTax = $this->_getShippingTax();\n $taxClassAmount = array_merge($taxClassAmount, $shippingTax);\n\n if (!empty($taxClassAmount)) {\n foreach ($taxClassAmount as &$tax) {\n $percent = $tax['percent'] ? ' (' . $tax['percent']. '%)' : '';\n $tax['amount'] = $this->getAmountPrefix() . $this->getOrder()->formatPriceTxt($tax['tax_amount']);\n $tax['label'] = $this->_getTaxHelper()->__($tax['title']) . $percent . ':';\n $tax['font_size'] = $fontSize;\n }\n } else {\n $fullInfo = $this->_getFullRateInfo();\n $tax_info = array();\n\n if ($fullInfo) {\n foreach ($fullInfo as $info) {\n if (isset($info['hidden']) && $info['hidden']) {\n continue;\n }\n\n $_amount = $info['amount'];\n\n foreach ($info['rates'] as $rate) {\n $percent = $rate['percent'] ? ' (' . $rate['percent']. '%)' : '';\n\n $tax_info[] = array(\n 'amount' => $this->getAmountPrefix() . $this->getOrder()->formatPriceTxt($_amount),\n 'label' => $this->_getTaxHelper()->__($rate['title']) . $percent . ':',\n 'font_size' => $fontSize\n );\n }\n }\n }\n $taxClassAmount = $tax_info;\n }\n\n return $taxClassAmount;\n }", "function getFullTaxInfo()\n {\n $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;\n $taxClassAmount = $this->_taxHelper->getCalculatedTaxes($this->getQuote());\n if (!empty($taxClassAmount)) {\n foreach ($taxClassAmount as &$tax) {\n $percent = $tax['percent'] ? ' (' . $tax['percent'] . '%)' : '';\n $tax['amount'] = $this->getAmountPrefix() . $this->getQuote()->formatPriceTxt($tax['tax_amount']);\n $tax['label'] = __($tax['title']) . $percent . ':';\n $tax['font_size'] = $fontSize;\n }\n } else {\n /** @var $orders \\Magento\\Tax\\Model\\ResourceModel\\Sales\\Order\\Tax\\Collection */\n $orders = $this->_taxOrdersFactory->create();\n $rates = $orders->loadByOrder($this->getQuote())->toArray();\n $fullInfo = $this->_taxCalculation->reproduceProcess($rates['items']);\n $tax_info = [];\n\n if ($fullInfo) {\n foreach ($fullInfo as $info) {\n if (isset($info['hidden']) && $info['hidden']) {\n continue;\n }\n\n $_amount = $info['amount'];\n\n foreach ($info['rates'] as $rate) {\n $percent = $rate['percent'] ? ' (' . $rate['percent'] . '%)' : '';\n\n $tax_info[] = [\n 'amount' => $this->getAmountPrefix() . $this->getQuote()->formatPriceTxt($_amount),\n 'label' => __($rate['title']) . $percent . ':',\n 'font_size' => $fontSize,\n ];\n }\n }\n }\n $taxClassAmount = $tax_info;\n }\n\n return $taxClassAmount;\n }", "public function GetRates()\n\t{\n\t\treturn $this->rates;\n\t}", "function tep_get_tax_rate_value($class_id) {\n return tep_get_tax_rate($class_id, -1, -1);\n }", "public function getTax()\n {\n return $this->_tax;\n }", "public function getFxRates()\n {\n return array_map(function (stdClass $object) {\n return FxRate::createFromObject($object);\n }, $this->getEndpoint('GetFxRates'));\n }", "public function getTaxAmount();", "public function getExciseTaxList($type ='Excise'){\n\t \n\t \t\t$this->db->select(\"TS.tax_id, TS.tax_per, TS.tax_type\");\n\t\t\t$this->db->from(\"tax_structure AS TS\");\n\t\t\t//$this->db->where(\"TS.tax_type\",'Active');\n\t\t\t$this->db->where('TS.tax_type', 'Excise');\n\t\t\t$this->db->where(\"TS.status\",'Active');\n\t\t\t$query_tax_array = $this->db->get();\n\t\t\t//echo $this->db->last_query();die;\n\t\t\tif($query_tax_array->num_rows()>0)\n\t\t\t{\n\t\t\t\treturn $query_tax_array->result_array();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t \n\t }", "public function getPurchaseTaxes() {\n return $this->purchaseTaxes;\n }", "public function getTaxLines() {\n return $this->getParameter('tax_lines');\n }", "public function getUseExchangeRates();", "function get_tax_base_rate() {\n\t\t\n\t\tif ( $this->is_taxable() && get_option('woocommerce_calc_taxes')=='yes') :\n\t\t\t\n\t\t\t$_tax = &new woocommerce_tax();\n\t\t\t$rate = $_tax->get_shop_base_rate( $this->data['tax_class'] );\n\t\t\t\n\t\t\treturn $rate;\n\t\t\t\n\t\tendif;\n\t\t\n\t}", "function get_tax_rate()\n\t{\n\t\tif(empty($this->address))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$rate\t= 0;\n\t\t\n\t\t$rate += $this->get_country_tax_rate();\n\t\t$rate += $this->get_zone_tax_rate();\n\t\t$rate += $this->get_area_tax_rate();\n\t\t\n\t\t//returns the total rate not affected by price of merchandise.\n\t\treturn $rate;\n\t}", "public function taxes()\n {\n return $this->hasMany(Tax::class);\n }", "public function selectTaxRateRecords($taxCode='') {\n \n // query preparation\n $select = 'bh.NUMMER, bh.STEUERSATZCODE, bh.STEUERSATZPROZ, bh.GUELTIGABTTMMJJJJ'.\n ($this->oldTaxTableExists() == true ? ', st.BEMERKUNG AS BEMERKUNG' : '').' ';\n $from = $this->getTableName('BHSTEUER').' bh'. \n ($this->oldTaxTableExists() == true ? ' LEFT JOIN '.$this->getTableName('STEUER').' st ON bh.STEUERSATZCODE LIKE st.CODE' : '');\n $where = (empty($taxCode) ? '1' : 'STEUERSATZCODE LIKE '.$this->gsaDbObj->fullQuoteStr($taxCode, $from)).' ';\n $groupBy = 'bh.STEUERSATZCODE, bh.GUELTIGABTTMMJJJJ, bh.STEUERSATZPROZ'; // this is required due to a bug of the ERP system: it creates multiple redundant records (but with different UIDs in field NUMMER) in the DB table BHSTEUER\n $orderBy = 'bh.STEUERSATZCODE, bh.GUELTIGABTTMMJJJJ';\n $limit = '';\n \n // exec query using TYPO3 DB API\n $res = $this->gsaDbObj->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);\n if ($res == false) {\n throw new tx_pttools_exception('Query failed or returned empty result', 1, $this->gsaDbObj->sql_error());\n } \n \n // store all data in twodimensional array\n $a_result = array();\n while ($a_row = $this->gsaDbObj->sql_fetch_assoc($res)) {\n // if enabled, do charset conversion of all non-binary string data \n if ($this->charsetConvEnabled == 1) {\n $a_row = tx_pttools_div::iconvArray($a_row, $this->gsaCharset, $this->siteCharset);\n }\n $a_result[] = $a_row;\n }\n $this->gsaDbObj->sql_free_result($res);\n \n trace($a_result);\n return $a_result;\n \n }", "public function getRates()\n {\n return (new Rates)->fetchRates(); \n }", "public function tax(): float;", "public function getRates()\n {\n $this->uri = \"/?section=shipping&action=getRates\";\n \n return $this->send();\n }", "public function getTaxes() : float\n {\n $multiplier = app(CartLogistics::class)->getTaxRate(\n $this->purchaseable,\n $this->cart->shipping_address\n ) * 0.01;\n\n return $this->price * $multiplier;\n }", "public function tax()\n {\n return 0;\n }", "abstract public function getTaxType();", "public function get_tax() {\n\t\treturn $this->_tax;\n\t}", "function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n\n \n//Eversun mod for sppc and qty price breaks\n// global $customer_zone_id, $customer_country_id;\n global $customer_zone_id, $customer_country_id, $sppc_customer_group_tax_exempt;\n\n if(!tep_session_is_registered('sppc_customer_group_tax_exempt')) {\n $customer_group_tax_exempt = '0';\n } else {\n $customer_group_tax_exempt = $sppc_customer_group_tax_exempt;\n }\n\n if ($customer_group_tax_exempt == '1') {\n return 0;\n }\n//Eversun mod end for sppc and qty price breaks\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n if (!tep_session_is_registered('customer_id')) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n } else {\n $country_id = $customer_country_id;\n $zone_id = $customer_zone_id;\n }\n }\n\n $tax_query = tep_db_query(\"select sum(tax_rate) as tax_rate from \" . TABLE_TAX_RATES . \" tr left join \" . TABLE_ZONES_TO_GEO_ZONES . \" za on (tr.tax_zone_id = za.geo_zone_id) left join \" . TABLE_GEO_ZONES . \" tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '\" . (int)$country_id . \"') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '\" . (int)$zone_id . \"') and tr.tax_class_id = '\" . (int)$class_id . \"' group by tr.tax_priority\");\n if (tep_db_num_rows($tax_query)) {echo \"}}}}{{{{{\";\n $tax_multiplier = 1.0;\n while ($tax = tep_db_fetch_array($tax_query)) {\n $tax_multiplier *= 1.0 + ($tax['tax_rate'] / 100);\n }\n return ($tax_multiplier - 1.0) * 100;\n } else {\n return 0;\n }\n }", "function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n global $customer_zone_id, $customer_country_id;\n\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n }\n\n $Qtax = Registry::get('Db')->prepare('select sum(tax_rate) as tax_rate from :table_tax_rates tr left join :table_zones_to_geo_zones za on tr.tax_zone_id = za.geo_zone_id left join :table_geo_zones tz on tz.geo_zone_id = tr.tax_zone_id where (za.zone_country_id IS NULL OR za.zone_country_id = \"0\" OR za.zone_country_id = :zone_country_id) AND (za.zone_id IS NULL OR za.zone_id = \"0\" OR za.zone_id = :zone_id) AND tr.tax_class_id = :tax_class_id group by tr.tax_priority');\n $Qtax->bindInt(':zone_country_id', (int)$country_id);\n $Qtax->bindInt(':zone_id', (int)$zone_id);\n $Qtax->bindInt(':tax_class_id', (int)$class_id);\n $Qtax->execute();\n\n if ($Qtax->fetch() !== false) {\n $tax_multiplier = 0;\n\n do {\n $tax_multiplier += $Qtax->value('tax_rate');\n } while ($Qtax->fetch());\n\n return $tax_multiplier;\n } else {\n return 0;\n }\n }", "public function getCurrencyRates()\n {\n return $this->curlCall();\n }", "public function get_tax_totals() {\n\t\t$taxes = $this->get_taxes();\n\t\t$tax_totals = array();\n\n\t\tforeach ( $taxes as $key => $tax ) {\n\t\t\t$code = WC_Tax::get_rate_code( $key );\n\n\t\t\tif ( $code || apply_filters( 'woocommerce_cart_remove_taxes_zero_rate_id', 'zero-rated' ) === $key ) {\n\t\t\t\tif ( ! isset( $tax_totals[ $code ] ) ) {\n\t\t\t\t\t$tax_totals[ $code ] = new stdClass();\n\t\t\t\t\t$tax_totals[ $code ]->amount = 0;\n\t\t\t\t}\n\t\t\t\t$tax_totals[ $code ]->tax_rate_id = $key;\n\t\t\t\t$tax_totals[ $code ]->is_compound = WC_Tax::is_compound( $key );\n\t\t\t\t$tax_totals[ $code ]->label = WC_Tax::get_rate_label( $key );\n\t\t\t\t$tax_totals[ $code ]->amount += wc_round_tax_total( $tax );\n\t\t\t\t$tax_totals[ $code ]->formatted_amount = wc_price( wc_round_tax_total( $tax_totals[ $code ]->amount ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( apply_filters( 'woocommerce_cart_hide_zero_taxes', true ) ) {\n\t\t\t$amounts = array_filter( wp_list_pluck( $tax_totals, 'amount' ) );\n\t\t\t$tax_totals = array_intersect_key( $tax_totals, $amounts );\n\t\t}\n\n\t\treturn apply_filters( 'woocommerce_cart_tax_totals', $tax_totals, $this );\n\t}", "function get_tax($tax_class, $subtotal)\n{\n global $config, $tax_cache, $current_user_info;\n\n $rate = get_tax_rate($tax_class);\n\n if ($config['cart']['tax_base'] == 'shipping') {\n $tbase = 'ship';\n } else {\n $tbase = 'bill';\n }\n if (comparecsn($config['site_city'], $current_user_info[$tbase.'_city'])) {\n $tax_rate = $rate['tax_city'];\n } elseif (comparecsn($config['site_state'], $current_user_info[$tbase.'_state'])) {\n $tax_rate = $rate['tax_state'];\n } elseif (comparecsn($config['site_country'], $current_user_info[$tbase.'_country'])) {\n $tax_rate = $rate['tax_nation'];\n } else {\n $tax_rate = $rate['tax_world'];\n }\n\n return ($tax_rate / 100) * $subtotal;\n}", "public function getTax(){\n $brutto = $this->getBrutto();\n return $brutto - ($brutto / (107) * 100);\n }", "public function getJsonList()\n {\n return $this->Ascending()->lists('tax', 'tax_id');\n }", "public function getTax() {\n return $this->_tax;\n }", "public function index()\n\t{\n try {\n return $this->_tax->getJsonList();\n } catch(Exception $e)\n {\n return null;\n }\n\t}", "public function getCustomerTaxvat();", "public function getTaxes1()\n {\n return $this->hasMany(Tax::className(), ['purchase_gl_acc_id' => 'account_id']);\n }", "public function tax_types()\n {\n $taxTypes = TaxTypes::where('status', 'active')->orderBy('idx')->get();\n return view('setup.tax_types.index', compact('taxTypes'));\n }", "function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n global $customer_zone_id, $customer_country_id;\n\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n if (!tep_session_is_registered('customer_id')) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n } else {\n $country_id = $customer_country_id;\n $zone_id = $customer_zone_id;\n }\n }\n\n $tax_query = tep_db_query(\"select SUM(tax_rate) as tax_rate from \" . TABLE_TAX_RATES . \" tr left join \" . TABLE_ZONES_TO_GEO_ZONES . \" za ON tr.tax_zone_id = za.geo_zone_id left join \" . TABLE_GEO_ZONES . \" tz ON tz.geo_zone_id = tr.tax_zone_id WHERE (za.zone_country_id IS NULL OR za.zone_country_id = '0' OR za.zone_country_id = '\" . $country_id . \"') AND (za.zone_id IS NULL OR za.zone_id = '0' OR za.zone_id = '\" . $zone_id . \"') AND tr.tax_class_id = '\" . $class_id . \"' GROUP BY tr.tax_priority\");\n if (tep_db_num_rows($tax_query)) {\n $tax_multiplier = 0;\n while ($tax = tep_db_fetch_array($tax_query)) {\n $tax_multiplier += $tax['tax_rate'];\n }\n return $tax_multiplier;\n } else {\n return 0;\n }\n}", "public function getTaxRateKey();", "public function getTaxationLinks() {\n\t\treturn $this->taxation;\n\t}", "public function getBaseTaxRefunded();", "public function model()\n {\n return Taxrate::class;\n }", "public function getShippingTaxRefunded();", "public function getAllRates()\n {\n return $this->getRatesQuery()->execute();\n }", "public function get_rates() {\n\t\t$rates = self::make_api_call( 'rates' );\n\t\tif ( 'ok' === $rates['error'] ) {\n\t\t\treturn $rates['result'];\n\t\t}\n\t\treturn array();\n\t}", "public function index(){\n $data['title'] = \"Taxes\";\n $data['records']= $this->TaxModel->get_list('tbltaxes');\n\n $this->admin_load('taxes/tax_list',$data); \n }", "public function get_taxcode() {\n $matches = array();\n $paid = $this->input->post('paid');\n $query_string = htmlspecialchars($_POST['q'], ENT_QUOTES, 'UTF-8');\n $result = $this->classtraineemodel->get_user($this->tenant_id, $query_string, '', $paid);\n if ($result) {\n foreach ($result as $row) {\n $matches[] = array(\n 'key' => $row->user_id,\n 'label' => $row->tax_code . ' (Name: ' . $row->first_name . ' ' . $row->last_name . ')',\n 'value' => $row->tax_code\n );\n }\n }\n echo json_encode($matches);\n exit();\n }", "public function getTax(): Tax\n\t{\n\t\treturn $this->tax;\n\t}", "public function getBaseTaxInvoiced();", "public function getTaxes0()\n {\n return $this->hasMany(Tax::className(), ['sales_gl_acc_id' => 'account_id']);\n }", "public function get_taxes() {\n\t\treturn apply_filters( 'woocommerce_cart_get_taxes', wc_array_merge_recursive_numeric( $this->get_shipping_taxes(), $this->get_cart_contents_taxes(), $this->get_fee_taxes() ), $this );\n\t}", "protected function _getFullRateInfo()\n {\n $rates = Mage::getModel('tax/sales_order_tax')->getCollection()->loadByOrder($this->getOrder())->toArray();\n $fullInfo = Mage::getSingleton('tax/calculation')->reproduceProcess($rates['items']);\n return $fullInfo;\n }", "public function getTaxRate()\n {\n if (is_null($this->taxRate)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_TAX_RATE);\n if (is_null($data)) {\n return null;\n }\n\n $this->taxRate = TaxRateModel::of($data);\n }\n\n return $this->taxRate;\n }", "public function getTax()\n {\n $tax = 0;\n\n if (isset($this->_taxrate)) {\n $tax = $this->_taxrate * $this->_subtotal;\n }\n \n return $tax;\n }", "public function getTotalTax(){\n return $this->getParameter('total_tax');\n }", "public function getCurHisTaxes()\n {\n return $this->hasMany(CurHisTax::className(), ['currency_id' => 'currency_id']);\n }", "public function getBaseTaxAmount();", "public function getZoneRates();", "abstract public function getTaxPercent();", "public function get_alltaxcode() {\n \n $query_string = htmlspecialchars($_POST['q'], ENT_QUOTES, 'UTF-8');\n $result = $this->classtraineemodel->get_alluser($this->tenant_id, '', $query_string);\n if ($result) {\n foreach ($result as $row) {\n $matches[] = array(\n 'key' => $row->user_id,\n 'label' => $row->tax_code . ' (Name: ' . $row->first_name . ' ' . $row->last_name . ')',\n 'value' => $row->tax_code\n );\n }\n }\n echo json_encode($matches);\n exit();\n }", "public function get_tax_details(){\r\n\t\t\r\n\t\t$data\t\t\t\t\t\t\t= array();\r\n\t\t$data['tax_id']\t\t\t\t\t= $this->uri->segment(3);\r\n\t\t$data['tax_details']\t= $this->Common_model->get_tax_details($data['tax_id']);\r\n\t\techo json_encode($data['tax_details']);\r\n\t}", "public function getTaxAttribute(): float;", "function addTaxRates ( ) {\r\n\r\n\t\t$taxratekeys = $this->cart->lookupProductTaxRates( true );\r\n\r\n\t\t$this->glmsg .= '<tax-tables>'\r\n\t\t \t . '<default-tax-table>'\r\n \t\t . '<tax-rules>'\r\n \t\t . '<default-tax-rule>'\r\n \t\t . '<rate>0</rate>'\r\n \t\t . '<tax-area><world-area/></tax-area>'\r\n \t\t . '</default-tax-rule>'\r\n \t\t . '</tax-rules>'\r\n \t\t . '</default-tax-table>'\r\n\t\t\t\t\t . '<alternate-tax-tables>';\r\n\r\n\t\tif( is_array( $taxratekeys ) ) {\r\n\t\t\tforeach( $taxratekeys as $key ) {\r\n\t\t\t\t$this->glmsg .= '<alternate-tax-table standalone=\"true\" name=\"' . htmlspecialchars( $key, ENT_NOQUOTES) . '\">'\r\n\t\t\t\t\t\t\t . '<alternate-tax-rules>'\r\n\t\t\t\t\t\t\t . \t'<alternate-tax-rule>'\r\n\t\t\t\t\t\t\t . \t\t'<rate>' . strval( $this->cart->lookupTaxPerc( $key ) ) . '</rate>'\r\n\t\t\t\t\t\t\t . \t\t'<tax-area><world-area/></tax-area>'\r\n\t\t\t\t\t\t\t . \t'</alternate-tax-rule>'\r\n\t\t\t\t\t\t\t . '</alternate-tax-rules>'\r\n\t\t\t\t\t\t\t . '</alternate-tax-table>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif( $this->cart->getShippingHandlingTotal() != 0 ) {\r\n\t\t\t$this->glmsg .= '<alternate-tax-table standalone=\"true\" name=\"shipping\">'\r\n\t\t\t\t\t\t . '<alternate-tax-rules>'\r\n\t\t\t\t\t\t . \t'<alternate-tax-rule>'\r\n\t\t\t\t\t\t . \t\t'<rate>' . $this->cart->lookupTaxPercSpecial( 'Shipping' ) . '</rate>'\r\n\t\t\t\t\t\t . \t\t'<tax-area><world-area/></tax-area>'\r\n\t\t\t\t\t\t . \t'</alternate-tax-rule>'\r\n\t\t\t\t\t\t . '</alternate-tax-rules>'\r\n\t\t\t\t\t\t . '</alternate-tax-table>';\r\n\t\t}\r\n\r\n\r\n\t\t$this->glmsg .= '</alternate-tax-tables>'\r\n\t\t\t\t\t . '</tax-tables>';\r\n\t}", "public function getFullTaxInfo()\n {\n $source = $this->getSource();\n if (!$source instanceof \\Magento\\Sales\\Model\\Order\\Invoice\n && !$source instanceof \\Magento\\Sales\\Model\\Order\\Creditmemo\n ) {\n $source = $this->getOrder();\n }\n\n $taxClassAmount = [];\n if (empty($source)) {\n return $taxClassAmount;\n }\n\n $taxClassAmount = $this->_taxHelper->getCalculatedTaxes($source);\n if (empty($taxClassAmount)) {\n $rates = $this->_taxOrderFactory->create()->getCollection()->loadByOrder($source)->toArray();\n $taxClassAmount = $this->_taxCalculation->reproduceProcess($rates['items']);\n }\n\n return $taxClassAmount;\n }", "public function get_paid_taxcode() {\n $matches = array();\n $query_string = htmlspecialchars($_POST['q'], ENT_QUOTES, 'UTF-8');\n $result = $this->classtraineemodel->get_paid_user($this->tenant_id, $query_string, '');\n if ($result) {\n foreach ($result as $row) {\n $matches[] = array(\n 'key' => $row->user_id,\n 'label' => $row->tax_code . ' (Name: ' . $row->first_name . ' ' . $row->last_name . ')',\n 'value' => $row->tax_code\n );\n }\n }\n echo json_encode($matches);\n exit();\n }", "public function tax_codes()\n {\n $taxCodes = TaxCodes::where('status', 'active')->orderBy('idx')->get();\n return view('setup.tax_codes.index', compact('taxCodes'));\n }", "function getTax() \n\t{\n\t\t$tax = Option::where('attribute', '=', 'tax_mod')->first();\n\n\t\treturn (float)$tax->value;\n\t}", "public function getLineTax()\n\t{\n\t\treturn $this->getKeyValue('line_tax'); \n\n\t}", "public function getTotalTaxAmount();", "function get_tax($merchant_id,$access_token)\r\n{\r\n$curl=curl_init('https://apisandbox.dev.clover.com/v3/merchants/'.$merchant_id.'/tax_rates');\r\n\r\ncurl_setopt($curl, CURLOPT_HTTPHEADER, array(\r\n \r\n \"Authorization:Bearer \".$access_token,\r\n 'Content-Type: application/json',\r\n)\r\n); \r\n\r\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n$auth = curl_exec($curl);\r\n$info = curl_getinfo($curl);\r\n$tax_result=json_decode($auth);\r\nreturn $tax_result;\r\n}", "public function getTaxCategory();", "public function getTaxCategory();", "public function getTaxCategory();", "public function getPicklistValues()\n\t{\n\t\t$taxes = Vtiger_Inventory_Model::getGlobalTaxes();\n\t\tforeach ($taxes as $key => $tax) {\n\t\t\t$taxes[$key] = $tax['name'] . ' - ' . App\\Fields\\Double::formatToDisplay($tax['value']) . '%';\n\t\t}\n\t\treturn $taxes;\n\t}", "public function get_coupon_discount_tax_totals() {\n\t\treturn (array) $this->coupon_discount_tax_totals;\n\t}", "function getTaxPercenTax($id)\n\t{\n\n\n\t\t$query3=\"SELECT (ps.cgst+ps.sgst) as gst FROM `product` as p INNER JOIN product_variant as pv on pv.`ptdvar_id` = p.ptdvar_id INNER JOIN product_sub_category as ps on ps.pr_sub_id = pv.ptd_sub_catgry_id where p.product_id ='$id'\";\n\t $data3=$this->get_results( $query3 );\n\t\treturn $data3;\n\n\t}", "public function getListTaxMaster()\n {\n return null;\n }" ]
[ "0.7906354", "0.771376", "0.73928463", "0.73269075", "0.72271836", "0.7067093", "0.6976278", "0.69280666", "0.6871433", "0.6860583", "0.6728387", "0.66911477", "0.66283065", "0.6625015", "0.6580278", "0.6578986", "0.6548295", "0.64964306", "0.6472996", "0.6472856", "0.6453268", "0.6438818", "0.643729", "0.64046973", "0.6404104", "0.6400563", "0.6382949", "0.6341551", "0.6334142", "0.6328192", "0.6315292", "0.6305259", "0.63023597", "0.629808", "0.6294674", "0.62946206", "0.6291865", "0.6288825", "0.62762934", "0.62744284", "0.6248465", "0.6246458", "0.6233332", "0.6216718", "0.6209416", "0.6192343", "0.6147455", "0.61427075", "0.6128446", "0.61258316", "0.6123084", "0.610454", "0.61005753", "0.60997653", "0.6095532", "0.60925937", "0.6088584", "0.60856485", "0.6084677", "0.6082516", "0.60641384", "0.6042338", "0.603744", "0.60334456", "0.6027832", "0.601369", "0.5987188", "0.59796506", "0.5960263", "0.5954336", "0.5944177", "0.59382224", "0.5937562", "0.59273446", "0.5927093", "0.5925076", "0.59181005", "0.59163624", "0.5890322", "0.58724356", "0.587164", "0.5863858", "0.5862783", "0.5862563", "0.5839008", "0.5835891", "0.5829902", "0.58279246", "0.5813476", "0.580866", "0.5790205", "0.5787003", "0.57764965", "0.5774524", "0.5774524", "0.5774524", "0.57721734", "0.5766502", "0.57646614", "0.57611877" ]
0.755543
2
Parse xml data and store the results
protected function parseXML($xml, $recursive = false, $cust = false) { if (!$recursive) { $array = simplexml_load_string($xml); } else { $array = $xml; } $newArray = array(); $array = (array) $array; foreach ($array as $key=>$value) { $value = (array) $value; if (isset($value[0])) { if (count($value) > 1) { $newArray[$key] = (array) $value; } else { $newArray[$key] = trim($value[0]); } } else { $newArray[$key] = $this->parseXML($value, true); } } return $newArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function parseXmlFile() {}", "protected function processData()\n {\n if (empty($this->data)) {\n throw new \\Netcreators\\NcgovPdc\\Xml\\Search\\SamenwerkendeCatalogi40\\ResponseParser\\Exception('Error: No XML data supplied.');\n }\n\n libxml_clear_errors();\n $this->xmlRoot = simplexml_load_string($this->data, '\\SimpleXmlElement', LIBXML_NOERROR);\n $lastError = libxml_get_last_error();\n if ($this->xmlRoot === false || $lastError !== false) {\n throw new \\Netcreators\\NcgovPdc\\Xml\\Search\\SamenwerkendeCatalogi40\\ResponseParser\\Exception('Xml parsing failed with message: ' . $lastError->code . ': ' . $lastError->message);\n }\n\n $this->xmlRoot->registerXPathNamespace('sru', 'http://www.loc.gov/zing/srw/'); // __ns\n $this->xmlRoot->registerXPathNameSpace('xsi', 'http://www.w3.org/2001/XMLSchema-instance');\n $this->xmlRoot->registerXPathNamespace('overheidsru', 'http://standaarden.overheid.nl/sru');\n $this->xmlRoot->registerXPathNamespace('dcterms', 'http://purl.org/dc/terms/');\n $this->xmlRoot->registerXPathNamespace('overheid', 'http://standaarden.overheid.nl/owms/terms/');\n $this->xmlRoot->registerXPathNamespace('overheidproduct', 'http://standaarden.overheid.nl/product/terms/');\n }", "function parse() {\n $this->xml_parser = xml_parser_create('UTF-8');\n xml_set_object($this->xml_parser,$this);\n\n ## convert all tags to upper\n xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, true);\n \n xml_set_element_handler($this->xml_parser,'startElement', 'endElement');\n xml_set_character_data_handler($this->xml_parser,'characterData');\n \n if(!($fp = @fopen($this->xml_file,\"r\"))) {\n die(\"could not open XML input\".$this->xml_file);\n }\n \n ## read the whole file and scan in the information\n while($data = fread($fp, 4096)) {\n if(!xml_parse($this->xml_parser,$data, feof($fp))) {\n die(sprintf(\"XML error: %s at line %d\", xml_error_string(xml_get_error_code($this->xml_parser)), xml_get_current_line_number($this->xml_parser)));\n }\n }\n fclose($fp);\n $this->destroy();\n }", "function amazon_xml_parsexml ( $xmlcontent )\n\t\t{\n\t\t\t$String = $xmlcontent;\n\t\t\t$Encoding = $this->amazon_xml_encoding( $String );\n\t\t\t$String = $this->amazon_xml_deleteelements( $String, \"?\" );\n\t\t\t$String = $this->amazon_xml_deleteelements( $String, \"!\" );\n\t\t\t$Data = $this->amazon_xml_readxml( $String, $Data, $Encoding );\n\t\t\treturn($Data);\n\t\t}", "function parse_xml($xml)\n\t{\n\t\t// PHP's XML array structures stink so make our own\n\t\tif ($this->parse_into_struct($xml) === FALSE)\n\t\t{\n\t\t\terror_log('Unable to parse XML data');\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$elements = array();\n\t\t\t$child = array();\n\t\t\tforeach ($this->tagdata as $item)\n\t\t\t{\n\t\t\t\t$current = count($elements);\n\n\t\t\t\tif ($item['type'] == 'open' OR $item['type'] == 'complete')\n\t\t\t\t{\n\t\t\t\t\t$elements[$current] = new XML_Cache;\n\t\t\t\t\t$elements[$current]->tag\t\t= $item['tag'];\n\t\t\t\t\t$elements[$current]->attributes\t= (array_key_exists('attributes', $item)) ? $item['attributes'] : '';\n\t\t\t\t\t$elements[$current]->value\t\t= (array_key_exists('value', $item)) ? $item['value'] : '';\n\n\t\t\t\t\t/** -------------------------------------\n\t\t\t\t\t/** Create a new child layer for 'open'\n\t\t\t\t\t/** -------------------------------------*/\n\t\t\t\t\tif ($item['type'] == \"open\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$elements[$current]->children = array();\n\t\t\t\t\t\t$child[count($child)] = &$elements;\n\t\t\t\t\t\t$elements = &$elements[$current]->children;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/** -------------------------------------\n\t\t\t\t/** Put child layer into root object\n\t\t\t\t/** -------------------------------------*/\n\n\t\t\t\telseif ($item['type'] == 'close')\n\t\t\t\t{\n\t\t\t\t\t$elements = &$child[count($child) - 1];\n\t\t\t\t\tunset($child[count($child) - 1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $elements[0];\n\t}", "function parseXml($xmlText) {\n if ($xmlText == '') {\n trace('Warning: Empty xml supplied!');\n }\n $this->navajoDoc = new DOMDocument('1.0', 'iso-8859-1');\n $this->navajoDoc->loadXML($xmlText);\n $nodelist = $this->navajoDoc->getElementsByTagName('tml');\n $this->tmlNode = $nodelist->item(0);\n #\tfor ($i = 0; $i < $nodelist->length; $i++) {\n #\t echo $nodelist->item($i)->nodeValue . \"\\n\";\n #\t}\n\n // TODO Fix this, not efficient\n $this->headerNode = $this->tmlNode->getElementsByTagName('header')->item(0);\n $this->transactionNode = $this->headerNode->getElementsByTagName('transaction')->item(0);\n # $this->dumpElement($this->headerNode);\n\n }", "function Parse()\n {\n //Create the parser resource\n $this->parser = xml_parser_create(\"UTF-8\");\n \n //Set the handlers\n xml_set_object($this->parser, $this);\n xml_set_element_handler($this->parser, 'StartElement', 'EndElement');\n xml_set_character_data_handler($this->parser, 'CharacterData');\n\n //Error handling\n if (!xml_parse($this->parser, $this->xml))\n $this->HandleError(xml_get_error_code($this->parser), xml_get_current_line_number($this->parser), xml_get_current_column_number($this->parser));\n\n //Free the parser\n xml_parser_free($this->parser);\n }", "abstract public function parse($xmlFile);", "function readXml($xmlResult)\n{\n //$data = implode(\"\", $xmlResult);\n \n $parser = xml_parser_create();\n xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);\n \n xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);\n xml_parse_into_struct($parser, $xmlResult, $values, $tags);\n \n if(!xml_parser_free($parser))\n die(\"Failed parsing\");\n \n // loop through the structures\n foreach ($tags as $key=>$val) {\n if ($key == \"result\") {\n $molranges = $val;\n // each contiguous pair of array entries are the\n // lower and upper range for each molecule definition\n for ($i=0; $i < count($molranges); $i+=2) {\n \n $offset = $molranges[$i] + 1;\n \n $len = $molranges[$i + 1] - $offset;\n \n $tdb[] = parseMol(array_slice($values, $offset, $len));\n \n }\n } else {\n continue;\n }\n }\n return $tdb;\n}", "function _parserResult($resultXML) {\r\n \t$statusMessage = substr($resultXML, strpos($resultXML, \"<statusMessage>\")+strlen(\"<statusMessage>\"), strpos($resultXML, \"</statusMessage>\")-strlen(\"<statusMessage>\")-strpos($resultXML, \"<statusMessage>\"));\r\n \t//print \"message = $statusMessage\";\r\n\t$cphandling = substr($resultXML, strpos($resultXML, \"<handling>\")+strlen(\"<handling>\"), strpos($resultXML, \"</handling>\")-strlen(\"<handling>\")-strpos($resultXML, \"<handling>\"));\r\n\t$this->handling_cp = $cphandling;\r\n \tif ($statusMessage == 'OK') {\r\n \t\t$strProduct = substr($resultXML, strpos($resultXML, \"<product id=\")+strlen(\"<product id=>\"), strpos($resultXML, \"</product>\")-strlen(\"<product id=>\")-strpos($resultXML, \"<product id=\"));\r\n \t\t$index = 0;\r\n \t\t$aryProducts = false;\r\n \t\twhile (strpos($resultXML, \"</product>\")) {\r\n\t\t\t$cpnumberofboxes = substr_count($resultXML, \"<expediterWeight\");\r\n\t\t\t$this->boxCount = $cpnumberofboxes;\r\n \t\t\t$name = substr($resultXML, strpos($resultXML, \"<name>\")+strlen(\"<name>\"), strpos($resultXML, \"</name>\")-strlen(\"<name>\")-strpos($resultXML, \"<name>\"));\r\n \t\t\t$rate = substr($resultXML, strpos($resultXML, \"<rate>\")+strlen(\"<rate>\"), strpos($resultXML, \"</rate>\")-strlen(\"<rate>\")-strpos($resultXML, \"<rate>\"));\r\n \t\t\t$shippingDate = substr($resultXML, strpos($resultXML, \"<shippingDate>\")+strlen(\"<shippingDate>\"), strpos($resultXML, \"</shippingDate>\")-strlen(\"<shippingDate>\")-strpos($resultXML, \"<shippingDate>\"));\r\n \t\t\t$deliveryDate = substr($resultXML, strpos($resultXML, \"<deliveryDate>\")+strlen(\"<deliveryDate>\"), strpos($resultXML, \"</deliveryDate>\")-strlen(\"<deliveryDate>\")-strpos($resultXML, \"<deliveryDate>\"));\r\n \t\t\t$deliveryDayOfWeek = substr($resultXML, strpos($resultXML, \"<deliveryDayOfWeek>\")+strlen(\"<deliveryDayOfWeek>\"), strpos($resultXML, \"</deliveryDayOfWeek>\")-strlen(\"<deliveryDayOfWeek>\")-strpos($resultXML, \"<deliveryDayOfWeek>\"));\r\n \t\t\t$nextDayAM = substr($resultXML, strpos($resultXML, \"<nextDayAM>\")+strlen(\"<nextDayAM>\"), strpos($resultXML, \"</nextDayAM>\")-strlen(\"<nextDayAM>\")-strpos($resultXML, \"<nextDayAM>\"));\r\n \t\t\t$packingID = substr($resultXML, strpos($resultXML, \"<packingID>\")+strlen(\"<packingID>\"), strpos($resultXML, \"</packingID>\")-strlen(\"<packingID>\")-strpos($resultXML, \"<packingID>\"));\r\n \t\t\t$aryProducts[$index] = array( $name . ', ' . $deliveryDate => $rate);\r\n \t\t\t$index++;\r\n \t\t\t$resultXML = substr($resultXML, strpos($resultXML, \"</product>\") + strlen(\"</product>\"));\r\n \t\t}\r\n \t\treturn $aryProducts;\r\n \t} else {\r\n \t\tif (strpos($resultXML, \"<error>\")) return $statusMessage;\r\n \t\telse return false;\r\n \t}\r\n }", "abstract protected function buildData(DOMDocument $xml);", "function process(){\n\t\t\treturn $this->xml->dumpmem();\n\t\t}", "function parseXML() {\n \n $xml_parser = xml_parser_create($this->encoding);\n xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 1);\n\n xml_set_object($xml_parser, $this);\n xml_set_element_handler($xml_parser, 'startElement', 'endElement');\n xml_set_character_data_handler($xml_parser, 'cDataHandler');\n\n xml_set_external_entity_ref_handler($xml_parser, 'externalEntityRefHandler');\n xml_set_processing_instruction_handler($xml_parser, 'piHandler');\n xml_set_unparsed_entity_decl_handler($xml_parser, 'unparsedEntityDeclHandler');\n xml_set_notation_decl_handler($xml_parser, 'entityDeclHandler');\n xml_set_default_handler($xml_parser, 'defaultHandler');\n \n if (!xml_parse($xml_parser, $this->contentBuffer, true)) {\n ($this->currentFile != '') ? $inFile = \"in file $this->currentFile\" : $inFile = '';\n if ($GLOBALS['SM_develState']) {\n echo \"XML dump: \\n\".$this->contentBuffer;\n }\n $this->fatalErrorPage(sprintf(get_class($this).\": XML error: %s at line %d $inFile\",\n xml_error_string(xml_get_error_code($xml_parser)),\n xml_get_current_line_number($xml_parser)));\n }\n\n xml_parser_free($xml_parser);\n\n }", "protected function parseXml($xml)\n {\n if (! $xml) {\n return false;\n }\n if (isset($xml->ShipmentEventList)) {\n foreach ($xml->ShipmentEventList->children() as $x) {\n $this->list['Shipment'][] = $this->parseShipmentEvent($x);\n }\n }\n if (isset($xml->RefundEventList)) {\n foreach ($xml->RefundEventList->children() as $x) {\n $this->list['Refund'][] = $this->parseShipmentEvent($x);\n }\n }\n if (isset($xml->GuaranteeClaimEventList)) {\n foreach ($xml->GuaranteeClaimEventList->children() as $x) {\n $this->list['GuaranteeClaim'][] = $this->parseShipmentEvent($x);\n }\n }\n if (isset($xml->ChargebackEventList)) {\n foreach ($xml->ChargebackEventList->children() as $x) {\n $this->list['Chargeback'][] = $this->parseShipmentEvent($x);\n }\n }\n if (isset($xml->PayWithAmazonEventList)) {\n foreach ($xml->PayWithAmazonEventList->children() as $x) {\n $temp = [];\n $temp['SellerOrderId'] = (string) $x->SellerOrderId;\n $temp['TransactionPostedDate'] = (string) $x->TransactionPostedDate;\n $temp['BusinessObjectType'] = (string) $x->BusinessObjectType;\n $temp['SalesChannel'] = (string) $x->SalesChannel;\n $temp['Charge'] = $this->parseCharge($x->Charge);\n if (isset($x->FeeList)) {\n foreach ($x->FeeList->children() as $z) {\n $temp['FeeList'][] = $this->parseFee($z);\n }\n }\n $temp['PaymentAmountType'] = (string) $x->PaymentAmountType;\n $temp['AmountDescription'] = (string) $x->AmountDescription;\n $temp['FulfillmentChannel'] = (string) $x->FulfillmentChannel;\n $temp['StoreName'] = (string) $x->StoreName;\n $this->list['PayWithAmazon'][] = $temp;\n }\n }\n if (isset($xml->ServiceProviderCreditEventList)) {\n foreach ($xml->ServiceProviderCreditEventList->children() as $x) {\n $temp = [];\n $temp['ProviderTransactionType'] = (string) $x->ProviderTransactionType;\n $temp['SellerOrderId'] = (string) $x->SellerOrderId;\n $temp['MarketplaceId'] = (string) $x->MarketplaceId;\n $temp['MarketplaceCountryCode'] = (string) $x->MarketplaceCountryCode;\n $temp['SellerId'] = (string) $x->SellerId;\n $temp['SellerStoreName'] = (string) $x->SellerStoreName;\n $temp['ProviderId'] = (string) $x->ProviderId;\n $temp['ProviderStoreName'] = (string) $x->ProviderStoreName;\n $this->list['ServiceProviderCredit'][] = $temp;\n }\n }\n if (isset($xml->RetrochargeEventList)) {\n foreach ($xml->RetrochargeEventList->children() as $x) {\n $temp = [];\n $temp['RetrochargeEventType'] = (string) $x->RetrochargeEventType;\n $temp['AmazonOrderId'] = (string) $x->AmazonOrderId;\n $temp['PostedDate'] = (string) $x->PostedDate;\n $temp['BaseTax']['Amount'] = (string) $x->BaseTax->CurrencyAmount;\n $temp['BaseTax']['CurrencyCode'] = (string) $x->BaseTax->CurrencyCode;\n $temp['ShippingTax']['Amount'] = (string) $x->ShippingTax->CurrencyAmount;\n $temp['ShippingTax']['CurrencyCode'] = (string) $x->ShippingTax->CurrencyCode;\n $temp['MarketplaceName'] = (string) $x->MarketplaceName;\n $this->list['Retrocharge'][] = $temp;\n }\n }\n if (isset($xml->RentalTransactionEventList)) {\n foreach ($xml->RentalTransactionEventList->children() as $x) {\n $temp = [];\n $temp['AmazonOrderId'] = (string) $x->AmazonOrderId;\n $temp['RentalEventType'] = (string) $x->RentalEventType;\n $temp['ExtensionLength'] = (string) $x->ExtensionLength;\n $temp['PostedDate'] = (string) $x->PostedDate;\n if (isset($x->RentalChargeList)) {\n foreach ($x->RentalChargeList->children() as $z) {\n $temp['RentalChargeList'][] = $this->parseCharge($z);\n }\n }\n if (isset($x->RentalFeeList)) {\n foreach ($x->RentalFeeList->children() as $z) {\n $temp['RentalFeeList'][] = $this->parseFee($z);\n }\n }\n $temp['MarketplaceName'] = (string) $x->MarketplaceName;\n if (isset($x->RentalInitialValue)) {\n $temp['RentalInitialValue']['Amount'] = (string) $x->RentalInitialValue->CurrencyAmount;\n $temp['RentalInitialValue']['CurrencyCode'] = (string) $x->RentalInitialValue->CurrencyCode;\n }\n if (isset($x->RentalReimbursement)) {\n $temp['RentalReimbursement']['Amount'] = (string) $x->RentalReimbursement->CurrencyAmount;\n $temp['RentalReimbursement']['CurrencyCode'] = (string) $x->RentalReimbursement->CurrencyCode;\n }\n $this->list['RentalTransaction'][] = $temp;\n }\n }\n if (isset($xml->PerformanceBondRefundEventList)) {\n foreach ($xml->PerformanceBondRefundEventList->children() as $x) {\n $temp = [];\n $temp['MarketplaceCountryCode'] = (string) $x->MarketplaceCountryCode;\n $temp['Amount'] = (string) $x->Amount->CurrencyAmount;\n $temp['CurrencyCode'] = (string) $x->Amount->CurrencyCode;\n if (isset($x->ProductGroupList)) {\n foreach ($x->ProductGroupList->children() as $z) {\n $temp['ProductGroupList'][] = (string) $z;\n }\n }\n $this->list['PerformanceBondRefund'][] = $temp;\n }\n }\n if (isset($xml->ServiceFeeEventList)) {\n foreach ($xml->ServiceFeeEventList->children() as $x) {\n $temp = [];\n $temp['AmazonOrderId'] = (string) $x->AmazonOrderId;\n $temp['FeeReason'] = (string) $x->FeeReason;\n if (isset($x->FeeList)) {\n foreach ($x->FeeList->children() as $z) {\n $temp['FeeList'][] = $this->parseFee($z);\n }\n }\n $temp['SellerSKU'] = (string) $x->SellerSKU;\n $temp['FnSKU'] = (string) $x->FnSKU;\n $temp['FeeDescription'] = (string) $x->FeeDescription;\n $temp['ASIN'] = (string) $x->ASIN;\n $this->list['ServiceFee'][] = $temp;\n }\n }\n if (isset($xml->DebtRecoveryEventList)) {\n foreach ($xml->DebtRecoveryEventList->children() as $x) {\n $temp = [];\n $temp['DebtRecoveryType'] = (string) $x->DebtRecoveryType;\n $temp['RecoveryAmount']['Amount'] = (string) $x->RecoveryAmount->CurrencyAmount;\n $temp['RecoveryAmount']['CurrencyCode'] = (string) $x->RecoveryAmount->CurrencyCode;\n $temp['OverPaymentCredit']['Amount'] = (string) $x->OverPaymentCredit->CurrencyAmount;\n $temp['OverPaymentCredit']['CurrencyCode'] = (string) $x->OverPaymentCredit->CurrencyCode;\n if (isset($x->DebtRecoveryItemList)) {\n foreach ($x->DebtRecoveryItemList->children() as $z) {\n $ztemp = [];\n $ztemp['RecoveryAmount']['Amount'] = (string) $z->RecoveryAmount->CurrencyAmount;\n $ztemp['RecoveryAmount']['CurrencyCode'] = (string) $z->RecoveryAmount->CurrencyCode;\n $ztemp['OriginalAmount']['Amount'] = (string) $z->OriginalAmount->CurrencyAmount;\n $ztemp['OriginalAmount']['CurrencyCode'] = (string) $z->OriginalAmount->CurrencyCode;\n $ztemp['GroupBeginDate'] = (string) $z->GroupBeginDate;\n $ztemp['GroupEndDate'] = (string) $z->GroupEndDate;\n $temp['DebtRecoveryItemList'][] = $ztemp;\n }\n }\n if (isset($x->ChargeInstrumentList)) {\n foreach ($x->ChargeInstrumentList->children() as $z) {\n $ztemp = [];\n $ztemp['Description'] = (string) $z->Description;\n $ztemp['Tail'] = (string) $z->Tail;\n $ztemp['Amount'] = (string) $z->Amount->CurrencyAmount;\n $ztemp['CurrencyCode'] = (string) $z->Amount->CurrencyCode;\n $temp['ChargeInstrumentList'][] = $ztemp;\n }\n }\n $this->list['DebtRecovery'][] = $temp;\n }\n }\n if (isset($xml->LoanServicingEventList)) {\n foreach ($xml->LoanServicingEventList->children() as $x) {\n $temp = [];\n $temp['Amount'] = (string) $x->LoanAmount->CurrencyAmount;\n $temp['CurrencyCode'] = (string) $x->LoanAmount->CurrencyCode;\n $temp['SourceBusinessEventType'] = (string) $x->SourceBusinessEventType;\n $this->list['LoanServicing'][] = $temp;\n }\n }\n if (isset($xml->AdjustmentEventList)) {\n foreach ($xml->AdjustmentEventList->children() as $x) {\n $temp = [];\n $temp['AdjustmentType'] = (string) $x->AdjustmentType;\n $temp['Amount'] = (string) $x->AdjustmentAmount->CurrencyAmount;\n $temp['CurrencyCode'] = (string) $x->AdjustmentAmount->CurrencyCode;\n if (isset($x->AdjustmentItemList)) {\n foreach ($x->AdjustmentItemList->children() as $z) {\n $ztemp = [];\n $ztemp['Quantity'] = (string) $z->Quantity;\n $ztemp['PerUnitAmount']['Amount'] = (string) $z->PerUnitAmount->CurrencyAmount;\n $ztemp['PerUnitAmount']['CurrencyCode'] = (string) $z->PerUnitAmount->CurrencyCode;\n $ztemp['TotalAmount']['Amount'] = (string) $z->TotalAmount->CurrencyAmount;\n $ztemp['TotalAmount']['CurrencyCode'] = (string) $z->TotalAmount->CurrencyCode;\n $ztemp['SellerSKU'] = (string) $z->SellerSKU;\n $ztemp['FnSKU'] = (string) $z->FnSKU;\n $ztemp['ProductDescription'] = (string) $z->ProductDescription;\n $ztemp['ASIN'] = (string) $z->ASIN;\n $temp['AdjustmentItemList'][] = $ztemp;\n }\n }\n $this->list['Adjustment'][] = $temp;\n }\n }\n if (isset($xml->SAFETReimbursementEventList)) {\n foreach ($xml->SAFETReimbursementEventList->children() as $x) {\n $temp = [];\n $temp['PostedDate'] = (string) $x->PostedDate;\n $temp['SAFETClaimId'] = (string) $x->SAFETClaimId;\n $temp['Amount'] = (string) $x->ReimbursedAmount->CurrencyAmount;\n $temp['CurrencyCode'] = (string) $x->ReimbursedAmount->CurrencyCode;\n $temp['SAFETReimbursementItemList'] = [];\n if (isset($x->SAFETReimbursementItemList)) {\n foreach ($x->SAFETReimbursementItemList->children() as $y) {\n if (! isset($y->ItemChargeList)) {\n continue;\n }\n $ztemp = [];\n foreach ($y->ItemChargeList->children() as $z) {\n $ztemp['ItemChargeList'][] = $this->parseCharge($z);\n }\n $temp['SAFETReimbursementItemList'][] = $ztemp;\n }\n }\n $this->list['SAFET'][] = $temp;\n }\n }\n }", "private function _parseXml()\n {\n $temp = @simplexml_load_string( $this->input, \"SimpleXMLElement\", LIBXML_NOCDATA );\n $json = @json_encode( $temp );\n $data = @json_decode( $json, true );\n\n if( is_array( $data ) )\n {\n $_REQUEST = array_merge( $_GET, $this->_data( $data ) );\n return true;\n }\n return false;\n }", "function parseXML() {\r\n\t\t$xmlString = getFileStr();\r\n\r\n\t\tif (!strstr($xmlString, \"<?xml version='1.0' ?>\")) {\r\n\t\t\tparseBin();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$xmlParser = xml_parser_create();\r\n\t\txml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, FALSE);\r\n\t\txml_set_element_handler($xmlParser, \"startElement\", \"endElement\");\r\n\r\n\t\txml_parse($xmlParser, $xmlString);\r\n\t\txml_parser_free($xmlParser);\r\n\r\n\t\txmlToObj();\r\n\t}", "public function initVarfromXml() {\n if ((array) $this->xml_data) {\n foreach ($this->xml_data->xpath('//page_group') as $item) {\n foreach ($item->children() as $child) {\n $seq = 0;\n if (!empty($child['seq'])) {\n $seq = (string) $child['seq'];\n }\n if ($seq < 99) {\n\n if ($child['type'] == 'IE') {\n foreach ($child->xpath('input') as $value) {\n $tp = 0;\n if (empty($value->value)) {\n $datav = (string) $value->default;\n } else {\n $datav = (string) $value->value;\n }\n if (strtolower($value->type) == 'number')\n $tp = 1;\n if (empty($this->sccpvalues[(string) $value->name])) {\n $this->sccpvalues[(string) $value->name] = array('keyword' => (string) $value->name, 'data' => $datav, 'type' => $tp, 'seq' => $seq);\n// $this->sccpvalues[] = array('keyword' => (string)$value->name, 'data' =>(string)$value->default, 'type'=> '0');\n }\n }\n }\n if ($child['type'] == 'IS' || $child['type'] == 'IED') {\n if (empty($child->value)) {\n $datav = (string) $child->default;\n } else {\n $datav = (string) $child->value;\n }\n if (empty($this->sccpvalues[(string) $child->name])) {\n $this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq);\n// $this->sccpvalues[] = array('keyword' => (string)$child->name, 'data' =>(string)$child-> default,'type'=>'0');\n }\n }\n if ($child['type'] == 'SLD' || $child['type'] == 'SLS' || $child['type'] == 'SLT' || $child['type'] == 'SL' || $child['type'] == 'SLM' || $child['type'] == 'SLZ' || $child['type'] == 'SLZN' || $child['type'] == 'SLA') {\n if (empty($child->value)) {\n $datav = (string) $child->default;\n } else {\n $datav = (string) $child->value;\n }\n if (empty($this->sccpvalues[(string) $child->name])) {\n $this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq);\n }\n }\n }\n }\n }\n }\n }", "function ParseXmlData($xmlData) {\n\tif (strpos($xmlData, \"<?xml\")===false) {\n\t\t$xmlStatus='500';\n\t\t$xmlInfo=$xmlData;\n\t\treturn;\n\t}\n\t$xml_parser = xml_parser_create(\"\");\n\txml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false);\n\txml_set_element_handler($xml_parser, \"start_xml_tag\", \"end_xml_tag\");\n\txml_set_character_data_handler($xml_parser, \"parse_xml\");\n\txml_parse($xml_parser, $xmlData, true);\n\txml_parser_free($xml_parser);\n}", "function getXMLData()\n{\n\t$xml=simplexml_load_file(\"/var/www/VDF.xml\") or die(\"Error: Cannot create object\");\n\t$n = $xml->data_cloud[0]->datatocloud->count();\n\t$data = $xml->data_cloud[0];\n\t$data_array = array();\n\t$variable_array = array(\"type\",\"ext\",\"meteringID\",\"time_interval\",\"unit\",\"factor\",\"timestamp\");\n\t$data_split_array = array();\n\n\n\tfor ($i=0;$i<$n;$i++){\n\t\t$string = $data->datatocloud[$i];\n\t\t$string_parts = explode(\":\", $string);\n\t\t$sn = 7;\n\t\tfor ($s=0;$s<$sn;$s++){\n\t\t\tif($s<6){\n\t\t\t\t$data_split_array[$variable_array[$s]] = trim($string_parts[$s]);\n\t\t\t} else {\n\t\t\t\t//set inital timestamp\n\t\t\t\t$date = new DateTime();\n\t\t\t\t//$_SERVER['REQUEST_TIME'];\n\t\t\t\t$timestamp = $date->getTimestamp();\n\t\t\t\t$data_split_array[$variable_array[$s]] = $timestamp;\n\t\t\t}\n\t\t}\n\n\t\t$data_array[$i] = $data_split_array;\n\t\tunset($data_split_array);\n\t}\n\n\treturn $data_array;\t\n}", "function parseXMLResult($doc, &$result) {\n\tglobal $gbRepeatView;\n\n\t$result = array();\n\t$median = $doc->getElementsByTagName('median')->item(0); // This is the block of info representing ALL the data of the \"median\" run.\n\tif ( ! $median ) {\n\t\treturn;\n\t}\n\t$pageview = $median->getElementsByTagName( $gbRepeatView ? 'repeatView' : 'firstView' )->item(0); // change this to 'repeatView' for primed cache\n\tif ( ! $pageview ) {\n\t\treturn;\n\t}\n\n\t$result['medianRun'] = (int)$pageview->getElementsByTagName('run')->item(0)->nodeValue;\n}", "public function parseXml()\n {\n libxml_use_internal_errors(true);\n\n if ($this->getMimeType() == 'application/xml') {\n $elem = simplexml_load_string($this->contents);\n if ($elem !== false) {\n return $elem;\n } else {\n return libxml_get_errors();\n }\n }\n\n return false;\n }", "function process() {\n\t\tif ( is_object($this->_Xml) ) {\n\t\t\t$procCount = 0;\n\t\t\t$oldSource = systemLog::getInstance()->getSource();\n\t\t\t\n\t\t\t/*\n\t\t\t * get top level of devices tree\n\t\t\t */\n\t\t\tforeach ( $this->_Xml as $rootElement => $rootData ) {\n\t\t\t\t/*\n\t\t\t\t * Parse the devices\n\t\t\t\t */\n\t\t\t\tif ( $rootElement == 'devices' ) {\n\t\t\t\t\t$deviceCnt = count($rootData);\n\t\t\t\t\tfor ( $i=0; $i<$deviceCnt; $i++ ) {\n\t\t\t\t\t\t$tag = $rootData->device[$i];\n\t\t\t\t\t\t$wurfl_id\t\t= trim((string) $tag['id']);\n\t\t\t\t\t\t$user_agent\t\t= trim((string) $tag['user_agent']);\n\t\t\t\t\t\t$device_root\t= $this->convertVarType(trim($tag['actual_device_root']));\n\t\t\t\t\t\t$fall_back\t\t= trim((string) $tag['fall_back']);\n\t\t\t\t\t\tsystemLog::getInstance()->setSource('import]['.$wurfl_id);\n\t\t\t\t\t\tsystemLog::message(\"Importing data for $wurfl_id\");\n\t\t\t\t\t\tif ( $wurfl_id == 'generic' ) {\n\t\t\t\t\t\t\t$user_agent = 'generic';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Check userAgent and see if we have a modelID already\n\t\t\t\t\t\t */\n\t\t\t\t\t\tsystemLog::notice(\"Searching for existing device with ID: $wurfl_id\");\n\t\t\t\t\t\t$oDevice = wurflManager::getInstanceByWurflID($wurfl_id);\n\t\t\t\t\t\tif ( $oDevice->getDeviceID() ) {\n\t\t\t\t\t\t\tsystemLog::notice(\"Found existing device for ID: {$oDevice->getDeviceID()}\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$oDevice->setCreateDate(date(system::getConfig()->getDatabaseDatetimeFormat()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$oDevice->setUserAgent($user_agent);\n\t\t\t\t\t\t$oDevice->setWurflID($wurfl_id);\n\t\t\t\t\t\t$oDevice->setFallBackID($fall_back);\n\t\t\t\t\t\t$oDevice->setRootDevice($device_root);\n\t\t\t\t\t\t$oDevice->setUpdateDate(date(system::getConfig()->getDatabaseDatetimeFormat()));\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Get the groups and build capabilities array\n\t\t\t\t\t\t */\n\t\t\t\t\t\tsystemLog::notice('Processing capabilities');\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor ( $j=0; $j<count($tag); $j++ ) {\n\t\t\t\t\t\t\t$group = $tag->group[$j];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * @var deviceCapabilityGroup\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t$oGroup = wurflCapabilityGroup::getInstance((string) $group['id']);\n\t\t\t\t\t\t\t$oGroup->setDescription((string) $group['id']);\n\t\t\t\t\t\t\t$oGroup->setDisplayName(ucwords(str_replace('_', ' ', $oGroup->getDescription())));\n\t\t\t\t\t\t\t$oGroup->save();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor ( $k=0; $k<count($group); $k++ ) {\n\t\t\t\t\t\t\t\t$capability = $group->capability[$k];\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t * Get our capabilities, store them if not already in the DB, and assign to model\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * @var deviceCapability\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t$oCapability = new wurflCapability();\n\t\t\t\t\t\t\t\t$oCapability->setCapabilityGroupID($oGroup->getCapabilityGroupID());\n\t\t\t\t\t\t\t\t$oCapability->setDescription(trim((string) $capability['name']));\n\t\t\t\t\t\t\t\tif ( !$oCapability->load() ) {\n\t\t\t\t\t\t\t\t\t$oCapability->setCapabilityGroupID($oGroup->getCapabilityGroupID());\n\t\t\t\t\t\t\t\t\t$oCapability->setDescription(trim((string) $capability['name']));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$oCapability->save();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t * Add capability and value to mapper\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tsystemLog::info(\"Adding capability to device {$oCapability->getDescription()}(\".$this->convertVarType(trim($capability['value'])).\")\");\n\t\t\t\t\t\t\t\tif ( $this->_TreatAsCustomData === true ) {\n\t\t\t\t\t\t\t\t\t$oDevice->getCapabilities()->setCustomCapability($oCapability->getDescription(), $this->convertVarType(trim($capability['value'])));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$oDevice->getCapabilities()->setCapability($oCapability->getDescription(), $this->convertVarType(trim($capability['value'])));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t * For brand_name and model_name, parse out and add references / update records\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tif ( $oCapability->getDescription() == 'brand_name' && strlen($this->convertVarType(trim($capability['value']))) > 1 ) {\n\t\t\t\t\t\t\t\t\t$oManfacturer = wurflManufacturer::getInstance($this->convertVarType(trim($capability['value'])));\n\t\t\t\t\t\t\t\t\t$oManfacturer->setDescription($this->convertVarType(trim($capability['value'])));\n\t\t\t\t\t\t\t\t\t$oManfacturer->save();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ( $oManfacturer->getManufacturerID() ) {\n\t\t\t\t\t\t\t\t\t\t$oDevice->setManufacturerID($oManfacturer->getManufacturerID());\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\tif ( $oCapability->getDescription() == 'model_name' ) {\n\t\t\t\t\t\t\t\t\t$oDevice->setModelName($this->convertVarType(trim($capability['value'])));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} // end foreach group;\n\t\t\t\t\t\t} // end foreach tag\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$oDevice->save();\n\t\t\t\t\t\t$procCount++;\n\t\t\t\t\t\tunset($oDevice);\n\t\t\t\t\t\tsystemLog::notice(\"Finished processing device\\n---------------------------------------------------------------------\");\n\t\t\t\t\t} // end foreach rootData;\n\t\t\t\t} // end if == devices;\n\t\t\t} // end foreach rootElement;\n\t\t\tsystemLog::getInstance()->setSource($oldSource);\n\t\t\t$this->setProcessCount($procCount);\n\t\t} else {\n\t\t\tsystemLog::error(\"Error! Internal SimpleXML object not ready for parsing!\");\n\t\t}\n\t}", "public function parse($xml)\n {\n // return (isset($data['elements'])) ? $data['elements'] : throw new Exception('elements key not found');\n }", "public function parseXml($data = '') {\n\n if ($data == '' || !$data) {\n return [];\n }\n // Read string using SimpleXMLElement.\n $xml_data = new \\SimpleXMLElement($data);\n\n return $xml_data;\n }", "private function readResult()\n {\n $xr = $this->xmlReader;\n \n $lastKey = NULL;\n $lastValues = array();\n $insideValue = FALSE;\n \n $result = array();\n while ($xr->read())\n {\n // Begin: /result/field\n if ($xr->nodeType == XMLReader::ELEMENT &&\n $xr->name === 'field')\n {\n $lastKey = $xr->getAttribute('k');\n $lastValues = array();\n }\n \n // Begin: /result/field/value\n // Begin: /result/field/v\n if ($xr->nodeType == XMLReader::ELEMENT &&\n ($xr->name === 'value' || $xr->name === 'v'))\n {\n $insideValue = TRUE;\n }\n \n // Read: /result/field/value/text/[TEXT]\n // Read: /result/field/v/[TEXT]\n if ($insideValue &&\n $xr->nodeType == XMLReader::TEXT)\n {\n $lastValues[] = $xr->value;\n }\n \n // End: /result/field/value\n // End: /result/field/v\n if ($xr->nodeType == XMLReader::END_ELEMENT &&\n ($xr->name === 'value' || $xr->name === 'v'))\n {\n $insideValue = FALSE;\n }\n \n // End: /result/field\n if ($xr->nodeType == XMLReader::END_ELEMENT &&\n $xr->name === 'field')\n {\n if (count($lastValues) === 1)\n {\n $lastValues = $lastValues[0];\n }\n $result[$lastKey] = $lastValues;\n }\n \n // End: /result\n if ($xr->nodeType == XMLReader::END_ELEMENT &&\n $xr->name === 'result')\n {\n break;\n }\n }\n return $result;\n }", "public function parseXML($xml)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->dom_doc = new DOMDocument();\n\t\t\t$this->dom_doc->loadXML($xml);\n\t\t\t$this->xpath = new DOMXPath($this->dom_doc);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tthrow new TSS_Tribal_TransportException($e->getMessage(), 0);\n\t\t}\n\n\t\t//return !$this->searchForError();\n\t}", "protected function parseXML($xml)\n {\n if (! $xml) {\n return false;\n }\n\n foreach ($xml->children() as $key => $x) {\n $i = $this->index;\n if ($key == 'Count') {\n $this->count = (string) $x;\n $this->log(\"Successfully canceled $this->count report requests.\");\n }\n if ($key != 'ReportRequestInfo') {\n continue;\n }\n\n $this->reportList[$i]['ReportRequestId'] = (string) $x->ReportRequestId;\n $this->reportList[$i]['ReportType'] = (string) $x->ReportType;\n $this->reportList[$i]['StartDate'] = (string) $x->StartDate;\n $this->reportList[$i]['EndDate'] = (string) $x->EndDate;\n $this->reportList[$i]['Scheduled'] = (string) $x->Scheduled;\n $this->reportList[$i]['SubmittedDate'] = (string) $x->SubmittedDate;\n $this->reportList[$i]['ReportProcessingStatus'] = (string) $x->ReportProcessingStatus;\n $this->reportList[$i]['GeneratedReportId'] = (string) $x->GeneratedReportId;\n $this->reportList[$i]['StartedProcessingDate'] = (string) $x->StartedProcessingDate;\n $this->reportList[$i]['CompletedProcessingDate'] = (string) $x->CompletedProcessingDate;\n\n $this->index++;\n }\n }", "private function parse ( ) {\n\t\t\t$this->parse_csv();\n\t\t\t\n\t\t\t// parse out the daily html\n\t\t\t$this->parse_html();\n\t\t\t\n\t\t}", "private function readXMLQuery($data)\n\t{\n\t\t$result=array();\n\t\tif(is_array($data))\n\t\t{\n\t\t\tif(false!==($data=@simplexml_load_string($data['body'])))\n\t\t\t{\n\t\t\t\tif($data->destinationProtocol){\n\t\t\t\t\t$result['protocol']=$data->destinationProtocol;\n\t\t\t\t\tforeach($data->userData as $k=>$v)\n\t\t\t\t\t{\n\t\t\t\t\t\tprint_rbr($v);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$result=API_QUERY_WRONG;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->setError(\"Reading error: \".$data.\"; wrong xml-declaration;\");\n\t\t\t\t$result=API_QUERY_ERROR;\n\t\t\t}\n\t\t}else{\n\t\t\t$this->setError(\"Reading error: \".$data.\"; wrong xml-declaration;\");\n\t\t\t$result=API_WRONG_PARAMS;\n\t\t}\n\t}", "protected function parseResponse()\n {\n $data = simplexml_load_string($this->body);\n \n $this->data = $data;\n }", "public function parseDataFromXML(&$xml, $templateCheck=1) {\n\n Debug::printMsg('<li><i>'.$this->className.'</i> (parsing from XML)</li><ul style=\"margin-left:2em\">');\n\n // xml backup\n $this->logXML = new DomDocument(\"1.0\", \"UTF-8\");\n $this->logXML->appendChild ($this->logXML->createElement($this->className));\n $this->logXMLData = $this->logXML->createElement(\"data\");\n $this->logXMLLinks = $this->logXML->createElement(\"links\");\n $this->logXML->firstChild->appendChild($this->logXMLData);\n $this->logXML->firstChild->appendChild($this->logXMLLinks);\n\n $this->path = XML::pathToClass($this->className, array());\n $this->template = Template::getInputTemplate($this);\n $this->xmlId = $xmlId;\n $this->data = array();\n\n foreach ($xml->childNodes as $link) {\n \n Debug::printMsg('<li><span style=\"background-color:gray; color:white\">LINK: '.$link->tagName.'</span>');\n\n foreach($link->childNodes as $child) {\n\n // skip text nodes\n if($child->nodeType == 3)\n continue;\n \n $linkId = XML::getPropertyID($link->tagName);\n $linkFull = $linkId[\"id\"].$linkId[\"dir\"].\".\".$linkId[\"title\"];\n // if($this->className == \"Place\" && $linkId == \"P89B\")\n // throw new Exception('Parts must be added to whole!');\n $node = DataNode::factory($child);\n $node->linkId = $linkId;\n $node->indexWords = $this->indexWords;\n\n // check link validity\n Template::checkLinkRange($this, $linkFull, $node);\n\n // check for conversion id (for imports)\n if($child->hasAttribute(\"map_id\")) {\n if ($child->getAttribute(\"map_id\") != \"0\") {\n $rec_id = IdaDb::getIdByMapId($child->getAttribute(\"map_id\"));\n $node->id = $rec_id;\n $this->data[] = $node;\n } else\n throw new Exception('Invalid map_id!');\n\n } else if($child->hasAttribute(\"id\")) {\n if (ctype_digit($child->getAttribute(\"id\")) && $child->getAttribute(\"id\") != \"0\") {\n $node->id = $child->getAttribute(\"id\");\n $this->append($node);\n } else\n throw new Exception('Invalid id!');\n\n } else {\n\n // if node is not an event, try to find ID (table gives empty array)\n if ($node->unique)\n $matches = $node->searchByXML($child);\n else\n $matches = 0;\n\n // if we did not found any matches, then create a record\n if(empty($matches)) {\n\n // load and check data from xml\n $node->parseDataFromXML($child, $templateCheck);\n $this->append($node);\n\n // else if we found just 1 match then we can link to it\n } else if(count($matches) == 1) {\n\n $node->id = $matches[0];\n $this->data[] = $node;\n Debug::printMsg('<li><span style=\"color:green\">found ID! ('.$node->id.')</span> </li>');\n\n // if we have multiple matches then stop the show\n } else {\n throw new Exception('Can not link! Multiple matches found!');\n }\n }\n\n }\n Debug::printMsg('</li>');\n }\n\n\n\n // check if required values are still missing\n /*\n $templateCheck = 0;\n if($templateCheck) {\n Debug::printPara(\"Checking missing things against template:\");\n foreach($this->template as $temp) {\n if($temp[\"required\"]) {\n if($temp[\"target_type\"] == \"type\") {\n Debug::printMsg('<span style=\"color:red\">MISSING '.$temp[\"property_title\"].$this->G->typeNames[$temp[\"target\"]][\"title\"].'!</span>'); \n $this->errors[] = 'required value missing: '.$temp[\"property_title\"].\": \".$this->G->typeNames[$temp[\"target\"]][\"title\"]; \n\n }else if($temp[\"target_type\"] == \"table\") {\n \n $this->errors[] = 'required value missing: '.$temp[\"property_title\"];\n\n } else {\n Debug::printMsg('<span style=\"color:red\">MISSING '.$this->G->classNames[$temp[\"target\"]][\"title\"].'!</span>');\n $this->errors[] = 'required value missing: '.$temp[\"property_title\"].\": \".$temp[\"target_table\"].$this->G->classNames[$temp[\"target\"]][\"title\"];\n }\n }\n }\n }\n */\n\n\n\n if(DEBUG) {\n echo '<li><span style=\"background-color:green; color:white\">Done Parsing of object:</span>'.$this->className;\n echo '<br>Found '.count($this->errors, COUNT_RECURSIVE).' errors</li></ul>';\n echo '<pre>';\n print_r($this->errors);\n echo '</pre>';\n }\n\n}", "function xml_to_array()\r\n {\r\n $output=array();\r\n \r\n foreach($this->xpath_map as $key=>$value)\r\n {\r\n $output[$key]=$value['data'];\r\n }\r\n \r\n return $output;\r\n }", "function parse ( $src, $typeof = 'FILE', $encoding = 'UTF-8' ) {\n\n\t\t// ini;\n\t\t// (re)set array;\n\t\t$this->pOut = array();\n\t\t$this->parser = xml_parser_create();\n\n\t\txml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);\n\t\txml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $encoding);\n\n\t\txml_set_object($this->parser, $this);\n\t\txml_set_element_handler($this->parser, 'startHandler', 'endHandler');\n\t\txml_set_character_data_handler($this->parser, 'contentHandler');\n\n\n\t\t// format source;\n\t\tif($typeof == NULL)\n\t\t\t$data = $src;\n\t\telseif($typeof == 'FILE') {\n\t\t\t$fop = fopen($src, 'r');\n\t\t\t$data = fread($fop, filesize($src));\n\t\t\tfclose($fop);\n\t\t}\n\t\telseif($typeof == 'CURL') {\n\t\t\t$curl = curl_init();\n\t\t\tcurl_setopt($curl, CURLOPT_URL, $src);\n\t\t\tcurl_setopt($curl, CURLOPT_HEADER, 0);\n\t\t\t$data = curl_exec($curl);\n\t\t\tcurl_close($curl);\n\t\t}\n\t\telse\n\t\t\ttrigger_error('Xml parser need data', E_USER_ERROR);\n\n\t\t// parse $data;\n\t\t$parse = xml_parse($this->parser, $data);\n\t\tif(!$parse)\n\t\t\ttrigger_error('XML Error : '.xml_error_string(xml_get_error_code($this->parser)).\n ' at line '.xml_get_current_line_number($this->parser), E_USER_ERROR);\n\n\t\t// destroy parser;\n\t\txml_parser_free($this->parser);\n\n\t\t// unset extra vars;\n\t\tunset($data, $this->track, $this->tmpLevel, $this->tmpAttrLevel);\n\n\t\t// remove global tag and return the result;\n\t\treturn $this->pOut[0][key($this->pOut[0])];\n\t}", "protected function processData(SimpleXMLElement $xml)\n {\n // Do nothing.\n }", "private function parse()\n {\n $this->parseChildrenNodes($this->_dom, $this->_rootNode);\n }", "protected function extractXml($xml){\r\n\t$data = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);\r\n\t\r\n\t$ret = array();\r\n\t$ret['system_type'] = (string)$data->row[0]->attributes()->system_type;\r\n\t$ret['validate'] = (string)$data->row[0]->attributes()->validate;\r\n\t$ret['predefined'] = (string)$data->row[0]->attributes()->predefined;\r\n\t$ret['size'] = (string)$data->row[0]->attributes()->size;\r\n\t$ret['unique'] = (string)$data->row[0]->attributes()->unique;\r\n\t$ret['cleanup'] = (string)$data->row[0]->attributes()->cleanup;\r\n\t$ret['name'] = (string)$data->row[0]->name;\r\n\t$ret['title'] = (string)$data->row[0]->title;\r\n\t$ret['table'] = (string)$data->row[0]->table;\r\n\t$ret['default_value'] = (string)$data->row[0]->default_value;\r\n\t$ret['default_lock_url'] = (string)$data->row[0]->default_lock_url;\r\n\treturn $ret; \r\n}", "public function parse()\n {\n $parserResolver = new ParserResolver();\n $parserResolver->setXMLElement(new \\SimpleXMLElement($this->xmlString));\n \n $parser = $parserResolver->getParser();\n \n return $parser->parse();\n }", "function setXmlArray(){\n \n $xmlData = simplexml_load_file($this->urlXml);\n $this->xmlArray = (array)$xmlData;\n \n }", "public static function fromXML($xml){\n //self::$strxml = file_get_contents($xml);\n // echo self::$xmldoc != null;\n\n $bool = self::$xmldata = self::$xmldoc->loadXML($xml);\n $newXML = self::$xmldoc->saveXML();\n // echo $newXML;\n }", "function CardinalXMLParser() {\n\t\t $this->xml_parser = xml_parser_create();\n\t\t}", "public function parse() {\n\n // check xml load\n if(!$this->xml)\n return false;\n\n $city = new City();\n foreach($this->xml->attributes() as $key => $value) {\n if(isset(Mapping::mapCity()[$key]))\n $city->{Mapping::mapCity()[$key]} = (string) $value;\n }\n\n $fact = new Detail();\n foreach ($this->xml->fact[0] as $key => $value) {\n if(isset(Mapping::mapDetail()[$key])) {\n $fact->{Mapping::mapDetail()[$key]} = (string) $value;\n }\n\n }\n $city->fact = $fact;\n\n $fact = new Detail();\n foreach ($this->xml->yesterday[0] as $key => $value) {\n if(isset(Mapping::mapDetail()[$key])) {\n $fact->{Mapping::mapDetail()[$key]} = (string) $value;\n }\n\n }\n $city->yesterday = $fact;\n\n $days = array();\n foreach($this->xml->day as $value) {\n $day = new Day();\n foreach ($value as $key => $value1) {\n if(isset(Mapping::mapDay()[$key])) {\n $day->{Mapping::mapDay()[$key]} = (string) $value1;\n }\n //var_dump($value1->attributes()[\"typeid\"]);\n\n\n }\n foreach ($value->day_part as $key2 => $value2) {\n $detail = new Detail();\n foreach ($value2 as $key3 => $value3) {\n if(isset(Mapping::mapDetail()[$key3])) {\n $detail->{Mapping::mapDetail()[$key3]} = (string) $value3;\n }\n if(isset(Mapping::mapDetail()[\"inner\"][$key3])) {\n $detail->{Mapping::mapDetail()[\"inner\"][$key3]} = (string) $value3->avg;\n }\n }\n $day->{$value2->attributes()[\"type\"]} = $detail;\n }\n $days[(string)$value->attributes()[\"date\"]] = $day;\n }\n $city->days = $days;\n\n return $city;\n }", "protected function parseXml($xml)\n {\n if (! $xml) {\n return false;\n }\n\n //SKU or ASIN list\n $list = false;\n if (isset($xml->SKUPrepInstructionsList)) {\n $list = $xml->SKUPrepInstructionsList;\n }\n if (isset($xml->ASINPrepInstructionsList)) {\n $list = $xml->ASINPrepInstructionsList;\n }\n if ($list) {\n foreach ($list->children() as $x) {\n $temp = [];\n if (isset($x->SellerSKU)) {\n $temp['SellerSKU'] = (string) $x->SellerSKU;\n }\n $temp['ASIN'] = (string) $x->ASIN;\n $temp['BarcodeInstruction'] = (string) $x->BarcodeInstruction;\n $temp['PrepGuidance'] = (string) $x->PrepGuidance;\n foreach ($x->PrepInstructionList->children() as $z) {\n $temp['PrepInstructionList'][] = (string) $z;\n }\n if (isset($x->AmazonPrepFeesDetailsList)) {\n foreach ($x->AmazonPrepFeesDetailsList->children() as $z) {\n $fee = [];\n $fee['PrepInstruction'] = (string) $z->PrepInstruction;\n $fee['Amount']['Value'] = (string) $z->Amount->Value;\n $fee['Amount']['CurrencyCode'] = (string) $z->Amount->CurrencyCode;\n $temp['AmazonPrepFees'][] = $fee;\n }\n }\n $this->prepList[] = $temp;\n }\n }\n\n //invalid item list\n $invList = false;\n if (isset($xml->InvalidSKUList)) {\n $invList = $xml->InvalidSKUList;\n }\n if (isset($xml->InvalidASINList)) {\n $invList = $xml->InvalidASINList;\n }\n if ($invList) {\n foreach ($invList->children() as $x) {\n $temp = [];\n $temp['ErrorReason'] = (string) $x->ErrorReason;\n if (isset($x->SellerSKU)) {\n $temp['SellerSKU'] = (string) $x->SellerSKU;\n }\n if (isset($x->ASIN)) {\n $temp['ASIN'] = (string) $x->ASIN;\n }\n $this->invalidList[] = $temp;\n }\n }\n }", "public function parse();", "public function parse();", "public function parse();", "function parse($strInputXML) {\n\n\t\t$this->objParser = xml_parser_create();\n\t\txml_set_object($this->objParser, $this);\n\t\txml_set_element_handler($this->objParser, \"tagOpen\", \"tagClosed\");\n\n\t\txml_set_character_data_handler($this->objParser, \"tagData\");\n\n\t\t$this->strXmlData = xml_parse($this->objParser, $strInputXML);\n\t\tif (!$this->strXmlData) {\n\t\t\tdie(sprintf(\"XML error: %s at line %d\",\n\t\t\t\txml_error_string(xml_get_error_code($this->objParser)),\n\t\t\t\txml_get_current_line_number($this->objParser)));\n\t\t}\n\n\t\txml_parser_free($this->objParser);\n\n\t\treturn $this->arrOutput;\n\t}", "function decode_xml($data) {\n return @get_object_vars(simplexml_load_string($data));\n }", "function render_xml( $data ) {\n\n\t\theader (\"Content-Type:text/xml\"); \n\t\t$xml = new SimpleXMLElement( '<results></results>' );\n\t\t$xml = $this->object_to_xml( $data, $xml );\n\t\techo $this->tidy_xml( $xml );\n\t\t\n\t}", "function requestData($url) {\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t$request_results = curl_exec($ch);\n\t$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\n\tif ($code == '200') {\n\t\t$results = simplexml_load_string($request_results);\n\t\tif (!$results) {\n\t\t\t$errors = libxml_get_errors();\n\t\t\t$xml = explode(\"\\n\", $request_results);\n\t\t\n\t\t\tforeach ($errors as $error) {\n\t\t\t\techo display_xml_error($error, $xml);\n\t\t\t}\n\t\t\n\t\t\tlibxml_clear_errors();\n\t\t}\n\t} else {\n\t\t$results = $request_results->error->message->value;\n\t}\t\n\t\n\tcurl_close($ch);\n\t\n\treturn $results;\n}", "function parseXml($inXml){\n\t$tidy = tidy_parse_string($inXml, array(\"output-xml\" => true,\"input-xml\" => true));\n\t$tidy->cleanRepair();\n\t\n\t//create simpleXML object from data\n\t$result = new SimpleXMLElement($tidy);\n\treturn $result;\n}", "public function parseXML($start, $end, $xml)\t {\n\t\t\t $result = \"Can't parse XML\";\n $matches = array();\n if(preg_match('|'.$start.'(.*?)'.$end.'|i', $xml, $matches))\n $result = $matches[1];\n $start.$result.$end.\"<br/>\";\n return $result;\n\t\t}", "public function setData($xml) {}", "function begin_xml() {\n\t\tglobal $pgv_lang, $factarray;//, $eventsArray, $dom, $ePeople, $this->eFams, $egSources, $ePlaces, $eObject;\n\t\t$user = PGV_USER_NAME;\n\n\t\t$this->dom = new DomDocument(\"1.0\", \"UTF-8\");\n\t\t$this->dom->formatOutput = true;\n\n\t\t$eRoot = $this->dom->createElementNS(\"http://gramps-project.org/xml/1.1.0/\", \"database\");\n\t\t$eRoot = $this->dom->appendChild($eRoot);\n\n\t\t$eHeader = $this->dom->createElement(\"header\");\n\t\t$eHeader = $eRoot->appendChild($eHeader);\n\n\t\t$eCreated = $this->dom->createElement(\"created\");\n\t\t$eCreated = $eHeader->appendChild($eCreated);\n\t\t$eCreated->setAttribute(\"date\", date(\"Y-m-d\"));\n\t\t$eCreated->setAttribute(\"version\", \"1.1.2.6\");\n\n\t\t$eResearcher = $this->dom->createElement(\"researcher\");\n\t\t$eResname = $this->dom->createElement(\"resname\");\n\t\t$etResname = $this->dom->createTextNode(getUserFullName($user));\n\t\t$etResname = $eResname->appendChild($etResname);\n\t\t$eResname = $eResearcher->appendChild($eResname);\n\t\t$eResemail = $this->dom->createElement(\"resemail\");\n\t\t$etResemail = $this->dom->createTextNode(get_user_setting($user, 'email'));\n\t\t$etResemail = $eResemail->appendChild($etResemail);\n\t\t$eResemail = $eResearcher->appendChild($eResemail);\n\t\t$eResearcher = $eHeader->appendChild($eResearcher);\n\n\t\t$this->egEvents = $this->dom->createElement(\"events\");\n\t\t$this->egEvents = $eRoot->appendChild($this->egEvents);\n\n\t\t$this->ePeople = $this->dom->createElement(\"people\");\n\t\t$this->ePeople = $eRoot->appendChild($this->ePeople);\n\n\t\t$this->eFams = $this->dom->createElement(\"families\");\n\t\t$this->eFams = $eRoot->appendChild($this->eFams);\n\n\t\t$this->egSources = $this->dom->createElement(\"sources\");\n\t\t$this->egSources = $eRoot->appendChild($this->egSources);\n\n\t\t$this->ePlaces = $this->dom->createElement(\"places\");\n\t\t$this->ePlaces = $eRoot->appendChild($this->ePlaces);\n\n\t\t$this->eObject = $this->dom->createElement(\"objects\");\n\t\t$this->eObject = $eRoot->appendChild($this->eObject);\n\t}", "public function processXml($xml) {\r\n $ds = new \\Gateway\\DataSource\\Customers();\r\n \r\n Utils::log(\"Processing customers XML input...\");\r\n \r\n foreach ($xml->customers as $xmlCustomer) {\r\n // customer entity\r\n $customer = new Customer();\r\n\r\n $customer->id = (int) $xmlCustomer['customers_id'];\r\n $customer->firstname = (string) $xmlCustomer['customers_firstname'];\r\n $customer->surname = (string) $xmlCustomer['customers_lastname'];\r\n $customer->email = (string) $xmlCustomer['customers_email_address'];\r\n $customer->password = (string) $xmlCustomer['customers_email_address'];\r\n $customer->gender = $this->createGender((string) $xmlCustomer['customers_gender']);\r\n\r\n $customer->addSpecialProperty('store_id', 0);\r\n $customer->addSpecialProperty('website_id', 0);\r\n $customer->addSpecialProperty('group_id', 0);\r\n \r\n\t\t\t//bonus points\r\n\t\t\t$customer->bonus_value = (int) $xmlCustomer['customers_bonus_value'];\r\n\t\t\t$customer->bonus_date = (string) $xmlCustomer['customers_bonus_date']; \r\n \r\n //customers members card\r\n if (!empty($xmlCustomer['customers_card']))\r\n $customer->cardID = (string) $xmlCustomer['customers_card']; \r\n \r\n // address according to the last XML description - email from Fritz 18.06.2013 v11\r\n \r\n if (!empty($xmlCustomer['customers_street_address']) \r\n && !empty($xmlCustomer['customers_postcode'])\r\n && !empty($xmlCustomer['customers_city'])\r\n && !empty($xmlCustomer['customers_country'])\r\n )\r\n { \r\n $address = new Address();\r\n\r\n $address->firstname = (string) $xmlCustomer['customers_firstname'];\r\n $address->surname = (string) $xmlCustomer['customers_lastname'];\r\n $address->street = (string) $xmlCustomer['customers_street_address']; \r\n $address->postCode = (string) $xmlCustomer['customers_postcode'];\r\n $address->city = (string) $xmlCustomer['customers_city'];\r\n $address->phoneNo = (string) $xmlCustomer['customers_telephone']; \r\n $address->country = (string) $xmlCustomer['customers_country']; // FIXME have conversion map/mapping table for this?\r\n \r\n // missing in XML\r\n $address->phoneNo = (string) '123456'; \r\n $address->setIsBilling(true);\r\n $address->setIsShipping(false);\r\n \r\n $customer->addAddress($address); \r\n }\r\n \r\n /* NOT USED ANYMORE - see above \r\n \r\n // address entities\r\n $xmlCustomerAddressesPattern = '//address_book[@customers_id=' . $customer->id . ']';\r\n $xmlCustomerAdresses = $xml->xpath($xmlCustomerAddressesPattern); \t\t\t\r\n\t\t\t\r\n if (count($xmlCustomerAdresses)) {\r\n foreach ($xmlCustomerAdresses as $xmlCustomerAddress) {\r\n $address = new Address();\r\n \r\n $address->firstname = (string) $xmlCustomerAddress['entry_firstname'];\r\n $address->surname = (string) $xmlCustomerAddress['entry_lastname'];\r\n $address->gender = $this->createGender((string) $xmlCustomerAddress['entry_gender']);\r\n $address->postCode = (string) $xmlCustomerAddress['entry_postcode'];\r\n $address->city = (string) $xmlCustomerAddress['entry_city'];\r\n $address->street = (string) $xmlCustomerAddress['entry_street_address'];\r\n \r\n // missing in XML\r\n $address->phoneNo = (string) '123456';\r\n $address->country = (string) 'CZ'; // FIXME have conversion map/mapping table for this?\r\n\r\n $address->setIsBilling(false);\r\n $address->setIsShipping(false);\r\n \r\n $customer->addAddress($address);\r\n }\r\n } else {\r\n Utils::log(sprintf(\"Customer '%s' has no address.\", $customer->fullName));\r\n }\r\n */\r\n \r\n //dump($xmlCustomer);\r\n //dump($customer);\r\n \r\n //exit;\r\n \r\n $ds->add($customer); \r\n }\r\n \r\n Utils::log(\"%s customer has been parsed.\", $ds->count());\r\n \r\n return $ds;\r\n }", "function parseLocationData2($xmlData)\n\t{\n\t\t$xml = simplexml_load_string($xmlData);\n\n\t\tif (!is_object($xml))\n\t\t throw new Exception('Error reading XML');\n\t\t\n\t\n\t\t//$city = $xml->xpath('//kml/Response/Placemark id=\"p1\"/AddressDetails/Country/AdministrativeArea/SubAdministrativeArea/Locality');\n$res=$xml->Response->Placemark->AddressDetails->Country->AdministrativeArea->SubAdministrativeArea->Locality->LocalityName;\n\n\t\t\t\t$info = array (\n\t\t\t\"LocalityNamee\" \t\t\t=> (string) $res,\n\n\t\t);\n\t\treturn $info;\n\t}", "public function getValuesXml();", "protected function parse() {}", "abstract public function getDataprotXML();", "protected function parseXML($xml)\n {\n $this->destinationList = [];\n if (! $xml) {\n return false;\n }\n\n $i = 0;\n foreach ($xml->DestinationList->children() as $item) {\n $this->destinationList[$i]['DeliveryChannel'] = (string) $item->DeliveryChannel;\n\n foreach ($item->AttributeList->children() as $member) {\n $this->destinationList[$i]['AttributeList'][(string) $member->Key] = (string) $member->Value;\n }\n\n $i++;\n }\n }", "function _extract_xml_info( $content, $xml, $xmlarchive )\n\t{\n\t\t$return = array();\n\n\t\t//-----------------------------------------\n\t\t// Unpack the datafile\n\t\t//-----------------------------------------\n\n\t\t$xml->xml_parse_document( $content );\n\n\t\tif ( ! is_array( $xml->xml_array['infoexport']['infogroup']['info'][0] ) )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Ensure [0] is populated\n\t\t\t//-----------------------------------------\n\n\t\t\t$tmp = $xml->xml_array['infoexport']['infogroup']['info'];\n\n\t\t\tunset($xml->xml_array['infoexport']['infogroup']['info']);\n\n\t\t\t$xml->xml_array['infoexport']['infogroup']['info'][0] = $tmp;\n\t\t}\n\n\t\tif ( is_array( $xml->xml_array['infoexport']['infogroup']['info'] ) )\n\t\t{\n\t\t\tforeach( $xml->xml_array['infoexport']['infogroup']['info'] as $entry )\n\t\t\t{\n\t\t\t\t$return[ 'set_name' ] = $entry['set_name']['VALUE'];\n\t\t\t\t$return[ 'set_author_email' ] = $entry['set_author_email']['VALUE'];\n\t\t\t\t$return[ 'set_author_name' ] = $entry['set_author_name']['VALUE'];\n\t\t\t\t$return[ 'set_author_url' ] = $entry['set_author_url']['VALUE'];\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public function process_root_element($data) {\n }", "private function load(){\n\n $xml = simplexml_load_string($this->response);\n if($xml){\n if(!$this->isResponseSuccessFull($xml)) {\n\n $item = $xml->Items->Item;\n\n $this->data['title'] = $item->ItemAttributes->Title->__toString();\n $this->data['ean'] = $item->ItemAttributes->EAN->__toString();\n $this->data['brand'] = $item->ItemAttributes->Brand->__toString();\n $this->data['picture'] = $item->SmallImage->URL->__toString();\n $this->data['asin'] = $item->ASIN->__toString();\n $this->data['price'] = round(((int)$item->ItemAttributes->ListPrice->Amount->__toString()) / 100,2);\n }\n }else{\n $this->errorMessage[] = 'can not load xml.';\n }\n }", "public function loadData($xml)\n {\n if (($xml = new \\SimpleXMLElement($xml, LIBXML_COMPACT | LIBXML_PARSEHUGE)) === false) {\n throw new \\Exception('Invalid XML File.');\n }\n $this->dataToConvert = $xml->xpath('page');\n\n if ($this->dataToConvert == '') {\n throw new \\Exception('XML Data is empty');\n }\n }", "public function parse($data, $callback){\r\n $parser = new \\SimpleXMLIterator($data);\r\n $this->content = $data;\r\n //process the root node\r\n if(isset($callback)){\r\n foreach($this->mappings as $mapping){\r\n if(strcmp($mapping->name(), $parser->getName()) == 0){\r\n $result = $this->invokeParser($mapping, $parser);\r\n if(isset($result)){\r\n $this->results[] = $result;\r\n }\r\n }\r\n }\r\n }\r\n //process children\r\n $this->start($parser, $callback);\r\n return $this->results;\r\n }", "function Parse($xml)\n\t{\n\t\tforeach($xml->release->dbinfo AS $o) {\n\t\t\t$db = $o->attributes()->dbname.\" v\".$o->attributes()->version.\" (\".$o->attributes()->entry_count.\" entries) [\".$o->attributes()->file_date.\"]\";\n\t\t\t$this->AddRDF($this->QQuadL($this->GetDatasetURI(), \"interpro_vocabulary:contains\", $db));\n\t\t}\n\t\t// now interate over the entries\n\t\tforeach($xml->interpro AS $o) {\n\t\t\t$this->WriteRDFBufferToWriteFile();\n\t\t\t\n\t\t\t$interpro_id = $o->attributes()->id;\n\t\t\techo \"$interpro_id\".PHP_EOL;\n\t\t\t\n\t\t\t$name = $o->name;\n\t\t\t$short_name = $o->attributes()->short_name;\n\t\t\t$type = $o->attributes()->type;\n\t\t\t$s = \"interpro:$interpro_id\";\n\t\t\t\n\t\t\t$this->AddRDF($this->QQuadL($s,\"rdfs:label\",\"$name ($short_name) $type [$s]\"));\n\t\t\t$this->AddRDF($this->QQuad($s,\"rdf:type\",\"interpro_vocabulary:$type\"));\n\t\t\t$this->AddRDF($this->QQuad($s,\"void:inDataset\",$this->GetDatasetURI()));\n\t\t\t\n\t\t\t// get the pubs\n\t\t\tunset($pubs);\n\t\t\tforeach($o->pub_list->publication AS $p) {\n\t\t\t\t$pid = (string) $p->attributes()->id;\n\t\t\t\tif(isset($p->db_xref)) {\n\t\t\t\t\tif($p->db_xref->attributes()->db == \"PUBMED\") {\n\t\t\t\t\t\t$pmid = (string) $p->db_xref->attributes()->dbkey;\n\t\t\t\t\t\t$pubs['pid'][] = '<cite idref=\"'.$pid.'\"/>';\n\t\t\t\t\t\t$pubs['pmid'][] = '<a href=\"http://www.ncbi.nlm.nih.gov/pubmed/'.$pmid.'\">pubmed:'.$pmid.'</a>';\n\t\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:x-pubmed\",\"pubmed:$pmid\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$abstract = (string) $o->abstract->p->asXML();\n\t\t\tif(isset($pubs)) {\n\t\t\t\t$abstract = str_replace($pubs['pid'],$pubs['pmid'],$abstract);\n\t\t\t}\n\t\t\t\n\t\t\t$this->AddRDF($this->QQuadL($s,\"dc:description\",$this->SafeLiteral($abstract)));\n\t\t\t\n\t\t\tforeach($o->example_list->example AS $example) {\n\t\t\t\t$db = (string) $example->db_xref->attributes()->db;\n\t\t\t\t$id = (string) $example->db_xref->attributes()->dbkey;\n\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:example-entry\", $this->GetNS()->MapQName(\"$db:$id\")));\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($o->parent_list->rel_ref)) {\n\t\t\t\tforeach($o->parent_list->rel_ref AS $parent) {\n\t\t\t\t\t$id = (string) $parent->attributes()->ipr_ref;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:parent\", \"interpro:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($o->child->rel_ref)) {\n\t\t\t\tforeach($o->child->rel_ref AS $child) {\n\t\t\t\t\t$id = (string) $child->attributes()->ipr_ref;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:child\", \"interpro:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($o->contains->rel_ref)) {\n\t\t\t\tforeach($o->contains->rel_ref AS $contains) {\n\t\t\t\t\t$id = (string) $contains->attributes()->ipr_ref;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:contains\", \"interpro:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($o->found_in->rel_ref)) {\n\t\t\t\tforeach($o->found_in->rel_ref AS $f) {\n\t\t\t\t\t$id = (string) $f->attributes()->ipr_ref;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:found-in\", \"interpro:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($o->sec_list->sec_ac)) {\n\t\t\t\tforeach($o->sec_ac AS $s) {\n\t\t\t\t\t$id = (string) $s->attributes()->acc;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:secondary-accession\", \"interpro:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// xrefs\n\t\t\tif(isset($o->member_list->dbxref)) {\n\t\t\t\tforeach($o->member_list->db_xref AS $dbxref) {\n\t\t\t\t\t$db = (string) $dbxref->attributes()->db;\n\t\t\t\t\t$id = (string) $dbxref->attributes()->dbkey;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:x-\".strtolower($db), \"$db:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($o->external_doc_list)) {\n\t\t\t\tforeach($o->external_doc_list->db_xref AS $dbxref) {\n\t\t\t\t\t$db = (string) $dbxref->attributes()->db;\n\t\t\t\t\t$id = (string) $dbxref->attributes()->dbkey;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:x-\".strtolower($db), \"$db:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($o->structure_db_links->db_xref)) {\n\t\t\t\tforeach($o->structure_db_links->db_xref AS $dbxref) {\n\t\t\t\t\t$db = (string) $dbxref->attributes()->db;\n\t\t\t\t\t$id = (string) $dbxref->attributes()->dbkey;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:x-\".strtolower($db), \"$db:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// taxon distribution\n\t\t\tforeach($o->taxonomy_distribution->taxon_data AS $t) {\n\t\t\t\t$organism = (string) $t->attributes()->name;\n\t\t\t\t$number = (string) $t->attributes()->proteins_count;\n\t\t\t\t$this->AddRDF($this->QQuadL($s,\"interpro_vocabulary:taxon-distribution\", \"$organism ($number)\"));\n\t\t\t}\n\t\t}\n\t}", "function xml_import ($xml) {\r\n $xml = html_entity_decode($xml);\r\n\t\tif (!stristr($xml,'<?xml')) {\r\n\t\t\t\t$xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>'.$xml;\r\n\t\t}\r\n $data = XML_unserialize($xml);\r\n\t\tif ($data === NULL) {\r\n\t\t\treturn 0;\r\n\t\t} else {\r\n\t\t return $data;\r\n\t\t}\r\n\t}", "function _atos_esuite_process_feed($url) {\n if (!strstr($url, '://')) {\n $filename = $url;\n }\n else {\n // Given URI is an URL, download this file first.\n $filename = 'temporary://import_' . md5(time() . $url) . '.xml';\n if (!$data = drupal_http_request($url)) {\n return FALSE;\n }\n if ($data->code != 200) {\n return FALSE;\n }\n if (!$fp = fopen($filename, 'w')) {\n return FALSE;\n }\n fwrite($fp, $data->data);\n fclose($fp);\n // Sleep 1s to wait for filesystem\n sleep(1);\n }\n\n $xmlReader = new XMLReader;\n $xmlReader->open($filename);\n\n $imported = 0;\n $errors = 0;\n\n $last_atos_id = 0;\n\n // Move to the first <result> node.\n while ($xmlReader->read() && $xmlReader->name !== 'result');\n\n while ($xmlReader->name === 'result') {\n try {\n $atos_id = atos_esuite_map_node($xmlReader->readOuterXml());\n ++$imported;\n $last_atos_id = max($last_atos_id, $atos_id);\n }\n catch (Exception $e) {\n ++$errors;\n }\n $xmlReader->next('result');\n }\n\n unlink($filename);\n\n return array($imported, $errors, $last_atos_id);\n}", "function getData($url){\n\t$contents = \"\";\n\t//Pull in XML data\n\t$xml = simplexml_load_file($url);\n\t//Go get our title\n\t$contents .= $xml->channel->item->title.\"<br><br>\";\n\t//Get our weather data\n\t$contents .= $xml->channel->item->description.\"<br>\";\n\t//Go get the Latitude\n\t$geoLat = $xml->channel->item->xpath(\"geo:lat\");\n\t$contents .= \"The Latitude is: \".$geoLat[0].\"<br>\";\n\t//Go get the Longitude\n\t$geoLong = $xml->channel->item->xpath(\"geo:long\");\n\t$contents .= \"The Longitude is: \".$geoLong[0];\n\t//Echo everything out\n\techo $contents;\n\n}", "protected function getData() {\n\n $path = $this->getPath();\n\n // Check if file exists.\n if(!file_exists($path)) {\n throw new ImporterException(t('XML file @path does not exist.', array('@path' => $path)));\n }\n\n // Let the XML parser use internal errors so we can collect them later if anything goes wrong.\n libxml_use_internal_errors(true);\n $xml = simplexml_load_file($path);\n if($xml === FALSE) {\n $error_message = \"Failed loading XML:\";\n foreach(libxml_get_errors() as $error) {\n $error_message.= PHP_EOL . $error->message;\n }\n throw new ImporterException($error_message);\n }\n\n // XML -> JSON -> ARRAY\n $json = json_encode($xml);\n $array = json_decode($json, TRUE);\n return $array;\n }", "function parseKML($inc_filename = \"\")\n{\n\t$location_array = array();\n\t//echo \"Collecting Location information from file\";\n\tif(file_exists($inc_filename))\n\t{\n\t\t//yay!\n\t}\n\telse\n\t{\n\t\t//Error \n\t}\t\n\techo \"<p>File Accepted... \".$inc_filename.\"</p>\";\n\t//Starting to parse KML file\n\t$filedom = simplexml_load_file($inc_filename);\n\t$count = 0;\n\t\t//Testing to see if the data exists in correct format\n\t//echo \"<p>\" . htmlentities( (string) $filedom->Document->name ) . \"</p>\";\n\t//echo \"<p>\" . htmlentities( (string) $filedom->Document->Placemark->name ) . \"</p>\";\n\n\n\t//Use that namespace\n\t$namespaces = $filedom->Document->Placemark->getNameSpaces(true);\n\t$gx = $filedom->Document->Placemark->children($namespaces['gx']); \n\n\t$src = new DOMDocument('1.0', 'utf-8');\n\t$src->formatOutput = true;\n\t$src->preserveWhiteSpace = false;\n\t$src->load($inc_filename);\n\t$components = $src->getElementsByTagName('when');\n\techo \"<p>Starting Upload</p>\";\n\n\t//Waste of my time\t\n\t$latmax = 0;\n\t$latmin = -360;\n\t$longmax = 0;\n\t$longmin = 360;\n\t$buffer = 0.02;\n\t$link= mysql_connect('localhost', 'UsernameHere','PasswordHere') or die(mysql_error());\n\tmysql_select_db('DatabaseHere') or die(mysql_error());\n\t//echo \"<p>Starting parseing...</p>\";\n\tforeach( $gx->Track->coord as $acord )\n\t{\n\t\t$latlongcombo = htmlentities( (string) $acord );\n\t\t\t$temp_latlong = split(\" \", $latlongcombo);\n\n\t\t $lat = $temp_latlong[0]; \n\t\t $long = $temp_latlong[1];\n\n\t\t$when = (string)$components->item($count)->nodeValue;\n\t\t\t\t\t$temp_when = split(\"T\", $when);\n\t\t$date = $temp_when[0];\n\t\t\t\t\t$temp_time = split(\"-\",$temp_when[1]);\n\t\t\t\t\t$temp_time2 = split(\"\\.\",$temp_time[0]);\n\t\t$time = $temp_time2[0];\n\t$loc_obj = new location();\n\t$loc_obj->settime($time);\n\t$loc_obj->setdate($date);\n\t$pointlessdate = $date;\n\t$loc_obj->setlongitude($long);\n\t$loc_obj->setlatitude($lat);\n\t$sql = \"INSERT INTO locations (`id`, `time`, `date`, `latitude`, `longitude` ,`tripid`) VALUES (NULL, '\".$time.\"', '\".$date.\"', '\".$long.\"', '\".$lat.\"',NULL)\";\n\t\n\t$result = mysql_query($sql);\n\n\t\t$location_array[] = $loc_obj;\n\t\t$count ++;\n\t}\n\tmysql_close($link);\n\treturn $location_array;\n}", "function parseCurlData($res){\n \n $results = array();\n \n foreach($res as $key=>$val){\n \n $doc = new SimpleXmlElement($val, LIBXML_NOCDATA);\n \n if(isset($doc->channel)){\n $results[$key] = $this->parseRSS($doc,$key);\n }\n if(isset($doc->entry)){\n // return $this->parseAtom($doc);\n }\n \n }\n return $results;\n }", "protected function setParamsFromXml(string $data): void\n {\n $p = xml_parser_create();\n xml_parse_into_struct($p, $data, $values, $index);\n xml_parser_free($p);\n\n $inputParams = [];\n\n foreach ($values as $key => $item) {\n $inputParams[$item['tag']] = $item['value'];\n }\n $this->checkRequiredParams($inputParams);\n\n foreach ($values as $key => $item) {\n $classVar = strtolower($item['tag']);\n $this->$classVar = $item['value'];\n }\n }", "public static function xml2array($xml)\n {\n $arr = array();\n \n if(is_file($xml))\n {\n $xml = file_get_contents($xml);\n }\n $xml = (string)$xml;\n libxml_use_internal_errors(true);\n $dom = new DOMDocument();\n $dom->loadXML($xml);\n $sheets = $dom->getElementsByTagName(SheetConv::XML_WORKSHEET);\n for($i = 0; $i < $sheets->length; $i++)\n {\n $vals = array();\n $sheet = $sheets->item($i);\n $tables = $sheet->getElementsByTagName(SheetConv::XML_TABLE); \n // the sheet has only one table\n if($tables->length > 0)\n {\n $table = $tables->item(0);\n $rows = $table->getElementsByTagName(SheetConv::XML_ROW);\n // the table should has more than one row, first row was the field\n if($rows->length > 0)\n {\n $fields = array();\n $fieldRow = $rows->item(0);\n $fieldCells = $fieldRow->getElementsByTagName(SheetConv::XML_CELL);\n // field cells index\n for($fci = 0; $fci < $fieldCells->length; $fci++)\n {\n // $row->cell->data->value\n $fields[$fci] = $fieldCells->item($fci)->nodeValue;\n }\n \n // value rows index\n for($vri = 1; $vri < $rows->length; $vri++)\n {\n $val = array();\n $valRow = $rows->item($vri);\n $valCells = $valRow->getElementsByTagName(SheetConv::XML_CELL);\n $current = 0;\n // value cells index\n for($vci = 0; $vci < $valCells->length; $vci++)\n {\n if($valCells->item($vci)->getAttribute('ss:Index'))\n {\n $val[$fields[$vci]] = '';\n $current = $valCells->item($vci)->getAttribute('ss:Index') - 1;\n }\n if(isset($fields[$current]))\n {\n $val[$fields[$current]] = $valCells->item($vci)->nodeValue;\n $current++;\n }\n }\n $vals[] = $val;\n }\n }\n }\n $arr[$i] = $vals; \n }\n return $arr;\n }", "function contents($parser, $data){\n global $current_tag, $xml_picture_key, /*$xml_name_key, $xml_size_key,*/ $xml_link_key, $counter, $featured_array;\n switch($current_tag){\n case $xml_picture_key:\n $featured_array[$counter]->picture = $data;\n break;\n /*case $xml_name_key:\n $featured_array[$counter]->name = $data;\n break;\n\t\t\tcase $xml_size_key:\n $featured_array[$counter]->size = $data;\n break;*/\n case $xml_link_key:\n $featured_array[$counter]->link = $data;\n $counter++;\n break;\n }\n }", "function _loadData()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (!$this->_data)\n\t\t{\n\t\t\t$options = array('lite' => '1');\n\t\t\t$xmlDoc = & JFactory::getXMLparser('dom', $options);\n\t\t\tif ($xmlDoc == false) {\n\t\t\t\t$this->setError(JText::_('Error: Cannot create XML doc'));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$content = $xmlDoc->getTextFromFile(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_weblinks'.DS.'models'.DS.'snapshotsources.xml');\n\t\t\tif (!$content) {\n\t\t\t\t$this->setError(JText::_('Error: Cannot load document'));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$status = $xmlDoc->parseXML($content);\n\t\t\tif ($status == false) {\n\t\t\t\t$this->setError(JText::_('Error: Cannot parse XML doc'));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$config = &$xmlDoc->documentElement;\n\t\t\tif ($config->nodeName != 'config') {\n\t\t\t\t$this->setError(JText::_('Error: Root incorrect'));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$sitesNode = &$config->firstChild;\n\t\t\tif ($sitesNode->nodeName != 'sites') {\n\t\t\t\t$this->setError(JText::_('Error: Sites incorrect'));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$sites = array();\n\t\t\t$siteNode = & $sitesNode->firstChild;\n\t\t\twhile ($siteNode) {\n\t\t\t\tif ($siteNode->nodeName != 'site') {\n\t\t\t\t\t$this->setError(JText::_('Error: Invalid site format'));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$siteInfo = & $siteNode->attributes;\n\t\t\t\t$site = new stdClass();\n\t\t\t\t$site->name = $siteInfo['name'];\n\t\t\t\t$siteItem = & $siteNode->firstChild;\n\t\t\t\twhile ($siteItem) {\n\t\t\t\t\tswitch ($siteItem->nodeName) {\n\t\t\t\t\t\tcase 'url':\n\t\t\t\t\t\t\t$site->url = $siteItem->firstChild->nodeValue;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'website':\n\t\t\t\t\t\t\t$site->website = $siteItem->firstChild->nodeValue;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'website-url':\n\t\t\t\t\t\t\t$site->website_url = $siteItem->firstChild->nodeValue;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'pic':\n\t\t\t\t\t\t\t$site->pic = $siteItem->firstChild->nodeValue;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'submit':\n\t\t\t\t\t\t\t$site->submit = $siteItem->firstChild->nodeValue;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'valid':\n\t\t\t\t\t\t\t$site->valid = $siteItem->firstChild->nodeValue;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$this->setError(JText::_('Error: Invalid site parameter'));\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$siteItem = & $siteItem->nextSibling;\n\t\t\t\t}\n\t\t\t\t$sites[] = $site;\n\t\t\t\t$siteNode = & $siteNode->nextSibling;\n\t\t\t}\n\n\t\t\t$this->_data = $sites;\n\t\t\treturn (boolean) $this->_data;\n\t\t}\n\t\treturn true;\n\t}", "public function parse_xml_config ($data, $rootobj)\n {\n $this->cfg = array ();\n $this->curpath = array ();\n $this->depth = 0;\n $this->havedata = 0;\n $this->xml_parser = xml_parser_create ();\n $this->error = NULL;\n\n xml_set_object($this->xml_parser, $this);\n xml_set_element_handler ($this->xml_parser, \"startElement\", \"endElement\");\n xml_set_character_data_handler ($this->xml_parser, \"cData\");\n \n if (!xml_parse ($this->xml_parser, $data))\n {\n\t$this->error = sprintf (\"XML error: %s at line %d\\n\",\n\t\t\t xml_error_string (xml_get_error_code\n\t\t\t\t\t ($this->xml_parser)),\n\t\t\t xml_get_current_line_number ($this->xml_parser));\n\treturn -1;\n }\n if ($this->error != NULL) {\n /* error detected while parsing... */\n return -1;\n }\n xml_parser_free($this->xml_parser);\n\n if (!$this->cfg[$rootobj])\n {\n\t$this->error = \"XML error: no \".$rootobj.\" object found!\\n\";\n\treturn -1;\n }\n\n return 0;\n }", "abstract protected function parse($data);", "public function execute()\n {\n Logger::setMessage(get_called_class().': start importation');\n\n $xml = XmlParser::getSimpleXml(trim($this->content));\n\n if ($xml === false || $xml->getName() !== 'opml' || !isset($xml->body)) {\n Logger::setMessage(get_called_class().': OPML tag not found or malformed XML document');\n\n return false;\n }\n\n $this->parseEntries($xml->body);\n Logger::setMessage(get_called_class().': '.count($this->items).' subscriptions found');\n\n return $this->items;\n }", "protected function parseXML($xml)\n {\n if (! $xml || ! $xml->Shipment) {\n return false;\n }\n $d = $xml->Shipment;\n $this->data['ShipmentId'] = (string) $d->ShipmentId;\n $this->data['AmazonOrderId'] = (string) $d->AmazonOrderId;\n if (isset($d->SellerOrderId)) {\n $this->data['SellerOrderId'] = (string) $d->SellerOrderId;\n }\n $this->data['Status'] = (string) $d->Status;\n if (isset($d->TrackingId)) {\n $this->data['TrackingId'] = (string) $d->TrackingId;\n }\n $this->data['CreatedDate'] = (string) $d->CreatedDate;\n if (isset($d->LastUpdatedDate)) {\n $this->data['LastUpdatedDate'] = (string) $d->LastUpdatedDate;\n }\n $this->data['Weight']['Value'] = (string) $d->Weight->Value;\n $this->data['Weight']['Unit'] = (string) $d->Weight->Unit;\n $this->data['Insurance']['Amount'] = (string) $d->Insurance->Amount;\n $this->data['Insurance']['CurrencyCode'] = (string) $d->Insurance->CurrencyCode;\n if (isset($d->Label)) {\n $this->data['Label']['Dimensions']['Length'] = (string) $d->Label->Dimensions->Length;\n $this->data['Label']['Dimensions']['Width'] = (string) $d->Label->Dimensions->Width;\n $this->data['Label']['Dimensions']['Unit'] = (string) $d->Label->Dimensions->Unit;\n $this->data['Label']['FileContents']['Contents'] = (string) $d->Label->FileContents->Contents;\n $this->data['Label']['FileContents']['FileType'] = (string) $d->Label->FileContents->FileType;\n $this->data['Label']['FileContents']['Checksum'] = (string) $d->Label->FileContents->Checksum;\n if (isset($d->Label->CustomTextForLabel)) {\n $this->data['Label']['CustomTextForLabel'] = (string) $d->Label->CustomTextForLabel;\n }\n if (isset($d->Label->LabelFormat)) {\n $this->data['Label']['LabelFormat'] = (string) $d->Label->LabelFormat;\n }\n if (isset($d->Label->StandardIdForLabel)) {\n $this->data['Label']['StandardIdForLabel'] = (string) $d->Label->StandardIdForLabel;\n }\n }\n\n $this->data['ItemList'] = [];\n foreach ($d->ItemList->children() as $x) {\n $temp = [];\n $temp['OrderItemId'] = (string) $x->OrderItemId;\n $temp['Quantity'] = (string) $x->Quantity;\n $this->data['ItemList'][] = $temp;\n }\n if (isset($d->PackageDimensions->Length)) {\n $this->data['PackageDimensions']['Length'] = (string) $d->PackageDimensions->Length;\n $this->data['PackageDimensions']['Width'] = (string) $d->PackageDimensions->Width;\n $this->data['PackageDimensions']['Height'] = (string) $d->PackageDimensions->Height;\n $this->data['PackageDimensions']['Unit'] = (string) $d->PackageDimensions->Unit;\n }\n if (isset($d->PackageDimensions->PredefinedPackageDimensions)) {\n $this->data['PackageDimensions']['PredefinedPackageDimensions'] = (string) $d->PackageDimensions->PredefinedPackageDimensions;\n }\n\n //Ship From Address\n $this->data['ShipFromAddress']['Name'] = (string) $d->ShipFromAddress->Name;\n $this->data['ShipFromAddress']['AddressLine1'] = (string) $d->ShipFromAddress->AddressLine1;\n if (isset($d->ShipFromAddress->AddressLine3)) {\n $this->data['ShipFromAddress']['AddressLine2'] = (string) $d->ShipFromAddress->AddressLine2;\n }\n if (isset($d->ShipFromAddress->AddressLine3)) {\n $this->data['ShipFromAddress']['AddressLine2'] = (string) $d->ShipFromAddress->AddressLine3;\n }\n if (isset($d->ShipFromAddress->DistrictOrCounty)) {\n $this->data['ShipFromAddress']['DistrictOrCounty'] = (string) $d->ShipFromAddress->DistrictOrCounty;\n }\n $this->data['ShipFromAddress']['Email'] = (string) $d->ShipFromAddress->Email;\n $this->data['ShipFromAddress']['City'] = (string) $d->ShipFromAddress->City;\n if (isset($d->ShipFromAddress->StateOrProvinceCode)) {\n $this->data['ShipFromAddress']['StateOrProvinceCode'] = (string) $d->ShipFromAddress->StateOrProvinceCode;\n }\n $this->data['ShipFromAddress']['PostalCode'] = (string) $d->ShipFromAddress->PostalCode;\n $this->data['ShipFromAddress']['CountryCode'] = (string) $d->ShipFromAddress->CountryCode;\n $this->data['ShipFromAddress']['Phone'] = (string) $d->ShipFromAddress->Phone;\n\n //Ship To Address\n $this->data['ShipToAddress']['Name'] = (string) $d->ShipToAddress->Name;\n $this->data['ShipToAddress']['AddressLine1'] = (string) $d->ShipToAddress->AddressLine1;\n if (isset($d->ShipToAddress->AddressLine3)) {\n $this->data['ShipToAddress']['AddressLine2'] = (string) $d->ShipToAddress->AddressLine2;\n }\n if (isset($d->ShipToAddress->AddressLine3)) {\n $this->data['ShipToAddress']['AddressLine2'] = (string) $d->ShipToAddress->AddressLine3;\n }\n if (isset($d->ShipToAddress->DistrictOrCounty)) {\n $this->data['ShipToAddress']['DistrictOrCounty'] = (string) $d->ShipToAddress->DistrictOrCounty;\n }\n $this->data['ShipToAddress']['Email'] = (string) $d->ShipToAddress->Email;\n $this->data['ShipToAddress']['City'] = (string) $d->ShipToAddress->City;\n if (isset($d->ShipToAddress->StateOrProvinceCode)) {\n $this->data['ShipToAddress']['StateOrProvinceCode'] = (string) $d->ShipToAddress->StateOrProvinceCode;\n }\n $this->data['ShipToAddress']['PostalCode'] = (string) $d->ShipToAddress->PostalCode;\n $this->data['ShipToAddress']['CountryCode'] = (string) $d->ShipToAddress->CountryCode;\n $this->data['ShipToAddress']['Phone'] = (string) $d->ShipToAddress->Phone;\n\n //Service\n $this->data['ShippingService']['ShippingServiceName'] = (string) $d->ShippingService->ShippingServiceName;\n $this->data['ShippingService']['CarrierName'] = (string) $d->ShippingService->CarrierName;\n $this->data['ShippingService']['ShippingServiceId'] = (string) $d->ShippingService->ShippingServiceId;\n $this->data['ShippingService']['ShippingServiceOfferId'] = (string) $d->ShippingService->ShippingServiceOfferId;\n $this->data['ShippingService']['ShipDate'] = (string) $d->ShippingService->ShipDate;\n if (isset($d->ShippingService->EarliestEstimatedDeliveryDate)) {\n $this->data['ShippingService']['EarliestEstimatedDeliveryDate'] = (string) $d->ShippingService->EarliestEstimatedDeliveryDate;\n }\n if (isset($d->ShippingService->LatestEstimatedDeliveryDate)) {\n $this->data['ShippingService']['LatestEstimatedDeliveryDate'] = (string) $d->ShippingService->LatestEstimatedDeliveryDate;\n }\n $this->data['ShippingService']['Rate']['Amount'] = (string) $d->ShippingService->Rate->Amount;\n $this->data['ShippingService']['Rate']['CurrencyCode'] = (string) $d->ShippingService->Rate->CurrencyCode;\n $this->data['ShippingService']['DeliveryExperience'] = (string) $d->ShippingService->ShippingServiceOptions->DeliveryExperience;\n $this->data['ShippingService']['CarrierWillPickUp'] = (string) $d->ShippingService->ShippingServiceOptions->CarrierWillPickUp;\n if (isset($d->ShippingService->ShippingServiceOptions->DeclaredValue)) {\n $this->data['ShippingService']['DeclaredValue']['Amount'] = (string) $d->ShippingService->ShippingServiceOptions->DeclaredValue->Amount;\n $this->data['ShippingService']['DeclaredValue']['CurrencyCode'] = (string) $d->ShippingService->ShippingServiceOptions->DeclaredValue->CurrencyCode;\n }\n }", "function readInXML()\n {\n $xml = simplexml_load_file($this->url);\n return $xml;\n }", "public function getXml() {}", "public function getXMLData() {\n // Set the timezone.\n date_default_timezone_set('Europe/Copenhagen');\n\n // Get the machines from the database.\n $statement = 'SELECT * FROM machine';\n $query = $this->connection->execute($statement);\n $machines = $query->fetchAll(PDO::FETCH_ASSOC);\n\n // Create an XML document with a <machines> root.\n $xml = new DOMDocument(\"1.0\");\n $root = $xml->createElement(\"machines\");\n $xml->appendChild($root);\n\n foreach ($machines as $machine) {\n // If the machines is registered as a test machine, leave out of the results.\n if (isset($machine[\"test\"]) && $machine[\"test\"]) {\n continue;\n }\n\n // Create new <machine> element.\n $entry = $xml->createElement(\"machine\");\n $entry->setAttribute(\"magafd\", $machine[\"magafd\"]);\n $entry->setAttribute(\"forvalt\", $machine[\"forvalt\"]);\n $entry->setAttribute(\"place\", $machine[\"place\"]);\n $entry->setAttribute(\"name\", $machine[\"name\"]);\n $root->appendChild($entry);\n\n // Get all the data for $machine.\n $statement = 'SELECT * FROM data WHERE macid = :macid';\n $query = $this->connection->execute($statement, array('macid' => $machine[\"macid\"]));\n $dataForMachine = $query->fetchAll(PDO::FETCH_ASSOC);\n\n // Add each <data> element to the <machine> element.\n foreach ($dataForMachine as $data) {\n $dataEntry = $xml->createElement(\"data\");\n\n // Convert from timestamp (milliseconds since Jan. 1, 1970) to ISO 8601 date: 2004-02-12T15:19:21+00:00.\n $dataEntry->setAttribute(\"timestamp\", date(\"c\", $data[\"datetime\"] / 1000));\n $dataEntry->setAttribute(\"smiley\", $data[\"smiley\"]);\n $dataEntry->setAttribute(\"what\", $data[\"what\"]);\n\n $entry->appendChild($dataEntry);\n }\n }\n\n // Set content type to XML.\n header('Content-type: application/xml');\n\n // Output XML document.\n echo $xml->saveXML();\n }", "public function xml()\n {\n // if dirty data exists\n $this->swallow();\n // if redirecting\n if ($this->redirect) {\n /*header(\"Location: {$this->redirect}\");\n // more headers\n foreach ( $this->headers as $header ) {\n header($header);\n }*/\n $this->redirect($this->redirect, array(), false);\n } else {\n // header xml data\n header('Content-Type: text/xml');\n //过滤$CFG\n if (!empty($this->vars['CFG'])) {\n unset($this->vars['CFG']);\n }\n // more headers\n foreach ($this->headers as $header) {\n header($header);\n }\n // set varibales data\n $results = Utility::array2XML($this->vars);\n // send\n echo $results;\n }\n }", "protected function parseAdlibResponse() {\n $xml = new SimpleXMLElement($this->raw);\n $results = $xml->xpath('//record');\n $docs = array();\n foreach ($results as $result) {\n $doc = array();\n foreach ($this->fields as $field) {\n // check if we have multiple values\n $children = $this->getGroupedFieldByXpath($result, $field);\n // $children = $result->{$field}->children();\n if(empty($children)) {\n continue;\n }\n if (count($children) > 1) {\n $field_array = array();\n // get all values\n foreach ($children as $value) {\n if ((string) $value != '' && (string) $value != 'Array') {\n $field_array[] = $this->replaceTokenCharacters((string) $value);\n }\n else {\n $field_array[] = $this->replaceTokenCharacters((string) $value->value);\n }\n }\n // and put the resulting array in $doc[$field]\n $doc[$field] = $field_array;\n }\n else {\n // single value\n // First try if there is a result without value.\n if ((string) $children[0] !== '' && (string) $children[0] !== 'Array') {\n $doc[$field] = $this->replaceTokenCharacters((string) $children[0]);\n }\n else {\n $doc[$field] = $this->replaceTokenCharacters((string) $children[0]->value);\n }\n }\n }\n $doc['priref'] = (string) $xml->record->attributes()->priref;\n $doc['raw_xml'] = $result->asXML();\n $docs[] = $doc;\n }\n return $docs;\n }", "static function hlp_extract_params_from_XML($data, $xmlFieldNames) {\n\t\t\n\t\t$parsedXML = array();\n\t\tforeach ($xmlFieldNames as $xmlField) {\n\n\t\t \tif(strpos($data, $xmlField)!==false) {\n\t\t \t$parsedXML[$xmlField] = substr($data, strpos($data,\"<$xmlField>\")+strlen(\"<$xmlField>\"),\n\t\t \t strpos($data, \"</$xmlField>\") - strlen(\"<$xmlField>\") - strpos($data,\"<$xmlField>\"));\n\t\t \t}\n\t\t}\n\t\treturn $parsedXML;\n\t}", "private function parseResponseXML($response_xml=\"\")\n\t\t{\n\t\t\t$this->error_no = 0;\n\t\t\t$this->error_text = '';\n\t\t\t$x = simplexml_load_string($response_xml);\n\t\t\t//rateshop\n\t\t\tif($this->action_code==\"RateShop\"){\n\n\t\t\t\tif (isset($x->OTA_VehAvailRateRS->Errors))\n\t\t\t\t{\n\t\t\t\t\t$this->error=true;\n\t\t\t\t\t$this->error_no = (int) $x->OTA_VehAvailRateRS->Errors->Error[\"Code\"];\n\t\t\t\t\t$this->error_text .= (string) $x->OTA_VehAvailRateRS->Errors->Error[\"ShortText\"];\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//BOOKING\n\t\t\tif($this->action_code==\"Booking\"){\n\t\t\t\tif (isset($x->OTA_VehResRS->Errors))\n\t\t\t\t{\n\t\t\t\t\t$this->error=true;\n\t\t\t\t\t$this->error_no = (int) $x->OTA_VehResRS->Errors->Error[\"Code\"];\n\t\t\t\t\t$this->error_text .= (string) $x->OTA_VehResRS->Errors->Error[\"ShortText\"];\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Modify\n\t\t\tif($this->action_code==\"ModifyReservation\"){\n\t\t\t\tif (isset($x->OTA_VehModifyRS->Errors))\n\t\t\t\t{\n\t\t\t\t\t$this->error=true;\n\t\t\t\t\t$this->error_no = (int) $x->OTA_VehModifyRS->Errors->Error[\"Code\"];\n\t\t\t\t\t$this->error_text .= (string) $x->OTA_VehModifyRS->Errors->Error[\"ShortText\"];\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//CANCEL\n\t\t\tif($this->action_code==\"CANCEL\"){\n\t\t\t\tif (isset($x->OTA_VehCancelRS->Errors))\n\t\t\t\t{\n\t\t\t\t\t$this->error=true;\n\t\t\t\t\t$this->error_no = (int) $x->OTA_VehCancelRS->Errors->Error[\"Code\"];\n\t\t\t\t\t$this->error_text .= (string) $x->OTA_VehCancelRS->Errors->Error[\"ShortText\"];\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $response_xml;\n\t\t}", "private function parseProducts($xml){\n $catalogue = $xml->shop->offers;\n $productData = array();\n foreach ($catalogue as $offers) {\n foreach ($offers as $product) {\n foreach ($product->attributes() as $key => $value) {\n if ($key == 'id') $productData['id_prom'] = $value;\n }\n $productData['model'] = $product->vendorCode;\n $productData['id_group_prom'] = $product->categoryId;\n $this->addProduct($productData);\n }\n }\n }", "function amazon_xml_readxml( $String, $Data, $Encoding='' )\n\t\t{\n\t\t\twhile($Node=$this->amazon_xml_nextnode($String))\n\t\t\t{\n\t\t\t\t$TmpData = \"\";\n\t\t\t\t$Start = strpos( $String, \">\", strpos( $String, \"<$Node\" ) )+1;\n\t\t\t\t$End = strpos( $String, \"</$Node>\", $Start );\n\t\t\t\t$ThisContent = trim( substr( $String, $Start, $End-$Start ) );\n\t\t\t\t$String = trim( substr( $String, $End+strlen( $Node )+3 ) );\n\t\t\t\tif(substr_count($ThisContent, \"<\")) {\n\t\t\t\t\t$TmpData = $this->amazon_xml_readxml( $ThisContent, $TmpData, $Encoding );\n\t\t\t\t\t$Data[$Node][] = $TmpData;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($Encoding == \"UTF-8\") { $ThisContent = utf8_decode($ThisContent); }\n\t\t\t\t\t$ThisContent = str_replace( \"&gt;\", \">\", $ThisContent );\n\t\t\t\t\t$ThisContent = str_replace( \"&lt;\", \"<\", $ThisContent );\n\t\t\t\t\t$ThisContent = str_replace( \"&quote;\", \"\\\"\", $ThisContent );\n\t\t\t\t\t$ThisContent = str_replace( \"&#39;\", \"'\", $ThisContent );\n\t\t\t\t\t$ThisContent = str_replace( \"&amp;\", \"&\", $ThisContent );\n\t\t\t\t\t$Data[$Node][] = $ThisContent;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $Data;\n\t\t}", "function get_info_from_xml($xml_a_traiter)\n{\n\t//Création des tableaux\n\t\t$liste_info['message_id'] = array();\n\t\t$liste_info['isrc'] = array();\n\t\t$liste_info['technicalresourcedetailsreference'] = array();\n\t\t$liste_info['audiocodectype'] = array();\n\t\t$liste_info['bitrate'] = array();\n\t\t$liste_info['url'] = array();\t\t\n\t\t$liste_info['fichier_destination'] = array();\t\n\t\t$liste_info['album_grid'] = array();\t\n\t\t\t\n\t//Reading xml file\t\t\n\t\t$xmlContent = file_get_contents($xml_a_traiter);\t\n\t\tif ($xmlContent == \"\") \n\t\t{\n\t\t\techo \"Fichier XML Vide!\" . \"\\n\";\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$tabXML = array();\n\t\t\t$tabXML = xml2array($xmlContent);\t\n\t\t}\n\t//************************************************************************************************************\t\n\t//Récuperation du MessageId\n\t\tif(isset($tabXML['ernm:PurgeReleaseMessage']))\n\t\t\t$liste_info['message_id'] = $tabXML['ernm:PurgeReleaseMessage']['MessageHeader']['MessageId']['value'];\n\t\telse\n\t\t\t$liste_info['message_id'] = $tabXML['ernm:NewReleaseMessage']['MessageHeader']['MessageId']['value'];\n\t//************************************************************************************************************\n\t//For processing the array in the same manner even if there is one or more sub-block\n\t\tif (isset($tabXML['ernm:NewReleaseMessage']['ResourceList']['SoundRecording'][0])) \n\t\t{\n\t\t\t//There are several sub-block\n\t\t\t$ProductInfoSoundRecording = null;\n\t\t\t$ProductInfoSoundRecording = $tabXML['ernm:NewReleaseMessage']['ResourceList']['SoundRecording'];\n\t\t}\n\t\telse \n\t\t{\n\t\t\t//There is one sub-block\n\t\t\t$ProductInfoSoundRecording = null;\n\t\t\t$ProductInfoSoundRecording[0] = $tabXML['ernm:NewReleaseMessage']['ResourceList']['SoundRecording'];\n\t\t}\n\t\t\n\t//************************************************************************************************************\t\n\t$nb_SoundRecording = count($ProductInfoSoundRecording);\n\tfor($element=0;$element<$nb_SoundRecording;$element++)\n\t{\t\n\t\t$info_track_tmp1['SoundRecording_SoundRecordingId_ISRC'] \t\t\t\t\t\t\t= $ProductInfoSoundRecording[$element]['SoundRecordingId']['ISRC']['value'];\n\t\t$info_track_tmp1['SoundRecording_ResourceReference'] \t\t\t\t\t\t\t\t= $ProductInfoSoundRecording[$element]['ResourceReference']['value'];\n\n\t\t//************************************************************************************************************\n\t\t//For processing the array in the same manner even if there is one or more sub-block\t\t\t\n\t\t\tif (isset($ProductInfoSoundRecording[$element]['SoundRecordingDetailsByTerritory']['TechnicalSoundRecordingDetails'][0])) \n\t\t\t{\n\t\t\t\t//There are several sub-block\n\t\t\t\t$ProductInfoTechnicalSoundRecordingDetails = null;\n\t\t\t\t$ProductInfoTechnicalSoundRecordingDetails = $ProductInfoSoundRecording[$element]['SoundRecordingDetailsByTerritory']['TechnicalSoundRecordingDetails'];\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t//There is one sub-block\n\t\t\t\t$ProductInfoTechnicalSoundRecordingDetails = null;\n\t\t\t\t$ProductInfoTechnicalSoundRecordingDetails[0] = $ProductInfoSoundRecording[$element]['SoundRecordingDetailsByTerritory']['TechnicalSoundRecordingDetails'];\n\t\t\t}\t\t\n\t\t//************************************************************************************************************\n\t\t$nb_TechnicalSoundRecordingDetails = count($ProductInfoTechnicalSoundRecordingDetails);\n\t\t\n\t\tfor($y=0;$y<$nb_TechnicalSoundRecordingDetails;$y++)\n\t\t{\n\t\t\tif(isset($ProductInfoTechnicalSoundRecordingDetails[$y]['BitsPerSample']['value']))\n\t\t\t{\n\t\t\t\tarray_push($liste_info['isrc'],$ProductInfoSoundRecording[$element]['SoundRecordingId']['ISRC']['value']);\n\t\t\t\tarray_push($liste_info['technicalresourcedetailsreference'],$ProductInfoTechnicalSoundRecordingDetails[$y]['TechnicalResourceDetailsReference']['value']);\n\t\t\t\tarray_push($liste_info['audiocodectype'],$ProductInfoTechnicalSoundRecordingDetails[$y]['AudioCodecType']['value']);\n\t\t\t\tarray_push($liste_info['bitrate'],$ProductInfoTechnicalSoundRecordingDetails[$y]['BitsPerSample']['value']);\t\t\t\n\t\t\t\tarray_push($liste_info['url'],$ProductInfoTechnicalSoundRecordingDetails[$y]['File']['URL']['value']);\t\t\t\n\t\t\t\tarray_push($liste_info['fichier_destination'],$ProductInfoTechnicalSoundRecordingDetails[$y]['TechnicalResourceDetailsReference']['value'].\"_\".$ProductInfoTechnicalSoundRecordingDetails[$y]['AudioCodecType']['value'].\"_\".$ProductInfoTechnicalSoundRecordingDetails[$y]['BitsPerSample']['value'].\"_\".$ProductInfoSoundRecording[$element]['SoundRecordingId']['ISRC']['value'].\".\".strtolower($ProductInfoTechnicalSoundRecordingDetails[$y]['AudioCodecType']['value']));\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t//************************************************************************************************************\t\n\t\t//For processing the array in the same manner even if there is one or more sub-block\n\t\t\tif (isset($tabXML['ernm:NewReleaseMessage']['ReleaseList']['Release'][0])) \n\t\t\t{\n\t\t\t\t//There are several sub-block\n\t\t\t\t$ProductInfoRelease = null;\n\t\t\t\t$ProductInfoRelease = $tabXML['ernm:NewReleaseMessage']['ReleaseList']['Release'];\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t//There is one sub-block\n\t\t\t\t$ProductInfoRelease = null;\n\t\t\t\t$ProductInfoRelease[0] = $tabXML['ernm:NewReleaseMessage']['ReleaseList']['Release'];\n\t\t\t}\n\t\t//************************************************************************************************************\t\n\t\t$nb_Release = count($ProductInfoRelease);\n\t\tfor($element=0;$element<$nb_Release;$element++)\n\t\t{\n\t\t\tif($ProductInfoRelease[$element]['ReleaseType']['value']==\"Album\" or $ProductInfoRelease[$element]['ReleaseType']['value']==\"Single\" or $ProductInfoRelease[$element]['ReleaseType']['value']==\"Bundle\" or $ProductInfoRelease[$element]['ReleaseType']['value']==\"ClassicalAlbum\")\n\t\t\t{\n\t\t\t\t$liste_info['album_grid'] = $ProductInfoRelease[$element]['ReleaseId']['GRid']['value'];\n\t\t\t\t$liste_info['globaloriginalreleasedate'] = $ProductInfoRelease[$element]['GlobalOriginalReleaseDate']['value'];\n\t\t\t}\n\t\t}\n\t//************************************************************************************************************\n\n\treturn $liste_info;\n}", "private function parseToXhtml()\n\t{\n\t\t$this->_generic->_time_checkpoint = microtime(true);\n\t\t\n\t\t// Xml\n\t\t$xmlDoc = new DOMDocument();\n\t\ttry \n\t\t{\n\t\t\t$xmlDoc->loadXML($this->_xml); \n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tSLS_Tracing::addTrace(new Exception(\"Error during XML Parsing\"), true, \"<h2>\".$e->getMessage().\"</h2><div style=\\\"margin: 0 30px;padding: 10px;\\\"><pre name=\\\"code\\\" class=\\\"brush:xml\\\">\".htmlentities($this->_xml, ENT_QUOTES).\"</pre></div>\");\n\t\t}\n\t\t\n\t\t// Xsl\n\t\t$xslDoc = new DOMDocument();\t\t\n\t\ttry \n\t\t{\n\t\t\t$xslDoc->loadXML($this->constructGenericXsl()); \n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tSLS_Tracing::addTrace(new Exception($e->getMessage()));\n\t\t}\n\t\t\n\t\t// Parsing\n\t\t$proc = new XSLTProcessor();\n\t\t$proc->registerPHPFunctions();\n\t\ttry \n\t\t{ \n\t\t\t$proc->importStyleSheet($xslDoc); \n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tSLS_Tracing::addTrace(new Exception($e->getMessage()));\t\t\t\n\t\t}\n\t\t\n\t\t// If errors in dev\n\t\tif (!SLS_Generic::getInstance()->isProd() && SLS_Tracing::$_exceptionThrown)\n\t\t\tSLS_Tracing::displayTraces();\n\t\telse\n\t\t{\n\t\t\t// Show xml in source in dev\n\t\t\t/*if ($this->_generic->getSiteConfig(\"isProd\") == 0)\t\t\t\t\t\t\t\n\t\t\t\techo \"<!--[if lt IE 5]><!--<![CDATA[<pre style='display:none;'>\\n\".$this->_xml.\" \\n</pre>]]>--><![endif]-->\\n\";*/\n\t\t\t\n\t\t\t// Parse XML/XSL\n\t\t\t$html = $proc->transformToXML($xmlDoc);\t\t\t\n\t\t\t$this->_generic->logTime($this->_generic->monitor($this->_generic->_time_checkpoint),\"Parsing XML/XSL\",\"\",\"XML/XSL Parsing\");\n\t\t\t$this->_generic->_time_checkpoint = microtime(true);\n\t\t\t\n\t\t\t// Parse HTML with SLS_Dtd\n\t\t\t$html = $this->parseHtml($html);\n\t\t\t\n\t\t\t// Sls cached enabled and Action cache enabled ?\n\t\t\t$cacheOptions = $this->_cache->getAction();\n\t\t\t$actionCache = false;\n\t\t\tif ($this->_generic->isCache() && \n\t\t\t\t$this->_generic->getSide() == \"user\" && \n\t\t\t\t$this->_generic->getGenericControllerName() != \"Default\" &&\n\t\t\t\tis_array($cacheOptions) && \n\t\t\t\tcount($cacheOptions) == 4)\n\t\t\t{\n\t\t\t\t$actionCache\t\t\t= true; \n\t\t\t\t$actionCacheVisibility \t= $cacheOptions[0];\n\t\t\t\t$actionCacheScope \t\t= $cacheOptions[1];\n\t\t\t\t$actionCacheResponsive\t= $cacheOptions[2];\n\t\t\t\t$actionCacheExpiration \t= $cacheOptions[3];\n\t\t\t\t\n\t\t\t\t// Save Full HTML cached\n\t\t\t\tif ($actionCacheScope == \"full\")\t\t\t\t\n\t\t\t\t\t$this->_cache->saveCacheFull($html,$actionCacheVisibility,$actionCacheResponsive);\t\t\t\t\n\t\t\t}\n\n\t\t\t// Show flash button to copy Xml if developer on user side and not on Bo\n\t\t\tif (SLS_BoRights::isLogged() && SLS_BoRights::getAdminType() == \"developer\" && $this->_generic->getSide() == \"user\" && $this->_generic->getGenericControllerName() != $this->_generic->getBo())\n\t\t\t\t$html = preg_replace('/\\<\\/head\\>/i', \"\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t t(1).'<!-- Sls developer Toolbar -->'.\"\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t t(1).'<script type=\"text/javascript\" src=\"'.$this->_generic->getProtocol().'://'.$this->_generic->getSiteConfig(\"domainName\").\"/\".$this->_generic->getPathConfig(\"coreJsDyn\").'ZeroClipboard/ZeroClipboard.js\"></script>'.\"\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t t(1).'<script type=\"text/javascript\">'.\"\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t t(2).'window.slsBuild.xml = \"'.htmlentities(str_replace(array('\"',\"\\n\"),array('\\\"',''),$this->_xml),ENT_COMPAT,\"UTF-8\").'\";'.\"\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t t(1).'</script>'.\"\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t t(1).'<!-- /Sls developer Toolbar -->'.\"\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t t(1).'</head>', $html);\n\n\t\t\techo $html;\n\t\t\t\n\t\t\t$this->_generic->logTime($this->_generic->monitor($this->_generic->_time_checkpoint),\"Parsing HTML\",\"\",\"HTML Parsing\");\n\t\t}\t\t\n\t}", "public abstract function parse($resultFile);", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "function xml_form_by_file($xml_file) {\r\n\t\t$xml = new my_xml_parser ( $xml_file );\r\n\t\t$this->xml_form_by_obj ( $xml );\r\n\t\t\r\n//\t\tif($this->config_service['multilang']==\"1\"){\r\n//\t\t\t$xml_and = simplexml_load_file($xml_file) or die(\"feed not loading\");\r\n//\t\t\tforeach($xml_and->field as $key => $val){\r\n//\t\t\t\tforeach( $val->txt_value as $k => $v ){\r\n//\t\t\t\t\techo $k ;print_R($v); echo \"--<br>\";\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}", "function parse_xml_config($data, $rootobj) {\n\n\tglobal $config, $depth, $curpath, $cfg, $havedata, $current;\n\t\n\t$listtags = explode(\" \", \"rule user group key dnsserver winsserver pages \" .\n\t\"encryption-algorithm-option hash-algorithm-option hosts tunnel onetoone \" .\n\t\"staticmap route alias pipe queue shellcmd cacert earlyshellcmd mobilekey \" .\n\t\"servernat proxyarpnet passthrumac allowedip wolentry vlan domainoverrides element\");\n\n\n $current = \"\";\n\t$cfg = array();\n\t$curpath = array();\n\t$depth = 0;\n\t$havedata = 0;\n\t$current = \"\";\n\t\n\t$xml_parser = xml_parser_create();\n\t\n\txml_set_element_handler($xml_parser, \"startElement\", \"endElement\");\n\txml_set_character_data_handler($xml_parser, \"cData\");\n\t\n\tif (!xml_parse($xml_parser, $data)) {\n\t\t$current = sprintf(\"XML error: %s at line %d\\n\",\n\t\t\t\t\txml_error_string(xml_get_error_code($xml_parser)),\n\t\t\t\t\txml_get_current_line_number($xml_parser));\n\t\treturn 0;\n\t}\n\txml_parser_free($xml_parser);\n\t\n\tif (!$cfg[$rootobj]) {\n\t\t$current = \"XML error: no \".$rootobj.\" object found!\\n\";\n\t\treturn 0;\n\t}\n\t\n\t$current = $cfg[$rootobj];\n return 1;\n}", "protected function parseContent($content) {\n $htmlDom = new \\DOMDocument();\n @$htmlDom->loadHTML('<?xml encoding=\"UTF-8\">' . $content);\n $elements = simplexml_import_dom($htmlDom);\n\n return $elements;\n }", "public function parseXML($filePath) {\n \t$doc = $this->_loadXML($filePath);\n\n \t$texts = $doc->getElementsByTagName('text');\n \tforeach ($texts as $text) {\n \t\tdefine($text->getAttribute('id'), $text->nodeValue);\n \t}\n\n //\tthat's all folks!\n }", "function read_Content() {\n\n\t\tglobal $xml;\n\t\tglobal $test;\n\t\t$i = 0;\n\t\t\n\t\tforeach ($xml as $content):\n\t\n\t\t\t\n\t\t\tif ($test == \"pizza\"){\n\t\t\t\t\n\t\t\t\t$typ = $xml->category[$i]->attributes();\n\t\t\t\tif ($typ == 'pizza'){\n\t\t\t\t\techo \"Pizza Nr. \" . $i . \": <br>\";\n\t\t\t\t\t\n\t\t\t\t\t$name = $xml->category[$i]->name;\n\t\t\t\t\t$size = $xml->category[$i]->name->attributes();\n\t\t\t\t\t$price = $xml->category[$i]->price;\n\t\t\t\t\techo $name . \"<br>\";\n\t\t\t\t\techo \"Price: \" . $price . \"$<br>\";\n\t\t\t\t\techo \"Size: \" . $size . \"<br>----------------------------<br>\";\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ($test == \"spaghetti or ziti\"){\n\t\t\t\t\t\n\t\t\t\t$typ = $xml->category[$i]->attributes();\n\t\t\t\tif ($typ == 'spaghetti or ziti'){\n\t\t\t\t\t\t\n\t\t\t\t\techo \"Dish Nr. \" . $i . \": <br>\";\n\t\t\t\t\t$name = $xml->category[$i]->name;\n\t\t\t\t\t$size = $xml->category[$i]->name->attributes();\n\t\t\t\t\t$price = $xml->category[$i]->price;\n\t\t\t\t\techo $name . \"<br>\";\n\t\t\t\t\techo \"Price: \" . $price . \"$<br>\";\n\t\t\t\t\techo \"Size: \" . $size . \"<br>\";\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\n\t\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "function &parseContents(&$contents) {\n\t\t$xmlParser = new XMLParser();\n\t\t$result =& $xmlParser->parseText($contents);\n\n\t\t$returner = array();\n\t\tforeach ($result->getChildren() as $child) {\n\t\t\t$name = $child->getName();\n\t\t\t$value = $child->getValue();\n\t\t\tif (String::substr($name, 0, 3) == 'dc:') $name = String::substr($name, 3);\n\t\t\t$returner[$name][] = $value;\n\t\t}\n\n\t\t$result->destroy();\n\t\t$xmlParser->destroy();\n\t\tunset($result, $xmlParser);\n\n\t\treturn $returner;\n\t}" ]
[ "0.71299076", "0.6738705", "0.658204", "0.6455392", "0.64235216", "0.63851154", "0.6369252", "0.63048816", "0.62966776", "0.62382084", "0.62297755", "0.62230605", "0.6144148", "0.607942", "0.6065264", "0.6055967", "0.6015603", "0.6009095", "0.5983039", "0.5967268", "0.59559065", "0.5943561", "0.59328705", "0.5892147", "0.58712876", "0.57971776", "0.57743275", "0.57579994", "0.57204056", "0.57009137", "0.5668869", "0.5654148", "0.56379026", "0.5632154", "0.5630985", "0.5602478", "0.5579044", "0.5572732", "0.55609554", "0.5552224", "0.55449736", "0.55305064", "0.552665", "0.552665", "0.552665", "0.5522965", "0.55212533", "0.5508065", "0.5494118", "0.5473063", "0.54728806", "0.54689014", "0.5460537", "0.5454544", "0.5451994", "0.5451601", "0.5450488", "0.5447496", "0.5446827", "0.5446456", "0.5444881", "0.5442603", "0.5441037", "0.54381895", "0.5434102", "0.5426041", "0.542156", "0.5417212", "0.5416746", "0.5416653", "0.54145676", "0.53909934", "0.53859025", "0.53738", "0.53646684", "0.5361994", "0.5361536", "0.53501815", "0.53452384", "0.5338407", "0.533794", "0.5331158", "0.531882", "0.53179395", "0.5316372", "0.5314235", "0.5313269", "0.53092325", "0.5308249", "0.5305793", "0.53023547", "0.5294517", "0.5294517", "0.52934813", "0.52933455", "0.52915823", "0.528571", "0.5274314", "0.527405", "0.5269671", "0.52526045" ]
0.0
-1
Set the XML Request
protected function createRequest($xmlData) { $this->xmlRequest = $this->xmlHeader() . $xmlData . $this->xmlFooter(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setRequestXml(){\n\n $orderHandleRepos = new InternationOrderHandleRepository();\n $this->orderInfo = $orderHandleRepos->getOneWithNotes($this->handleId);\n\n //设置请求用户信息\n $this->userInfoSet($this->requestXml);\n $this->currencySet($this->requestXml);\n\n /**\n * 获取AddBookingRequest xml部分\n * 用户设置 订单新增主体信息\n */\n\n $addBookingRequestXml = $this->requestXml->RequestDetails->AddBookingRequest;\n //设置请求货币类别\n /** @var \\SimpleXMLElement $addBookingRequestXml */\n $addBookingRequestXml->attributes()->Currency = ConfigGta::CURRENCY;\n //订单号设置\n $addBookingRequestXml->addChild(\"BookingReference\",(string)$this->orderInfo[\"order_sn\"]);\n //客户出发时间设置,默认与入住时间相同\n $addBookingRequestXml->addChild(\"BookingDepartureDate\",(string)$this->orderInfo[\"begin_date\"]);\n\n //获取 客户 和 pid 属性 数组\n $guestPids = $this->getGuestPids();\n\n\n\n //客户姓名设置\n $this->setPaxNamesXml($addBookingRequestXml,$guestPids);\n\n //价格处理\n //计算预定房间数\n $roomNum = $this->orderInfo->internationOrderNotes[0]->room_number;\n $roomTotalPrice = number_format($this->orderInfo[\"floor_price_origin\"]/$roomNum,2,\".\",\"\");\n\n\n //booking item 设置\n $bookItemsXml = $addBookingRequestXml->addChild(\"BookingItems\");\n foreach ($guestPids as $index=>$guestPid)\n {\n $this->setBookItemXml($bookItemsXml,$guestPid,$index,$roomTotalPrice);\n\n }\n\n }", "private function setRequestXML($cmd=\"\")\n\t\t{\n\t\t\t$xml_file = \"\";\n\t\t\t\tswitch($cmd){\n\t\t\t\t\tcase 'SingleCarRateShop':\n\t\t\t\t\tcase 'RateShop':\n\t\t\t\t\t\t$xml_file = dirname(__FILE__).\"/xml/\".$this->car_company.\"/single_car_rate_shop.xml\";\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Booking':\n\t\t\t\t\t\t$xml_file = dirname(__FILE__).\"/xml/\".$this->car_company.\"/booking.xml\";\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'RetrieveReservation':\n\t\t\t\t\t\t$xml_file = dirname(__FILE__).\"/xml/\".$this->car_company.\"/retrieve_reservation.xml\";\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'CANCEL':\n\t\t\t\t\t\t$xml_file = dirname(__FILE__).\"/xml/\".$this->car_company.\"/cancel_booking.xml\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\n\t\t\tif($xml_file!=\"\")\n\t\t\t{\n\t\t\t\t$x = file_get_contents($xml_file);\n $this->vars['LOYALTYSET']=\"\";\n $this->vars['LOYALTY']=\"\";\n\t\t\t\tif($this->vars['LOYALTY'] != \"\") {\n $this->vars['LOYALTYSET'] = '<CustLoyalty ProgramID=\"ZT\" MembershipID=\"'.$this->vars['LOYALTY'].'\" TravelSector=\"2\" />';\n\t\t\t\t }\n\t\t\t\tforeach($this->vars as $key=>$val){\n\t\t\t\t\t$k = trim($key);\n\t\t\t\t\t//@todo:fix for vehicle_pref for thirfity;\n\t\t\t\t\t//$v = $this->escapeXML(trim($val));\n\t\t\t\t\t$v = $val;\n\t\t\t\t\t$x = str_replace(\"{\".$k.\"}\",$v,$x);\n\t\t\t\t}\n\n\t\t\t\t$xml = simplexml_load_string($x);\n\t\t\t\treturn str_replace(array(\"\\n\",\"\\r\",\"\\t\"),array(\"\",\"\",\"\"),$xml->asXML());\n\t\t\t}\n\t\t}", "public function setXML(SimpleXMLElement $xml);", "function setRequest($request) {\n\t\t$this->m_request = $request;\n\t}", "public function setData($xml) {}", "public function setXml($_xml)\n {\n $this->_xml = $_xml;\n }", "public function getRequestXML()\n\t{\n\t\treturn $this->request_xml;\n\t}", "function setRequest($value) {\n $this->request = $value;\n }", "public function setRequestData()\n {\n $this->setHeaderInformation();\n }", "public function reset() : self\n {\n $this->xml = new SimpleXMLElement('<?xml version=\"1.0\" encoding=\"utf-8\" ?> <request/>');\n\n return $this;\n }", "public static function set_request($request){\n\t\t\tself::$request = $request;\n\t\t}", "public function getRequestXML()\n\t{\n\t\treturn $this->requestXML;\n\t}", "public function setRequest($request);", "public function setXML($xml)\r\n\t{\r\n\t\t$this->dom->loadXML($xml);\r\n\t}", "public function setRequest(namespace\\Request $request)\n {\n $this->request = $request;\n }", "function XMLBodyRequest(){\n\t\t$request = \"<?xml version='1.0' encoding='UTF-8'?>\\n\";\n\t\t$request .= \"<SyncFoliosRequest user='desarrollo' password='M1Gd3s4rr0y02015'>\";\n\t\t\t$request .= \"<RFC>TTV0812107N4</RFC>\";\n\t\t\t$request .= \"<FoliosUsed>666</FoliosUsed>\";\n\t\t$request .= \"</SyncFoliosRequest>\";\n\t\t\n\t\t/**For debugging purposes*/\n\t\t//header (\"Content-Type:text/xml\");echo \"$request\";die;\n\t\treturn $request;\n\t}", "function setRequest($request) {\n $this->request = $request;\n }", "public function setRequest()\n {\n $requestArray = [\n \"client_id\" => $this->getClientId(),\n \"trx_amount\" => $this->getTrxAmount(),\n \"customer_name\" => $this->getCustomerName(),\n \"customer_email\" => $this->getCustomerEmail(),\n \"customer_phone\" => $this->getCustomerPhone(),\n \"virtual_account\" => $this->getVirtualAccount(),\n \"trx_id\" => $this->getTrxId(),\n \"datetime_expired\" => $this->getDateTimeExpired(),\n \"description\" => $this->getDescription(),\n \"type\" => $this->getTypeTransaction(),\n \"billing_type\" => $this->getBillingType()\n ];\n\n $requestHash = DclHashing::hashData($requestArray, $this->getClientId(), $this->getSecretKey());\n\n if (is_null($requestHash)) {\n throw new BillingException(\"Hashing data is fail\");\n }\n\n $this->request = json_encode(['client_id' => $this->getClientId(), 'data' => $requestHash]);\n\n return $this;\n }", "private function setXmlContentType()\n {\n Http::setContentType(self::XML_CONTENT_TYPE);\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 }", "protected function buildXML() {\n $xml = new \\DOMDocument('1.0', 'utf-8');\n $xml->formatOutput = true;\n\n $request = $xml->appendChild($xml->createElement('SMSBoxXMLRequest'));\n\n // add command, username and password params\n $username = $xml->createElement('username', $this->client->getConfig('username'));\n $password = $xml->createElement('password', $this->client->getConfig('password'));\n $command = $xml->createElement('command', strtoupper($this->getName()));\n\n $request->appendChild($username);\n $request->appendChild($password);\n $request->appendChild($command);\n\n $params = $request->appendChild($xml->createElement('parameters'));\n\n // add parameters\n foreach ($this->getApiCommand()->getParams() as $name => $arg) {\n if ($this->get($name) === true) {\n $params->appendChild($xml->createElement($name));\n } else if (!is_null($this->get($name)) && $this->get($name) !== false) {\n $params->appendChild($xml->createElement($name, $this->get($name)));\n }\n }\n\n return $xml;\n }", "public function sendRequestXML($object);", "public function setRequest( $request ){\n \n $this->request = $request;\n \n }", "function send_xml_request($xml_request){\t\n\t\tini_set('max_execution_time', 300);\n\t\t$ch = curl_init(); //initiate the curl session\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->url.$this->endpoint); //set to API endpoint\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t//curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // tell curl to return data in a variable\n\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Content-Type: text/xml\", \n\t\t\t\t\t\t\t\t\t\t\t\t\t\"Content-length: \".strlen($xml_request),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Authorize: '.$this->authorisation_key.' username='.$this->api_username.'&password='.$this->api_password.'&apikey='.$this->api_key.'&class=Customer'\n\t\t\t\t\t\t\t\t\t\t\t));\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $xml_request); // post the xml\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, (int)120); // set timeout in seconds\n\n\t\t$xml_response = curl_exec($ch);\n\n\t\tif($xml_response === FALSE)\n\t\t\t$this->has_response=false;\n\t\telse\n\t\t\t$this->has_response=true;\n\t\t\t\n\t\tcurl_close ($ch);\n\t\t// Get Status\n\t\t//$status_code = get_status($xml_response);\n\t\treturn $xml_response;\n\t}", "function setUrlXml($data){\n \n $this->urlXml = \"https://www.sis-handball.de/xmlexport/xml_dyn.aspx?\"\n .\"user=\".$this->getConfiguration(0)\n .\"&pass=\".$this->getConfiguration(1)\n .\"&art=\".$this->optionsList[$data]\n .\"&auf=\".$this->getConfiguration(2); \n \n // check Url.\n $this->exceptions->findURL($this->urlXml);\n \n $this->setXmlArray($this->urlXml); \n \n }", "private function Send_CE_XML_Request($request)\n\t\t{\n\t\t\t$test_url = \"https://api.stgi.net/xml.pl\";\n\t\t\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $test_url);\n\t\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\t\n\t\t\t// turning off the server and peer verification(TrustManager Concept).\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\t\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n\t\t\n\t\t\treturn curl_exec($ch);\n\t\t}", "public function setRequest(Request $request)\n {\n $this->_request = $request;\n }", "function XML(){\n\t\t\t\t$this->parser = &xml_parser_create();\n\t\t\t\txml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false);\n\t\t\t\txml_set_object($this->parser, $this);\n\t\t\t\txml_set_element_handler($this->parser, 'open','close');\n\t\t\t\txml_set_character_data_handler($this->parser, 'data');\n\t\t\t}", "public function setRequest($request)\n {\n $this->request = $request;\n }", "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 setRequest(Request $request)\n\t{\n\t\t/* null */\n\t}", "public function setDefaultRequest() {\n }", "public function __construct()\n {\n $this->data = '<?xml version=\"1.0\"?>\n<a:searchrequest\nxmlns:a=\"DAV:\"\nxmlns:mapi=\"http://schemas.microsoft.com/mapi/\">\n<a:sql>SELECT\n\"DAV:href\",\n\"urn:schemas:mailheader:to\",\n\"http://schemas.microsoft.com/exchange/x-priority-long\",\n\"http://schemas.microsoft.com/mapi/commonstart\",\n\"http://schemas.microsoft.com/mapi/commonend\",\n\"urn:schemas:calendar:location\",\n\"urn:schemas:httpmail:textdescription\",\n\"urn:schemas:httpmail:htmldescription\",\n\"urn:schemas:httpmail:subject\"\nFROM \"'.$this->preparedUrl.'\"\n</a:sql>\n</a:searchrequest>';\n }", "public function xml()\n {\n // if dirty data exists\n $this->swallow();\n // if redirecting\n if ($this->redirect) {\n /*header(\"Location: {$this->redirect}\");\n // more headers\n foreach ( $this->headers as $header ) {\n header($header);\n }*/\n $this->redirect($this->redirect, array(), false);\n } else {\n // header xml data\n header('Content-Type: text/xml');\n //过滤$CFG\n if (!empty($this->vars['CFG'])) {\n unset($this->vars['CFG']);\n }\n // more headers\n foreach ($this->headers as $header) {\n header($header);\n }\n // set varibales data\n $results = Utility::array2XML($this->vars);\n // send\n echo $results;\n }\n }", "private function _setRequest()\n\t{\n\t\tif ($this->_requestUri !== NULL) {\n $this->_request = preg_replace('#(^/)|(^' . ROOT . ')|(/$)#', '', $this->_requestUri);\n\n if (! $this->_request) {\n \t$this->_request = self::DEFAULT_MODULE . '/' . self::DEFAULT_VIEW;\n }\n\n $this->_requestVars = explode('/', $this->_request);\n if (count($this->_requestVars) == 1) {\n\t\t\t\t$this->_request .= '/' . self::DEFAULT_VIEW;\n\t\t\t\t$this->_requestVars[] = self::DEFAULT_VIEW;\n }\n\n return $this;\n }\n\n throw new Exception('Request URI is not available');\n\t}", "public function setRequest(Request $request)\n\t{\n\t\t$this->request = $request;\n\t}", "public function setRequest(Request $request) {\r\n $this->request = $request;\r\n }", "protected function setSourceDocument(): void\n {\n $jsonArray = $this->requestHandler->getRequestBodyArray();\n $this->requestSource = $this->ser($jsonArray);\n }", "public function SetRequest(&$arrReq) {\n if(is_array($arrReq)) $this->arrReq = $arrReq;\n }", "public function setRequest(Request $request);", "public function set_request($request) : self\n {\n if (!isset($this->request)) {\n $this->request = $request;\n }\n return $this;\n }", "public function setRequest(Request $request) {\n $this->request = $request;\n }", "public function setRequest(Request $request) {\n $this->request = $request;\n }", "public function getEmrsRequest(){\r\n\t \t$xml = '<EMRSV4.0Request USERID=\"282LIXIA0523\" PASSWORD=\"309NM26RF888\">\r\n\t\t\t\t\t\t<Option>RIGHTWINDOW</Option>\r\n\t\t\t\t\t\t<CustomerName>Garrison Johns</CustomerName>\r\n\t\t\t\t\t\t<CustomerAddress1>TEST 40</CustomerAddress1>\r\n\t\t\t\t\t\t<CustomerAddress2>6406 Ivy Lane</CustomerAddress2>\r\n\t\t\t\t\t\t<CustomerCity>Greenbelt</CustomerCity>\r\n\t\t\t\t\t\t<CustomerState>MD</CustomerState>\r\n\t\t\t\t\t\t<CustomerZip5>20770</CustomerZip5>\r\n\t\t\t\t\t\t<CustomerZip4 />\r\n\t\t\t\t\t\t<RetailerName>Reza Dianat</RetailerName>\r\n\t\t\t\t\t\t<RetailerAddress>6406 Ivy Lane</RetailerAddress>\r\n\t\t\t\t\t\t<PermitNumber>293829</PermitNumber>\r\n\t\t\t\t\t\t<PermitIssuingPOCity>Greenbelt</PermitIssuingPOCity>\r\n\t\t\t\t\t\t<PermitIssuingPOState>MD</PermitIssuingPOState>\r\n\t\t\t\t\t\t<PermitIssuingPOZip5>20770</PermitIssuingPOZip5>\r\n\t\t\t\t\t\t<PDUPOBox>6406 Ivy Lane</PDUPOBox>\r\n\t\t\t\t\t\t<PDUCity>Greenbelt</PDUCity>\r\n\t\t\t\t\t\t<PDUState>MD</PDUState>\r\n\t\t\t\t\t\t<PDUZip5>20770</PDUZip5>\r\n\t\t\t\t\t\t<PDUZip4>1234</PDUZip4>\r\n\t\t\t\t\t\t<ServiceType>Bound Printed Matter</ServiceType>\r\n\t\t\t\t\t\t<DeliveryConfirmation>False</DeliveryConfirmation>\r\n\t\t\t\t\t\t<InsuranceValue />\r\n\t\t\t\t\t\t<MailingAckPackageID>ID00001</MailingAckPackageID>\r\n\t\t\t\t\t\t<WeightInPounds>0</WeightInPounds>\r\n\t\t\t\t\t\t<WeightInOunces>10</WeightInOunces>\r\n\t\t\t\t\t\t<RMA>RMA 123456</RMA>\r\n\t\t\t\t\t\t<RMAPICFlag>False</RMAPICFlag>\r\n\t\t\t\t\t\t<ImageType>TIF</ImageType>\r\n\t\t\t\t\t\t<RMABarcode>False</RMABarcode>\r\n\t\t\t\t\t\t<AllowNonCleansedDestAddr>False</AllowNonCleansedDestAddr>\r\n\t\t\t\t\t\t</EMRSV4.0Request>';\r\n\t\t\t\t\t\t\r\n\t\t\treturn $xml ;\r\n\t \t\r\n\t }", "public function setRequest(\\Mvc\\Helper\\Request $request)\n {\n $this->request = $request;\n return $this;\n }", "public function setStatusRequest()\n {\n $this->status = 'REQUEST';\n\n return $this;\n }", "public function SetOauthRequest() {\n $this->request = new DrupalOAuthRequest($this->method, $this->url, $this->RequestTokens());\n return $this;\n }", "public function prepareRequest()\r\n {\r\n\r\n }", "public function setRequest(Request $request)\n {\n $this->request = $request;\n }", "public function setRequest(Request $request)\n {\n $this->request = $request;\n }", "public function setRequest(Request $request)\n {\n $this->request = $request;\n }", "public function setRequest(Request $request)\n {\n $this->request = $request;\n }", "public function setRequest(Request $request)\n {\n $this->request = $request;\n }", "protected function configureRequest()\n {\n $this->transporter\n ->setMethod('changeStatus')\n ->setParam('version', 2);\n }", "public function setRequestContent($request_content) {\n $this->request_content = $this->replaceTokenStrings($request_content);\n }", "protected function sendViaXml(): self\n {\n $this->response = $this->callApi('POST', $this->getUrl(), $this->createXmlPost(), [\n 'Content-Type' => 'text/xml; charset=UTF8',\n ]);\n\n return $this->parseResponse();\n }", "protected function setRequest(Request $request)\n {\n $this->request = $request;\n }", "public function setRequest()\n\t{\n\n\t\t/** http://localhost/molajo/index.php returns 'http' */\n\t\t$this->set('scheme', $this->symfony_request->getScheme());\n\n\t\t/** http://localhost/molajo/index.php returns 'http' */\n\t\t$this->set('is_secure', $this->symfony_request->isSecure());\n\n\t\t/** http://localhost:99/molajo/index.php retursn http:://localhost:99 (non-standard port) */\n\t\t$this->set('host', $this->symfony_request->headers->get('host'));\n\n\t\t/** http://localhost/molajo/index.php returns '/molajo' */\n\t\t$this->set('base_path', $this->symfony_request->getBasePath());\n\n\t\t/** http://localhost/molajo/index.php returns '/molajo' */\n\t\t$this->set('base_url', $this->symfony_request->getBaseURL());\n\n\t\t/** http://localhost/molajo/index.php returns 80 */\n\t\t$this->set('port', $this->symfony_request->getPort());\n\n\t\t/** http://localhost/molajo/index.php return http:://localhost */\n\t\t/** http://localhost/molajo:88/index.php return http:://localhost:88 */\n\t\t$this->set('http_host', $this->symfony_request->getHttpHost());\n\n\t\t/** http://localhost/molajo/index.php returns 80 */\n\t\t$this->set('request_uri', $this->symfony_request->getRequestUri());\n\n\t\t/** http://localhost/molajo/index.php returns 80 */\n\t\t$this->set('uri', $this->symfony_request->getUri());\n\n\t\t/** POST: Create GET: Read PUT: Update, DELETE: Delete */\n\t\t/** Many browsers do not support PUT or DELETE, $_SERVER['REQUEST_METHOD] supplements */\n\t\t$this->set('method', $this->symfony_request->getMethod());\n\n\t\t/** http://localhost/molajo/index.php returns 80 */\n\t\t$this->set('port', $this->symfony_request->getPort());\n\n\t\t$this->set('path_info', $this->symfony_request->getPathInfo());\n\n\t\t$this->set('query_string', $this->symfony_request->getQueryString());\n\n\t\tif ($this->symfony_request->getQueryString() == '') {\n\t\t\t$tempQueryParameters = array();\n\t\t} else {\n\t\t\t$tempQueryParameters = explode('&', $this->get('query_string'));\n\t\t}\n\n\t\t$query_parameters = array();\n\t\tif (count($tempQueryParameters) > 0) {\n\t\t\tforeach ($tempQueryParameters as $item) {\n\t\t\t\t$pair = explode('=', $item);\n\t\t\t\t$query_parameters[$pair[0]] = $pair[1];\n\t\t\t}\n\t\t}\n\t\t$this->set('query_parameters', $query_parameters);\n\n\t\t/** http://localhost/molajo/index.php returns '/molajo/index.php' */\n\t\t$this->set('base_url_path', $this->get('http_host') . $this->get('base_url')\n\t\t);\n\n\t\t/** http://localhost/molajo/index.php returns 'http://molajo/index.php' */\n\t\t$this->set('base_url_path_with_scheme',\n\t\t\t$this->get('scheme')\n\t\t\t\t. '://'\n\t\t\t\t. $this->get('http_host')\n\t\t\t\t. $this->get('base_url')\n\t\t);\n\n\t\t$this->set('ajax', $this->symfony_request->isXmlHttpRequest());\n\n\t\t$this->set('request_format', $this->symfony_request->getRequestFormat());\n\n\t\t$this->set('mime_type', $this->symfony_request->getMimeType($this->get('request_format')));\n\n\t\t$this->set('format', $this->symfony_request->getFormat($this->get('mime_type')));\n\n\t\t$this->set('content_type', $this->symfony_request->getContentType());\n\n\t\t/** Client */\n\t\t$this->set('client_ip', $this->symfony_request->getClientIp());\n\n\t\t/** Server */\n\t\t$this->set('user', $this->symfony_request->getUser());\n\n\t\t$this->set('password', $this->symfony_request->getPassword());\n\n\t\t$this->set('document_root', $this->symfony_request->server->get('DOCUMENT_ROOT'));\n\n\t\t$this->set('entry_point', $this->symfony_request->server->get('SCRIPT_FILENAME'));\n\n\t\t/** Language */\n\n\t\treturn true;\n\t}", "function setXmlArray(){\n \n $xmlData = simplexml_load_file($this->urlXml);\n $this->xmlArray = (array)$xmlData;\n \n }", "public function setRequestContent()\n {\n $this->requestContent = array(\n 'method' => $this->request->getMethod(),\n 'headers' => $this->request->headers->all(),\n 'content_type' => $this->request->headers->get('content-type'),\n 'content' => array(),\n );\n\n if (strstr($this->requestContent['content_type'], 'application/x-www-form-urlencoded')) {\n $this->requestContent['content'] += $this->request->request->all();\n } elseif (strstr($this->requestContent['content_type'], 'application/json')) {\n $this->requestContent['content'] += json_decode($this->getRequest()->getContent(), true);\n } else {\n $this->requestContent['content'] += $this->request->query->all();\n }\n }", "function GetPollRequestXML() {\n\t\trequire_once('xml-processing/gc_xmlbuilder.php');\n\t\t$xml_data = new gc_XmlBuilder();\n\t\t\n\t\t$xml_data->Push('notification-data-request',\n \t\tarray('xmlns' => $this->schema_url));\n \t\t$xml_data->Element('continue-token', $this->continue_token);\n \t$xml_data->Pop('notification-data-request');\n\n \treturn $xml_data->GetXML();\n\t}", "protected function getRequest() {}", "public function setCurrentRequest(array $parsedRequest){\n\t\t\t$this->currentRequest = CurrentRequest::set($parsedRequest); \n\t\t}", "static public function setXML($content_type = null) {\n\t\tself::$page_type = 2;\n\t\tif (!is_null($content_type)) {\n\t\t\tself::$xml_content_type = $content_type;\n\t\t}\n\t}", "public function getBaseXMLRequest($requestName)\n\t{\n\t\t$requestCommand = $requestName . 'Request';\n\n\t\t$xml = new SimpleXMLElement('<?xml version=\"1.0\" encoding=\"utf-8\" ?><' . $requestCommand . ' xmlns=\"urn:ebay:apis:eBLBaseComponents\" />');\n\t\t$requesterCredentials = $xml->addChild('RequesterCredentials');\n\t\t$requesterCredentials->addChild('eBayAuthToken', GetConfig('EbayUserToken'));\n\n\t\treturn $xml;\n\t}", "public function setRequest( Request $request )\n {\n $this->request = $request;\n \n # Return object to preserve method-chaining:\n return $this;\n }", "public function setResultXml($xmlResult)\n {\n $this->rawResponse = $xmlResult;\n $this->parseResponseXml();\n }", "public function setRequest($Request) {\n $this->Request = $Request;\n return $this;\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 XMLsetContent($data) {\n $this->contentBuffer = $data;\n $this->currentFile = '';\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}", "public function xml(): ?ViaCepApi {\n $this->endpoint .= \"xml/\";\n $this->responseType = \"xml\";\n return $this;\n }", "function setRequestUrl($url) {\n\t\treturn $this->requestUrl = $url;\n\t}", "public function setRequest(Request $request)\n\t{\n\t\t$this->request = $request;\n\n\t\treturn $this;\n\t}", "protected function configureRequest()\n {\n $this->transporter\n ->setMethod('getFields')\n ->setParam('version', 2);\n }", "public function createDocumentElement() {\n\t\t$this->node = $this->getDocument ()->createElement ( 'notificationRequest' );\n\t\t$this->node->setAttribute ( 'xmlns', self::XMLNS_ORDERS );\n\t\t$this->node->setAttribute ( 'xmlns:common', self::XMLNS_COMMON );\n\t\t$this->node->setAttribute ( 'version', '1.0' );\n\t\t$this->getDocument ()->appendChild ( $this->node );\n\t}", "function qa_set_request($request, $relativeroot, $usedformat = null)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\tglobal $qa_request, $qa_root_url_relative, $qa_used_url_format;\n\n\t$qa_request = $request;\n\t$qa_root_url_relative = $relativeroot;\n\t$qa_used_url_format = $usedformat;\n}", "private function request($request=null){\r\n\r\n if(is_null($request)){\r\n\r\n $this->request = request_uri();\r\n\r\n }else{\r\n\r\n $this->request = $request;\r\n\r\n }\r\n\r\n\r\n }", "public function prepareRequest()\n {\n }", "function setRequestUser($value)\n {\n $this->_props['RequestUser'] = $value;\n }", "abstract public function populateRequest(PHPFrame_Request $request);", "public function init() {\n $this->xml = new DomDocument($this->version, $this->encoding);\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 setRequest(Zend_Controller_Request_Abstract $request)\n {\n $this->_request = $request;\n }", "private function setContent()\n {\n $this->setTag();\n $this->openRoot();\n $this->setParam(ModulesInterface::KEY_NAME, ApiInterface::RAML_TYPE_STRING, ucfirst($this->generator->version));\n $this->setParam(ConfigInterface::ATTRIBUTES_CASE, ApiInterface::RAML_TYPE_STRING, ConfigInterface::DEFAULT_CASE);\n $this->setQueryParams();\n $this->setTrees();\n $this->setJwtContent();\n $this->setConfigEntities();\n $this->closeRoot();\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}", "private function open_xml()\n {\n $xmlw = new XMLWriter();\n $xmlw->openMemory();\n\n if (isset($this->request['fs_curl_debug']) && $this->request['fs_curl_debug'] > 0) {\n $indent = true;\n } else {\n $indent = false;\n }\n $xmlw->setIndent($indent);\n $xmlw->setIndentString(' ');\n\n $xmlw->startDocument('1.0', 'UTF-8', 'no');\n $xmlw->startElement('document');\n $xmlw->writeAttribute('type', 'freeswitch/xml');\n\n return $xmlw;\n }", "public function setRequest(Request $request = null)\n {\n $this->request = $request;\n }", "function setRequestURI($sRequestURI)\n\t{\n\t\t$this->sRequestURI = $sRequestURI;\n\t}", "protected function configureRequest()\n {\n $this->transporter\n ->setMethod('getAssociatedCandidates')\n ->setParam('version', 2);\n }", "function __construct() {\n $this->init();\n \\base\\RequestRegistry::setRequest($this);\n }", "public function setRequest($request)\n {\n $this->setAttribute('request', $request);\n\n return $this;\n }", "public function setRequest(Request $request = null)\n {\n $this->request = $request ?? \\Request::instance();\n }", "public function setRequest(\\Pop\\Http\\Request $request)\n {\n $this->request = $request;\n return $this;\n }", "protected function start(){\n \tLynx_Request::parse();\n }", "abstract protected function _setRequestServiceBuilder();", "protected function _request() {}", "public static function setRequestInfo($request)\n {\n if ($request instanceof ServerRequest) {\n static::pushRequest($request);\n } else {\n $requestData = $request;\n $requestData += [[], []];\n $requestData[0] += [\n 'controller' => false,\n 'action' => false,\n 'plugin' => null\n ];\n $request = new ServerRequest();\n $request->addParams($requestData[0])->addPaths($requestData[1]);\n static::pushRequest($request);\n }\n }", "public function getRequest();", "public function getRequest();" ]
[ "0.7258424", "0.684771", "0.65927774", "0.6479331", "0.6415225", "0.63833296", "0.63043296", "0.6294739", "0.6254427", "0.62200373", "0.6182985", "0.61808455", "0.61189413", "0.60839725", "0.6075451", "0.6049277", "0.6029166", "0.60199004", "0.60170954", "0.5990846", "0.5937356", "0.5906208", "0.587156", "0.5871436", "0.5864657", "0.58550435", "0.58405536", "0.58169526", "0.58064425", "0.58057153", "0.5723175", "0.5714567", "0.56909424", "0.56768686", "0.56766343", "0.5672556", "0.56188107", "0.5599501", "0.55967265", "0.5574329", "0.55634516", "0.55564624", "0.55564624", "0.55552745", "0.5547487", "0.5545535", "0.55288583", "0.55006063", "0.54905814", "0.54905814", "0.54905814", "0.54905814", "0.54905814", "0.54836434", "0.5471449", "0.54671603", "0.54476845", "0.54288995", "0.5420019", "0.54183507", "0.5417037", "0.5410234", "0.54086065", "0.5393929", "0.5390335", "0.53885585", "0.5388143", "0.53788537", "0.5376971", "0.5368984", "0.5363707", "0.5323938", "0.5315611", "0.5315506", "0.53150207", "0.5301178", "0.52964836", "0.5287745", "0.52871394", "0.52867925", "0.5282659", "0.5276141", "0.5275756", "0.5255941", "0.5254316", "0.5249963", "0.52496547", "0.52494633", "0.52430725", "0.524078", "0.52400184", "0.52389383", "0.52337086", "0.5217096", "0.52155066", "0.521372", "0.5208445", "0.5197889", "0.51907736", "0.51907736" ]
0.59654087
20
Determine the length (in bytes) of our reponse and stream it.
private function getResponse() { $packed_len = stream_get_contents($this->id, 4); //The first 4 bytes contain our N-packed length $hdr = unpack('Nlen', $packed_len); $len = $hdr['len']; $this->xmlResponse = stream_get_contents($this->id, $len); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _setContentLength() {\n\t\t$shouldSetLength = !isset($this->_headers['Content-Length']) && !in_array($this->_status, range(301, 307));\n\t\tif (isset($this->_headers['Content-Length']) && $this->_headers['Content-Length'] === false) {\n\t\t\tunset($this->_headers['Content-Length']);\n\t\t\treturn;\n\t\t}\n\t\tif ($shouldSetLength && !$this->outputCompressed()) {\n\t\t\t$offset = ob_get_level() ? ob_get_length() : 0;\n\t\t\tif (ini_get('mbstring.func_overload') & 2 && function_exists('mb_strlen')) {\n\t\t\t\t$this->length($offset + mb_strlen($this->_body, '8bit'));\n\t\t\t} else {\n\t\t\t\t$this->length($this->_headers['Content-Length'] = $offset + strlen($this->_body));\n\t\t\t}\n\t\t}\n\t}", "function wfDoContentLength( $length ) {\n\tif ( !headers_sent() && isset( $_SERVER['SERVER_PROTOCOL'] ) && $_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0' ) {\n\t\theader( \"Content-Length: $length\" );\n\t}\n}", "function getContentLength(){\n\t\treturn $this->_OutputBuffer->getLength();\n\t}", "function read()\n {\n $response_content = '';\n if ($this->headers['Transfer-Encoding'] == 'chunked')\n {\n while ($chunk_length = hexdec(fgets($this->socket)))\n {\n $response_content_chunk = '';\n $read_length = 0;\n\n while ($read_length < $chunk_length)\n {\n $response_content_chunk .= fread($this->socket, $chunk_length - $read_length);\n $read_length = strlen($response_content_chunk);\n }\n\n $response_content .= $response_content_chunk;\n fgets($this->socket);\n }\n }\n else\n {\n while (!feof($this->socket))\n {\n $response_content .= fgets($this->socket, 128);\n }\n }\n return chop($response_content);\n fclose($this->socket);\n }", "public function count() {\n // response without using iterator_count (which actually consumes \n // our iterator to calculate the size, and we cannot perform a rewind)\n return $this->_replySize;\n }", "public function getContentLength() { return $this->content_length; }", "public function contentLength()\n {\n return strlen($this->body());\n }", "public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);", "public function getSize()\n {\n $curl_options = array (\n CURLOPT_HEADER => 1,\n CURLOPT_NOBODY => 1,\n CURLOPT_RETURNTRANSFER => 1,\n );\n\n $headers = $this->curl_query($curl_options);\n\n if (!$headers) return false;\n\n /* grep Content-Length from response */\n preg_match('/(Content-Length: \\d{1,})/', $headers, $content_length);\n preg_match('/\\d{1,}/', $content_length[0], $size);\n\n return intval($size[0]);\n }", "public function getContentLength()\n {\n $result = $this->headers->get('Content-Length');\n\n return $result ? (int)$result[0] : null;\n }", "function getResponseBody(){\n $page = \"\";\n if ($this->fpopened===FALSE) return $page;\n while (!feof ($this->fpopened)) {\n $page .= fread ($this->fpopened, 1024);\n }\n return $page;\n }", "static public function GetContentLength() {\n return (isset(self::$headers[\"content-length\"]))? (int) self::$headers[\"content-length\"] : 0;\n }", "public function getContentLength()\n {\n return isset($_SERVER['CONTENT_LENGTH'])\n ? (int) $_SERVER['CONTENT_LENGTH']\n : null;\n }", "public function getRawResponse();", "public function getRawResponse() {\n\t}", "public function getContentLength() {\r\n return $this->__contentLength;\r\n }", "public function getContentLength(): int\n {\n return $this->length;\n }", "public function getResponseCount()\n\t{\n\t\t$responses = $this->getResponses();\n\n\t\tif ($responses) {\n\t\t\treturn count($responses);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getSize() {\n if (isset($_SERVER[\"CONTENT_LENGTH\"])){\n return (int)$_SERVER[\"CONTENT_LENGTH\"];\n } else {\n throw new Exception('Getting content length is not supported.');\n }\n }", "public function read()\n {\n return $this->response;\n }", "public function testRetrieveChunkedHttpResponse()\n {\n $client = new HttpClient();\n $response = $client->send(\n HttpRequestMethod::GET,\n 'https://postman-echo.com/stream/5'\n );\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals('OK', $response->getReasonPhrase());\n $this->assertNotEmpty($response->getBody());\n $this->assertNotEmpty($response->getHeaders());\n }", "public static function length($size){\n\t\t\tif(!headers_sent())header('Content-Length: '.$size,true);\n\t\t\treturn !headers_sent();\n\t\t}", "public function downloadlength() {\n return $this->info['download_content_length'];\n }", "public function getResponseBody()\n {\n return $this->httpResponse;\n }", "function curl_callback($ch, $bytes){\n global $fp;\n $len = fwrite($fp, $bytes);\n // if you want, you can use any progress printing here\n return $len;\n}", "function getPayloadLength();", "private function readChunk() {\n\t\t// Handle content length\n\t\tif ($this->contentLength > 0) {\n\t\t\t// End of buffer\n\t\t\tif ($this->contentIndex >= $this->contentLength) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\t// Calculate chunk size to read\n\t\t\t$size = $this->contentLength - $this->contentIndex;\n\t\t\t$size = $size < $this->bufferSize ? $size : $this->bufferSize;\n\t\t\t$data = $this->fread($size);\n\n\t\t\t// Debug chunk size\n\t\t\tif ($this->client->getLogLevel() >= 3) {\n\t\t\t\t$this->client->log(\"- Chunk size: \" . strlen($data));\n\t\t\t}\n\n\t\t\treturn $data;\n\t\t}\n\n\t\t// Handle chunked transfer encoding\n\t\tif ($this->transferEncoding === \"chunked\") {\n\t\t\tif ($this->chunkLength === 0) {\n\t\t\t\t$line = $this->readLine($this->bufferSize);\n\n\t\t\t\t// Curl can produce empty response if first chunk length is 0\n\t\t\t\tif ($line === '') {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\n\t\t\t\tif (!preg_match('/^([0-9a-f]+)/i', $line, $matches)) {\n\t\t\t\t\tthrow new MOXMAN_Http_HttpClientException(\"Invalid chunk length: \" . $line);\n\t\t\t\t} else {\n\t\t\t\t\t$this->chunkLength = hexdec($matches[1]);\n\t\t\t\t\t$this->chunkedContentLength += $this->chunkLength;\n\n\t\t\t\t\t// Chunk with zero length indicates the end\n\t\t\t\t\tif ($this->chunkLength === 0) {\n\t\t\t\t\t\t$this->contentLength = $this->chunkedContentLength;\n\t\t\t\t\t\t$this->readLine();\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$data = $this->fread(min($this->chunkLength, $this->bufferSize));\n\t\t\t$this->chunkLength -= strlen($data);\n\n\t\t\tif ($this->chunkLength === 0) {\n\t\t\t\t$this->readLine(); // Trailing CRLF\n\t\t\t}\n\n\t\t\t// Debug chunk size\n\t\t\tif ($this->client->getLogLevel() >= 3) {\n\t\t\t\t$this->client->log(\"- Chunk size: \" . strlen($data));\n\t\t\t}\n\n\t\t\treturn $data;\n\t\t}\n\n\t\treturn \"\";\n\t}", "public function getResponseBody()\n {\n return $this->responseBody; \n }", "public function pipe($length)\n {\n $data = $this->connection->read($length);\n $this->buffer .= $data;\n\n return strlen($data);\n }", "public function rawResponse() {\n\t\treturn $this->raw_response;\n\t}", "public function getRawResponse()\n {\n return $this->response->getBody();\n }", "public static function getContentLength(): ?string {\r\n return $_SERVER['CONTENT_LENGTH'] ?? null;\r\n }", "public function getResponseBody(){\n\t\treturn $this->response->getBody();\n\t}", "public function length() {\r\n return strlen($this->contents);\r\n }", "function processBody()\r\n\t{\r\n\t\t$failureCount = 0;\r\n\t\tif( $this->debug & DBGLOW ) echo \"processBody()\\n\";\r\n/*\t\tif( $this->responseHeaders['Content-Length'] ) \r\n\t\t{\r\n\t\t\t$length = $this->responseHeaders['Content-Length'];\r\n\t\t\t$data = fread( $this->socket, $length );\r\n\t\t\tif( $this->debug & DBGSOCK ) echo \"DBG.SOCK socket_read using Content-Length ($length)\\n\";\r\n\r\n\t\t} else {*/\r\n\r\n\t\t\t$data = \"\";\r\n\t\t\t$counter = 0;\r\n//\t\t\tsocket_set_blocking( $this->socket, false );\r\n\t\t\tdo{\r\n\t\t\t\t$status = socket_get_status( $this->socket );\r\n\t\t\t\tif( $status['eof'] == 1 ) {\r\n\t\t\t\t\tif( $this->debug & DBGSOCK ) echo \"DBG.SOCK status eof met, finished socket_read\\n\";\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif( $status['unread_bytes'] > 0 ) {\r\n\t\t\t\t\t$buffer = fread( $this->socket, $status['unread_bytes'] );\r\n\t\t\t\t\t$counter = 0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$buffer = fread( $this->socket, 1024 );\r\n\t\t\t\t\t$failureCount++;\r\n\t\t\t\t\tusleep(2);\r\n\t\t\t\t}\r\n\t\t\t\t$data .= $buffer;\r\n\t\t\t\tif( $this->debug & DBGSOCK )\r\n\t\t\t\t\techo implode( \" | \", $status ), \"\\n\";\r\n\t\t\t\t\r\n\t\t\t} while( $status['unread_bytes'] > 0 || $counter++ < 10 );\r\n\r\n\t\t\tif( $this->debug & DBGSOCK ) {\r\n\t\t\t\techo \"DBG.SOCK Counter:$counter\\nRead failure #: $failureCount\\n\";\r\n\t\t\t\techo \" Socket status: \"; print_r($status);\r\n\t\t\t}\r\n//\t\t\tsocket_set_blocking( $this->socket, true );\r\n//\t\t}\r\n\t\treturn $data;\r\n\t}", "public function getRawResponse()\n {\n return $this->response;\n }", "public function getRequestLength()\n\t{\n\t\treturn $this->elapsed;\n\t}", "function output() {\n if (isset($this->status)) {\n $this->send_header(sprintf('HTTP/1.1 %d %s',\n $this->status, $this->reason),\n TRUE,\n $this->status);\n }\n\n foreach ($this->headers as $k => $v) {\n $this->send_header(\"$k: $v\");\n }\n\n echo $this->body;\n }", "public function getResponseDuration()\n\t{\n\t\treturn ($this->responseTime - $this->time) * 1000;\n\t}", "protected function getResponseWidth()\n {\n $responseWidth = static::RESPONSE_WIDTH_DEFAULT;\n $expectedLength = $this->interaction->getExpectedLength();\n if ($expectedLength > 0 && $this->isUsingExpectedLengthAsResponseWidth()) {\n $responseWidth = (ceil($expectedLength) * 10) . 'px';\n }\n\n return $responseWidth;\n }", "protected function getResponse(): Response\n {\n return new Response(fopen('data://text/plain,', 'rb'), 200);\n }", "public function getRespBody()\n {\n $headerSize = curl_getinfo($this->res, CURLINFO_HEADER_SIZE);\n\n return substr($this->lastResponse, $headerSize);\n }", "function http_parse_response()\n\t{\n\t\tlist($headers, $body) = explode(\"\\r\\n\\r\\n\", $this->http_response, 2);\n\t\t$this->http_parse_headers($headers);\n\n\t\tif(isset($this->http_response_headers['Transfer-Encoding']) && 'chunked' == $this->http_response_headers['Transfer-Encoding']):\n \t\t$this->http_response_body = $this->http_chunked_decode($body);\n\t\telse:\n\t\t\t$this->http_response_body = $body;\n\t\tendif;\n\n\t\t$this->http_set_content_type($this->http_default_content_type);\n\t}", "public function length($bytes = null) {\n\t\tif ($bytes !== null) {\n\t\t\t$this->_headers['Content-Length'] = $bytes;\n\t\t}\n\t\tif (isset($this->_headers['Content-Length'])) {\n\t\t\treturn $this->_headers['Content-Length'];\n\t\t}\n\t\treturn null;\n\t}", "public function getOutputLength();", "protected function receiveResponse()\n {\n $metaData = fread($this->socket, 8);\n\n if ($metaData === false || strlen($metaData) < 8) {\n throw new Exception\\SocketException('Socket closed unexpectedly');\n }\n\n list($code, $length) = array_values(unpack('Vcode/Vlength', $metaData));\n\n $buffer = '';\n\n do {\n $buffer .= ($data = $length ? fread($this->socket, $length) : '');\n $length -= strlen($data);\n } while ($data !== false && $length > 0);\n\n if ($length > 0) {\n throw new Exception\\SocketException('Not enough data received');\n }\n\n return new Response($code, $buffer);\n }", "public static function response($req, $out)\n {\n $chunksize = 65520;\n do {\n if (strlen($out) > $chunksize) {\n while (($ol = strlen($out)) > 0) {\n $l = min($chunksize, $ol);\n if (static::sendChunk($req, substr($out, 0, $l)) === false) {\n fwrite(STDOUT, \"send response failed.\\n\");\n break 2;\n }\n $out = substr($out, $l);\n }\n } elseif (static::sendChunk($req, $out) === false) {\n fwrite(STDOUT, \"send response failed.\\n\");\n break;\n }\n } while (false);\n static::endRequest($req, 0, 0);\n\n return true;\n }", "public function as_response() {\n return Net_HTTP::Response($this);\n }", "public final function getRawResponse() {\n return $this->_rawresponse;\n }", "public function getRawResponse()\n {\n return $this->rawResponse;\n }", "private function getResponse ($size = 128) {\n $pop3_response = fgets($this->pop_conn, $size);\n\n return $pop3_response;\n }", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "public function getResponseBody()\n {\n return $this->responseBody;\n }", "public function getResponseBody()\n {\n return $this->responseBody;\n }", "public function getResponseBody()\n {\n return $this->responseBody;\n }", "protected function sendContent()\n {\n if ($this->stream === null) {\n $this->swoole_http_response->end($this->content);\n // 这里看到还有写session的\n return;\n }\n\n $chunkSize = 8 * 1024 * 1024; // 8MB per chunk\n\n if (is_array($this->stream)) {\n list ($handle, $begin, $end) = $this->stream;\n fseek($handle, $begin);\n while (!feof($handle) && ($pos = ftell($handle)) <= $end) {\n if ($pos + $chunkSize > $end) {\n $chunkSize = $end - $pos + 1;\n }\n $this->swoole_http_response->write(fread($handle, $chunkSize));\n }\n fclose($handle);\n } else {\n while (!feof($this->stream)) {\n $this->swoole_http_response->write(fread($this->stream, $chunkSize));\n }\n fclose($this->stream);\n }\n $this->swoole_http_response->end();\n\n // 这里看到还有写session的\n }", "protected function parseResponse()\n {\n // get the status code from response.\n $statusCode = $this->httpResponse->getStatusCode();\n\n // set as error, if http status code is not between 200 and 299 (inclusive).\n $this->networkError = !($statusCode >= 200 && $statusCode <= 299);\n\n // decode the response body.\n $body = $this->decodeBody();\n\n // stop when no body is present.\n if ($body) {\n // parse the response id from the body.\n $this->id = (int) array_get($body, 'id', null);\n\n // set as error when there is a an error key and it's not null.\n $this->isError = array_get($body, 'error', null) !== null;\n\n // parse the response data, from result or error.\n $this->data = collect(array_get($body, $this->isError ? 'error' : 'result', []));\n }\n\n // just return the response body.\n return $this->body;\n }", "public function getLastRawResponse()\n\t{\n\t\treturn $this->rawResponse;\n\t}", "public function getResponseContent(): string\n {\n return $this->responseContent;\n }", "public function getSize()\n {\n if ($this->isWrapped() || $this->isTemp()) {\n $wrapper_info = $this->getWrapperInfo();\n\n if (!in_array($wrapper_info['protocol'], static::$stat_able_protocols)) {\n return strlen($this->getRaw());\n }\n }\n\n // Just call our parent, otherwise\n return parent::getSize();\n }", "public function outputStatus()\n {\n if ($this->responseStatus instanceof ResponseStatus) {\n header(sprintf('HTTP/1.1 %d %s', $this->responseStatus->httpStatusCode, $this->responseStatus->httpStatusMessage));\n }\n echo $this->body;\n }", "public function getResponseOutput() {\n // Empty, to be overridden\n }", "public function getDigestedResponse() {\n\t}", "public function read() {\n\t\t// For head requests\n\t\tif ($this->isEmptyBody) {\n\t\t\t$this->close();\n\t\t\treturn \"\";\n\t\t}\n\n\t\t// Currently we don't support any content encodings like gzip or deflate\n\t\t// TODO: Implement this if needed\n\t\tif ($this->contentEncoding) {\n\t\t\tthrow new MOXMAN_Http_HttpClientException(\"Unsupported content encoding: \" . $this->contentEncoding);\n\t\t}\n\n\t\t// Read uncompressed chunk\n\t\t$data = $this->readChunk();\n\n\t\t// Close connection when there is no more data\n\t\tif ($data === \"\") {\n\t\t\t$this->close();\n\t\t}\n\n\t\treturn $data;\n\t}", "public function getSize(): int {\n\t\treturn mb_strlen($this->getContent());\n\t}", "protected function _parseClientRequestStream() {\n\t $this->clientoutput->response = array();\n\t\t$this->_parsing->offset = 0;\n\t\t\n $body = '';\n $length = 0;\t\t\n\t\t\n\t $fp = fopen(\"php://input\",\"r\"); //rb?\n\n\t //while(!feof($fp)) {\n\t\tdo {\n\t\t\n // NOTE: for chunked encoding to work properly make sure\n // there is NOTHING (besides newlines) before the first hexlength\n\n // get the line which has the length of this chunk (use fgets here)\n $line = fgets($fp, BUFFER_LENGTH);\n\n // if it's only a newline this normally means it's read\n // the total amount of data requested minus the newline\n // continue to next loop to make sure we're done\n if ($line == CRLF) {\n continue;\n }\n\n // the length of the block is sent in hex decode it then loop through\n // that much data get the length\n // NOTE: hexdec() ignores all non hexadecimal chars it finds\n $length = hexdec($line);\n\n if (!is_int($length)) {\n //trigger_error('Most likely not chunked encoding', E_USER_ERROR);\n\t\t\t $this->clientoutput->body .= $line;\n\t\t\t continue;\n }\n\n // zero is sent when at the end of the chunks\n // or the end of the stream or error\n if ($line === false || $length < 1 || feof($fp)) {\n // break out of the streams loop\n break;\n }\t\n\n // loop though the chunk\n do\n {\n // read $length amount of data\n // (use fread here)\n $data = fread($fp, $length);\n\n // remove the amount received from the total length on the next loop\n // it'll attempt to read that much less data\n $length -= strlen($data);\n\n // PRINT out directly\n #print $data;\n #flush();\n // you could also save it directly to a file here\n\n // store in string for later use\n $this->clientoutput->body .= $data;\n\n // zero or less or end of connection break\n if ($length <= 0 || feof($fp)) {\n // break out of the chunk loop\n break;\n }\n }\n while (true);\n // end of chunk loop\n }\n while (true);\n // end of stream loop\n\t\t\n\t //} \n fclose($fp);\t\t\n\t}", "public function initialize()\n {\n $this->app->after(function (Request $request, Response $response) {\n // If it's a HEAD request: don't set content-length\n if ($request->getMethod() == 'HEAD') {\n return $response;\n }\n\n // If the response already has a Content-Length header: skip it\n if ($response->headers->has('Content-Length')) {\n return $response;\n }\n\n // Messages MUST NOT include both a Content-Length header field and\n // a non-identity transfer-coding. If the message does include a\n // non-identity transfer-coding, the Content-Length MUST be ignored.\n // (RFC 2616, Section 4.4)\n if ($response->headers->has('Transfer-Encoding')) {\n return $response;\n }\n\n $length = strlen($response->getContent());\n if ($length) {\n $response->headers->set('Content-Length', $length);\n }\n return $response;\n }, Application::LATE_EVENT);\n }", "public function getResponse()\n\t{\n\t\t$outGoingResponse = $this->response;\n\t\t$request = $this->request;\n\n\t\t$headers = $outGoingResponse->getHeaders();\n\t\t$status_code = (isset($headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS])) ? $headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS] : 200;\n\t\tunset($headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS]);\n\n\t\t$response = new Response(trim($outGoingResponse->getStream()), $status_code, array_filter($headers));\n\t\t$response->prepare($request->getRequest());\n\n\t\treturn $response;\n\t}", "function getresponse()\n {\n if ($this->response) return $this->response;\n $query_string = http_build_query($this->params);\n if ($this->method == \"GET\")\n {\n $path .= '?' . $query_string;\n }\n // set default headers\n $headers = $this->headers;\n if (empty($headers['User-Agent'])) $headers['User-Agent'] = 'php-httplib/1.0 (PHP ' . phpversion() . ')';\n if (empty($headers['Content-Type'])) $headers['Content-Type'] = 'application/x-www-form-urlencoded';\n if ($this->method == 'POST') $headers['Content-Length'] = strlen($query_string);\n $headers['Host'] = $this->host;\n // build the header string\n $request_header = strtoupper($this->method) . \" \" . $this->path . \" HTTP/1.1\\r\\n\";\n foreach ($headers as $key=>&$value)\n {\n $request_header .= $key . \": \" . $value . \"\\r\\n\";\n }\n $request_header .= \"Connection: close\\r\\n\\r\\n\";\n \n if ($this->method == \"POST\")\n {\n $request_header .= $query_string;\n }\n fwrite($this->socket, $request_header);\n $response_header = '';\n do\n {\n $response_header .= fread($this->socket, 1);\n }\n while (!preg_match('/\\\\r\\\\n\\\\r\\\\n$/', $response_header));\n $this->response = new HTTPResponse($this->socket, $response_header);\n return $this->response;\n }", "public function getResponseBody()\n\t{\n\t\treturn $this->_responseBody;\n\t}", "private final function getLength() {\n\t\t\treturn $this->length;\n\t\t}", "public function getSize()\n {\n return $this->length;\n }", "function lengthRequired() {\n header('HTTP/1.0 411 Length Required');\n }", "private function getResponse() {\n $this->response['status_code'] = $this->status->getStatusCode();\n $this->response['reason_phrase'] = $this->status->getReasonPhrase();\n \n $this->readHeaders();\n }", "function echo_ok()\n{\n\t\n\tob_start();\n\techo 'ok';\n\t$length = ob_get_length();\n\theader('Connection: close');\n\theader(\"Content-Length: \" . $length);\n\theader(\"Content-Encoding: none\");\n\theader(\"Accept-Ranges: bytes\");\n\tob_end_flush();\n\tob_flush();\n\tflush();\n\t//fastcgi_finish_request();\n}", "function curl_get_file_size( $url ) {\n // Assume failure.\n $result = -1;\n $curl = curl_init( $url );\n\n // Issue a HEAD request and follow any redirects.\n curl_setopt( $curl, CURLOPT_NOBODY, true );\n curl_setopt( $curl, CURLOPT_HEADER, true );\n curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $curl, CURLOPT_FOLLOWLOCATION, true );\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $data = curl_exec( $curl );\n curl_close( $curl );\n\n if( $data ) {\n $content_length = \"unknown\";\n $status = \"unknown\";\n\n if( preg_match( \"/^HTTP\\/1\\.[01] (\\d\\d\\d)/\", $data, $matches ) ) {\n $status = (int)$matches[1];\n }\n\n if( preg_match( \"/Content-Length: (\\d+)/\", $data, $matches ) ) {\n $content_length = (int)$matches[1];\n }\n\n // http://en.wikipedia.org/wiki/List_of_HTTP_status_codes\n if( $status == 200 || ($status > 300 && $status <= 308) ) {\n $result = $content_length;\n }\n }\n\n return $result;\n}", "public function getResponseContent()\n {\n return $this->responseContent;\n }", "function send(ResponseInterface $response)\n{\n $heading = sprintf('HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase());\n\n if (!headers_sent()) {\n header($heading, true, 200);\n\n foreach ($response->getHeaders() as $key => $header) {\n foreach ($header as $value) {\n header($key.':'.$value);\n }\n }\n }\n\n $stream = $response->getBody();\n\n if ($stream->isWritable()) {\n $stream->rewind();\n }\n\n while (!$stream->eof()) {\n echo $stream->read(1024 * 8);\n }\n}", "function getSize(): int {\n return \\strlen($this->buffer);\n }", "public function writeTo($stream) {\n\t\t// have we written the request size yet?\n\t\t$written = $this->writeRequestSize($stream);\n\t\t\n\t\t// try to write the actual buffer itself\n\t\tif ($this->sizeWritten && !feof($this->buffer)) {\n\t\t\t//TODO: check that fread returns something\n\t\t\t$written += fwrite($stream, fread($this->buffer, 8192));\n\t\t}\n\t\t// if we are done, mark it off\n\t\tif (feof($this->buffer)) {\n\t\t\t$this->complete = true;\n\t\t\tfclose($this->buffer);\n\t\t}\n\t\treturn $written;\n\t}", "public function getResponseBody()\r\n\t{\r\n\t\treturn $this->body;\r\n\t}", "public function getLength() {}", "public function getLength() {}", "public function getLength() {}", "public function getLength() {}", "public function getBytesRead(): int\n {\n return $this->content->bytesRead();\n }", "public function content() {\n try {\n $r= '';\n while ($this->stream->available()) {\n $r.= $this->stream->read();\n }\n return $r;\n } finally {\n $this->stream->close();\n }\n }", "public function length()\n {\n return strlen($this->buffer);\n }", "public function getBody()\n {\n return $this->response;\n }", "function contentSize($buffer, $mode){\n global $PREVENT_CSIZE_HEADER;\n if(!$PREVENT_CSIZE_HEADER) header('Content-Length: ' . ob_get_length());\n return false;\n}", "public function read()\n {\n $this->response = $this->transport->read();\n return $this->response;\n }", "function getLength ()\n\t{\n\t\treturn $this->_len ; \n\t}", "public function getResponseBody()\n\t{\n\t\treturn isset($this->_response['body']) ? $this->_response['body'] : '';\n\t}", "public function getResponse()\n {\n return new StreamedResponse(\n [$this, 'streamCallback'],\n Response::HTTP_OK,\n [\n 'Content-Type' => 'text/event-stream',\n 'Access-Control-Allow-Origin' => '*',\n 'Cache-Control' => 'no-cache',\n 'X-Accel-Buffering' => 'no',\n ]\n );\n }", "public function getSize()\n {\n $size = null;\n\n if ($this->stream) {\n $stats = fstat($this->stream);\n $size = $stats['size'];\n }\n\n return $size;\n }", "private function fetchContents()\n {\n return $this->response->getBody()->getContents();\n }" ]
[ "0.6586103", "0.6537876", "0.64760494", "0.6271659", "0.62327397", "0.6225083", "0.6205151", "0.61919105", "0.60390973", "0.6015385", "0.60052824", "0.59714776", "0.5868513", "0.5849501", "0.5835116", "0.577322", "0.5765429", "0.5754051", "0.5730395", "0.5684209", "0.56434035", "0.56403744", "0.56300336", "0.5600599", "0.5587728", "0.5545474", "0.5514706", "0.55069447", "0.5502784", "0.54995316", "0.5490234", "0.5489104", "0.5484291", "0.548007", "0.54739404", "0.5470548", "0.54671407", "0.54610497", "0.54570115", "0.54545414", "0.5449494", "0.54449546", "0.5443942", "0.54370433", "0.5425571", "0.542363", "0.542095", "0.54131997", "0.539649", "0.5393764", "0.5390892", "0.5390703", "0.5390703", "0.5390703", "0.5390703", "0.5390703", "0.5384312", "0.5384312", "0.5384312", "0.5357069", "0.53502125", "0.53500026", "0.53410614", "0.5334264", "0.533346", "0.5325873", "0.5314918", "0.5306372", "0.5301836", "0.5297545", "0.52882487", "0.52870846", "0.5286802", "0.528517", "0.52833235", "0.52809143", "0.5278608", "0.5278098", "0.52657", "0.5265659", "0.52642924", "0.52614224", "0.5254537", "0.5253995", "0.5244846", "0.5239357", "0.5238093", "0.5238093", "0.5238093", "0.5238028", "0.5234662", "0.5233185", "0.5230345", "0.52135235", "0.5210852", "0.52029616", "0.5202364", "0.52022207", "0.5190928", "0.5189663" ]
0.67875105
0
Set the results from a response
private function setResult($res) { $this->result = $res; $this->statusCode = $this->result['FbiMsgsRs']['@attributes']['statusCode']; //$this->statusMsg = $this->result['FbiMsgsRs']['@attributes']['statusMessage']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function setresults();", "function setResults ($result) {\n\t\t$this->_results = $result;\n\t}", "public function setResults($results){\n $this->results = $results;\n }", "final protected function setResults(array $results)\n {\n $this->results = $results;\n }", "public function setResponse() {\n }", "public function setResult($result)\n\t{\n\t\t$this->result = $result;\n\t}", "protected function _handleResponse(){\n $this->_results[] = array(\n 'http_code' => $this->getInfoHTTPCode(),\n 'response' => $this->getResponse(),\n 'server' => $this->getUrl()\n );\n }", "public function setResponse(Response $response) {}", "public function setResults(array $results = array()) {\n $this->results = $results;\n }", "protected function setResult($value)\n {\n $this->result = $value;\n }", "public function setResponse( $response ){\n \n $this->response = $response;\n \n }", "public function setResponse($response)\n\t{\n\t\t$this->response = $response;\n\t}", "protected function set_result($result) {\r\n\t\t$this->result = $result;\r\n\t}", "public function set_result($result) {\n\t\t$this->_result = \"$result\";\n\t}", "private function setResult($result) {\n // possible http code errors\n if (intval($this->getHttpCode()) > 299) {\n $this->setError(\"HTTP CODE: \" . $this->getHttpCode());\n $result_decoded = false;\n }\n\n $result_decoded = json_decode($result, true);\n\n // bad json query or authentication fail\n if ($result_decoded === null and is_string($result)) {\n $this->setError($result);\n $result_decoded = false;\n }\n\n // curl error\n if ($result === null or $result === false) {\n $this->setError(curl_error($this->curl));\n }\n \n // error on the query\n if (isset($result_decoded['Error'])) {\n $this->setError($result_decoded['text']);\n $result_decoded = false;\n }\n\n $this->result = $result_decoded;\n }", "public function setResponse(array $response)\n {\n $this->response = $response;\n }", "public function setResult($result = null) {\r\n $this->_result = $result;\r\n }", "public function setResponse(Response $response): void;", "public function __construct($response)\n {\n $this->transformResultData($response->results);\n\n }", "public function setResponse(Response $response)\n\t{\n\t\t$this->_output = $output = new Output;\n\t\t$response->setBodyGenerator(function() use($output)\n\t\t{\n\t\t\t$output->sendBody();\n\t\t});\n\t}", "private function setResponse($response)\n {\n if (!is_array($response) && !is_object($response)) {\n\n $this->response = json_decode((string) $response, true);\n }\n }", "protected function bindResponse()\r\n {\r\n $responseArray = explode( '&', $this->responseString );\r\n \r\n foreach ( $responseArray as $value ){\r\n $pair = explode( '=', $value );\r\n $this->$pair[0] = $pair[1];\r\n }\r\n }", "public function setResponse(Response $response) {\n $this->_response = $response;\n $this->_isHandled = true;\n }", "public function setAllResults($all_results)\n {\n # Set the variable.\n $this->all_results = $all_results;\n }", "public function setResponse(Response $response)\n {\n $this->_response = $response;\n }", "public function setResponse(Response $response) {\n $this->response = $response;\n }", "public function setResponse(namespace\\Response $response)\n {\n $this->response = $response;\n }", "public function setResponse(Response $response)\n {\n $this->response = $response;\n }", "public function setResponse(Response $response)\n {\n $this->response = $response;\n }", "protected function setDataResults()\n {\n $this->setQueryResultsArray();\n $this->setParametersFromToken();\n\n return $this;\n }", "public function setResult(string $result): void\n {\n $this->result = $result;\n }", "private function resetResults() {\n $this->results = array();\n }", "private function setNumResults()\n\t{\n\t\t$this->numResults = (int) count($this->data);\n\t}", "function setResult($function, $result)\n {\n $this->m_results[$function] = $result;\n }", "function updateResponse($name, $value) {\n\t\t\t$this->responseVar[$name] = $value;\n\t\t}", "public function setResults(array $input)\n {\n $this->results = $input;\n return $this;\n }", "public function prepareResponse();", "protected function setResult(string $result)\n {\n $this->result = $result;\n }", "private function setResponseObject($aResponse)\n {\n $this->aRepsonse = (array)$aResponse;\n }", "public function prepare_response_for_collection($response)\n {\n }", "public function setPageResults($results,$resultsCount) {\n $this->calculatePageCount($resultsCount);\n $this->pageResults = $results;\n }", "private function _loadResponse()\n {\n $sroObjects = Mage::getModel('pedroteixeira_correios/sro_object_collection');\n $trackList = $this->getRequestCollection();\n $response = $this->getResponse();\n \n if (isset($response->return) && $response->return->qtd > 0) {\n foreach ((array)$response->return->objeto as $obj) {\n $track = $trackList->getItemByColumnValue('number', $obj->numero);\n if ($track) {\n $item = Mage::getModel('pedroteixeira_correios/sro_object');\n $item->setTrack($track)\n ->setInfo($obj);\n $sroObjects->addItem($item);\n } else {\n Mage::log(\"Cant locate track for {$obj->numero}\");\n }\n }\n }\n \n $this->setLog(\"{$sroObjects->count()} identified of {$this->getLog()}\");\n \n return $this->setResponseCollection($sroObjects);\n }", "protected function setResult(Result $result): void\n {\n $this->result = $result;\n }", "public function getResponse($response) {\r\n\r\n\r\n }", "function setResultSet(/* SQL ResultSet */$rs){\n\t\t$this->main_rs = $rs;\n\t}", "public function setResultByRequest($number) \n { \n //if number is actually 0 \n if ($number == 0) {\n $this->duplicatedNumber = $number;\n return;\n }\n \n $number = intval($number);\n //If intval failed it will return 0 (in case of non numeric)\n if ($number == 0) {\n $this->duplicatedNumber = $number;\n return;\n }\n\n if($this->result !== null) {\n return;\n }\n if (!$this->integrityCheck($number)) {\n return;\n } \n if ($this->duplicationCheck($number) !== null) {\n $this->duplicatedNumber = $number;\n return;\n } \n \n //Every result setted should trigerred $this->updateParents(), but in the case of the result set by the user\n //We don't want the algorithm to find a solution by logical before all result given by the user are setted\n //Otherwise some result would be display in green while it has been sent from the user.\n $this->setFinalResult($number);\n $this->isResultSettedByUser = true;\n }", "public function setResults($ip, $results)\n {\n $this->voiceService->postLog('Got results from '.$ip);\n // look up the server by ip\n $server = Server::where('ip', $ip)->first();\n\n if (!$server) {\n $this->voiceService->postLog('Could not find server by '.$ip);\n throw new \\Exception('Could not find server by IP');\n }\n\n // get the race that's running on that server\n $race = Race::find($server->race_id);\n\n if (!$race) {\n $this->voiceService->postLog('Could not find race on server '.$server->id.' ('.$ip.')');\n throw new \\Exception('Could not find race by server IP');\n }\n\n // apply the results to that race\n $this->saveResults($results, $race);\n\n // mark the race as complete, do whatever is needed\n $this->completeRace($race);\n\n return $race;\n }", "public function setData() \n {\n $serverNames = [];\n foreach($this->_jsonRequestedArr as $k=>$obj) {\n $serverNames[] = $obj->s_system;\n }\n $this->_jsonResponseArr[\"server_list\"] = $serverNames;\n }", "public function setResponse($response)\n {\n $this->_response = $response;\n return $this;\n }", "public function set_result($name,$data){\n\t\t\n\t\t$this->key=$name;\n\t\t$this->value=$data;\n\t}", "public function setResponse($response)\r\n {\r\n $this->response = $response;\r\n\r\n return $this;\r\n }", "public function set_response($response) : self\n {\n if (!isset($this->reponse)) {\n $this->response = $response;\n }\n return $this;\n }", "public function popolate_full_response($response){\n\t\t\n\t\tif(!is_array($response)){\n\t\t\t$response = json_decode(json_encode($response), true);\n\t\t}\n\t\t\n\t\tif(!is_array($response)){\n\t\t\tthrow new \\Exception(\"\\$response type must be iterable\");\n\t\t}\n\t\t\n\t\tforeach($response as $key => $value){\n\t\t\t\n\t\t\tif(!property_exists(self::class, $key)){\n\t\t\t\t$this->{$key} = $value;\n\t\t\t}\n\t\t}\n\t}", "public function populate(stdClass $response);", "public function setResultList($resultList);", "public function setResponse($response)\n {\n $this->response = $response;\n return $this;\n }", "public function getResults(){\n $this->results;\n }", "public function setResult(int $result)\n {\n $this->result = $result;\n }", "public function setResult($result)\n\t{\n\t\t$this->result = $result;\n\t\tunset($this->error);\n\t\treturn $this;\n\t}", "protected function setResponse(Response $value)\n {\n $this->response = $value;\n }", "private function parseResult(Response $response): void\n {\n $json = json_decode($response->getBody());\n\n if (isset($json->errorMessage)) {\n $this->result->status = 'ERROR';\n $this->result->errors[] = $json->errorMessage;\n return;\n }\n\n $this->result->status = 'OK';\n\n if (isset($this->result->errors)) {\n unset($this->result->errors);\n }\n\n foreach ($json->conhecimentos as $key => $billOfLading) {\n $this->result->billsOfLading[$key] = new \\stdClass();\n $this->result->billsOfLading[$key]->status = 'OK';\n $this->result->billsOfLading[$key]->originClient = $billOfLading->nomeClienteOrigem;\n $this->result->billsOfLading[$key]->originCity = $billOfLading->municipioOrigem;\n $this->result->billsOfLading[$key]->originState = $billOfLading->ufOrigem;\n $this->result->billsOfLading[$key]->destinyClient = $billOfLading->nomeClienteDestino;\n $this->result->billsOfLading[$key]->destinyCity = $billOfLading->municipioDestino;\n $this->result->billsOfLading[$key]->destinyState = $billOfLading->ufDestino;\n $this->result->billsOfLading[$key]->invoiceNumber = $billOfLading->numeroNotaFiscal;\n $this->result->billsOfLading[$key]->eBillOfLadingNumber = $billOfLading->conhecimentoTransporteEletronico;\n $this->result->billsOfLading[$key]->deliveryForecast = (\\DateTime::createFromFormat('d/m/y', $billOfLading->dataPrevisaoEntrega))->format('d/m/Y');\n $this->result->billsOfLading[$key]->shippingCost = $billOfLading->valorFrete;\n $this->result->billsOfLading[$key]->deliveryReceiptLink = $billOfLading->linkImagemComprovanteEntrega;\n\n $this->result->billsOfLading[$key]->events = $this->parseTrackingEvents($billOfLading->historico);\n }\n\n }", "public function setResponseObject($obj)\n {\n $this->responseObject = $obj;\n }", "public function setResponseObject($obj)\n {\n $this->responseObject = $obj;\n }", "public function setResponseObject($obj)\n {\n $this->responseObject = $obj;\n }", "public function setPaymentExecutionResult($response, $request) {\n $this->paymentExecutionResult = $response;\n }", "public function setResponses(?array $responses): void\n {\n $this->responses = $responses;\n }", "public function modify_api_response( $results ) {\n\n\t\t// Sanity check.\n\t\tif ( ! is_object( $results ) || ! $this->should_update() ) {\n\t\t\treturn $results;\n\t\t}\n\n\t\t// Make sure the translations property is defined in the object.\n\t\tif ( ! isset( $results->translations ) || ! is_array( $results->translations ) ) {\n\t\t\t$results->translations = [];\n\t\t}\n\n\t\t// Set the translations from our custom API.\n\t\t$results->translations[] = [\n\t\t\t'type' => $this->type,\n\t\t\t'slug' => $this->slug,\n\t\t\t'language' => $this->lang,\n\t\t\t'version' => $this->ver,\n\t\t\t'updated' => $this->get_updated(),\n\t\t\t'package' => $this->get_package(),\n\t\t\t'autoupdate' => true,\n\t\t];\n\t\treturn $results;\n\t}", "protected abstract function prepareResponse(stubResponse $response);", "public function setHttpResponse($httpResponse);", "public function Response($response) {\n\t\t\n\t}", "public function __construct($responses)\n {\n foreach ($responses as $response) {\n $this->responses[] = [\n 'field' => $response->field,\n 'type' => $response->type,\n 'value' => $response->response\n ];\n }\n }", "private function setResponse($key, $value)\n {\n $this->response[$key] = $value;\n }", "public function setResult(?array $result): self\n {\n $this->result = $result;\n \n return $this;\n }", "public function setData( ) {\r\n\t\t\tself::callEvent('response.setData', $this, func_get_args());\r\n\t\t}", "private function set_response_rows($result) { \n $rows = [];\n foreach ($result as $r) {\n $cell = [];\n foreach ($r as $column => $value) {\n $cell[] = call_user_func($this->format, $column, $value, $r);\n }\n\n $rows[] = [\n 'id' => $r->id,\n 'cell' => $cell\n ];\n }\n return $rows;\n }", "private function processOptions()\r\n {\r\n $this->response = new Response(null, 200);\r\n }", "private function _setResults( $extended = TRUE )\n {\n $this->results = [ ];\n $this->results[ 'file_count' ] = count( $this->fileHandles );\n $this->results[ 'dir_count' ] = count( $this->dirHandles );\n $this->results[ 'link_count' ] = count( $this->linkHandles );\n\n if ( $extended )\n {\n $this->results[ 'files' ] = $this->fileHandles;\n $this->results[ 'dirs' ] = $this->dirHandles;\n $this->results[ 'links' ] = $this->linkHandles;\n }\n }", "public function setResponse( Response $response )\n {\n $this->response = $response;\n \n # Return object to preserve method-chaining:\n return $this;\n }", "public function setResponse(Response $response)\n {\n $this->response = $response;\n \n $this->stopPropagation();\n }", "private function _setReponseArray() {\n try {\n $this->RESP = array(\n 'MSG' => $this->MSG,\n 'STATUS' => $this->STATUS\n );\n } catch (Exception $ex) {\n throw new Exception('Crud Model : Error in _setReponseArray function - ' . $ex);\n }\n }", "public function set_response($response_data)\n\t{\n\t\t$this->response = (is_array($response_data))\n\t\t\t? $this->array2json($response_data)\n\t\t\t: $response_data;\n\t}", "public function setResponse(Response $response)\n\t{\n\t\t$this->response = $response;\n\t\treturn $this;\n\t}", "public function setResponse(Response $response)\n\t{\n\t\t$this->response = $response;\n\t\treturn $this;\n\t}", "abstract public function processResponse($response);", "private function getResult(): void\n {\n $matches = $this->getNeedlesResult();\n foreach ($matches as $n_key => $match) {\n if (isset($match['matching_filters'])) {\n $match_count = count($match['matching_filters']);\n if ($match_count === 1) { // Save Matches\n $match = $this->getReturnValues($match);\n $match = $this->getLayerData($match);\n unset($match['matching_filters']);\n $this->SearchResult->matches[$n_key] = $match;\n continue;\n } elseif ($match_count > 1) { // Save Indecisive\n $result = [];\n $matching_filters = $match['matching_filters'];\n unset($match['matching_filters']);\n foreach ($matching_filters as $filter) {\n $result[] = $this->getReturnValues($match, $filter['filter_id']);\n }\n $match[$this->config->prefix . 'matching_filters'] = $result;\n $this->SearchResult->indecisive_matches[$n_key] = $match;\n continue;\n }\n }\n // Save no matches\n $this->SearchResult->no_matches[$n_key] = $match;\n }\n }", "protected function _response() {}", "public function setResponse($response)\n {\n $this->response = $response;\n\n return $this;\n }", "public function setResponse($response)\n {\n $this->response = $response;\n\n return $this;\n }", "protected function initializeResultArray() {}", "public function setResultXml($xmlResult)\n {\n $this->rawResponse = $xmlResult;\n $this->parseResponseXml();\n }", "public function set_response($response_data)\n\t{\n\t\t$this->response = (is_array($response_data))\n\t\t\t? json_encode($response_data)\n\t\t\t: $response_data;\n\t}", "public function setResponse(array $response)\n\t{\n\t\t$this->response = \\Zend\\Json\\Encoder::encode($response);\n\t\treturn $this;\n\t}", "abstract protected function updateResponse(Model $data);", "public function setResultSource($source) {\n $this->resultSource_ = $source;\n $this->resultSource_->setResultList($this); \n $this->results_ = null;\n }", "abstract public function response();", "public function parseResults($id, array $results);", "function process() {\n\t\t\t$response = $this->response();\n\t\t\t$this->setSuccess($response);\n\t\t\treturn $this->responseVar;\n\t\t}", "function set($name, $value){\n \t $this->result[$name] = $value; \n \t}", "public function reset_response()\n\t{\n\t\t$this->data = array();\n\t\t$this->last_selector = null;\n\t\t$this->merged = array();\n\t\treturn $this;\n\t}", "public function show_results($response, $schema, $operation_name, $request, $variables)\n {\n }" ]
[ "0.775509", "0.76000893", "0.7467166", "0.692865", "0.67400855", "0.66929984", "0.66602606", "0.66506505", "0.6587824", "0.6553314", "0.65466875", "0.64256144", "0.6402162", "0.6320113", "0.6274513", "0.62688404", "0.62407386", "0.6226751", "0.6202416", "0.61636704", "0.6151923", "0.61223435", "0.61165786", "0.609279", "0.6062927", "0.604286", "0.60364705", "0.5974588", "0.5974588", "0.5966801", "0.5946367", "0.5928473", "0.5927466", "0.58836", "0.5883421", "0.58592474", "0.5835523", "0.58302003", "0.582805", "0.5828014", "0.5791664", "0.57855594", "0.5781376", "0.57681036", "0.57433075", "0.5741564", "0.5738805", "0.5735001", "0.5733835", "0.573049", "0.5718832", "0.570907", "0.5699541", "0.56882316", "0.56851643", "0.5675439", "0.56508774", "0.5642052", "0.5637807", "0.5634508", "0.5625519", "0.5606504", "0.5606504", "0.5606504", "0.56055784", "0.5580777", "0.55806893", "0.5576669", "0.55567086", "0.55561733", "0.5554156", "0.5550379", "0.553732", "0.5528755", "0.55149376", "0.5514134", "0.55098623", "0.5509568", "0.550845", "0.5499736", "0.5494295", "0.5492316", "0.5492316", "0.54908955", "0.5482819", "0.5479248", "0.5473", "0.5473", "0.54619", "0.54501045", "0.54398215", "0.5427351", "0.54225165", "0.54224396", "0.53938854", "0.53885335", "0.53840137", "0.53728455", "0.5366048", "0.53632313" ]
0.68013006
4
===== Employee Id =======
public function setEmpId($val){ if(intval($val) > 0){ $this->employeeId = intval($val); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEmployeeId()\n {\n return $this->employee_id;\n }", "public function getEmployeeID()\n {\n return $this->employeeID;\n }", "public function determineId() {}", "private function getEmployeesIDs() {\n return DB::table('dx_users as u')\n ->select('u.id')\n ->whereExists(function ($query) {\n $query->select(DB::raw(1))\n ->from('dx_users_accrual_policies as a')\n ->whereRaw('a.user_id = u.id')\n ->where('a.timeoff_type_id', '=', $this->argument('timeoff_id'))\n ->whereNull('a.end_date');\n })\n ->get();\n }", "public function getEntityId();", "public function getEntityId();", "public function getEntityId();", "public function listId() {\n\t\treturn $this->employee->get()->pluck('id')->all();\n\t}", "abstract public function get_id();", "function get_employee()\n\t\t{\n\t\t\treturn EmployeeFactory::createEmployee($this->empID);\n\t\t}", "public function getEmployeeId($uid=0){\r\n\r\n $retval = 0;\r\n $sql = sprintf(\"SELECT employee_id FROM sim_hr_employee WHERE uid = '%d' \",$uid);\r\n\r\n $rs=$this->xoopsDB->query($sql);\r\n\r\n if($row=$this->xoopsDB->fetchArray($rs)){\r\n $retval = $row['employee_id'];\r\n }\r\n\r\n return $retval;\r\n\r\n }", "public function getEmployee($employee_id) {\n $db = Database::getDB();\n $query = 'SELECT * FROM planners\n WHERE employeeID = :employee_id'; \n $statement = $db->prepare($query);\n $statement->bindValue(':employee_id', $employee_id);\n $statement->execute(); \n $row = $statement->fetch();\n $statement->closeCursor(); \n $employee = new Employee($row['employeeID'],$row['fname']);\n //echo $employee->getID();\n return $employee;\n }", "public function getUser(string $employeeId);", "abstract function getId();", "public function obtenerId() {}", "public function getEntityId(){\n return $this->_getData(self::ENTITY_ID);\n }", "abstract public function objId();", "public function getAccessibleEmployeeId($user = null, $self = 0) {\n\t\treturn $this->getAccessibleEmployee($user, $self)->get()->pluck('id')->all();\n\t}", "function setEmployeeID($employeeid) {\n $this->employeeid = $employeeid;\n }", "public static function getEmployerId($user_id){\n $employer = Employer::where('user_id',$user_id)->first();\n return $employer->id;\n}", "public function getEntityId() {\n return $this->entityId;\n }", "abstract public function getId();", "function getEntityId() {\n return $this->entity_id;\n }", "public function GetId () ;", "public function get_id();", "public function get_id();", "public function getEmployCompanyId() {\n\t\treturn ($this->employCompanyId);\n\t}", "abstract public function getId();", "abstract public function getId();", "abstract public function getId();", "public function getID();", "public function getID();", "public function getID();", "public function getEntityId()\n {\n return $this->entity_id;\n }", "public function getId() {}", "public function getId() {}", "public function get_id()\n {\n }", "public function getId() ;", "public function get_entity_id(){\n return $this->entityId;\n }", "public function getEntityId() {\n\n\t\treturn $this->id;\n\n\t}", "private function check_employee_id($id) {\n\t\t$query = \"SELECT employee_id FROM users WHERE id='$id'\";\n\t\t$check_database = mysqli_query($this->con, $query);\n\t\t$result = mysqli_fetch_assoc($check_database);\n\n\t\treturn $result['employee_id']; \n\t}", "function getId();", "public function getEmployee()\n {\n return $this->hasOne(Employees::className(), ['ID' => 'EmployeeID']);\n }", "public function read($employeeId)\n {\n }", "public function getEid() {\n return $this->eid;\n }", "public function getEntryId();", "public abstract function getIdentity();", "public function getEntityId(): ?int;", "public function getEntityId(): ?int;", "public function getID(): string;", "private function getEntityId()\n\t{\n\t\t$id = $this->GetDocumentId();\n\t\t$pairs = explode('_', $id[2]);\n\n\t\treturn count($pairs) > 1 ? $pairs[1] : $pairs[0];\n\t}", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "function getEmployeeManagerID($db, $strIDEmployee = \"\", $strEmployeeID = \"\")\n{\n $intResult = -1;\n if ($strIDEmployee === \"\" && $strEmployeeID === \"\") {\n return $intResult;\n }\n // cari data karyawan\n $strSQL = \"SELECT id, position_code, section_code, department_code \";\n $strSQL .= \"FROM hrd_employee WHERE flag=0 \";\n if ($strIDEmployee !== \"\") {\n $strSQL .= \"AND id = '$strIDEmployee' \";\n }\n if ($strEmployeeID !== \"\") {\n $strSQL .= \"AND employee_id = '$strEmployeeID' \";\n }\n $resDb = $db->execute($strSQL);\n if ($rowDb = $db->fetchrow($resDb)) {\n $strDH = getSetting(\"department_head\");\n $strGH = getSetting(\"group_head\");\n if ($rowDb['position_code'] == $strDH) // dept head, dirinya sendiri\n {\n $intResult = $rowDb['id'];\n } else if ($rowDb['position_code'] == $strGH || $rowDb['section_code'] == \"\") {\n // cari dept.head sebagai manager\n $strSQL = \"SELECT id FROM hrd_employee WHERE position_code = '$strDH' \";\n $strSQL .= \"AND department_code = '\" . $rowDb['department_code'] . \"' \";\n $resTmp = $db->execute($strSQL);\n if ($rowTmp = $db->fetchrow($resTmp)) {\n $intResult = $rowTmp['id'];\n }\n } else { // employee biasa, cari data group headnya\n // cari dept.head sebagai manager\n $strSQL = \"SELECT id FROM hrd_employee WHERE position_code = '$strGH' \";\n $strSQL .= \"AND section_code = '\" . $rowDb['section_code'] . \"' \";\n $resTmp = $db->execute($strSQL);\n if ($rowTmp = $db->fetchrow($resTmp)) {\n $intResult = $rowTmp['id'];\n }\n }\n }\n return $intResult;\n}", "public function obtenerID();", "public function getIdentity();", "public function getExpedienteId() {\n return $this->expedienteId;\n }", "public function getId(): int;", "public function getID() : string;", "public function getAnonymousId();", "public function employee()\n {\n return $this->belongsTo(User::class, 'employee_id', 'id');\n }", "abstract public function HighId();", "public function getId(): mixed;", "public function getSeniorId($empid, $orgid)\n\t{\n\t\t$id = \"0\";\n\t\t\n\t\t$parentid=$empid;\n\t\tif($parentid!=\"0\" && $parentid!=\"\")\n\t\t{\n\t\t\t\t$sql1 = \"SELECT ReportingTo FROM EmployeeMaster WHERE OrganizationId = ? and Id in ( $parentid ) and DOL='0000-00-00' \";\n\t\t\t\t\n\t\t\t\t$query1 = $this->db->query($sql1,array($orgid));\n\t\t\t\t/* $query1->execute(array($orgid)); */\n\t\t\t\t$parentid=\"\";\n\t\t\t\tforeach($query1->result() as $row1)\n\t\t\t\t{\n\t\t\t\t$id = $row1->ReportingTo;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t}\n\t\t\treturn $id;\n\t}", "public function getEmployeeInfo() {\n\n $employeeModel = $GLOBALS[\"employeeModel\"];\n\n $GLOBALS[\"employee\"] = $employeeModel->getOneByEmployeeID($_SESSION[\"workerID\"]);\n }", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();" ]
[ "0.82639277", "0.79021835", "0.68641347", "0.6795072", "0.6769959", "0.6769959", "0.6769959", "0.67374957", "0.66256416", "0.662104", "0.6600593", "0.65612024", "0.65418285", "0.6505947", "0.6477745", "0.6475243", "0.64396244", "0.6430536", "0.6430157", "0.6425504", "0.64020956", "0.63924456", "0.63836926", "0.6377368", "0.6360745", "0.6360745", "0.6351479", "0.6342246", "0.6342246", "0.6342246", "0.6305434", "0.6305434", "0.6305434", "0.629873", "0.62961173", "0.62961173", "0.6287721", "0.62538284", "0.62243724", "0.62223524", "0.6210796", "0.61591285", "0.61573374", "0.6156508", "0.61466473", "0.6130196", "0.61234796", "0.61229205", "0.61229205", "0.6106729", "0.60757965", "0.60687435", "0.60687435", "0.60687435", "0.60687435", "0.60687435", "0.60687435", "0.60687435", "0.60687435", "0.60687435", "0.6068022", "0.60542953", "0.6053554", "0.6044569", "0.60390294", "0.6035498", "0.60260695", "0.6023221", "0.6019417", "0.60143405", "0.6008775", "0.6007176", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064", "0.6002064" ]
0.67394257
7
===== Employee Name =======
public function setEmpName($val){ if(trim($val) != ''){ $this->employeeName = trim($val); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEmployeeName()\r\n {\r\n return $this->deleted ? $this->old_username : $this->username;\r\n }", "public function getNameE()\n {\n return $this->name_e;\n }", "abstract public function get_name();", "abstract public function get_name();", "abstract public function get_name();", "public function get_name()\n {\n // TODO: Implement get_name() method.\n }", "public function name() {\r\n $name = $this->first_name . ' ' . $this->last_name;\r\n return $name;\r\n }", "public function get_name();", "public function get_name();", "public function get_name();", "public function get_name()\n {\n }", "public function get_name()\n {\n }", "protected function getInviteeName()\n {\n return $this->invitee->fullName();\n }", "protected function _getRealName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getEmpName($eid,$f=\"LFM\",$abM=true){\n\t\tif($Personal=$this->MySQLi->GetArray(\"SELECT CONCAT_WS(', ',`tblemppersonalinfo`.`EmpLName`, CONCAT_WS(' ',`tblemppersonalinfo`.`EmpFName`, CONCAT_WS('.', SUBSTRING(`tblemppersonalinfo`.`EmpMName`, 1, 1), ''))) AS EmpName FROM `tblemppersonalinfo` WHERE `tblemppersonalinfo`.`EmpID`='\".$eid.\"';\")){\n\t\treturn $Personal['EmpName'];}else{return \"$eid NOT EXIST.\";}\n\t}", "public function name()\n {\n return $this->first_name .' ' .$this->last_name;\n }", "public function getName()\n {\n return $this->firstname.' '.$this->lastname;\n }", "function getName() ;", "function getName() ;", "function getName() ;", "function getName() ;", "public function get_name() {\r\n\t\treturn '';\r\n\t}", "Public Function getUserName()\n\t{\n\t\treturn $this->firstName . ' ' . $this->lastName;\n\t}", "abstract function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "public function getName()\n {\n $result = null;\n if (isset($this->userInfo['first_name']) && isset($this->userInfo['last_name'])) {\n $result = $this->userInfo['first_name'] . ' ' . $this->userInfo['last_name'];\n } elseif (isset($this->userInfo['first_name']) && !isset($this->userInfo['last_name'])) {\n $result = $this->userInfo['first_name'];\n } elseif (!isset($this->userInfo['first_name']) && isset($this->userInfo['last_name'])) {\n $result = $this->userInfo['last_name'];\n }\n return $result;\n }", "public function getDisplayName() {}", "public function getName() {\n\t\tif($this->_name)\n\t\t\treturn $this->_name;\n\t\tif ($this->first_name != '')\n\t\t\treturn $this->first_name . ($this->last_name ? ' ' . $this->last_name : '');\n\t\telse\n\t\t\treturn $this->username ? $this->username : $this->email;\n\t}", "public function getName(): string\n {\n return $this->firstName . \" \" . $this->lastName;\n }", "public static function get_name() : string ;", "public static function get_name() : string ;", "public function getHumanName();", "public function getNameAttribute()\n {\n if ($this->firstname && $this->lastname)\n return $this->firstname . ' ' . $this->lastname;\n else\n return $this->email;\n }", "public function name()\n\t{\n\t\treturn nl2br(strtoupper($this->name));\n\t}", "abstract protected function getName();", "abstract protected function getName();", "public function feide_name() {\n\t\t\tif(isset($this->attributes['displayName'][0])) {\n\t\t\t\t$this->feide_name = $this->attributes['displayName'][0];\n\t\t\t\t// echo \"displayName set!!!\";\n\t\t\t} else if(isset($this->attributes['givenName'][0]) && isset($this->attributes['sn'][0])) {\n\t\t\t\t$this->feide_name = $this->attributes['givenName'][0] . ' ' . $this->attributes['sn'][0];\n\t\t\t\t// echo \"givenName/sn set!!!\";\n\t\t\t} else if(isset($this->attributes['cn'][0])) {\n\t\t\t\t$this->feide_name = $this->attributes['cn'][0];\n\t\t\t\t// echo \"cn set!!!\";\n\t\t\t} // FALLBACK IF NO NAME IS ACCESSIBLE FROM ANY OF THE ABOVE ATTRIBS...\n\t\t\telse {\n\t\t\t\t$this->feide_name = $this->attributes['eduPersonPrincipalName'][0];\n\t\t\t}\n\n\t\t\treturn $this->feide_name;\n\t\t}", "private function get_name()\n\t{\n\t\treturn $this->m_name;\n\t}", "private function get_name()\n\t{\n\t\treturn $this->m_name;\n\t}", "public function publicName()\n {\n if($this->type === 'natural_person') {\n return $this->first_name . ' ' . $this->last_name;\n }\n\n return $this->company_name;\n }", "public function getHonoreeLastName();", "function getEmployeeName($empId) {\n\n // Function to connect to the DB\n $link = connectToDB();\n\n\t//Retrieve the data\n $strSQL = \"SELECT FirstName, LastName FROM FC_Employees where EmployeeID=\" . $empId;\n $result = mysql_query($strSQL) or die(mysql_error());\n if ($result) {\n if (mysql_num_rows($result) > 0) {\n $ors = mysql_fetch_array($result);\n $name = $ors['FirstName'] . \" \" . $ors['LastName'];\n } else {\n $name = \" N/A \";\n }\n }\n mysql_close($link);\n\n return $name;\n}", "public function getName()\n {\n $firstName = $this->getFieldValue(self::FIELD_FIRST_NAME);\n $lastName = $this->getFieldValue(self::FIELD_LAST_NAME);\n // User does not exist.\n if (!$firstName && !$lastName) {\n $name = 'Unknown&nbsp;User';\n } else {\n $name = \"{$firstName} {$lastName}\";\n }\n\n return $name;\n }", "public function GetName()\n {\n static $chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890abcdefghijklmnopqrstuvwxyz\";\n $i = $this->lastname++;\n $name = \"\"; $len = strlen($chars);\n do\n {\n $name .= $chars[$i%$len];\n $i = intval($i/$len);\n }\n while ($i > 0);\n return $name;\n }", "public function getDisplayName();", "public function getName()\n {\n return sprintf('%s %s', $this->getFirstName(), $this->getLastName());\n }", "public function getDisplayName() {\r\n $displayName = $this->fname.' '.$this->lname;\r\n if(strlen($displayName) <= 1) {\r\n $displayName = explode('@',$this->email);\r\n return($displayName[0]);\r\n }\r\n return($displayName);\r\n }", "public function getGivenName ();", "public function get_employee_name()\r\n {\r\n // get the value of department id\r\n $deptid = $this->request->getPostGet('dept_id');\r\n // print_r($deptid);\r\n // get employee name by id\r\n $data = $this->model->get_emp_name($deptid);\r\n // print_r($data);\r\n echo json_encode($data);\r\n }", "public function get_name() : string\n {\n return $this->additional['name'] ?? '';\n }", "public function getName()\n {\n return trim(\"$this->FirstName $this->Surname\");\n }", "public abstract function getName();", "public function name() {\n $a = $this->firstname;\n return $a;\n }", "function getSupervisorLastName() {\n\t\treturn $this->getData('supervisorLastName');\n\t}", "public function getNomEmploye() {\n return $this->nomEmploye;\n }", "public function getNomEmploye() {\n return $this->nomEmploye;\n }", "function getName();", "function getName();", "function getName();", "function getName();", "function getName();", "function getName();", "function getName();", "public function get_name(){\n\t\treturn $this->name;\n\t}", "function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "function name()\r\n {\r\n return htmlspecialchars( $this->Name );\r\n }", "function name()\r\n {\r\n return htmlspecialchars( $this->Name );\r\n }", "function name()\r\n {\r\n return htmlspecialchars( $this->Name );\r\n }", "public function getShipToLastName();", "public function get_name() \n {\n return $this->name;\n }", "public function getUserDisplayName();" ]
[ "0.77697086", "0.7055254", "0.69926053", "0.69926053", "0.69926053", "0.69472253", "0.68847024", "0.68410635", "0.68410635", "0.68410635", "0.6797153", "0.6796199", "0.6780412", "0.6737445", "0.67165726", "0.6663416", "0.66478384", "0.66421294", "0.66421294", "0.66421294", "0.66421294", "0.66374403", "0.6624351", "0.6620546", "0.6617121", "0.6617121", "0.6617121", "0.6617121", "0.6617121", "0.6617121", "0.6617121", "0.6617121", "0.6617121", "0.6617121", "0.6617121", "0.66025805", "0.65918994", "0.6582798", "0.6579651", "0.65769964", "0.65769964", "0.65475386", "0.65474224", "0.6541221", "0.6530022", "0.6530022", "0.65194553", "0.6518266", "0.6518266", "0.6505476", "0.64917827", "0.6490756", "0.64863694", "0.6470649", "0.6467928", "0.646002", "0.64575005", "0.6455344", "0.64472276", "0.64429206", "0.64396137", "0.6439591", "0.64327586", "0.6422651", "0.6411383", "0.6411383", "0.6409232", "0.6409232", "0.6409232", "0.6409232", "0.6409232", "0.6409232", "0.6409232", "0.6408845", "0.6399003", "0.6390757", "0.6390757", "0.6390757", "0.63897014", "0.63897014", "0.63891333", "0.63891333", "0.63891333", "0.63891333", "0.63891333", "0.63891333", "0.63891333", "0.63891333", "0.63891333", "0.63891333", "0.63891333", "0.63891333", "0.63891333", "0.63891333", "0.63891333", "0.6380469", "0.6380469", "0.6380469", "0.63780534", "0.63759416", "0.63747275" ]
0.0
-1
===== Employee Mobile =======
public function setEmpMobile($val){ if(trim($val) != ''){ $this->employeeMobile = trim($val); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mobile_employee_code($mobile)\n{\n\t$sql=\"select emp_id from employee_master where mobile_no='$mobile'\";\n\t$res = mysql_query($sql);\n\t$rt=mysql_fetch_assoc($res);\n\treturn $rt['emp_id'];\n}", "public function getEmployeeInfo() {\n\n $employeeModel = $GLOBALS[\"employeeModel\"];\n\n $GLOBALS[\"employee\"] = $employeeModel->getOneByEmployeeID($_SESSION[\"workerID\"]);\n }", "public function getMobile();", "function get_employee()\n\t\t{\n\t\t\treturn EmployeeFactory::createEmployee($this->empID);\n\t\t}", "public function isEmployee()\n {\n return (\\Auth::user()->role == 'employee');\n }", "public function personalAction()\r\n\t{ \r\n\t if(defined('EMPTABCONFIGS'))\r\n\t\t{\r\n\t\t $empOrganizationTabs = explode(\",\",EMPTABCONFIGS);\r\n\t\t\tif(in_array('emppersonaldetails',$empOrganizationTabs)){\r\n\t\r\n\t\t\t\t$employeeData =array();$emptyFlag=0;\r\n\t\t\t\t$identityDocumentArr = array();\r\n\t\t\t\t$documentsArr = array();\r\n\t\t\t\t$auth = Zend_Auth::getInstance();\r\n\t\t\t\tif($auth->hasIdentity()){\r\n\t\t\t\t\t\t\t$loginUserId = $auth->getStorage()->read()->id;\r\n\t\t\t\t\t\t\t$loginUserGroup = $auth->getStorage()->read()->group_id;\r\n\t\t\t\t\t\t\t$loginUserRole = $auth->getStorage()->read()->emprole;\r\n\t\t\t\t}\r\n\t\t\t\t$id = $loginUserId;\t$tabName=\"personal\";\r\n\t\t\t\t$employeeModal = new Default_Model_Employee();\r\n\t\t\t\t$empdata = $employeeModal->getsingleEmployeeData($id);\r\n\t\t\t\t\r\n\t\t\t\tif($empdata == 'norows')\r\n\t\t\t\t{\r\n\t\t\t\t $this->view->rowexist = \"norows\";\r\n\t\t\t\t $this->view->empdata = \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(!empty($empdata))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->view->rowexist = \"rows\";\r\n\t\t\t\t\t$usersModel = new Default_Model_Users();\r\n\t\t\t\t\t$emppersonaldetailsform = new Default_Form_emppersonaldetails();\r\n\t\t\t\t\tif($id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$empperdetailsModal = new Default_Model_Emppersonaldetails();\r\n\t\t\t\t\t\t$usersModel = new Default_Model_Users();\r\n\t\t\t\t\t\t$emppersonaldetailsform = new Default_Form_emppersonaldetails();\r\n\t\t\t\t\t\t$identitydocumentsModel = new Default_Model_Identitydocuments();\t\r\n\t\t\t\t\t\t$identityDocumentArr = $identitydocumentsModel->getIdentitydocumnetsrecord();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$genderModel = new Default_Model_Gender();\r\n\t\t\t\t\t\t$maritalstatusmodel = new Default_Model_Maritalstatus();\r\n\t\t\t\t\t\t$nationalitymodel = new Default_Model_Nationality();\r\n\t\t\t\t\t\t$ethniccodemodel = new Default_Model_Ethniccode();\r\n\t\t\t\t\t\t$racecodemodel = new Default_Model_Racecode();\t\r\n\t\t\t\t\t\t$languagemodel = new Default_Model_Language();\r\n\t\t\t\t\t\t$msgarray = array();\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t$genderlistArr = $genderModel->getGenderList();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!empty($genderlistArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ($genderlistArr as $genderlistres){\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->genderid->addMultiOption($genderlistres['id'],$genderlistres['gendername']);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msgarray['genderid'] = 'Gender is not configured yet.';\r\n\t\t\t\t\t\t\t$emptyFlag++;\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$maritalstatuslistArr = $maritalstatusmodel->getMaritalStatusList();\r\n\t\t\t\t\t\tif(!empty($maritalstatuslistArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ($maritalstatuslistArr as $maritalstatuslistres){\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->maritalstatusid->addMultiOption($maritalstatuslistres['id'],$maritalstatuslistres['maritalstatusname']);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msgarray['maritalstatusid'] = 'Marital status is not configured yet.';\r\n\t\t\t\t\t\t\t$emptyFlag++;\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$nationalitylistArr = $nationalitymodel->getNationalityList();\r\n\t\t\t\t\t\tif(!empty($nationalitylistArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ($nationalitylistArr as $nationalitylistres){\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->nationalityid->addMultiOption($nationalitylistres['id'],$nationalitylistres['nationalitycode']);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msgarray['nationalityid'] = 'Nationality is not configured yet.';\r\n\t\t\t\t\t\t\t$emptyFlag++;\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$ethniccodeArr = $ethniccodemodel->gettotalEthnicCodeData();\r\n\t\t\t\t\t\tif(!empty($ethniccodeArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ($ethniccodeArr as $ethniccoderes){\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->ethniccodeid->addMultiOption($ethniccoderes['id'],$ethniccoderes['ethnicname']);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msgarray['ethniccodeid'] = 'Ethnic codes are not configured yet.';\r\n\t\t\t\t\t\t\t$emptyFlag++;\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$racecodeArr = $racecodemodel->gettotalRaceCodeData();\r\n\t\t\t\t\t\tif(!empty($racecodeArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ($racecodeArr as $racecoderes){\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->racecodeid->addMultiOption($racecoderes['id'],$racecoderes['racename']);\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}else\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msgarray['racecodeid'] = 'Race codes are not configured yet.';\r\n\t\t\t\t\t\t\t$emptyFlag++;\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$languageArr = $languagemodel->gettotalLanguageData();\r\n\t\t\t\t\t\tif(!empty($languageArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ($languageArr as $languageres){\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->languageid->addMultiOption($languageres['id'],$languageres['languagename']);\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}else\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msgarray['languageid'] = 'Languages are not configured yet.';\r\n\t\t\t\t\t\t\t$emptyFlag++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!empty($identityDocumentArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->view->identitydocument = $identityDocumentArr;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->view->identitydocument = \"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$data = $empperdetailsModal->getsingleEmpPerDetailsData($id);\r\n\t\t\t\t\t\tif(!empty($data))\r\n\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t$emppersonaldetailsform->populate($data[0]);\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$dob = sapp_Global::change_date($data[0][\"dob\"], 'view');\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->dob->setValue($dob);\r\n\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\tif($data[0]['celebrated_dob'] !='')\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$celebrated_dob = sapp_Global::change_date($data[0][\"celebrated_dob\"], 'view');\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->celebrated_dob->setValue($celebrated_dob);\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 if($data[0]['identity_documents'] !='')\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$documentsArr = get_object_vars(json_decode($data[0]['identity_documents']));\r\n\t\t\t\t\t\t\t\t$documentsArr = sapp_Global::object_to_array($documentsArr);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->setDefault('genderid',$data[0]['genderid']);\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->setDefault('maritalstatusid',$data[0]['maritalstatusid']);\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->setDefault('nationalityid',$data[0]['nationalityid']);\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->setDefault('ethniccodeid',$data[0]['ethniccodeid']);\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->setDefault('racecodeid',$data[0]['racecodeid']);\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->setDefault('languageid',$data[0]['languageid']);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$this->view->form = $emppersonaldetailsform;\r\n\t\t\t\t\t\t$this->view->data = $data;\r\n\t\t\t\t\t\t$this->view->documentsArr = $documentsArr;\r\n\t\t\t\t\t\t$this->view->id = $id;\r\n\t\t\t\t\t\t$this->view->msgarray = $msgarray;\r\n\t\t\t\t\t\t$this->view->employeedata = $empdata[0];\r\n\t\t\t\t\t\t$this->view->emptyFlag=$emptyFlag;\r\n\t\t\t\t\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$emppersonaldetailsform->user_id->setValue($id);\r\n\t\t\t\t\t\t$emppersonaldetailsform->setAttrib('action',BASE_URL.'mydetails/personal');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($this->getRequest()->getPost())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result = $this->savepersonaldetails($emppersonaldetailsform,$loginUserId,$identityDocumentArr);\t\r\n\t\t\t\t\t\t$this->view->msgarray = $result; \r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->view->empdata = $empdata; \r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\telse{\r\n\t\t \t $this->_redirect('error');\r\n\t\t }\r\n }\r\n\t\telse{\r\n\t\t \t$this->_redirect('error');\r\n\t\t }\t\t\t\r\n\t}", "public function update_emp_mobile(){\n\t\t// {\t\t\t\t\n\n\t\t// \t$mmm=$this->input->post('aaa_'.$employee_id);\n\t\t// \t$aaa=$this->input->post('aaa_201613');\n\t\n\n\t\t// \techo \"$employee_id | aaa_$employee_id <br>\";\n\n\t\t// \t// $query=$this->db->query(\"update employee_info set mobile_1='\".$mobile_1.\"',mobile_2='\".$mobile_2.\"',mobile_3='\".$mobile_3.\"',mobile_4='\".$mobile_4.\"', where employee_id='\".$employee_id.\"' \");\n\t\t// }\n\n\t}", "function viewEmployeeDetails( 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$id = $request->emp_id;\n\n\t\t\t\t\t\treturn [ Employee::find( $id )->makeHidden( ['password', 'created_at', 'updated_at'] ), [ 'meta_details' => EmployeeMeta::select( 'address','contact' )->where( 'employee_id' , $id )->get() ] ];\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t}", "public function employee()\n {\n \treturn $this->belongsTo(MasterEmployee::class,'employee_id');\n }", "public function show(Employee $employee)\n {\n \n $employee->phones;\n return $this->showOne($employee);\n }", "public function index()\n {\n\n if (!Gate::denies('employee_access')) {\n $employeeInfo = EmployeeInfo::with('user:id,name,email')->get();\n } elseif (!Gate::denies('branch_employee_access')) {\n $master = Branch::all();\n $empid = array();\n foreach ($master as $value) {\n if (is_array($value['manager']) && in_array(Auth::id(), $value['manager'])) {\n $empid = array_merge($empid, $value['employee']);\n }\n }\n\n $employeeInfo = EmployeeInfo::with('user:id,name,email')->whereIn('emp_id', $empid)->get();\n } else {\n\n abort_if(true, Response::HTTP_FORBIDDEN, '403 Forbidden');\n }\n\n return view('admin.employee.index', compact('employeeInfo'));\n }", "public function actionIndex()\n { \n $mac=get_client_mac(get_client_ip());\n $employeeModel=Employee::findIdentityByMacAddress($mac);\n \n if($employeeModel!=null){\n if ($employeeModel->Active==0){\n print_r (\"InActive Employee.. Contact Admin\");\n return;\n }\n $model = new AttendanceIn();\n date_default_timezone_set('Asia/Calcutta');\n $model=AttendanceIn::findIdentityByUniqueKeys($employeeModel->id,date(\"Y-m-d\"));\n $month_off=MonthOff::find()->select([\"Dates\"])->where(['BranchId'=>$employeeModel->Branch])->andWhere(['Month'=>date('m')])->andWhere(['Year'=>date(\"Y\")])->all();\n if($month_off)\n $month_off=array_map('intval',explode(',',$month_off[0]['Dates'],-1));\n if($model==null){\n $model= new AttendanceIn();\n $model->EmployeeId=$employeeModel->id;\n $model->Date=date(\"Y-m-d\");\n $model->Time=date(\"H:i:s\");\n $timeSlotModel=TimeSlots::findOne(['id'=>$employeeModel->TimeSlot]);\n if(strcmp($model->Time,$timeSlotModel->Grace)<0){\n if(in_array(date('d'), $month_off)){\n if(!$leaveHistory=LeaveHistory::findOne(['EmployeeId'=>$employeeModel->id, 'LeaveType'=>4])){\n $leaveHistory =new LeaveHistory();\n $leaveHistory->id=$employeeModel->id;\n $leaveHistory->Type=4;\n $leaveHistory->LeaveCount=0;\n $leaveHistory->MaxLeave=0.5;\n }\n else{\n $leaveHistory->MaxLeave+=0.5;\n }\n $leaveHistory->save();\n $model->FirstHalf=\"WP\";\n }\n else\n $model->FirstHalf=\"P\";\n \n }\n else if (strcmp($model->Time,$timeSlotModel->Grace)>0 && strcmp($model->Time,$timeSlotModel->DeadOut)<0){\n if($employeeModel->DeadOutCount>=$timeSlotModel->MaxDeadOutCount)\n $model->FirstHalf=\"A\";\n else{\n $employeeModel->DeadOutCount+=1;\n $employeeModel->save();\n $model->Remark=$employeeModel->DeadOutCount.\" Late Count\";\n if(in_array(date('d'), $month_off)){\n if(!$leaveHistory=LeaveHistory::findOne(['EmployeeId'=>$employeeModel->id, 'LeaveType'=>4])){\n $leaveHistory =new LeaveHistory();\n $leaveHistory->id=$employeeModel->id;\n $leaveHistory->Type=4;\n $leaveHistory->LeaveCount=0;\n $leaveHistory->MaxLeave=0.5;\n }\n else{\n $leaveHistory->MaxLeave+=0.5;\n }\n $leaveHistory->save();\n $model->FirstHalf=\"WP\";\n }\n else\n $model->FirstHalf=\"P\";\n }\n }\n else{\n $model->FirstHalf=\"A\";\n }\n if($model->validate() && $model->save()){\n return $this->renderPartial('attendance-in-success', [\n 'employeeModel'=>$employeeModel,\n 'model'=>$model,\n ]);\n }\n else{\n print_r(\"Error Occured\");\n return;\n }\n }\n return AttendanceInController::actionOut();\n\n }\n else{\n print_r(\"<h1><p style='color:red;background-color:pink;border-color:#c3e6cb;'>No Such Device/Employee Registered</p></h1>\");\n return;\n }\n \n }", "public function getCompanyEmployees();", "function getByNameAndPosition($employee){\n //devolver Empleado\n }", "public function index()\n {\n //$employees = employee::where('user_id', Auth::id())->get();\n $employees;\n switch (Auth::user()->branch->type) {\n case '0':\n case '1':\n $employees = null;\n break;\n case '2':\n $employees = employee::where('user_id', Auth::id())->get(); \n break;\n default:\n $employees = employee::all();\n break; \n }\n //return $employees;\n /*$employees = employee::all();*/\n return view('layouts.employee.index', [\n 'employees'=> $employees, \n 'page_title' => 'كل البائعين',\n 'module_name_ar' => 'بائع', \n 'module_name' => 'employee.create'\n ]);\n }", "public function run()\n {\n $employees = [\n ['E1','John', 'Doe', '18 Kepler Road', '#2', 'Natick','MA','01902','5085670909',30,'Male','',''],\n\t\t\t['E2','Jane', 'Doe', '12 Foreest Road', '#1', 'Stoughton','MA','01902','7085670909',45,'Female','',''],\n\t\t\t['E3','Mike', 'Pal', '10 Wellesly Road', '#1', 'Stoughton','MA','01902','7085670909',50,'Male','',''],\n ];\n\t\t\n\t\t$count = count($employees);\n\t\t\n\t\t foreach ($employees as $key => $employeeData) {\n\n\n $employee = new Employee();\n $employee->created_at = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n $employee->updated_at = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n \n\t\t\t$employee->identification = $employeeData[0];\n\t\t\t$employee->first_name = $employeeData[1];\n $employee->last_name = $employeeData[2];\n $employee->address_line_1 = $employeeData[3];\n $employee->address_line_2 = $employeeData[4];\n $employee->city = $employeeData[5];\n $employee->state = $employeeData[6];\n $employee->zip_code = $employeeData[7];\n $employee->telephone_number = $employeeData[8];\n $employee->age = $employeeData[9];\n\t\t\t$employee->sex = $employeeData[10];\n\t\t\t$employee->start_date = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n\t\t\t$employee->end_date = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n\t\t\n $employee->save();\n $count--;\n }\n }", "public function show(employee $employee)\n {\n //\n }", "private function _getEmployeeInfo($emp_seqno) {\n $sql_string = <<<eof\n select id_no_sz as emp_id,\n name_sz as emp_name\n from hr_personnel_base\n where seg_segment_no = :company_id\n and id = :emp_seqno\neof;\n return $this->DBConn->GetRow($sql_string,\n array ('company_id' => $this->companyID, 'emp_seqno' => $emp_seqno));\n }", "public function getAllEmployees();", "public function employee()\n\t{\n\t\treturn $this->belongsTo(User::class,'user_id','id');\n\t}", "static function isEmployee()\n {\n if(!Auth::check())\n return false;\n $user = Auth::User();\n if(stristr($user->type, 'Employee'))\n return true;\n return false;\n }", "function addemployee($empyname,$empymbl,$empemail,$empdesignation)\n\t{\n\t\t$names = array('name' => $empyname ,'mobile' =>$empymbl,'\temail' => $empemail, 'designation' => $empdesignation);\n\t\t$add_query = $this->insert( 'payrentz_employees', $names );\n\t\tif( $add_query )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function userMobile()\n {\n $data = [\n 'title' => \"Pengguna Mobile | SIPENPAS\",\n 'menu_open' => \"Manajemen Pengguna\",\n 'menu_active' => \"Pengguna Mobile\",\n 'breadCrumb' => [\"Manajemen Pengguna\", \"Pengguna Mobile\"]\n ];\n\n return view('pages/manaj-user/mobile/main', $data);\n }", "private function listEmployee()\n\t{\n\t\t$employees = $this->employee->getEmployee();\n\t\t$cnt = 1;\n\t\tforeach($employees as $key => $val)\n\t\t{\n\t\t\t$arr = array('CNT' => $cnt,\n\t\t\t\t\t\t 'EMPLOYEE_NAME' => $val['name_employee'],\n\t\t\t\t\t\t 'EMPLOYEE_ID' => $val['id_employee'],\n\t\t\t\t\t\t 'EMPLOYEE_MAIL' => $val['mail_employee']);\n\t\t\t$cnt ++;\n\t\t\t$this->view->addToReplace($arr);\n\t\t\t$this->arrRender['LISTEMPLOYEES'] .= $this->view->\n\t\t\tsetTemplateFile('employeeslist')->renderFile();\n\t\t}\n\t}", "public function indexAction() {\r\n try {\r\n $pageHeading = \"Staff-Management\";\r\n $this->view->page_heading = $pageHeading;\r\n $this->view->data_page = \"tables\";\r\n\r\n $employee_number = $this->_request->getParam('employee-number');\r\n $full_name = $this->_request->getParam('full-name');\r\n $date_of_birth = $this->_request->getParam('date-of-birth');\r\n $nic_number = $this->_request->getParam('nic-number');\r\n $driving_license_no = $this->_request->getParam('driving-license-no');\r\n $telephone_number_residence = $this->_request->getParam('telephone-number-residence');\r\n $contact_number = $this->_request->getParam('contact-number');\r\n $email_address_personal = $this->_request->getParam('email-address-personal');\r\n $email_address_office = $this->_request->getParam('email-address-office');\r\n $country = $this->_request->getParam('country');\r\n $region = $this->_request->getParam('region');\r\n $branch = $this->_request->getParam('branch');\r\n $department = $this->_request->getParam('department');\r\n $employee_status = $this->_request->getParam('employee-status');\r\n\r\n\r\n // get all the user all users...\r\n $employeeService = new Base_Model_ObtorLib_App_Core_Employee_Service_Employee();\r\n $employeeEntity = new Base_Model_ObtorLib_App_Core_Employee_Entity_Employee();\r\n $employeeEntity->setEmployeeNumber($employee_number);\r\n $employeeEntity->setFullName($full_name);\r\n $employeeEntity->setDateOfBirth($date_of_birth);\r\n $employeeEntity->setNationalIdentityCardNo($nic_number);\r\n $employeeEntity->setDrivingLicenseNo($driving_license_no);\r\n $employeeEntity->setTelephoneNumberResidence($telephone_number_residence);\r\n $employeeEntity->setTelephoneNumberMobile($contact_number);\r\n $employeeEntity->setEMailAddressPersonal($email_address_personal);\r\n $employeeEntity->setEMailAddressOffice($email_address_office);\r\n $employeeEntity->setCountry($country);\r\n $employeeEntity->setRegion($region);\r\n $employeeEntity->setBranch($branch);\r\n $employeeEntity->setDepartment($department);\r\n $employeeEntity->setEmployeeStatus($employee_status);\r\n\r\n $employeeService->employee = $employeeEntity;\r\n\r\n $objPaggination = new Base_Model_ObtorLib_Base_Lib_Paggination();\r\n $page = $this->_getParam('page', 1);\r\n $objPaggination->CurrentPage = $page;\r\n $objPaggination->TotalResults = $employeeService->searchCount();\r\n $paginationData = $objPaggination->getPaggingData();\r\n $pageLimit1 = $paginationData['MYSQL_LIMIT1'];\r\n $pageLimit2 = $paginationData['MYSQL_LIMIT2'];\r\n\r\n $limit = \" LIMIT $pageLimit1,$pageLimit2\";\r\n\r\n\r\n $employeeService->employee = $employeeEntity;\r\n $employeeInfo = $employeeService->search($limit);\r\n $this->view->employeeInfo = $employeeInfo;\r\n\r\n $this->view->pageNum = $page;\r\n $this->view->rowsPerPage = $objPaggination->ResultsPerPage;\r\n $this->view->paggination = $objPaggination;\r\n } catch (Exception $ex) {\r\n throw new Exception('<ERROR>' . $ex->getMessage() . \"\\n\");\r\n }\r\n }", "public function employee()\n {\n return $this->belongsTo(User::class, 'employee_id', 'id');\n }", "function set_employee($emp)\n\t\t{\n\t\t\t$this->employee = $emp;\n\t\t}", "public static function isEmployee(): bool\n\t{\n\t if(in_array('employee', self::getUserRole()) || in_array('administrator', self::getUserRole())) return true;\n\t return false;\n\t}", "public function Emprunter()\n {\n // section -64--88-56-1-313d700b:16f04d7fd4a:-8000:00000000000009BA begin\n // section -64--88-56-1-313d700b:16f04d7fd4a:-8000:00000000000009BA end\n }", "public function testCreateEmployee()\n {\n }", "public function show(EmployeeInfo $employee)\n {\n\n }", "public function createEmployee() {\n $newUser = User::create([\n \"name\"=>request('name'),\n \"email\"=>request('email'),\n \"password\"=> '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm',\n \"organizationId\"=>Auth::user()->organizationId,\n \"role\"=>\"employee\",\n \"password_token\"=>\\str_random(100)\n ]);\n\n $headers = request('headers');\n\n if(isset($headers)) {\n for($i = 0; $i < sizeof($headers); $i++) {\n Header::create([\n 'header'=>$headers[$i],\n 'userId'=>$newUser->id\n ]);\n }\n }\n\n return back();\n }", "function employee(){\n $data['employee'] = $this->m_rental->get_data('employee')->result();\n $this->load->view('header');\n $this->load->view('admin/employee',$data);\n $this->load->view('footer');\n }", "function createMBO()\n\t{\n\t\t$emp_id = $this->input->post(\"emp_id\");\n\t\t\n\t\t$this->load->model('M_evs_employee','memp');\n\t\t$this->memp->Emp_ID = $emp_id;\n\t\t$data['emp_info'] = $this->memp->get_by_empid();\n\t\t\n\t\t$this->output('/consent/ev_form/v_createMBO',$data);\n\t}", "public function getEmployeeId()\n {\n return $this->employee_id;\n }", "public function getMobile()\n\t{\n\t\treturn $this->get(\"mobile\");\n\t}", "function Immobile(){\n\t\t\t$this->database=new Database();\n\t\t\t$approvato=false;\n\t\t}", "public function index()\n {\n // \n $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $employees= m_employee::where('user_id',$loggeduser->id)->paginate(10);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$employees=m_employee::paginate(10);\n\t\t\t}\n \treturn view('employees.index')->withEmployees($employees);\n\t\t \n }", "public function isEmployee(){\n if(isset($this->staffId)){\n return TRUE;\n }\n else{\n return FALSE;\n }\n }", "function processEmployee() {\r\n // Names the array as `first intial+last name` of employee. ????\r\n // Sends the array to the `employee_arrays.php` file to be pushed to $employeeDatabase.\r\n // From there, the new array gets passed through the `addToDatabase()` function. \r\n }", "public function show(Emploitime $emploitime)\n {\n //\n }", "public function testUpdateEmployee()\n {\n }", "public function getEmployee()\n {\n return $this->hasOne(Employees::className(), ['ID' => 'EmployeeID']);\n }", "public function actionUpdatePhone()\n {\n $model=new Employee;\n $Address=new Address;\n if(isset($_POST['Employee']))\n {\n $model=Employee::getEmployee(Yii::app()->user->id);\n $model->attributes = $_POST['Employee'];\n Users::updateStatus(Yii::app()->user->id);\n if($model->save())\n {\n $this->redirect(array('infoEmployee', 'id' => $model->id));\n }\n }\n\n $this->render('UpdatePhone',array('model'=>$model, 'address'=>$Address));\n }", "public function index()\r\n {\r\n $employeedataf = DB::table('employee')\r\n ->join('familybackground','employee.emp_id', '=', 'familybackground.emp_id')\r\n ->where('familybackground.emp_id', Auth::user()->username)\r\n ->first();\r\n\r\n $employeedatachild = DB::table('employee')\r\n ->join('children', 'employee.emp_id', '=', 'children.emp_id')\r\n ->where('children.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n $employeedatawork = DB::table('employee')\r\n ->join('workexperience', 'employee.emp_id', '=', 'workexperience.emp_id')\r\n ->where('workexperience.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n $employeedataeduc = DB::table('employee')\r\n ->join('educationalbackground', 'employee.emp_id', '=', 'educationalbackground.emp_id')\r\n ->where('educationalbackground.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n $employeedatacivil = DB::table('employee')\r\n ->join('civilserviceeligibility', 'employee.emp_id', '=', 'civilserviceeligibility.emp_id')\r\n ->where('civilserviceeligibility.emp_id', Auth::user()->username)\r\n ->get();\r\n $employeedatavol = DB::table('employee')\r\n ->join('voluntary_works', 'employee.emp_id', '=', 'voluntary_works.emp_id')\r\n ->where('voluntary_works.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n $employeedatatrain = DB::table('employee')\r\n ->join('trainings', 'employee.emp_id', '=', 'trainings.emp_id')\r\n ->where('trainings.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n $employeedataotherinfo = DB::table('employee')\r\n ->join('other_info', 'employee.emp_id', '=', 'other_info.emp_id')\r\n ->where('other_info.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n $employeedataposition = DB::table ('employee')\r\n ->join('position', 'employee.position_id', '=', 'position.position_id')\r\n ->where('employee.emp_id', Auth::user()->username)\r\n ->first();\r\n\r\n $employeedatareferences = DB::table('employee')\r\n ->join('references', 'employee.emp_id', '=', 'references.emp_id')\r\n ->where('references.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n\r\n return view ('Employee.PdsOfEmp') ->with (\"employeedatachild\", $employeedatachild)->with (\"employeedataf\", $employeedataf)->with(\"employeedatawork\", $employeedatawork)->with(\"employeedataeduc\", $employeedataeduc)->with(\"employeedatacivil\", $employeedatacivil)->with('employeedatavol', $employeedatavol)->with('employeedatatrain', $employeedatatrain)->with('employeedataotherinfo', $employeedataotherinfo)->with('employeedatareferences', $employeedatareferences);\r\n\r\n }", "public function run()\n {\n \t$emp1 = Employee::where('name','00001')->first();\n \t$emp2 = Employee::where('name','00002')->first();\n \t$emp3 = Employee::where('name','00003')->first();\n\n \t$user1= new User();\n \t$user1->employee_id=$emp1->id;\n \t$user1->email='[email protected]';\n \t$user1->password=bcrypt('dummy1');\n $user1->save();\n\n $user2= new User();\n \t$user2->employee_id=$emp2->id;\n \t$user2->email='[email protected]';\n \t$user2->password=bcrypt('dummy2');\n $user2->save();\n\n $user3= new User();\n \t$user3->employee_id=$emp3->id;\n \t$user3->email='[email protected]';\n \t$user3->password=bcrypt('dummy3');\n $user3->save();\n\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function updateOneEmployee() {\n\n $employeeModel = $GLOBALS[\"employeeModel\"];\n\n $emp = $employeeModel->getOneByEmployeeID($_SESSION[\"workerID\"]);\n\n $givenOldLogin_Password = filter_input(INPUT_POST, \"givenOldLogin_Password\");\n $givenNewLogin_Password = filter_input(INPUT_POST, \"givenNewLogin_Password\");\n if (($givenOldLogin_Password != NULL) && ($givenNewLogin_Password != NULL)) {\n $oldLogin_Password_encrypted = sha1($givenOldLogin_Password);\n\n if ($oldLogin_Password_encrypted == $emp[\"Login_Password\"]) {\n $givenNewLogin_Password = sha1($givenNewLogin_Password);\n }\n } \n else {\n $givenNewLogin_Password = $emp[\"Login_Password\"];\n //kanskje en error beskjed ?\n }\n $updateFirst_name = filter_input(INPUT_POST, 'First_name');\n $updateLast_name = filter_input(INPUT_POST, 'Last_name');\n $updateBirth = filter_input(INPUT_POST, 'Birth');\n $updatePhone_Number = filter_input(INPUT_POST, 'Phone_Number');\n $updateHome_Address = filter_input(INPUT_POST, 'Home_Address');\n $updateZip_Code = filter_input(INPUT_POST, 'Zip_Code');\n $EmployeeID = filter_input(INPUT_POST, 'EmployeeID');\n\n $employeeModel->updateEmployee($updateFirst_name, $updateLast_name, $updateBirth, $updatePhone_Number, $updateHome_Address, $updateZip_Code, $EmployeeID, $givenNewLogin_Password);\n $employee = $employeeModel->getOneByEmployeeID($EmployeeID);\n\n $data = array(\"employee\" => $employee);\n return $this->render(\"adminInfo\", $data); //MÅ ENDRE NAVN TIL MASTER\n }", "function get_emp_list($email1)\r\n\t{\r\n\t\t$email = trim(Yii::app()->user->getState(\"employee_email\"));\r\n\t\t$connection=Yii::app()->db;\r\n\t\t$sql = \"select distinct `Employee_id` from `kpi_auto_save` use index (emp_index) where appraisal_id1 = '\".$email.\"' and (final_kra_status !='')\";\r\n\t\t$command=$connection->createCommand($sql);\r\n\t\t$rows=$command->queryAll();\t\t\r\n\t\treturn $rows;\r\n\t}", "public function employee () {\n\t\treturn $this->belongsTo('App\\Employee');\n\t}", "private function submitToMasterEmployee($request)\n {\n $request->request->add(['id' => $this->generateUUID()]);\n// $request->request->add(['employeeNo' => str_random(6)]);\n\n $requestData = $request->except([\n 'lengthEmploymentTimeFormat',\n 'siblingName',\n 'siblingAddress',\n 'siblingCity',\n 'siblingPhoneNo',\n 'siblingMaritalStatusId',\n ]); // remove from request\n\n /*Handle image uploads*/\n if ($request->hasFile('idCardPhoto') && $request->file('idCardPhoto')->isValid()) {\n\n /*Save new image*/\n $filename = $this->getImageName($request->idCardPhoto, $request->nickName);\n $requestData['idCardPhoto'] = $filename; //rename\n $request->idCardPhoto->move(base_path(Configs::$IMAGE_PATH['EMPLOYEE_PHOTO']), $filename);\n\n }\n\n /*Handle image uploads*/\n if ($request->hasFile('employeePhoto') && $request->file('employeePhoto')->isValid()) {\n\n /*Save new image*/\n $filename = $this->getImageName($request->employeePhoto, $request->nickName);\n $requestData['employeePhoto'] = $filename; // rename\n $request->employeePhoto->move(base_path(Configs::$IMAGE_PATH['EMPLOYEE_PHOTO']), $filename);\n\n\n }\n\n //create employee\n $employee = MasterEmployee::create($requestData);\n\n //save siblings\n if($employee->numberOfSiblings !=null){\n if ($employee->numberOfSiblings > 0) {\n for ($i = 0; $i < $employee->numberOfSiblings; $i++) {\n\n EmployeeSiblings::create([\n 'employeeId' => $employee->id,\n 'name' => $request->siblingName[$i],\n 'address' => $request->siblingAddress[$i],\n 'city' => $request->siblingCity[$i]\n ]);\n\n }\n }\n }\n\n\n /* Register face to Microsoft Face API to be used in attendance*/\n if (file_exists(base_path(Configs::$IMAGE_PATH['EMPLOYEE_PHOTO']) . $employee->employeePhoto)) {\n\n try {\n CreatePersonLogic::create(\n [\n 'employeeId' => $employee->id,\n 'employeeFullName' => $employee->givenName . ' ' . $employee->surname,\n 'filename' => $employee->employeePhoto\n ]\n );\n } catch (\\Exception $exception) {\n Log::info($exception->getMessage());\n }\n\n }\n\n\n //return employee\n return $employee;\n }", "public function employee()\n {\n return $this->belongsTo(Employee::class);\n }", "public function __construct(Employee $employee)\n {\n $this->employee = $employee ;\n }", "public function __construct($employee)\n {\n $this->employee = $employee;\n }", "function employeeDetail(&$smartyEmployee,$searchBox) {\n\t\t$uid = intval($this->piVars['id']);\t//SQL-Injection!!!\n\t\t$pos_id = intval($this->piVars['pos_id']); //must come from piVars -> need to know which one of several possible positions is to be displayed....\n\n\t\t// test bk: get position from Database\n\t\t// a) employee is linked to position-record, could be > 1 !!!\n\t\t// b) employee is linked to organisation-record (leader of the pack)\n\t\t/*\n\t\t$pos_id = intval($this->piVars['pos_id']);\n\t\t$res_emppos = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(\n\t\t\t\t\t'uid',\n\t\t\t\t\t'tx_civserv_employee,\n\t\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t\t tx_civserv_position'\n\t\t);\n\t\t*/\n\n\n\n\n\n\t\t// Standard query for employee details --> table tx_civserv_employee\n\n\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t}\n\n\t\t$res_common = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t'tx_civserv_employee.uid,\n\t\t\t\t\t\t tx_civserv_employee.em_address,\n\t\t\t\t\t\t tx_civserv_employee.em_title,\n\t\t\t\t\t\t tx_civserv_employee.em_name,\n\t\t\t\t\t\t tx_civserv_employee.em_firstname,\n\t\t\t\t\t\t tx_civserv_employee.em_telephone,\n\t\t\t\t\t\t tx_civserv_employee.em_fax,\n\t\t\t\t\t\t tx_civserv_employee.em_email,\n\t\t\t\t\t\t tx_civserv_employee.em_image,\n\t\t\t\t\t\t tx_civserv_employee.em_datasec',\n\t\t\t\t\t\t'tx_civserv_employee',\n\t\t\t\t\t\t'1 '.\n\t\t\t\t\t\t$strEnableField.\n\t\t\t\t\t\t' AND uid='. intval($uid).'\n\t\t\t\t\t\tAND em_datasec=1',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'');\n\n\t\t//Check if data security option is enabled\n\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res_common) == 0) {\n\t\t\t$GLOBALS['error_message'] = $this->pi_getLL('tx_civserv_pi1_employee.datasec','Datasec enabled! Employee is not shown.');\n\t\t\treturn false;\n\t\t}\n\n\t\t//Query for employee office hours\n\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t}\n\t\t$res_emp_hours = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(\n\t\t\t\t\t'tx_civserv_officehours.oh_start_morning,\n\t\t\t\t\t tx_civserv_officehours.oh_end_morning,\n\t\t\t\t\t tx_civserv_officehours.oh_start_afternoon,\n\t\t\t\t\t tx_civserv_officehours.oh_end_afternoon,\n\t\t\t\t\t tx_civserv_officehours.oh_manual_checkbox,\n\t\t\t\t\t tx_civserv_officehours.oh_freestyle,\n\t\t\t\t\t tx_civserv_officehours.oh_weekday',\n\t\t\t\t\t'tx_civserv_employee',\n\t\t\t\t\t'tx_civserv_employee_em_hours_mm',\n\t\t\t\t\t'tx_civserv_officehours',\n\t\t\t\t\t$strEnableField.\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_officehours').\n\t\t\t\t\t' AND tx_civserv_employee.uid = ' . intval($uid),\n\t\t\t\t\t'',\n\t\t\t\t\t'oh_weekday',\n\t\t\t\t\t'');\n\n\t\t// Create additional queries if position uid is set in piVars\n\t\tif ($pos_id != '' && intval($pos_id) > 0) {\n\n\t\t\t// Query for employee-position office hours\n\t\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t\t\t$strEnableField .= $this->cObj->enableFields('tx_civserv_position');\n\t\t\t}\n\t\t\t$res_emp_pos_hours = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'tx_civserv_officehours.oh_start_morning,\n\t\t\t\t tx_civserv_officehours.oh_end_morning,\n\t\t\t\t tx_civserv_officehours.oh_start_afternoon,\n\t\t\t\t tx_civserv_officehours.oh_end_afternoon,\n\t\t\t\t tx_civserv_officehours.oh_manual_checkbox,\n\t\t\t\t tx_civserv_officehours.oh_freestyle,\n\t\t\t\t tx_civserv_officehours.oh_weekday',\n\t\t\t\t'tx_civserv_employee,\n\t\t\t\t tx_civserv_position,\n\t\t\t\t tx_civserv_officehours,\n\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t tx_civserv_officehours_oep_employee_em_position_mm_mm',\n\t\t\t\t'1 '.\n\t\t\t\t$strEnableField.\n\t\t\t\t$this->cObj->enableFields('tx_civserv_officehours').\n\t\t\t\t' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t AND tx_civserv_position.uid = tx_civserv_employee_em_position_mm.uid_foreign\n\t\t\t\t AND tx_civserv_employee_em_position_mm.uid = tx_civserv_officehours_oep_employee_em_position_mm_mm.uid_local\n\t\t\t\t AND tx_civserv_officehours.uid = tx_civserv_officehours_oep_employee_em_position_mm_mm.uid_foreign\n\t\t\t\t AND tx_civserv_employee.uid = ' . intval($uid) . '\n\t\t\t\t AND tx_civserv_position.uid = '. intval($pos_id),\n\t\t\t\t'',\n\t\t\t\t'oh_weekday',\n\t\t\t\t'');\n\n\n\t\t\t// Query for employee-organisation office hours\n\t\t\t// 1. will only return result if position occupied by employee has relation to organisation\n\t\t\t// 2. ignores direct employee-organisation-relations (leader of the pack....)\n\t\t\t$res_emp_org_hours = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t'tx_civserv_officehours.oh_start_morning,\n\t\t\t\t\t tx_civserv_officehours.oh_end_morning,\n\t\t\t\t\t tx_civserv_officehours.oh_start_afternoon,\n\t\t\t\t\t tx_civserv_officehours.oh_end_afternoon,\n\t\t\t\t\t tx_civserv_officehours.oh_manual_checkbox,\n\t\t\t\t\t tx_civserv_officehours.oh_freestyle,\n\t\t\t\t\t tx_civserv_officehours.oh_weekday',\n\t\t\t\t\t'tx_civserv_employee,\n\t\t\t\t\t tx_civserv_organisation,\n\t\t\t\t\t tx_civserv_position,\n\t\t\t\t\t tx_civserv_officehours,\n\t\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t\t tx_civserv_position_po_organisation_mm,\n\t\t\t\t\t tx_civserv_organisation_or_hours_mm',\n\t\t\t\t\t'1 '.\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_organisation').\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_officehours').\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_position').\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_officehours').\n\t\t\t\t\t' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t\t AND tx_civserv_position.uid = tx_civserv_employee_em_position_mm.uid_foreign\n\t\t\t\t\t AND tx_civserv_position.uid = tx_civserv_position_po_organisation_mm.uid_local\n\t\t\t\t\t AND tx_civserv_organisation.uid = tx_civserv_position_po_organisation_mm.uid_foreign\n\t\t\t\t\t AND tx_civserv_organisation.uid = tx_civserv_organisation_or_hours_mm.uid_local\n\t\t\t\t\t AND tx_civserv_officehours.uid = tx_civserv_organisation_or_hours_mm.uid_foreign\n\t\t\t\t\t AND tx_civserv_employee.uid = ' . intval($uid) . '\n\t\t\t\t\t AND em_datasec = 1\n\t\t\t\t\t AND tx_civserv_position.uid = ' . intval($pos_id),\n\t\t\t\t\t'',\n\t\t\t\t\t'oh_weekday',\n\t\t\t\t\t'');\n\n\n\t\t\t//test bk: single out one building for the organisation / employee\n\t\t\t//todo!\n\n\n\t\t\t// not all employee-position-records have a relation to a room (building, floor)\n\t\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t\t\t$strEnableField .= $this->cObj->enableFields('tx_civserv_position');\n\t\t\t}\n\t\t\t$res_position = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'tx_civserv_position.uid as pos_uid,\n\t\t\t\t tx_civserv_organisation.uid as or_uid,\n\t\t\t\t tx_civserv_employee.uid as emp_uid,\n\t\t\t\t tx_civserv_position.po_name as position,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_telephone as phone,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_fax as fax,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_email as email,\n\t\t\t\t tx_civserv_organisation.or_name as organisation',\n\t\t\t\t'tx_civserv_employee,\n\t\t\t\t tx_civserv_position,\n\t\t\t\t tx_civserv_organisation,\n\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t tx_civserv_position_po_organisation_mm',\n\t\t\t\t'tx_civserv_employee.uid='. intval($uid).'\n\t\t\t\t AND em_datasec=1\n\t\t\t\t AND tx_civserv_position.uid = '. intval($pos_id).\n\t\t\t\t$this->cObj->enableFields('tx_civserv_organisation').\n\t\t\t\t$strEnableField.\n\t\t\t\t ' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t AND tx_civserv_employee_em_position_mm.uid_foreign = tx_civserv_position.uid\n\t\t\t\t AND tx_civserv_position.uid = tx_civserv_position_po_organisation_mm.uid_local\n\t\t\t\t AND tx_civserv_organisation.uid = tx_civserv_position_po_organisation_mm.uid_foreign',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\t\t\t\t\n\t\t\t$query_position = $GLOBALS['TYPO3_DB']->SELECTquery(\n\t\t\t\t'tx_civserv_position.uid as pos_uid,\n\t\t\t\t tx_civserv_organisation.uid as or_uid,\n\t\t\t\t tx_civserv_employee.uid as emp_uid,\n\t\t\t\t tx_civserv_position.po_name as position,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_telephone as phone,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_fax as fax,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_email as email,\n\t\t\t\t tx_civserv_organisation.or_name as organisation',\n\t\t\t\t'tx_civserv_employee,\n\t\t\t\t tx_civserv_position,\n\t\t\t\t tx_civserv_organisation,\n\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t tx_civserv_position_po_organisation_mm',\n\t\t\t\t'tx_civserv_employee.uid='. intval($uid).'\n\t\t\t\t AND em_datasec=1\n\t\t\t\t AND tx_civserv_position.uid = '. intval($pos_id).\n\t\t\t\t$this->cObj->enableFields('tx_civserv_organisation').\n\t\t\t\t$strEnableField.\n\t\t\t\t ' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t AND tx_civserv_employee_em_position_mm.uid_foreign = tx_civserv_position.uid\n\t\t\t\t AND tx_civserv_position.uid = tx_civserv_position_po_organisation_mm.uid_local\n\t\t\t\t AND tx_civserv_organisation.uid = tx_civserv_position_po_organisation_mm.uid_foreign',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\n\t\t\t//special cases have been intercepted before, in fct employee_list\n\t\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t\t\t$strEnableField .= $this->cObj->enableFields('tx_civserv_position');\n\t\t\t}\n\t\t\t$res_room = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t'tx_civserv_building.bl_name as building,\n\t\t\t\t\t tx_civserv_building.bl_name_to_show as building_to_show,\n\t\t\t\t\t tx_civserv_floor.fl_descr as floor,\n\t\t\t\t\t tx_civserv_room.ro_name as room',\n\t\t\t\t\t'tx_civserv_employee,\n\t\t\t\t\t tx_civserv_position,\n\t\t\t\t\t tx_civserv_room,\n\t\t\t\t\t tx_civserv_floor,\n\t\t\t\t\t tx_civserv_building,\n\t\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t\t tx_civserv_building_bl_floor_mm',\n\t\t\t\t\t'tx_civserv_employee.uid='. intval($uid).'\n\t\t\t\t\t AND em_datasec=1\n\t\t\t\t\t AND tx_civserv_position.uid = '. intval($pos_id).\n\t\t\t\t\t$strEnableField.\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_room').\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_floor').\n\t\t\t\t\t ' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t\t AND tx_civserv_employee_em_position_mm.uid_foreign = tx_civserv_position.uid\n\t\t\t\t\t AND tx_civserv_employee_em_position_mm.ep_room = tx_civserv_room.uid\n\t\t\t\t\t AND tx_civserv_building.uid = tx_civserv_building_bl_floor_mm.uid_local\n\t\t\t\t\t AND tx_civserv_floor.uid = tx_civserv_building_bl_floor_mm.uid_foreign\n\t\t\t\t\t AND tx_civserv_room.rbf_building_bl_floor = tx_civserv_building_bl_floor_mm.uid',\n\t\t\t\t\t'',\n\t\t\t\t\t'',\n\t\t\t\t\t'');\n\n\t\t\t//Assign employee position data\n\t\t\t$employee_position = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_position);\n\t\t\tdebug($employee_position);\n\t\t\t$employee_position['or_link'] = htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'organisation', id => $employee_position['or_uid']),1,1));\n\t\t\tif($employee_position['building_to_show'] > ''){\n\t\t\t\t$employee_position['building'] = $employee_position['building_to_show'];\n\t\t\t}\n\t\t\t$employee_room = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_room);\n\t\t\tif(count($employee_room) > 0){\n\t\t\t\t$employee_position = array_merge($employee_position, (array)$employee_room);\n\t\t\t}\n\t\t\t$smartyEmployee->assign('position',$employee_position);\n\n\n\t\t\t// employee_position_hours:\n\t\t\t//Assign employee-position working hours\n\t\t\t$row_counter = 0;\n\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_emp_pos_hours) ){\n\t\t\t\t$emp_pos_hours[$row_counter]['weekday'] = $this->pi_getLL('tx_civserv_pi1_weekday_'.$row['oh_weekday']);\n\t\t\t\t$emp_pos_hours[$row_counter]['start_morning'] = $row['oh_start_morning'];\n\t\t\t\t$emp_pos_hours[$row_counter]['end_morning'] = $row['oh_end_morning'];\n\t\t\t\t$emp_pos_hours[$row_counter]['start_afternoon'] = $row['oh_start_afternoon'];\n\t\t\t\t$emp_pos_hours[$row_counter]['end_afternoon'] = $row['oh_end_afternoon'];\n\t\t\t\tif($row['oh_manual_checkbox'] == 1){\n\t\t\t\t\t$emp_pos_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\t\t}else{\n\t\t\t\t\t$emp_pos_hours[$row_counter]['freestyle'] = '';\n\t\t\t\t}\n\t\t\t\t$row_counter++;\n\t\t\t}\n\t\t\t$smartyEmployee->assign('emp_pos_hours',$emp_pos_hours);\n\n\n\t\t\t//Assign employee-organisation working hours\n\t\t\t$row_counter = 0;\n\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_emp_org_hours) ){\n\t\t\t\t$emp_org_hours[$row_counter]['weekday'] = $this->pi_getLL('tx_civserv_pi1_weekday_'.$row['oh_weekday']);\n\t\t\t\t$emp_org_hours[$row_counter]['start_morning'] = $row['oh_start_morning'];\n\t\t\t\t$emp_org_hours[$row_counter]['end_morning'] = $row['oh_end_morning'];\n\t\t\t\t$emp_org_hours[$row_counter]['start_afternoon'] = $row['oh_start_afternoon'];\n\t\t\t\t$emp_org_hours[$row_counter]['end_afternoon'] = $row['oh_end_afternoon'];\n#\t\t\t\t$emp_org_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\t\tif($row['oh_manual_checkbox'] == 1){\n\t\t\t\t\t$emp_org_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\t\t}else{\n\t\t\t\t\t$emp_org_hours[$row_counter]['freestyle'] = '';\n\t\t\t\t}\n\t\t\t\t$row_counter++;\n\t\t\t}\n\t\t\t$smartyEmployee->assign('emp_org_hours',$emp_org_hours);\n\t\t} //End if additional queries\n\n\t\t$employee_rows = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_common);\n\n\t\t// get Image code\n\t\t$imagepath = $this->conf['folder_organisations'] . $this->community['id'] . '/images/';\n\t\t$description = $employee_rows['em_firstname'] . ' ' . $employee_rows['em_name'];\n\t\t$imageCode = $this->getImageCode($employee_rows['em_image'],$imagepath,$this->conf['employee-image.'],$description);\n\n\t\t//Assign employee data\n\t\t$smartyEmployee->assign('title',$employee_rows['em_title']);\n\t\tif (intval($employee_rows['em_address']) == 2) {\n\t\t\t$smartyEmployee->assign('address',$this->pi_getLL('tx_civserv_pi1_organisation.address_female','Mrs.'));\n\t\t} else if (intval($employee_rows['em_address']) == 1) {\n\t\t\t$smartyEmployee->assign('address',$this->pi_getLL('tx_civserv_pi1_organisation.address_male','Mr.'));\n\t\t}\n\t\t$smartyEmployee->assign('firstname',$employee_rows['em_firstname']);\n\t\t$smartyEmployee->assign('name',$employee_rows['em_name']);\n\t\t$smartyEmployee->assign('phone',$employee_rows['em_telephone']);\n\t\t$smartyEmployee->assign('fax',$employee_rows['em_fax']);\n\t\t$smartyEmployee->assign('image',$imageCode);\n\n\t\t//search employee\n\t\t$smartyEmployee->assign('employee_search', $this->community['employee_search']);\n\n\t\t// Assign email data\n\t\t// use typolink, because of the possibility to use encrypted email-adresses for spam-protection\n\t\tif ($employee_position['email'] != '') {\n\t\t\t$email_form_url = htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'set_email_form',id => $employee_position['emp_uid'],pos_id => $employee_position['pos_uid']),1,1));\n\t\t\t$email_code = $this->cObj->typoLink($employee_position['email'],array(parameter => $employee_position['email'],ATagParams => 'class=\"email\"'));\n\t\t} elseif ($employee_rows['em_email'] != '') {\n\t\t\t$email_form_url = htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'set_email_form',id => $employee_rows['uid']),1,1));\n\t\t\t$email_code = $this->cObj->typoLink($employee_rows['em_email'],array(parameter => $employee_rows['em_email'],ATagParams => 'class=\"email\"'));\n\t\t}\n\t\t$smartyEmployee->assign('email_form_url',$email_form_url);\n\t\t$smartyEmployee->assign('email_code',$email_code);\n\n\t\t//Assign employee working hours\n\t\t$row_counter = 0;\n\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_emp_hours) ){\n\t\t\t$emp_hours[$row_counter]['weekday'] = $this->pi_getLL('tx_civserv_pi1_weekday_'.$row['oh_weekday']);\n\t\t\t$emp_hours[$row_counter]['start_morning'] = $row['oh_start_morning'];\n\t\t\t$emp_hours[$row_counter]['end_morning'] = $row['oh_end_morning'];\n\t\t\t$emp_hours[$row_counter]['start_afternoon'] = $row['oh_start_afternoon'];\n\t\t\t$emp_hours[$row_counter]['end_afternoon'] = $row['oh_end_afternoon'];\n#\t\t\t$emp_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\tif($row['oh_manual_checkbox'] == 1){\n\t\t\t\t$emp_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\t}else{\n\t\t\t\t$emp_hours[$row_counter]['freestyle'] = '';\n\t\t\t}\n\t\t\t$row_counter++;\n\t\t}\n\t\t$smartyEmployee->assign('emp_hours',$emp_hours);\n\n\n\n\t\t//Assign template labels\n\t\tif (intval($employee_rows['em_address']) == 2) {\n\t\t\t$smartyEmployee->assign('employee_label',$this->pi_getLL('tx_civserv_pi1_employee.employee_female','Employee'));\n\t\t} else{ //1 for male or nothing\n\t\t\t$smartyEmployee->assign('employee_label',$this->pi_getLL('tx_civserv_pi1_employee.employee_male','Employee'));\n\t\t}\n\t\t$smartyEmployee->assign('phone_label',$this->pi_getLL('tx_civserv_pi1_organisation.phone','Phone'));\n\t\t$smartyEmployee->assign('fax_label',$this->pi_getLL('tx_civserv_pi1_organisation.fax','Fax'));\n\t\t$smartyEmployee->assign('email_label',$this->pi_getLL('tx_civserv_pi1_organisation.email','E-Mail'));\n\t\t$smartyEmployee->assign('web_email_label',$this->pi_getLL('tx_civserv_pi1_organisation.web_email','E-Mail-Form'));\n\t\t$smartyEmployee->assign('working_hours_label',$this->pi_getLL('tx_civserv_pi1_employee.hours','Working hours'));\n\t\t$smartyEmployee->assign('office_hours_summary',str_replace('###EMPLOYEE###',$employee_rows['em_firstname'] . ' ' . $employee_rows['em_name'],$this->pi_getLL('tx_civserv_pi1_employee.officehours','In the table are the office hours of ###EMPLOYEE### shown.')));\n\t\tif($this->conf['showOhLabels']){\n\t\t\t//default\n\t\t}else{\n\t\t\t$smartyEmployee->assign('supress_labels', 'invisible');\n\t\t}\n\t\t$smartyEmployee->assign('weekday',$this->pi_getLL('tx_civserv_pi1_weekday','Weekday'));\n\t\t$smartyEmployee->assign('morning',$this->pi_getLL('tx_civserv_pi1_organisation.morning','mornings'));\n\t\t$smartyEmployee->assign('afternoon',$this->pi_getLL('tx_civserv_pi1_organisation.afternoon','in the afternoon'));\n\n\t\t$smartyEmployee->assign('organisation_label',$this->pi_getLL('tx_civserv_pi1_employee.organisation','Organisation'));\n\t\t$smartyEmployee->assign('room_label',$this->pi_getLL('tx_civserv_pi1_employee.room','Room'));\n\t\t//the image_employee_label is not being used yet\n\t\tif (intval($employee_rows['em_address']) == 2) {\n\t\t\t$smartyEmployee->assign('image_employee_label',$this->pi_getLL('tx_civserv_pi1_employee_female.image','Image of employee'));\n\t\t} else if (intval($employee_rows['em_address']) == 1) {\n\t\t\t$smartyEmployee->assign('image_employee_label',$this->pi_getLL('tx_civserv_pi1_employee_male.image','Image of employee'));\n\t\t}\n\n\t\tif ($searchBox) {\n\t\t\t//$_SERVER['REQUEST_URI'] = $this->pi_linkTP_keepPIvars_url(array(mode => 'search_result'),0,1); //dropped this according to instructions from security review\n\t\t\t$smartyTop15->assign('searchbox', $this->pi_list_searchBox('',true));\n\t\t}\n\t\t$GLOBALS['TSFE']->page['title']=$this->pi_getLL('tx_civserv_pi1_employee.employee_plural','Employees');\n\t\treturn true;\n\t}", "public function getSubscriberMobile()\n {\n $mobile = parent::getSubscriberMobile(); \n return $mobile;\n }", "function getEmployees($crewName) {\r\n\t\tglobal $databaseName;\r\n\t\tglobal $timesheetDate;\r\n\t\tglobal $builder;\r\n\t\tglobal $subdivision;\r\n\t\tglobal $lot;\r\n\t\tglobal $action;\r\n\t\t$employeesArr = array();\r\n\t\t\r\n\t\t$timesheetDateTS = strtotime($timesheetDate);\r\n\t\tif($timesheetDateTS > 0) {\r\n\t\t\t$date = date('m/d/y', $timesheetDateTS);\r\n\t\t}\r\n\r\n\t\t// Get Forman employees.\r\n\t\t$sql = \"select * from \" . $databaseName . \".employees where `crew_name`='\" . $crewName . \"' and `is_forman`='1'\";\r\n\t\t$records = mysqli_query($this->con, $sql);\r\n\t\t\r\n\t\twhile($rows = mysqli_fetch_array($records)) {\r\n\t\t\t$employee = new Employee();\r\n\t\t\t$employeeName = trim($rows['first']) . \" \" . trim($rows['last']);\r\n\t\t\t$employee->setName($employeeName);\r\n\t\t\t$employee->setWage($rows['wage']);\r\n\t\t\tarray_push($employeesArr, $employee);\r\n\t\t}\r\n\t\t\r\n\t\t// Get Mason employees.\r\n\t\t$sql = \"select * from \" . $databaseName . \".employees where `crew_name`='\" . $crewName . \"' and `is_mason`='1'\";\r\n\t\t$records = mysqli_query($this->con, $sql);\r\n\t\t\r\n\t\t// Get Employees from DB.\r\n\t\twhile($rows = mysqli_fetch_array($records)) {\r\n\t\t\t$employee = new Employee();\r\n\t\t\t$employeeName = trim($rows['first']) . \" \" . trim($rows['last']);\r\n\t\t\t$employee->setName($employeeName);\r\n\t\t\t$employee->setWage($rows['wage']);\r\n\t\t\t\r\n\t\t\tif(!in_array($employee, $employeesArr)) {\r\n\t\t\t\tarray_push($employeesArr, $employee);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Get Apprentice employees.\r\n\t\t$sql = \"select * from \" . $databaseName . \".employees where `crew_name`='\" . $crewName . \"' and `is_apprentice`='1'\";\r\n\t\t$records = mysqli_query($this->con, $sql);\r\n\t\t\r\n\t\t// Get Employees from DB.\r\n\t\twhile($rows = mysqli_fetch_array($records)) {\r\n\t\t\t$employee = new Employee();\r\n\t\t\t$employeeName = trim($rows['first']) . \" \" . trim($rows['last']);\r\n\t\t\t$employee->setName($employeeName);\r\n\t\t\t$employee->setWage($rows['wage']);\r\n\t\t\t\r\n\t\t\tif(!in_array($employee, $employeesArr)) {\r\n\t\t\t\tarray_push($employeesArr, $employee);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Get Apprentice employees.\r\n\t\t$sql = \"select * from \" . $databaseName . \".employees where `crew_name`='\" . $crewName . \"' and `is_labor`='1'\";\r\n\t\t$records = mysqli_query($this->con, $sql);\r\n\t\t\r\n\t\t// Get Employees from DB.\r\n\t\twhile($rows = mysqli_fetch_array($records)) {\r\n\t\t\t$employee = new Employee();\r\n\t\t\t$employeeName = trim($rows['first']) . \" \" . trim($rows['last']);\r\n\t\t\t$employee->setName($employeeName);\r\n\t\t\t$employee->setWage($rows['wage']);\r\n\t\t\t\r\n\t\t\tif(!in_array($employee, $employeesArr)) {\r\n\t\t\t\tarray_push($employeesArr, $employee);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Get Driver employees.\r\n\t\t$sql = \"select * from \" . $databaseName . \".employees where `crew_name`='\" . $crewName . \"' and `is_driver`='1'\";\r\n\t\t$records = mysqli_query($this->con, $sql);\r\n\t\t\r\n\t\t// Get Employees from DB.\r\n\t\twhile($rows = mysqli_fetch_array($records)) {\r\n\t\t\t$employee = new Employee();\r\n\t\t\t$employeeName = trim($rows['first']) . \" \" . trim($rows['last']);\r\n\t\t\t$employee->setName($employeeName);\r\n\t\t\t$employee->setWage($rows['wage']);\r\n\t\t\t\r\n\t\t\tif(!in_array($employee, $employeesArr)) {\r\n\t\t\t\tarray_push($employeesArr, $employee);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Get Operator employees.\r\n\t\t$sql = \"select * from \" . $databaseName . \".employees where `crew_name`='\" . $crewName . \"' and `is_operator`='1'\";\r\n\t\t$records = mysqli_query($this->con, $sql);\r\n\t\t\r\n\t\t// Get Employees from DB.\r\n\t\twhile($rows = mysqli_fetch_array($records)) {\r\n\t\t\t$employee = new Employee();\r\n\t\t\t$employeeName = trim($rows['first']) . \" \" . trim($rows['last']);\r\n\t\t\t$employee->setName($employeeName);\r\n\t\t\t$employee->setWage($rows['wage']);\r\n\t\t\t\r\n\t\t\tif(!in_array($employee, $employeesArr)) {\r\n\t\t\t\tarray_push($employeesArr, $employee);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $employeesArr;\r\n\t}", "public function getEmployeeID()\n {\n return $this->employeeID;\n }", "public function AutomaticCreateBasedAdmin(){\n $resp = employees::find(1);\n if(!$resp){\n employees::create([\n 'emp_name'=>'admin',\n 'emp_password'=>'test',\n 'emp_address'=>'abc',\n 'emp_phone'=>'0000000000',\n 'emp_dob'=> new DateTime(),\n 'pos_id'=>1,\n ]);\n }else{\n $resp->pos_id = 1;\n $resp->save();\n }\n }", "public static function get_staff_for_manage()\n {\n $sql = \"SELECT EM1_EmployeeID_pk, EM1_Lname_ind + ', ' + EM1_FName As Full_Name FROM t_Employee1 WHERE EM1_CurrencyStatus = 'CURRENT' ORDER BY EM1_Lname_ind ASC\";\n $stmt = \\NMI::Db()->prepare($sql);\n $stmt->execute();\n $rows = $stmt->fetchAll();\n return \\Arr::assoc_to_keyval($rows, 'EM1_EmployeeID_pk', 'Full_Name');\n }", "public function employee() {\n\t\treturn $this->belongsTo('App\\Employee');\n\t}", "public function run()\n {\n Employee::forceCreate([\n 'last_name' => 'Harangozó',\n 'first_name' => 'Dóra',\n 'birth' =>'1994-04-20',\n 'image' =>'default.jpg',\n 'email' =>'[email protected]',\n 'address' => 'Sopron, Kőszegi út 20.',\n 'phone_number' => '06306089097',\n 'month_salary' => 123456789,\n 'recruitment_date'=>'2018-10-10',\n 'job'=>'mérnök',\n 'comment'=> null,\n 'user_id'=>1,\n 'site_id'=>1,\n ]);\n Employee::forceCreate([\n 'last_name' => 'Nagy',\n 'first_name' => 'Péter',\n 'birth' =>'1980-08-08',\n 'image' =>'default.jpg',\n 'email' =>'[email protected]',\n 'address' => 'Sopron, Kossuth út 20.',\n 'phone_number' => '06301234569',\n 'month_salary' => 123456789,\n 'recruitment_date'=>'2018-10-10',\n 'job'=>'menedzser',\n 'comment'=> null,\n 'user_id'=>2,\n 'site_id'=>1,\n ]);\n\n Employee::create([\n 'last_name' => 'Nagy',\n 'first_name' => 'Luca',\n 'birth' =>'1990-11-24',\n 'image' =>'default.jpg',\n 'email' =>'[email protected]',\n 'address' => 'Sopron, Baross út 20.',\n 'phone_number' => '06306666666',\n 'month_salary' => 123456789,\n 'recruitment_date'=>'2018-10-10',\n 'job'=>'telephely vezető',\n 'comment'=> null,\n 'user_id'=>4,\n 'site_id'=>2,\n ]);\n Employee::create([\n 'last_name' => 'Nagy',\n 'first_name' => 'Lili',\n 'birth' =>'1990-07-01',\n 'image' =>'default.jpg',\n 'email' =>'[email protected]',\n 'address' => 'Sopron, Szív utca 20.',\n 'phone_number' => '06303333333',\n 'month_salary' => 123456789,\n 'recruitment_date'=>'2018-10-10',\n 'job'=>'adminisztrátor',\n 'comment'=> null,\n 'user_id'=>3,\n 'site_id'=>2,\n ]);\n }", "public function insert_employee_info()\n\t{\t\n\t\tif (!$this->Admin_model->is_admin_loged_in()) \n\t\t{\n\t\t\tredirect('Adminlogin/?logged_in_first');\n\t\t}else{\n\t\t\tif($this->admin_access('employee_entry') != 1){\n\t\t\t\t$data['warning_msg']=\"You Are Not able to Access this Module...!\";\n\t\t\t\t$this->session->set_flashdata($data);\n\t\t\t\tredirect('hr_payroll/dashboard');\n\t\t\t}\n\t\t\t$data['title'] = 'Add Employee Information'; \n\t\t\t$data['content'] = 'employee/insert_employee';\n\t\t\t$this->load->view('admin/adminMaster', $data);\n\t\t}\n\t}", "function get_emp_name(){\n\n\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"\";\n $db = \"nhk_epms\";\n \n // Create connection\n $conn = mysqli_connect($servername, $username, $password, $db);\n // Check connection\n if (!$conn) {\n die(\"Connection failed: \" . mysqli_connect_error());\n }\n\n $emp_n = $_POST[\"emp\"];\n\n $sql = \"SELECT \n * \n FROM\n `epms_employee` e\n WHERE e.`Emp_id`='$emp_n'\";\n\n\n $result = mysqli_query($conn, $sql);\n\n if (mysqli_num_rows($result) > 0) {\n // output data of each row\n while($row = mysqli_fetch_assoc($result)) {\n echo $row[\"Emp_name\"];\n }\n } else {\n echo \"0 results\";\n }\n }", "public function actionFirstView()\n {\n $model=Employee::getEmployee(Yii::app()->user->id);\n if(is_null($model))\n {\n $model=new Employee;\n $Address=new Address;\n if(isset($_POST['Employee']))\n {\n $model->id_nationality=$_POST['Employee']['nationality'];\n $model->attributes = $_POST['Employee'];\n\n if($model->save())\n {\n Users::updateStatus(Yii::app()->user->id);\n Users::assignEmployee(Yii::app()->user->id, $model->id);\n\n if(Address::validAddressForm($_POST['Address']))\n {\n $checkAddress = Address::checkAddress($_POST['Address']);\n\n if(is_null($checkAddress))\n {\n $idAddress= Address::newAddress($_POST['Address']['address_line_1'],$_POST['Address']['address_line_2'],$_POST['Address']['zip'],$_POST['Address']['id_city'] ); \n }\n else\n {\n $idAddress = $checkAddress;\n }\n\n $checkAddressEmployee = AddressEmployee::checkAddressByEmployee($model->id, $idAddress);\n /* si esdddddd */\n if(is_null($checkAddressEmployee))\n {\n if($Address->id!= NULL)\n {\n $OldAddressEmployee = AddressEmployee::model()->find('id_address =:address', array(':address' => $Address->id));\n $OldAddressEmployee->end_date = date(\"Y-m-d\");\n $OldAddressEmployee->save();\n }\n $AddressEmployee = new AddressEmployee;\n $AddressEmployee->id_employee = $model->id;\n $AddressEmployee->id_address = $idAddress;\n $AddressEmployee->start_date = date(\"Y-m-d\");\n if($AddressEmployee->save())\n {\n\n }\n $this->redirect(array('infoEmployee', 'id' => $model->id));\n }\n else\n {\n return false;\n }\n }\n }\n }\n }\n else{ \n $addressModel = AddressEmployee::loadAddressByEmployee($model->id);\n if(is_null($addressModel))\n $Address = new Address;\n else\n $Address=Address::employee($addressModel->id_address);\n \n if(isset($_POST['Employee']))\n {\n Users::updateStatus(Yii::app()->user->id);\n Users::assignEmployee(Yii::app()->user->id, $model->id);\n\n if(Address::validAddressForm($_POST['Address']))\n {\n $checkAddress = Address::checkAddress($_POST['Address']);\n\n if(is_null($checkAddress))\n {\n $idAddress= Address::newAddress($_POST['Address']['address_line_1'],$_POST['Address']['address_line_2'],$_POST['Address']['zip'],$_POST['Address']['id_city'] ); \n }\n else\n {\n $idAddress = $checkAddress;\n }\n\n $checkAddressEmployee = AddressEmployee::checkAddressByEmployee($model->id, $idAddress);\n /* si esdddddd */\n if(is_null($checkAddressEmployee))\n {\n if($Address->id!= NULL)\n {\n $OldAddressEmployee = AddressEmployee::model()->find('id_address =:address', array(':address' => $Address->id));\n $OldAddressEmployee->end_date = date(\"Y-m-d\");\n $OldAddressEmployee->save();\n }\n $AddressEmployee = new AddressEmployee;\n $AddressEmployee->id_employee = $model->id;\n $AddressEmployee->id_address = $idAddress;\n $AddressEmployee->start_date = date(\"Y-m-d\");\n if($AddressEmployee->save())\n {\n\n }\n $this->redirect(array('infoEmployee', 'id' => $model->id));\n }\n else\n {\n $this->redirect(array('infoEmployee', 'id' => $model->id));\n }\n }\n }\n }\n\n $this->render('viewfirstemployee', array('model'=>$model,'Address'=>$Address));\n }", "public function setEmpTel($empTel) {\n $this->empTel = $empTel;\n return $this;\n }", "function newEmployee($conn){\n\t\t$name = mysqli_real_escape_string($conn, $_POST['name']);\n\t\t$email = mysqli_real_escape_string($conn, $_POST['email']);\n\t\t$password = mysqli_real_escape_string($conn, $_POST['password']);\n\t\t$contact = mysqli_real_escape_string($conn, $_POST['contact']);\n\t\t$dept = mysqli_real_escape_string($conn, $_POST['dept']);\n\t\t$type = mysqli_real_escape_string($conn, $_POST['choice']);\n\n\t\t$sql = \"SELECT * FROM employee WHERE employee.email='$email'\";\n\t\t$result = mysqli_query($conn, $sql);\n\t\t$check = mysqli_num_rows($result);\n\t\tif($check == 1){\n\t\t\t// Employee with this email already exists\n\t\t\theader('Location: ../addEmployee.php?user_exists=true');\n\t\t}else{\n\t\t\t// Create new Employee\n\t\t\tif($type == \"normal\"){\n\t\t\t\t// Permanent Employee\n\t\t\t\t$salary = mysqli_real_escape_string($conn, $_POST['ann_salary']);\n\n\t\t\t\t$sql = \"INSERT INTO employee(name,email,password,contact,department,salary) VALUES('$name','$email','$password','$contact','$dept','$salary')\";\n\n\t\t\t\t$result = mysqli_query($conn, $sql);\n\t\t\t\tif($result){\n\t\t\t\t\t$last_id = mysqli_insert_id($conn);\n\t\t\t\t\t$sql = \"INSERT INTO permanent_trainer(emp_id) VALUES($last_id)\";\n\t\t\t\t\t$result2 = mysqli_query($conn, $sql);\n\t\t\t\t\t\n\t\t\t\t\theader('Location: ../admin.php?p_emp_added=true');\n\t\t\t\t}\n\t\t\t}elseif($type == \"temp\"){\n\t\t\t\t// Temporary Employee\n\t\t\t\t$salary = mysqli_real_escape_string($conn, $_POST['mon_salary']);\n\n\t\t\t\t$sql = \"INSERT INTO employee(name,email,password,contact,department) VALUES('$name','$email','$password','$contact','$dept')\";\n\t\t\t\t$result = mysqli_query($conn, $sql);\n\t\t\t\tif($result){\n\t\t\t\t\t$last_id = mysqli_insert_id($conn);\n\t\t\t\t\t$sql = \"INSERT INTO temporary_trainer(emp_id,monthly_salary) VALUES($last_id,$salary)\";\n\t\t\t\t\t$result2 = mysqli_query($conn, $sql);\n\t\t\t\t\theader('Location: ../admin.php?t_emp_added=true');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function editEmployee()\n\t{\n\t\tif (true === $this->flag)\n\t\t{\n\t\t\tif (isset($this->dataArray))\n\t\t\t{\n\t\t\t\t$array = array();\n\t\t\t\t$name = $this->dataArray['name_employee'];\n\t\t\t\t$email = $this->dataArray['email_employee'];\n\t\t\t\t$pass = $this->dataArray['pass_employee'];\n\t\t\t\t$key_employee = $this->encodeObj->generateCode($name);\n\t\t\t\tif (0 != strlen($name))\n\t\t\t\t{\n\t\t\t\t\t$array['name_employee'] = $name;\n\t\t\t\t}\n\t\t\t\tif (0 != strlen($email))\n\t\t\t\t{\n\t\t\t\t$arr = $this->queryToDbObj\n\t\t\t\t\t\t->getEmployeeForCheckExists($email);\n\t\t\t\t\t\tif(!empty($arr))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t $this->error['ERROR_STATUS'] = ERROR_EXISTS;\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 $array['mail_employee'] = $email;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (0 != strlen($pass))\n\t\t\t\t{\n\t\t\t\t\t$array['passwd_employee'] = md5($key_employee.$pass.SALT);\n\t\t\t\t\t$array['key_employee'] = $key_employee;\n\t\t\t\t}\n\t\t\t\t$id_employee = $this->data->getParams();\n\t\t\t\t$id_employee = abs((int)$id_employee['id']);\n\t\t\t\t$rez = $this->queryToDbObj\n\t\t\t\t\t->setEmployeeNewData($array, $id_employee);\n\n\t\t\t\treturn $rez;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$id_employee = $this->data->getParams();\n\t\t\t\t$rez = $this->queryToDbObj\n\t\t\t\t\t->getEmployeeById($id_employee['id']);\n\t\t\t\t$arr['EMPLOYEE_N'] = $rez[0]['name_employee'];\n\t\t\t\t$arr['EMPLOYEE_EMAIL'] = $rez[0]['mail_employee'];\n\t\t\t}\n\t\t}\n\n\t\treturn $arr;\n\t}", "public function getUser(string $employeeId);", "function userinfo($empcode){\n $sql = \"SELECT * FROM UserManager WHERE EmpCode = '$empcode'\";\n $query = $this->db->query($sql);\n if ($query) {\n return $query->result_array();\n } else {\n return false;\n } \n }", "public function employee()\n {\n return $this->belongsTo(Employee::class, 'employee_id');\n }", "public function employees()\n\t{\n\t\treturn $this->hasOne(Employee::class,'id','emp_id');\t\t\t\t\n\t}", "public function memployee_list()\n {\n $this->AdminAuthCheck();\n $all_employee= DB::table('tbl_employee')\n\t\t\t\t\t\t\t\t->join('tbl_grade','tbl_employee.grade_id','=','tbl_grade.grade_id')\n ->get();\n return view('manager.employee_list',compact('all_employee'));\n }", "public function show(Employeepatient $employeepatient)\n {\n //\n }", "public function GetAppraisalEmployeeData(){\n $sql = \"select appraisal_employee.*,\n employee.first_name,\n employee.last_name,\n designation.des_name,\n appraisal_category.category_name\n from appraisal_employee\n left join employee on appraisal_employee.em_id = employee.em_id\n left join designation on employee.des_id = designation.id\n left join appraisal_category on appraisal_employee.category_id = appraisal_category.id\";\n $query = $this->db->query($sql);\n $result = $query->result();\n\n return $result;\n }", "public function showEmployees() {\n\n $employeeModel = $GLOBALS[\"employeeModel\"];\n\n // get all the employees from the db.\n $included_employee = $employeeModel->getAll();\n $data = array(\"included_employees\" => $included_employee);\n return $this->render(\"listEmployees\", $data);\n }", "public function superMng() {\r\n\t\tif ($this->user['user_type_id'] != 19) {\r\n\t\t\t$this->error('无权限访问');\r\n\t\t}\r\n\t\t/*\r\n\t\tif (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {\r\n\t\t\t$data = array();\r\n\t\t\t$data['page'] = I('post.page', 1);\r\n\t\t\t$data['rows'] = I('post.rows', 20);\r\n\t\t\t$data['sort'] = I('post.sort', 'id');\r\n\t\t\t$data['order_by'] = I('post.order', 'ASC');\r\n\t\t\t\r\n\t\t\t$data['city_id'] = $this->city['city_id'];\r\n\t\t\t$data['advance'] = true;\r\n\t\t\t\r\n\t\t\t$id = I('post.id', 0);\r\n\t\t\t$status_id = I('post.status_id', 0);\r\n\t\t\t$area_id = I('post.area_id', 0);\r\n\t\t\t$target_id = I('post.target_id', 0);\r\n\t\t\t$area_names = I('post.area_names', '');\r\n\t\t\t$target_names = I('post.target_names', '');\r\n\t\t\t$start_date = I('post.start_date', '');\r\n\t\t\t$end_date = I('post.end_date', '');\r\n\t\t\t!empty($id) && $data['id'] = $id;\r\n\t\t\t!empty($status_id) && $data['status_id'] = $status_id;\r\n\t\t\t!empty($start_date) && $data['exm_start_date'] = $start_date;\r\n\t\t\t!empty($end_date) && $data['exm_end_date'] = $end_date;\r\n\t\t\t\r\n\t\t\tif (!empty($area_id)) {\r\n\t\t\t\t$data['area_id'] = $area_id;\r\n\t\t\t}else if (!empty($area_names)) {\r\n\t\t\t\t$arr = explode(',', $area_names);\r\n\t\t\t\tforeach($arr as $k=>$v) {\r\n\t\t\t\t\t$data['area' . ($k+1)] = $v;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (!empty($target_id)) {\r\n\t\t\t\t$data['target_id'] = $target_id;\r\n\t\t\t}else if (!empty($target_names)) {\r\n\t\t\t\t$arr = explode(',', $target_names);\r\n\t\t\t\tforeach($arr as $k=>$v) {\r\n\t\t\t\t\t$data['target' . ($k+1)] = $v;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//print_r($data);exit;\r\n\t\t\t$IssueEvent = A('Issue', 'Event');\r\n\t\t\t\r\n\t\t\t$res = $IssueEvent->getIssueList($data);\r\n\t\t\t\t\r\n\t\t\techo $this->generateDataForDataGrid($res['total'], $res['data']);\r\n\t\t\texit;\r\n\t\t}*/\r\n\t\t$AreaEvent = A('Area', 'Event');\r\n\t\t$area_list = $AreaEvent->getAreaList($this->city['city_id'], 0);\r\n\t\t$this->assign('area_list', $area_list);\r\n\t\t\r\n\t\t$TargetEvent = A('Target', 'Event');\r\n\t\t$target_list = $TargetEvent->getTargetList($this->city['city_id'], 0);\r\n\t\t$this->assign('target_list', $target_list);\r\n\t\t\r\n\t\t$IssueEvent = A('Issue', 'Event');\r\n\t\t$status_list = M('IssueStatus')->select();\r\n\t\tforeach($status_list as $key=>$row) {\r\n\t\t\t\t$status_list[$key]['name'] = $IssueEvent->getStatusName($row['status_id'], $this->user['user_type_id'], $row['name']);\r\n\t\t}\r\n\t\t$this->assign('status_list', $status_list);\r\n\t\t\r\n\t\t$this->assign('title', '数据管理');\r\n\t\t$this->display('Issue:superMng');\r\n\t}", "public function getEmpleado() {\r\n return $this->empleado;\r\n }", "public function index_get()\n\t{\n\t\t$employee = new EmployeeModel;\n\t\t$result_emp =$employee->get_employee();\n\t\t$this->response($result_emp,200);\n\t}", "function dbCreateEmpQuery($empCodeName,$empFirstName,$empLastName,$empDoB,$empBloodGroup,$empGender,$empPhoneNumPersonal,$empPhoneNumOffice,$empParmanentAddress,$empPresentAddress,$empDptId,$empDesiId,$empEmailAddress,$empLoginPass,$userCodeWhoCreateEmp,$empVerification,$empType)\n\t\t{\n\t\t\t$objDbOperation = new DbOperation();\n\t\t\t$this->check=0;\n\t\t\t\n\t\t\t$columnsName = \"`eEmployeeCodeNumber`,`eFirstName`,`eLastName`,`eDateOfBirth`,`eBloodGroup`,`eGender`,`ePhoneNumberPersonal`,`ePhoneNumberOffice`,`eParmanentAddress`,`ePresentAddress`,`eDptId`,`eDesignationId`,`eEmailAddress`,`ePassword`,`eEmployeeCodeNumberWhoAddEmployee`,`eEmployeeVerification`,`eEmpType`\";\n\t\t\t//database column name\n\t\t\t$tablesName = \"`employeeinfo`\";\n\t\t\t//database table name\n\t\t\t$conditions = \"'\".$empCodeName.\"','\".$empFirstName.\"','\".$empLastName.\"','\".$empDoB.\"','\".$empBloodGroup.\"','\".$empGender.\"','\".$empPhoneNumPersonal.\"','\".$empPhoneNumOffice.\"','\".$empParmanentAddress.\"','\".$empPresentAddress.\"','\".$empDptId.\"','\".$empDesiId.\"','\".$empEmailAddress.\"','\".$empLoginPass.\"','\".$userCodeWhoCreateEmp.\"','\".$empVerification.\"','\".$empType.\"'\";\n\t\t\t// conditions, what we want to apply\n\t\t\t$result = $objDbOperation->dbInsert($columnsName,$tablesName,$conditions);\n\t\t\t//var_dump($result);\n\t\t\tif($result)\n\t\t\t{\n\t\t\t\t$this->CreatedOrNot = 1;\n\t\t\t\t$this->check = 1;\t\t\t\t\n\t\t\t}\n\t\t\t//This if statement will execute For not creation Employee\n\t\t\tif($this->check==0)\n\t\t\t{\n\t\t\t\t$this->CreatedOrNot=0;\n\t\t\t}\n\t\t}", "public function findUser($mobile);", "public function packingemployees()\r\n\t{\r\n\t\t$crud = new grocery_CRUD();\r\n\t\t$crud->set_theme('datatables');\r\n\t\t$crud->required_fields('employeeId', 'name', 'password');\r\n\t\t$crud->display_as('employeeId', '工号')->display_as('name', '姓名')->display_as('password', '密码');\r\n\t\t$output = $crud->render();\r\n\t\tforeach ($output as $key=>$value)\r\n\t\t{\r\n\t\t\t$this->smarty->assign($key, $value);\r\n\t\t}\r\n\t\t$this->smarty->assign('title', '包装用户');\r\n\t\t$this->smarty->display('firstPage.tpl');\t\t\r\n\t}", "public function create_employee()\n {\n //get dropdown data\n $functional_units = [];\n $data = [];\n $this->get_data($data, $functional_units);\n\n return view('accounts.create_employee')->with([\n 'functional_units' => $functional_units, \n 'data' => $data\n ]);\n }" ]
[ "0.61257786", "0.6084011", "0.58897", "0.5787911", "0.5718764", "0.5712554", "0.5704612", "0.56070507", "0.5572408", "0.5550776", "0.5516409", "0.54929566", "0.54775256", "0.5475962", "0.5465419", "0.54384214", "0.5436511", "0.542072", "0.5417289", "0.53847605", "0.5384535", "0.5380709", "0.533107", "0.533107", "0.533107", "0.533107", "0.533107", "0.533107", "0.533107", "0.533107", "0.533107", "0.533107", "0.533107", "0.533107", "0.5324326", "0.53211635", "0.53162986", "0.5309632", "0.5302922", "0.52968425", "0.5292986", "0.5292826", "0.52921", "0.52798915", "0.5269028", "0.5268368", "0.52670634", "0.5249843", "0.5245136", "0.5238467", "0.52340144", "0.522366", "0.5216994", "0.5210683", "0.5201233", "0.5200618", "0.5187244", "0.5175656", "0.5169049", "0.5169049", "0.5169049", "0.5169049", "0.5169049", "0.5169049", "0.51675624", "0.51532954", "0.515041", "0.51484054", "0.51437956", "0.51400506", "0.51348275", "0.5134029", "0.51336175", "0.5132887", "0.513235", "0.5123656", "0.5114513", "0.5111852", "0.5108752", "0.5105357", "0.5105173", "0.50991124", "0.50843984", "0.508422", "0.5079597", "0.50786257", "0.50783277", "0.5077886", "0.50773174", "0.5076999", "0.50743294", "0.50667435", "0.5066719", "0.50652456", "0.50575393", "0.50558716", "0.5055003", "0.5051958", "0.50512767", "0.5050154" ]
0.5846865
3
====== Set Get Result Type =====
public function setResultType($val){ if(trim($val) != ""){ $this->resultType = trim($val); }else{ $this->resultType = "Array"; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function responseType ();", "public function get_type();", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "private function get_type() {\n\n\t}", "function getType()\t { return $this->type;\t }", "private function get_type(){\n\t\treturn $this->_type;\n\t}", "public function get_type(): string;", "function getType() { return $this->_type; }", "function getType() { return $this->readType(); }", "function _get_type() {\n\t\treturn $this->type();\n\n\t}", "function getType() { \n\t\treturn $this->_type; \n\t}", "public function get_type(){ return $this->_type;}", "public function getType()\n { return $this->get('type'); }", "public function result($type = 'object')\n\t{\n\t\tif ($type === 'object')\n\t\t{\n\t\t\treturn $this->result_object();\n\t\t}\n\t\telseif ($type === 'array')\n\t\t{\n\t\t\treturn $this->result_array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->custom_result_object($type);\n\t\t}\n\t}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "final protected function get_type() {\n return $this->type;\n }", "public function getType(){\n return $this->type;\n }", "public function getType(){\n return $this->type;\n }", "public function GetType(){\r\n\t\treturn $this->type;\r\n\t}", "public function getType(){ }", "public function GetType(){\r\r\n\t\treturn $this->type;\r\r\n\t}", "function getType () {\n\t\treturn $this->type;\n\t}", "public function getType():string { return $this->type; }", "abstract protected function getType();", "function getType() ;", "function getType() ;", "function getType() ;", "function getType() {\n\t\treturn $this->type;\n\t}", "public function get_type(){\n\t\treturn $this->_type;\n\t}", "public function get($type);", "public function getResultClass();", "public function getValue() {\n return $this->type;\n }", "public function getType()\n {\n\treturn $this->type;\n }", "function getType() {\n return $this->type;\n }", "public function getType() \n {\n return $this->_type;\n }", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();" ]
[ "0.6954915", "0.68674046", "0.68476486", "0.68476486", "0.68473315", "0.6847215", "0.6846058", "0.68439883", "0.67430454", "0.6672242", "0.6645201", "0.66145843", "0.6589703", "0.6565559", "0.65616256", "0.65592295", "0.6531488", "0.6526389", "0.6505215", "0.6505215", "0.6505076", "0.6505076", "0.6505076", "0.65045947", "0.65045947", "0.65045947", "0.65045947", "0.65045947", "0.65045947", "0.65045947", "0.65045947", "0.65045947", "0.65045947", "0.64934963", "0.6480231", "0.6480231", "0.64765275", "0.64710325", "0.64630866", "0.6445784", "0.6443467", "0.64179206", "0.6408811", "0.6407395", "0.64071155", "0.6404365", "0.6402715", "0.6394426", "0.6386419", "0.6381698", "0.6377554", "0.6366515", "0.63613635", "0.63595504", "0.63595504", "0.63595504", "0.63595504", "0.63595504", "0.63595504", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053", "0.6359053" ]
0.6683183
9
Set attribute swatch option
private function setSwatchAttributeOption( AttributeInterface $attribute, AttributeOption $option, string $optionId ): void { $optionsValue = trim($option->getLabel() ?: ''); if ($this->swatchHelper->isVisualSwatch($attribute)) { if (strpos($optionsValue, "#") === 0) { $attribute->setData('swatchvisual', ['value' => [$optionId => $optionsValue]]); } } else { $options = []; $options['value'][$optionId][Store::DEFAULT_STORE_ID] = $optionsValue; foreach ($option->getStoreLabels() as $label) { if ($label->getData('swatchtext') !== null) { $options['value'][$optionId][$label->getStoreId()] = $label->getData('swatchtext'); } } $attribute->setData('swatchtext', $options); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAttributes();", "function set_attr($attr=array()) {\n $this->other_attr = $attr;\n }", "public function testSetAttribs()\n {\n $this->todo('stub');\n }", "function useattrib($attribute) { atkuse(\"attribute\", $attribute); }", "public function setAttributes($attributes){ }", "public function setAttribs($attribs) {\n\t\t$this->_attribs = $attribs;\n\t}", "public function set_attribute($name, $value)\n {\n }", "function __set($attributeToChange, $newValueToAssign) {\n //check that name is valid class attribute\n switch($attributeToChange) {\n case \"name\":\n $this->name = $newValueToAssign;\n break;\n case \"favoriteFood\":\n $this->favoriteFood = $newValueToAssign;\n break;\n case \"sound\":\n $this->sound = $newValueToAssign;\n break;\n default:\n echo $attributeToChange . \" was not found <br>\";\n }\n echo \"Set \" . $attributeToChange . \" to \" . $newValueToAssign . \"<br>\";\n }", "public function setAttributes($attributes);", "public function setAttribute($attribute, $value)\n {\n }", "public function initAttribute();", "public function define_attribute($attribute,$value)\n\t\t{\n\t\t\tif(!isset($this->matchcode[$attribute]))\n\t\t\t{\n\t\t\t\terror_log(__FILE__.' name '.$attribute.' not defined in matchcode array');die();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($this->matchcode[$attribute][1] == 'A' || $this->matchcode[$attribute][1] == 'W')\n\t\t\t\t{\n\t\t\t\t\t$var = $this->matchcode[$attribute][0];\n\t\t\t\t\t$this->$var = $value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\terror_log(__FILE__.' name '.$attribute.' no write access');die();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function setAttributes(array $attributes);", "public function setAttributes(array $attributes);", "public function setAttributes(array $attributes);", "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 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 setAttr($attribute, $value) {\n $this->attributes[$attribute] = $value;\n }", "public function setAttribute($attribute, $value)\r\n\t{\r\n\t\t\r\n\t}", "function enableConfigurableSwatches()\n\t {\n\t \t $eavAttrTable\t\t= Mage::getSingleton('core/resource')->getTableName('eav_attribute');\n\t \t $catalogAttrTable\t= Mage::getSingleton('core/resource')->getTableName('catalog_eav_attribute');\n\t \t $read\t\t\t\t= Mage::getSingleton('core/resource')->getConnection('core_read');\n\t\t\n\t\t$sql\t\t\t\t= \"SELECT `e`.`attribute_id` FROM `\" . $eavAttrTable . \"` as `e` \n\t\t\t\t\t\t\t\tJOIN `\" . $catalogAttrTable . \"` as `c` ON `e`.`attribute_id` = `c`.`attribute_id`\n\t\t\t\t\t\t\t\tWHERE `e`.`entity_type_id` = '4' \n\t\t\t\t\t\t\t\tAND `e`.`frontend_input` = 'select' \n\t\t\t\t\t\t\t\tAND `e`.`is_user_defined` = '1' \n\t\t\t\t\t\t\t\tAND `c`.`is_configurable` = 1 \";\n\t\t$result\t\t\t\t= $read->fetchAll($sql);\n\t\tif ($result) {\n\t\t\t$arr = array();\n\t\t\tforeach ($result as $id) {\n\t\t\t\tarray_push($arr, $id['attribute_id']);\n\t\t\t}\n\t\t\t$ids = implode(',', $arr);\n\t\t\tif ($ids) {\n\t\t\t\t$configModel = new Mage_Core_Model_Config();\n\t\t\t\t$configModel->saveConfig('configswatches/general/enabled', \"1\", 'default', 0);\n\t\t\t\t$configModel->saveConfig('configswatches/general/swatch_attributes', $ids, 'default', 0);\n\t\t\t}\n\t\t}\n\t\treturn $ids;\n\t\t}", "public function computeRendermodeAttribute(): void\n {\n $renderer = $this->getRenderer();\n $this->attributes['data-rendermode'] = $renderer->getMode() ?? 'default';\n }", "protected function setAdditionalAttributes(array &$attributes, $html_tag) {\n switch ($html_tag) {\n case 'img':\n $attributes['style'][] = 'width:0;';\n $attributes['style'][] = 'height:0;';\n break;\n\n case 'iframe':\n $attributes['height'] = '1';\n $attributes['width'] = '1';\n $attributes['frameborder'] = '0';\n $attributes['scrolling'] = 'no';\n break;\n }\n }", "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 }", "protected function _setAttribute(&$elt, $const, $bool)\n {\n if ($bool) {\n $elt['a'] |= $const;\n } else {\n $elt['a'] &= ~$const;\n }\n }", "public function __construct()\n {\n $defaultAttributeSetId = \\Mage::getSingleton('eav/config')\n ->getEntityType(\\Mage_Catalog_Model_Product::ENTITY)\n ->getDefaultAttributeSetId();\n $set = \\Mage::getModel('eav/entity_attribute_set')->load(4);\n $gid = $set->getDefaultGroupId();\n\n $that = $this;\n $this->setDefaultParameters(array(\n 'type'=> 'text',\n 'input'=> 'text',\n 'label'=> 'Test Attribute',\n 'global'=> \\Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,\n 'is_required'=> '0',\n 'is_comparable'=> '0',\n 'is_searchable'=> '0',\n 'is_unique'=> '1',\n 'is_configurable'=> '1',\n 'user_defined'=> '1',\n 'attribute_code' => function() use($that) { return $that->nextValue('attribute_code', function($i){return 'attribute_fixture_code_' . $i; }); },\n 'frontend_label' => function() use($that) { return $that->nextValue('frontend_label', function($i){return 'Attribute Fixture ' . $i; }); },\n 'attribute_set_id' => $defaultAttributeSetId,\n 'attribute_group_id' => $gid\n ));\n }", "public function setAttribute($name, $value);", "public function set_attributes()\n {\n $this->id = 0;\n $this->set_process();\n $this->set_decomposition();\n $this->set_technique();\n $this->set_applicability();\n $this->set_input();\n $this->set_output();\n $this->set_validation();\n $this->set_quality();\n $this->score = 0;\n $this->matchScore = 0;\n $this->misMatch = \"\";\n }", "public function setAttribute(string $attribute, string $value);", "public function setAttrs($attrs);", "function disableConfigurableSwatches()\n\t {\n\t \t $configModel = new Mage_Core_Model_Config();\n\t \t $configModel->saveConfig('configswatches/general/enabled', \"0\", 'default', 0);\n\t \t $configModel->saveConfig('configswatches/general/swatch_attributes', \"\", 'default', 0);\n\t }", "public function __set($attri, $value) {\n if (in_array($attri, self::DYN_ATTRIBUTES)) {\n $this->{$attri} = $value;\n }\n }", "abstract public function attr(string $component_name, string $attr_data = null);", "protected function setAttribute($dataArray, $attribute)\n {\n if (isset($dataArray[$attribute])) {\n if (in_array($attribute, self::$validAttributes)) {\n $this->$attribute = $dataArray[$attribute];\n }\n }\n }", "public function setAttributes($item,$attributes) {\n\t\t$this->_properties[$item]['Attributes'] = ' '.$attributes;\n\t}", "public function setAttribute($name, $value)\n\t\t{\n\t\t\tswitch(strtolower($name))\n\t\t\t{\n\t\t\t\tcase 'mode':\n\t\t\t\t\t$this->setDisplayMode($value);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tparent::setAttribute($name, $value);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function testGetChangeAttributes()\n {\n }", "public function __set($name, $value)\n { \n //set the attribute with the value\n $this->$name = $value;\n }", "public function __set($name,$value)\n\t{\n\t\tif(in_array($name,$this->config_other_attributes))\n\t\t\t$this->list_other_attributes[$name]=$value;\n\t\telse \n\t\t\tparent::__set($name,$value);\n\t}", "public function __set($name, $value)\n {\n // Don't allow to set attributes\n }", "public function __set($attrib, $value) {\r\n if (in_array($attrib, $this->commonAttribs)) {\r\n $this->$attrib = $value;\r\n }\r\n }", "public function __set($attrib, $value) {\r\n if (in_array($attrib, $this->commonAttribs)) {\r\n $this->$attrib = $value;\r\n }\r\n }", "public function setAttribs(array $attribs)\n {\n $this->clearAttribs();\n return $this->addAttribs($attribs);\n }", "public function setAttributes(array $params)\n {\n foreach($params as $name => $value) {\n $this->setAttribute($name, $value);\n }\n }", "abstract public function setAttribute($key, $value);", "public function setAttributes(array $attributes, $merge = false);", "public function setDefaultAttribute($value){\n $this->attributes['default'] = ($value === 'true' || $value ? true : false);\n}", "public function isSwatchAttribute(Attribute $attribute)\n {\n return $this->swatchTypeChecker->isSwatchAttribute($attribute);\n }", "public function __set($attribute, $param) {\n $this->$attribute = $param;\n }", "protected function setRegexAttributes()\n {\n $find = '#{([a-z][a-zA-Z0-9_]*)}#';\n $attributes = $this->route->attributes;\n $newAttributes = [];\n preg_match_all($find, $this->regex, $matches, PREG_SET_ORDER);\n foreach ($matches as $match) {\n $name = $match[1];\n $subpattern = $this->getSubpattern($name);\n $this->regex = str_replace(\"{{$name}}\", $subpattern, $this->regex);\n if (! isset($attributes[$name])) {\n $newAttributes[$name] = null;\n }\n }\n $this->route->attributes($newAttributes);\n }", "public function setAttrList($attrList) {\n\t$this->attrList = $attrList;\n }", "public function __set($name, $value)\n\t{\n\t\t$this->attributes[$name] = $value;\n\t\t\n\t}", "function gdl_style_att( $attribute, $value ){\n\t\treturn $attribute . ': ' . $value . '; ';\n\t}", "function set_variation_attributes(array $data) {\n\t\tif ( ! empty( $this->variation_data ) && is_array( $this->variation_data ) ) foreach ($this->variation_data as $attribute=>$value) {\n\t\t\tif(isset($data[$attribute])) {\n\t\t\t\t$this->variation_data[$attribute] = $data[$attribute];\n\t\t\t}\n\t\t}\n\t}", "protected function configure($options = array(), $attributes = array())\n {\n \n }", "function set($attr, $value)\r\n\t{\r\n\t\t$this->$attr = $value;\r\n\t}", "public function __SET($attr, $value){ //Establece valor y atributo\n\n\t\t\t$this->$attr=$value;\n\t\t}", "abstract protected function mustApplyRuleOnAttribute(): bool;", "public function __set($attribute, $value){\n\t\t$this->$attribute = $value;\n\t}", "protected function configure($options = array(), $attributes = array())\n {\n parent::configure($options, $attributes);\n $this->addOption('asset_type', 'image');\n }", "public function setAttributeList(array $attribute_list): void;", "function atkClone($attribute)\n{\n\tif (intval(substr(phpversion(),0,1))<5)\n\t$attr = $attribute;\n\telse\n\t$attr = clone($attribute);\n\n\treturn $attr;\n}", "public function __set( $name, $value )\n\t{\n\t\t$this->attributes[$name] = $value;\n\t}", "public function setAttribute($key, $value);", "public function setAttribute($key, $value);", "abstract protected function setValidationCustomAttributes(): array;", "public function __set($attribute, $value)\n {\n array_set($this->attributes, $attribute, $value);\n }", "function std_attr($at){\n switch($at){\n case 'wrap': $attr = array('id'=>strval($this->obj->id));break;\n default:\n $attr = array();\n\n }\n return new opc_attrs(NULL,$attr);\n }", "public function createAttribute()\n\t{\n\n\t\t$this->createCustomAttribute($this->attributeName, $this->arguments);\n\n\t}", "public function setAttribute($attribute, $value) {\n\t\tif (!$this->attributes) {\n\t\t\t$this->attributes = tx_newspaper::selectOneRow(\n\t\t\t\t\t'*', tx_newspaper::getTable($this), $this->condition\n\t\t\t);\n\t\t}\n\t\t\n\t\t$this->attributes[$attribute] = $value;\n\t}", "public function attr($attribute, $value = null)\n {\n return call_user_func_array(\n array($this, 'set'),\n func_get_args()\n );\n }", "protected function configure($options = array(), $attributes = array())\n {\n $this->addOption('format', '%isd% %mobile%');\n }", "public function setCompact()\n {\n parent::setAttr(\"compact\");\n }", "public function setNameAttribute($value){//\n $this->attributes['name'] = strtolower($value);\n }", "public function setAttr($attr) {\n\t\t$this->attr = $attr;\n\t\treturn $this;\n\t}", "public function setAttribute($key, $value = null);", "protected function _generateAttributeOnToken()\n\t{\n\t\tif (!isset($this->_tempToken[\"args\"][\"attributes\"])) {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"] = array();\n\t\t}\n\t\tif (isset($this->_tempToken[\"args\"][\"attributes\"][$this->_attribute])) {\n\t\t\t$this->_attribute = null;\n\t\t} else {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"][$this->_attribute] = array(\n\t\t\t\t\"value\" => \"\"\n\t\t\t);\n\t\t}\n\t}", "public function set_attribute( $attribute_name = '', $value = null ) {\n\t\t\n\t\t$this->attributes[$attribute_name] = $value;\n\t\t\n\t}", "public function setAttributes($attributes)\n {\n foreach($attributes as $key => $value) {\n $this->$key = $value;\n }\n }", "protected function initializeAttributes() {\n\t\tparent::initializeAttributes();\n\n\t\t$this->attributes['subtype'] = \"widget\";\n\t}", "function filter_woocommerce_rest_prepare_product_object( $response, $object, $request ) {\n if( empty( $response->data ) ) {\n return $response;\n }\n\n $attribute_taxonomies = wc_get_attribute_taxonomies();\n\n // Loop through the attributes on current product\n $attributes = $response->data['attributes'];\n foreach($attributes as $attrkey => $attribute) {\n\n /* ########################################################\n - Adding new swatch key to attribute response for color attributes,\n which holds the hex code for each swatch color option\n ######################################################## */\n // Get an array of attributes whose attribute type is color\n $color_type_attribute_taxonomies = array_filter($attribute_taxonomies, function($attribute_taxonomy) {\n return $attribute_taxonomy->attribute_type == 'color';\n });\n // Loop through the color type attributes\n foreach($color_type_attribute_taxonomies as $tax_object) {\n //Check if current attribute is a color type attribute\n if ($attribute['id'] == $tax_object->attribute_id) {\n // Get current attribute's options\n $options = $response->data['attributes'][$attrkey]['options'];\n // Get current attribute's terms\n $color_terms = get_terms('pa_' . $tax_object->attribute_name);\n foreach( $options as $option ) {\n foreach($color_terms as $term) {\n if ($term->name == $option) {\n // Add a new swatch with hex value for each color option\n $response->data['attributes'][$attrkey]['swatches'][$option] = get_term_meta( $term->term_id, 'product_attribute_color', true);\n }\n }\n }\n }\n }\n\n /* ########################################################\n - Adding attribute taxonomy to the attribute response\n - Adding attribute identifier to the attribute response\n - Adding more detailed option data to the attribute options response\n ######################################################## */\n foreach($attribute_taxonomies as $attribute_taxonomy) {\n if ($attribute['id'] == $attribute_taxonomy->attribute_id) {\n\n /* Add slug to current attribute response */\n $response->data['attributes'][$attrkey]['taxonomy'] = ('pa_' . $attribute_taxonomy->attribute_name);\n\n /* Add attribute identifier to current attribute response */\n $response->data['attributes'][$attrkey]['slug'] = $attribute_taxonomy->attribute_name;\n\n /* Replace default options data with detailed options data for current attribute */\n $options = $response->data['attributes'][$attrkey]['options'];\n $new_options = array();\n $attribute_terms = get_terms('pa_' . $attribute_taxonomy->attribute_name);\n\n foreach( $options as $option ) {\n foreach($attribute_terms as $attribute_term) {\n if ($attribute_term->name == $option) {\n $new_options[] = (object) [\n 'id' => $attribute_term->term_id,\n 'name' => $attribute_term->name,\n 'slug' => $attribute_term->slug,\n 'taxonomy' => $attribute_term->taxonomy,\n 'description' => $attribute_term->description,\n 'count' => $attribute_term->count\n ];\n }\n }\n }\n $response->data['attributes'][$attrkey]['options'] = $new_options;\n }\n }\n }\n\n /* ########################################################\n - Replacing Variation IDs with Variation details\n ######################################################## */\n\n // Get the current product object\n $variation_ids = $response->data['variations'];\n\n $detailed_variations = array_map(function($variation_id) {\n $variation = wc_get_product($variation_id);\n return (object) [\n 'variation_id' => $variation->get_id(),\n 'image_url' => wp_get_attachment_url($variation->get_image_id()),\n 'variation_regular_price' => $variation->get_regular_price(),\n 'variation_sale_price' => $variation->get_sale_price(),\n 'attributes' => $variation->get_attributes(),\n 'is_on_sale' => $variation->is_on_sale()\n ];\n }, $variation_ids);\n\n $response->data['variations'] = $detailed_variations;\n\n\n /* ########################################################\n - Get ALL Variation attributes for a product\n ######################################################## */\n if ($response->data['type'] == 'variable') {\n $variation_attributes = wc_get_product($response->data['id'])->get_variation_attributes();\n $variation_attributes = array_map(function($attribute) {\n return (array_values($attribute));\n }, $variation_attributes);\n $response->data['variation_attributes'] = $variation_attributes;\n }\n\n\n\n /* Return new response */\n return $response;\n}", "public function setAttributes(array $attributes): AssetInterface\n {\n }", "public function set_attributes($attributes)\n {\n }", "private function renameOldAttributes()\n {\n if ($this->mageVersion < '2.2.5') {\n $attributes = $this->attrNames;\n foreach ($attributes as $key => $attr) {\n $isExist = $this->eavConfig->getAttribute('catalog_product', 'wwe_'.$attr.'')->getAttributeId();\n if ($isExist != null) {\n $updateSql = \"UPDATE \".$this->tableNames['eav_attribute'].\" \"\n . \"SET attribute_code = 'en_\".$attr.\"', is_required = 0 \"\n . \"WHERE attribute_code = 'wwe_\".$attr.\"'\";\n $this->connection->query($updateSql);\n }\n }\n }\n }", "protected function configure($options = array(), $attributes = array())\r\n\t{\r\n\t\t$this->addOption('value');\r\n\t}", "public function set_attrs($xml, $cloned=true)\n\t{\n\t\t$this->attrs['type'] = $xml->localName;\n\t\tparent::set_attrs($xml, $cloned);\n\n\t\t// set attrs[multiple] from attrs[options]\n\t\tif ($this->attrs['options'] > 1)\n\t\t{\n\t\t\t$this->setElementAttribute($this->id, 'multiple', true);\n\t\t}\n\t}", "public function attr()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && is_array($args[0])) {\n $this->attributes = $args[0];\n return $this;\n } elseif (isset($args[0]) && isset($args[1])) {\n $this->attributes[$args[0]] = $args[1];\n return $this;\n } elseif (isset($args[0])) {\n return isset($this->attributes[$args[0]]) ? $this->attributes[$args[0]] : null;\n }\n\n return $this->attributes;\n }", "public function CreateAttributeDiff($attribute_data,$attribute_set_id,$diff_attr){\n\n $diff_code = '_d';\n if($diff_attr == 'filter'){\n $diff_code = '_f';\n }\n\n $attribute_code = $attribute_data['attribute_code'] . $diff_code;\n $attribute_name = $attribute_data['attribute_name'] . $diff_code;\n $field_type_id = $attribute_data['field_type_id'];\n $input_type = 'text';\n\n $input_type = 'select';\n\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\".$attribute_code,0);\n\n if( isset($result['message']) ){\n\n $data['attribute'] = array(\n \"attribute_code\" => $attribute_code,\n \"frontend_input\" => $input_type,\n \"scope\" => \"global\",\n \"default_value\" => \"\",\n \"is_unique\" => 0,\n \"is_required\" => 0,\n \"is_searchable\" => 0,\n \"is_visible_in_advanced_search\" => 0,\n \"is_comparable\" => 0,\n \"is_used_for_promo_rules\" => 0,\n \"is_visible_on_front\" => 0,\n \"used_in_product_listing\" => 0,\n \"default_frontend_label\" => $attribute_name,\n \"frontend_labels\" => array(array(\"store_id\" => \"0\", \"label\" => $attribute_name))\n );\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\",1,json_encode($data));\n $attribute_id = $result['attribute_id'];\n\n\n\n //die();\n\n }else{\n $attribute_id = $result['attribute_id'];\n }\n\n $result2 = $this->curlRequest(\"/rest/V1/products/attribute-sets/attributes\",1,json_encode([\n \"attributeSetId\" => $attribute_set_id,\n \"attributeCode\" => $attribute_code,\n \"attributeGroupId\" => 130,\n \"sortOrder\" => 0\n ]) );\n\n return $attribute_id;\n }", "public function setAllowedAttributes(array $allowedAttributes);", "function attribute($identifier, $attribute) {\n\t\treturn 'jQuery(\"'.$identifier.'\").prop(\"'.$attribute.'\")';\n\t}", "public function __set($attr, $value)\n\t{\n\t\t$this->$attr = $value;\n\t}", "public function testAddAttributesToNodeForAttributeWithValue()\n {\n $dom = Document::fromHtml('<p>Hello World</p>');\n $element = $dom->createElement('div');\n $attributes = [\n 'class' => 'myClass',\n 'id' => 'myId',\n ];\n $element->setAttributes($attributes);\n\n $this->assertTrue($element->hasAttributes());\n $this->assertElementHasAttributes($element, $attributes);\n }", "public function __set($name, $value)\n {\n $this->attributes[$name] = $value;\n }", "public function removeAttributes()\n\t{\n\t\tforeach ($this->argsArray(func_get_args()) as $a) {\n\t\t\t$this->removed_attrs[] = $a;\n\t\t}\n\t}", "public function CreateAttributeOption_diff($attribute_code,$option_value,$diff_attr){\n\n $diff_code = '_d';\n if($diff_attr == 'filter'){\n $diff_code = '_f';\n }\n $attribute_code = $attribute_code . $diff_code;\n\n $options = $this->curlRequest(\"/rest/V1/products/attributes/\".$attribute_code.\"/options\",0);\n\n $insert = true;\n foreach($options as $option){\n if($option['label'] == $option_value){\n $insert = false;\n break;\n }\n }\n\n if($insert){\n\n $label = array (\n array(\n \"store_id\" => 1,\n \"label\" => $option_value\n )\n );\n\n $data['option'] = array(\n \"label\" => $option_value,\n \"value\" => $option_value,\n \"store_labels\" => $label,\n \"sort_order\" => 0,\n \"is_default\" => false\n\n );\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\".$attribute_code.\"/options\", 1, json_encode($data) );\n\n }\n return $insert;\n\n }", "function __set ($name, $value)\n\t{\n\t\tswitch ($name) {\n\t\t\tcase \"background\":\n\t\t\t\t$this->_setProperty($name, $value);\n\t\t\tbreak;\n\t\t\tcase \"bgColor\":\n\t\t\tcase \"link\":\n\t\t\tcase \"vLink\":\n\t\t\tcase \"aLink\":\n\t\t\tcase \"text\":\n\t\t\t\t$this->_setProperty($name, $value, \"bool\");\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tparent::__set($name, $value);\n\t\t\tbreak;\n\t\t}\n\t}", "public function setHtmlAttributeWildcards() {}", "public function __set($attribute, $value) {\n $this->setAttribute($attribute, $value);\n }", "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 }", "public function setAttributes($data = []) {\n if (empty($data)) {\n //init\n $data = array_fill_keys(array_keys(static::attributLabels()), null);\n }\n if (is_array($data)) {\n $this->attributes = self::$wpdb->_escape($data);\n } else {\n parse_str($data, $this->attributes);\n }\n foreach ($this->attributes as $name => $value)\n if (property_exists($this, $name)) {\n $this->$name = $this->attributes[$name] = stripslashes_deep($value);\n } else {\n unset($this->attributes[$name]);\n }\n }", "function initByAttribs($attribs) {\n\t\tforeach($attribs as $a=>$b) {\n\t\t\tif (strtolower($a) != \"id\") {\n\t\t\t\tif ($b != \"\") {\n\t\t\t\t\t$this->setElement($a, $b, \"attrib\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.6359591", "0.5986671", "0.5921983", "0.5597901", "0.557272", "0.5512836", "0.54989403", "0.5421103", "0.539422", "0.53904796", "0.5389652", "0.53434515", "0.5341784", "0.5341784", "0.5341784", "0.5327409", "0.5303777", "0.52947956", "0.527504", "0.5274072", "0.5264004", "0.52447236", "0.52434427", "0.5242702", "0.52406174", "0.522088", "0.5215127", "0.52092505", "0.5207518", "0.51909214", "0.51651317", "0.5158186", "0.51072633", "0.50989133", "0.509621", "0.50889206", "0.5086422", "0.5069196", "0.50662947", "0.5063922", "0.5063922", "0.5046718", "0.5043007", "0.50377274", "0.5029654", "0.5028622", "0.5017991", "0.5015403", "0.4992618", "0.49900284", "0.49825507", "0.49759695", "0.49752113", "0.49620506", "0.49575418", "0.4951465", "0.4943922", "0.4943506", "0.49277174", "0.49225187", "0.49142075", "0.4911188", "0.49103445", "0.49103445", "0.48976564", "0.48923603", "0.48848906", "0.48751226", "0.48705754", "0.48696396", "0.48694187", "0.48626754", "0.48571023", "0.4853589", "0.4852784", "0.48482007", "0.48442218", "0.48420906", "0.48410875", "0.48397782", "0.48390597", "0.48364207", "0.48302037", "0.4823736", "0.4816828", "0.48159415", "0.48142728", "0.4811691", "0.48111072", "0.48086682", "0.4802426", "0.48011428", "0.48006198", "0.4792259", "0.47906816", "0.4790042", "0.47889134", "0.4786601", "0.47838902", "0.47837058" ]
0.572727
3
Get option id to create new option
private function getNewOptionId(AttributeOption $option): string { $optionId = trim($option->getLabel() ?: ''); if (empty($optionId)) { $optionId = 'new_option'; } return 'id_' . $optionId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductOptionId();", "public function getOptionId()\n {\n return $this->optionId;\n }", "function ppom_get_option_id($option, $data_name=null) {\n\t\n\t$default_option = is_null($data_name) ? $option['option'] : $data_name.'_'.$option['option'];\n\t\n\t$option_id = empty($option['id']) ? $default_option : $option['id'];\n\n\treturn apply_filters('ppom_option_id', sanitize_key( $option_id ), $option, $data_name );\n}", "public function createOption($attid)\n\t{\n\t\t$t=$this->tablename('eav_attribute_option');\n\t\t$optid=$this->insert(\"INSERT INTO $t (attribute_id) VALUES (?)\",$attid);\n\t\treturn $optid;\n\t}", "function initialiserId()\n {\n if(empty($this->m_idOption))\n {\n $requete = 'SELECT idOption FROM optionHotel WHERE libelleOption=? AND prixOption=?';\n $tabParametres = array($this->m_libelleOption, $this->m_prixOption);\n $tabResultat = $this->m_bdd->selection($requete, $tabParametres);\n $this->m_idOption = $tabResultat[0]['idOption']; \n }\n }", "protected function GetId() {\n\n $Id= $this->GetOption('Id');\n if (!$Id) {\n $Id= $this->GetName(); // let id be same as name\n $Id= str_replace(array('[',']'),'_', $Id); // id cannot contain '[' and ']'\n $Id= trim($Id, '_'); // id cannot start with '_'\n }\n return $Id;\n }", "public function getTagOptionId() : int\n {\n return $this->tagOptionId;\n }", "protected function generateId()\n {\n if (empty($this->editorOptions['id'])) {\n $this->editorOptions['id'] = $this->options['id'] . '-editor';\n }\n if (empty($this->containerOptions['id'])) {\n $this->containerOptions['id'] = $this->options['id'] . '-container';\n }\n if (empty($this->headerOptions['id'])) {\n $this->headerOptions['id'] = $this->options['id'] . '-header';\n }\n if (empty($this->footerOptions['id'])) {\n $this->footerOptions['id'] = $this->options['id'] . '-footer';\n }\n if (empty($this->previewOptions['id'])) {\n $this->previewOptions['id'] = $this->options['id'] . '-preview';\n }\n Html::addCssStyle($this->options, 'height:' . $this->height . 'px');\n }", "function get_id() {\n\t// Check Altis config first.\n\t$juicer_id = has_altis_config() ? Altis\\get_config()['hm-juicer']['juicer-id'] : false;\n\tif ( ! empty( $juicer_id ) ) {\n\t\treturn $juicer_id;\n\t}\n\n\t// Check the JUICER_ID constant and return it if it exists.\n\tif ( defined( 'JUICER_ID' ) ) {\n\t\treturn JUICER_ID;\n\t}\n\n\t// Return the option, if it exists.\n\treturn Settings\\juicer_get_option( 'juicer_id', false );\n}", "public function getAnswerId()\n {\n if ($this->getAnswers()->count()) {\n return $this->getAnswers()->first()->getOptionId();\n }\n\n return null;\n }", "public function getOptionKey()\n {\n return $this->optionKey;\n }", "public function get_option_id( $index ) {\n\t\t$slug = $this->get_args( 'slug' );\n\n\t\treturn $slug . '_' . $index;\n\t}", "public function getId(){\n if(!$this->id){\n return $this->getShippingOptionId().'_'.md5($this->getShippingServiceName());\n }\n return $this->id;\n }", "public function getProducts_options_id() {\n\t\treturn $this->products_options_id;\n\t}", "public function getOptId(string $name, string $label, ?int $default = null): ?int;", "function getNewId();", "public function get_id();", "public function get_id();", "public function getBuyableIdentifier($options = null)\n {\n return $this->id;\n }", "public function getBuyableIdentifier($options = null)\n {\n return $this->id;\n }", "public function getCorrectOptionId(): ?int\n {\n return $this->correctOptionId;\n }", "public static function add_option() {\n\t\tFrmAppHelper::permission_check('frm_edit_forms');\n check_ajax_referer( 'frm_ajax', 'nonce' );\n\n\t\t$id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );\n\t\t$opt_type = FrmAppHelper::get_post_param( 'opt_type', '', 'sanitize_text_field' );\n\t\t$opt_key = FrmAppHelper::get_post_param( 'opt_key', 0, 'absint' );\n\n $field = FrmField::getOne($id);\n\n if ( 'other' == $opt_type ) {\n\t\t\t$opt = __( 'Other', 'formidable' );\n $other_val = '';\n $opt_key = 'other_' . $opt_key;\n } else {\n\t\t\t$opt = __( 'New Option', 'formidable' );\n }\n $field_val = $opt;\n\n $field_data = $field;\n\t\t$field = (array) $field;\n\t\t$field['separate_value'] = isset( $field_data->field_options['separate_value'] ) ? $field_data->field_options['separate_value'] : 0;\n\t\tunset( $field_data );\n\n\t\t$field_name = 'item_meta[' . $id . ']';\n\t\t$html_id = FrmFieldsHelper::get_html_id( $field );\n $checked = '';\n\n if ( 'other' == $opt_type ) {\n\t\t\tinclude( FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-fields/other-option.php' );\n } else {\n\t\t\trequire( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/single-option.php' );\n }\n wp_die();\n }", "public function determineId() {}", "public function createOptionValue($optid,$store_id,$optval)\n\t{\n\t\t$t=$this->tablename('eav_attribute_option_value');\n\t\t$optval_id=$this->insert(\"INSERT INTO $t (option_id,store_id,value) VALUES (?,?,?)\",array($optid,$store_id,$optval));\n\t\treturn $optval_id;\n\t}", "public function createOrGetId($attributeCode, $label)\n {\n if (strlen($label) < 1) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __('Label for %1 must not be empty.', $attributeCode)\n );\n }\n\n // Does it already exist?\n $optionId = $this->getOptionId($attributeCode, $label);\n\n if (!$optionId) {\n // If no, add it.\n\n /** @var \\Magento\\Eav\\Model\\Entity\\Attribute\\OptionLabel $optionLabel */\n $optionLabel = $this->optionLabelFactory->create();\n $optionLabel->setStoreId(0);\n $optionLabel->setLabel($label);\n\n $option = $this->optionFactory->create();\n $option->setLabel($optionLabel);\n $option->setStoreLabels([$optionLabel]);\n $option->setSortOrder(0);\n $option->setIsDefault(false);\n\n $this->attributeOptionManagement->add(\n \\Magento\\Catalog\\Model\\Product::ENTITY,\n $this->getAttribute($attributeCode)->getAttributeId(),\n $option\n );\n\n // Get the inserted ID. Should be returned from the installer, but it isn't.\n $optionId = $this->getOptionId($attributeCode, $label, true);\n }\n\n return $optionId;\n }", "public static function getSelectedFormId() {\n\n return (int) get_option( 'geb_gfe_form_id' );\n }", "public function ultimo_id (){\n\t\t$id= mysqli_insert_id($this->descriptor);\n\t\treturn $id;\n\t}", "public function addOption()\n {\n try {\n $this->validate();\n DB::beginTransaction();\n if ($this->option !== \"\") {\n $this->assessment->options()->create([\n 'option' => $this->option,\n ]);\n }\n $this->option = \"\";\n } catch (\\Throwable $th) {\n DB::rollback();\n session()->flash('error', $th->getMessage());\n }\n DB::commit();\n $this->emitSelf('render');\n }", "public function getBuyableIdentifier( $options = null ) {\n return method_exists( $this, 'getKey' ) ? $this->getKey() : $this->id;\n }", "function add(){\n global $wpdb;\n global $DOPBSP;\n \n $field_id = $_POST['field_id'];\n $position = $_POST['position'];\n $language = $_POST['language'];\n \n $wpdb->insert($DOPBSP->tables->forms_fields_options, array('field_id' => $field_id,\n 'position' => $position,\n 'translation' => $DOPBSP->classes->translation->encodeJSON('FORMS_FORM_FIELD_SELECT_ADD_OPTION_LABEL')));\n $id = $wpdb->insert_id;\n $select_option = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n \n $DOPBSP->views->backend_form_field_select_option->template(array('select_option' => $select_option,\n 'language' => $language));\n \n die();\n }", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "public function create($product_id, $option_id) \n\t{\n\n\n\t\t$order = $this->_get_next_order();\n\n\t\t// Prep the new record\n\t\t$to_insert = array(\n\t\t\t'prod_id' => $product_id,\n\t\t\t'option_id' => $option_id,\n\t\t\t'order' => $order,\n\t\t);\n\t\t\n\t\t// Insert\n\t\treturn $this->insert($to_insert); \t\t\t\n\n\t}", "private function generateId() {\n $this->setId(AgaviToolkit::uniqid(\"ldap_conn_\"));\n }", "function delete(){\n global $wpdb;\n global $DOPBSP;\n \n $id = $_POST['id'];\n \n $select_option = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n $wpdb->delete($DOPBSP->tables->forms_fields_options, array('id' => $id));\n \n echo $select_option->field_id;\n \n die();\n }", "public function create()\n {\n $this->db->query('INSERT INTO ' . $this->db->tableName('p_democracy_votes') . ' (' . $this->db->fieldName('voting_id') . ', ' . $this->db->fieldName('player_id') . ', ' . $this->db->fieldName('type') . ', ' . $this->db->fieldName('comment') . ') VALUES (0, 0, 0, '');\n\n // reads created voting's ID\n $this->data['id'] = $this->db->lastInsertId();\n\n // return name of newly created \n return $id;\n }", "public function getID();", "public function getID();", "public function getID();", "public function obtenerId() {}", "abstract public function get_id();", "public static function getID() {\r\n return 1;\r\n }", "public function insertOption($data);", "function get_id() {\n\t\treturn $this->id;\n\t}", "function jbr_options_validate_ID($ID) {\n\n\treturn $ID;\n\n}", "function getId(){\n\t\tswitch ($this->intBanco){\n\t\t\tcase INT_SQLSERVER:\n\t\t\t\treturn \"\";\n\t\t\t\tbreak;\n\t\t\tcase INT_ORACLE:\n\t\t\t\treturn \"\";\n\t\t\t\tbreak;\n\t\t\tcase INT_POSTGRE:\n\t\t\t\treturn \"\";\n\t\t\t\tbreak;\n\t\t\tcase INT_MYSQL:\n\t\t\t\treturn mysql_insert_id();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t}", "function get_id()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_ID);\r\n }", "function get_id()\n {\n return $this->get_default_property(self :: PROPERTY_ID);\n }", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function getId(){\n return $this->__get('setting_id');\n }", "function get_id() {\n\t\treturn $this->id;\n\n\t}", "function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "public function get_id()\n {\n }", "public function getcreatePersonId()\n {\n return $this->createperson_id;\n }", "public function setId($value,$options=array('required'=>true)){\n #if (!$options['db']){\n \n $this->_id = $value;\n $values = explode('-',$value);\n\n $this->_data['id_conteudo'] = $values[0];\n $this->_data['id_usuario'] = $values[1];\n #}\n return $this;\n }", "public function getSetId() {\r\n\t\treturn $this -> setid;\r\n\t}", "private function _getCreateInvoiceOption()\n {\n return Mage::getStoreConfig('payment/paymentnetwork_pnsofortueberweisung/create_invoice', Mage::app()->getStore()->getStoreId());\n }", "public function __newID() {\n\t\treturn ('#'.$this->_fieldid);\n\t}", "public static function id()\n {\n return 1;\n }", "function get_id() {\n return $this->id;\n }", "function get_id()\n {\n return $this->id;\n }", "function yaz_set_option($id, $options)\n{\n}", "function get_id()\r\n {\r\n return $this->id;\r\n }", "public function store(CreateOptionRequest $request)\n {\n $map = Map::where('slug', request('map'))->first();\n $variant = Variant::where('slug', request('variant'))->first();\n\n $option = Option::create([\n 'map_id' => $map->id,\n 'variant_id' => $variant->id,\n 'can_be_veto_result' => $request->has('can-be-veto-result'),\n 'slug' => Str::slug(random_int(10000, 99999)),\n ]);\n\n return redirect()->route('official-playlists.options.show', $option)\n ->with('status', __('Option created!'));\n }", "public function getBuyableIdentifier($options = null)\n {\n return $this->getKey();\n }", "public function findOptionById($optionId);", "public function actionAddOption($id)\n {\n $model = new Lists();\n $parent = $this->findModel($id);\n $model->scenario = 'option-insert';\n\n if (Yii::$app->request->isAjax and !Yii::$app->request->isPjax) {\n $model->load(Yii::$app->request->post());\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ActiveForm::validate($model);\n }\n\n if (Yii::$app->request->post()) {\n if ($model->load(Yii::$app->request->post())) {\n $model->parentID = $id;\n $model->status = 1;\n\n if ($model->prependTo($parent)) {\n app()->session->setFlash('alert', ['type' => 'success', 'message' => Yii::t('words', 'base.successMsg')]);\n return $this->redirect(['options', 'id' => $id]);\n } else\n app()->session->setFlash('alert', ['type' => 'danger', 'message' => Yii::t('words', 'base.dangerMsg')]);\n } else\n app()->session->setFlash('alert', ['type' => 'danger', 'message' => Yii::t('words', 'base.dangerMsg')]);\n }\n\n return $this->render('option_create', [\n 'model' => $model,\n 'parent' => $parent,\n ]);\n }", "public function actionCreateOptions()\n {\n $model = new Options();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view-options', 'id' => $model->id]);\n } else {\n return $this->render('options/create', [\n 'model' => $model,\n ]);\n }\n }", "public function getId()\n {\n return $this->savePayment();\n }", "private function create() {\n $connection = mysqli_connect(\"localhost\", \"php\", \"password\");\n if (!$connection) {\n //error connecting\n } else { //connection was good\n $this->enforceSQLProtection($connection);\n $db = mysqli_select_db($connection, \"DB_PHP\");\n $queryString = \"INSERT INTO OPTIONS(QuestionID\n ,Text\n ,IsAnswer)\n VALUES (\n '$this->QuestionID'\n ,'$this->Text'\n ,$this->IsAnswer\n );\n \";\n $qCreateUser = mysqli_query($connection, $queryString);\n $this->OptionID = $connection->insert_id;\n\n\n mysqli_close($connection); // Closing Connection\n return $this;\n }\n }", "public function getID()\n {\n return 1;\n }", "function getCategoriesIdOption() {\r\n\t\t$database = JFactory::getDBO();\r\n\r\n\t\t$catoptions = array();\r\n\r\n\t\treturn $catoptions;\r\n\t}", "public function obtenerID();", "public function getOptionId($attributeCode, $label, $force = false)\n {\n /** @var \\Magento\\Catalog\\Model\\ResourceModel\\Eav\\Attribute $attribute */\n $attribute = $this->getAttribute($attributeCode);\n\n // Build option array if necessary\n if ($force === true || !isset($this->attributeValues[ $attribute->getAttributeId() ])) {\n $this->attributeValues[ $attribute->getAttributeId() ] = [];\n\n // We have to generate a new sourceModel instance each time through to prevent it from\n // referencing its _options cache. No other way to get it to pick up newly-added values.\n\n /** @var \\Magento\\Eav\\Model\\Entity\\Attribute\\Source\\Table $sourceModel */\n $sourceModel = $this->tableFactory->create();\n $sourceModel->setAttribute($attribute);\n\n foreach ($sourceModel->getAllOptions() as $option) {\n $this->attributeValues[ $attribute->getAttributeId() ][ $option['label'] ] = $option['value'];\n }\n }\n\n // Return option ID if exists\n if (isset($this->attributeValues[ $attribute->getAttributeId() ][ $label ])) {\n return $this->attributeValues[ $attribute->getAttributeId() ][ $label ];\n }\n\n // Return false if does not exist\n return false;\n }", "function getId();", "public function get_id () {\r\n\t\treturn $this->id;\r\n\t}", "public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }", "public function getRequestedId() {}", "public function intGetNewId() {\n $this->XaoThrow(\n \"_EntBase::Build(): This entity does not implement retrieval of a \".\n \"new numeric identifier as a descrite function. It may not be \" .\n \"applicable.\"\n , debug_backtrace()\n );\n }", "function _options_field_id($field, $id) {\n global $db;\n $data = null;\n $req = $db->prepare(\"SELECT $field FROM _options WHERE id= ?\");\n $req->execute(array($id));\n $data = $req->fetch();\n //return $data[0];\n return (isset($data[0]))? $data[0] : false;\n}", "public function getOptionCategoryId()\n {\n return $this->optionCategoryId;\n }", "function insertId();", "public function getId() {}", "public function getId() {}", "public function get_id()\n {\n return $this->id;\n }", "public function get_id()\n {\n return $this->id;\n }", "public function get_id()\n {\n return $this->id;\n }", "function add_predefined_innovation_plan($params)\n {\n $this->db->insert('predefined_innovation_plan', $params);\n $id = $this->db->insert_id();\n $db_error = $this->db->error();\n if (! empty($db_error['code'])) {\n echo 'Database error! Error Code [' . $db_error['code'] . '] Error: ' . $db_error['message'];\n exit();\n }\n return $id;\n }", "function getCategoriesIdOption() {\r\n\t\t$database = & JFactory::getDBO();\r\n\r\n\t\t$catoptions = array();\r\n\r\n\t\treturn $catoptions;\r\n\t}", "public function created(AnswerOption $answerOption)\n {\n //\n }", "function getID();", "public function getId() {\n return ($this->isInit()) ? $this->id : null;\n }", "public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }" ]
[ "0.74493146", "0.7327861", "0.6758422", "0.6726272", "0.6434927", "0.6333391", "0.6283048", "0.60707146", "0.59963584", "0.5978969", "0.59081644", "0.59034336", "0.58509886", "0.58349884", "0.58088547", "0.5804071", "0.57917976", "0.57917976", "0.5763694", "0.5763694", "0.5753687", "0.5741193", "0.57402706", "0.57389575", "0.568626", "0.5673942", "0.562819", "0.56157285", "0.5613756", "0.5574347", "0.55452126", "0.55325073", "0.552452", "0.5514072", "0.5514048", "0.55128527", "0.55128527", "0.55128527", "0.55104697", "0.5485844", "0.548063", "0.54741997", "0.5472299", "0.5470349", "0.5466846", "0.5454566", "0.54522705", "0.5450223", "0.5450223", "0.5450223", "0.5450223", "0.5450223", "0.5450223", "0.5450223", "0.5450223", "0.5450223", "0.5438812", "0.5437172", "0.54313034", "0.5422009", "0.54202306", "0.5410108", "0.540613", "0.53926873", "0.5392042", "0.5388707", "0.53866285", "0.53845966", "0.53839684", "0.53802353", "0.5378861", "0.5377898", "0.53680426", "0.53667676", "0.5347815", "0.53401613", "0.5339137", "0.533913", "0.53371143", "0.5336891", "0.5326152", "0.5324896", "0.5318686", "0.5318528", "0.5307097", "0.5306221", "0.5305913", "0.52973616", "0.5291477", "0.52880806", "0.52880806", "0.52840453", "0.52840453", "0.52840453", "0.5279468", "0.52694774", "0.5265718", "0.52652097", "0.5264295", "0.5263651" ]
0.71576184
2
filter, retornando true or false
function aprovados($nota){ return $nota >= 7; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isFiltered() : bool;", "public function hasFilter(): bool;", "public function isFilterable(): bool;", "public function filter();", "public function isFiltered(): bool\n {\n return (bool) $this->prepare()->filtered;\n }", "protected abstract function filter();", "public function filtersExist();", "public function hasFilter() {\n return $this->_has(1);\n }", "public function hasFilter(){\n return $this->_has(5);\n }", "public function isFiltered() : bool\n {\n return $this->filtered;\n }", "public function isFiltered(): bool\n {\n return $this->filtered;\n }", "function es_filtro($vfiltro){\n $res = false;\n if ($vfiltro != SIN_FILTRO)\n $res = true;\n return $res;\n}", "function filter($value)\n\t{\n\t\treturn (boolean)$this->callback->invokeArgs(array($value));\n\t}", "function filter( $params)\n\t{\n\t\treturn true;\n\t}", "public function filtering();", "protected function filter($meta, $filters)\n {\n \n return true;\n }", "public function filterable()\n {\n return true;\n }", "public function hasPredicateFilter(){\n return $this->_has(6);\n }", "public function hasFilter(string $name): bool;", "function is_filtered() {\n\t\tglobal $_chosen_attributes;\n\n\t\treturn ( sizeof( $_chosen_attributes ) > 0 || ( isset( $_GET['max_price'] ) && isset( $_GET['min_price'] ) ) ) ? true : false;\n\t}", "function CheckFilter() {\n\t\tglobal $deals_details;\n\n\t\t// Check dealer extended filter\n\t\tif ($this->NonTextFilterApplied($deals_details->dealer))\n\t\t\treturn TRUE;\n\n\t\t// Check date_start extended filter\n\t\tif ($this->NonTextFilterApplied($deals_details->date_start))\n\t\t\treturn TRUE;\n\n\t\t// Check status extended filter\n\t\tif ($this->NonTextFilterApplied($deals_details->status))\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "public function filter( )\n {\n global $UNDERQL;\n $l_args_num = func_num_args( );\n if ( $l_args_num < 3 )\n return false;\n $filter_name = func_get_arg( 0 );\n\n $l_filter_callback = $UNDERQL['filter']['prefix'] . $filter_name;\n\n if ( !function_exists( $l_filter_callback ))\n return false;\n\n switch(func_get_arg(1))\n {\n case UQL_FILTER_IN:\n\n for ( $i = 2; $i < $l_args_num; $i++ )\n {\n if(!isset($this->in_filters[$this->table_name][func_get_arg( $i )]))\n $this->in_filters[$this->table_name][func_get_arg( $i )] = array($filter_name);\n else\n {\n $_temp = $this->in_filters[$this->table_name][func_get_arg( $i )];\n $_temp[@count($_temp)] = $filter_name;\n\n $this->in_filters[$this->table_name][func_get_arg( $i )] = $_temp;\n }\n }\n return true;\n\n case UQL_FILTER_OUT:\n for ( $i = 2; $i < $l_args_num; $i++ )\n {\n if(!isset($this->out_filters[$this->table_name][func_get_arg( $i )]))\n {\n $this->out_filters[$this->table_name][func_get_arg( $i )] = array($filter_name);\n }\n else\n {\n $_temp = $this->out_filters[$this->table_name][func_get_arg( $i )];\n $_temp[@count($_temp)] = $filter_name;\n\n $this->out_filters[$this->table_name][func_get_arg( $i )] = $_temp;\n\n }\n }\n return true;\n default : return false;\n }\n }", "public function is_filtered() {\n\n\t\t$is_filtered = false;\n\n\t\tif (\n\t\t\t$this->get_filtered_search_parts() !== false ||\n\t\t\t$this->get_filtered_dates() !== false ||\n\t\t\t$this->get_filtered_status() !== false\n\t\t) {\n\t\t\t$is_filtered = true;\n\t\t}\n\n\t\treturn $is_filtered;\n\t}", "abstract public function filters();", "private function any($a) {\n return !empty(array_filter($a));\n }", "public static function isFiltered(): bool\n {\n return !empty(self::$filters['act']) && self::$filters['act'] === 'search';\n }", "function has_filters() {\n //default to true, since almost all reports will have some filtering options\n return true;\n }", "protected function hasFilter()\n {\n return ! empty($this->filter);\n }", "public function is_filterable() {\n\t\treturn $this->is_listable() && isset( $this->data['filterable'] ) && $this->data['filterable'];\n\t}", "public function hasFilters() {\n\t\treturn count($this->filters) ? true : false;\n\t}", "private function hasFilters()\n {\n return (count($this->filters) > 0);\n }", "private function hasFiltroReputacao()\n {\n return !empty($this->filtros['reputacao']);\n }", "function filter($callback = null);", "private static function _getFilter() {}", "private function allowsFilter()\n {\n return config('dingoquerymapper.allowFilters');\n }", "public function hasQueryVals($filter = null)\n {\n // This should only work for GET request\n if (!$this->isGet()) {\n return false;\n }\n\n if ($filter !== null && $this->hasQuery($filter)) {\n $data = $this->getQuery($filter);\n } else {\n $data = $this->getQuery();\n }\n\n foreach ($data as $key => $value) {\n // If it's positive-like, then stop returning true\n if ($value == '0' || $value) {\n return true;\n }\n }\n\n // By default\n return false;\n }", "function _applyFilter($user, $info, $filter) {\n\t\tforeach($filter as $key => $pattern) {\n\t\t\t//sanitize pattern for use as regex\n\t\t\t$pattern = '/'.str_replace('/', '\\/', $pattern).'/i';\n\t\t\t\n\t\t\tif($key == 'user') {\n\t\t\t\tif(!preg_match($pattern, $user)) return false;\n\t\t\t} else if($key == 'grps') {\n\t\t\t\tif(!count(preg_grep($pattern, $info['grps']))) { \n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(!preg_match($pattern, $info[$key])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function CheckFilter()\n{\n\tglobal $FilterArr, $lAdmin;\n\tforeach ($FilterArr as $f) global $$f;\n\t\n\treturn count($lAdmin->arFilterErrors) == 0; //if some errors took place, return false;\n}", "public function has_filters()\n {\n }", "public function hasFilters()\n {\n return !$this->getFilters()->isEmpty();\n }", "public function filter(array $item)\n {\n /** @var FilterInterface $filter */\n foreach ($this->filters as $filter) {\n if (!$filter->filter($item)) {\n return false;\n }\n }\n\n return true;\n }", "function applyFilters($filters)\n {\n $r = true;\n foreach ($filters as $filter)\n {\n $r = $this->applyFilter($filter);\n }\n return $r;\n }", "function CheckFilter() {\n\t\tglobal $dealers_reports;\n\n\t\t// Check StartDate extended filter\n\t\tif ($this->NonTextFilterApplied($dealers_reports->StartDate))\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "public function matches(Filter $filter)\n {\n // toPlainObject method\n return $filter->matches($this->toPlainObject());\n }", "function customerHasFilterAccess() {\n\n\t\tif (in_array($_SESSION[\"webuser\"][\"ID\"], $this->_blackList)) {\n\t\t\treturn false;\n\t\t} else if (in_array($_SESSION[\"webuser\"][\"ID\"], $this->_whiteList)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$_filter_op = array(\n\t\t\t'0'=>'%s==%s',\n\t\t\t'1'=>'%s<>%s',\n\t\t\t'2'=>'%s<%s',\n\t\t\t'3'=>'%s<=%s',\n\t\t\t'4'=>'%s>%s',\n\t\t\t'5'=>'%s>=%s',\n\t\t\t'6'=>'weAbstractCustomerFilter::startsWith(%s,%s)',\n\t\t\t'7'=>'weAbstractCustomerFilter::endsWith(%s,%s)',\n\t\t\t'8'=>'weAbstractCustomerFilter::contains(%s,%s)',\n\t\t\t'9'=>'weAbstractCustomerFilter::in(%s,%s)'\n\n\t\t);\n\n\t\t$_conditions = array();\n\n\t\t$_flag = false;\n\t\tforeach ( $this->_filter as $_filter ) {\n\t\t\t$_conditions[] = (($_filter[\"logic\"] && $_flag) ? ($_filter[\"logic\"]==\"AND\" ? \" && \" : \" || \") : \"\") . sprintf(\n\t\t\t\t$_filter_op[$_filter[\"operation\"]],\n\t\t\t\tweAbstractCustomerFilter::quote4Eval($_SESSION[\"webuser\"][$_filter[\"field\"]]),\n\t\t\t\tweAbstractCustomerFilter::quote4Eval($_filter[\"value\"])\n\t\t\t);\n\t\t\t$_flag = true;\n\t\t}\n\n\t\t$_hasPermission = false;\n\t\t$_cond = \"if (\" . implode(\"\", $_conditions) . \") { \\$_hasPermission = true; }\";\n\t\teval( $_cond );\n\n\t\treturn $_hasPermission;\n\t}", "public function filter($data);", "public function valid()\n {\n return key($this->_filters) !== null;\n }", "public function filtering(): string;", "public function filterObjects($filterObjects) {\n $this->filterObjects = (bool)$filterObjects;\n return $this->filterObjects;\n }", "protected function checkFilterPasses()\n {\n $filter = $this->getFilter();\n if (! $filter) {\n return true;\n }\n\n if (is_callable($filter)) {\n return call_user_func($filter, $this->request);\n }\n if (! $this->request->is($this->filter)) {\n return false;\n }\n\n return true;\n }", "private function hasFiltroPreco()\n {\n return !empty($this->filtros['precos']);\n }", "public function filter($value)\n {\n return filter_var($value, FILTER_VALIDATE_BOOLEAN);\n }", "private static function filter_args( $arg ) {\n\t\t\tif ( empty( $arg ) && $arg !== false ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "public function hasPredicateMatched(){\n return $this->_has(1);\n }", "public function filterExists(string $name);", "public function hasUserFilter()\n {\n return $this->user_filter !== null;\n }", "private function some($a) {\n return $this->any($a) && !$this->all($a);\n }", "public function isSearchFilterExists(): bool;", "protected function _isFiltered($fileName)\n\t{\n\t\t$parts = explode('-', $fileName);\n\t\tif ($this->_classExclude) {\n\t\t\tif (preg_match($this->_classExclude, $parts[0])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tif ($this->_classFilter) {\n\t\t\tif (! preg_match($this->_classFilter, $parts[0])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tif ($this->_sequenceExclude) {\n\t\t\tif (preg_match($this->_sequenceExclude, $parts[1])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tif ($this->_sequenceFilter) {\n\t\t\tif (! preg_match($this->_sequenceFilter, $parts[1])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tif ($this->_testExclude) {\n\t\t\tif (preg_match($this->_testExclude, $parts[2])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tif ($this->_testFilter) {\n\t\t\tif (! preg_match($this->_testFilter, $parts[2])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function HasFilters(): bool\n {\n return $this->FilterLinks()->count() > 1;\n }", "public function filter()\n {\n return $this->collection->filter( function( $entry ) {\n\n // get parameters to check from the tag\n $params_to_check = explode( '|', $this->get('params', '' ) );\n\n // match all the params (`and` mode), or just some (`or` mode)\n // tag usage: {{ ... match=\"all\" }}\n $mode = $this->get('match', 'any'); //default to any (`or` mode)\n\n // This creates an empty array used to store true or false on the match for each parameter\n $return_array = [];\n\n // check for all supplied taxonomies, to see if this entry contains it\n foreach ( $params_to_check as $param_name )\n {\n // get the taxonomy value from the $_GET paramaters\n $value = Request::get( $param_name, false );\n\n // This paramater does not exist in the url params we skip over filtering it\n if ( ! $value )\n {\n $return_array[] = true;\n }\n else\n {\n // This gets the array of taxonomies from the entry, this is used to do the comparison\n // It returns an array of taxonomy terms on the entry (slugs) IE: ['coffee', 'harry-potter']\n $taxonomies_array = $entry->get( $param_name );\n\n // if something has been set, not sure on the last two - see above...\n // If the taxonomy field we are searching on is not valid or if the entry has no terms for that taxonomy field\n // For example we may get null or we may get an empty array []\n if ( $value != '' && $taxonomies_array != null && ! empty( $taxonomies_array ) )\n {\n // This checks to see if the $value (text of the passed param) is in the array of taxonmy terms on the entry\n // It adds its result (true or false) to the return array.\n $return_array[] = in_array( $value, $taxonomies_array );\n }\n }\n }\n\n // If we want all terms to match, our array should now *only* contain [true, true, true] (if we are matching three terms)\n // In other words we are making sure there are no mismatched terms [true, false, true] for example\n if ( $mode === 'all' && in_array( false, $return_array ) )\n {\n return false;\n }\n // Here we are checking to see if *any* of the terms evaluated to be true, e.g. [true, false, true]\n else if ( in_array( true, $return_array ) )\n {\n return true;\n }\n\n return false;\n\n });\n }", "function has_filter($hook_name, $callback = \\false)\n {\n }", "private function hasFiltroCulinaria()\n {\n return !empty($this->filtros['culinaria']);\n }", "public function filter() {\n\t\t// If there is no arguments, return $this\n\t\t$numArgs = func_num_args();\n\t\tif($numArgs == 0){\n\t\t\treturn $this;\n\t\t}\n\t\t\n\t\t// If only a lone array is passed use it as parameters\n\t\t$firstArgument = func_get_arg(0);\n\t\tif ($numArgs == 1 and isset($firstArgument[0]) and is_array($firstArgument[0])) {\n\t\t\treturn $this->_f(true, $firstArgument);\n\t\t}\n\n\t\t// General case of filtering: arguments are conditions\n\t\treturn $this->_f(true, func_get_args());\n\t}", "static function any($collection, $function)\n {\n foreach($collection as $item) {\n if($function($item)) {\n return TRUE;\n }\n }\n return FALSE;\n }", "public function hasFilters()\n {\n return count($this->getFilters()) > 0;\n }", "abstract public function filter(callable $func);", "public function includes(): bool;", "function outcomeFilter($var)\n\t{\n\t\tif(strpos($var, 'CAC') !== FALSE || strpos($var, 'EAC') !== FALSE)\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "function MCW_checkshow($MyFilter){\n $myfilteroptions = MCW_get_all_filters();\n $max = count($myfilteroptions);\n $erg = false;\n for ( $i = 0; $i < $max; ++$i ) {\n $c=\"if ((\".stripslashes($myfilteroptions[$i][1]).\") && isset(\\$MyFilter[\\$myfilteroptions[\\$i][0]])) {\\$erg = true;}\";\n eval($c);\n }\n return $erg;\n }", "private function extractOwnFilters(array $filters): bool\n {\n if (isset($filters['the_posts']->callbacks[10]) === true) {\n foreach ($filters['the_posts']->callbacks[10] as $postFilter) {\n if (is_array($postFilter['function']) === true\n && $postFilter['function'][0] instanceof PostController\n && $postFilter['function'][1] === 'showPosts'\n ) {\n $this->wordpressFilters['the_posts'] = $filters['the_posts'];\n $filters['the_posts']->callbacks = [10 => [$postFilter]];\n return true;\n }\n }\n }\n\n return false;\n }", "private function whereBoolean($matches) {\n\n $field = underscore($matches['field']);\n $not = isset($matches['not']) ? (strcasecmp('not', $matches['not']) == 0) : false;\n\n return $this->where(array($field => $not ? 0 : 1));\n }", "public function isFiltered()\n {\n $globalFiltering = (isset($this->requestParams['search']) && '' !== $this->requestParams['search']['value']);\n $individualFiltering = false;\n foreach ($this->columns as $key => $column) {\n if (true === $this->isSearchableColumn($column)) {\n if (true === array_key_exists($key, $this->requestParams['columns'])) {\n $searchValue = $this->requestParams['columns'][$key]['search']['value'];\n\n if ('' !== $searchValue && 'null' !== $searchValue) {\n $individualFiltering = true;\n break;\n }\n }\n }\n }\n\n return $globalFiltering || $individualFiltering;\n }", "protected function initializeFilters()\r\n\t{\r\n\t\t$this->iso_filterFields = deserialize($this->iso_filterFields, true);\r\n\t\t\r\n\t\tif(!empty($this->iso_filterFields))\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->iso_filterTpl)\r\n\t\t{\r\n\t\t\t$this->strTemplate = $this->iso_filterTpl;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "private function hasFiltroCidade()\n {\n return !empty($this->filtros['cidade']);\n }", "public function passes()\n\t{\n\t\tif (empty($this->results)) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ($this->results as $value) {\n\t\t\tif ($value === false) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private function init_consolidationAndSelect_isFilterArray()\n {\n // RETURN: true, there is a filter array\n if ( is_array( $this->conf_view[ 'filter.' ] ) )\n {\n return true;\n }\n // RETURN: true, there is a filter array\n // DRS\n if ( $this->pObj->b_drs_filter )\n {\n $viewWiDot = $this->view . '.';\n $prompt = $viewWiDot . $this->mode . ' . filters isn\\'t an array. There isn\\'t any filter for processing.';\n t3lib_div :: devlog( '[INFO/FILTER] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n // RETURN: true, there is a filter array\n return false;\n }", "public function hasAdditionalFilter($dataProvider = null);", "function filterPosts($filterOpt, $filterArg, $post, $poster)\n {\n global $con;\n switch($filterOpt)\n {\n case none:\n return true;\n break;\n case curQtr:\n if(strtotime($post[date])<strtotime(getCurrentQuarter()))\n {\n print $post[date];\n print getCurrentQuarter();\n return false;\n }\n break;\n case username:\n if($poster[user_name]!=$filterArg)\n {\n if($filterArg == \"none\")\n {\n return true;\n }\n return false;\n }\n break;\n }\n return true;\n }", "public function any(callable $test): bool\n {\n foreach($this as $item) {\n if ($test($item)) {\n return true;\n }\n }\n\n return false;\n }", "public function filter($predicate);", "public static function createIsActiveFilter()\n {\n return function ($signature) {\n // Signature is not signed\n if (!$signature->is_signed) {\n return false;\n }\n\n // Signature is cancelled\n if ($signature->is_cancelled) {\n return false;\n }\n\n return true;\n };\n }", "public function isTaskShouldApplyFilters(): bool\n {\n $this->consistencyCheck();\n\n if ($this->concat_fade_duration > 0) {\n return true;\n }\n \n if (! $this->isInputsHaveSameRatio()) {\n return true;\n }\n \n if ($this->isInputsFromDifferentCodecs()) {\n return true;\n }\n \n return false;\n }", "public function filter() {\n\t\t$args = func_get_args();\n\t\t$r = Core_Types::reflection_for($this->sets[':default']);\n\t\t$m = $r->getMethod('filter');\n\t\treturn $m->invokeArgs($this->sets[':default'],$args);\n\t}", "public function some(callable $callback): bool {\n\t\treturn count(array_filter($this->array, $callback)) > 0;\n\t}", "function testPersonSearchByBoolean() {\n\t\t$this->setUrl('/search/advanced?r=per&q[per_can_call][value]=FALSE');\n\t\t$this->app->go();\n\t\t$this->assertPattern('/id=\"qb_per_can_call\"/', $this->view->output);\n\t\t$this->assertPattern('/<th>Can Call<\\/th>/', $this->view->output);\n\t\t$this->assertPattern('/<td><img src=\"\\/graphics\\/tactile\\/false.png\" alt=\"f\" \\/><\\/td>/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$this->assertIsA($collection, 'Omelette_PersonCollection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('Greg Jones', 'Simon Kamina'));\n\t}", "private function _hardFilter()\n\t {\n\t\t$check = true;\n\n\t\t$blackxml = new SimpleXMLElement(file_get_contents(__DIR__ . \"/storage/blacklist.xml\"));\n\n\t\tforeach ($blackxml->patterns->pattern as $pattern)\n\t\t {\n\t\t\tif (isset($this->name) === true)\n\t\t\t {\n\t\t\t\tif (preg_match((string) $pattern, $this->name) > 0)\n\t\t\t\t {\n\t\t\t\t\t$check = false;\n\t\t\t\t\tbreak;\n\t\t\t\t } //end if\n\n\t\t\t } //end if\n\n\t\t\tif (preg_match((string) $pattern, $this->description) > 0)\n\t\t\t {\n\t\t\t\t$check = false;\n\t\t\t\tbreak;\n\t\t\t } //end if\n\n\t\t } //end foreach\n\n\t\tif ($check !== false)\n\t\t {\n\t\t\tforeach ($blackxml->words->word as $word)\n\t\t\t {\n\t\t\t\tif (isset($this->name) === true)\n\t\t\t\t {\n\t\t\t\t\tif (preg_match(\"/\" . (string) $word . \"/ui\", $this->name) > 0)\n\t\t\t\t\t {\n\t\t\t\t\t\t$check = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t } //end if\n\n\t\t\t\t } //end if\n\n\t\t\t } //end foreach\n\n\t\t } //end if\n\n\t\tif ($check === false)\n\t\t {\n\t\t\t$whitexml = new SimpleXMLElement(file_get_contents(__DIR__ . \"/storage/whitelist.xml\"));\n\n\t\t\tforeach ($whitexml->patterns->pattern as $pattern)\n\t\t\t {\n\t\t\t\tif (preg_match((string) $pattern, $this->description) > 0)\n\t\t\t\t {\n\t\t\t\t\t$check = true;\n\t\t\t\t\tbreak;\n\t\t\t\t } //end if\n\n\t\t\t } //end foreach\n\n\t\t } //end if\n\n\t\treturn $check;\n\t }", "public function hasFilteredQuery() {\n return $this->_has(3);\n }", "public function isFiltered() : bool\n {\n $check = $this->adapter instanceof AdapterFiltered;\n\n /** @var AdapterFiltered $adapterFiltered */\n $adapterFiltered = $this->adapter;\n\n return $check ? $adapterFiltered->isFiltered() : false;\n }", "public function filters()\n {\n return array(\n 'value' => array(\n array(array($this, 'check_for_array_or_object')),\n )\n );\n }", "public function getPredicate();", "protected function filtersPass(Application $app)\n {\n if (($this->_filter && ($this->_filter))\n || $this->_reject && call_user_func($this->_reject, $app)\n ) {\n return false;\n }\n\n return true;\n }", "function any(callable $callback, iterable $items) : bool\n{\n foreach ($items as $item) {\n if ($callback($item)) {\n return true;\n }\n }\n return false;\n}", "public function isSetFilters()\n {\n if (empty($this->filters)) {\n return false;\n }\n\n return true;\n }", "public function hasFilters($type = NULL)\n\t{\n\t\treturn count($type == NULL ? $this->getFilters() : $this->getFilters($type)) > 0;\n\t}", "public function hasResults();", "static function all($collection, $function)\n {\n foreach($collection as $item) {\n if(!$function($item)) {\n return FALSE;\n }\n }\n return TRUE;\n }", "private function all($a) {\n return count(array_filter($a)) == count($a);\n }", "public function HasGroupFilters(): bool\n {\n return $this->GroupFilterLinks()->count() > 1;\n }", "public function HasSearchFilters(): bool\n {\n return false;\n }", "public function TestFilterUserByStatusFalse()\n {\n $expected = $this->usersFilter->filterByStatus(\"authorized\",\"decline\");\n $this->assertFalse($expected);\n }" ]
[ "0.72347635", "0.7150549", "0.6631984", "0.6631743", "0.6588239", "0.65518427", "0.6497843", "0.6450877", "0.64178115", "0.63863057", "0.6354727", "0.6320365", "0.631643", "0.6296135", "0.61952615", "0.6144664", "0.6037879", "0.60338944", "0.6025301", "0.60069185", "0.596827", "0.59668285", "0.59339327", "0.5932519", "0.5930556", "0.5926944", "0.5924219", "0.58661896", "0.5787378", "0.57754034", "0.5774356", "0.57479924", "0.5730962", "0.5705754", "0.57032156", "0.5669616", "0.5669023", "0.5667692", "0.5667395", "0.5652859", "0.5640566", "0.5633537", "0.5612934", "0.56117225", "0.56088436", "0.5597255", "0.5589825", "0.555151", "0.5544208", "0.5541098", "0.5540408", "0.553695", "0.55349743", "0.5528035", "0.55268615", "0.5526075", "0.5524456", "0.55180085", "0.55064005", "0.55030143", "0.55026114", "0.54418826", "0.5432157", "0.54320097", "0.5422146", "0.5414756", "0.5403958", "0.53737754", "0.5373377", "0.53703815", "0.53596777", "0.53542024", "0.5351978", "0.53361666", "0.5326482", "0.53085893", "0.5291682", "0.52896607", "0.5281521", "0.52796626", "0.5271352", "0.5266294", "0.5264641", "0.52490973", "0.5243351", "0.5241833", "0.5241672", "0.52406746", "0.52354735", "0.5222315", "0.5221255", "0.5210463", "0.5201689", "0.5197239", "0.5192798", "0.51906264", "0.51885027", "0.5185415", "0.51768804", "0.5170515", "0.5165711" ]
0.0
-1
Returns the static model of the specified AR class.
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model() {\n return parent::model(get_called_class());\n }", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }" ]
[ "0.74850124", "0.73803526", "0.7154113", "0.71401674", "0.70629025", "0.703232", "0.69285315", "0.69285315", "0.6925706", "0.6902751", "0.6894916", "0.6894916", "0.68900806", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424" ]
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function criteriaSearch() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; if(!empty($this->periksakacamata_id)){ $criteria->addCondition('periksakacamata_id = '.$this->periksakacamata_id); } if(!empty($this->pendaftaran_id)){ $criteria->addCondition('pendaftaran_id = '.$this->pendaftaran_id); } if(!empty($this->ruangan_id)){ $criteria->addCondition('ruangan_id = '.$this->ruangan_id); } if(!empty($this->pasien_id)){ $criteria->addCondition('pasien_id = '.$this->pasien_id); } if(!empty($this->pegawai_id)){ $criteria->addCondition('pegawai_id = '.$this->pegawai_id); } $criteria->compare('LOWER(tglperiksakacamata)',strtolower($this->tglperiksakacamata),true); $criteria->compare('LOWER(pro_kacamata)',strtolower($this->pro_kacamata),true); $criteria->compare('LOWER(permintaanke_kacamata)',strtolower($this->permintaanke_kacamata),true); $criteria->compare('LOWER(jatuhtempo_kacamata)',strtolower($this->jatuhtempo_kacamata),true); $criteria->compare('LOWER(hasil_penglihatan)',strtolower($this->hasil_penglihatan),true); $criteria->compare('LOWER(create_time)',strtolower($this->create_time),true); $criteria->compare('LOWER(update_time)',strtolower($this->update_time),true); if(!empty($this->create_loginpemakai_id)){ $criteria->addCondition('create_loginpemakai_id = '.$this->create_loginpemakai_id); } if(!empty($this->update_loginpemakai_id)){ $criteria->addCondition('update_loginpemakai_id = '.$this->update_loginpemakai_id); } if(!empty($this->create_ruangan)){ $criteria->addCondition('create_ruangan = '.$this->create_ruangan); } return $criteria; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public function getModels()\n\t{\n\t\t$scope = $this->scopeName;\n\t\treturn CActiveRecord::model($this->baseModel)->$scope()->findAll();\n\t}", "protected function findModel()\n {\n $class = $this->model;\n $query = $class::query();\n\n foreach ($this->input as $key => $value) {\n $where = is_array($value) ? 'whereIn' : 'where';\n $query->$where($key, $value);\n }\n\n return $query->get();\n }", "public function modelScans()\n {\n if ($this->scanEverything) {\n return $this->getAllClasses();\n }\n\n return $this->scanModels;\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function getModelsForIndex()\n {\n $models = [];\n $all_models = $this->getAllModels();\n\n foreach ($all_models as $model) {\n //parse model\n $pieces = explode('.', $model);\n if (count($pieces) != 2) {\n throw new Exception('Parse error in AppModelList');\n }\n //check form match\n $app_model = $pieces[1];\n $link = $this->convertModelToLink($app_model);\n\n // add to actions\n $models[$app_model]['GET'] = [\n [\n 'action' => 'index',\n 'description' => 'List & filter all ' . $app_model . ' resources.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link\n ],\n [\n 'action' => 'show',\n 'description' => 'Show the ' . $app_model . ' that has the matching {id} from the route.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link . '/{id}'\n ]\n ];\n }\n return $models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function searchableBy()\n {\n return [];\n }", "public function all($model){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public static function find($model, $conditions = null, $orderby = null){\n\t\t$sql = \"SELECT * FROM \" . self::table_for($model);\n\t\tif ($conditions) $sql .= \" WHERE \" . self::make_conditions($conditions);\n\t\tif ($orderby)\t$sql .= \" ORDER BY \" . $orderby;\n\t\t\n\t\t$resultset = self::do_query($sql);\n\t\treturn self::get_results($resultset, $model);\n\t}", "function get_model_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"make_model\",\"id,name,del_status\",$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }", "public function getList()\n {\n $this->db->order_by(\"id\", 'desc');\n $this->db->where('status', 1);\n return $this->db->get($this->model);\n }", "public function findAll()\n {\n $fields = $options = [];\n //$options['debug'] = 1;\n $options['enablefieldsfe'] = 1;\n\n return $this->search($fields, $options);\n }", "public function findAll()\n {\n return $this->model->all();\n }", "public function get_multiple()\n\t{\n\t\t$options = array_merge(array(\n\t\t\t'offset' => 0,\n\t\t\t'limit' => 20,\n\t\t\t'sort_by' => 'name',\n\t\t\t'order' => 'ASC'\n\t\t), Input::all(), $this->options);\n\n\t\t// Preparing our query\n\t\t$results = $this->model->with($this->includes);\n\n\t\tif(count($this->join) > 0)\n\t\t{\n\t\t\tforeach ($this->join as $table => $settings) {\n\t\t\t\t$results = $results->join($table, $settings['join'][0], $settings['join'][1], $settings['join'][2]);\n\t\t\t\tif($settings['columns'])\n\t\t\t\t{\n\t\t\t\t\t$options['sort_by'] = (in_array($options['sort_by'], $settings['columns']) ? $table : $this->model->table()).'.'.$options['sort_by'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(stripos($options['sort_by'], '.') === 0)\n\t\t{\n\t\t\t$options['sort_by'] = $this->model->table().'.' . $options['sort_by'];\n\t\t}\n\t\t\n\t\t// Add where's to our query\n\t\tif(array_key_exists('search', $options))\n\t\t{\n\t\t\tforeach($options['search']['columns'] as $column)\n\t\t\t{\n\t\t\t\t$results = $results->or_where($column, '~*', $options['search']['string']);\n\t\t\t}\n\t\t}\n\n\t\t$total = (int) $results->count();\n\n\t\t// Add order_by, skip & take to our results query\n\t\t$results = $results->order_by($options['sort_by'], $options['order'])->skip($options['offset'])->take($options['limit'])->get();\n\n\t\t$response = array(\n\t\t\t'results' => to_array($results),\n\t\t\t'total' => $total,\n\t\t\t'pages' => ceil($total / $options['limit'])\n\t\t);\n\n\t\treturn Response::json($response);\n\t}", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "public function filter($params) {\n $model = $this->model;\n $keyword = isset($params['keyword'])?$params['keyword']:'';\n $sort = isset($params['sort'])?$params['sort']:''; \n if ($sort == 'name') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('name'); \n }\n else if ($sort == 'newest') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('updated_at','desc'); \n }\n else {\n $query = $model->where('name','LIKE','%'.$keyword.'%'); \n }\n /** filter by class_id */ \n if (isset($params['byclass']) && isset($params['bysubject'])) {\n $query = $model->listClass($params['byclass'], $params['bysubject']);\n return $query; \n }\n else if (isset($params['byclass'])) { \n $query = $model->listClass($params['byclass']);\n return $query;\n }\n else if (isset($params['bysubject'])) {\n $query = $model->listClass(0,$params['bysubject']);\n return $query;\n }\n /** filter by course status */\n if (isset($params['incomming'])) {\n $query = $model->listCourse('incomming');\n return $query;\n }\n else if (isset($params['upcomming'])) {\n $query = $model->listCourse('upcomming');\n return $query;\n }\n $result = $query->paginate(10); \n return $result; \n }", "public function getAll($model, $filters = array())\n {\n $repo = $this->getRepository($model);\n\n return $repo->getAll($filters);\n }", "public function filters(Model $model): array\n {\n return [];\n }", "public function getResults()\n {\n if($this->search) {\n foreach ($this->filters as $field) {\n $field = array_filter(explode('.', $field));\n if(count($field) == 2) {\n $this->query->whereHas($field[0], function ($q) use ($field) {\n $q->where($field[1], 'ilike', \"%{$this->search}%\");\n });\n }\n if(count($field) == 1) {\n $this->query->orWhere($field[0], 'ilike', \"%{$this->search}%\");\n }\n }\n }\n\n if($this->where) {\n foreach ($this->where as $field => $value) {\n $this->query->where($field, $value);\n }\n }\n\n if ($this->whereBetween) {\n foreach ($this->whereBetween as $field => $value)\n $this->query->whereBetween($field, $value);\n }\n// dd($this->query->toSql());\n return $this->query->paginate($this->per_page);\n }", "protected function _searchInModel(Model $model, Builder $items){\n foreach($model->searchable as $param){\n if($param != 'id'){\n if(isset($this->request[$param]))\n $items = $items->where($param, $this->request[$param]);\n if(isset($this->request[$param.'_like']))\n $items = $items->where($param, 'like', '%'.$this->request[$param.'_like'].'%');\n }else{\n if(isset($this->request['id'])){\n $ids = explode(',', $this->request['id']);\n $items = $items->whereIn('id', $ids);\n }\n }\n }\n\n return $items;\n }", "public function getAll($model)\n {\n $sql = \"SELECT * FROM {$this->table}\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_CLASS,get_class($this->model));\n }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function findAll()\n {\n return $this->driver->findAll($this->model);\n }", "public function getAllFilters();", "public function GetAll()\n {\n return $this->model->all();\n }", "public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function findWhere($model, $conditions, $limit = 0){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n\n $sql = 'select * from ' . $table . ' where ';\n $values = [];\n $counter = 1;\n\n foreach ($conditions as $key => $value) {\n if($counter > 1)\n $sql .= ' AND ';\n\n $sql .= $key . '=?';\n $values[] = $value; \n $counter++;\n }\n\n if($limit > 0)\n $sql .= ' LIMIT ' . $limit;\n \n $stmt = $this->pdo->prepare($sql);\n $stmt->execute($values);\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('type', $this->type);\n\n return $criteria;\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getSearchFields();", "public function getModels()\n {\n return $this->_models;\n }", "public function all()\n {\n return $this->model->get();\n }", "public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "public function getAll()\n {\n return $this->fetchAll($this->searchQuery(0));\n }", "public function listAction() {\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$select = null;\n\t\t\n\t\tif ($this->_request->getParam('data')) {\n\t\t\t\n\t\t\t$data = unserialize($this->_request->getParam('data'));\n\t\t\t$aWhere = array();\n\t\t\t$searchText = array();\n\t\t\t\n\t\t\tforeach ($data['query'] as $key => $q) {\n\t\t\t\n\t\t\t\tif (isset($data['fields'][$key]) && !empty($data['fields'][$key])) {\n\t\t\t\t\n\t\t\t\t\t$func = addslashes($data['func'][$key]);\n\t\t\t\t\t$q =\taddslashes($q);\n\t\t\t\t\t$tmpWhere = array();\n\t\t\t\t\t$searchText[] = implode(' OU ', $data['fields'][$key]) . ' ' . $this->view->func[$func] . ' \"' . stripslashes($q) . '\"';\n\t\t\t\t\t\n\t\t\t\t\tforeach ($data['fields'][$key] as $field) {\n\t\t\t\t\t\n\t\t\t\t\t\t$field\t=\taddslashes($field);\n\t\t\t\t\t\tswitch ($func) {\n\t\t\t\t\t\t\tcase 'LIKE':\n\t\t\t\t\t\t\tcase 'NOT LIKE':\n\t\t\t\t\t\t\tcase '=':\n\t\t\t\t\t\t\tcase '!=':\n\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\tcase '>=':\n\t\t\t\t\t\t\tcase '<':\n\t\t\t\t\t\t\tcase '<=':\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' ' . $func . ' \\'' . $q . '\\''; }\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"= ''\":\n\t\t\t\t\t\t\tcase \"!= ''\":\n\t\t\t\t\t\t\tcase 'IS NULL':\n\t\t\t\t\t\t\tcase 'IS NOT NULL':\n\t\t\t\t\t\t\t\t$tmpWhere[] = $field . ' ' . stripslashes($func);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' LIKE \\'%' . $q . '%\\''; }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$aWhere[] = '(' . implode(' OR ', $tmpWhere) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($aWhere)) { $select = $model->select()->where(implode(' AND ', $aWhere)); }\n\t\t\t$this->view->searchText = $searchText;\n\t\t}\n\t\t$this->view->model = $modelName;\n\t\t$this->view->allData = $model->fetchAll($select);\n\t\t$this->view->data = Zend_Paginator::factory($this->view->allData)\n\t\t\t\t\t\t\t->setCurrentPageNumber($this->_getParam('page', 1));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function index(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required',\n 'searched' => 'required',\n ]);\n\n try {\n if ($request->type == 'Categories') {\n return Category::search($request->searched)->take(20)->get();\n }\n\n if ($request->type == 'Submissions') {\n return $this->sugarFilter(Submission::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Comments') {\n return $this->withoutChildren(Comment::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Users') {\n return User::search($request->searched)->take(20)->get();\n }\n } catch (\\Exception $exception) {\n app('sentry')->captureException($exception);\n\n return [];\n }\n }", "public function getReturnModels(){\r\n return array_values($this->models);\r\n }", "public function findAll()\n {\n $models = $this->getDoctrineRepository()->findAll();\n $this->events()->trigger(__FUNCTION__ . '.post', $this, array(\n 'model' => $models,\n 'om' => $this->getObjectManager())\n );\n return $models;\n }", "public function models();", "public function search($conditions)\n\t{\n\t\t$limit = (isset($conditions['limit']) && $conditions['limit'] !== null ? $conditions['limit'] : 10);\n\t\t$result = array();\n\t\t$alphabets = [];\n\n\t\tDB::enableQueryLog();\n\n\t\t$mem = new Memcached();\n\t\t$mem->addServer(env('memcached_server'), env('memcached_port'));\n\n\t\t/* Get Default Logo Link on setting_object table */\n\t\t$logoMem = $mem->get('logo_course');\n\n\t\tif ($logoMem)\n\t\t{\n\t\t\t$default_logo = $logoMem;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$default_logo = $this->getDefaultLogo();\n\t\t\t$mem->set('logo_course', $default_logo);\n\t\t}\n\n\t\tif (isset($conditions['alphabet']) && $conditions['alphabet'] !== null && sizeof($conditions['alphabet']) > 0) {\n\t\t\tforeach ($conditions['alphabet'] as $item) {\n\t\t\t\t$alphabets[] = \"lower(entity.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t\t$alphabets[] = \"lower(curriculum.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t}\n\t\t}\n\n\t\t$extraGroup = (isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : '' );\n\t\t$extraGroup = str_replace(' ASC', '',$extraGroup);\n\t\t$extraGroup = str_replace(' DESC', '',$extraGroup);\n\n\t\t$searchData = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->limit($limit)\n\t\t\t->offset(isset($conditions['page']) && $conditions['page'] !== null ? ($conditions['page']-1) * $limit : 0)\n\t\t\t->get();\n\n\t\t$searchAll = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t//->groupBy('course.course_id','schedule.instructor_id','curriculum.curriculum_id','entity.logo', 'course.day_of_week','entity.name','curriculum.name','course.time_start', 'course.time_end','event_type.name')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->get();\n\n\t\t//echo(\"<br>Total : \" . sizeof($searchData) . \" records\");\n\t\tforeach ($searchData as $data) {\n\t\t\t/*echo('<br>' . $data->program_id . '|' . $data->program_name . '|'. $data->activity_id . '|' . $data->provider_name . '|' . $data->location_name);*/\n\t\t\t//echo('<br>' . $data->provider_id . '|' . $data->provider_name . '|' . $data->location_name);\n\n\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\n\n\t\t\t//echo('<br>' . $data->course_id . \"~\" . $data->program_name . '#'.$day->name. \"|\". date('h:i',strtotime($data->time_start)) . '-' .date('h:i',strtotime($data->time_end)));\n\t\t\t$item = ['course_id' => $data->course_id,\n\t\t\t\t'entity_logo' => ($data->entity_logo ? $data->entity_logo : $default_logo),\n\t\t\t\t'entity_name' => $data->entity_name,\n\t\t\t\t'curriculum_name' => $data->curriculum_name,\n\t\t\t\t'day_name' => $day->name,\n\t\t\t\t'time_start' => date('H:i',strtotime($data->time_start)),\n\t\t\t\t'time_end' => date('H:i',strtotime($data->time_end))];\n\n\t\t\t/*$schedules = DB::table('schedule')\n\t\t\t\t->select('schedule.schedule_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\tforeach ($schedules as $schedule) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t}*/\n\n\t\t\t$programs = DB::table('curriculum')\n\t\t\t\t->select('program.program_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\t$searchActivities = [];\n\t\t\tforeach ($programs as $program) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t\t$activities = DB::table('program')\n\t\t\t\t\t->select('activity.logo', 'program.provider_id', DB::raw('program.name program_name'))\n\t\t\t\t\t->join('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t\t\t->leftjoin('activity_classification', 'activity.activity_classification_id', 'activity_classification.activity_classification_id')\n\t\t\t\t\t->where('program.program_id', $program->program_id)\n\t\t\t\t\t->whereRaw(\n\t\t\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\t\t\t\t\t\t('program.status = 0')\n\t\t\t\t\t)\n\t\t\t\t\t//->groupBy('activity.logo')\n\t\t\t\t\t->get();\n\n\t\t\t\tforeach ($activities as $activity) {\n\t\t\t\t\t//echo('<img src=\"' . $activity->logo . '\" style=\"width:2%;\" alt=\"' . $activity->program_name . '\" title=\"' . $activity->program_name . '\">');\n\t\t\t\t\t$searchActivity = [\n\t\t\t\t\t\t'logo' => $activity->logo,\n\t\t\t\t\t\t'name' => $activity->program_name,\n\t\t\t\t\t];\n\t\t\t\t\tarray_push($searchActivities, $searchActivity);\n\t\t\t\t}\n\t\t\t}\n\t\t\tarray_push($result, array('item' => $item, 'activity' => $searchActivities));\n\t\t}\n\n\t\t$final = array('totalPage' => ceil(sizeof($searchAll)/$limit), 'total' => ( sizeof($searchAll) > 0 ? sizeof($searchAll) : 0), 'result' => $result, 'debug' => DB::getQueryLog()[0]['query']);\n\t\treturn $final;\n\t}", "public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}", "public function all()\n {\n return $this->model->get();\n }", "public function master_search() {\r\n $this->db->join(\r\n '__Vehicles', \r\n '__Vehicles.__ContactId = ' . $this->table_name. '.' . $this->contactId_fieldname ,\r\n 'left outer'\r\n ); \r\n return $this->get();\r\n }", "public function getList()\n {\n return $this->model->getList();\n }", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function findBy(array $filters);", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getList($params = [])\n {\n $model = $this->prepareModel();\n return $model::all();\n }", "abstract protected function getSearchModelName(): string;", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public function getFilters();", "public static function getList(array $filters){\n return self::model()->findAllByAttributes($filters);\n }", "public function getSearch();", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function actionList() {\n switch ($_GET['model']) {\n case 'Product':\n $models = Product::model()->findAll();\n break;\n case 'Vendor':\n $models = Vendor::model()->findAll();\n break;\n case 'FavoriteProduct':\n $models = FavoriteProduct::model()->findAll();\n break;\n case 'Order':\n $models = Order::model()->findAll();\n break;\n case 'Rating':\n $models = Rating::model()->findAll();\n break;\n case 'Review':\n $models = Review::model()->findAll();\n break;\n case 'UserAddress':\n $models = UserAddress::model()->findAll();\n break;\n case 'OrderDetail':\n $models = OrderDetail::model()->findAll();\n break;\n default:\n $this->_sendResponse(0, 'You have pass invalid modal name');\n Yii::app()->end();\n }\n // Did we get some results?\n if (empty($models)) {\n // No\n $this->_sendResponse(0, 'No Record found ');\n } else {\n // Prepare response\n $rows = array();\n $i = 0;\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n if ($_GET['model'] == 'Order') {\n $rows[$i]['cart_items'] = Product::model()->getProducts($model->product_id);\n $rows[$i]['order_detail'] = OrderDetail::model()->findAll(array('condition' => 'order_id ='.$model->id));\n }\n $i = $i + 1;\n }\n // Send the response\n $this->_sendResponse(1, '', $rows);\n }\n }", "static public function filterData($model_name)\n {\n $query = \"{$model_name}Query\";\n $objects = $query::create()->find();\n \n if ($objects != null) {\n\n $array = array();\n foreach ($objects as $object) {\n $array[$object->getId()] = $object->__toString();\n }\n\n return $array;\n } else {\n return array();\n }\n }", "public static function getList(string $filter='')\n {\n $query = self::with(['product','insuredPerson','agency'])->whereNotNull('n_OwnerId_FK');\n\n $filterArray = json_decode(request('filter'));\n\n if (is_object($filterArray)) {\n foreach($filterArray as $key=>$value) {\n if (empty($value)) {\n continue;\n }\n if (is_array($value)) {\n $query->whereIn($key, $value);\n continue;\n }\n $query->where($key, 'like', \"%$value%\");\n }\n }\n return $query;\n }", "public function getCriteria();", "public static function getSearchable()\n {\n return [\n 'columns' => [],\n 'joins' => [\n \n ]\n ];\n }", "static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }", "public function findByModelName($model_name);", "abstract public function getFieldsSearchable();", "function _get_by_related($model, $arguments = array())\r\n\t{\r\n\t\tif ( ! empty($model))\r\n\t\t{\r\n\t\t\t// Add model to start of arguments\r\n\t\t\t$arguments = array_merge(array($model), $arguments);\r\n\t\t}\r\n\r\n\t\t$this->_related('where', $arguments);\r\n\r\n\t\treturn $this->get();\r\n\t}", "public static function getModels()\n\t{\n\t\t$result = [];\n\t\t$path = __DIR__ . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR;\n\t\t$Iterator = new RecursiveDirectoryIterator($path);\n\t\t$objects = new RecursiveIteratorIterator($Iterator, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach ($objects as $name => $object)\n\t\t{\n\t\t\tif (strtolower(substr($name, -4) != '.php'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$name = strtolower(str_replace($path, '', substr($name, 0, strlen($name) - 4)));\n\t\t\t$name = str_replace(DIRECTORY_SEPARATOR, '\\\\', $name);\n\t\t\t$name = 'Model\\\\' . ucwords($name, '\\\\');\n\t\t\tif (class_exists($name))\n\t\t\t{\n\t\t\t\t$result[]= $name;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }", "public function getListQuery();", "public function getList()\n {\n $filter = $this->getEvent()->getRouteMatch()->getParam('filter', null);\n return $this->getService()\n ->getList($filter);\n }", "public function search($model, $request)\n {\n $search = filter_var($request->get('search'), FILTER_SANITIZE_STRING);\n\n // Get optional filters\n // FILTER: GEOLOCATION\n if($request->input('location')) {\n $location = filter_var($request->get('location'), FILTER_SANITIZE_STRING);\n }\n if($request->input('geo_lat')) {\n $geo_lat = filter_var($request->get('geo_lat'), FILTER_SANITIZE_STRING);\n $geo_lng = filter_var($request->get('geo_lng'), FILTER_SANITIZE_STRING);\n }\n\n /**\n * Get current page number for location manual Pagination\n */\n $page = $request->get('page') ? $request->get('page') : 1;\n\n\n // Location first, since it's a special query\n if(isset($geo_lat) && isset($geo_lng)) {\n \n $location_data = Posts::location($geo_lat, $geo_lng, $search, 25, 100); \n\n // Hard and dirty search function through collection\n // since search with location method doesn't work still\n if($search !== '') {\n $location_data = $location_data->filter(function ($item) use ($search) {\n return stripos($item->name, $search) !== false;\n });\n }\n\n // Paginate results because location method can't\n $paginate = new Paginate;\n return $paginate->paginate($location_data, 15, $page, [\n 'path' => '/search/'\n ]);\n\n } \n // Section selection handler (brands/shops/prods/strains)\n elseif($search)\n {\n return $model->where('name', 'like', \"%$search%\");\n }\n\n }", "public function getWorkFlowModels()\n {\n return $this->postRequest('GetWorkFlowModels');\n }", "private function _getAllModels(): array {\n\t\t$models = Array();\n\t\t$folder = Environment::$dirs->models;\n\t\t$files = array_diff(scandir($folder), array('.', '..'));\n\t\tforeach ($files as $fileName) {\n\t\t\tinclude_once($folder.DIRECTORY_SEPARATOR.$fileName);\n\t\t\t$className = basename($fileName, \".php\");\n\t\t\t$classNameNamespaced = \"\\\\Jeff\\\\Api\\\\Models\\\\\" . ucfirst($className);\n\t\t\t$model = new $classNameNamespaced($this->db, $this->account);\n\t\t\t$models[$model->modelNamePlural] = $model;\n\t\t}\n\t\treturn $models;\n\t}", "function getAll(){\n\n\t\t\t$this->db->order_by(\"status\", \"asc\");\n\t\t\t$query = $this->db->get_where($this->table);\n\t\t\treturn $query;\n\t\t}", "public function actionViewModelList($modelName)\n\t{\n\t\t$pageSize = BaseModel::PAGE_SIZE;\n\t\tif ($_POST[\"sortBy\"]) {\n\t\t\t$order = $_POST[\"sortBy\"];\n\t\t}\n\t\t//echo $order;\n\t\t/*if (!$modelName) {\n\t\t\t\n\t\t}*/\n\t\t$sess_data = Yii::app()->session->get($modelName.'search');\n\t\t$searchId = $_GET[\"search_id\"];\n\t\t$fromSearchId = TriggerValues::model() -> decodeSearchId($searchId);\n\t\t//print_r($fromSearchId);\n\t\t//echo \"<br/>\";\n\t\t//Если задан $_POST/GET с формы, то сливаем его с массивом из searchId с приоритетом у searchId\n\t\tif ($_POST[$modelName.'SearchForm'])\n\t\t{\n\t\t\t$fromPage = array_merge($_POST[$modelName.'SearchForm'], $fromSearchId);\n\t\t} else {\n\t\t\t//Если же он не задан, то все данные берем из searchId\n\t\t\t$fromPage = $fromSearchId;\n\t\t}\n\t\t//print_r($fromPage);\n\t\tif ((!$fromPage)&&(!$sess_data))\n\t\t{\n\t\t\t//Если никаких критереев не задано, то выдаем все модели.\n\t\t\t$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t} else {\n\t\t\tif ($_GET[\"clear\"]==1)\n\t\t\t{\n\t\t\t\t//Если критерии заданы, но мы хотим их сбросить, то снова выдаем все и обнуляем нужную сессию\n\t\t\t\tYii::app()->session->remove($modelName.'search');\n\t\t\t\t$page = 1;\n\t\t\t\t//was://$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromSearchId,$order);\n\t\t\t} else {\n\t\t\t\t//Если же заданы какие-то критерии, но не со страницы, то вместо них подаем данные из сессии\n\t\t\t\tif (!$fromPage)\n\t\t\t\t{\n\t\t\t\t\t$fromPage = $sess_data;\n\t\t\t\t\t//echo \"from session\";\n\t\t\t\t}\n\t\t\t\t//Адаптируем критерии под специализацию. Если для данной специализации нет какого-то критерия, а он где-то сохранен, то убираем его.\n\t\t\t\t$fromPage = Filters::model() -> FilterSearchCriteria($fromPage, $modelName);\n\t\t\t\t//Если критерии заданы и обнулять их не нужно, то запускаем поиск и сохраняем его критерии в сессию.\n\t\t\t\tYii::app()->session->add($modelName.'search',$fromPage);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromPage,$order);\n\t\t\t}\n\t\t}\n\t\t//делаем из массива объектов dataProvider\n $dataProvider = new CArrayDataProvider($searched['objects'],\n array( 'keyField' =>'id'\n ));\n\t\t$this -> layout = 'layoutNoForm';\n\t\t//Определяем страницу.\n\t\t$maxPage = ceil(count($searched['objects'])/$pageSize);\n\t\tif ($_GET[\"page\"]) {\n\t\t\t$_POST[\"page\"] = $_GET[\"page\"];\n\t\t}\n\t\t$page = $_POST[\"page\"] ? $_POST[\"page\"] : 1;\n\t\t$page = (($page >= 1)&&($page <= $maxPage)) ? $page : 1;\n\t\t$_POST[$modelName.'SearchForm'] = $fromPage;\n\t\t$this->render('show_list', array(\n\t\t\t'objects' => array_slice($searched['objects'],($page - 1) * $pageSize, $pageSize),\n\t\t\t'modelName' => $modelName,\n\t\t\t'filterForm' => $modelName::model() -> giveFilterForm($fromPage),\n\t\t\t'fromPage' => $fromPage,\n\t\t\t'description' => $searched['description'],\n\t\t\t'specialities' => Filters::model() -> giveSpecialities(),\n\t\t\t'page' => $page,\n\t\t\t'maxPage' => $maxPage,\n\t\t\t'total' => count($searched['objects'])\n\t\t));\n\t\t\n\t}", "public function search_through(Request $request)\n {\n $reports = Payment::query();\n\n if (!empty($request->query())) {\n foreach ($request->query() as $key => $value) {\n if ($key == 'date') {\n $reports->whereDate('created_at', '>=', $value);\n } else {\n $reports->where($key, $value);\n }\n }\n }\n\n return $reports->get();\n }", "public function models($query, array $options = [])\n {\n $hits = $this->run($query);\n list($models, $totalCount) = $this->search->config()->models($hits, $options);\n // Remember total number of results.\n $this->setCachedCount($query, $totalCount);\n\n return Collection::make($models);\n }", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n return $this->repository->all();\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function queryset(){\n return $this->_get_queryset();\n }", "public function index(Request $request)\n {\n $keyword = $request->get('search');\n $perPage = $request->get('limit');\n $perPage = empty($perPage) ? 25 : $perPage;\n\n if (!empty($keyword)) {\n $filters = Filter::where('sl_gender', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_color', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_occasion', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_style', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_age', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_from', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_to', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_city_id', 'LIKE', \"%$keyword%\")\n ->orWhere('user_id', 'LIKE', \"%$keyword%\")\n ->paginate($perPage);\n } else {\n $filters = Filter::paginate($perPage);\n }\n\n return $filters;\n }", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getSearchCriterias()\n {\n return $this->_searchCriterias;\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "private function getSearchConditions()\n {\n $searchConditions = [];\n\n $userIds = $this->request->get('ids') ?? [];\n if ($userIds) {\n $searchConditions['id'] = $userIds;\n }\n\n $email = $this->request->get('email') ?? '';\n if ($email) {\n $searchConditions['email'] = $email;\n }\n\n return $searchConditions;\n }", "public function findAllAction();", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sSavedFilterList = \"\";\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\" && isset($UserProfile))\n\t\t\t$sSavedFilterList = $UserProfile->GetSearchFilters(CurrentUserName(), \"fsolicitudlistsrch\");\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id->AdvancedSearch->ToJson(), \",\"); // Field id\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nombre_contacto->AdvancedSearch->ToJson(), \",\"); // Field nombre_contacto\n\t\t$sFilterList = ew_Concat($sFilterList, $this->name->AdvancedSearch->ToJson(), \",\"); // Field name\n\t\t$sFilterList = ew_Concat($sFilterList, $this->lastname->AdvancedSearch->ToJson(), \",\"); // Field lastname\n\t\t$sFilterList = ew_Concat($sFilterList, $this->_email->AdvancedSearch->ToJson(), \",\"); // Field email\n\t\t$sFilterList = ew_Concat($sFilterList, $this->address->AdvancedSearch->ToJson(), \",\"); // Field address\n\t\t$sFilterList = ew_Concat($sFilterList, $this->phone->AdvancedSearch->ToJson(), \",\"); // Field phone\n\t\t$sFilterList = ew_Concat($sFilterList, $this->cell->AdvancedSearch->ToJson(), \",\"); // Field cell\n\t\t$sFilterList = ew_Concat($sFilterList, $this->created_at->AdvancedSearch->ToJson(), \",\"); // Field created_at\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_sucursal->AdvancedSearch->ToJson(), \",\"); // Field id_sucursal\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoinmueble->AdvancedSearch->ToJson(), \",\"); // Field tipoinmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipovehiculo->AdvancedSearch->ToJson(), \",\"); // Field tipovehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomaquinaria->AdvancedSearch->ToJson(), \",\"); // Field tipomaquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomercaderia->AdvancedSearch->ToJson(), \",\"); // Field tipomercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->documento_mercaderia->AdvancedSearch->ToJson(), \",\"); // Field documento_mercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoespecial->AdvancedSearch->ToJson(), \",\"); // Field tipoespecial\n\t\t$sFilterList = ew_Concat($sFilterList, $this->email_contacto->AdvancedSearch->ToJson(), \",\"); // Field email_contacto\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "public function search(Request $request)\n {\n if(!$request->has('query')) {\n return response()->json(['message' => 'Please type a keyword.']);\n }\n\n $userTenant = Auth::userTenant();\n $user = Auth::user();\n\n $searchableModelNameSpace = 'App\\\\Models\\\\';\n $result = [];\n // Loop through the searchable models.\n foreach (config('scout.searchableModels') as $model) {\n $modelClass = $searchableModelNameSpace.$model;\n $modelService = app($model.'Ser');\n\n if($model == 'Task') {\n $allowedModels = $modelService->searchForUserTenant($userTenant, $request->get('query'))->get();\n } else {\n $foundModels = $modelClass::search($request->get('query'))->get();\n if ($model === 'Comment') {\n $foundModels->where('groupId', '!=', null)->toArray();\n }\n $policy = app()->make('App\\Policies\\V2\\\\' . $model . 'Policy');\n $allowedModels = $foundModels->filter(function(BaseModel $foundModel) use($user, $policy) {\n return $policy->getAccess($user, $foundModel);\n });\n }\n\n $result[Str::lower($model) . 's'] = $allowedModels;\n }\n\n $responseData = ['message' => 'Keyword(s) matched!', 'results' => $result, 'pagination' => ['more' => false]];\n $responseHeader = Response::HTTP_OK;\n if (!count($result)) {\n $responseData = ['message' => 'No results found, please try with different keywords.'];\n $responseHeader = Response::HTTP_NOT_FOUND;\n }\n\n return response()->json($responseData, $responseHeader);\n }", "public function getAndFilter() {\n\t\treturn $this->db->getAndFilter();\n\t}" ]
[ "0.6744587", "0.6744587", "0.66071475", "0.6480176", "0.6380854", "0.63459533", "0.6310267", "0.6301479", "0.62540275", "0.625096", "0.625096", "0.6111257", "0.60779804", "0.6071859", "0.60465646", "0.6035604", "0.60343957", "0.6015879", "0.59832615", "0.59805286", "0.5979286", "0.59701556", "0.59312874", "0.5927603", "0.59224916", "0.5891777", "0.5888019", "0.58500385", "0.5848168", "0.5827002", "0.58180237", "0.58134884", "0.58085763", "0.57903516", "0.57772547", "0.57701206", "0.57645535", "0.57641006", "0.5752261", "0.5740839", "0.57383156", "0.5728667", "0.5723783", "0.5723328", "0.572305", "0.5720528", "0.5718706", "0.571377", "0.5711854", "0.57070047", "0.5694479", "0.56806386", "0.5671331", "0.56708217", "0.567048", "0.567048", "0.567048", "0.5669598", "0.56677866", "0.5665962", "0.5656587", "0.56506765", "0.5649381", "0.5643239", "0.5635908", "0.5634382", "0.563247", "0.56226563", "0.56167454", "0.56126386", "0.56093323", "0.55950135", "0.55783314", "0.55714875", "0.5556534", "0.5549239", "0.55488616", "0.5547631", "0.554729", "0.55349416", "0.5534242", "0.5534184", "0.5531692", "0.5525876", "0.5519699", "0.5518362", "0.5514306", "0.5509539", "0.5506421", "0.55009496", "0.5499837", "0.5496821", "0.5496821", "0.5496821", "0.54954517", "0.5493816", "0.5492836", "0.54923123", "0.54904383", "0.5488725", "0.548521" ]
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=$this->criteriaSearch(); $criteria->limit=10; return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public function getModels()\n\t{\n\t\t$scope = $this->scopeName;\n\t\treturn CActiveRecord::model($this->baseModel)->$scope()->findAll();\n\t}", "protected function findModel()\n {\n $class = $this->model;\n $query = $class::query();\n\n foreach ($this->input as $key => $value) {\n $where = is_array($value) ? 'whereIn' : 'where';\n $query->$where($key, $value);\n }\n\n return $query->get();\n }", "public function modelScans()\n {\n if ($this->scanEverything) {\n return $this->getAllClasses();\n }\n\n return $this->scanModels;\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function getModelsForIndex()\n {\n $models = [];\n $all_models = $this->getAllModels();\n\n foreach ($all_models as $model) {\n //parse model\n $pieces = explode('.', $model);\n if (count($pieces) != 2) {\n throw new Exception('Parse error in AppModelList');\n }\n //check form match\n $app_model = $pieces[1];\n $link = $this->convertModelToLink($app_model);\n\n // add to actions\n $models[$app_model]['GET'] = [\n [\n 'action' => 'index',\n 'description' => 'List & filter all ' . $app_model . ' resources.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link\n ],\n [\n 'action' => 'show',\n 'description' => 'Show the ' . $app_model . ' that has the matching {id} from the route.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link . '/{id}'\n ]\n ];\n }\n return $models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function searchableBy()\n {\n return [];\n }", "public function all($model){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public static function find($model, $conditions = null, $orderby = null){\n\t\t$sql = \"SELECT * FROM \" . self::table_for($model);\n\t\tif ($conditions) $sql .= \" WHERE \" . self::make_conditions($conditions);\n\t\tif ($orderby)\t$sql .= \" ORDER BY \" . $orderby;\n\t\t\n\t\t$resultset = self::do_query($sql);\n\t\treturn self::get_results($resultset, $model);\n\t}", "function get_model_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"make_model\",\"id,name,del_status\",$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }", "public function getList()\n {\n $this->db->order_by(\"id\", 'desc');\n $this->db->where('status', 1);\n return $this->db->get($this->model);\n }", "public function findAll()\n {\n $fields = $options = [];\n //$options['debug'] = 1;\n $options['enablefieldsfe'] = 1;\n\n return $this->search($fields, $options);\n }", "public function findAll()\n {\n return $this->model->all();\n }", "public function get_multiple()\n\t{\n\t\t$options = array_merge(array(\n\t\t\t'offset' => 0,\n\t\t\t'limit' => 20,\n\t\t\t'sort_by' => 'name',\n\t\t\t'order' => 'ASC'\n\t\t), Input::all(), $this->options);\n\n\t\t// Preparing our query\n\t\t$results = $this->model->with($this->includes);\n\n\t\tif(count($this->join) > 0)\n\t\t{\n\t\t\tforeach ($this->join as $table => $settings) {\n\t\t\t\t$results = $results->join($table, $settings['join'][0], $settings['join'][1], $settings['join'][2]);\n\t\t\t\tif($settings['columns'])\n\t\t\t\t{\n\t\t\t\t\t$options['sort_by'] = (in_array($options['sort_by'], $settings['columns']) ? $table : $this->model->table()).'.'.$options['sort_by'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(stripos($options['sort_by'], '.') === 0)\n\t\t{\n\t\t\t$options['sort_by'] = $this->model->table().'.' . $options['sort_by'];\n\t\t}\n\t\t\n\t\t// Add where's to our query\n\t\tif(array_key_exists('search', $options))\n\t\t{\n\t\t\tforeach($options['search']['columns'] as $column)\n\t\t\t{\n\t\t\t\t$results = $results->or_where($column, '~*', $options['search']['string']);\n\t\t\t}\n\t\t}\n\n\t\t$total = (int) $results->count();\n\n\t\t// Add order_by, skip & take to our results query\n\t\t$results = $results->order_by($options['sort_by'], $options['order'])->skip($options['offset'])->take($options['limit'])->get();\n\n\t\t$response = array(\n\t\t\t'results' => to_array($results),\n\t\t\t'total' => $total,\n\t\t\t'pages' => ceil($total / $options['limit'])\n\t\t);\n\n\t\treturn Response::json($response);\n\t}", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "public function filter($params) {\n $model = $this->model;\n $keyword = isset($params['keyword'])?$params['keyword']:'';\n $sort = isset($params['sort'])?$params['sort']:''; \n if ($sort == 'name') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('name'); \n }\n else if ($sort == 'newest') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('updated_at','desc'); \n }\n else {\n $query = $model->where('name','LIKE','%'.$keyword.'%'); \n }\n /** filter by class_id */ \n if (isset($params['byclass']) && isset($params['bysubject'])) {\n $query = $model->listClass($params['byclass'], $params['bysubject']);\n return $query; \n }\n else if (isset($params['byclass'])) { \n $query = $model->listClass($params['byclass']);\n return $query;\n }\n else if (isset($params['bysubject'])) {\n $query = $model->listClass(0,$params['bysubject']);\n return $query;\n }\n /** filter by course status */\n if (isset($params['incomming'])) {\n $query = $model->listCourse('incomming');\n return $query;\n }\n else if (isset($params['upcomming'])) {\n $query = $model->listCourse('upcomming');\n return $query;\n }\n $result = $query->paginate(10); \n return $result; \n }", "public function getAll($model, $filters = array())\n {\n $repo = $this->getRepository($model);\n\n return $repo->getAll($filters);\n }", "public function filters(Model $model): array\n {\n return [];\n }", "public function getResults()\n {\n if($this->search) {\n foreach ($this->filters as $field) {\n $field = array_filter(explode('.', $field));\n if(count($field) == 2) {\n $this->query->whereHas($field[0], function ($q) use ($field) {\n $q->where($field[1], 'ilike', \"%{$this->search}%\");\n });\n }\n if(count($field) == 1) {\n $this->query->orWhere($field[0], 'ilike', \"%{$this->search}%\");\n }\n }\n }\n\n if($this->where) {\n foreach ($this->where as $field => $value) {\n $this->query->where($field, $value);\n }\n }\n\n if ($this->whereBetween) {\n foreach ($this->whereBetween as $field => $value)\n $this->query->whereBetween($field, $value);\n }\n// dd($this->query->toSql());\n return $this->query->paginate($this->per_page);\n }", "protected function _searchInModel(Model $model, Builder $items){\n foreach($model->searchable as $param){\n if($param != 'id'){\n if(isset($this->request[$param]))\n $items = $items->where($param, $this->request[$param]);\n if(isset($this->request[$param.'_like']))\n $items = $items->where($param, 'like', '%'.$this->request[$param.'_like'].'%');\n }else{\n if(isset($this->request['id'])){\n $ids = explode(',', $this->request['id']);\n $items = $items->whereIn('id', $ids);\n }\n }\n }\n\n return $items;\n }", "public function getAll($model)\n {\n $sql = \"SELECT * FROM {$this->table}\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_CLASS,get_class($this->model));\n }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function findAll()\n {\n return $this->driver->findAll($this->model);\n }", "public function getAllFilters();", "public function GetAll()\n {\n return $this->model->all();\n }", "public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function findWhere($model, $conditions, $limit = 0){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n\n $sql = 'select * from ' . $table . ' where ';\n $values = [];\n $counter = 1;\n\n foreach ($conditions as $key => $value) {\n if($counter > 1)\n $sql .= ' AND ';\n\n $sql .= $key . '=?';\n $values[] = $value; \n $counter++;\n }\n\n if($limit > 0)\n $sql .= ' LIMIT ' . $limit;\n \n $stmt = $this->pdo->prepare($sql);\n $stmt->execute($values);\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('type', $this->type);\n\n return $criteria;\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getModels()\n {\n return $this->_models;\n }", "public function getSearchFields();", "public function all()\n {\n return $this->model->get();\n }", "public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "public function getAll()\n {\n return $this->fetchAll($this->searchQuery(0));\n }", "public function listAction() {\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$select = null;\n\t\t\n\t\tif ($this->_request->getParam('data')) {\n\t\t\t\n\t\t\t$data = unserialize($this->_request->getParam('data'));\n\t\t\t$aWhere = array();\n\t\t\t$searchText = array();\n\t\t\t\n\t\t\tforeach ($data['query'] as $key => $q) {\n\t\t\t\n\t\t\t\tif (isset($data['fields'][$key]) && !empty($data['fields'][$key])) {\n\t\t\t\t\n\t\t\t\t\t$func = addslashes($data['func'][$key]);\n\t\t\t\t\t$q =\taddslashes($q);\n\t\t\t\t\t$tmpWhere = array();\n\t\t\t\t\t$searchText[] = implode(' OU ', $data['fields'][$key]) . ' ' . $this->view->func[$func] . ' \"' . stripslashes($q) . '\"';\n\t\t\t\t\t\n\t\t\t\t\tforeach ($data['fields'][$key] as $field) {\n\t\t\t\t\t\n\t\t\t\t\t\t$field\t=\taddslashes($field);\n\t\t\t\t\t\tswitch ($func) {\n\t\t\t\t\t\t\tcase 'LIKE':\n\t\t\t\t\t\t\tcase 'NOT LIKE':\n\t\t\t\t\t\t\tcase '=':\n\t\t\t\t\t\t\tcase '!=':\n\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\tcase '>=':\n\t\t\t\t\t\t\tcase '<':\n\t\t\t\t\t\t\tcase '<=':\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' ' . $func . ' \\'' . $q . '\\''; }\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"= ''\":\n\t\t\t\t\t\t\tcase \"!= ''\":\n\t\t\t\t\t\t\tcase 'IS NULL':\n\t\t\t\t\t\t\tcase 'IS NOT NULL':\n\t\t\t\t\t\t\t\t$tmpWhere[] = $field . ' ' . stripslashes($func);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' LIKE \\'%' . $q . '%\\''; }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$aWhere[] = '(' . implode(' OR ', $tmpWhere) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($aWhere)) { $select = $model->select()->where(implode(' AND ', $aWhere)); }\n\t\t\t$this->view->searchText = $searchText;\n\t\t}\n\t\t$this->view->model = $modelName;\n\t\t$this->view->allData = $model->fetchAll($select);\n\t\t$this->view->data = Zend_Paginator::factory($this->view->allData)\n\t\t\t\t\t\t\t->setCurrentPageNumber($this->_getParam('page', 1));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function index(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required',\n 'searched' => 'required',\n ]);\n\n try {\n if ($request->type == 'Categories') {\n return Category::search($request->searched)->take(20)->get();\n }\n\n if ($request->type == 'Submissions') {\n return $this->sugarFilter(Submission::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Comments') {\n return $this->withoutChildren(Comment::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Users') {\n return User::search($request->searched)->take(20)->get();\n }\n } catch (\\Exception $exception) {\n app('sentry')->captureException($exception);\n\n return [];\n }\n }", "public function getReturnModels(){\r\n return array_values($this->models);\r\n }", "public function findAll()\n {\n $models = $this->getDoctrineRepository()->findAll();\n $this->events()->trigger(__FUNCTION__ . '.post', $this, array(\n 'model' => $models,\n 'om' => $this->getObjectManager())\n );\n return $models;\n }", "public function models();", "public function search($conditions)\n\t{\n\t\t$limit = (isset($conditions['limit']) && $conditions['limit'] !== null ? $conditions['limit'] : 10);\n\t\t$result = array();\n\t\t$alphabets = [];\n\n\t\tDB::enableQueryLog();\n\n\t\t$mem = new Memcached();\n\t\t$mem->addServer(env('memcached_server'), env('memcached_port'));\n\n\t\t/* Get Default Logo Link on setting_object table */\n\t\t$logoMem = $mem->get('logo_course');\n\n\t\tif ($logoMem)\n\t\t{\n\t\t\t$default_logo = $logoMem;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$default_logo = $this->getDefaultLogo();\n\t\t\t$mem->set('logo_course', $default_logo);\n\t\t}\n\n\t\tif (isset($conditions['alphabet']) && $conditions['alphabet'] !== null && sizeof($conditions['alphabet']) > 0) {\n\t\t\tforeach ($conditions['alphabet'] as $item) {\n\t\t\t\t$alphabets[] = \"lower(entity.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t\t$alphabets[] = \"lower(curriculum.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t}\n\t\t}\n\n\t\t$extraGroup = (isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : '' );\n\t\t$extraGroup = str_replace(' ASC', '',$extraGroup);\n\t\t$extraGroup = str_replace(' DESC', '',$extraGroup);\n\n\t\t$searchData = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->limit($limit)\n\t\t\t->offset(isset($conditions['page']) && $conditions['page'] !== null ? ($conditions['page']-1) * $limit : 0)\n\t\t\t->get();\n\n\t\t$searchAll = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t//->groupBy('course.course_id','schedule.instructor_id','curriculum.curriculum_id','entity.logo', 'course.day_of_week','entity.name','curriculum.name','course.time_start', 'course.time_end','event_type.name')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->get();\n\n\t\t//echo(\"<br>Total : \" . sizeof($searchData) . \" records\");\n\t\tforeach ($searchData as $data) {\n\t\t\t/*echo('<br>' . $data->program_id . '|' . $data->program_name . '|'. $data->activity_id . '|' . $data->provider_name . '|' . $data->location_name);*/\n\t\t\t//echo('<br>' . $data->provider_id . '|' . $data->provider_name . '|' . $data->location_name);\n\n\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\n\n\t\t\t//echo('<br>' . $data->course_id . \"~\" . $data->program_name . '#'.$day->name. \"|\". date('h:i',strtotime($data->time_start)) . '-' .date('h:i',strtotime($data->time_end)));\n\t\t\t$item = ['course_id' => $data->course_id,\n\t\t\t\t'entity_logo' => ($data->entity_logo ? $data->entity_logo : $default_logo),\n\t\t\t\t'entity_name' => $data->entity_name,\n\t\t\t\t'curriculum_name' => $data->curriculum_name,\n\t\t\t\t'day_name' => $day->name,\n\t\t\t\t'time_start' => date('H:i',strtotime($data->time_start)),\n\t\t\t\t'time_end' => date('H:i',strtotime($data->time_end))];\n\n\t\t\t/*$schedules = DB::table('schedule')\n\t\t\t\t->select('schedule.schedule_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\tforeach ($schedules as $schedule) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t}*/\n\n\t\t\t$programs = DB::table('curriculum')\n\t\t\t\t->select('program.program_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\t$searchActivities = [];\n\t\t\tforeach ($programs as $program) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t\t$activities = DB::table('program')\n\t\t\t\t\t->select('activity.logo', 'program.provider_id', DB::raw('program.name program_name'))\n\t\t\t\t\t->join('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t\t\t->leftjoin('activity_classification', 'activity.activity_classification_id', 'activity_classification.activity_classification_id')\n\t\t\t\t\t->where('program.program_id', $program->program_id)\n\t\t\t\t\t->whereRaw(\n\t\t\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\t\t\t\t\t\t('program.status = 0')\n\t\t\t\t\t)\n\t\t\t\t\t//->groupBy('activity.logo')\n\t\t\t\t\t->get();\n\n\t\t\t\tforeach ($activities as $activity) {\n\t\t\t\t\t//echo('<img src=\"' . $activity->logo . '\" style=\"width:2%;\" alt=\"' . $activity->program_name . '\" title=\"' . $activity->program_name . '\">');\n\t\t\t\t\t$searchActivity = [\n\t\t\t\t\t\t'logo' => $activity->logo,\n\t\t\t\t\t\t'name' => $activity->program_name,\n\t\t\t\t\t];\n\t\t\t\t\tarray_push($searchActivities, $searchActivity);\n\t\t\t\t}\n\t\t\t}\n\t\t\tarray_push($result, array('item' => $item, 'activity' => $searchActivities));\n\t\t}\n\n\t\t$final = array('totalPage' => ceil(sizeof($searchAll)/$limit), 'total' => ( sizeof($searchAll) > 0 ? sizeof($searchAll) : 0), 'result' => $result, 'debug' => DB::getQueryLog()[0]['query']);\n\t\treturn $final;\n\t}", "public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}", "public function all()\n {\n return $this->model->get();\n }", "public function master_search() {\r\n $this->db->join(\r\n '__Vehicles', \r\n '__Vehicles.__ContactId = ' . $this->table_name. '.' . $this->contactId_fieldname ,\r\n 'left outer'\r\n ); \r\n return $this->get();\r\n }", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getList()\n {\n return $this->model->getList();\n }", "public function findBy(array $filters);", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getList($params = [])\n {\n $model = $this->prepareModel();\n return $model::all();\n }", "abstract protected function getSearchModelName(): string;", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public function getFilters();", "public static function getList(array $filters){\n return self::model()->findAllByAttributes($filters);\n }", "public function getSearch();", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function actionList() {\n switch ($_GET['model']) {\n case 'Product':\n $models = Product::model()->findAll();\n break;\n case 'Vendor':\n $models = Vendor::model()->findAll();\n break;\n case 'FavoriteProduct':\n $models = FavoriteProduct::model()->findAll();\n break;\n case 'Order':\n $models = Order::model()->findAll();\n break;\n case 'Rating':\n $models = Rating::model()->findAll();\n break;\n case 'Review':\n $models = Review::model()->findAll();\n break;\n case 'UserAddress':\n $models = UserAddress::model()->findAll();\n break;\n case 'OrderDetail':\n $models = OrderDetail::model()->findAll();\n break;\n default:\n $this->_sendResponse(0, 'You have pass invalid modal name');\n Yii::app()->end();\n }\n // Did we get some results?\n if (empty($models)) {\n // No\n $this->_sendResponse(0, 'No Record found ');\n } else {\n // Prepare response\n $rows = array();\n $i = 0;\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n if ($_GET['model'] == 'Order') {\n $rows[$i]['cart_items'] = Product::model()->getProducts($model->product_id);\n $rows[$i]['order_detail'] = OrderDetail::model()->findAll(array('condition' => 'order_id ='.$model->id));\n }\n $i = $i + 1;\n }\n // Send the response\n $this->_sendResponse(1, '', $rows);\n }\n }", "static public function filterData($model_name)\n {\n $query = \"{$model_name}Query\";\n $objects = $query::create()->find();\n \n if ($objects != null) {\n\n $array = array();\n foreach ($objects as $object) {\n $array[$object->getId()] = $object->__toString();\n }\n\n return $array;\n } else {\n return array();\n }\n }", "public static function getList(string $filter='')\n {\n $query = self::with(['product','insuredPerson','agency'])->whereNotNull('n_OwnerId_FK');\n\n $filterArray = json_decode(request('filter'));\n\n if (is_object($filterArray)) {\n foreach($filterArray as $key=>$value) {\n if (empty($value)) {\n continue;\n }\n if (is_array($value)) {\n $query->whereIn($key, $value);\n continue;\n }\n $query->where($key, 'like', \"%$value%\");\n }\n }\n return $query;\n }", "public function getCriteria();", "public static function getSearchable()\n {\n return [\n 'columns' => [],\n 'joins' => [\n \n ]\n ];\n }", "static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }", "public function findByModelName($model_name);", "abstract public function getFieldsSearchable();", "function _get_by_related($model, $arguments = array())\r\n\t{\r\n\t\tif ( ! empty($model))\r\n\t\t{\r\n\t\t\t// Add model to start of arguments\r\n\t\t\t$arguments = array_merge(array($model), $arguments);\r\n\t\t}\r\n\r\n\t\t$this->_related('where', $arguments);\r\n\r\n\t\treturn $this->get();\r\n\t}", "public static function getModels()\n\t{\n\t\t$result = [];\n\t\t$path = __DIR__ . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR;\n\t\t$Iterator = new RecursiveDirectoryIterator($path);\n\t\t$objects = new RecursiveIteratorIterator($Iterator, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach ($objects as $name => $object)\n\t\t{\n\t\t\tif (strtolower(substr($name, -4) != '.php'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$name = strtolower(str_replace($path, '', substr($name, 0, strlen($name) - 4)));\n\t\t\t$name = str_replace(DIRECTORY_SEPARATOR, '\\\\', $name);\n\t\t\t$name = 'Model\\\\' . ucwords($name, '\\\\');\n\t\t\tif (class_exists($name))\n\t\t\t{\n\t\t\t\t$result[]= $name;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }", "public function getListQuery();", "public function search($model, $request)\n {\n $search = filter_var($request->get('search'), FILTER_SANITIZE_STRING);\n\n // Get optional filters\n // FILTER: GEOLOCATION\n if($request->input('location')) {\n $location = filter_var($request->get('location'), FILTER_SANITIZE_STRING);\n }\n if($request->input('geo_lat')) {\n $geo_lat = filter_var($request->get('geo_lat'), FILTER_SANITIZE_STRING);\n $geo_lng = filter_var($request->get('geo_lng'), FILTER_SANITIZE_STRING);\n }\n\n /**\n * Get current page number for location manual Pagination\n */\n $page = $request->get('page') ? $request->get('page') : 1;\n\n\n // Location first, since it's a special query\n if(isset($geo_lat) && isset($geo_lng)) {\n \n $location_data = Posts::location($geo_lat, $geo_lng, $search, 25, 100); \n\n // Hard and dirty search function through collection\n // since search with location method doesn't work still\n if($search !== '') {\n $location_data = $location_data->filter(function ($item) use ($search) {\n return stripos($item->name, $search) !== false;\n });\n }\n\n // Paginate results because location method can't\n $paginate = new Paginate;\n return $paginate->paginate($location_data, 15, $page, [\n 'path' => '/search/'\n ]);\n\n } \n // Section selection handler (brands/shops/prods/strains)\n elseif($search)\n {\n return $model->where('name', 'like', \"%$search%\");\n }\n\n }", "public function getWorkFlowModels()\n {\n return $this->postRequest('GetWorkFlowModels');\n }", "private function _getAllModels(): array {\n\t\t$models = Array();\n\t\t$folder = Environment::$dirs->models;\n\t\t$files = array_diff(scandir($folder), array('.', '..'));\n\t\tforeach ($files as $fileName) {\n\t\t\tinclude_once($folder.DIRECTORY_SEPARATOR.$fileName);\n\t\t\t$className = basename($fileName, \".php\");\n\t\t\t$classNameNamespaced = \"\\\\Jeff\\\\Api\\\\Models\\\\\" . ucfirst($className);\n\t\t\t$model = new $classNameNamespaced($this->db, $this->account);\n\t\t\t$models[$model->modelNamePlural] = $model;\n\t\t}\n\t\treturn $models;\n\t}", "public function getList()\n {\n $filter = $this->getEvent()->getRouteMatch()->getParam('filter', null);\n return $this->getService()\n ->getList($filter);\n }", "function getAll(){\n\n\t\t\t$this->db->order_by(\"status\", \"asc\");\n\t\t\t$query = $this->db->get_where($this->table);\n\t\t\treturn $query;\n\t\t}", "public function actionViewModelList($modelName)\n\t{\n\t\t$pageSize = BaseModel::PAGE_SIZE;\n\t\tif ($_POST[\"sortBy\"]) {\n\t\t\t$order = $_POST[\"sortBy\"];\n\t\t}\n\t\t//echo $order;\n\t\t/*if (!$modelName) {\n\t\t\t\n\t\t}*/\n\t\t$sess_data = Yii::app()->session->get($modelName.'search');\n\t\t$searchId = $_GET[\"search_id\"];\n\t\t$fromSearchId = TriggerValues::model() -> decodeSearchId($searchId);\n\t\t//print_r($fromSearchId);\n\t\t//echo \"<br/>\";\n\t\t//Если задан $_POST/GET с формы, то сливаем его с массивом из searchId с приоритетом у searchId\n\t\tif ($_POST[$modelName.'SearchForm'])\n\t\t{\n\t\t\t$fromPage = array_merge($_POST[$modelName.'SearchForm'], $fromSearchId);\n\t\t} else {\n\t\t\t//Если же он не задан, то все данные берем из searchId\n\t\t\t$fromPage = $fromSearchId;\n\t\t}\n\t\t//print_r($fromPage);\n\t\tif ((!$fromPage)&&(!$sess_data))\n\t\t{\n\t\t\t//Если никаких критереев не задано, то выдаем все модели.\n\t\t\t$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t} else {\n\t\t\tif ($_GET[\"clear\"]==1)\n\t\t\t{\n\t\t\t\t//Если критерии заданы, но мы хотим их сбросить, то снова выдаем все и обнуляем нужную сессию\n\t\t\t\tYii::app()->session->remove($modelName.'search');\n\t\t\t\t$page = 1;\n\t\t\t\t//was://$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromSearchId,$order);\n\t\t\t} else {\n\t\t\t\t//Если же заданы какие-то критерии, но не со страницы, то вместо них подаем данные из сессии\n\t\t\t\tif (!$fromPage)\n\t\t\t\t{\n\t\t\t\t\t$fromPage = $sess_data;\n\t\t\t\t\t//echo \"from session\";\n\t\t\t\t}\n\t\t\t\t//Адаптируем критерии под специализацию. Если для данной специализации нет какого-то критерия, а он где-то сохранен, то убираем его.\n\t\t\t\t$fromPage = Filters::model() -> FilterSearchCriteria($fromPage, $modelName);\n\t\t\t\t//Если критерии заданы и обнулять их не нужно, то запускаем поиск и сохраняем его критерии в сессию.\n\t\t\t\tYii::app()->session->add($modelName.'search',$fromPage);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromPage,$order);\n\t\t\t}\n\t\t}\n\t\t//делаем из массива объектов dataProvider\n $dataProvider = new CArrayDataProvider($searched['objects'],\n array( 'keyField' =>'id'\n ));\n\t\t$this -> layout = 'layoutNoForm';\n\t\t//Определяем страницу.\n\t\t$maxPage = ceil(count($searched['objects'])/$pageSize);\n\t\tif ($_GET[\"page\"]) {\n\t\t\t$_POST[\"page\"] = $_GET[\"page\"];\n\t\t}\n\t\t$page = $_POST[\"page\"] ? $_POST[\"page\"] : 1;\n\t\t$page = (($page >= 1)&&($page <= $maxPage)) ? $page : 1;\n\t\t$_POST[$modelName.'SearchForm'] = $fromPage;\n\t\t$this->render('show_list', array(\n\t\t\t'objects' => array_slice($searched['objects'],($page - 1) * $pageSize, $pageSize),\n\t\t\t'modelName' => $modelName,\n\t\t\t'filterForm' => $modelName::model() -> giveFilterForm($fromPage),\n\t\t\t'fromPage' => $fromPage,\n\t\t\t'description' => $searched['description'],\n\t\t\t'specialities' => Filters::model() -> giveSpecialities(),\n\t\t\t'page' => $page,\n\t\t\t'maxPage' => $maxPage,\n\t\t\t'total' => count($searched['objects'])\n\t\t));\n\t\t\n\t}", "public function search_through(Request $request)\n {\n $reports = Payment::query();\n\n if (!empty($request->query())) {\n foreach ($request->query() as $key => $value) {\n if ($key == 'date') {\n $reports->whereDate('created_at', '>=', $value);\n } else {\n $reports->where($key, $value);\n }\n }\n }\n\n return $reports->get();\n }", "public function models($query, array $options = [])\n {\n $hits = $this->run($query);\n list($models, $totalCount) = $this->search->config()->models($hits, $options);\n // Remember total number of results.\n $this->setCachedCount($query, $totalCount);\n\n return Collection::make($models);\n }", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n return $this->repository->all();\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function queryset(){\n return $this->_get_queryset();\n }", "public function index(Request $request)\n {\n $keyword = $request->get('search');\n $perPage = $request->get('limit');\n $perPage = empty($perPage) ? 25 : $perPage;\n\n if (!empty($keyword)) {\n $filters = Filter::where('sl_gender', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_color', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_occasion', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_style', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_age', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_from', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_to', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_city_id', 'LIKE', \"%$keyword%\")\n ->orWhere('user_id', 'LIKE', \"%$keyword%\")\n ->paginate($perPage);\n } else {\n $filters = Filter::paginate($perPage);\n }\n\n return $filters;\n }", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getSearchCriterias()\n {\n return $this->_searchCriterias;\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "private function getSearchConditions()\n {\n $searchConditions = [];\n\n $userIds = $this->request->get('ids') ?? [];\n if ($userIds) {\n $searchConditions['id'] = $userIds;\n }\n\n $email = $this->request->get('email') ?? '';\n if ($email) {\n $searchConditions['email'] = $email;\n }\n\n return $searchConditions;\n }", "public function findAllAction();", "public function search(Request $request)\n {\n if(!$request->has('query')) {\n return response()->json(['message' => 'Please type a keyword.']);\n }\n\n $userTenant = Auth::userTenant();\n $user = Auth::user();\n\n $searchableModelNameSpace = 'App\\\\Models\\\\';\n $result = [];\n // Loop through the searchable models.\n foreach (config('scout.searchableModels') as $model) {\n $modelClass = $searchableModelNameSpace.$model;\n $modelService = app($model.'Ser');\n\n if($model == 'Task') {\n $allowedModels = $modelService->searchForUserTenant($userTenant, $request->get('query'))->get();\n } else {\n $foundModels = $modelClass::search($request->get('query'))->get();\n if ($model === 'Comment') {\n $foundModels->where('groupId', '!=', null)->toArray();\n }\n $policy = app()->make('App\\Policies\\V2\\\\' . $model . 'Policy');\n $allowedModels = $foundModels->filter(function(BaseModel $foundModel) use($user, $policy) {\n return $policy->getAccess($user, $foundModel);\n });\n }\n\n $result[Str::lower($model) . 's'] = $allowedModels;\n }\n\n $responseData = ['message' => 'Keyword(s) matched!', 'results' => $result, 'pagination' => ['more' => false]];\n $responseHeader = Response::HTTP_OK;\n if (!count($result)) {\n $responseData = ['message' => 'No results found, please try with different keywords.'];\n $responseHeader = Response::HTTP_NOT_FOUND;\n }\n\n return response()->json($responseData, $responseHeader);\n }", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sSavedFilterList = \"\";\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\" && isset($UserProfile))\n\t\t\t$sSavedFilterList = $UserProfile->GetSearchFilters(CurrentUserName(), \"fsolicitudlistsrch\");\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id->AdvancedSearch->ToJson(), \",\"); // Field id\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nombre_contacto->AdvancedSearch->ToJson(), \",\"); // Field nombre_contacto\n\t\t$sFilterList = ew_Concat($sFilterList, $this->name->AdvancedSearch->ToJson(), \",\"); // Field name\n\t\t$sFilterList = ew_Concat($sFilterList, $this->lastname->AdvancedSearch->ToJson(), \",\"); // Field lastname\n\t\t$sFilterList = ew_Concat($sFilterList, $this->_email->AdvancedSearch->ToJson(), \",\"); // Field email\n\t\t$sFilterList = ew_Concat($sFilterList, $this->address->AdvancedSearch->ToJson(), \",\"); // Field address\n\t\t$sFilterList = ew_Concat($sFilterList, $this->phone->AdvancedSearch->ToJson(), \",\"); // Field phone\n\t\t$sFilterList = ew_Concat($sFilterList, $this->cell->AdvancedSearch->ToJson(), \",\"); // Field cell\n\t\t$sFilterList = ew_Concat($sFilterList, $this->created_at->AdvancedSearch->ToJson(), \",\"); // Field created_at\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_sucursal->AdvancedSearch->ToJson(), \",\"); // Field id_sucursal\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoinmueble->AdvancedSearch->ToJson(), \",\"); // Field tipoinmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipovehiculo->AdvancedSearch->ToJson(), \",\"); // Field tipovehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomaquinaria->AdvancedSearch->ToJson(), \",\"); // Field tipomaquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomercaderia->AdvancedSearch->ToJson(), \",\"); // Field tipomercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->documento_mercaderia->AdvancedSearch->ToJson(), \",\"); // Field documento_mercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoespecial->AdvancedSearch->ToJson(), \",\"); // Field tipoespecial\n\t\t$sFilterList = ew_Concat($sFilterList, $this->email_contacto->AdvancedSearch->ToJson(), \",\"); // Field email_contacto\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "public function getAndFilter() {\n\t\treturn $this->db->getAndFilter();\n\t}" ]
[ "0.6744886", "0.6744886", "0.660744", "0.6478935", "0.63809466", "0.634619", "0.6310661", "0.63017946", "0.62542254", "0.6251588", "0.6251588", "0.6110578", "0.60789883", "0.6072824", "0.6045855", "0.60337853", "0.6033558", "0.60152847", "0.5982737", "0.5980334", "0.5979643", "0.59705067", "0.59310067", "0.59274197", "0.5921588", "0.58922106", "0.5888649", "0.5850717", "0.5848848", "0.58265543", "0.58166176", "0.5813406", "0.5808671", "0.5791005", "0.57769156", "0.5768634", "0.57644945", "0.57629555", "0.5752514", "0.5741027", "0.573719", "0.5728591", "0.5722794", "0.5722046", "0.57219696", "0.57207656", "0.5718825", "0.57142407", "0.5711659", "0.5705662", "0.5694775", "0.5681068", "0.5670744", "0.5670455", "0.5670455", "0.5670455", "0.56700355", "0.5669091", "0.56674314", "0.5665479", "0.56555426", "0.5650441", "0.56491435", "0.5641216", "0.56337774", "0.5632674", "0.56311625", "0.5622468", "0.5617358", "0.56110185", "0.56096834", "0.5594402", "0.55776775", "0.55723196", "0.55556023", "0.555058", "0.5549535", "0.5547251", "0.5546426", "0.5534472", "0.55335116", "0.5532724", "0.5532639", "0.55260795", "0.5518454", "0.55178773", "0.5515939", "0.55085504", "0.55058104", "0.5500244", "0.5498356", "0.54954916", "0.54954916", "0.54954916", "0.54944354", "0.549276", "0.5492497", "0.5491262", "0.5489033", "0.5488128", "0.5485355" ]
0.0
-1
Warning: Please modify the following code to remove attributes that
public function searchPrint() { // should not be searched. $criteria=$this->criteriaSearch(); $criteria->limit=-1; return new CActiveDataProvider($this, array( 'criteria'=>$criteria, 'pagination'=>false, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeBlacklistedAttributes($attribs) \n { \n $this->_html = preg_replace('/[\\s]+('.$attribs.')=[\\s]*(\"[^\"]*\"|\\'[^\\']*\\')/i',\"\",$this->_html); \n $this->_html = preg_replace('/[\\s]+('.$attribs.')=[\\s]*[^ |^>]*/i',\"\",$this->_html); \n }", "public function removeAttributes()\n\t{\n\t\tforeach ($this->argsArray(func_get_args()) as $a) {\n\t\t\t$this->removed_attrs[] = $a;\n\t\t}\n\t}", "abstract protected function attributes();", "public function removeAllAttributes()\n {\n $this->attr = [];\n }", "private function function_die(){\n\t\tunset($this->attributes);\n\t}", "public function clearAttributes ()\n {\n\n $this->attributes = null;\n $this->attributes = array();\n\n }", "public function __unset($name)\n {\n // Dont' allow to unset attributes Ruts\n }", "function DOM_delete_empty_attributes() {\r\n\t\t$query = '//' . ReTidy::get_html_namespace() . '*[@*=\"\"]';\r\n\t\t$tags_with_empty_attribute = $this->xpath->query($query);\r\n\t\tforeach($tags_with_empty_attribute as $tag) {\r\n\t\t\t$tagName = $tag->nodeName;\r\n\t\t\t$array_attributes = DTD::getAttributesForElementByType($tagName, \"#IMPLIED\");\r\n\t\t\tforeach($tag->attributes as $attribute) {\r\n\t\t\t\tif(strlen($attribute->nodeValue) === 0) {\r\n\t\t\t\t\tforeach($array_attributes as $attribute2){\r\n\t\t\t\t\t\tif($attribute->nodeName === $attribute2) {\r\n\t\t\t\t\t\t\t$attribute->nodeValue = \"XXX9o9stripme9o9XXX\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function getAttributes()\n {\n }", "public function attributes();", "function remove_image_alignment( $attributes ) {\n $attributes['class'] = str_replace( 'alignleft', 'alignnone', $attributes['class'] );\n\treturn $attributes;\n}", "function non_inline_attributes() {\r\n\t\t$this->code = preg_replace('/<span([^>]*) align=\"[^\"]*\"([^>]*)>/is', '<span$1$2>', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^>]*) style=\"([^\"]*)text-align\\s*:\\s*[^;]*;([^\"]*)\"([^>]*)>/is', '<span$1 style=\"$2$3\"$4>', $this->code);\r\n\t}", "protected function getUnsafeAttributes()\n\t{\n\t\treturn array_merge(parent::getUnsafeAttributes(), [\n\t\t\t'checked',\n\t\t]);\n\t}", "public function unsetAllAttributeValue()\n {\n foreach ($this->attributes as $key=>$val) {\n $this->$key = null;\n }\n }", "function getAdditionalAttributes() ;", "function GetAttributes();", "function be_remove_image_alignment( $attributes ) {\r\n $attributes['class'] = str_replace( 'alignleft', 'aligncenter', $attributes['class'] );\r\n\treturn $attributes;\r\n}", "function rocket_lazyload_exclude_class( $attributes ) {\n\t$attributes[] = 'class=\"custom-logo\"';\n // custom-logo\n\n\treturn $attributes;\n}", "function remove_attachment_title_attr( $attr ) {\n\tunset($attr['title']);\n\treturn $attr;\n}", "function protected_attributes() {\n\t\treturn array();\n\n\t}", "public function remove_attribute($name)\n {\n }", "protected function filter_attributes()\n\t{\n\t\t$filter = array_flip(array('type', 'split', 'align'));\n\t\t\n\t\t$attrs = $this->manager->attrs();\n\t\t\n\t\t$this->btn_attrs = array_diff_key($attrs, $filter);\n\t\t$this->manager->attrs(array_intersect_key($attrs, $filter));\n\t}", "protected function _ensureInheritedAttributes() {}", "function filterAttr($attrSet) {\t\n\t\t$newSet = array();\n\t\t// process attributes\n\t\tfor ($i = 0; $i <count($attrSet); $i++) {\n\t\t\t// skip blank spaces in tag\n\t\t\tif (!$attrSet[$i]) continue;\n\t\t\t// split into attr name and value\n\t\t\t$attrSubSet = explode('=', trim($attrSet[$i]));\n\t\t\tlist($attrSubSet[0]) = explode(' ', $attrSubSet[0]);\n\t\t\t// removes all \"non-regular\" attr names AND also attr blacklisted\n\t\t\t//////\n\t\t\t///// NEEDS FIX!!! eregi zu preg_match umgeschrieben... stimmt das noch??? ////\n\t\t\t/////\n\t\t\tif ((!preg_match(\"^[a-z]*$\",$attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on')))) \n\t\t\t\tcontinue;\n\t\t\t// xss attr value filtering\n\t\t\tif ($attrSubSet[1]) {\n\t\t\t\t// strips unicode, hex, etc\n\t\t\t\t$attrSubSet[1] = str_replace('&#', '', $attrSubSet[1]);\n\t\t\t\t// strip normal newline within attr value\n\t\t\t\t$attrSubSet[1] = preg_replace('/\\s+/', '', $attrSubSet[1]);\n\t\t\t\t// strip double quotes\n\t\t\t\t$attrSubSet[1] = str_replace('\"', '', $attrSubSet[1]);\n\t\t\t\t// [requested feature] convert single quotes from either side to doubles (Single quotes shouldn't be used to pad attr value)\n\t\t\t\tif ((substr($attrSubSet[1], 0, 1) == \"'\") && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == \"'\"))\n\t\t\t\t\t$attrSubSet[1] = substr($attrSubSet[1], 1, (strlen($attrSubSet[1]) - 2));\n\t\t\t\t// strip slashes\n\t\t\t\t$attrSubSet[1] = stripslashes($attrSubSet[1]);\n\t\t\t}\n\t\t\t// auto strip attr's with \"javascript:\n\t\t\tif (\t((strpos(strtolower($attrSubSet[1]), 'expression') !== false) &&\t(strtolower($attrSubSet[0]) == 'style')) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'javascript:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'behaviour:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'vbscript:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'mocha:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'livescript:') !== false) \n\t\t\t) continue;\n\n\t\t\t// if matches user defined array\n\t\t\t$attrFound = in_array(strtolower($attrSubSet[0]), $this->attrArray);\n\t\t\t// keep this attr on condition\n\t\t\tif ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) {\n\t\t\t\t// attr has value\n\t\t\t\tif ($attrSubSet[1]) $newSet[] = $attrSubSet[0] . '=\"' . $attrSubSet[1] . '\"';\n\t\t\t\t// attr has decimal zero as value\n\t\t\t\telse if ($attrSubSet[1] == \"0\") $newSet[] = $attrSubSet[0] . '=\"0\"';\n\t\t\t\t// reformat single attributes to XHTML\n\t\t\t\telse $newSet[] = $attrSubSet[0] . '=\"' . $attrSubSet[0] . '\"';\n\t\t\t}\t\n\t\t}\n\t\treturn $newSet;\n\t}", "public function moveHtmlAttributesToAdditionalArguments() {}", "private function renameOldAttributes()\n {\n if ($this->mageVersion < '2.2.5') {\n $attributes = $this->attrNames;\n foreach ($attributes as $key => $attr) {\n $isExist = $this->eavConfig->getAttribute('catalog_product', 'wwe_'.$attr.'')->getAttributeId();\n if ($isExist != null) {\n $updateSql = \"UPDATE \".$this->tableNames['eav_attribute'].\" \"\n . \"SET attribute_code = 'en_\".$attr.\"', is_required = 0 \"\n . \"WHERE attribute_code = 'wwe_\".$attr.\"'\";\n $this->connection->query($updateSql);\n }\n }\n }\n }", "abstract function attributes(): array;", "public function getReservedForFutureUse1Attribute(){}", "function omega_enforce_attributes(&$variables) {\n // Copy over the classes array into the attributes array.\n if (!empty($variables['classes_array'])) {\n $variables['attributes_array']['class'] = !empty($variables['attributes_array']['class']) ? array_merge($variables['attributes_array']['class'], $variables['classes_array']) : $variables['classes_array'];\n $variables['attributes_array']['class'] = array_unique($variables['attributes_array']['class']);\n }\n\n // Sync that with the classes array. Remember: We don't recommend using it.\n if (!empty($variables['attributes_array']['class'])) {\n $variables['classes_array'] = $variables['attributes_array']['class'];\n }\n}", "public function sanitizeAttributes( $attributes, $meta )\n\t\t{\n\t\t\t$attributes = parent::sanitizeAttributes( $attributes, $meta );\n\t\t\t$attributes['columns'] = [];\n\t\t\tunset( $attributes[ 'sections' ] );\n\t\t\treturn $attributes;\n\t\t}", "protected function collect_attributes() {\n\t\tforeach ( $this->properties as $key => $val ) {\n\t\t\tif ( in_array($key, self::$global_attributes) || in_array($key, static::$element_attributes) ) {\n\t\t\t\t$this->attributes[ $key ] = $val;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// also check for compound attributes, such as data-src, aria-required, etc.\n\t\t\tforeach ( self::$global_attribute_pattern_prefixes as $prefix ) {\n\t\t\t\tif ( preg_match( '/'. $prefix .'[-]\\w+/', $key ) ) {\n\t\t\t\t\t$this->attributes[ $key ] = $val;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function _resetModifiedAttributesFlags() {\n\t\t$this->_modifiedAttributes = array();\n\t}", "public function fixedAttributes()\n {\n return array('pid');\n }", "public function setAttributes();", "abstract protected function getModelAttributes();", "function safecss_filter_attr($css, $deprecated = '')\n {\n }", "protected function attributes()\n {\n return [];\n }", "public function __unset($name) {\n\t\tif ($this->hasAttribute($name))\n\t\t\tunset($this->_attributes[$name]);\n\t\telse\n\t\t\tparent::__unset($name);\n\t}", "public function getAttributes()\n {\n }", "public function getAttributes() {}", "public function getAttributes() {}", "protected function getAttributes()\n {\n return [];\n }", "public function attributes() : array;", "public function safeAttributes()\n {\n return $this->attributes();\n }", "public function withoutAttribute($name)\n {\n }", "public function withoutAttribute($name)\n {\n }", "function clearAttributes()\n {\n $this->arrRelations = array();\n return true;\n }", "public function clearAttribs()\n {\n $this->attribs = [];\n return $this;\n }", "public function __unset($name)\n\t{\n\t\tif(isset($this->_attributes[$name]))\n\t\t\tunset($this->_attributes[$name]);\n\t\telse\n\t\t\tparent::__unset($name);\n\t}", "private function _getBaseAttributes( $aField ) {\r\n \r\n $_aBaseAttributes = $aField[ 'attributes' ] + array( 'class' => null );\r\n unset( \r\n $_aBaseAttributes[ 'input' ], \r\n $_aBaseAttributes[ 'select_button' ], \r\n $_aBaseAttributes[ 'name' ], \r\n $_aBaseAttributes[ 'value' ],\r\n $_aBaseAttributes[ 'type' ],\r\n $_aBaseAttributes[ 'remove_button' ] \r\n );\r\n return $_aBaseAttributes;\r\n \r\n }", "function extract_attrs($line) {\n if (preg_match(self::REGEX_ATTR, $line)) {\n return preg_replace(self::REGEX_ATTR, ' \\1', $line);\n }\n }", "public function get_attributes()\n {\n }", "public function get_attributes()\n {\n }", "public static function require_compare_attributes(){\n\t\treturn false;\n\t}", "public function getAttributes(){ }", "public function defineAttributes()\n\t{\n\t\treturn array();\n\t}", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_dl('');\n $this->setDl('');\n $this->setRegion('');\n $this->setNombre_dl('');\n $this->setGrupo_estudios('');\n $this->setRegion_stgr('');\n $this->setStatus('');\n $this->setPrimary_key($aPK);\n }", "public function getRestUnHookableAttributes(): array\n {\n return [];\n }", "function protectAttr($str,$name=false)\n\t{\n\t\tif ($name && !preg_match('/^[A-Za-z][A-Za-z0-9_:.-]*$/',$str)) {\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\treturn str_replace(array(\"'\",'\"'),array('&#039;','&quot;'),$str);\n\t}", "public static function supportedAttributes();", "function Hippo_Widget_Attributes() {\n\t\t\tnew Hippo_Widget_Attributes();\n\t\t}", "public function getUnloggableAttributes(): array\n {\n return [];\n }", "function fixAttributes(&$template,$attribute) {\n\tif ( ! is_array($template[$attribute]) ) return;\n\tif ( $template[$attribute]['@attributes'] ) {\n\t\t$template[$attribute][0]['@attributes'] = $template[$attribute]['@attributes'];\n\t\tif ( $template[$attribute]['value'])\n\t\t\t$template[$attribute][0]['value'] = $template[$attribute]['value'];\n\n\t\tunset($template[$attribute]['@attributes']);\n\t\tunset($template[$attribute]['value']);\n\t}\n\n\tif ( $template[$attribute] ) {\n\t\tforeach ($template[$attribute] as $tempArray) {\n\t\t\t$tempArray2[] = $tempArray['value'] ? array('@attributes'=>$tempArray['@attributes'],'@value'=>$tempArray['value']) : array('@attributes'=>$tempArray['@attributes']);\n\t\t}\n\t\t$template[$attribute] = $tempArray2;\n\t}\n}", "function _wp_post_thumbnail_class_filter_remove($attr)\n {\n }", "public function getReservedAttributes()\n {\n if ($this->_reservedAttributes === null) {\n $_reserved = array('position');\n $methods = get_class_methods(__CLASS__);\n foreach ($methods as $method) {\n if (preg_match('/^get([A-Z]{1}.+)/', $method, $matches)) {\n $method = $matches[1];\n $tmp = strtolower(preg_replace('/(.)([A-Z])/', \"$1_$2\", $method));\n $_reserved[] = $tmp;\n }\n }\n $_allowed = array(\n 'type_id','calculated_final_price','request_path','rating_summary'\n );\n $this->_reservedAttributes = array_diff($_reserved, $_allowed);\n }\n return $this->_reservedAttributes;\n }", "public function testAddAttributesToNodeForNoAttributes()\n {\n $dom = Document::fromHtml('<p>Hello World</p>');\n $element = $dom->createElement('b');\n $element->setAttributes([]);\n $this->assertFalse($element->hasAttributes());\n }", "public function overlayUserdefinedHtmlAttributeValues() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "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 testGetChangeAttributes()\n {\n }", "public function testUnlinkAttributesFromCertificate()\n {\n }", "private function removeAttribute( $attr )\n {\n if (isset($this->attributeTypes[$attr]) || array_key_exists($attr, $this->attributeTypes))\n unset( $this->attributeTypes[$attr] ); // forma de remover un valor de un array...\n }", "protected function getNotRequiredAttributesArray()\n {\n return [\"custom_design\",\"custom_design_to\", \"image\",\"price\",\"sku_type\",\"special_from_date\",\"special_to_date\",\"tax_class_id\",\"sku\", \"price_type\",'page_layout', 'custom_design_from', 'gift_message_available','media_gallery', 'custom_layout', 'tier_price', 'old_id', 'gallery', 'msrp',\n 'msrp_display_actual_price_type', 'minimal_price', 'price_view', 'quantity_and_stock_status','required_options', 'has_options', 'news_from_date',\n 'image_label', 'news_to_date', \"links_purchased_separately\",\"options_container\", \"shipment_type\", \"small_image\", \"special_price\", \"swatch_image\", \"status\",\"custom_layout_update\"];\n }", "public static function spanTagCorrectlyRemovedWhenRmTagIfNoAttribIsConfiguredDataProvider() {}", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setNivel_stgr('');\n $this->setDesc_nivel('');\n $this->setDesc_breve('');\n $this->setOrden('');\n $this->setPrimary_key($aPK);\n }", "function tag_attributes($attributes)\n{\n if (is_string($attributes)) {\n $toProcess['name'] = $attributes;\n $toProcess['id'] = $attributes;\n } else {\n //don't allow 'value' to be set specifically as an attribute (why = consistency)\n unset($attributes['value']);\n $toProcess = $attributes;\n }\n\n $attr = array();\n foreach ($toProcess as $key => $attribute) {\n // Reject weird attribute names (a little more restrictively than necessary)\n if (preg_match('/[^A-Za-z0-9_:.-]/', $key)) {\n continue;\n }\n if (is_string($attribute)) {\n $attr[$key] = $key . '=\"' . html_escape($attribute) . '\"';\n } elseif ($attribute === true) {\n $attr[$key] = $key;\n }\n }\n return join(' ', $attr);\n}", "function remove_img_attr ($html)\n{\n return preg_replace('/(width|height)=\"\\d+\"\\s/', \"\", $html);\n}", "private function _filter_attributes($str) {\n\t\t$out = '';\n\n\t\tif (preg_match_all('#\\s*[a-z\\-]+\\s*=\\s*(\\042|\\047)([^\\\\1]*?)\\\\1#is', $str, $matches)) {\n\t\t\tforeach ($matches [0] as $match) {\n\t\t\t\t$out .= preg_replace('#/\\*.*?\\*/#s', '', $match);\n\t\t\t}\n\t\t}\n\n\t\treturn $out;\n\t}", "function std_attr($at){\n switch($at){\n case 'wrap': $attr = array('id'=>strval($this->obj->id));break;\n default:\n $attr = array();\n\n }\n return new opc_attrs(NULL,$attr);\n }", "private static function removeUnallowedHTMLAttributes(string $html): string\n {\n $tidy = new tidy();\n\n $dom = new DOMDocument();\n\n // Normalizes the HTML which reduce the possibility of having an unexpected\n // exception in the DomDocument library because some bad HTML was found.\n // Once the HTML is normalized, we will parse it again.\n $html = $tidy->repairString($html, [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n\n try {\n libxml_use_internal_errors(true);\n // Needs a XML encoding declaration to ensure is treated as UTF-8\n $dom->loadHTML('<?xml encoding=\"utf-8\" ?>'.$html);\n } catch (Exception $e) {\n return '';\n }\n\n $attributes = static::getAttributesNodes($dom);\n\n collect($attributes)\n ->filter(fn ($attribute) => static::isAttributeAllowedForTag($attribute))\n ->each(fn ($node) => $node->parentNode->removeAttribute($node->nodeName));\n\n return $tidy->repairString($dom->saveHTML(), [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_item('');\n $this->setId_enc('');\n $this->setId_nom('');\n $this->setModo('');\n $this->setF_ini('');\n $this->setF_fin('');\n $this->setId_nom_new('');\n $this->setPrimary_key($aPK);\n }", "public function getAttributesList()\n {\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_item('');\n $this->setId_ubi('');\n $this->setF_gasto('');\n $this->setTipo('');\n $this->setCantidad('');\n $this->setPrimary_key($aPK);\n }", "function initialize () {\n //blank for implementing\n\t\n\t//go through the attributes see if any of them have a name propery\n }", "function guy_attrcheck($arr) {\n\tglobal $guy_c;\n\t$element = strtolower($arr[1]); $attributes = $arr[2];\n\t$nosp = ''; $sp = 'title|class|id|onclick'; $dims = '';\n\t$ok = array();\n\n\tif ($element == 'a') {\n\t\t$nosp = 'href|hreflang|name|lang';\n\t} elseif ($element == 'img') {\n\t\t$nosp = 'longdesc|src|align';\n\t\t$sp .= '|class|alt';\n\t\tif (!preg_match('/alt/i',$attributes)) {\n\t\t\t$ok = array('alt={|}{|}');\n\t\t}\n\t\tpreg_match(\"/src\\s*=\\s*\\\"([^\\s\\\">]+)\\\"/is\",$attributes,$matches);\n\t\tif (isset($matches[1])) {\n\t\t\t$dims = guy_imagedims($matches[1]);\n\t\t} else {\n\t\t\tpreg_match(\"/src\\s*=\\s*'([^\\s'>]+)'/is\",$attributes,$matches);\n\t\t\tif (isset($matches[1])) {\n\t\t\t\t$dims = guy_imagedims($matches[1]);\n\t\t\t} else {\n\t\t\t\tpreg_match(\"/src\\s*=\\s*([^'\\\"][^\\s>]+)/is\",$attributes,$matches);\n\t\t\t\tif (isset($matches[1])) {\n\t\t\t\t\t$dims = guy_imagedims($matches[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} elseif ($element == 'ins' || $element == 'del') {\n\t\t$nosp = 'cite|datetime|lang';\n\t} elseif ($element == 'blockquote' || $element == 'q') {\n\t\t$nosp = \"cite|lang\";\n\t} elseif ($element == 'br' || $element == 'news' || $element == \n\t'column') {\n\t\t$sp='';\n\t} elseif ($element == 'span') {\n\t\t$sp .= '|class';\n\t\t$nosp = 'lang';\n\t} elseif ($element == 'form') {\n\t\t$sp = '';\n\t\t$nosp = 'cc|counter';\n\t} elseif ($element == 'submenu') {\n\t\t$sp = '';\n\t\t$nosp = 'level';\n\t} elseif ($element == 'ol') {\n\t\t$nosp = 'type';\n\t} else {\n\t\t$nosp = \"lang\";\n\t}\n\n\tif ($nosp) {\n\t\tpreg_match_all(\"/(?:$nosp)\\s*=\\s*\\\"[^\\s\\\">]+\\\"/is\",$attributes,$matches);\n\t\t$ok = \n\t\tarray_merge($ok,str_replace('\"',$guy_c['quot'],$matches[0]));\n\t\tpreg_match_all(\"/(?:$nosp)\\s*=\\s*'[^\\s'>]+'/is\",$attributes,$matches);\n\t\t$ok = array_merge($ok,$matches[0]);\n\t\tpreg_match_all(\"/(?:$nosp)\\s*=\\s*[^\\s>'\\\"][^\\s>]*/is\",$attributes,$matches);\n\t\t$ok = array_merge($ok,$matches[0]);\n\t}\n\tif ($sp) {\t\n\t\tpreg_match_all(\"/(?:$sp)\\s*=\\s*\\\"[^\\\"]*\\\"/is\",$attributes,$matches);\n\t\t$ok = \n\t\tarray_merge($ok,str_replace('\"',$guy_c['quot'],$matches[0]));\n\t\tpreg_match_all(\"/(?:$sp)\\s*=\\s*'[^']*'/is\",$attributes,$matches);\n\t\t$ok = array_merge($ok,$matches[0]);\n\t\tpreg_match_all(\"/(?:$sp)\\s*=\\s*[^\\s>'\\\"][^\\s>]*/is\",$attributes,$matches);\n\t\t$ok = array_merge($ok,$matches[0]);\n\t}\n\t$ok = join(' ',$ok);\n\treturn $guy_c['lt'] . $element . ($ok ? \" $ok\" : '') . ($dims ? ' \n'.str_replace('\"',$guy_c['quot'],$dims) : '') .$guy_c['gt'];\n}", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_region('');\n $this->setRegion('');\n $this->setNombre_region('');\n $this->setStatus('');\n $this->setPrimary_key($aPK);\n }", "function DOM_double_quotes_in_attributes() {\r\n\t\t$query = '//@*';\r\n\t\t$attributes = $this->xpath->query($query);\r\n\t\tforeach($attributes as $attribute) {\r\n\t\t\tif(strpos($attribute->nodeValue, '\"') !== false) {\r\n\t\t\t\t$attribute->nodeValue = str_replace('\"', '\\'', $attribute->nodeValue);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function wp_kses_uri_attributes()\n {\n }", "public function unsetAttributes($names=null)\n {\n if($names===null)\n $names=$this->attributeLabels();\n foreach($names as $key => $name)\n $this->$key=null;\n }", "private function _remove_evil_attributes($str, $is_image)\n {\n // All javascript event handlers (e.g. onload, onclick, onmouseover), style, and xmlns\n //$evil_attributes = array('on\\w*', 'style', 'xmlns', 'formaction');\n $evil_attributes = array('on\\w*', 'xmlns', 'formaction');\n\n if ($is_image === true)\n {\n /*\n * Adobe Photoshop puts XML metadata into JFIF images,\n * including namespacing, so we have to allow this for images.\n */\n unset($evil_attributes[array_search('xmlns', $evil_attributes)]);\n }\n\n do {\n $count = 0;\n $attribs = array();\n\n // find occurrences of illegal attribute strings with quotes (042 and 047 are octal quotes)\n preg_match_all('/('.implode('|', $evil_attributes).')\\s*=\\s*(\\042|\\047)([^\\\\2]*?)(\\\\2)/is', $str, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $attr)\n {\n $attribs[] = preg_quote($attr[0], '/');\n }\n\n // find occurrences of illegal attribute strings without quotes\n preg_match_all('/('.implode('|', $evil_attributes).')\\s*=\\s*([^\\s>]*)/is', $str, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $attr)\n {\n $attribs[] = preg_quote($attr[0], '/');\n }\n\n // replace illegal attribute strings that are inside an html tag\n if (count($attribs) > 0)\n {\n $str = preg_replace('/(<?)(\\/?[^><]+?)([^A-Za-z<>\\-])(.*?)('.implode('|', $attribs).')(.*?)([\\s><]?)([><]*)/i', '$1$2 $4$6$7$8', $str, -1, $count);\n }\n\n } while ($count);\n\n return $str;\n }", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();" ]
[ "0.71117824", "0.7035495", "0.6810129", "0.6756575", "0.6662393", "0.64803207", "0.63691974", "0.6355436", "0.6354229", "0.6353134", "0.6352825", "0.6333506", "0.6317176", "0.627881", "0.6275085", "0.62605983", "0.6248935", "0.62345755", "0.61991394", "0.6188764", "0.6176879", "0.6175388", "0.614708", "0.61264527", "0.61216265", "0.6106515", "0.6090132", "0.6078733", "0.6067409", "0.6048261", "0.60476065", "0.60359275", "0.60279006", "0.60161024", "0.598617", "0.597498", "0.5967296", "0.5962961", "0.5953265", "0.5949186", "0.5945583", "0.59374124", "0.5929156", "0.5911232", "0.5897209", "0.5897209", "0.5874286", "0.5868841", "0.5868023", "0.58596075", "0.58581877", "0.5854035", "0.5854035", "0.5848833", "0.58262503", "0.5825847", "0.5825423", "0.5823047", "0.58020234", "0.5794609", "0.57945615", "0.57910055", "0.57900673", "0.5786733", "0.578644", "0.5777766", "0.57617295", "0.573643", "0.5735756", "0.5735756", "0.5735611", "0.5734621", "0.5734621", "0.5734621", "0.5734621", "0.57226723", "0.57223946", "0.5708633", "0.5708012", "0.57049197", "0.56926405", "0.5687686", "0.56874436", "0.56829137", "0.56816816", "0.56685513", "0.5663078", "0.56601787", "0.5657601", "0.5656998", "0.5656981", "0.5655041", "0.56470156", "0.56441593", "0.5640923", "0.5639839", "0.5638182", "0.5634312", "0.5634312", "0.5634312", "0.5634312" ]
0.0
-1
$data = \DB::table('aula.archivos')>where('iArchivoId',$id)>delete(); aliminado fisico
public function deleteFilesUser($id){ $data = DB::table('aula.archivos')->where('iArchivoId', $id)->update(['bEstadoActivo' => false]); return response()->json($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function excluirAnuncio($id){\n global $pdo;\n $sql = $pdo->prepare(\"DELETE FROM anuncios_imagens WHERE id_anuncio = :id_anuncio\"); // vai remover o registro de imagens\n $sql->bindValue(\":id_anuncio\", $id);\n $sql->execute(); \n\n $sql = $pdo->prepare(\"DELETE FROM anuncios WHERE id = :id\"); \n $sql->bindValue(\":id\", $id);\n $sql->execute(); \n\n \n\n\n\n }", "public function vymaz(){\r\n $db = napoj_db();\r\n $sql =<<<EOF\r\n DELETE FROM Diskusie WHERE id = \"$this->ID\";\r\nEOF;\r\n $ret = $db->exec($sql);\r\n if(!$ret){\r\n echo $db->lastErrorMsg();\r\n }\r\n $db->close();\r\n }", "function borrarImagenes($id){\n $conn=connexioBD();\n $sql=\"DELETE FROM imatges WHERE producte_id='$id'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n $conn->close();\n}", "public function destroy($id)\n {\n $opcion=2;\n $usuario=Auth::user()->id;\n $imagen=\"no importa\";\n $descripcion=\"no importa\";\n $idimagen=$id;\n $sql_sol = \"call spCSL_CRUD_galeria\n (\n '\".$opcion.\"',\n '\".$imagen.\"',\n '\".$descripcion.\"',\n '\".$usuario.\"',\n '\".$idimagen.\"'\n )\";\n $datos = DB::select($sql_sol,array(1,10));\n //recupero de la base de datos para eliminar en fisico!\n \n if($datos==null){\n return Redirect::to('administrador/galeria')->withErrors(['erroregistro'=> 'Error']);\n }\n $cadena=substr($datos[0]->imagen, 22 ,strlen ($datos[0]->imagen)); \n if(Storage::disk('local')->exists($cadena)){\n $dele= Storage::disk('local')->delete($cadena);\n }\n return Redirect::to('administrador/galeria');\n \n }", "public function deleteData($id)\n {\n \n DB::table('haisou')->where('bango', $id)->delete();\n\n return redirect('/');\n }", "public function eliminar($id) {\n\n $datosLibro = new Libro;\n //Validar que exista un archivo\n if($datosLibro) {\n //ubicar el archivo y su ruta\n $rutaArchivo = base_path('public').$datosLibro->imagen;\n //validar que exista lo anterior y si es asi eliminarlo\n if($rutaArchivo) {\n unlink($rutaArchivo);\n }\n $datosLibro->delete();\n }\n return response()->json(\"Registro Borrado\");\n }", "public function deleteByid(Request $req , Response $res , $args)\n{\n //$pizzaid = $this->em->find('App\\Model\\Categorias' , $args['id']);\n\n $categorias = $this->em->find('App\\Model\\Categorias' , $args['id']);\n \n\n foreach ($categorias->getPizza() as $key => $value) {\n echo $value->getValorM().\"<br>\";\n echo $value->getId().\"<br>\";\n\n if($value->getId() == 113){ // a varialvel get com id pizza\n \n $pizza = $this->em->find('App\\Model\\Pizza', 113);\n $this->em->remove($pizza);\n $this->em->flush();\n\n }\n }\n\n\n // $directory = $this->container->get('upload_directory');\n // unlink($directory . $pizza->getUrlimg());\n\n //echo \"<p class='red text-darken-1'>Item excluido com sucesso</p>\";\n\n\n}", "public function destroy($id)\n {\n Carrera::where('id',$id)->delete($datos,'cascade');\n }", "public static function delete($id){\n $conexion = new Conexion();\n $sql = $conexion->prepare('DELETE FROM'. self::TABLA .' WHERE id = :id');\n $sql->bindValue(':id', $id);\n $sql->execute();\n return $sql; \n}", "public function deleteSeguimientos(Request $request){\n $this->validate($request,['id' => 'required']);\n $id = $request->input('id');\n $seguimiento = Seguimiento::where('paciente_id',$id)->get()->toArray();\n foreach($seguimiento as $seg){\n $file = storage_path('recursos/seguimientos/'.$seg['foto']);\n unlink($file);\n }\n\n DB::table('seguimientos')->where('paciente_id',$id)->delete();\n\n return response()->json([\n 'status' => 'ok',\n 'code' => 200,\n 'result' => 'Se elimino el seguimiento'\n ],200)\n ->header('Access-Control-Allow-Origin','*')\n ->header('Content-Type', 'application/json');\n\n }", "public function delete ($id){\n DB::table('barang')->where('id',$id)->delete();\n return redirect()->back();\n }", "public function eliminarComuna($id){\n\n $comuna = Commune::find($id);\n $ruta = public_path().'/imagenes/comunas';\n $rutaImagen = $ruta.'/'.$comuna->image;\n $exito = $comuna->delete();\n if($exito){\n File::delete($rutaImagen);\n alert()->success('El comuna fue eliminada correctamente','Comuna Eliminada')->autoclose(3000);\n } \n return redirect('administrador/comunas');\n }", "public function destroy($id)\n {\n //\n $data = Karyawan::where('id_karyawan', $id)->first();\n File::delete('images/karyawan/'.$data->foto);\n\n DB::table('tbl_karyawan')->where('id_karyawan',$id)->delete();\n return redirect()->route('karyawan.index')->with('hapus','');\n }", "public function Excluir(){\n $idMotorista = $_GET['id'];\n\n $motorista = new Motorista();\n\n $motorista->id = $idMotorista;\n\n $motorista::Delete($motorista);\n\n\n }", "function borrarImagen($idImagen, $ruta){\n $conn=connexioBD();\n $sql=\"DELETE FROM imatges WHERE id='$idImagen'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n unlink($ruta);\n $conn->close();\n}", "function delete_servicio($id)\n {\n $this->db->where('id', $id);\n return $this->db->delete('servicio');\n }", "public function delete(int $id): void{\r\n \r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n\r\n\r\n}", "public function delete($id){\n $sql = DELETE . TABELA_MODELO . \" WHERE idModelo = \".$id;\n\n \n //Abrindo conexão com o BD\n $PDO_conex = $this->conex->connectDataBase();\n\n //Executa no BD o script Insert e retorna verdadeiro/falso\n if($PDO_conex->query($sql)){\n $erro = false;\n }else{\n $erro = true;\n }\n //Fecha a conexão com o BD\n $this->conex->closeDataBase();\n return $erro;\n}", "public function delete($id){\n\n $this->db->where('idPagina', $id)->delete('pagina');\n\n // Si se ejecuta la consulta\n if ($this->db->affected_rows() === 1) {\n return true;\n }\n return null;\n }", "function hapus($id){\n DB::table('tb_inflasi_kategori')->where('id',$id)->delete();\n\n return redirect('/inflasi_kategori');\n }", "function del($param) {\n extract($param);\n $conexion->getPDO()->exec(\"DELETE FROM operario WHERE fk_usuario = '$id'; \n DELETE FROM usuario WHERE id_usuario='$id'\");\n echo $conexion->getEstado();\n }", "function eliminarTipoDeMatricula($id){\n \t$pdo = DatabaseCao::connect();\n mysql_query(\"DELETE FROM ca_tipo_matricula WHERE id = ? ;\");\n $sql = \"DELETE FROM ca_tipo_matricula WHERE id = ?\";\n $q = $pdo->prepare($sql);\n $q->execute(array($id));\n DatabaseCao::disconnect();\n }", "public function delete(int $id): void\r\n{\r\n \r\n\r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n}", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "public function destroy($id)\n {\n DB::table('producto')->where('codigo',$id)->delete();\n return redirect()->route('productos.index')\n ->with('success','Producto Borrado Exitosamente');\n \n }", "public function excluir()\n {\n return (new Database('vagas'))->delete('id = '.$this->id);\n }", "public function excluir(){\r\n return (new Database('cartao'))->delete('id = '.$this->id);\r\n }", "public function deleteRapb($id_rapb)\n {\n DB::table('rapb')->where('id_rapb',$id_rapb)->delete();\n \n // alihkan halaman ke halaman pegawai\n return redirect('/rapb')->with('success', 'Data telah dihapus');\n }", "function delValoracion($id_comentario){\n try {\n $c = new Conexion();\n $c->exec(\"DELETE FROM valoracion WHERE id=$id_comentario\");\n return true;\n }\n catch (PDOException $e) {\n return false;\n }\n}", "function eliminarImagenSusQ($campo, $tabla, $idAsignacion)\n {\n $data=$this->analisisRiesgo->getNombreImagen($campo, $tabla, $idAsignacion);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagen($borrar, $tabla, $idAsignacion);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/fotoSustanciasQuimicas/$nombreImagen\");\n echo \"OK\";\n }\n\n }", "public function destroy($id)\n {\n //\n // sp::delete($id);\n // //hoặc\n // DB::table('users')->where('votes', '>', 100)->delete();\n // \n \n $a = sp::destroy($id);\n $anh = anh_giay::where('id_giay', $id)->get();\n foreach ($anh as $key) {\n # code...\n Storage::delete('public/img/'.$key->url);\n }\n \n \n return redirect()->route('admin.tables', 'product')->with(['message'=> 'Đã xóa thành công', 'class'=> 'alert alert-success']);\n }", "public function delete(){\r\n\t\t// goi den phuong thuc delete cua tableMask voi id cua man ghi hien hanh\r\n\t\t$mask = $this->mask();\r\n\t\treturn $mask->delete(array($mask->idField=>$this->id));\r\n\t\t// $query = \"DELETE FROM $this->tableName WHERE id='$this->id'\";\r\n\t\t// $conn = self::getConnect()->prepare($query);\r\n\t}", "public function delete($id_soal_siswa);", "public function delete($id){\n $this->db->where('id', $id);\n $this->db->delete('pegawai'); // Untuk mengeksekusi perintah delete data\n }", "public function eliminar($data)\n {\n $cliente=$this->db->query('delete from tab_cliente where id_cliente='.$data); \n }", "public function destroy($id)\n {\n $apoderado =Apoderado::find($id);\n $nombre=$apoderado->nombre .\" \".$apoderado->apellido;\n if(Alumno::where('apoderado_id',$apoderado->id)->get()->count()==0){\n $apoderado->delete();\n Flash::error('El apoderado '.$nombre. \" ha sido borrado de forma exitosa\");\n return redirect()->route('admin.apoderados.index'); \n }\n else{\n Flash::error('El apoderado '.$nombre. \" No se puede Eliminar ya que tiene dependencias\");\n return redirect()->route('admin.apoderados.index'); \n }\n }", "public function destroy($id)\n {\n $eliminar = Alumno::where('DNI',$id)->delete();\n if($eliminar){\n return \"OK\";\n }else{\n return \"FAIL\";\n }\n \n }", "public function delete($record_id, Request $request){\n if(Ahkam::findOrFail($record_id)->first() != \" \" ) { \n $file = Ahkam::findOrFail($record_id);\n $deleted = new AhkamDeleted;\n\n \n /////////////////////////////////////////////\n\n\n $deleted->crida_number = $file->crida_number;\n $deleted->database_id = $file->id;\n $deleted->date_of_archiving = $file->date_of_archiving; \n $deleted->type_of_document = $file->type_of_document; \n $deleted->number_of_document = $file->number_of_document;\n $deleted->date_of_document = $file->date_of_document; \n $deleted->kholasmatlab = $file->kholasmatlab;\n $deleted->molahezat = $file->molahezat; \n $deleted->more = $file->more; \n $deleted->file = $file->file; \n $deleted->uuid = $file->uuid; \n\n\n $del_comment = AhkamComment::where('ahkam_id', $record_id);\n $del_access = AhkamUser::where('ahkam_id',$record_id);\n $del_notis = Noti::where('file_id', $record_id);\n \n DB::beginTransaction();\n try {\n $deleted->save();\n\n //to move a file in the (deleted) folder\n if(file_exists(storage_path('app/files/Ahkam/'. $file->file))){ \n $old = storage_path('app/files/Ahkam/'. $file->file);\n $new = storage_path('app/deleted/Ahkam/'. $file->file);\n $move = File::move($old, $new);\n }\n\n //to delete its comments\n if($del_comment){\n $del_comment->delete();\n } \n \n //to delete its user access\n if($del_access){\n $del_access->delete();\n }\n //to delete its notifications\n if($del_notis){\n $del_notis->delete();\n }\n $file->delete();\n DB::commit();\n $result = \"success\";\n } catch (\\Exception $e) {\n $result = \"failed\";\n DB::rollback();\n }\n\n return response()->json(['result' => $result]);\n }\n }", "public function delete(){\n return (new Database('cliente'))->delete('id = '.$this->id);\n }", "public function deleteCotizacion($id){\n try {\n $cotizacion = Cotizacion::find($id);\n \n $detallesCotizacion = DetallesCotizacion::where('id_cotizacions','=',$id)->get();\n // echo($detallesCotizacion);\n foreach ($detallesCotizacion as $key ) {\n $key->delete();\n }\n $cotizacion->delete();\n return back()->with('success','Cotizacion Eliminada');\n } catch (\\Throwable $th) {\n return back();\n }\n }", "public function destroy($id)\n {\n DataBerkas::where('id',$id)->delete();\n return redirect('uploaddata/index');\n }", "public function eliminararchivoAction()\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->_modeloArchivo->eliminar($id, $this->_usuario);\n\t\t\t\t\t\n if($resultado == 0) { /* Si no se eliminó */\n echo 'error|No está autorizado a eliminar este registro'; \n exit;\n }\n\t\t\t\t\n\t\t\t\t} catch(Exception $ex) {\n $message = $ex->getMessage();\n echo 'error|'.$message;\n }\n }\n }\n }", "public function destroy($id)\n {\n $targetUpload = \"img/barang/\";\n $foto = Barang::find($id);\n\n // dd($foto);\n\n if($foto->foto === \"default.png\" || $foto->foto === null)\n {\n Barang::where('id',$id)->delete();\n return redirect()->route('barang.index');\n }\n unlink($targetUpload.$foto->foto);\n\n\n Barang::where('id',$id)->delete();\n\n return redirect()->route('barang.index');\n //\n }", "public static function destroyEstudiante($idEstu)\n{\n $estudiante = Estudiante::find($idEstu);\n $estudiante->delete();\n}", "function eliminarCursosDelTipoDeMatricula($id){\n \t$pdo = DatabaseCao::connect();\n $sql = \"DELETE FROM ca_tipo_matricula_curso WHERE tipo_matricula = ?\";\n $q = $pdo->prepare($sql);\n $q->execute(array($id));\n DatabaseCao::disconnect();\n }", "public function excluir(){\r\n return (new Database('atividades'))->delete('id = '.$this->id);\r\n }", "public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }", "public function destroy( $id) //aqui reemplazamos los objetos para recibir solo el id\n {\n $empleado = Empleados::findOrFail($id); // busco los registros correspondientes al id que estoy buscando\n if(Storage::delete('public/'.$empleado->Foto)){// y si el borrado se lleva a cabo ->\n Empleados::destroy($id); //eliminamos de la base de datos\n } \n return redirect('empleados')->with('Mensaje','Empleado Eliminado'); //usamos un return para desplegar la informacion con el registro borrado\n //aqui enviamos un parametro id luego lo destruimos y finalmente actualizamos con el return los registros\n }", "public function destroy($id)\n {\n $Nama = DataOrang::findOrFail($id);\n if ($Nama->delete()) {\n if (!$Nama->Photo == null){\n unlink(public_path($Nama->Photo));\n } \n }\n DataOrang::destroy($id);\n\n return response()->json([\n 'success' => true,\n 'message' => 'Data Successfully Deleted'\n ]);\n }", "public function deleteData(){\n //buatlah query\n $sqlQuery = \"DELETE FROM \" . $this->t_name . \" WHERE id = ?\";\n\n //persiapkan stmt\n $stmt = $this->conn->prepare($sqlQuery);\n\n //cukup converte id\n $this->id=htmlspecialchars(strip_tags($this->id));\n\n //bind\n $stmt->bindParam(1,$this->id);\n\n //eksekusi\n if($stmt->execute()){\n return true;\n }\n return false;\n }", "function deleteData($id) {\n global $conn;\n\n mysqli_query($conn, \"DELETE FROM mahasiswa WHERE id = $id\");\n return mysqli_affected_rows($conn);\n}", "function deleteArticulo( $id ){\n $sql = \"UPDATE `articulo` SET `activo`= 0 WHERE `id`= $id\";\n ejecutarConsulta($sql);\n }", "public function destroy($id)\n {\n $wisata = Wisata::findOrFail($id);\n\n \n if(isset($wisata->gambar) && file_exists('data_gambar/'.$wisata->gambar)){\n unlink('data_gambar/'.$wisata->gambar);\n }\n\n\n $wisata->delete();\n return redirect('wisata')->with(['success' => 'Data berhasil di delete !']);\n }", "public function delete(){\n $id = $_POST['id'];\n Cita::destroy($id);\n }", "function hapus($id)\n{\n $conn = koneksi();\n\n // menghapus gambar di foldder img\n $p = query(\"SELECT * FROM products WHERE id = $id\")[0];\n if ($p['picture'] != 'nophoto.png') {\n unlink('../assets/img/' . $p['picture']);\n // die;\n } \n\n mysqli_query($conn, \"DELETE FROM products WHERE id = $id\") or die(mysqli_error($conn));\n return mysqli_affected_rows($conn);\n}", "public function destroy($id)\n { //productimg dc truy van qua model Product thong qua hasmany\n $prod_img_detail= Product::find($id)->productimg;\n\n foreach ($prod_img_detail as $prodImgDetail){\n File::delete('uploads/products/product/'.$prodImgDetail->name);\n $prodImgDetail->delete();\n }\n $prodImg= Product::find($id);\n unlink('uploads/products/thumbnail/'.$prodImg->image);\n $prodImg->delete();\n return redirect()->route('product.index')->with('thongbao','Delete Success!!!');\n }", "public function destroy($id)\n {\n $data = Post::where('id',$id)->first();\n if(File::where('post_id',$id)->exists()){\n $file = File::where('post_id',$id)->first();\n $file_path = 'uploads/file/'.$file->nama_file;\n unlink($file_path);\n $file->delete();\n }\n $data->delete();\n return redirect()->route('post.index')->with('alert-success','Data berhasi dihapus!');\n }", "public function destroy($id)\n { \n $data = Bahan::findOrFail($id);\n $data->delete();\n \n }", "public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }", "public function delete($id)\n {\n $produto = $this->produto->with('imagens','fornecedor')->find($id);\n if(isset($produto)) {\n foreach($produto->imagens as $image) {\n $deletefile = $image->file;\n $deletefilethumb = $image->file_thumb;\n Storage::disk('public')->delete([$deletefile, $deletefilethumb]);\n //unlink(storage_path('public/'.$image->file));\n //unlink(storage_path('public/'.$image->file));\n //Storage::disk('public')->delete($deletefilethumb);\n }\n $delete = $produto->delete();\n if($delete){\n return redirect()->route('produto.create')\n ->withSuccess('Produto deletado com sucesso!');\n } else {\n return redirect()->route('/')\n ->withSuccess('Ops.. Erro ao deletar o produto!');\n }\n }\n /*\n */\n }", "function deleteProductMediasById($id) {\r\n //On supprime physiquement les medias avant de les retirer de la base\r\n $medias = getProductMediasById($id);\r\n foreach ($medias as $media) {\r\n unlink($media->mediaSource);\r\n }\r\n\r\n $dbc = connection();\r\n $table = 'medias';\r\n $dbc->quote($table);\r\n\r\n $req = \"DELETE FROM $table \"\r\n . \"WHERE id IN (\"\r\n . \"SELECT pm.id_medias \"\r\n . \"FROM products_has_medias \"\r\n . \"AS pm \"\r\n . \"WHERE pm.id_products = $id)\";\r\n\r\n $requPrep = $dbc->prepare($req); // on prépare notre requête\r\n $requPrep->execute();\r\n $data = $requPrep->fetchAll(PDO::FETCH_OBJ);\r\n $requPrep->closeCursor();\r\n}", "public function destroy($id)\n {\n $datos=Habito::where('id_habito', $id)->get()->first(); \n if($datos != null){\n $datos->delete();\n return response()->json(['result'=>\"Dato Eliminado\", 'code'=>'201']);\n }else\n return response()->json(['result'=>\"Registro no encontrado\", 'code'=>'202']);\n }", "public function destroy($id)\n {\n \n $director = Director::find($id);\n $foto = FotoDirector::where('director_id', $id)\n ->orderBy('name_foto', 'DESC')\n ->get();\n\n $image_array = $foto->all(); // array\n\n // borra el archivo de la imagen\n foreach ($image_array as $valor) {\n $vari = $valor[\"name_foto\"]; // se le asigna el nuevo formato al array \n $path = public_path() . '/img/directores/fotos/' . $vari;\n unlink($path);\n } \n \n $deleted = DB::delete('delete from fotos_directores WHERE director_id = ?' , [$id]); \n \n \n $director->delete();\n\n Flash::error('Se ha borrado el director ' . $director->nombre . ' de forma exitosa!');\n return redirect()->route('admin.directores.index');\n }", "public function delete($id_alojamiento){\r\n\t\t$sql = 'DELETE FROM alojamientos WHERE id_alojamiento = ?';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t$sqlQuery->setNumber($id_alojamiento);\r\n\t\treturn $this->executeUpdate($sqlQuery);\r\n\t}", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "function delete (){\n $sql= \"DELETE FROM acceso WHERE id_acceso = '{$this->id_acceso}'\";\n $query=$this->db->query($sql);\n echo $sql;\n return $query;\n }", "function delete_data($table, $id){\n\n $query = $this->db->delete($table, array('id' => $id));\n\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 function delete_faseetapa($id_p){ \n\n $this->db->where('proy_id', $id_p);\n $this->db->delete('_proyectofaseetapacomponente');\n }", "public function actionDelete($id)\n { $pathFile = '';\n $daodien = Daodien::findOne($id);\n $attributes = json_decode($daodien->attributes);\n $objDaoDien = new objDaoDien();\n if($attributes->image !== ''){\n $pathFile = Yii::getAlias('@img').'/daodien'.'/'.$attributes->image;\n if ($objDaoDien->deleteFile($pathFile)) {\n $daodien->delete(); \n }\n }\n else{\n $daodien->delete();\n }\n $session = Yii::$app->session;\n $session->addFlash('flashMessage');\n $session->setFlash('flashMessage', 'Đã xóa \"'.$attributes->name.'\" thành công!');\n return $this->redirect(['index']);\n}", "public function destroy($id)\n { $respostas = Resposta::all();\n foreach($respostas as $resposta){\n if($resposta->cdComentario == $id){\n Resposta::find($resposta->id)->delete();\n }\n }\n\n Comentario::find($id)->delete();\n return redirect('/comentario');\n }", "function delete($id) {\n $this->db->where('id', $id);\n $this->db->delete('rit');\n }", "public function destroy($id_content)\n {\n\n $opds = DB::delete('DELETE FROM content_opds WHERE id_content = ?' , [$id_content]);\n return redirect('/opd')->with('delete', 'Data Opd telah berhasil dihapus');\n }", "public function clean(){\n\t\t$sql = 'DELETE FROM ano_letivo';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function eliminar ($idpersona)\n\t{\n\t\t$sql=\"DELETE FROM persona WHERE idpersona='$idpersona';\";\n/*echo \"<pre><br>Elin¡minas:<br>\";\nprint_r($sql);\necho \"</pre>\";\ndie();*/\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function destroy($id)\n {\n DB::table('tb_datakaryawan')->where('id_karyawan',$id)->delete();\n return redirect('/data_karyawan');\n }", "function eliminarPoi($id) {\n $sql = \"DELETE FROM poi WHERE id='\" . $id . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }", "public function Delete($id)\n {\n $dbt = Team::where('id','like', $id)->first();\n /// Delete Stored image \n if (Storage::exists($dbt->image)) {\n /// Delete Stored image \n Storage::delete($dbt->image);\n }\n //print_r($dbt[0]->image);\n $dt = Team::find($id);\n $dt->delete();\n }", "protected\n function eliminar($id)\n {\n }", "public function destroy($id)\n {\n Alert::success('Data successfully Deleted','Good Job')->autoclose(1700);\n $fasilitas = fasilitas::findOrFail($id);\n if ($fasilitas->poto) {\n $old_foto = $fasilitas->poto;\n $filepath = public_path() . DIRECTORY_SEPARATOR . 'assets/img/gambarweb/'\n . DIRECTORY_SEPARATOR . $fasilitas->poto;\n try {\n File::delete($filepath);\n } catch (FileNotFoundException $e) {\n // File sudah dihapus/tidak ada\n }\n }\n $fasilitas->delete();\n return redirect()->route('fasilitas.index'); }", "public function delete_nivel($conexao, $id) {\n //$this->db->where('id', $id);\n //return $this->db->delete('meio');\n $query = \"DELETE FROM nivel WHERE id = '{$id}'\";\n return mysqli_query($conexao, $query);\n }", "public function eliminar($id)\n {\n }", "public function eliminar($id)\n {\n }", "public function eliminar($id)\n {\n }", "public function xoaLoaiMon($id){\n $loaimon = Loaimon::find($id);\n $loaimon->delete();\n return redirect()->back()->with(\"thanhcong\",\"Xoá loại món ăn & thức uống thành công\");\n }", "public function delete() {\n $sql = \"DELETE FROM archivos WHERE contrato_id=:contrato_id\";\n $args = array(\n \":contrato_id\" => $this->id\n );\n $stmt = $this->executeQuery($sql, $args);\n\n $sql = \"DELETE FROM contratos_tipos_contratos WHERE contrato_id=:contrato_id\";\n $args = array(\n \":contrato_id\" => $this->id\n );\n $stmt = $this->executeQuery($sql, $args);\n\n $sql = \"DELETE FROM contratos WHERE id=:id\";\n $args = array(\n \":id\" => $this->id\n );\n $stmt = $this->executeQuery($sql, $args);\n\n return !$stmt ? false : true;\n }", "public function eliminar($id)\n {\n //\n }", "public function eliminar($id)\n {\n //\n }", "function del_barrio ($idbarrios) {\n // $idbarrios --> Identificador del barrio que se va a eliminar\n // Primero borramos las actividades y por lo tanto, primero las imagenes y los documentos de las actividades \n \n // Borramos las imagenes\n//OJO ??? // No la borramos del HD por si acaso\n $sql = \"SELECT idactividades FROM actividades WHERE idbarrio='\" . $idbarrios.\"'\";\n $resultado = $this -> db -> query($sql);\n foreach ($resutado->result() as $row) {\n $sql_borra_imagen = \"DELETE FROM imagenes WHERE idactividad ='\" . $row->idactividades.\"'\";\n $resultado_borrado = $this -> db -> query($sql_borra_imagen);\n } \n \n // Borramos los documentos\n //OJO ??? // No la borramos del HD por si acaso\n $sql = \"SELECT idactividades FROM actividades WHERE idbarrio='\" . $idbarrios.\"'\";\n $resultado = $this -> db -> query($sql);\n foreach ($resutado->result() as $row) {\n $sql_borra_documento = \"DELETE FROM documentos WHERE idactividad ='\" . $row->idactividades.\"'\";\n $resultado_borrado = $this -> db -> query($sql_borra_documento);\n } \n \n\n // Ahora borramos las actividades\n $sql = \"DELETE FROM actividades WHERE idbarrio='\" . $idbarrios.\"'\";\n $resultado = $this -> db -> query($sql);\n\n // Y por ultimo el barrio\n $sql = \"DELETE FROM barrios WHERE idbarrios='\" . $idbarrios.\"'\";\n $resultado = $this -> db -> query($sql);\n }", "public function delete($id){\n \n $response=array(\"message\"=>'',\"status\"=>false);\n \n $sql=\"UPDATE area SET status=0, updatedAt=CURRENT_TIMESTAMP WHERE idArea=$id\";\n $res = DB::query($sql);\n \n if($res){\n \n $response[\"message\"]='eliminado(a) con éxito';\n $response[\"status\"]=true;\n }\n \n return $response;\n }", "public function delete($id)\n {\n\n if(count(DB::table('users')->where('fk_departamento',$id)->get())>0){\n return Redirect::to('/departamentos')->with( 'delete','Atenção: O departamento contém colaboradores, deve mover remover os colaboradores primeiro!')->withInput();\n }\n $departamento=departamento::where('pk_departamento',$id)->value('descricao');\n DB::table('departamentos')->where('pk_departamento',$id)->delete();\n \\Session::flash('success', 'O departamento '.$departamento.' foi removido.');\n\n // escrever log \n \n \n return Redirect::to('/departamentos');\n }", "public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "public function destroy($id)\n {\n if(!$relatorioFinanceiro = $this->objRelatorioFinanceiro->where('id',$id)->first()){\n return redirect()->back(); \n }\n $relatorioFinanceiro->delete();\n return redirect('relatoriofinanceiro');\n //dd(\"deletando a consulta $id\");\n\n }", "function deleteParoquia()\n {\n $sql = \"UPDATE Paroquia SET status = 0 WHERE id=:id\";\n $query = $this->db->prepare($sql);\n $query->bindParam(\":id\",$this->id);\n $query->execute();\n echo json_encode(\"{'message': 'Paroquia apagada'}\");\n }", "static function odhlas_z_preteku($ID,$ID_pouz){\r\n $db = napoj_db();\r\n\r\n $sql =<<<EOF\r\n DELETE FROM PRIHLASENY WHERE ID_POUZ = \"$ID_pouz\" AND ID_PRET=\"$ID\";\r\nEOF;\r\n\r\n $ret = $db->exec($sql);\r\n if(!$ret){\r\n echo $db->lastErrorMsg();\r\n } else {\r\n \r\n }\r\n $db->close();\r\n}", "function eliminar($id) {\n\t\t\tif ($this->con->conectar() == true) {\n\t\t\t\t$sql = \"DELETE FROM detalle_liquidacion WHERE detliqId = '\".$id.\"'\";\n\t\t\t\t\t\t\n\t\t\t\treturn mysql_query($sql) or die (mysql_error());\n\t\t\t}\n\t\t}", "function EliminarMascotas($nombres, $primer_apellido, $segundo_apellido, $fehca_nacimiento, $lugar_nacimiento, $iddepartamento, $idmunicipio, $telefono_casa, $celular, $direccion, $foto){\n $conexion = Conectar();\n $sql = \"DELETE FROM padrinos WHERE id=:id\";\n $statement = $conexion->prepare($sql);\n $statement->bindParam(':idpadrinos', $idpadrinos);\n $statement->execute();\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n $res=$statement->fetchAll();\n return $res;\n}", "public function destroy( $idMenu)\n {\n //\n $Menus = Menu::Find($idMenu);\n \n$image_path = parse_url($Menus->imagen);\n$imagen1 = (public_path($image_path['path']));\n//dd($prueba);\n File::delete($imagen1);\n $Menus::destroy($idMenu); \n \n return redirect()->route('Menu.index')->with('success','Registro eliminado satisfactoriamente');\n }", "public function getDeleteCate($id)//Xóa tên danh mục có sẳn\n {\n //$data['a'] = DB::table('vp_products')->select(DB::raw('count(*)'))->where('prod_cate', $id)->get();\n $data = DB::table('vp_products')->where('prod_cate', $id)->count();\n \n if ($data == 0) {\n # code...\n Category::destroy($id);\n return back();\n }\n \telse\n dd('that bai');\n //echo $data ;\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}" ]
[ "0.75309813", "0.73321193", "0.7283382", "0.7226446", "0.7138038", "0.7136303", "0.7098265", "0.7093458", "0.7078388", "0.7063934", "0.70151156", "0.7014747", "0.70083284", "0.70062655", "0.7002818", "0.700189", "0.6995671", "0.69954187", "0.69917935", "0.69664353", "0.6963346", "0.6941415", "0.69405985", "0.6934887", "0.69332254", "0.6923394", "0.6917692", "0.68903506", "0.68776524", "0.68768287", "0.68713474", "0.6869746", "0.68585366", "0.68378407", "0.68366385", "0.68264276", "0.68257076", "0.68205523", "0.6816876", "0.6812333", "0.67975783", "0.67957836", "0.6783405", "0.6782958", "0.67795527", "0.67759985", "0.6763704", "0.67567444", "0.6752957", "0.6751696", "0.6748156", "0.67456675", "0.6745129", "0.67450744", "0.6741989", "0.67387855", "0.6736491", "0.6734972", "0.67322487", "0.67303157", "0.67287457", "0.6724579", "0.6723993", "0.672308", "0.6718588", "0.67173076", "0.6709043", "0.67077804", "0.6707504", "0.6706808", "0.6702739", "0.6694196", "0.6693305", "0.6691759", "0.6691408", "0.66901773", "0.66890115", "0.66885525", "0.66880155", "0.6685732", "0.6684604", "0.66815877", "0.66815877", "0.66815877", "0.66804016", "0.66795385", "0.6677772", "0.6677772", "0.6675342", "0.6672513", "0.66675913", "0.6666909", "0.6665867", "0.6664281", "0.6659345", "0.6658519", "0.6656107", "0.6652789", "0.6651174", "0.6647611" ]
0.7192866
4
Get api access token
public function getAccessToken() { return trim($this->scopeConfig->getValue(self::XML_PATH_GENERAL_API_CREDENTIALS_ACCESS_TOKEN)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAccessToken();", "public function getAccessToken();", "public function getAccessToken();", "public function getAccessToken();", "public function getAccessToken();", "public function getAccessToken($access_token);", "public function getAccessToken()\n {\n return $this->get(self::_ACCESS_TOKEN);\n }", "private function _get_access_token() {\n return $this->_http->request( \n 'POST', 'https://oauth.api.189.cn/emp/oauth2/v3/access_token',\n http_build_query( array(\n 'grant_type' => 'client_credentials',\n 'app_id' => C( 'SMS_189_KEY' ),\n 'app_secret' => C( 'SMS_189_SECRET' )\n ) ) );\n\n }", "private function getToken() {\n\t // CHECK API and get token\n\t\t$post = [\n\t\t\t'grant_type' => 'password',\n\t\t\t'scope' => 'ost_editor',\n\t\t\t'username' => 'webmapp',\n\t\t\t'password' => 'webmapp',\n\t\t\t'client_id' => 'f49353d7-6c84-41e7-afeb-4ddbd16e8cdf',\n\t\t\t'client_secret' => '123'\n\t\t];\n\n\t\t$ch = curl_init('https://api-intense.stage.sardegnaturismocloud.it/oauth/token');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$j=json_decode($response,TRUE);\n\t\t$this->token=$j['access_token'];\n\t}", "public function getAccessToken()\n\t{\n\t\tif ($this->makeRequest())\n\t\t{\n\t\t\tif ($token = isset($this->getJson()->access_token) ? $this->getJson()->access_token : null) {\n\t\t\t\treturn $token;\n\t\t\t}\n\t\t}\n\t}", "function GetAccessToken()\r\n {\r\n return $this->Rest->GetAccessToken();\r\n }", "public function getToken()\n {\n $params = array(\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'code' => $this->code,\n 'redirect_uri' => $this->redirect_uri\n );\n $res = $this->getRequest('oauth/access_token',$params);\n //$token = $res['access_token'];\n return $this->res = $res;\n\n\n }", "protected function getAccessToken()\n {\n return $this->access_token->getToken();\n }", "public function getToken() {\n return $this->accessToken;\n }", "public function getAccessToken()\n\t{\n\t\treturn $this->client->getAccessToken();\n\t}", "public function getToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken() {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->client->getAccessToken();\n }", "public function getAccessToken() {\n return $this->authenticate();\n }", "public function retrieveAccessToken() {\n\n $helper = Api::getInstance();\n $helper->retrieveAccessToken();\n\n $this->output()->writeln('Done');\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->access_token;\n }", "abstract public function url_access_token();", "public function getAccessToken()\n {\n return $this->request->getAccessToken();\n }", "protected function getAccessToken()\n {\n return $this->accessToken;\n }", "public static function getAccessToken()\n {\n $authorization = request()->header('Authorization');\n // $authorization = @getallheaders()['Authorization'];\n // before running unit tests...\n //$authorization = '$2y$10$tSM.PiN9BnMfyonqjHlwTONa1DPHbyQSAMOtmt4chJYXenGeYySHC';\n return (isset($authorization))?$authorization:null;\n }", "public function getApiToken()\n {\n return $this->apiGenerator->getApiToken();\n }", "public static function accessToken(){\n $appInfo = WxAppInfo::get(1);\n if($appInfo->is_over_time){\n // 过期重新获取access token\n $appid = $appInfo->appid;\n $appsecret = $appInfo->appsecret;\n $grantType = 'client_credential';\n $url = 'https://api.weixin.qq.com/cgi-bin/token?appid=' . $appid . '&secret=' . $appsecret . '&grant_type=' . $grantType;\n $api = curl_init();\n curl_setopt($api, CURLOPT_URL, $url);\n curl_setopt($api, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($api, CURLOPT_HEADER, false);\n $tokenObj = curl_exec($api);\n curl_close($api);\n $tokenObj = json_decode($tokenObj);\n $appInfo->access_token = $tokenObj->access_token;\n $appInfo->expires_in = $tokenObj->expires_in;\n $appInfo->isUpdate(true)->save();\n $token = $tokenObj->access_token;\n }else{\n // 未过期\n $token = $appInfo->access_token;\n }\n\n return $token;\n }", "public function getAccessToken()\n {\n return $this->_accessToken;\n }", "public function get_access_token($oauth_token, $oauth_addon);", "public function getAccessToken()\n {\n return $this->_access_token;\n }", "private static function generate_access_token()\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials';\n\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n $credentials = base64_encode(env('MPESA_CONSUMER_KEY') . ':' . env('MPESA_CONSUMER_SECRET'));\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Basic ' . $credentials)); //setting a custom header\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $curl_response = curl_exec($curl);\n\n return json_decode($curl_response)->access_token;\n }", "private function requestToken() \n {\n $requestUrl = $this->configuration->getBaseUrl() . \"connect/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->configuration->getClientId() . \"&client_secret=\" . $this->configuration->getClientSecret();\n $headers = [];\n $headers['Content-Type'] = \"application/x-www-form-urlencoded\";\n $headers['Content-Length'] = strlen($postData);\n $response = $this->client->send(new Request('POST', $requestUrl, $headers, $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->configuration->setAccessToken($result[\"access_token\"]);\n }", "protected function getAccessToken($oauth_token) {\n\n\t}", "public function getAccessToken()\n {\n return $this->get('AccessToken');\n }", "public function getAccessToken()\n {\n return $this->get('AccessToken');\n }", "public function getAccessToken()\n {\n return $this->get('AccessToken');\n }", "public function getAccessToken()\n {\n return $this->get('AccessToken');\n }", "public function getAccessToken()\n {\n return $this->get('AccessToken');\n }", "public function getAccessToken()\n {\n return $this->get('AccessToken');\n }", "public function getAccessToken()\n {\n return $this->get('AccessToken');\n }", "public function getAccessToken()\n {\n return $this->get('AccessToken');\n }", "public function getAccessToken()\n {\n return $this->get('AccessToken');\n }", "public function getAccessToken()\n {\n return $this->get('AccessToken');\n }", "public function getAccessToken()\n\t{\n\t\tif(!$this->hasAccessToken()){\n\t\t\t//reset all the parameters\n\t\t\t$this->resetParams();\n\t\t\t\n\t\t\t//set the returned token\n\t\t\t$this->setParam('token', $this->getRequestToken()->getToken());\n\t\t\t\n\t\t\t//build the signiture\n\t\t\t$this->setSecret($this->getRequestToken()->getTokenSecret());\n\t\t\t$this->setRequestUrl($this->_accessTokenUrl);\n\t\t\t$this->_buildSignature();\n\t\t\t\n\t\t\t//get the response\n\t\t\t$response = $this->_send($this->_accessTokenUrl)->getBody();\n\t\t\t\n\t\t\t//format the response\n\t\t\t$responseVars = array();\n\t\t\tparse_str($response, $responseVars);\n\t\t\t$response = new BaseOAuthResponse($responseVars);\n\t\t\t$this->setAccessToken($response);\n\t\t}\n\t\treturn $this->getData('access_token');\n\t}", "public function getApiToken()\n {\n return $this->apiToken;\n }", "public function getAccessToken(): string\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->getQuery('accesstoken');\n }", "public function getAccessToken()\n {\n // maybe the token will expire in next 10 seconds\n $expiryCutoff = new \\DateTime('+10 seconds');\n\n // if the token expires try to reauthenticate\n if (!$this->accessToken or $this->getExpires() < $expiryCutoff->getTimestamp()) {\n $this->authenticate();\n }\n\n return $this->accessToken->getToken();\n }", "private function _requestToken() \n {\n $requestUrl = $this->config->getHost() . \"/oauth2/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->config->getAppSid() . \"&client_secret=\" . $this->config->getAppKey();\n $response = $this->client->send(new Request('POST', $requestUrl, [], $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->config->setAccessToken($result[\"access_token\"]);\n $this->config->setRefreshToken($result[\"refresh_token\"]);\n }", "public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }", "function get_access_token() {\n\n global $api_clientId, $api_secret, $host;\n\n $postFields = 'grant_type=client_credentials';\n $url = $host.'/v1/oauth2/token';\n\n // curl documentation -> http://php.net/manual/en/book.curl.php\n\n $curl = curl_init($url); // Initializes a new session and return a cURL handle for use with the curl_setopt(), curl_exec(), and curl_close() functions.\n\n // curl_setopt documentation -> http://php.net/manual/en/function.curl-setopt.php\n\n curl_setopt($curl, CURLOPT_POST, true); // TRUE to do a regular HTTP POST.\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // FALSE to stop cURL from verifying the peer's certificate.\n curl_setopt($curl, CURLOPT_USERPWD, $api_clientId . \":\" . $api_secret); // A username and password formatted as \"[username]:[password]\" to use for the connection.\n curl_setopt($curl, CURLOPT_HEADER, false); // TRUE to include the header in the output.\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); // TRUE to return the transfer as a string of the return value of curl_exec() instead of outputting it out directly.\n curl_setopt($curl, CURLOPT_POSTFIELDS, $postFields); //The full data to post in a HTTP \"POST\" operation.\n #curl_setopt($curl, CURLOPT_VERBOSE, TRUE); // TRUE to output verbose information. Writes output to STDERR, or the file specified using CURLOPT_STDERR.\n\n $response = curl_exec( $curl ); // Returns TRUE on success or FALSE on failure. However, if the CURLOPT_RETURNTRANSFER option is set, it will return the result on success, FALSE on failure.\n\n if (empty($response)) {\n // Some kind of an error happened\n die(curl_error($curl)); // The die() function prints a message and exits the current script. This function is an alias of the exit() function.\n curl_close($curl); // Closes a cURL session and frees all resources. The cURL handle, $curl, is also deleted.\n } else {\n $info = curl_getinfo($curl); // Gets information about the last transfer.\n curl_close($curl); // Closes a cURL session and frees all resources. The cURL handle, $curl, is also deleted.\n \n if ($info['http_code'] != 200 && $info['http_code'] != 201 ) {\n echo \"Received error: \" . $info['http_code']. \"\\n\";\n echo \"Raw response:\".$response.\"\\n\";\n die();\n }\n \n }\n\n // Convert the result from JSON format to a PHP array\n $jsonResponse = json_decode( $response );\n return $jsonResponse->access_token;\n\n}", "public function accessToken()\n {\n return $this->accessToken;\n }", "public function getAuthorizationCode()\n {\n $oauth_param = array(\n 'grant_type' => $this->grant_type, \n 'client_id' => config::$clientId,\n 'client_secret' => config::$secretKey,\n 'scope' => implode(',', $this->scope));\n\n $url = config::$apiUrl . 'oauth/access_token';\n $response = $this->curl->request('post', $url, $oauth_param);\n\n if( $response )\n {\n $res = json_decode($response);\n if( isset($res->access_token) )\n {\n $this->setExpiresAtFromTimeStamp($res->expires);\n $this->session->write('access_token',$res->access_token);\n $this->session->write('expires', $this->expiresAt);\n\n $read = $this->session->read('access_token');\n session_write_close();\n }\n elseif( isset($res->error) )\n {\n die($response);\n }\n }\n }", "public function getBaseAccessToken() {\n\t\t\n// \t\tif ($result == null) {\n\t\t\treturn $token = $this->get_access_token ();\n// \t\t} else {\n// \t\t\treturn $result;\n// \t\t}\n\t}", "private function getAccessToken(): string\n {\n try {\n $token = Storage::disk('local')->get(self::ALIGO_ACCESS_TOKEN_FILE);\n } catch (\\Exception $exception) {\n $token = null;\n }\n\n if (empty($token)) {\n try {\n $response = $this->call('/akv10/token/create/10/y');\n $data = json_decode((string) $response->getBody(), false);\n } catch (\\Throwable $exception) {\n throw CouldNotSendNotification::serviceRespondedWithAnError($exception);\n }\n Storage::disk('local')->put(self::ALIGO_ACCESS_TOKEN_FILE, $data->token);\n\n return $data->token;\n }\n\n return $token;\n }", "function getAccessToken($token) {\n $this->getToken(\"grant_type=authorization_code&code=$token&redirect_uri=\" . urlencode($this->redirectUri));\n }", "public function actionGetToken() {\n\t\t$token = UserAR::model()->getToken();\n\t\t$this->responseJSON($token, \"success\");\n\t}", "protected function get_access_token() {\n global $SESSION;\n if (isset($SESSION->{self::SESSIONKEY})) {\n return $SESSION->{self::SESSIONKEY};\n }\n return null;\n }", "private function getAccessToken()\n {\n if (time() < $this->get_option('paypal_access_token_expires_at')) {\n return $this->get_option('paypal_access_token');\n }\n\n $response = wp_remote_retrieve_body(wp_remote_post('https://api.sandbox.paypal.com/v1/oauth2/token', [\n 'method' => 'POST',\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'Authorization' => 'Basic ' . base64_encode($this->get_option('client_id') . ':' . $this->get_option('client_secret'))\n ],\n 'body' => [\n 'client_id' => $this->get_option('client_id'),\n 'client_secret' => $this->get_option('client_secret'),\n 'grant_type' => 'client_credentials'\n ]\n ]));\n\n $response = json_decode($response, true);\n\n add_option('paypal_access_token', $response['access_token']);\n add_option('paypal_access_token_expires_at', time() + $response['expires_in']);\n\n return $response['access_token'];\n }", "private function get_bitly_client_access_token()\n {\n\n if (FCMSUtils::acf_available()) {\n\n return get_field('fpt_bitly_access_token', 'options');\n\n }\n\n }", "public function get_access_token() {\r\n\t\t$session = $_SESSION['auth_baidu']['last_key'];;\r\n\t\tif (isset ( $session ['access_token'] )) {\r\n\t\t\treturn $session ['access_token'];\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "protected function getAccessToken()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$params = $this->getParams();\n\t\t$consumerKey = $params->get('oauth_consumer_key');\n\t\t$session = JFactory::getSession();\n\t\t$oauthToken = $app->input->get('oauth_token', '', 'string');\n\t\ttry\n\t\t{\n\t\t\t//$_GET['http_error_codes'] = array(200, 201, 301, 302);\n\n\t\t\t$curlOpts = $this->getOAuthCurlOpts();\n\t\t\t$result = XingOAuthRequester::requestAccessToken($consumerKey, $oauthToken, 0, 'POST', $_GET, $curlOpts);\n\t\t\t//$result = OAuthRequester::requestAccessToken($consumerKey, $oauthToken, 0, 'POST', $_GET, $curlOpts);\n\t\t}\n\t\tcatch (OAuthException2 $e)\n\t\t{\n\t\t\techo \"<h1>get access token error</h1>\";\n\t\t\techo \"<pre>restult...\";print_r($result);echo \"</pre>\";\n\t\t\tprint_r($e->getMessage());\n\t\t\treturn false;\n\t\t}\n\t\treturn $result;\n\t}", "private function GetAccessToken()\n\t{\n\t\tif(IsSet($_SESSION['OAUTH']['OAUTH_ACCESS_TOKEN'][$this->access_token_url]))\n\t\t{\n\t\t\t$access_token = $_SESSION['OAUTH']['OAUTH_ACCESS_TOKEN'][$this->access_token_url];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$access_token = array();\n\t\t}\n\t\treturn($access_token);\n\t}", "function getRequestToken() {\n\t\t$r = $this->oAuthRequest ( $this->requestTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}", "public function get_access_token()\n\t\t{\n\t\t\tif(isset($_COOKIE['bing_access_token']))\n\t\t\t\treturn $_COOKIE['bing_access_token'];\n\t\t\n\t\t\t// Get a 10-minute access token for Microsoft Translator API.\n\t\t\t$url = 'https://datamarket.accesscontrol.windows.net/v2/OAuth2-13';\n\t\t\t$postParams = 'grant_type=client_credentials&client_id='.urlencode($this->clientID).\n\t\t\t'&client_secret='.urlencode($this->clientSecret).'&scope=http://api.microsofttranslator.com';\n\t\t\t\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url); \n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); \n\t\t\t$rsp = curl_exec($ch); \n\t\t\t$rsp = json_decode($rsp);\n\t\t\t$access_token = $rsp->access_token;\n\t\t\t\n\t\t\tsetcookie('bing_access_token', $access_token, $rsp->expires_in);\n\t\t\t\n\t\t\treturn $access_token;\n\t\t}", "public function getAccessToken()\n {\n if ($this->_accessToken == null) {\n\n if ($this->_oauthToken == null) {\n $this->_setOauthToken();\n }\n\n $this->_accessToken = json_decode($this->_oauthToken)->access_token;\n }\n\n return $this->_accessToken;\n }", "public function access_token() {\n\t\ttry {\n\t\t\tif ($this->request->is('post')) {\n\t\t\t\t$this->OAuth2Lib->grantAccessToken();\n\t\t\t}\n\t\t} catch(Exception $e) {\n\t\t\t$this->fail($e);\n\t\t}\n\t}", "function requestToken() {\n\t\t$conn = new Connection('DB-Name');\n\n\t\t//instantiate login information, api_key, username, and password\n\t\t$api = $conn->tokenGrab(x);\n\t\t$user = $conn->tokenGrab(x);\n\t\t$pass = $conn->tokenGrab(x);\n\n\t\t//build fields to send to the token giver\n\t\t$fields = array(\n\t\t\t'grant_type' \t=> urlencode('password')\n\t\t\t, 'client_id' \t=> urlencode($api)\n\t\t\t, 'username' \t=> urlencode($user)\n\t\t\t, 'password'\t=> urlencode($pass));\n\n\t\t$fields_string = '';\n\t\tforeach ($fields as $key=>$value) { $fields_string .= $key . '=' . $value . '&'; }\n\t\trtrim($fields_string, '&');\n\n\t\t//send the request to token giver via cURL\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $conn->tokenGrab(x));\n\t\tcurl_setopt($ch, CURLOPT_POST, count($fields));\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t\t 'Content-Type' => urlencode('application/x-www-form-urlencoded')\n\t\t\t, 'Content-Length' => urlencode(strlen($fields_string))\n\t\t));\n\n\t\t$cherwellApiResponse = json_decode(curl_exec($ch), TRUE);\n\t\treturn $cherwellApiResponse['access_token'];\n\t}", "public function fetchAccessToken() {\n if (!isset($_SESSION['ACCESS_TOKEN'])) {\n if (!empty($_GET) && isset($_SESSION['REQUEST_TOKEN'])) {\n return parent::getAccessToken(\n $_GET, unserialize($_SESSION['REQUEST_TOKEN']));\n }\n }\n return null;\n }", "public function getAccessToken() {\n return $this->credential->getAccessToken();\n }", "public function getAccessToken(): string {\n\t\tif(!$this->_accessToken || $this->isAccessTokenExpired()) {\n\t\t\t$json = $this->request->authorize($this->getClientId(), $this->getClientSecret());\n\n\t\t\t$data = $json['data'];\n\n\t\t\t$expireDateTime = new DateTime($data['expireDateTime']);\n\n\t\t\t$this->setAccessToken($data['accessToken'], $data['accessTokenType'], $expireDateTime);\n\t\t}\n\n\t\treturn $this->_accessToken;\n\t}", "public function urlAccessToken() {\n return $this->host . '/oauth/token';\n }", "private function __get_access_token() {\r\n // Access token exists in a cookie\r\n if($_COOKIE[ACCESS_TOKEN_COOKIE_NAME]) {\r\n parse_str($_COOKIE[ACCESS_TOKEN_COOKIE_NAME], $tok); \r\n return $tok;\r\n }\r\n\r\n // Handling a redirect back from login\r\n else if($_COOKIE[REQUEST_TOKEN_COOKIE_NAME] && $_REQUEST['oauth_verifier'] && $_REQUEST['oauth_token']) {\r\n $tok = YMClient::oauth_token_from_query_string($_COOKIE[REQUEST_TOKEN_COOKIE_NAME]);\r\n\r\n if($tok['oauth_token'] != $_REQUEST['oauth_token']) {\r\n throw new Exception(\"Cookie and URL disagree about request token value\");\r\n }\r\n\r\n $tok['oauth_verifier'] = $_REQUEST['oauth_verifier']; \r\n $newtok = $this->ymc->oauth_get_access_token($tok);\r\n\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, \"\", time()-3600);\r\n setcookie(ACCESS_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($newtok));\r\n return $newtok;\r\n }\r\n\r\n // Sending the user to login to grant access to this app\r\n else {\r\n list ($tok, $url) = $this->ymc->oauth_get_request_token($this->callbackURL);\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($tok));\r\n header(\"Location: $url\");\r\n }\r\n }", "public function getToken()\n\t{\n\t\treturn $this->getOption('accesstoken');\n\t}", "public function getAccessToken() {\n\n $data = $this->redis->get('pa_access_token');\n if (!$data) {\n $data['expire_time'] = 0;\n $data['access_token'] = \"0\";\n $this->redis->set('pa_access_token', $data, 7200);\n }\n if ($data['expire_time'] < time()) {\n $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.$this->config['appId'].'&secret='.$this->config['appSecret'];\n $res = json_decode($this->httpGet($url));\n $access_token = $res->access_token;\n if ($access_token) {\n $data['expire_time'] = time() + 7000;\n $data['access_token'] = $access_token;\n }\n }\n //debug_info(\"getaccesstoken,b4 storage:\".json_encode($data));\n $this->redis->set('pa_access_token', $data, 7200);\n return $data;\n }", "public function getTokenFromServer()\n {\n $params = [\n 'component_appid' => $this->component_token->getAppId(),\n 'authorizer_appid' => $this->appId,\n 'authorizer_refresh_token' => $this->refresh_token,\n ];\n\n $http = $this->getHttp();\n $url = sprintf(self::API_AUTHORIZER_TOKEN, $this->component_token->getToken());\n $token = $http->parseJSON($http->json($url, $params));\n\n if (empty($token['authorizer_access_token'])) {\n throw new HttpException('Request AccessToken fail. response: '.json_encode($token, JSON_UNESCAPED_UNICODE));\n }\n\n return $token;\n }", "public function get_access_token() {\n $access_token = get_transient( 'yith-wcbk-gcal-access-token' );\n if ( !$access_token ) {\n $refresh_token = $this->get_option( 'refresh-token' );\n if ( $refresh_token ) {\n $data = array(\n 'client_id' => $this->get_client_id(),\n 'client_secret' => $this->get_client_secret(),\n 'refresh_token' => $refresh_token,\n 'grant_type' => 'refresh_token',\n );\n\n $params = array(\n 'body' => http_build_query( $data ),\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ),\n );\n\n $response = wp_remote_post( $this->oauth_url . 'token', $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $access_token = sanitize_text_field( $body->access_token );\n $expires_in = isset( $body->expires_in ) ? absint( $body->expires_in ) : HOUR_IN_SECONDS;\n $expires_in -= 100;\n\n set_transient( 'yith-wcbk-gcal-access-token', $access_token, $expires_in );\n\n $this->debug( 'Access Token refreshed successfully', compact( 'access_token', 'expires_in', 'body' ) );\n } else {\n $this->error( 'Error while refreshing Access Token: ', $response );\n }\n }\n }\n\n return $access_token;\n }", "private function get_token() {\n $uri = $this->settings->hostname.\"oauth/token\";\n //echo \"POST $uri\\n\";\n\n $data = array(\n \"grant_type\" => \"password\",\n \"client_id\" => $this->settings->client_id,\n \"client_secret\" => $this->settings->client_secret,\n \"username\" => $this->settings->username,\n \"password\" => $this->settings->password\n );\n $postdata = http_build_query($data);\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $uri);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);\n curl_setopt($ch, CURLOPT_POST, TRUE);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/x-www-form-urlencoded'));\n\n $curl_response = curl_exec($ch);\n\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $curl_error_number = curl_errno($ch);\n $curl_error = curl_error($ch);\n\n //echo $curl_response.\"\\n\"; // output entire response\n //echo $http_code.\"\\n\"; // output http status code\n\n curl_close($ch);\n $token = NULL;\n if ($http_code == 200) {\n $token = json_decode($curl_response);\n //var_dump($token); // print entire token object\n }\n return $token;\n }", "public function get_request_token($accid) {\n // Get a request token from the appliance\n $url = $this->appliance_url . \"/api/request_token.php\";\n $result = $this->call($url, array());\n // dbg(\"Received request token $result\");\n $req_token = array();\n parse_str($result,$req_token);\n\n if(!isset($req_token['oauth_token'])) {\n //error_log(\"Failed to retrieve request token from \".$url.\" result = \".$result);\n throw new Exception(\"Unable to retrieve request token\");\n }\n $token = new OAuthToken($req_token['oauth_token'], $req_token['oauth_token_secret']);\n return $token;\n }", "private function _getToken()\n {\n $postData = array(\n 'UserApiKey' => $this->username,\n 'SecretKey' => $this->password,\n 'System' => 'joomla_acy_3_5_v_3_0'\n );\n $postString = json_encode($postData);\n\n $ch = curl_init($this->apidomain.$this->getApiTokenUrl());\n curl_setopt(\n $ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json'\n )\n );\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);\n\n $result = curl_exec($ch);\n curl_close($ch);\n\n $response = json_decode($result);\n $resp = false;\n if (is_object($response)) {\n @$IsSuccessful = $response->IsSuccessful;\n if ($IsSuccessful == true) {\n @$TokenKey = $response->TokenKey;\n $resp = $TokenKey;\n } else {\n $resp = false;\n }\n }\n return $resp;\n }", "public function getAccessTokenFromClientCredentials(): AccessToken;", "public function getBearerToken() \n {\n $headers = $this->getAuthorizationHeader(); \n \n if (!empty($headers)) {\n $token = explode(\" \", $headers, 2);\n if (!empty($token[1])) {\n //echo (\"Token: \" . $token[1] .\"\\n\"); //debug\n return $token[1];\n } \n $this->throwException(COULD_NOT_GET_AUTHORIZATION_FROM_HEADER, 'Could not parse access token from authorization header'); \n }\n }", "private function getBearerToken() {\n\n // Encoding the consumer key and secret\n $bearer_auth = $this->encodeBearerAuth();\n\n // The POST request has to have\n // a specific grant_type in the body\n $request_body = ['grant_type' => 'client_credentials'];\n $request_body = http_build_query($request_body);\n\n // Setting the required headers\n $headers = [\n 'Authorization: Basic ' . $bearer_auth,\n 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8',\n 'Content-Length: ' . strlen($request_body)\n ];\n\n // Requesting the bearer token\n $result = $this->makePostRequest(\n 'oauth2/token',\n $headers,\n $request_body,\n true\n );\n\n if (isset($result['token_type']) &&\n strlen($result['token_type']) &&\n $result['token_type'] === 'bearer' &&\n isset($result['access_token']) &&\n strlen($result['access_token'])) {\n\n $this->bearer_token = $result['access_token'];\n }\n }", "public function getAccessToken() {\n $spotify_config = \\Drupal::config('spotify.settings');\n $url = 'https://accounts.spotify.com/api/token';\n $query = [\n 'grant_type' => 'client_credentials',\n 'client_id' => $spotify_config->get('client_id') ? $spotify_config->get('client_id') : '83c0f9f106b1493590e4d45cd5f0a979',\n 'client_secret' => $spotify_config->get('client_secret') ? $spotify_config->get('client_secret') : 'c8411ff0b00646c88a373e21a445acca',\n ];\n $options = [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ],\n 'form_params' => $query,\n ];\n try {\n $request = $this->httpClient->request('post', $url, $options);\n if ($response = json_decode($request->getBody(), TRUE)) {\n return $response['access_token'];\n }\n } catch (RequestException $requestException) {\n if (function_exists('dpm')) {\n dpm($requestException->getMessage());\n }\n }\n return FALSE;\n }", "public function getAccessToken()\n {\n return json_encode($this->accessToken);\n }", "public function request_token() {\n $this->sign_secret = $this->consumer_secret.'&';\n\n if (empty($this->oauth_callback)) {\n $params = [];\n } else {\n $params = ['oauth_callback' => $this->oauth_callback->out(false)];\n }\n\n $params = $this->prepare_oauth_parameters($this->request_token_api, $params, 'GET');\n $content = $this->http->get($this->request_token_api, $params, $this->http_options);\n // Including:\n // oauth_token\n // oauth_token_secret\n $result = $this->parse_result($content);\n if (empty($result['oauth_token'])) {\n throw new moodle_exception('oauth1requesttoken', 'core_error', '', null, $content);\n }\n // Build oauth authorize url.\n $result['authorize_url'] = $this->authorize_url . '?oauth_token='.$result['oauth_token'];\n\n return $result;\n }", "function extract_access_token()\r\n{\r\n $header = $_SERVER['HTTP_AUTHORIZATION'];\r\n\r\n if ($header != null && preg_match('/^Bearer[ ]+(.+)/i', $header, $captured))\r\n {\r\n return $captured;\r\n }\r\n\r\n if ($_SERVER['REQUEST_METHOD'] == 'GET')\r\n {\r\n return $_GET['access_token'];\r\n }\r\n else\r\n {\r\n return $_POST['access_token'];\r\n }\r\n}", "public function getToken()\n {\n return $this->getAttr('access_token');\n }", "function get_access_token()\r\n {\r\n $script_location = $this->script_location.'Soundcloud_get_token.py';\r\n $params = $this->sc_client_id.\" \".$this->sc_secret.\" \".$this->sc_user.\" \".$this->sc_pass;\r\n //Execute python script and save results\r\n exec(\"python \\\"\".$script_location.\"\\\" \".$params, $result);\r\n return $result;\r\n }", "public static function acquire_token() {\n\n\t\t\n\n\t\t$response = skydrive_tokenstore::get_tokens_from_store();\n\n\t\tif (empty($response['access_token'])) {\t// No token at all, needs to go through login flow. Return false to indicate this.\n\n\t\t\treturn false;\n\n\t\t\texit;\n\n\t\t} else {\n\n\t\t\tif (time() > (int)$response['access_token_expires']) { // Token needs refreshing. Refresh it and then return the new one.\n\n\t\t\t\t$refreshed = skydrive_auth::refresh_oauth_token($response['refresh_token']);\n\n\t\t\t\tif (skydrive_tokenstore::save_tokens_to_store($refreshed)) {\n\n\t\t\t\t\t$newtokens = skydrive_tokenstore::get_tokens_from_store();\n\n\t\t\t\t\treturn $newtokens['access_token'];\n\n\t\t\t\t}\n\n\t\t\t\texit;\n\n\t\t\t} else {\n\n\t\t\t\treturn $response['access_token']; // Token currently valid. Return it.\n\n\t\t\t\texit;\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function loadAccessToken()\n {\n $this->setHeader(self::HEADER_TYPE_BASIC, self::TOKEN_HEADER);\n\n $curl = new Curl;\n\n $opt = [\n 'grant_type' => $this->grant,\n 'username' => $this->username,\n 'password' => $this->password,\n 'scope' => $this->scope\n ];\n\n $token = $curl->post(self::BASE_API_URL.self::TOKEN_END_POINT, $opt, $this->getHeader());\n\n $this->saveAccessToken($token);\n }", "public function token()\n {\n if ($this->accessToken === null) {\n $this->initToken();\n }\n return $this->accessToken;\n }" ]
[ "0.8310489", "0.8310489", "0.8310489", "0.8310489", "0.8310489", "0.80417573", "0.7703571", "0.7677438", "0.7650841", "0.76337296", "0.7633071", "0.7598896", "0.7575737", "0.75592554", "0.7491925", "0.74746567", "0.7472849", "0.74697536", "0.7435633", "0.7435452", "0.7398265", "0.7398265", "0.7398265", "0.7398265", "0.7398265", "0.7398265", "0.7398265", "0.7398265", "0.73982537", "0.7383509", "0.7381069", "0.7381005", "0.7354047", "0.73489445", "0.73459685", "0.73283875", "0.73220074", "0.73213285", "0.7293252", "0.72905827", "0.728609", "0.72698784", "0.72698784", "0.72698784", "0.72698784", "0.72698784", "0.72698784", "0.72692585", "0.72692585", "0.72692585", "0.72692585", "0.725915", "0.7249502", "0.7228631", "0.72226554", "0.7210585", "0.7194221", "0.7181515", "0.7174199", "0.7173585", "0.71536916", "0.7153021", "0.7103596", "0.7100609", "0.70907813", "0.7090724", "0.7088563", "0.70727503", "0.7069474", "0.70639193", "0.70479566", "0.704419", "0.7040614", "0.7029516", "0.7024038", "0.7018219", "0.70138896", "0.7008672", "0.7008348", "0.6982845", "0.69797075", "0.6978995", "0.6971453", "0.6965268", "0.69450414", "0.6941216", "0.69364285", "0.6931187", "0.69239676", "0.6908139", "0.68970597", "0.6895678", "0.6888934", "0.68879694", "0.68831664", "0.6866256", "0.6865887", "0.6856573", "0.6849849", "0.6847017" ]
0.7128449
62
/ Default title and description for modules that are not yet installed
public function __construct() { $this->setTitle('Low Order Fee'); $this->setDescription('Low Order Fee'); $this->init('loworderfee'); if ($this->isInstalled() === true){ $this->taxClass = $this->getConfigData('TAX_CLASS'); $this->allowFees = $this->getConfigData('MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE'); $this->feesDestination = $this->getConfigData('MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION'); $this->lowOrderAmount = $this->getConfigData('MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER'); $this->lowOrderFee = $this->getConfigData('MODULE_ORDER_TOTAL_LOWORDERFEE_FEE'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function title()\n {\n return 'Untitled module';\n }", "protected function getModuleHeadline() {}", "public function getDefaultTitle(): string;", "public function getDefaultModule();", "public function get_module_title()\n {\n return \"LC__DIALOG_ADMIN\";\n }", "public function getHelpMessage()\n {\n return \"Get summary of a module or all modules\\n\";\n }", "public function getDescription() {\n\t\t\treturn $this->MODULE_DESCRIPTION;\t\n\t\t}", "public function help()\r\n{\r\n // You could include a file and return it here.\r\n return \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\r\n}", "function tg_columns_head_package($defaults) {\n $defaults['package_items'] = esc_html__('Package Listing','weddingvendor');\n\t$defaults['package_price'] = esc_html__('Price','weddingvendor');\n return $defaults;\n}", "function defineDescription() {\n return 'List all available commands with a short description';\n }", "protected static function get_default_description()\n {\n }", "public function help()\n {\n // You could include a file and return it here.\n return \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\n }", "public function help()\r\n\t{\r\n\t\t// You could include a file and return it here.\r\n\t\treturn \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\r\n\t}", "function getDescription() {\n\t\treturn __('plugins.themes.default.description');\n\t}", "public function init() {\n $this->title = get_string('config_default_title', 'block_courses_available');\n }", "public function testGetModDescription()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function getDefaultModule()\n\t{\n\t\t$modules = ModuleComponentContainerAdapter::getAll( $this->dbConnection, \"IsDefault = 1 and (AppName LIKE '\".SoondaUtil::encodeHTML($this->config[\"appname\"]).\"' or AppName LIKE '\".$this->config[\"appname\"].\"') \" );\n\n\t\tif(count( $modules) > 0)\n\t\t\treturn $modules[0];\n\t\telse \n\t\t\treturn null;\n\t}", "public static function getModuleInfo() {\n\t\treturn array(\n\t\t\t'title' => '',\t\t// printable name/title of module\n\t\t\t'version' => 1, \t// version number of module\n\t\t\t'summary' => '', \t// 1 sentence summary of module\n\t\t\t'href' => '', \t\t// URL to more information (optional)\n\t\t\t'permanent' => false, \t// true if module is permanent and thus not uninstallable\n\t\t\t); \n\t}", "protected function createModuleInfo()\n {\n return new Core_ModuleInfo(\n \"Ras Blog\",\n \"LemonStand blogging feature\",\n \"Ras\");\n }", "function app_products() {\r\n $this->name=\"app_products\";\r\n $this->title=\"<#LANG_APP_PRODUCTS#>\";\r\n $this->module_category=\"<#LANG_SECTION_APPLICATIONS#>\";\r\n $this->checkInstalled();\r\n}", "public function DoDefault()\n\t\t{\n\t\t\t/*$template = Template::LoadTemplate(\"YageCMS.Core.Module.UserManager.Overview.Overview\",\"VIEW\");\n\t\t\tprint $template->VarDump(true);\n\t\t\treturn \"Hi\";*/\n\t\t\t\n\t\t\t\n\t\t\t/*\n\t\t\t$moduleViewSetup = ConfigurationManager::Instance()->GetParameter(\"YageCMS.Core.CustomSetup.Overview\",\"module-usermanager\");\n\t\t\t\n\t\t\tif(!$moduleViewSetup)\n\t\t\t{\n\t\t\t\t$moduleViewSetup = ConfigurationManager::Instance()->GetParameter(\"YageCMS.Core.DefaultSetup\");\n\t\t\t}\n\t\t\t\n\t\t\t$setup = SetupAccess::Instance()->GetByID($moduleViewSetup);\n\t\t\t\n\t\t\t$setup->AddToSection(\"YageCMS.Core.ModuleView\", $this);\n\t\t\t*/\n\t\t\t$output = $this->LoadSetup();\n\t\t\t\n\t\t\treturn $output;\n\t\t}", "public function builder_module_title( $atts, $content = null ) {\n extract( $this->get_sanitized_attributes( $atts ) );\n $title = $title ? $title : $this->config['title'];\n return '<i class=\"icon-' . $icon . '\"></i> ' . $title;\n }", "function ui_title() {\n if (!isset($this->plugin['ui_title'])) {\n return check_plain($this->plugin['module'] . ':' . $this->plugin['name']);\n }\n return check_plain($this->plugin['ui_title']);\n }", "protected function getModuleDefaultData() {\n return array(\n 'title'=>ucfirst($this->configModule),\n 'disabled'=>0,\n 'protected'=>0,\n 'search'=>0,\n 'secure'=>0\n );\n }", "public function builder_module_title( $atts, $content = null ) {\n extract( $this->get_sanitized_attributes( $atts ) );\n $progress = $progress ? $progress : '0';\n $title = $title ? $title : $this->config['title'];\n return $title . ' - ' . $progress . '%';\n }", "public function getDefaultModules() {\n\t\t$modules = parent::getDefaultModules();\n\t\t// flush unnecessary modules\n\t\t$modules['content'] = [];\n\n\t\t$modules['top'] = 'skins.minerva.scripts.top';\n\t\t// Define all the modules that should load on the mobile site and their dependencies.\n\t\t// Do not add mobules here.\n\t\t$modules['stable'] = 'skins.minerva.scripts';\n\n\t\t// Doing this unconditionally, prevents the desktop watchstar from ever leaking into mobile view.\n\t\t$modules['watch'] = [];\n\n\t\t$modules['context'] = $this->getContextSpecificModules();\n\n\t\tif ( $this->getSkinOption( self::OPTION_TOGGLING ) ) {\n\t\t\t$modules['toggling'] = [ 'skins.minerva.toggling' ];\n\t\t}\n\t\t$modules['site'] = 'mobile.site';\n\n\t\t// FIXME: Upstream?\n\t\tHooks::run( 'SkinMinervaDefaultModules', [ $this, &$modules ] );\n\t\treturn $modules;\n\t}", "public function _getModuleDescription()\n {\n // Tabs and line breaks are used for formatting resulting in readable HTML code\n $description = \"<table>\" . PHP_EOL;\n $description .= \"\\t<tr>\" . PHP_EOL;\n $description .= \"\\t\\t<td>Module name:</td>\" . PHP_EOL . \"\\t\\t<td>Product/Supplier add</td>\" . PHP_EOL;\n $description .= \"\\t</tr>\" . PHP_EOL;\n $description .= \"\\t<tr>\" . PHP_EOL;\n $description .= \"\\t\\t<td>Author:</td>\" . PHP_EOL . \"\\t\\t<td>\" . $this->_getModuleAuthor() . \"</td>\" . PHP_EOL;\n $description .= \"\\t</tr>\" . PHP_EOL;\n $description .= \"\\t<tr>\" . PHP_EOL;\n $description .= \"\\t\\t<td>Version:</td>\" . PHP_EOL . \"\\t\\t<td>\" . $this->_getModuleVersion() . \"</td>\" . PHP_EOL;\n $description .= \"\\t</tr>\" . PHP_EOL;\n $description .= \"\\t<tr>\" . PHP_EOL;\n $description .= \"\\t\\t<td>Description:</td>\" . PHP_EOL . \"\\t\\t<td>This module allows user (employee) to add products to the system as well as suppliers.</td>\" . PHP_EOL;\n $description .= \"\\t</tr>\" . PHP_EOL;\n $description .= \"</table>\" . PHP_EOL;\n\n return $description;\n }", "public function get_module_title()\n {\n return \"LC__MODULE__EVENTS\";\n }", "function title() {\n ?>\n <h2><?php _e(SCLNG_PUBLIC_PRODUCT_INFO, SC_DOMAIN); ?></h2>\n <?php\n }", "function spyropress_builder_render_modules( $display_core = false ) {\n global $spyropress_builder;\n $sort = $spyropress_builder->modules->get_modules();\n \n if( empty( $sort ) ) return;\n \n $content = '';\n \n // Sorting\n usort( $sort, 'builder_module_name_sort' );\n $done = array();\n\n foreach ( $sort as $module ) {\n if ( $display_core && $module->is_core ) {\n $module_idbase = $module->id_base;\n if ( in_array( $module_idbase, $done, true ) )\n continue;\n\n $done[] = $module_idbase;\n $widget_obj = $module;\n $class = get_class( $widget_obj );\n\n /** Generate HTML **/\n $content .= sprintf( '\n <li class=\"module-item\">\n <a class=\"builder-module-insert\" href=\"#\" data-module-type=\"%1$s\">\n <span class=\"module-icon-widget\"></span>\n <span class=\"module-item-body\">\n <strong class=\"module-item-title\">%2$s</strong>\n <span class=\"module-item-description\">%3$s</span>\n </span>\n </a>\n </li>', $class, $widget_obj->name, esc_html( $widget_obj->widget_options['description'] )\n );\n }\n elseif ( ! $display_core && ! $module->is_core ) {\n $module_idbase = $module->id_base;\n if ( in_array( $module_idbase, $done, true ) )\n continue;\n\n $done[] = $module_idbase;\n $widget_obj = $module;\n $class = get_class( $widget_obj );\n\n /** Generate HTML **/\n $content .= sprintf( '\n <li class=\"module-item\">\n <a class=\"builder-module-insert\" href=\"#\" data-module-type=\"%1$s\">\n <span class=\"module-icon-widget\"></span>\n <span class=\"module-item-body\">\n <strong class=\"module-item-title\">%2$s</strong>\n <span class=\"module-item-description\">%3$s</span>\n </span>\n </a>\n </li>', $class, $widget_obj->name, esc_html( $widget_obj->widget_options['description'] )\n );\n }\n }\n\n echo tomato_html( $content );\n}", "public function availableAction()\n {\n $modules = array();\n //$modulesInstalled = $this->installedModules();\n $iterator = new \\DirectoryIterator(Pi::path('module'));\n foreach ($iterator as $fileinfo) {\n if (!$fileinfo->isDir() || $fileinfo->isDot()) {\n continue;\n }\n $directory = $fileinfo->getFilename();\n if (preg_match('/[^a-z0-9_]/i', $directory)) {\n continue;\n }\n $meta = Pi::service('module')->loadMeta($directory, 'meta');\n if (empty($meta)) {\n continue;\n }\n $author = Pi::service('module')->loadMeta($directory, 'author');\n //$clonable = isset($meta['clonable']) ? $meta['clonable'] : false;\n //$meta['installed'] = in_array($directory, $modulesInstalled);\n $meta['installed'] = Pi::registry('module')\n ->read($directory) ? true : false;\n if (empty($meta['clonable']) && $meta['installed']) {\n continue;\n }\n $meta['logo'] = !empty($meta['logo'])\n ? Pi::url('script/browse.php') . '?'\n . sprintf('module/%s/asset/%s', $directory, $meta['logo'])\n : Pi::url('static/image/module.png');\n $modules[$directory] = array(\n 'meta' => $meta,\n 'author' => $author,\n );\n }\n\n $this->view()->assign('modules', $modules);\n $this->view()->assign('title', __('Modules ready for installation'));\n }", "public function getTitle()\n\t{\n\t\treturn JText::_('COM_DUMMY_OBJECT_ITEMS');\n\t}", "function getDescription()\n {\n $description = '\n\t\tThis is the template installation type. Change this text within the file for this installation type.';\n return $description;\n }", "public function getPanelTitle()\n {\n return 'assetPackages Plugin';\n }", "public function help()\n\t{\n\t\t// You could include a file and return it here.\n\t\treturn \"<h4>Overview</h4>\n\t\t<p>The Inventory module will work like magic. The End!</p>\";\n\t}", "function my_module_plugin_admin_info($subtype, $conf, $context) {\n // Set the title that shows on the admin Content page to the overridden title.\n $block = new stdClass();\n $title_text = \"My Special Page Section\";\n\n if (!empty($title_text)) {\n $admin_title = $title_text;\n }\n else {\n $admin_title = 'No Title';\n }\n $block->title = $conf['override_title_text'] ? $conf['override_title_text'] : $admin_title;\n return $block;\n}", "private function _getTitle()\r\n\t{\r\n\t\t$input\t= dunloader( 'input', true );\r\n\t\t$action\t= $input->getVar( 'action', 'themes' );\r\n\t\t$task\t= $input->getVar( 'task', null );\r\n\t\t\r\n\t\treturn '<h1>' . t( 'themer.admin.module.title', t( 'themer.admin.module.title.' . $action . ( $task ? '.' . $task : '' ) ) ) . '</h1>';\r\n\t}", "function ctools_default_block_info($module, $delta, &$info) {\n $core_modules = array('aggregator', 'block', 'blog', 'blogapi', 'book', 'color', 'comment', 'contact', 'drupal', 'filter', 'forum', 'help', 'legacy', 'locale', 'menu', 'node', 'path', 'ping', 'poll', 'profile', 'search', 'statistics', 'taxonomy', 'throttle', 'tracker', 'upload', 'user', 'watchdog', 'system');\n\n if (in_array($module, $core_modules)) {\n $info['icon'] = 'icon_core_block.png';\n $info['category'] = t('Miscellaneous');\n }\n else {\n $info['icon'] = 'icon_contrib_block.png';\n $info['category'] = t('Miscellaneous');\n }\n}", "function xh_initModules()\r\n\t{\r\n\t}", "function getDisplayName() {\n return lang('Module Name Display Name');\n }", "function info_module_mod_search_simple(){\n\n //\n // Описание модуля\n //\n\n //Заголовок (на сайте)\n $_module['title'] = 'Простой модуль поиска';\n\n //Название (в админке)\n $_module['name'] = 'Простой модуль поиска';\n\n //описание\n $_module['description'] = 'Модуль Простой поиск';\n\n //ссылка (идентификатор)\n $_module['link'] = 'mod_search_simple';\n\n //позиция\n $_module['position'] = 'sidebar';\n\n //автор\n $_module['author'] = 'soft-solution.ru';\n\n //текущая версия\n $_module['version'] = '1.0';\n\n //\n // Настройки по-умолчанию\n //\n //$_module['config'] = array();\n\n return $_module;\n\n }", "function help()\n\t{\n\t\t/* check if all required plugins are installed */\n\t\t\n\t\t$text = \"<div class='center buttons-bar'><form method='post' action='\".e_SELF.\"?\".e_QUERY.\"' id='core-db-import-form'>\";\n\t\t$text .= e107::getForm()->admin_button('importThemeDemo', 'Install Demo', 'other');\n\t\t$text .= '</form></div>';\n \n\t \treturn $text;\n\t}", "function ubercart_image_pkg_info() {\n // Include the CCK\n module_load_include('inc', 'filefield', 'filefield_widget');\n module_load_include('inc', 'imagefield', 'imagefield_widget');\n\n // Determine the image API plugin module to use.\n $plugin = class_exists('imagick') ? 'imageapi_imagemagick' : 'imageapi_gd';\n\n return array(\n 'title' => t('Image support'),\n 'description' => t('This package installs default image support for Ubercart products and integrates them into various parts of the store. It uses Lightbox2 for popup displays on product pages.'),\n 'modules' => array('content', 'filefield', 'imageapi', $plugin, 'imagefield', 'imagecache', 'imagecache_ui', 'lightbox2'),\n );\n}", "public function render_section_themes_description() {\n\t\t_e( 'Choose themes to make available in your SatisPress repository.', 'satispress' );\n\t}", "public function builder_module_title( $atts, $content = null ) {\n extract( $this->get_sanitized_attributes( $atts ) );\n return $text ? sprintf( __( 'Button: %s', 'canvys' ), $text ) : $this->config['title'];\n }", "function __construct() \r\n{\r\n $this->name=\"scheduled_job\";\r\n $this->title=\"scheduled job module\";\r\n $this->module_category=\"<#LANG_SECTION_SYSTEM#>\";\r\n //$this->checkInstalled();\r\n}", "public function getTitle()\n {\n return '<img src=\"'.$this->webDebug->getOption('image_root_path').'/config.png\" alt=\"assetPackagesPlugin informations\" /> Asset packages';\n }", "protected function getAllModules()\n {\n return Hook::getHookModuleExecList('displayHeader');\n }", "function educoAdminPrepareHead() {\n global $langs, $conf;\n\n $langs->load(\"educo@educo\");\n\n $h = 0;\n $head = array();\n\n $head[$h][0] = dol_buildpath(\"/educo/admin/setup.php\", 1);\n $head[$h][1] = $langs->trans(\"Settings\");\n $head[$h][2] = 'settings';\n $h++;\n $head[$h][0] = dol_buildpath(\"/educo/admin/about.php\", 1);\n $head[$h][1] = $langs->trans(\"About\");\n $head[$h][2] = 'about';\n $h++;\n\n // Show more tabs from modules\n // Entries must be declared in modules descriptor with line\n //$tabs = array(\n //\t'entity:+tabname:Title:@educo:/educo/mypage.php?id=__ID__'\n //); // to add new tab\n //$tabs = array(\n //\t'entity:-tabname:Title:@educo:/educo/mypage.php?id=__ID__'\n //); // to remove a tab\n complete_head_from_modules($conf, $langs, $object, $head, $h, 'educo');\n\n return $head;\n}", "function qa_list_modules_info()\n{\n\tglobal $qa_modules;\n\treturn $qa_modules;\n}", "protected function createModuleInfo() {\n return new Core_ModuleInfo(\n \"Event Listing\",\n \"Adds an event listing and admin entry for them to be displayed on the frontend\",\n \"Keyed-Up Media LLC\" );\n }", "function ajoute_le_titre()\n{\n if (!is_admin()) {\n add_theme_support(\"title-tag\");\n } \n}", "function opanda_change_menu_title( $title ) {\r\n if ( !BizPanda::isSinglePlugin() ) return $title;\r\n return __('Opt-In Panda', 'opanda');\r\n}", "public function getDesc(){\n\t\treturn $this->descModule;\n\t}", "public function getmodulemeta()\n {\n return array('displayfunc' => 'view',\n 'titlefield' => 'title',\n 'itemid' => 'pid');\n }", "public function getPackageDescription() {\n\t\treturn t('Coworking Space Search Block and admin pages for coworking.coop site.');\n\t}", "function checkForDefaultSettings(){\n\n if(!isset($this->settings[\"reportTitle\"]))\n $this->settings[\"reportTitle\"] = \"Packing List\";\n\n parent::checkForDefaultSettings();\n\n }", "public function getModuleTitle($show_help = true)\n {\n global $dotb_version, $dotb_flavor, $server_unique_key, $current_language, $action, $current_user;\n\n $theTitle = \"<div class='moduleTitle'>\\n\";\n\n $module = preg_replace(\"/ /\",\"\",$this->module);\n\n $params = $this->_getModuleTitleParams();\n $count = count($params);\n $index = 0;\n\n\t\tif(DotbThemeRegistry::current()->directionality == \"rtl\") {\n\t\t\t$params = array_reverse($params);\n\t\t}\n\n $paramString = '';\n foreach($params as $parm){\n $index++;\n $paramString .= $parm;\n if($index < $count){\n $paramString .= $this->getBreadCrumbSymbol();\n }\n }\n\n if(!empty($paramString)){\n $theTitle .= \"<h2> $paramString </h2>\\n\";\n }\n\n if ($show_help) {\n $theTitle .= \"<span class='utils'>\";\n if(is_admin($current_user) || is_admin_for_module($current_user, $this->module))\n {\n $createImageURL = DotbThemeRegistry::current()->getImageURL('create-record.gif');\n $theTitle .= <<<EOHTML\n&nbsp;\n<a href=\"index.php?module={$module}&action=EditView&return_module={$module}&return_action=DetailView\" class=\"utilsLink\">\n<img src='{$createImageURL}' alt='{$GLOBALS['app_strings']['LNK_CREATE']}'></a>\n<a href=\"index.php?module={$module}&action=EditView&return_module={$module}&return_action=DetailView\" class=\"utilsLink\">\n{$GLOBALS['app_strings']['LNK_CREATE']}\n</a>\nEOHTML;\n }\n }\n\n $theTitle .= \"</span></div>\\n\";\n return $theTitle;\n }", "function shoestrap_empty_page_title() {}", "private function _getTitle()\r\n\t{\r\n\t\tglobal $action, $whmcs;\r\n\t\t\r\n\t\t$task = ( array_key_exists( 'task', $whmcs->input ) && ! empty( $whmcs->input['task'] ) ? '.' . $whmcs->input['task'] : null );\r\n\t\t\r\n\t\treturn '<h1>' . t( 'themer.admin.module.title', t( 'themer.admin.module.title.' . $action . $task ) ) . '</h1>';\r\n\t}", "function set_title() {\n \tglobal $pageTitle;\n \tif (isset($pageTitle))\n \t\techo 'Tanqeeb | ' . $pageTitle;\n \telse\n \t\techo 'Tanqeeb';\n}", "public function getDefaultTitle()\n {\n throw new Exception(\"Please implement getDefaultTitle() on {get_class($this)}.\");\n }", "protected function createModuleInfo()\n\t\t{\n\t\t\treturn new Core_ModuleInfo(\n\t\t\t\t\"ImageMagick\",\n\t\t\t\t\"Provides IM-specific extensions for LemonStand thumbnail generator\",\n\t\t\t\t\"Limewheel Creative Inc.\" );\n\t\t}", "function DS_Custom_Modules(){\n if(class_exists(\"ET_Builder_Module\")){\n \t// This adds options for more contact types and, with some clever css, a more flexible usage.\n\tinclude(\"ehanhanced_divi_modules/extended_person_module.php\");\n\n\t// This creates a hybrid blurb/cta. CTA's should have the option for images and more than one button. Sheesh!\n\tinclude(\"ehanhanced_divi_modules/extended_cta.php\");\n }\n}", "public function change_default_title($title) {\n\t\treturn '';\n\t}", "public static function getModuleName() { return 'np_displayarticles'; }", "public function setDefaultModule($module);", "function atkModule($name=\"\")\n {\n $this->m_name = $name;\n }", "function modules_get_manual()\n{\n\t$currentlang = pnSessionGetVar('lang');\n\t$language = pnConfigGetVar('language');\n\n\tif (!isset($GLOBALS['ModName'])) {\n\t\t$modname = pnModGetName();\n\t} else {\n\t\t$modname = $GLOBALS['ModName'];\n\t}\n\t$modinfo = pnModGetInfo(pnModGetIDFromName($modname));\n\n\tif (file_exists('modules/'.pnVarPrepForOS($modinfo['directory']).'/lang/'.pnVarPrepForOS($currentlang).'/manual.html')) {\n\t\t$hlpfile = 'modules/'.pnVarPrepForOS($modinfo['directory']).'/lang/'.pnVarPrepForOS($currentlang).'/manual.html';\n\t} elseif (!empty($language)) {\n\t\tif (file_exists('modules/'.pnVarPrepForOS($modinfo['directory']).'/lang/'.pnVarPrepForOS($language).'/manual.html')) {\n\t\t\t$hlpfile = 'modules/'.pnVarPrepForOS($modinfo['directory']).'/lang/'.pnVarPrepForOS($language).'/manual.html';\n\t\t}\n\t} else {\n\t\t$hlpfile = 'modules/'.pnVarPrepForOS($modinfo['directory']).'/lang/eng/manual.html';\n\t}\n\treturn;\n}", "function render() {\n\t\t\t// this is to be overwritten as each module has a very unique display\n\t\t\t// for now we will have this default lame content\n\t\t\treturn \"<div style=\\\"border:1px solid blue;display:table\\\">Empty Module</div>\";\n\t\t}", "public function indexAction()\n {\n $active = Pi::registry('modulelist')->read('active');\n $inactive = Pi::registry('modulelist')->read('inactive');\n\n $modules = array_merge($active, $inactive);\n foreach ($modules as $name => &$data) {\n $meta = Pi::service('module')->loadMeta(\n $data['directory'],\n 'meta'\n );\n $author = Pi::service('module')->loadMeta(\n $data['directory'],\n 'author'\n );\n $data['description'] = $meta['description'];\n $data['author'] = $author;\n $data['active'] = isset($active[$name]) ? true : false;\n if (empty($meta['logo'])) {\n $data['logo'] = Pi::url('static/image/module.png');\n } elseif (empty($data['active'])) {\n $data['logo'] = Pi::url('script/browse.php') . '?' . sprintf(\n 'module/%s/asset/%s',\n $data['directory'],\n $meta['logo']\n );\n } else {\n $data['logo'] = Pi::service('asset')->getModuleAsset(\n $meta['logo'],\n $data['name']\n );\n }\n if (empty($data['update'])) {\n $data['update'] = __('Never updated.');\n } else {\n $data['update'] = _date($data['update']);\n }\n }\n $this->view()->assign('modules', $modules);\n //$this->view()->setTemplate('module-list');\n $this->view()->assign('title', __('Installed modules'));\n }", "public function setup_help_tab()\n {\n }", "public function testTitle()\n {\n $this->markTestSkipped();\n }", "function xh_finalModules()\r\n\t{\r\n\t}", "function acp_help_init()\n\t{\n\t\t//-----------------------------------------\n\t\t// Are we on 2.3?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( isset( $this->ipsclass->vars['acp_tutorial_mode'] ) )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Define our help sections\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$umi_acp_help = array( 'components_umi_'\t\t=> array( 'is_setting' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'help_title' => '(FSY23) Universal Mod Installer: Manage Mod Installations',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'help_body' => 'From this page, you can install, upgrade, and uninstall all compatible mods. Simply select the appropriate option from the box to the right of the mod in the table below.',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'help_mouseover' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t 'components_umi_view' => array( 'is_setting' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'help_title' => '(FSY23) Universal Mod Installer: Manage Mod Installations',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'help_body' => 'From this page, you can install, upgrade, and uninstall all compatible mods. Simply select the appropriate option from the box to the right of the mod in the table below.',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'help_mouseover' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t 'components_umi_install' => array( 'is_setting' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'help_title' => '(FSY23) Universal Mod Installer: XML Analysis',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'help_body' => 'The mod\\'s XML file has been analyzed and the proper steps have been determined.',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'help_mouseover' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t 'settinggroup_umi' => array( 'is_setting' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'help_title' => '(FSY23) Universal Mod Installer: Manage Settings',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'help_body' => 'Use the settings below to customize how the Universal Mod Installer behaves. If you experience any problems with the pages timing out when using the Universal Mod Installer, set the \"Use the \\'callback\\' functions?\" value to <b>No</b>.',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'help_mouseover' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Ensure the help keys have been created\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->ipsclass->DB->build_query( array( 'select' => 'page_key',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'acp_help',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"page_key IN ('\".implode( \"','\", array_keys( $umi_acp_help ) ).\"')\",\n\t\t\t\t\t\t\t\t\t\t\t)\t );\n\t\t\t$this->ipsclass->DB->exec_query();\n\t\t\t\n\t\t\tif ( $this->ipsclass->DB->get_num_rows() )\n\t\t\t{\n\t\t\t\twhile ( $row = $this->ipsclass->DB->fetch_row() )\n\t\t\t\t{\n\t\t\t\t\t$helps[] = $row['page_key'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach ( $umi_acp_help as $key => $value )\n\t\t\t{\n\t\t\t\tif ( is_array( $helps ) && count( $helps ) )\n\t\t\t\t{\n\t\t\t\t\tif ( !in_array( $key, $helps ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$insert = array( 'is_setting' => $value['is_setting'],\n\t\t\t\t\t\t\t\t\t\t 'page_key' => $key,\n\t\t\t\t\t\t\t\t\t\t 'help_title' => $value['help_title'],\n\t\t\t\t\t\t\t\t\t\t 'help_body' => $value['help_body'],\n\t\t\t\t\t\t\t\t\t\t 'help_mouseover' => $value['help_mouseover'],\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->ipsclass->DB->do_insert( 'acp_help', $insert );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "function GetAdminDescription()\n {\n return $this->Lang('moddescription');\n }", "function getTitle() {\n return 'Forms Demo';\n }", "public function testGetDescriptionDefault(): void\n {\n self::assertNull($this->class->getDescription());\n }", "public function install() {\n $strReturn = \"\";\n\n $strReturn .= \"Assigning null-properties and elements to the default language.\\n\";\n if($this->strContentLanguage == \"de\") {\n\n $strReturn .= \" Target language: de\\n\";\n\n if(class_exists(\"class_module_pages_page\", false) || class_classloader::getInstance()->loadClass(\"class_module_pages_page\") !== false)\n class_module_pages_page::assignNullProperties(\"de\", true);\n if(class_exists(\"class_module_pages_pageelement\", false) || class_classloader::getInstance()->loadClass(\"class_module_pages_pageelement\") !== false)\n class_module_pages_pageelement::assignNullElements(\"de\");\n\n $objLang = new class_module_languages_language();\n $objLang->setStrAdminLanguageToWorkOn(\"de\");\n }\n else {\n\n $strReturn .= \" Target language: en\\n\";\n\n if(class_exists(\"class_module_pages_page\", false) || class_classloader::getInstance()->loadClass(\"class_module_pages_page\") !== false)\n class_module_pages_page::assignNullProperties(\"en\", true);\n if(class_exists(\"class_module_pages_pageelement\", false) || class_classloader::getInstance()->loadClass(\"class_module_pages_pageelement\") !== false)\n class_module_pages_pageelement::assignNullElements(\"en\");\n\n $objLang = new class_module_languages_language();\n $objLang->setStrAdminLanguageToWorkOn(\"en\");\n\n }\n\n\n return $strReturn;\n }", "function on_install_module($module_name) {\n include('application.setup.php');\n return true;\n }", "function getDescription() {\n\t\treturn __('plugins.themes.ufrn-theme.description');\n\t}", "public function get_moduleinfo_output() {\n\n global $CFG, $DB, $OUTPUT;\n require_once($CFG->libdir . '/filelib.php');\n\n $result = '';\n\n // Now build HTML\n if (! empty ($this->data->module_code)) {\n \t$result .= html_writer::start_tag('p', array('class'=>'module_specific'));\n \t$result .= html_writer::tag('span', get_string( 'module_code', 'block_module_info' ).': ',\n \t\t\tarray('class'=>'module_info_title'));\n \t$result .= html_writer::tag('strong', $this->data->module_code);\n \t$result .= html_writer::end_tag('p');\n }\n if (! empty ($this->data->module_level)) {\n \t$result .= html_writer::start_tag('p', array('class'=>'module_specific'));\n \t$result .= html_writer::tag('span', get_string( 'module_level', 'block_module_info' ).': ',\n \t\t\tarray('class'=>'module_info_title'));\n \t$result .= html_writer::tag('strong', $this->data->module_level);\n \t$result .= html_writer::end_tag('p');\n }\n if (! empty ($this->data->module_credit)) {\n \t$result .= html_writer::start_tag('p', array('class'=>'module_specific'));\n \t$result .= html_writer::tag('span', get_string( 'module_credit', 'block_module_info' ).': ',\n \t\t\tarray('class'=>'module_info_title'));\n \t$result .= html_writer::tag('strong', $this->data->module_credit);\n \t$result .= html_writer::end_tag('p');\n }\n if (! empty ($this->data->module_semester)) {\n \t$result .= html_writer::start_tag('p', array('class'=>'module_specific'));\n \t$result .= html_writer::tag('span', get_string( 'module_semester', 'block_module_info' ).': ',\n \t\t\tarray('class'=>'module_info_title'));\n \t$result .= html_writer::tag('strong', $this->data->module_semester);\n \t$result .= html_writer::end_tag('p');\n }\n\n // If by this stage result is still empty then display a warning.\n if(empty($result)) {\n $result .= html_writer::tag('p', get_string( 'missing_module', 'block_module_info'), array('class'=>'missing_module'));\n }\n\n return $result;\n\n }", "public function setDefaultModule($module){ \r\n\t\t$this->_default_module = $module;\r\n\t}", "protected function generateModuleMenu() {}", "public function Install() {\n $modules = new CMModules();\n $results = $modules->Install();\n $allModules = $modules->ReadAndAnalyse();\n $this->views->SetTitle('Install Modules')\n ->AddInclude(__DIR__ . '/install.tpl.php', array('modules'=>$results), 'primary')\n ->AddInclude(__DIR__ . '/sidebar.tpl.php', array('modules'=>$allModules), 'sidebar');\n }", "public function getDescriptions()\n {\n return [\n 'debug applications' => 'Show all loaded applications'\n ];\n }", "function CIR_WorkaroundForMissingModulesDep()\n{\n\techo('\n\t[ -d \"/lib/modules/$(uname -r)\" ] || mkdir \"/lib/modules/$(uname -r)\"\n\t[ -f \"/lib/modules/$(uname -r)/modules.dep\" ] || cat /lib/modules/*/modules.dep > \"/lib/modules/$(uname -r)/modules.dep\";\n\t');\n}", "function pageTitle(){\n\t\tglobal $pageTitle;\n\t\techo isset($pageTitle) ? $pageTitle : \"Default\";\n\t}", "protected function get_default_title() {\n\n\t\treturn __( 'TeleCheck', 'woocommerce-gateway-firstdata' );\n\t}", "public function init() {\n \tif (array_key_exists('applicationName', $this->_strings)) {\n \t\t$this->view->headTitle($this->_strings['applicationName']);\n \t\t$this->view->headerTitle = $this->_strings['applicationName'];\n \t}\n }", "public function __construct()\n {\n parent::__construct(array(\n 'name' => __('Module Boilerplate', 'fl-builder'),\n 'description' => __('An starting point for coding new modules.', 'fl-builder'),\n 'category'\t\t=> __('Advanced Modules', 'fl-builder'),\n 'dir' => MY_MODULES_DIR . 'module-name/',\n 'url' => MY_MODULES_URL . 'module-name/',\n 'editor_export' => true, // Defaults to true and can be omitted.\n 'enabled' => true, // Defaults to true and can be omitted.\n ));\n }", "function example_module_noop_sysconfig()\n{\n return true;\n}", "protected function getInfoModule() {}", "function sloodle_print_header()\n {\n global $CFG;\n\n // Offer the user an 'update' button if they are allowed to edit the module\n $editbuttons = '';\n if ($this->canedit) {\n $editbuttons = update_module_button($this->cm->id, $this->course->id, get_string('modulename', 'sloodle'));\n }\n // Display the header\n $navigation = \"<a href=\\\"index.php?id={$this->course->id}\\\">\".get_string('modulenameplural','sloodle').\"</a> ->\";\n sloodle_print_header_simple(format_string($this->sloodle->name), \"&nbsp;\", \"{$navigation} \".format_string($this->sloodle->name), \"\", \"\", true, $editbuttons, navmenu($this->course, $this->cm));\n\n // Display the module name\n $img = '<img src=\"'.$CFG->wwwroot.'/mod/sloodle/icon.gif\" width=\"16\" height=\"16\" alt=\"\"/> ';\n sloodle_print_heading($img.$this->sloodle->name, 'center');\n \n // Display the module type and description\n $fulltypename = get_string(\"moduletype:{$this->sloodle->type}\", 'sloodle');\n echo '<h4 style=\"text-align:center;\">'.get_string('moduletype', 'sloodle').': '.$fulltypename;\n echo sloodle_helpbutton(\"moduletype_{$this->sloodle->type}\", $fulltypename, 'sloodle', true, false, '', true).'</h4>';\n // We'll apply a general introduction to all Controllers, since they seem to confuse lots of people!\n $intro = $this->sloodle->intro;\n if ($this->sloodle->type == SLOODLE_TYPE_CTRL) $intro = '<p style=\"font-style:italic;\">'.get_string('controllerinfo','sloodle').'</p>' . $this->sloodle->intro;\n\t\t// Display the intro in a box, if we have an intro\n\t\tif (!empty($intro)) sloodle_print_box($intro, 'generalbox', 'intro');\n \n }", "public function init() {\n $this->title = get_string('pluginname', 'block_course_modulenavigation');\n }", "public function index() {\n\t\t$data = $this->load_module_info ();\n\t\t\n\t\t$this->layout->display_admin ( $this->folder . $this->module . \"-list\", $data );\n\t}", "public function loadPageTitle()\n \t\t{\n echo \"<title>Add Item</title>\";\n }", "protected function setUp()\n {\n // finding a default module\n }", "function myblocks() {\n $this->name=\"myblocks\";\n $this->title=\"<#LANG_MODULE_MYBLOCKS#>\";\n $this->module_category=\"<#LANG_SECTION_SETTINGS#>\";\n $this->checkInstalled();\n}", "function _title()\n {\n return _(\"Menu\");\n }", "function info()\n\t{\n\t\t$info=array();\n\t\t$info['supports_advanced_import']=false;\n\t\t$info['product']='HTML website (page extraction and basic themeing)';\n\t\t$info['import']=array(\n\t\t\t\t\t\t\t\t'pages',\n\t\t\t\t\t\t\t);\n\t\treturn $info;\n\t}" ]
[ "0.6884893", "0.6558452", "0.6430557", "0.6348112", "0.62850535", "0.616982", "0.612619", "0.6022216", "0.60219437", "0.5983826", "0.5935141", "0.5932729", "0.5924254", "0.5922221", "0.5830168", "0.5807998", "0.5805914", "0.57973075", "0.57915634", "0.5789766", "0.5775734", "0.5773629", "0.5763842", "0.575951", "0.57566357", "0.5751397", "0.5744406", "0.5740787", "0.5740531", "0.57388747", "0.5729576", "0.5692547", "0.5684935", "0.56821096", "0.56571287", "0.5656723", "0.56479555", "0.56461316", "0.56357205", "0.56347984", "0.5630304", "0.5626507", "0.56241816", "0.5623035", "0.56159526", "0.56103283", "0.56032676", "0.5601997", "0.55874854", "0.5581802", "0.5579949", "0.5576322", "0.5569273", "0.5559728", "0.5554694", "0.55508375", "0.5534399", "0.5528462", "0.5517711", "0.55162346", "0.5511877", "0.5506708", "0.5503911", "0.5499211", "0.5495405", "0.54942405", "0.54936594", "0.547767", "0.5464721", "0.5461621", "0.54491955", "0.54401237", "0.54374856", "0.5425044", "0.5422846", "0.54094034", "0.5404902", "0.54040307", "0.5398724", "0.5395327", "0.5393043", "0.5391273", "0.53887683", "0.53847516", "0.5381366", "0.53773826", "0.53680646", "0.53641915", "0.5363868", "0.5363731", "0.5363152", "0.5361236", "0.5359618", "0.5358286", "0.53576416", "0.53569716", "0.53468573", "0.53455454", "0.5345175", "0.5344903", "0.533782" ]
0.0
-1
When the queried entityId is found
public function test_it_can_delete_an_entity() { $this->mockHandler ->append( new Response(200, [], file_get_contents(__DIR__ . '/fixture/delete_response_success.json')) ); $response = $this->client->delete('db2e5c63-3c54-4962-bf4a-d6ced1e9cf33'); $this->assertEquals(DeleteEntityRepository::RESULT_SUCCESS, $response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find($entity_id);", "public function afterFindOne(&$id, Entity $entity = null) { }", "public function findEntity($id);", "public function checkId($entityId){\n\t\t$select = $this->_getReadAdapter()->select()\n\t\t\t->from($this->getMainTable(), 'entity_id')\n\t\t\t->where('entity_id = :entity_id');\n\t\t$bind = array('entity_id' => $entityId);\n\t\treturn $this->_getReadAdapter()->fetchOne($select, $bind);\n\t}", "public function getEntityId();", "public function getEntityId();", "public function getEntityId();", "public function testFindOneById(): void\n {\n // given\n $event = $this->simpleEvent();\n $expectedId = $event->getId();\n\n // when\n $result = $this->eventService->findOneById($expectedId);\n\n // then\n $this->assertEquals($expectedId, $result->getId());\n }", "function getEntityId() {\n return $this->entity_id;\n }", "public function retrieve($entityName, $id);", "public function beforeFindOne(&$id) { }", "public function get_entity_id(){\n return $this->entityId;\n }", "public function FetchProductById($productid) { $pe = new ProductEntity();\n $FoundProduct = $pe->FetchProductById($productid, $this->DBH);\n var_dump($FoundProduct);\n //here's where I would check the object's fields before returning it, if I had a range targeted\n return $FoundProduct;\n }", "abstract protected function _doContains($id);", "public function getEntityId() {\n return $this->entityId;\n }", "public function test_getByRecordId_exists_executesCorrectly()\r\n\t{\r\n\t\t$recordId = \"aDummyRecordId\";\r\n\t\t\r\n\t\t$this->prepareSetRecordId($recordId);\r\n\t\t$this->prepareFind(true);\r\n\t\r\n\t\t$actual = $this->service->getByRecordId($recordId);\r\n\t\t$this->assertEquals($this->dbObjectMock, $actual);\r\n\t}", "public function getEntityId(): ?int;", "public function getEntityId(): ?int;", "public function getEntityId()\n {\n return $this->entity_id;\n }", "public function shouldReturnNotFoundWhenIdDoesNotExist()\n {\n $this->json($this->method, str_replace(':id', 123456789, $this->endpoint), [])\n ->assertNotFound();\n }", "abstract protected function _doFetch($id);", "public function testFindForId() {\n\t\t$id = 1;\n\n\t\t$result = $this->ItemsTable->findForId($id);\n\t\t$this->assertInternalType(\n\t\t\t'array',\n\t\t\t$result,\n\t\t\t'The result should always be an array.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$id,\n\t\t\t$result['id'],\n\t\t\t'The id key/value of the result for id should be equal to the id.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'Candy',\n\t\t\t$result['firstName'],\n\t\t\t'The id key/value of the result for firstName should be equal to `Candy`.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'Crush',\n\t\t\t$result['lastName'],\n\t\t\t'The id key/value of the result for lastName should be equal to `Crush`.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'Stripper',\n\t\t\t$result['occupation'],\n\t\t\t'The id key/value of the result for occupation should be equal to `Stripper`.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'1924 Sucka Drive',\n\t\t\t$result['address'],\n\t\t\t'The id key/value of the result for address should be equal to `1924 Sucka Drive`.'\n\t\t);\n\t\t\n\t}", "abstract public function find($id);", "protected function findEntity($entityId) { \n \n //SELECT * FOROM curr_dgu, his_dgu \n // WHERE id = $entityId AND his_dgu.catalog_id=$$versionId\n $entity = CurrDgu::model()->with('hisDgus')->find('t.id=:entityId AND hisDgus.catalog_id=:versionId',\n array(':entityId'=>$entityId, ':versionId'=> $this->catalog_id ));\n \n //if version does not exists, find the most reasent one\n if(is_null($entity)){\n \n //get the most resent activity\n $mostResentActiveVersion = $this->getMostResentActivatedVersionForEntity($entityId, $this->his_tableName);\n \n \n// SELECT * FOROM curr_dgu, his_dgu \n// WHERE id = $entityId AND his_dgu.catalog_id=$$versionId\n $entity = CurrDgu::model()->with('hisDgus')->find('t.id=:entityId AND hisDgus.catalog_id=:versionId',\n array(':entityId'=>$entityId, ':versionId'=> $mostResentActiveVersion['id']));\n \n }\n \n return $entity;\n }", "public function determineId() {}", "public function getBrandNameId(){\n $query = $this->getEntityManager()\n ->createQuery(\"SELECT b.id as id ,b.name as name FROM LoveThatFitAdminBundle:Brand b\");\n try {\n return $query->getResult();\n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n } \n \n }", "function jo($entity) {\n $entity->setEntityId(($entity->getEntityId() +1));\n }", "public function returnDetailFindByPK($id);", "public function hasEntityIdBeenUsed($entityid, &$message)\n {\n // Check if the entity id is already used on some other revision\n $st = $this->execute(\n 'SELECT count(*) AS count\n FROM '. self::$prefix .'entity je\n WHERE `entityid` = ?;',\n array($entityid)\n );\n\n // @todo It would be better to let db class throw an exception\n if ($st === false) {\n $message = 'error_db';\n return true;\n }\n\n $row = $st->fetchAll(PDO::FETCH_ASSOC);\n if ($row[0]['count'] > 0) {\n $message = 'error_entity_exists_other';\n return true;\n }\n\n return false;\n }", "public function findAction($id);", "public function testFindById(): void\n {\n // given\n $expectedCategory = new Category();\n $expectedCategory->setName('Test Category');\n $this->categoryRepository->save($expectedCategory);\n\n // when\n $result = $this->categoryService->findOneById($expectedCategory->getId());\n\n // then\n $this->assertEquals($expectedCategory->getId(), $result->getId());\n }", "public function test_findId() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 1]]);\n $this->assertNotNull($data);\n $this->assertEquals(1, $data[0]['SampleSet']['id']);\n $this->assertEquals(1, count($data));\n }", "public function findById() {\n // TODO: Implement findById() method.\n }", "public function testSelectRelatedObject() {\n $session = $this->getSampleProjectSession(true);\n $manager = $session->query(\n 'SELECT project.manager FROM sample_Project project WHERE project.projectId = :projectId'\n )->execute(array('projectId' => '35569',))->one();\n $this->assertEquals(99990, $manager->userId);\n }", "public function getId_entity($id_entity=null)\n {\n if ($id_entity != null && is_array($this->entity) && count($this->entity)!=0) {\n $table_name = strtolower(get_class($this));\n $query = \"SELECT * FROM $table_name WHERE id_entity = ?\";\n $req = Manager::bdd()->prepare($query);\n $req->execute([$id_entity]);\n $data = \"\";\n if ($data = $req->fetchAll(PDO::FETCH_ASSOC)) {\n$d=$data[0];\n$this->setId_entity($d['id_entity']);\n$this->setLabel($d['label']);\n$this->setDomaine($d['domaine']);\n$this->setEmail($d['email']);\n$this->setPhone_number($d['phone_number']);\n$this->setBp($d['bp']);\n$this->setLocalisation($d['localisation']);\n$this->setVille($d['ville']);\n$this->setUniqueId($d['uniqueId']);\n$this->setCreated_at($d['created_at']);\n$this->setCreated_by($d['created_by']);\n$this->setUpdate_at($d['update_at']);\n$this->setUpdate_by($d['update_by']);\n$this->entity =$data; \n return $this;\n }\n \n } else {\n return $this->id_entity;\n }\n \n }", "public function returnId($entity = null);", "public function hasArticleId(){\n return $this->_has(2);\n }", "public function searchItemById(){\n\n $this -> Conexion -> abrir();\n $this -> Conexion -> ejecutar( $this -> ProductoDAO -> searchItemById());\n $res = $this -> Conexion -> extraer();\n $this -> idProducto = $res[0];\n $this -> nombre = $res[1];\n $this -> foto = $res[2];\n $this -> descripcion = $res[3];\n $this -> precio = $res[4];\n $this -> Conexion -> cerrar();\n }", "public function getEntityId(){\n return $this->_getData(self::ENTITY_ID);\n }", "public function process($entity)\n {\n }", "public function getEntity($guid){\nif(isset($guid)){\n\t return get_entity($guid);\n}\n return false;\n}", "public function lookup($key)\r\n {\r\n\t\t// create the unique cache key of the entity\r\n \t$cacheKey = $this->getCacheKey($key);\r\n \t// check if a entity with the passed primary key is available\r\n if (array_key_exists($cacheKey, $this->_entities)) {\r\n \treturn $this->_entities[$cacheKey];\r\n }\r\n // check if the requested entity exists in cache\r\n elseif($this->getCache()->test($cacheKey)) {\r\n \treturn $this->getCache()->load($cacheKey);\r\n }\r\n // if not return null\r\n else {\r\n \treturn null;\r\n }\r\n }", "function entityID($entity){\n\t\t$entity = strtolower($entity);\n\t\t// Check local copy\n\t\tif(in_array($entity,$this->entities)) return $this->entities[$entity];\n\t\t\n\t\t// Check DB\n\t\tglobal $sess;\n\t\t$db = $sess->db();\n\t\t$entityID = $db->queryUniqueValue('SELECT id FROM `entities` WHERE `name` LIKE \\''.addslashes($entity).'\\'');\n\t\tif(!$entityID){\n\t\t\t// Create new entity\n\t\t\t$db->preparedInsert('entities',array('name'=>$entity));\n\t\t\t$entityID = $db->lastInsertedId();\n\t\t}\n\t\t// Store in local cache\n\t\t$this->entities[$entity] = $entityID;\t\n\t\treturn $entityID;\n\t}", "public function execute_and_get_ids()\n {\n }", "public function find($entity, $id) {\n if (!$this->getClient())\n $this->setError('Could not access Bullhorn API Client');\n // create query\n $request = new stdClass;\n $request->session = $this->getSessionKey();\n $request->entityName = $entity;\n $request->id = new SoapVar($id, XSD_INT, 'int', \"http://www.w3.org/2001/XMLSchema\");\n // do query\n try {\n $response = $this->getClient()->find($request);\n } catch (SoapFault $fault) {\n $this->setError($fault->getMessage());\n }\n // return\n return $response->return->dto;\n }", "public function isEntityIdInUse($entityid, &$message)\n {\n // Check if the entity id is already used on letest revision\n $st = $this->execute(\n 'SELECT count(*) AS count\n FROM '. self::$prefix .'entity je\n WHERE `entityid` = ?\n AND `revisionid` = (SELECT MAX(revisionid) FROM '.self::$prefix.'entity WHERE eid = je.eid);',\n array($entityid)\n );\n\n // @todo It would be better to let db class throw an exception\n if ($st === false) {\n $message = 'error_db';\n return true;\n }\n\n $row = $st->fetchAll(PDO::FETCH_ASSOC);\n if ($row[0]['count'] > 0) {\n $message = 'error_entity_exists';\n return true;\n }\n\n return false;\n }", "public function testDbFindById()\n {\n $test1 = is_null($this->app->db()->findById('games', 999));\n\n # One result\n $test2 = $this->app->db()->findById('games', 1)['id'] == 1;\n\n return $test1 && $test2;\n }", "public function setEntityId($entityId) {\n $this->entityId = $entityId;\n }", "public function find($entityName, $id) {\n return $this->setEntity($entityName)->entityRepository->find($id);\n }", "public function testFindPersistedEntities() {\n\t\t$table = TableRegistry::get('users');\n\t\t$table->entity = true;\n\t\t$results = $table->find('all');\n\t\t$this->assertCount(4, $results);\n\t\tforeach ($results as $article) {\n\t\t\t$this->assertFalse($article->isNew());\n\t\t}\n\t}", "abstract protected function getEntity();", "public function testGetId() {\n\t\techo (\"\\n********************Test GetId()************************************************************\\n\");\n\t\t\n\t\t$this->stubedGene->method ( 'getId' )->willReturn ( 1 );\n\t\t$this->assertEquals ( 1, $this->stubedGene->getId () );\n\t}", "abstract public function getRowId($rowEntity);", "public function actionFind()\n\t{\n\t\t$requestedId = craft()->request->getParam('id');\n\t\t// build criteria to find model\n\t\t$criteria = craft()->elements->getCriteria(ElementType::Entry);\n\t\t$criteria->id = $requestedId;\n\t\t$criteria->limit = 1;\n\t\t\n\t\t// fire !\n\t\t$entries = $criteria->find();\n\t\t$entry = count($entries) > 0 ? $entries[0] : null;\n\n\t\t// redirect if possible\n\t\tif($entry && $entry->url) {\n\n\t\t\t// build new query, but remove id from query path\n\t\t\t$newLocation = $entry->url . ( craft()->request->getParam('L') ? '?L='.craft()->request->getParam('L') : '');\n\n\t\t\theader(\"HTTP/1.1 302 Found\"); \n\t\t\theader(\"Location: \" . $newLocation); \n\t\t\texit();\n\t\t}else{\n\t\t\theader(\"HTTP/1.1 404 Not Found\");\n\t\t\theader(\"Location: /404.html\"); \n\t\t\texit();\n\t\t}\n\n\t\tcraft()->end();\n\t}", "public function beforeUpdate(&$id, \\stdClass $data, Entity $entity) { }", "public function remoteEntityExists($entity_type, $entity_id) {\n $uri = $this->getRemoteUri($entity_type, $entity_id);\n if ($this->request('head', $uri)->getStatusCode() === 200) {\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "function testFindByIdWithMissingId() {\r\n $this->User =& new User();\r\n \r\n $this->User->contain();\r\n $result = $this->User->findById(99999999, 'username');\r\n $this->assertFalse($result);\r\n }", "public function shouldGetProductWhenGivenIdExist()\n {\n $product = factory(Product::class)->create();\n\n $this->json($this->method, str_replace(':id', $product->id, $this->endpoint))\n ->assertOk()\n ->assertJsonPath('data.id', $product->id)\n ->assertJsonPath('data.short_name', $product->short_name)\n ->assertJsonPath('data.internal_code', $product->internal_code)\n ->assertJsonPath('data.customer_code', $product->customer_code)\n ->assertJsonPath('data.wire_gauge_in_bwg', $product->wire_gauge_in_bwg)\n ->assertJsonPath('data.wire_gauge_in_mm', $product->wire_gauge_in_mm);\n }", "private function getEntity($id) {\n // when the request uses the internal id the given id starts with an underscore\n if(substr($id, 0, 1) == '_') {\n // get entity via _internal_id\n return Entity::findOrFail(substr($id, 1));\n } else {\n // get entity via GIS id\n return Entity::where('id', $id)->firstOrFail();\n }\n }", "public function afterFindOneBy(array &$criteria, array &$orderBy = null, Entity $entity = null) { }", "public function find($id)\n {\n }", "public function find($id)\n {\n }", "public function find($id)\n {\n }", "protected function existingEntityId(FeedsSource $source, FeedsParserResult $result) {\n if ($id = parent::existingEntityId($source, $result)) {\n return $id;\n }\n\n // Iterate through all unique targets and test whether they do already\n // exist in the database.\n foreach ($this->uniqueTargets($source, $result) as $target => $value) {\n switch ($target) {\n case 'id':\n $id = db_query(\"SELECT id FROM {farm_asset} WHERE id = :id\", array(':id' => $value))->fetchField();\n break;\n }\n if (!empty($id)) {\n // Return with the first id found.\n return $id;\n }\n }\n return 0;\n }", "public function execute($entity);", "public function triggerBeforeFind()\n {\n if (!$this->_beforeFindFired && $this->clause('action') === self::ACTION_READ) {\n /** @var \\Muffin\\Webservice\\Model\\Endpoint $endpoint */\n $endpoint = $this->getRepository();\n $this->_beforeFindFired = true;\n $endpoint->dispatchEvent('Model.beforeFind', [\n $this,\n new ArrayObject($this->_options),\n !$this->isEagerLoaded(),\n ]);\n }\n }", "public function viewEntity($entity_id) {\n $account = $this->getAccount();\n return parent::viewEntity($account->uid);\n }", "function apachesolr_index_node_status_callback($entity_id, $entity_type, $entity = NULL) {\n if ($entity === NULL) {\n $entity = entity_load($entity_type, array($entity_id));\n $entity = $entity ? reset($entity) : FALSE;\n }\n if (empty($entity)) {\n // If the object failed to load, just stop.\n return FALSE;\n }\n // Make sure we have an integer value.\n // Anything different from 1 becomes zero\n return ($entity->status == 1 ? 1 : 0);\n}", "function verifyEntityParam($entityParam) {\n global $authorizedEntities;\n\n return array_key_exists($entityParam, $authorizedEntities);\n}", "public function test_getRecordId_called_returnCorrectly()\r\n\t{\r\n\t\t$expected = \"aDummyId\";\r\n\t\t$this->econtentRecordMock->id = $expected;\r\n\t\t$actual = $this->service->getRecordId();\r\n\t\t$this->assertEquals($expected, $actual);\r\n\t}", "public function getUserId_always_returnCorrectly()\n {\n $this->assertEquals($this->user['user_id'], $this->entity->getUserId());\n }", "public function findOneAnimalByStatusAndId($id)\n {\n \n $query = $this->getEntityManager()\n ->createQuery(\n 'SELECT animal FROM App\\Entity\\Animal AS animal \n WHERE animal.id =:id\n AND animal.status = 1 '\n )->setParameter('id',$id);\n \n return $query->getResult();\n }", "public function testQuarantineExistsGetQuarantinesidExists()\n {\n\n }", "public function findLocalId($entityName, $remoteId);", "public function hasEntity($name);", "public function getEntityId() {\n\n\t\treturn $this->id;\n\n\t}", "public function find(int $id) ;", "public function getById() {}", "public function hasId(): bool\n {\n return $this->getEntityDao()->hasId();\n }", "public function pageIdCanBeDeterminedWhileEditingARegularRecord() {}", "public function postLoad($entity);", "function entityName( $id ) ;", "protected function createEntityId($entityId = null) {\n $entity = new $this->managerName;\n $entityObject = $entity;\n $entity = $entity->toArray();\n if ($entityId) {\n $params = \"id, broadcast_segment_broadcast_type_rels.*,\";\n foreach ($this->fields as $k => $v) {\n $params .= $k . \",\";\n }\n if (in_array('can_be_deleted', array_keys($entity))) {\n $params .= \"can_be_deleted\";\n }\n $params = rtrim($params, ',');\n ManagerHolder::get($this->managerName)->clearCacheGroup();\n $entity = ManagerHolder::get($this->managerName)->getById($entityId, $params);\n if (empty($entity)) {\n redirect($this->adminBaseRoute . '/' . strtolower($this->entityUrlName));\n }\n if (!empty($entity['broadcast_types']) && !empty($entity['broadcast_segment_broadcast_type_rels'])) {\n foreach ($entity['broadcast_types'] as $k => $v) {\n $entity['broadcast_types'][$k] = array_merge($v, $entity['broadcast_segment_broadcast_type_rels'][$k]);\n }\n }\n // Decode json fields\n if (!empty($entity['last_login_filter'])) {\n $entity['last_login_filter'] = json_decode($entity['last_login_filter'], TRUE);\n }\n if (!empty($entity['receipt_type_filter'])) {\n $entity['receipt_type_filter'] = json_decode($entity['receipt_type_filter'], TRUE);\n }\n if (!empty($entity['open_type_filter'])) {\n $entity['open_type_filter'] = json_decode($entity['open_type_filter'], TRUE);\n }\n if (!empty($entity['page_visit_filter'])) {\n $entity['page_visit_filter'] = json_decode($entity['page_visit_filter'], TRUE);\n }\n }\n return $entity;\n }", "function find($entity, $model = FALSE)\n {\n $retval = NULL;\n // Get primary key of the entity\n $pkey = $this->object->get_primary_key_column();\n if (!is_numeric($entity)) {\n $entity = isset($entity->{$pkey}) ? intval($entity->{$pkey}) : FALSE;\n }\n // If we have an entity ID, then get the record\n if ($entity) {\n $results = $this->object->select()->where_and(array(\"{$pkey} = %d\", $entity))->limit(1, 0)->run_query();\n if ($results) {\n $retval = $model ? $this->object->convert_to_model($results[0]) : $results[0];\n }\n }\n return $retval;\n }", "public function fetch_the_id() {}", "public function testGettingId()\n {\n $this->assertEquals('bar', $this->principal->getId());\n }", "private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }", "public function retrieveById($identifier) {}", "public function returnExists($id);", "abstract function getId();", "public function return_existing_if_exists()\n {\n $author = factory( Author::class )->create();\n $data = array_add( $this->authorDataFormat, 'data.id', $author->id );\n\n $newAuthor = $this->dispatch( new StoreAuthor( $data ) );\n\n $this->assertEquals( $author->id, $newAuthor->id );\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\n return $this->_has(1);\n }" ]
[ "0.6783258", "0.6565709", "0.6288146", "0.62735283", "0.6072054", "0.6072054", "0.6072054", "0.59998626", "0.5986953", "0.5860847", "0.5831752", "0.5831473", "0.57355994", "0.56722146", "0.56600547", "0.559804", "0.55741805", "0.55741805", "0.5493485", "0.5434988", "0.54175717", "0.5412743", "0.5329648", "0.5325263", "0.5317356", "0.53072053", "0.52965313", "0.529483", "0.52914006", "0.5287263", "0.5286393", "0.5277849", "0.5256287", "0.525267", "0.5245237", "0.5228995", "0.52147925", "0.5213147", "0.52041197", "0.51996845", "0.5198704", "0.51959074", "0.5193561", "0.5189542", "0.518083", "0.5179314", "0.51756775", "0.51690555", "0.51549774", "0.5146328", "0.5142481", "0.5136776", "0.51219434", "0.5120914", "0.51149035", "0.5104282", "0.5104176", "0.51014036", "0.50997096", "0.5079045", "0.50737286", "0.50737286", "0.50737286", "0.5072882", "0.50585306", "0.504993", "0.5049802", "0.50485575", "0.5047078", "0.5042686", "0.50359267", "0.50323474", "0.5029892", "0.50279", "0.5022351", "0.5016845", "0.50165296", "0.5015181", "0.50021905", "0.49976787", "0.49974507", "0.49897423", "0.49849668", "0.49665684", "0.49633193", "0.49618018", "0.49604106", "0.4952572", "0.49524644", "0.49482664", "0.49471793", "0.49447373", "0.49447373", "0.49447373", "0.49447373", "0.49447373", "0.49447373", "0.49447373", "0.49447373", "0.49447373", "0.49447373" ]
0.0
-1
Set limits accordingly to
protected function setLimits() { if (!isset($this->settings->cpuLoad)) { $this->settings->cpuLoad = "low"; } $memoryLimit = self::MAX_MEMORY_RATIO; $timeLimit = self::EXECUTION_TIME_RATIO; switch ($this->settings->cpuLoad) { case "medium": $timeLimit = $timeLimit / 2; break; case "low": $timeLimit = $timeLimit / 4; break; case "fast": default: break; } $this->memoryLimit = $this->maxMemoryLimit * $memoryLimit; $this->executionLimit = $this->maxExecutionTime * $timeLimit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _setLimits() {\n\n\n\n $north = $this->_point->getRelativePoint($this->_radius, '0', $this->_unit);\n $south = $this->_point->getRelativePoint($this->_radius, '180', $this->_unit);\n\n $this->_limits['n'] = $north->lat;\n $this->_limits['s'] = $south->lat;\n\n $radDist = $this->_radius / Earth::radius($this->_unit);\n $minLat = deg2rad($this->_limits['s']);\n $maxLat = deg2rad($this->_limits['n']);\n $radLon = $this->_point->longitudeToRad();\n //if ($minLat > deg2rad(-90) && $maxLat < deg2rad(90)) {\n $deltaLon = asin(sin($radDist) / cos($this->_point->latitudeToRad()));\n $minLon = $radLon - $deltaLon;\n if ($minLon < deg2rad(-180)) {\n $minLon += 2 * pi();\n }\n $maxLon = $radLon + $deltaLon;\n if ($maxLon > deg2rad(180)){\n $maxLon -= 2 * pi();\n }\n //}\n //\n $this->_limits['w'] = rad2deg($minLon);\n $this->_limits['e'] = rad2deg($maxLon);\n }", "public function adjustMaxMin() {\r\n $tmp = new FloatRange();\r\n $this->calcMinMax($tmp);\r\n $this->minimumvalue = $tmp->min;\r\n $this->maximumvalue = $tmp->max;\r\n $this->iMaximum = $this->maximumvalue;\r\n $this->iMinimum = $this->minimumvalue;\r\n $this->internalCalcRange();\r\n }", "function setDisplayRange(&$range_limits,$total_pages,$page_index){\n\t\tdefine('PAGES_DISPLAYED',7);\n\t\tdefine('MAX_OFFSET',3);\n\t\t\n\t\tif ($total_pages <= constant('PAGES_DISPLAYED')){\n\t\t\t//range 1 to $total_pages\n\t\t\t$range_limits['min'] = 1;\n\t\t\t$range_limits['max'] = $total_pages;\n\t\t} else {//range $PAGE_NO_MAX buttons required\n\t\t\t//button moves, range is stationary\n\t\t\tif (($page_index <= constant('MAX_OFFSET')) || (($total_pages - $page_index) < constant('MAX_OFFSET'))) {\n\t\t\t\tif ($page_index <= constant('MAX_OFFSET')) {\n\t\t\t\t\t$range_limits['min'] = 1;\n\t\t\t\t\t$range_limits['max'] = constant('PAGES_DISPLAYED');\n\t\t\t\t} else {\n\t\t\t\t\t$range_limits['min'] = $total_pages - (constant('PAGES_DISPLAYED') - 1);\n\t\t\t\t\t$range_limits['max'] = $total_pages;\n\t\t\t\t}\n\t\t\t} else {//($page_index > $max_offset) && (($total_pages - $page_index) > $max_offset)\n\t\t\t\t//button stationary, range moves[$page_index +/- $max_offset] \n\t\t\t\t$range_limits['min'] = $page_index - constant('MAX_OFFSET');\n\t\t\t\t$range_limits['max'] = $page_index + constant('MAX_OFFSET');\n\t\t\t}\t\n\t\t}\n\t\treturn;\t\t\t\n\t}", "public function set_limit($limit);", "public function setLimits($offset, $limit, $max = 1000, $cutoff = 0)\n\t{\n\t\t$this->offset = $offset;\n\t\t$this->limit = $limit;\n\t\t$this->maxmatches = $max;\n\t}", "public function setBoundaries()\n {\n }", "public function set_limits($limit_x = null, $limit_y = null)\n {\n if (is_numeric($limit_x) && is_numeric($limit_y) && $limit_x > 0 && $limit_y > 0) {\n $this->limit_x = $limit_x;\n $this->limit_y = $limit_y;\n return true;\n }\n return false;\n }", "public function setLimit($x) { $this->limit = $x; }", "private function set_qb_limits(&$qb)\n {\n $this->check_request_variables();\n $qb->set_limit($this->limit);\n $qb->set_offset($this->offset);\n return;\n }", "public function set_limit($new_limit){\r\n $this->limit = $new_limit;\r\n }", "public function setMinMax($min, $max) {\r\n $this->automatic = false;\r\n $this->automaticMinimum = false;\r\n $this->automaticMaximum = false;\r\n\r\n if ($min > $max) { // swap\r\n $tmp = $min;\r\n $min = $max;\r\n $max = $tmp;\r\n }\r\n\r\n $this->internalSetMinimum($min);\r\n $this->internalSetMaximum($max);\r\n if (($this->maximumvalue - $this->minimumvalue) < self::$MINAXISRANGE) {\r\n $this->internalSetMaximum($this->minimumvalue + self::$MINAXISRANGE);\r\n }\r\n }", "private function limits()\n {\n // Calculate the links on the left (for the active link to be in the middle)\n $left = $this->current_page - round($this->max / 2);\n // Compute the reference point\n $start = $left > 0 ? $left : 1;\n // If there is at least $this-> max pages\n if ($start + $this->max <= $this->amount) {\n // Assign the end of the loop forward to $this-> max pages or just a minimum\n $end = $start > 1 ? $start + $this->max : $this->max;\n } else {\n // End - the total number of pages\n $end = $this->amount;\n // Start - minus $this-> max from the end\n $start = $this->amount - $this->max > 0 ? $this->amount - $this->max : 1;\n }\n return\n array($start, $end);\n }", "private function setLimitAndOffset()\n {\n $this->offset = ($this->page - 1) * $this->config->limit;\n if ($this->config->limit == 0) {\n $this->config->limit = count(self::$needles);\n }\n }", "private function validiate_limits() {\n\n\t\tforeach( $this->limits as $element_role => $element_limits ) {\n\t\t\tToolset_Association::validate_element_role( $element_role );\n\n\t\t\t$min = toolset_getarr( $element_limits, self::MIN, self::INVALID_VALUE );\n\t\t\t$max = toolset_getarr( $element_limits, self::MAX, self::INVALID_VALUE );\n\n\t\t\tif( $min <= self::INVALID_VALUE || $max <= self::INVALID_VALUE ) {\n\t\t\t\tthrow new InvalidArgumentException( 'Invalid cardinality value.' );\n\t\t\t}\n\n\t\t\tif( self::INFINITY != $max && $min > $max ) {\n\t\t\t\tthrow new InvalidArgumentException( 'Minimum element limit is higher than the maximum one.' );\n\t\t\t}\n\n\t\t\tif( self::ZERO_ELEMENTS == $max ) {\n\t\t\t\tthrow new InvalidArgumentException( 'Maximum element limit is zero.' );\n\t\t\t}\n\t\t}\n\n\t}", "private function checkBounds()\n {\n $this->page = max($this->page, 0);\n $this->page = min($this->page, $this->lastPage());\n }", "private function setLimit($limit)\n {\n $this->limit = (int)$limit;\n }", "public function setLimit ($value)\r\n\t{\r\n\t\t$this->limit = $value;\r\n\t}", "public function setLimit(?int $limit): void\n {\n $this->limit['value'] = $limit;\n }", "public function getLimits()\n {\n return $this->limits;\n }", "public function getLimits() {\n\t\t$limits['start'] = ($this->currentPage - 1) * $this->rowsPerPage;\n\t\t$limits['end'] = $this->currentPage * $this->rowsPerPage;\n\t\treturn $limits;\n\t}", "public function setMaxPoints($value) {}", "public final function setLimit($val1, $val2)\n {\n $this->limit['lower'] = (int) $val1;\n $this->limit['upper'] = (int) $val2;\n return $this;\n }", "public function setLimit($limit) {\n\t\t$this->limit = $limit;\n\t}", "public function setLimit(int $limit): self;", "public function setLimit($limit)\r\n {\r\n $this->limit = intval($limit);\r\n }", "public function setDataRange($limit, $offset = 0) {\n\t\t\t$this->limit = (int) $limit;\n\t\t\t$this->offset = (int) $offset;\n\t\t}", "function set_sys_limits()\n {\n if (is_numeric($this->_params->get('time_limit'))) {\n set_time_limit($this->_params->get('time_limit'));\n // avoid next execution\n // @TODO Change to static variable\n $this->_params->set('time_limit', '');\n $this->_paramsDef->set('time_limit', '');\n }\n\n if ($this->_params->get('memory_limit') != 'default') {\n ini_set(\"memory_limit\", $this->_params->get('memory_limit'));\n $this->_params->set('memory_limit', 'default');\n $this->_paramsDef->set('memory_limit', 'default');\n }\n\n }", "function setArticleCountsRange($min, $max)\n\t{\n\t\t$this->validate['articles_count']['range']['rule'][1] = $min-1;\n\t\t$this->validate['articles_count']['range']['rule'][2] = $max+1;\n\t}", "public function setLimit(int $limit): void\n {\n $this->_limit = $limit;\n }", "public function setLimit($limit) {\n $this->limit = (int)$limit;\n }", "public function setLimit(?int $limit): void\n {\n $this->limit = $limit;\n }", "public function setLimit(?int $limit): void\n {\n $this->limit = $limit;\n }", "public function setLimit($limit)\n {\n $this->limit = $limit;\n }", "public function setXMax($xMax) {}", "public function set_item_limit($limit = 0)\n {\n }", "public function setLimit(int $limit): void\n {\n $this->limit = $limit;\n }", "protected function setLimit() {\r\n if( $this->sqlLimit ) {\r\n $this->sql .= ' LIMIT ' . $this->sqlLimit;\r\n }\r\n }", "public function setYLimits($axis, $min, $max, $autoscale = false, $factor = 'auto') {\n\t\tif ($autoscale) {\n\t\t\t$diff = $max - $min;\n\t\t\tif ($factor == 'auto') {\n\t\t\t\t$factor = pow(10, round(log10($diff))-1);\n\n\t\t\t\tif ($factor > 10)\n\t\t\t\t\t$factor = 10;\n\t\t\t}\n\n\t\t\t$minScaled = $min > 0 ? max(0, $min/$factor - 0.02*$diff) : $min/$factor - 0.02*$diff;\n\t\t\t$min = floor($minScaled)*$factor;\n\t\t\t$max = ceil($max/$factor+0.02*$diff)*$factor;\n\n\t\t\t$this->setYTicks($axis, $factor);\n\t\t}\n\n\t\t$this->Options['yaxes'][$axis-1]['min'] = $min;\n\t\t$this->Options['yaxes'][$axis-1]['max'] = $max;\n\t}", "public static function setQueryLimit($limit){\t\t\n\t\t//reset the queryCount\n\t\tself::$queryCount = 0;\n\t\t\n\t\tself::$queryLimit = $limit;\n }", "function setLimit($start, $end) {\n\t\tif (!is_int($start) || !is_int($end)) {\n\t\t\tthrow new DBException(\"Limit must be integer\");\n\t\t}\n\t\t$this->start = $start;\n\t\t$this->end = $end;\n\t\treturn $this;\n\n\t}", "public function setLimit($limit){\n $this->limit = $limit;\n if ($this->total_records!=0) {\n $this->total_pages = ceil($this->total_records / $this->limit);\n }else{\n\n }\n }", "public function limit($limit)\n\t{\n\t\t$this->limit = (int) $limit;\n\t}", "private function processLimit(): void\n {\n if ($this->request->has(self::LIMIT) && null !== $this->request->get(self::LIMIT)) {\n $itemLimit = (int)$this->request->get(self::LIMIT);\n\n if ($itemLimit > 0) {\n $this->limit = $itemLimit;\n } elseif (0 === $itemLimit) {\n $this->limit = 0;\n }\n }\n }", "public function setQueryLimit($limit) {\n\t\t$this->queryLimit = (integer) $limit;\n\t}", "public function setLimit($limit) {\n\t\tif(!Validator::UnsignedNumber($limit)) throw new Exception(lang('error_98'));\n\t\t$this->_limit = $limit;\n\t}", "public function setMinMax(?int $iMin, ?int $iMax) : void\n {\n $this->iMin = $iMin ?? $this->iMin;\n $this->iMax = $iMax ?? $this->iMax;\n }", "public function clearLimits() {\r\n $this->__limits = \"\";\r\n return $this;\r\n }", "public function setLimit($limit) {\n\t$this->parseQuery->setLimit($limit);\n }", "function setLimit($limit, $offset)\n {\n if ($limit || $offset) {\n return Tree::raiseError(TREE_ERROR_DB_ERROR, null, null, 'limit is not supported by this backend');\n }\n }", "public function getLimitsArray(): array\n {\n return $this->limits;\n }", "function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function setXMaxExtent($xMaxExtent) {}", "public function resetTimeLimits()\n {\n unset($this->options['PostedAfter']);\n unset($this->options['PostedBefore']);\n }", "public function setLimit($limit)\n {\n $this->limit = $limit;\n \n $this->setTotalPages();\n }", "private function setCustomLimit()\n\t{\n\t\t$this->limit = $this->customQuery->limit ? $this->customQuery->limit : $this->queryLimit;\n\n\t\treturn $this;\n\t}", "public function unsetLimit(): void\n {\n $this->limit = [];\n }", "function limitToTypes($types) {\r\n $this->typesLimit = array();\r\n }", "private function setTimeLimits($type, $limits)\n {\n if (is_array($limits)) {\n\n $this->query[\"{$type}_relative\"]= [\n 'unit' => $limits['unit'],\n 'value' => $limits['value']\n ];\n\n } elseif(is_numeric($limits)) {\n $this->query[\"{$type}_absolute\"] = $limits;\n }\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "private function setLimits($factor = false) {\n if (!$factor) {\n $factor = $this->lines / 500;\n }\n if ($factor < 1) {\n return;\n }\n if ($factor > 20) {\n $factor = 20;\n }\n $maxmemory = 128 * $factor;\n $maxtime = 300 * $factor;\n ini_set(\"memory_limit\",$maxmemory . \"M\");\n ini_set(\"max_execution_time\", $maxtime);\n }", "public function limit(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'limit'), func_get_args());\r\n\t\treturn $this;\r\n }", "public function setCustomLimit($customLimit){\n $customLimitInt = 1;\n try{\n $customLimitInt= intval($customLimit);\n $customLimitInt = ($customLimitInt==0)?1:$customLimitInt;\n }catch (Exception $ex){\n $errorObj = new ErrorObj();\n\n $errorObj->params = \"limit\";\n $errorObj->msg = \"limit int required\";\n\n array_push($this->errorManager->errorObj,$errorObj);\n return false;\n }\n\n $this->customLimit= $customLimitInt;\n return true;\n }", "public function setLimits($mode, $lower = null, $upper = null)\n {\n try {\n if ($upper) {\n $before = $this->genTime($upper);\n } else {\n $before = $this->genTime('- 2 min');\n }\n if ($lower) {\n $after = $this->genTime($lower);\n } else {\n $after = $this->genTime('- 2 min');\n }\n if ($after > $before) {\n $after = $this->genTime($upper . ' - 150 sec');\n }\n if ($mode == 'Created') {\n $this->options['CreatedAfter'] = $after;\n if ($before) {\n $this->options['CreatedBefore'] = $before;\n }\n unset($this->options['LastUpdatedAfter']);\n unset($this->options['LastUpdatedBefore']);\n } else if ($mode == 'Modified') {\n $this->options['LastUpdatedAfter'] = $after;\n if ($before) {\n $this->options['LastUpdatedBefore'] = $before;\n }\n unset($this->options['CreatedAfter']);\n unset($this->options['CreatedBefore']);\n } else {\n $this->log('warning', 'First parameter should be either \"Created\" or \"Modified\".');\n return false;\n }\n\n } catch (\\Exception $e) {\n $this->log('error', 'Error: ' . $e->getMessage() . $this->options['LastUpdatedAfter'] . $this->options['LastUpdatedBefore'] . $e->getFile() . $e->getLine());\n return false;\n }\n\n }", "public function limit($limit)\n {\n }", "public function Limit($limit, $offset = 0) {\r\n $this->limit = (int)$limit;\r\n $this->offset = (int)$offset;\r\n }", "public function resetTimeLimits()\n {\n unset($this->options['RequestedFromDate']);\n unset($this->options['RequestedToDate']);\n }", "public function limit() : float;", "public function forceIntegerInRangeForcesIntegerIntoDefaultBoundariesDataProvider() {}", "public function get_limits()\n\t{\n\t\t$profile_start = microtime(true);\n\n\t\t$limitsData = array(\n\t\t\t\t\t'call_limit' =>\tCALL_LIMIT,\n\t\t\t\t\t'duration_limit' =>\tCALL_DURATION_LIMIT,\n\t\t\t\t\t'listing_limit' =>\tLISTING_LIMIT\n\t\t\t\t\t);\n\n\t\t$this->input->do_put($this->config->base_url.\"/api/limit\",[]);\n\n\t\tif(!empty($limitsData))\n\t\t\t$this->display->success($limitsData,'limits');\n\t\telse\n\t\t\t$this->display->error(1502);\n\n\t\t$profile_start = profiler($profile_start,__CLASS__,__FUNCTION__,'openapi');\n\t}", "private function _setSegmentMinMax($id)\n\t{\n\t\tif($id < $this->_segmentMin || !$this->_segmentMin) {\n\t\t\t$this->_segmentMin = $id;\n\t\t}\n\t\tif($id > $this->_segmentMax) {\n\t\t\t$this->_segmentMax = $id;\n\t\t}\n\t}", "function getLimit() ;", "protected function checkLimits()\n {\n if ($this->isTimeLimit() || $this->isJobLimit()) {\n $this->stop();\n }\n }", "public function setMaxValue($maxValue);", "public function get_limit();" ]
[ "0.7731031", "0.70651484", "0.7033516", "0.68895143", "0.68252325", "0.67285824", "0.66184056", "0.66021335", "0.6579789", "0.6574888", "0.65023375", "0.64781356", "0.6470008", "0.6463898", "0.6423711", "0.6326232", "0.6324432", "0.63239527", "0.6316685", "0.6306547", "0.63053584", "0.6249706", "0.61803216", "0.6170888", "0.6153275", "0.6108324", "0.61039895", "0.6097493", "0.6091023", "0.60857904", "0.60786766", "0.60786766", "0.6071668", "0.6070806", "0.6066692", "0.6053798", "0.60360324", "0.60320795", "0.600282", "0.59692717", "0.5954738", "0.5951035", "0.5928537", "0.5917901", "0.5903572", "0.5894523", "0.5893273", "0.58919024", "0.58608174", "0.58547485", "0.58061093", "0.5776991", "0.57698095", "0.5765866", "0.5760343", "0.5760015", "0.57494104", "0.5743206", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.57165474", "0.5716098", "0.5705543", "0.5703574", "0.5700461", "0.5684862", "0.5684312", "0.5672257", "0.5648421", "0.5629689", "0.5615727", "0.56149477", "0.5610275", "0.56094295", "0.5599477", "0.5581587" ]
0.70218843
3
Format bytes into ini_set favorable form
protected function formatBytes($bytes) { if ((int)$bytes < 1) { return ''; } $units = ['B', 'K', 'M', 'G']; // G since PHP 5.1.x so we are good! $bytes = (int)$bytes; $base = log($bytes) / log(1000); $pow = pow(1000, $base - floor($base)); return round($pow, 0) . $units[(int)floor($base)]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function ini_bytes($val) {\n\t\t$val = trim($val);\n\t\t$last = strtolower($val{strlen($val)-1});\n\t\tswitch ($last) {\n\t\t\t// The 'G' modifier is available since PHP 5.1.0\n\t\t\tcase 'g':\n\t\t\t\t$val *= 1024;\n\t\t\tcase 'm':\n\t\t\t\t$val *= 1024;\n\t\t\tcase 'k':\n\t\t\t\t$val *= 1024;\n\t\t}\n\t\treturn $val;\n\t}", "function elgg_get_ini_setting_in_bytes($setting) {\n\t// retrieve INI setting\n\t$val = ini_get($setting);\n\n\t// convert INI setting when shorthand notation is used\n\t$last = strtolower($val[strlen($val)-1]);\n\tswitch($last) {\n\t\tcase 'g':\n\t\t\t$val *= 1024;\n\t\tcase 'm':\n\t\t\t$val *= 1024;\n\t\tcase 'k':\n\t\t\t$val *= 1024;\n\t}\n\n\t// return byte value\n\treturn $val;\n}", "public static function iniToBytes($val)\n {\n $val = trim($val);\n\n switch (strtolower(substr($val, -1))) {\n case 'm':\n $val = (int)substr($val, 0, -1) * 1048576;\n break;\n case 'k':\n $val = (int)substr($val, 0, -1) * 1024;\n break;\n case 'g':\n $val = (int)substr($val, 0, -1) * 1073741824;\n break;\n case 'b':\n switch (strtolower(substr($val, -2, 1))) {\n case 'm':\n $val = (int)substr($val, 0, -2) * 1048576;\n break;\n case 'k':\n $val = (int)substr($val, 0, -2) * 1024;\n break;\n case 'g':\n $val = (int)substr($val, 0, -2) * 1073741824;\n break;\n default:\n break;\n }\n break;\n default:\n break;\n }\n\n return $val;\n }", "function serendipity_ini_bytesize($val) {\n if ( $val == '' )\n return 0;\n\n switch(substr($val, -1)) {\n case 'k':\n case 'K':\n return (int) $val * 1024;\n break;\n case 'm':\n case 'M':\n return (int) $val * 1048576;\n break;\n default:\n return $val;\n }\n}", "private static function iniGetBytes($val)\n {\n $val = trim(ini_get($val));\n if ($val != '') {\n $last = strtolower(\n $val{strlen($val) - 1}\n );\n } else {\n $last = '';\n }\n switch ($last) {\n // The 'G' modifier is available since PHP 5.1.0\n case 'g':\n $val *= 1024;\n case 'm':\n $val *= 1024;\n case 'k':\n $val *= 1024;\n }\n\n return $val;\n }", "function ini_get_bytes($option) {\n\tif (preg_match(\"/^([0-9]+)(|k|m|g)$/i\", ini_get($option), $match)) {\n\t\t$u = array(''=>0, 'k'=>10, 'm'=>20, 'g'=>30);\n\t\treturn (int)$match[1] << $u[strtolower(substr($match[2], 0, 1))];\n\t}\n}", "private static function iniGetBytes($val)\n {\n $val = trim(ini_get($val));\n if ($val != '') {\n $last = strtolower(\n $val[strlen($val) - 1]\n );\n } else {\n $last = '';\n }\n $val = (int) $val;\n switch ($last) {\n // The 'G' modifier is available since PHP 5.1.0\n case 'g':\n $val *= 1024;\n case 'm':\n $val *= 1024;\n case 'k':\n $val *= 1024;\n }\n\n return $val;\n }", "function ini_set(string $option, string $value): string\n{\n error_clear_last();\n $safeResult = \\ini_set($option, $value);\n if ($safeResult === false) {\n throw InfoException::createFromPhpError();\n }\n return $safeResult;\n}", "function parseINI($str) {\n list(, $data) = preg_split('/^\\\\[Data\\\\]\\\\s*$/mu', $str, 2);\n preg_match_all('/^([^=]+)=(.*)$/mu', $data, $matches);\n return array_combine(array_map('trim', $matches[1]), array_map('trim', $matches[2]));\n}", "public function parse_ini_string_base64($ini, $process_sections = false)\n {\n $lines = explode(\"\\n\", $ini);\n $ini_arr = array();\n $hashcollection = false;\n foreach ($lines as $line) {\n $line = trim($line);\n\n // comments can be skipped\n if (!$line || $line[0] == ';' || $line[0] == '#') {\n continue;\n } // collection detection\n else {\n if ($line[0] == '[' && $endline = strpos($line, ']')) {\n $collection = substr($line, 1, $endline - 1);\n $hashcollection = base64_encode($collection);\n $ini_arr[$hashcollection] = array();\n continue;\n }\n }\n\n $keyval = explode('=', $line, 2);\n $key = trim($keyval[0]);\n $hashkey = base64_encode($key);\n $value = ltrim($keyval[1]);\n if ($hashcollection !== false) {\n $ini_arr[$hashcollection][$hashkey] = $value;\n } else {\n $ini_arr[$hashkey] = $value;\n }\n }\n\n return new ini64($ini_arr, true);\n }", "protected function __resolve_ini_set($value)\n {\n foreach ($value as $key => $set) {\n ini_set($key, $set);\n }\n\n return $value;\n }", "function parse_ini_string($ini, $process_sections = false, $scanner_mode = null){\n\t\t$tempname = tempnam(sys_get_temp_dir(), 'ini');\n\t\t$fp = fopen($tempname, 'w');\n\t\tfwrite($fp, $ini);\n\t\t$ini = parse_ini_file($tempname, !empty($process_sections));\n\t\tfclose($fp);\n\t\t@unlink($tempname);\n\t\treturn $ini;\n\t}", "public static function parseIniSize($size): int\n {\n $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size.\n $size = preg_replace('/[^0-9\\.]/', '', $size); // Remove the non-numeric characters from the size.\n if ($unit && isset($unit[0])) {\n // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by.\n return round($size * pow(1024, stripos('bkmgtpezy', $unit[0])));\n } else {\n return round($size);\n }\n }", "public function setConfigFromString($string){\n $config = unserialize($string);\n if(is_array($config)) {\n foreach($config as $k=>$v) {\n $this->setOption($k,$v);\n }\n }\n }", "function return_ini_bytes($size){\n\tswitch(strtolower(substr ($size, -1))) {\n\t\tcase 'k': return (int)$size * 1024;\n\t\tcase 'm': return (int)$size * 1048576;\n\t\tcase 'g': return (int)$size * 1073741824;\n\t\tdefault: return $size;\n\t}\n}", "static function WriteINI()\n {\n $content = \"\";\n\n foreach(self::$settings as $key => $data)\n {\n if(is_array($data))\n {\n $is_section = true;\n\n foreach($data as $dataKey => $dataValues)\n {\n if(is_long($dataKey))\n {\n $is_section = false;\n break;\n }\n }\n\n $content .= \"\\n\";\n\n //Write global array value\n if(!$is_section)\n {\n foreach($data as $dataKey => $dataValue)\n {\n $content .= $key . '[] = \"' . $dataValue . '\"' . \"\\n\";\n }\n }\n\n //Write section\n else\n {\n $content .= \"[\" . $key . \"]\\n\";\n\n foreach($data as $dataKey => $dataValue)\n {\n if(is_array($dataValue))\n {\n foreach($dataValue as $dataInnerValue)\n {\n $content .= $dataKey . '[] = \"' . $dataInnerValue . '\"' . \"\\n\";\n }\n }\n else\n {\n $content .= $dataKey . ' = \"' . $dataValue . '\"' . \"\\n\";\n }\n }\n }\n\n $content .= \"\\n\";\n }\n\n //Write global value\n else\n {\n $content .= $key . ' = \"' . $data . '\"' . \"\\n\";\n }\n }\n\n file_put_contents(self::$file, $content);\n }", "public function toArray(){\n\t\treturn parse_ini_file($this->path, true);\n\t}", "function arr2ini(array $a, array $parent = array())\n\t{\n\n\t\t$out = '';\n\t\tforeach ($a as $k => $v)\n\t\t{\n\t\t\tif (is_array($v))\n\t\t\t{\n\n\t\t\t\t# Subsection case\n\t\t\t\t// Merge all the sections into one array...\n\t\t\t\t$sec = array_merge((array) $parent, (array) $k);\n\t\t\t\t// Add section information to the output\n\t\t\t\t$out .= '[' . join('.', $sec) . ']' . PHP_EOL;\n\t\t\t\t// Recursively traverse deeper\n\t\t\t\t$out .= arr2ini($v, $sec);\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\n\t\t\t\t// Plain key->value case\n\t\t\t\tif(strpos($k, \"pw\") !== false) $v = '\"'.$v.'\"';\n\t\t\t\t$out .= \"$k=$v\" . PHP_EOL;\n\n\t\t\t}\n\t\t}\n\n\t\treturn $out;\n\n\t}", "public function decodeSetOptions($list)\n {\n if (substr($list, 0, 4) == 'set(') {\n $list = substr($list, 4, -1);\n }\n $result = explode(',', $list);\n foreach ($result as &$value) {\n $value = strtr(substr($value, 1, -1), [\"''\" => \"'\", \"\\\\\\\\\" => \"\\\\\"]);\n }\n return $result;\n }", "function magictoolbox_WordPress_MagicScroll_parse_option_from_string($options) {\n $opt = array();\n\n $options = explode(\";\", $options);\n array_pop($options);\n\n foreach ($options as $value) {\n $value = trim($value);\n if (!empty($value)) {\n $value = explode(\":\", $value);\n // $opt[$value[0]] = trim($value[1]);\n $k = array_shift($value);\n $v = join(\":\",$value);\n $opt[$k] = trim($v);\n }\n }\n return $opt;\n}", "function let_to_num($v){ //This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)\n $l = substr($v, -1);\n $ret = substr($v, 0, -1);\n switch(strtoupper($l)){\n case 'P': $ret *= 1024;\n case 'T': $ret *= 1024;\n case 'G': $ret *= 1024;\n case 'M': $ret *= 1024;\n case 'K': $ret *= 1024;\n break;\n }\n return $ret;\n}", "protected function setCharacterSet() {}", "function setini($widget,$line) {\n\t global $setini;\n\t\n\t if ($setini[$line]==1) \n $setini[$line] = 0;\n\t else\n\t \t$setini[$line] = 1;\n\t\t\n\t //print_r($setini);\t\n\t}", "public function parseSet($set){\n $setStr = '';\n $str = array();\n foreach($set as $key => $val){\n $str[] = \"`$key` = \".Model::parseValue($val);\n }\n $setStr = \"set \".implode(\",\", $str);\n// echo $setStr.\"<br/>\";\n return $setStr;\n }", "function write_ini_file($path, $assoc_array)\r\n{\r\n $content = '';\r\n $sections = '';\r\n\r\n foreach ($assoc_array as $key => $item)\r\n {\r\n if (is_array($item))\r\n {\r\n $sections .= \"[{$key}]\\n\";\r\n foreach ($item as $key2 => $item2)\r\n {\r\n if (is_numeric($item2) || is_bool($item2))\r\n $sections .= $key2 . ' = '.(string)$item2.\"\\n\";\r\n else\r\n $sections .= $key2.' = \"'.$item2.'\"'.\"\\n\";\r\n } \r\n }\r\n else\r\n {\r\n if(is_numeric($item) || is_bool($item))\r\n $content .= $key.' = '.(string)$item .\"\\n\";\r\n else\r\n $content .= \"{$key} = \\\"{$item}\\\"\\n\";\r\n }\r\n } \r\n\r\n $content .= $sections;\r\n\r\n if (!$handle = fopen($path, 'w'))\r\n {\r\n return false;\r\n }\r\n \r\n if (!fwrite($handle, $content))\r\n {\r\n return false;\r\n }\r\n \r\n fclose($handle);\r\n return true;\r\n}", "private function multi_byte_string_to_array()\n {\n $this->strings = array_values(\n array_filter(\n preg_split(\"//u\",$this->string),\n \"strlen\"\n )\n );\n }", "public function smallestPossibleExample()\n {\n\n $data = [\"Section\" => [\"key\" => \"\"]];\n $ini = StringUtils::ensureLf(<<<'INI'\n[Section]\nkey = \"\"\n\nINI\n );\n\n $this->assertSame($ini, IniSerializer::serialize($data));\n $this->assertSame($data, IniSerializer::deserialize($ini));\n\n }", "public static function formatFromFixed($bytes) {}", "function funpack($format, $data){\n\t$pos=0;\n foreach ($format as $key => $len) {\n \tif(substr($key,0,4)!='skip')$result[$key] = trim(substr($data, $pos, $len));\n $pos+= $len;\n }\n return $result;\n}", "function get_phpini() {\n\tif (@function_exists('ini_get_all')) {\n\t\t$r = \"\";\n\t\tprint \"<table><tr><td><div align=center>Directive</div></td><td><div align=center>Local Value</div></td><td><div align=center>Global Value</div></td></tr>\";\n\t\tprint \"<tr><td><hr /></td><td><hr /></td><td><hr /></td></tr>\";\n\t\t\n\t\tforeach (@ini_get_all() as $key => $value)\n\t\t\t$r .= \"<tr><td>\".$key.\"</td><td><div align=center>\".check_value($value['local_value']).\"</div></td><td><div align=center>\".check_value($value['global_value']).\"</div></td></tr>\";\n\t\t\n\t\tprint $r;\n\t\tprint \"</table>\";\n\t\tprint \"<br /><br /><br /><br />\";\n\t}else\n\t\tprint \"[ERROR] <i>ini_get_all</i> NOT ACTIVE!\";\n}", "function iniwrite() {\n\t global $setini;\n\t\n\t $ini = $this->gtk_path . \"webos.ini\"; \t//echo $ini; \n\t \n if ($fp = fopen ($ini , \"wb\")) {\n\t\t\n\t\t\t\t $tow = serialize($setini) . \"<@>\";\t \n\t\t\t\t\t \n fwrite ($fp, $tow);\n fclose ($fp);\n\t\t\t\t \n\t\t $this->set_console_message(\"Writing ini settings successfully.\");\t\t\t\t \n\t\t\t\t return (true);\n\t }\n\t else {\n\t\t $this->set_console_message(\"Ini setting NOT saved !!!\");\t\t\n\t\t\t\t return (false);\n\t\t}\t\t\n\t}", "public static function fromString($ini,$sections = true,$mode = INI_SCANNER_TYPED){\n return parse_ini_string($filename,$sections,$mode);\n }", "function setValue($value)\n {\n\t\t$value = explode('|', $value);\n if($value[0] == 1){\n\t\t\t$this->_value['same'] = 1; \n\t\t\t$this->_value['size'] = array_fill(0, 4, $value[1]);\n\t\t\t$this->_value['type'] = array_fill(0, 4, $value[2]);\n\t\t\t$this->_value['color'] = array_fill(0, 4, $value[3]);\n\t\t}else{\n\t\t\t$this->_value['same'] = 0; \n\t\t\tfor($i=1,$j=0;$j<4;$i+=3,$j++){\n\t\t\t\t$this->_value['size'][$j] = $value[$i];\n\t\t\t\tif($value[$i]>0 && preg_match('/^#[a-f0-9]{6}$/i', $value[$i+1]))\n\t\t\t\t\t$this->_value['type'][$j] = $value[$i+1];\n\t\t\t\tif($value[$i]>0 && preg_match('/^#[a-f0-9]{6}$/i', $value[$i+2]))\n\t\t\t\t\t$this->_value['color'][$j] = $value[$i+2];\n\t\t\t\t\n\t\t\t}\n\t\t}\n }", "public function shorthandToBytes($val)\n\t{\n\t\t$val = trim($val);\n\t\t$last = strtolower($val[strlen($val) - 1]);\n\t\tswitch ($last) {\n\t\t\t// The 'G' modifier is available since PHP 5.1.0\n\t\t\tcase 'g':\n\t\t\t\t$val *= 1024 * 1024 * 1024;\n\t\t\t\tbreak;\n\t\t\tcase 'm':\n\t\t\t\t$val *= 1024 * 1024;\n\t\t\t\tbreak;\n\t\t\tcase 'k':\n\t\t\t\t$val *= 1024;\n\t\t\tdefault:\n\t\t}\n\t\treturn $val;\n\t}", "public static function parseSettings()\n\t{\n\t\t$settings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['sd_googlemaps']);\n\n\t\tif (!is_array($settings)) {\n\t\t\t$settings = [];\n\t\t}\n\t\treturn $settings;\n\t}", "public function testMultipleSizesAsString() {\n $this->assertEquals([\n ['width' => 200],\n ['width' => 400],\n ['width' => 600],\n ], ImageSet::parseSizesDescriptor('200,400,600'));\n }", "function ini_get(string $option): string\n{\n error_clear_last();\n $safeResult = \\ini_get($option);\n if ($safeResult === false) {\n throw InfoException::createFromPhpError();\n }\n return $safeResult;\n}", "public function clean_settings($in)\n {\n $out = array();\n\n foreach (array('time', 'limit') as $k) {\n if (!empty($in[$k])) {\n $out[$k] = absint($in[$k]);\n }\n }\n\n $out['trust_proxy'] = empty($in['trust_proxy']) ? 'off' : 'on';\n\n return $out;\n }", "function ini_safe_set($key, $value)\n{\n // some hosts disable ini_set for security \n // lets check so see if its disabled\n if(($disable_functions = ini_get('disable_functions')) !== false) {\n // if it is disabled then return as there is nothing we can do\n if(strpos($disable_functions, 'ini_set') !== false) {\n return false;\n }\n }\n\n // set it and return true if the result is not equal to false\n return (ini_set($key, $value) != false);\n}", "public function testDefaultEncodingOptionValue(): void\n {\n $config_defaults = \\Config::get(RB::CONF_KEY_ENCODING_OPTIONS);\n $this->assertEquals($config_defaults, RB::DEFAULT_ENCODING_OPTIONS);\n }", "abstract protected function setFormat();", "private function setSettings()\n {\n // Use faster compression if available\n if (Memcached::HAVE_IGBINARY) {\n $this->memcached->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_IGBINARY);\n } elseif (\\defined('Memcached::HAVE_MSGPACK') && Memcached::HAVE_MSGPACK) {\n $this->memcached->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_MSGPACK);\n }\n $this->memcached->setOption(Memcached::OPT_DISTRIBUTION, Memcached::DISTRIBUTION_CONSISTENT);\n $this->memcached->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);\n $this->memcached->setOption(Memcached::OPT_NO_BLOCK, true);\n $this->memcached->setOption(Memcached::OPT_TCP_NODELAY, true);\n $this->memcached->setOption(Memcached::OPT_COMPRESSION, false);\n $this->memcached->setOption(Memcached::OPT_CONNECT_TIMEOUT, 2);\n }", "function silent_ini_set ($name, $value)\r\n{\r\n\ttry {\r\n\t\tini_set($name, $value);\r\n\t}\r\n\tcatch (\\Throwable $e) {\r\n\t}\r\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 }", "function get_parse_ini($file)\n{\n if (!is_file($file))\n return false;\n\n $ini = file($file);\n\n // to hold the categories, and within them the entries\n $cats = array();\n\n foreach ($ini as $i) {\n if (@preg_match('/\\[(.+)\\]/', $i, $matches)) {\n $last = $matches[1];\n } elseif (@preg_match('/(.+)=(.+)/', $i, $matches)) {\n $cats[$last][trim($matches[1])] = trim($matches[2]);\n }\n }\n\n return $cats;\n\n}", "protected function setDataSetString() {\n\t\tif(!utility::isArrayEmpty($this->values)) {\n\t\t\t$this -> setProperty('chd', $this->getEncodingType().':'.$this->encodeData($this->values,',',$this->getEncodingType()));\n\t\t}\n\t}", "function sizesToArray($string){\n $sizesArray = explode(',',$string);\n $returnArray = array();\n foreach($sizesArray as $size){\n $s =explode(':',$size);\n $returnArray[] = array('size'=> $s[0], 'price' => $s[1],'quantity' => $s[2],'threshold' => $s[3]);\n }\n return $returnArray;\n}", "public function testMultipleSizesAsStringWrappedInArray() {\n $this->assertEquals([\n ['width' => 200],\n ['width' => 400],\n ['width' => 600],\n ], ImageSet::parseSizesDescriptor(['200,400,600']));\n }", "public function parseSettings($settings) {\n # already array?\n if (!is_string($settings)) {\n return $settings;\n }\n $parts = explode(',', trim($settings));\n $s = array();\n foreach ($parts as $k => $v) {\n $kv = explode('=', trim($v));\n # convert all key values to lowercase to ease against simple typos\n $key = strtolower(trim($kv[0]));\n $s[$key] = trim($kv[1]);\n }\n return $s;\n }", "function wp_is_ini_value_changeable($setting)\n {\n }", "protected function getLimitFromIni() {\n\t\treturn ( integer ) trim ( str_replace ( \"M\", \"\", ini_get ( 'memory_limit' ) ) );\n\t}", "public function __construct(){\n\t\t$this->_file = BP.'/settings.ini';\n\t\t$config_file = $this->_file;\n\t\tif(!file_exists($config_file)){\n\t\t\tthrow new \\Exception('The file '. basename($config_file) .' does not existed or cannot readable permission, please check in '. BP);\n\t\t}\n\t\t$setting_content = '';\n\t\t//read line\n\t\t$this->_handle = fopen($config_file, \"r+\");\n\t\tif ($this->_handle) {\n\t\t\twhile (($line = fgets($this->_handle)) !== false) {\n\t\t\t\t// process the line read.\n\t\t\t\tif(strpos(trim($line), '#') === 0){\n\t\t\t\t\tcontinue; //ignore comment line\n\t\t\t\t}\n\t\t\t\t//connect string content\n\t\t\t\tif($line != ''){\t\t\t\n\t\t\t\t\t$setting_content .= $line;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfclose($this->_handle); //destroy handle file opening\n\t\t\t\n\t\t\t$this->_settings = json_decode($setting_content, true); //converted into associative arrays\n\t\t\tif($setting_content != '' && $this->_settings == null && ($json_error = json_last_error()) != JSON_ERROR_NONE){\n\t\t\t\tswitch ($json_error) {\n\t\t\t\t\tcase JSON_ERROR_NONE:\n\t\t\t\t\t\t$json_error = ''; // JSON is valid // No error has occurred\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_DEPTH:\n\t\t\t\t\t\t$json_error = 'The maximum stack depth has been exceeded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_STATE_MISMATCH:\n\t\t\t\t\t\t$json_error = 'Invalid or malformed JSON.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_CTRL_CHAR:\n\t\t\t\t\t\t$json_error = 'Control character error, possibly incorrectly encoded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_SYNTAX:\n\t\t\t\t\t\t$json_error = 'Syntax error, malformed JSON.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// PHP >= 5.3.3\n\t\t\t\t\tcase JSON_ERROR_UTF8:\n\t\t\t\t\t\t$json_error = 'Malformed UTF-8 characters, possibly incorrectly encoded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// PHP >= 5.5.0\n\t\t\t\t\tcase JSON_ERROR_RECURSION:\n\t\t\t\t\t\t$json_error = 'One or more recursive references in the value to be encoded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// PHP >= 5.5.0\n\t\t\t\t\tcase JSON_ERROR_INF_OR_NAN:\n\t\t\t\t\t\t$json_error = 'One or more NAN or INF values in the value to be encoded.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JSON_ERROR_UNSUPPORTED_TYPE:\n\t\t\t\t\t\t$json_error = 'A value of a type that cannot be encoded was given.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$json_error = 'Unknown JSON error occured.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthrow new \\Exception($json_error.PHP_EOL);\n\t\t\t}\n\t\t} else {\n\t\t\t// error opening the file.\n\t\t\tthrow new \\Exception('The file '. basename($config_file) .' opening error');\n\t\t}\n\t}", "function size_format($bytes, $decimals = 0)\n {\n }", "private function getSettings() {\n\t\t$code = (version_compare(VERSION, '3.0', '<') ? '' : $this->type . '_') . $this->name;\n\t\t\n\t\t$settings = array();\n\t\t$settings_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"setting WHERE `code` = '\" . $this->db->escape($code) . \"' ORDER BY `key` ASC\");\n\t\t\n\t\tforeach ($settings_query->rows as $setting) {\n\t\t\t$value = $setting['value'];\n\t\t\tif ($setting['serialized']) {\n\t\t\t\t$value = (version_compare(VERSION, '2.1', '<')) ? unserialize($setting['value']) : json_decode($setting['value'], true);\n\t\t\t}\n\t\t\t$split_key = preg_split('/_(\\d+)_?/', str_replace($code . '_', '', $setting['key']), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\t\t\t\n\t\t\t\tif (count($split_key) == 1)\t$settings[$split_key[0]] = $value;\n\t\t\telseif (count($split_key) == 2)\t$settings[$split_key[0]][$split_key[1]] = $value;\n\t\t\telseif (count($split_key) == 3)\t$settings[$split_key[0]][$split_key[1]][$split_key[2]] = $value;\n\t\t\telseif (count($split_key) == 4)\t$settings[$split_key[0]][$split_key[1]][$split_key[2]][$split_key[3]] = $value;\n\t\t\telse \t\t\t\t\t\t\t$settings[$split_key[0]][$split_key[1]][$split_key[2]][$split_key[3]][$split_key[4]] = $value;\n\t\t}\n\t\t\n\t\treturn $settings;\n\t}", "private function setini() {\n ini_set('upload_max_filesize', '20M');\n //Increase execution time to 2 minutes\n ini_set('max_execution_time' , '3000');\n //Maximum time to allow parsing\n ini_set('max_input_time', '180');\n //Increase the size of possible post requests. Should be >= upload_max_filesize\n ini_set('post_max_size', '20M');\n\t //Increase the amount of Memory at PHPs disposal\n\t ini_set('memory_limit', '1256M');\t \t\n\t}", "public function getINIEntries()\n {\n }", "public function setInfo($info, $encoding = 'UTF-8') {}", "function load_settings(){\n $ret = array();\n $c = $this->_files->readfile($this->_settings_file);\n if( $c !== false ){\n $c = explode( \"\\n\", eol($c));\n foreach( $c as $line ){\n //ignore a lot of stuff - quick hack for now\n if(substr($line, 0, 1) != '#'\n && trim($line) != ''\n && substr($line, 0, 4) != 'LANG'\n && substr($line, 0, 1) != '#'\n && substr($line, 0, 11) != 'export LANG'\n && substr($line, 0, 4) != 'bold'\n && substr($line, 0, 6) != 'normal' ){\n $set = explode('=', $line);\n $ret[$set[0]] = trim($set[1], '\"\\''); //this should now be one setting per key with setting name as key\n }\n }\n\n if( count($ret) > 0 ){\n $_SESSION['settings.conf'] = $ret;\n return $_SESSION['settings.conf'];\n }\n }else{\n unset($_SESSION['settings.conf']);\n return false;\n }\n }", "function PMA_formatByteDown($value, $limes = 6, $comma = 0)\r\n{\r\n $dh = pow(10, $comma);\r\n $li = pow(10, $limes);\r\n $return_value = $value;\r\n $unit = $byteunits[0];\r\n\t$byteunits = array('Byte', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB');\r\n\t$number_thousands_separator = ',';\r\n\t$number_decimal_separator = '.';\r\n\r\n for ( $d = 6, $ex = 15; $d >= 1; $d--, $ex-=3 ) {\r\n if (isset($byteunits[$d]) && $value >= $li * pow(10, $ex)) {\r\n $value = round($value / ( pow(1024, $d) / $dh) ) /$dh;\r\n $unit = $byteunits[$d];\r\n break 1;\r\n } // end if\r\n } // end for\r\n\r\n if ($unit != $byteunits[0]) {\r\n $return_value = number_format($value, $comma, $number_decimal_separator, $number_thousands_separator);\r\n } else {\r\n $return_value = number_format($value, 0, $number_decimal_separator, $number_thousands_separator);\r\n }\r\n\r\n return array($return_value, $unit);\r\n}", "public function ParseIniString($string)\r\n\t{\r\n\t\tif(!function_exists(\"parse_ini_string\"))\r\n\t\t{\r\n\t\t\tif(($tmp = tempnam(md5(time().\"&\".$_SERVER['HTTP_HOST'].\"&\".mt_rand()), \"tmp\")))\r\n\t\t\t{\r\n\t\t\t\tif(($fp = fopen($tmp, \"w\")))\r\n\t\t\t\t{\r\n\t\t\t\t\tfwrite($fp, $string);\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\r\n\t\t\t\t\t$parseString = parse_ini_file($tmp, TRUE);\r\n\t\t\t\t\tunlink($tmp); unset($string);\r\n\t\t\t\r\n\t\t\t\t\treturn $parseString;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn parse_ini_string($string, TRUE);\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "function iniread() {\n\n\t $ini = $this->gtk_path . \"webos.ini\"; \n\t \n\t if (file_exists($ini)) {\n\t \n if ($fp = fopen ($ini , \"r\")) {\n $data = fread ($fp, filesize($ini));\n fclose ($fp);\n\t }\t \t \n \n\t\t if ($data) {\t \n \t\t $sets = explode(\"<@>\",$data);\n\t\t $myini = unserialize($sets[0]);\n\t\t }\n\t\t else {\n\t\t $myini = array();\n\t\t }\n\t //print_r($myini);\t\t \n\t\t //$this->console->write(\"Reading ini settings successfully.\");\t\t\t\t \n\t\t return ($myini);\n\t }\n\t else {\n\t\t //$this->console->write(\"Ini setting NOT readed !!!\");\t\t\n\t\t return (false);\n\t\t}\t\n\t}", "public function settings_options_format( $setting )\n\t\t{\n\t\t\tif ( empty( $setting ) ) return false;\n\n\t\t\t$defaults = apply_filters( $this->id . '_options_defaults', array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'name' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'desc' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'placeholder' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'class' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'tip' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'id' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'css' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'type' => 'text',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'std' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'select2' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'multiple' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'options' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'restrict' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'settings' => array()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\n\t\t\t// Each to it's own variable for slim-ness' sakes.\n\t\t\t$setting = shortcode_atts( $defaults, $setting ); //$setting la array chua tat ca cac key=>value cua setting va defauls\n\n\t\t\t$restrict_defaults = array(\n\t\t\t\t'min' => 0,\n\t\t\t\t'max' => '',\n\t\t\t\t'step' => 'any',\n\t\t\t);\n\n\t\t\t$setting[ 'restrict' ] = shortcode_atts( $restrict_defaults, $setting[ 'restrict' ] );\n\n\t\t\t$setting[ 'value' ] = $this->get_option( $setting[ 'id' ] ); // get value cua id\n\t\t\t$setting[ 'value' ] = $setting[ 'value' ] !== false ? maybe_unserialize( $setting[ 'value' ] ) : false;\n\t\t\t$setting[ 'value' ] = SF_Format_Options::sanitize_value( $setting[ 'value' ], $setting );\n\n\t\t\t$setting[ 'title' ] = $setting[ 'name' ];\n\t\t\t$setting[ 'name' ] = $this->id . \"_options[{$setting['id']}]\";\n\n\t\t\t$setting[ 'grouped' ] = !$setting[ 'title' ] ? ' style=\"padding-top:0px;\"' : '';\n\t\t\t$setting[ 'tip' ] = SF_Format_Options::get_formatted_tip( $setting[ 'tip' ] );\n\n\t\t\t$header_types = apply_filters( $this->id . '_options_header_types', array( 'heading', 'title' ) );\n\n\t\t\textract( $setting );\n\t\t\t\n\t\t\t$description = $desc && !$grouped && $type != 'checkbox'\n\t\t\t\t? '<br /><small>' . $desc . '</small>'\n\t\t\t\t: '<label for=\"' . $id . '\"> ' . $desc . '</label>';\n\n\t\t\t$description = ( ( in_array( $type, $header_types ) || $type == 'radio' ) && !empty( $desc ) )\n\t\t\t\t? '<p>' . $desc . '</p>'\n\t\t\t\t: $description;\n\n\t\t\t?>\n\n\t\t\t<?php if ( !in_array( $type, $header_types ) ) : ?>\n\t\t\t<!-- Header of the option. -->\n\t\t\t<tr valign=\"top\">\n\t\t\t<th scope=\"row\"<?php echo $grouped; ?>>\n\n\t\t\t\t<?php echo $tip; ?>\n\n\t\t\t\t<?php if ( !$grouped ) : ?>\n\t\t\t\t\t<label for=\"<?php echo $name; ?>\" class=\"description\"><?php echo $title; ?></label>\n\t\t\t\t<?php endif; ?>\n\n\t\t\t</th>\n\t\t\t<td <?php echo $grouped; ?> >\n\t\t<?php endif; ?>\n\n\t\t\t<?php foreach ( $header_types as $header ) :\n\t\t\tif ( $type != $header ) continue; ?>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"col\" colspan=\"2\">\n\t\t\t\t\t<h3 class=\"title\"><?php echo $title; ?></h3>\n\t\t\t\t\t<?php echo $description; ?>\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t<?php endforeach; ?>\n\n\t\t\t<?php switch ( $type ) :\n\n\t\t\tcase 'text' :\n\t\t\tcase 'color' :\n\t\t\tcase 'number' :\n\t\t\t\tif ( $type == 'color' ) {\n\t\t\t\t\t$type = 'text';\n\t\t\t\t\t$class .= ' colorpick';\n\t\t\t\t\t$description .= '<div id=\"colorPickerDiv_' . $id . '\" class=\"colorpickdiv\" style=\"z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;\"></div>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<input name=\"<?php echo $name; ?>\"\n\t\t\t\t\t id=\"<?php echo $id; ?>\"\n\t\t\t\t\t type=\"<?php echo $type; ?>\"\n\n\t\t\t\t\t<?php if ( $type == 'number' ): ?>\n\t\t\t\t\t\tmin=\"<?php echo $restrict[ 'min' ]; ?>\"\n\t\t\t\t\t\tmax=\"<?php echo $restrict[ 'max' ]; ?>\"\n\t\t\t\t\t\tstep=\"<?php echo $restrict[ 'step' ]; ?>\"\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t class=\"regular-text <?php echo $class; ?>\"\n\t\t\t\t\t style=\"<?php echo $css; ?>\"\n\t\t\t\t\t placeholder=\"<?php echo $placeholder; ?>\"\n\t\t\t\t\t value=\"<?php echo $value !== false ? $value : $std; ?>\"\n\t\t\t\t\t/>\n\t\t\t\t<?php echo $description;\n\t\t\t\tbreak;\n\n\t\t\tcase 'checkbox':\n\n\t\t\t\t$selected = ( $value !== false ) ? $value : $std;\n\n\t\t\t\tif ( $multiple ) :\n\n\t\t\t\t\tforeach ( $options as $key => $desc ) : ?>\n\n\t\t\t\t\t\t<input name=\"<?php echo $name; ?><?php echo $multiple ? '[]' : ''; ?>\"\n\t\t\t\t\t\t\t id=\"<?php echo $id . '_' . $key; ?>\"\n\t\t\t\t\t\t\t type=\"checkbox\"\n\t\t\t\t\t\t\t class=\"<?php echo $class; ?>\"\n\t\t\t\t\t\t\t style=\"<?php echo $css; ?>\"\n\t\t\t\t\t\t\t value=\"<?php echo $key; ?>\"\n\t\t\t\t\t\t\t<?php self::checked( $value, $key ); ?>\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t<label for=\"<?php echo $id . '_' . $key; ?>\">\n\t\t\t\t\t\t\t<?php echo $desc; ?>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t<br/>\n\t\t\t\t\t<?php\n\n\t\t\t\t\tendforeach;\n\n\t\t\t\telse : ?>\n\n\t\t\t\t\t<input name=\"<?php echo $name; ?>\"\n\t\t\t\t\t\t id=\"<?php echo $id ?>\"\n\t\t\t\t\t\t type=\"checkbox\"\n\t\t\t\t\t\t class=\"<?php echo $class; ?>\"\n\t\t\t\t\t\t style=\"<?php echo $css; ?>\"\n\t\t\t\t\t\t<?php checked( $selected, 1 ); ?>\n\t\t\t\t\t\t/>\n\t\t\t\t\t<?php echo $description;\n\t\t\t\tendif;\n\t\t\t\tbreak;\n\n\t\t\tcase 'radio':\n\n\t\t\t\t$selected = ( $value !== false ) ? $value : $std;\n\n\t\t\t\tforeach ( $options as $key => $val ) : ?>\n\t\t\t\t\t<label class=\"radio\">\n\t\t\t\t\t\t<input type=\"radio\"\n\t\t\t\t\t\t\t name=\"<?php echo $name; ?>\"\n\t\t\t\t\t\t\t id=\"<?php echo $key; ?>\"\n\t\t\t\t\t\t\t value=\"<?php echo $key; ?>\"\n\t\t\t\t\t\t\t class=\"<?php echo $class; ?>\"\n\t\t\t\t\t\t\t<?php checked( $selected, $key ); ?>\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t<?php echo $val; ?>\n\t\t\t\t\t</label><br/>\n\t\t\t\t<?php endforeach;\n\t\t\t\techo $description;\n\t\t\t\tbreak;\n\n\t\t\tcase 'single_select_page':\n\n\t\t\t\t$selected = ( $value !== false ) ? $value : $std;\n\n\t\t\t\t$args = array(\n\t\t\t\t\t'name' => $name,\n\t\t\t\t\t'id' => $id,\n\t\t\t\t\t'sort_order' => 'ASC',\n\t\t\t\t\t'echo' => 0,\n\t\t\t\t\t'selected' => $selected\n\t\t\t\t);\n\n\t\t\t\techo str_replace( \"'>\", \"'><option></option>\", wp_dropdown_pages( $args ) );\n\n\t\t\t\techo $description;\n\n\t\t\t\tif ( $select2 ) : ?>\n\t\t\t\t\t<script type=\"text/javascript\">jQuery(function () {\n\t\t\t\t\t\t\tjQuery(\"#<?php echo $id; ?>\").select2({ allowClear: true, placeholder: \"<?php _e( 'Select a page...', 'topgroupshops' ); ?>\", width: '350px' });\n\t\t\t\t\t\t});</script>\n\t\t\t\t<?php endif;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'select':\n\n\t\t\t\t$selected = ( $value !== false ) ? $value : $std;\n\t\t\t\t$options = apply_filters( $this->id . '_select_options', $options, $setting ); ?>\n\n\t\t\t\t<select id=\"<?php echo $id; ?>\"\n\t\t\t\t\t\tclass=\"<?php echo $class; ?>\"\n\t\t\t\t\t\tstyle=\"<?php echo $css; ?>\"\n\t\t\t\t\t\tname=\"<?php echo $name; ?><?php echo $multiple ? '[]' : ''; ?>\"\n\t\t\t\t\t<?php echo $multiple ? 'multiple=\"multiple\"' : ''; ?>>\n\n\t\t\t\t\t<?php foreach ( $options as $key => $val ) : ?>\n\t\t\t\t\t\t<option\n\t\t\t\t\t\t\tvalue=\"<?php echo $key; ?>\" <?php self::selected( $selected, $key ); ?>><?php echo $val; ?></option>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</select>\n\n\t\t\t\t<?php echo $description;\n\n\t\t\t\tif ( $select2 ) : ?>\n\t\t\t\t\t<script type=\"text/javascript\">jQuery(function () {\n\t\t\t\t\t\t\tjQuery(\"#<?php echo $id; ?>\").select2({ width: '350px' });\n\t\t\t\t\t\t});</script>\n\t\t\t\t<?php endif;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'textarea':\n\t\t\t\t?>\n\t\t\t\t<textarea name=\"<?php echo $name; ?>\"\n\t\t\t\t\t\t id=\"<?php echo $id; ?>\"\n\t\t\t\t\t\t class=\"large-text <?php echo $class; ?>\"\n\t\t\t\t\t\t style=\"<?php if ( $css ) echo $css; else echo 'width:300px;'; ?>\"\n\t\t\t\t\t\t placeholder=\"<?php echo $placeholder; ?>\"\n\t\t\t\t\t\t rows=\"3\"\n\t\t\t\t\t><?php echo ( $value !== false ) ? $value : $std; ?></textarea>\n\t\t\t\t<?php echo $description;\n\t\t\t\tbreak;\n\n\t\t\tcase 'wysiwyg':\n\t\t\t\twp_editor( $value, $id, array( 'textarea_name' => $name ) );\n\t\t\t\techo $description;\n\t\t\t\tbreak;\n\n\t\t\tdefault :\n\t\t\t\tdo_action( $this->id . '_options_type_' . $type, $setting );\n\t\t\t\tbreak;\n\n\t\tendswitch;\n\n\t\t\t/* Footer of the option. */\n\t\t\tif ( !in_array( $type, $header_types ) ) echo '</td></tr>';\n\n\t\t}", "private function generate_options(array &$string_arr = null) {\n $options = array('directories' => null,\n 'type' => 'yaml');\n $types = array('d' => 'directories',\n 't' => 'types');\n \n if ($string_arr === null) {\n return $options;\n }\n \n foreach ($string_arr as $string) {\n // removes initial '-'\n $string = substr($string, 1);\n \n $opttype = self::getChar($string, 0);\n $string = substr($string, 2);\n \n $opttype == 'd' ?\n $options[$types[$opttype]] = explode(' ', $string) :\n $options[$types[$opttype]] = $string;\n }\n \n if ($options['type'] != 'yaml' || $options['type'] != 'xml') {\n \t$sertype = $options['type'];\n throw new Exception(\"Serialization type $sertype not supported.\");\n }\n return $options;\n }", "public function getNormalizedIniPostMaxSize()\n {\n return strtoupper(trim(ini_get('post_max_size')));\n }", "public function options($array = true)\n {\n\n $data = json_decode($this->session->get('izime.options'), $array);\n $numItems = count($data);\n $i = 0;\n $qut=\"'\";\n $fcode=\"\";\n foreach ($data as $key => $value) {\n\n if(++$i === $numItems) {\n if(gettype( $value == \"string\" ))\n $fcode.= $key. \":\". $qut . $value. $qut ;\n else\n $fcode.= $key. \":\". $value ;\n\n }else {\n\n if(gettype( $value == \"string\" ))\n $fcode.= $key. \":\" . $qut . $value . $qut . \",\";\n else\n $fcode.= $key. \":\" . $value . \",\";\n\n }\n\n }\n\n return $fcode ;\n\n }", "protected function fixPersonalDictionaryCharacterSet() {}", "private function _parsePlain()\n {\n $data = @parse_ini_string( $this->input, true );\n\n if( is_array( $data ) )\n {\n $_REQUEST = array_merge( $_GET, $data );\n return true;\n }\n return false;\n }", "function ini_safe_set($key, $value) {\n\t// some hosts disable ini_set for security \n\t// lets check so see if its disabled\n\tif(($disable_functions = ini_get('disable_functions')) !== false) {\n\t\t// if it is disabled then return as there is nothing we can do\n\t\tif(strpos($disable_functions, 'ini_set') !== false) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// lets set it because we can!\n\treturn ini_set($key, $value);\n}", "function utf8enc($array) {\n if (!is_array($array)) return;\n $helper = array();\n foreach ($array as $key => $value) $helper[utf8_decode($key)] = is_array($value) ? utf8enc($value) : utf8_decode($value);\n return $helper;\n }", "public function prepare_icon_set() {\n\n\t\t\tif ( empty( $this->settings['icon_data']['icons'] ) ) {\n\t\t\t\t$this->maybe_parse_set_from_css();\n\t\t\t}\n\n\t\t\tif ( ! array_key_exists( $this->settings['icon_data']['icon_set'], self::$sets ) ) {\n\t\t\t\tself::$sets[ $this->settings['icon_data']['icon_set'] ] = array(\n\t\t\t\t\t'iconCSS' => $this->settings['icon_data']['icon_css'],\n\t\t\t\t\t'iconBase' => $this->settings['icon_data']['icon_base'],\n\t\t\t\t\t'iconPrefix' => $this->settings['icon_data']['icon_prefix'],\n\t\t\t\t\t'icons' => $this->settings['icon_data']['icons'],\n\t\t\t\t);\n\t\t\t}\n\t\t}", "private function _convertSettings(&$settings)\n {\n foreach ($settings as $item => $val) {\n\n if (substr($item, 0, 6) == 'allow_') {\n $settings[$item] = ($val == 0) ? false : true;\n }\n }\n\n $settings['exclude'] = explode(',', $settings['exclude']);\n if (strlen($settings['exclude'][0]) > 0) {\n $settings['exclude'] = array_merge($settings['exclude'], self::$exclude);\n } else {\n $settings['exclude'] = self::$exclude;\n }\n\n return $settings;\n }", "function cfgArray2CfgString($cfgArr) {\r\n\r\n // Initialize:\r\n $inLines = array();\r\n\r\n // Traverse the elements of the form wizard and transform the settings into configuration code.\r\n foreach($cfgArr as $vv) {\r\n if ($vv['comment']) {\r\n // If \"content\" is found, then just pass it over.\r\n $inLines[] = trim($vv['comment']);\r\n } else {\r\n // Begin to put together the single-line configuration code of this field:\r\n\r\n // Reset:\r\n $thisLine = array();\r\n\r\n // Set Label:\r\n $thisLine[0] = str_replace('|', '', $vv['label']);\r\n\r\n // Set Type:\r\n if ($vv['type']) {\r\n $thisLine[1] = ($vv['required']?'*':'').str_replace(',', '', ($vv['fieldname']?$vv['fieldname'].'=':'').$vv['type']);\r\n\r\n // Default:\r\n $tArr = array('', '', '', '', '', '');\r\n switch((string)$vv['type']) {\r\n case 'textarea':\r\n if (intval($vv['cols'])) $tArr[0] = intval($vv['cols']);\r\n if (intval($vv['rows'])) $tArr[1] = intval($vv['rows']);\r\n if (trim($vv['extra'])) $tArr[2] = trim($vv['extra']);\r\n if (strlen($vv['specialEval'])) {\r\n $thisLine[2] = '';\r\n // Preset blank default value so position 3 can get a value...\r\n $thisLine[3] = $vv['specialEval'];\r\n }\r\n break;\r\n case 'input':\r\n case 'password':\r\n if (intval($vv['size'])) $tArr[0] = intval($vv['size']);\r\n if (intval($vv['max'])) $tArr[1] = intval($vv['max']);\r\n if (strlen($vv['specialEval'])) {\r\n $thisLine[2] = '';\r\n // Preset blank default value so position 3 can get a value...\r\n $thisLine[3] = $vv['specialEval'];\r\n }\r\n break;\r\n case 'file':\r\n if (intval($vv['size'])) $tArr[0] = intval($vv['size']);\r\n break;\r\n case 'select':\r\n if (intval($vv['size'])) $tArr[0] = intval($vv['size']);\r\n if ($vv['autosize']) $tArr[0] = 'auto';\r\n if ($vv['multiple']) $tArr[1] = 'm';\r\n\r\n }\r\n $tArr = $this->cleanT($tArr);\r\n if (count($tArr)) $thisLine[1] .= ','.implode(',', $tArr);\r\n\r\n $thisLine[1] = str_replace('|', '', $thisLine[1]);\r\n\r\n // Default:\r\n if ($vv['type'] == 'select' || $vv['type'] == 'radio') {\r\n $thisLine[2] = str_replace(chr(10), ', ', str_replace(',', '', $vv['options']));\r\n } elseif ($vv['type'] == 'checkbox') {\r\n if ($vv['default']) $thisLine[2] = 1;\r\n } elseif (strcmp(trim($vv['default']), '')) {\r\n $thisLine[2] = $vv['default'];\r\n }\r\n if (isset($thisLine[2])) $thisLine[2] = str_replace('|', '', $thisLine[2]);\r\n }\r\n\r\n // Compile the final line:\r\n $inLines[] = ereg_replace(\"[\\n\\r]*\", '', implode(' | ', $thisLine));\r\n }\r\n }\r\n // Finally, implode the lines into a string, and return it:\r\n return implode(chr(10), $inLines);\r\n }", "function tidy_parse_string($input, $config = null, $encoding = null) {}", "protected function _parseOptions ($data) {\n $mode = 0;\n $section = '';\n $values = array ();\n\n # Character classes\n $letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $digits = '0123456789';\n $sectionchar = $letters . $digits . '_-.';\n $separatorchar = $sectionchar;\n\n # Convert Mac and MS-DOS line-feeds into Unix line-feeds. This\n # simplifies code below.\n $data = preg_replace ('/\\r\\n|\\r/', \"\\n\", $data);\n\n # Read line of data into buffer\n $i = 0;\n $n = strlen ($data);\n $done = false;\n while (!$done) {\n\n # Peek next character\n if ($i < $n) {\n $c = substr ($data, $i, 1);\n } else {\n $c = 'EOF';\n }\n\n # Deal with line\n switch ($mode) {\n case 0:\n # Initial mode\n switch ($c) {\n case ' ':\n case \"\\n\":\n case \"\\t\":\n # Ignore white space\n $i += strspn ($data, \" \\n\\t\", $i);\n break;\n\n case '[':\n # Start of section name\n $mode = 100;\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Not a comment\n $mode = 999;\n }\n break;\n\n case 'EOF':\n # Normal end of file\n $done = true;\n break;\n\n case ';':\n # Ignore\n $i++;\n break;\n\n default:\n if (strpos ($letters, $c) !== false) {\n # Option name\n $mode = 200;\n } else {\n # Invalid character\n $mode = 999;\n }\n }\n break;\n\n case 100:\n # Start of section name\n $i++;\n $section = '';\n $mode = 101;\n break;\n\n case 101:\n # Section name continued\n switch ($c) {\n case ']':\n # End of section name\n $mode = 0;\n $i++;\n break;\n\n case 'EOF':\n # Unexpected end of file\n $mode = 998;\n break;\n\n default:\n $len = strspn ($data, $sectionchar, $i);\n if ($len > 0) {\n # Character in section name\n $section .= substr ($data, $i, $len);\n $i += $len;\n } else {\n # Invalid character\n $mode = 999;\n }\n }\n break;\n\n case 200:\n # Start of option name\n $key = '';\n $value = '';\n $mode = 201;\n /*FALLTHROUGH*/\n\n case 201:\n # Option name continued\n switch ($c) {\n case ':':\n case '=':\n # Start of value\n $i++;\n $mode = 300;\n break;\n\n case ' ':\n case \"\\t\":\n # End of option name\n $mode = 202;\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Not a comment\n $mode = 999;\n }\n break;\n\n case \"\\n\":\n # Option name does not end in colon\n $mode = 999;\n break;\n\n case 'EOF':\n # Unexpected end of file\n $mode = 998;\n break;\n\n default:\n $len = strspn ($data, $letters . $digits, $i);\n if ($len > 0) {\n # Option name\n $key .= substr ($data, $i, $len);\n $i += $len;\n } else {\n # Invalid character\n $mode = 999;\n }\n }\n break;\n\n case 202:\n # Space after option name\n switch ($c) {\n case ':':\n case '=':\n # Start of value\n $i++;\n $mode = 300;\n break;\n\n case ' ':\n case \"\\t\":\n # Ignore white space\n $i += strspn ($data, \" \\t\", $i);\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Not a comment\n $mode = 999;\n }\n break;\n\n case \"\\n\":\n # Option name does not end in colon\n $mode = 999;\n break;\n\n case 'EOF':\n # Unexpected end of file\n $mode = 998;\n break;\n\n default:\n # Invalid character\n $mode = 999;\n }\n break;\n\n case 300:\n # Space before option value\n switch ($c) {\n case ' ':\n case \"\\t\":\n # Ignore white space before value\n $i += strspn ($data, \" \\t\", $i);\n break;\n\n case ';':\n case \"\\n\":\n # Line feed means no value\n $i++;\n /*FALLTHROUGH*/\n\n case 'EOF':\n # No value provided\n $mode = 398;\n break;\n\n case '\"':\n # Start of quoted string\n $i++;\n $mode = 320;\n break;\n\n case '<':\n # Start of multiline-data\n $i++;\n $mode = 330;\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Not a comment\n $mode = 999;\n }\n break;\n\n default:\n # Start of unquoted string\n $mode = 310;\n }\n break;\n\n case 310:\n # Start of unquoted string\n switch ($c) {\n case ';':\n case \"\\n\":\n # Linefeed ends value\n $i++;\n /*FALLTHROUGH*/\n\n case 'EOF':\n # EOF ends value\n $mode = 398;\n break;\n\n case ' ':\n case \"\\t\":\n # Space ends value\n $i++;\n $mode = 312;\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Slash in value\n $value .= $c;\n $i++;\n }\n break;\n\n default:\n # Regular characters within unqouted string\n $len = strcspn ($data, \" \\t\\n/#;\", $i);\n if ($len > 0) {\n $value .= substr ($data, $i, $len);\n $i += $len;\n } else {\n # Invalid character\n $mode = 999;\n }\n }\n break;\n\n case 312:\n # Space after unquoted value\n switch ($c) {\n case ' ':\n case \"\\t\":\n # Ignore excess white space\n $i++;\n break;\n\n case ';':\n case \"\\n\":\n # End of value\n $i++;\n /*FALLTHROUGH*/\n\n case 'EOF':\n # End of value\n $mode = 399;\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Not a comment\n $mode = 999;\n }\n break;\n\n default:\n # Invalid character\n $mode = 999;\n }\n break;\n\n case 320:\n # Inside quoted string\n switch ($c) {\n case 'EOF':\n # Missing close quote\n $mode = 998;\n break;\n\n case '\\\\':\n # Escape character\n $i++;\n $mode = 322;\n break;\n\n case '\"':\n # End of quoted string\n $i++;\n $mode = 323;\n break;\n\n default:\n # Regular characters inside string\n $len = strcspn ($data, '\\\\\"', $i);\n if ($len > 0) {\n $value .= substr ($data, $i, $len);\n $i += $len;\n } else {\n # Invalid character\n $mode = 999;\n }\n }\n break;\n\n case 322:\n # Escaped character inside quoted string\n switch ($c) {\n case 'EOF':\n # Backslash at the end of file\n $mode = 998;\n break;\n\n default:\n # Escaped character\n $value .= $c;\n $i++;\n $mode = 320;\n }\n break;\n\n case 323:\n # Space after quoted value\n switch ($c) {\n case ' ':\n case \"\\t\":\n # Ignore excess white space after quoted value\n $i++;\n break;\n\n case ';':\n case \"\\n\":\n # End of value\n $i++;\n /*FALLTHROUGH*/\n\n case 'EOF':\n # End of value\n $mode = 399;\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Not a comment\n $mode = 999;\n }\n break;\n\n default:\n # Invalid character\n $mode = 999;\n }\n break;\n\n case 330:\n # Start of multi-line value\n switch ($c) {\n case '<':\n # Ignore any number of less than signs. That is,\n # sequences <EOF, <<<EOF and <<<<<<EOF all begin\n # multi-line value alike.\n $i++;\n break;\n\n case ' ':\n case \"\\t\":\n case \"\\n\":\n # Missing separator string\n $mode = 999;\n break;\n\n case 'EOF':\n # Missing separator string\n $mode = 998;\n break;\n\n default:\n # Any other character starts separator string\n $separator = '';\n $mode = 331;\n }\n break;\n\n case 331:\n # Separator string\n switch ($c) {\n case ' ':\n case \"\\t\":\n # Space ends separator\n $mode = 332;\n break;\n\n case \"\\n\":\n # Line-feed starts the value\n $i++;\n $mode = 333;\n break;\n\n case 'EOF':\n # Unterminated value\n $mode = 998;\n break;\n\n default:\n # Collect separator string\n $len = strspn ($data, $separatorchar, $i);\n if ($len > 0) {\n $separator .= substr ($data, $i, $len);\n $i += $len;\n } else {\n # Invalid character\n $mode = 999;\n }\n }\n break;\n\n case 332:\n # Space after separator string\n switch ($c) {\n case ' ':\n case \"\\t\":\n # Ignore spaces\n $i += strspn ($data, \" \\t\", $i);\n break;\n\n case \"\\n\":\n # Line-feed starts the multi-line value\n $i++;\n $mode = 333;\n break;\n\n case 'EOF':\n # Unterminated string\n $mode = 998;\n break;\n\n default:\n # Invalid character\n $mode = 999;\n }\n break;\n\n case 333:\n # Inside multi-line value\n $pos = strpos ($data, \"\\n$separator\", $i - 1);\n if ($pos !== false) {\n\n # Compute length of value\n $len = $pos - $i;\n if ($len > 0) {\n\n # Extract value up until the possible separator\n $value .= substr ($data, $i, $len);\n $i += $len;\n\n }\n\n # Remember starting position of possible separator\n $separatorpos = $i;\n\n # Skip separator\n if (substr ($data, $i, 1) == \"\\n\") {\n $i++;\n }\n $i += strlen ($separator);\n\n # Continue parsing after separator\n $mode = 334;\n\n } else {\n\n # Unterminated string\n $mode = 998;\n\n }\n break;\n\n case 334:\n # White space after possible separator\n switch ($c) {\n case ';':\n case \"\\n\":\n # End of row\n $i++;\n /*FALLTHROUGH*/\n\n case 'EOF':\n # Store value as string\n $mode = 399;\n break;\n\n case ' ':\n case \"\\t\":\n # Ignore excess white space\n $i += strspn ($data, \" \\t\", $i);\n break;\n\n case '#':\n case '/':\n # Skip comments\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n break;\n }\n /*FALLTHROUGH*/\n\n default:\n # Text follows separator so the separator was\n # fake. Store separator as value and continue\n # looking for real separator.\n $i = $separatorpos;\n if (substr ($data, $i, 1) == \"\\n\") {\n $value .= \"\\n\";\n $i++;\n }\n $len = strlen ($separator);\n $value .= substr ($data, $i, $len);\n $i += $len;\n $mode = 333;\n }\n break;\n\n case 398:\n # Convert value to proper data type and store\n $value = $this->_convertValue ($value);\n /*FALLTHROUGH*/\n\n case 399:\n # Store value as is\n if ($section != '' && $section != 'global') {\n\n # Store in named section\n $key = $section . '.' . $key;\n\n } else {\n\n # Store in global section\n $key = \"global.$key\";\n\n }\n $values[$key] = $value;\n $mode = 0;\n break;\n\n case 998:\n throw new Exception ('Unexpected EOF');\n\n case 999:\n $str = substr ($data, $i, 15);\n throw new Exception (\"Parse error near $str\");\n\n default:\n throw new Exception (\"Invalid mode $mode\");\n }\n }\n return $values;\n }", "private function buildSettings()\n {\n $settings = [];\n foreach($this->settings as $key=>$setting)\n {\n $split = explode(': ', $setting);\n $option = $split[0];\n unset($split[0]);\n $value = implode($split);\n $settings[$option] = $value;\n }\n $this->settings = $settings;\n }", "public static function unformat_bytes($value) {\n if (preg_match('/^([0-9]+) *([[:alpha:]]+)$/', $value, $matches)) {\n $value = $matches[1];\n $unit = strtolower(substr($matches[2], 0, 1));\n }\n else {\n return $value;\n }\n\n switch($unit) {\n case 'p':\n $value *= 1024;\n case 't':\n $value *= 1024;\n case 'g':\n $value *= 1024;\n case 'm':\n $value *= 1024;\n case 'k':\n $value *= 1024;\n }\n\n return $value;\n }", "public function getConfigToString() {\n return serialize($this->_options);\n }", "function bintoip($ip) {\n\t\t\tif (!preg_match(\"/^[0-1]{0,128}$/\", $ip))\n\t\t\t\treturn false;\n\n\t\t\t$ip = sprintf(\"%0128s\", $ip);\n\n\t\t\t$ip = str_split($ip, 4);\n\t\t\tforeach ($ip as $index => $value)\n\t\t\t\t$ip[$index] = dechex(bindec($value));\n\n\t\t\treturn implode(\":\", str_split(implode(\"\", $ip), 4));\n\t\t}", "public function iniArrayPrepare ($ary) {\n \n if (!self::$hideSecrets) {\n return $ary;\n }\n \n $secrets =array (\n 'username', \n 'password',\n 'smtp_params_username',\n 'smtp_params_password',\n 'ssh_host',\n 'ssh_port',\n 'account_facebook_api_secret',\n 'account_google_secret',\n 'account_github_secret',\n 'imap_user',\n 'imap_password',\n 'google_translate_key',\n 'comment_akismet_key',\n 'session_handler',\n 'emailparse_imap_password'\n );\n \n foreach ($ary as $key => &$val) {\n if (is_array($val)) {\n foreach ($val as $k2 => $v2) {\n if (in_array($v2, $secrets)) {\n $val[$k2] = '';\n }\n }\n }\n if (in_array($key, $secrets)) {\n $ary[$key] = '';\n }\n }\n return $ary; \n }", "private function parseSettings($opts){\n\t\tif (!is_array($opts)) $opts=array('authz_reuse'=>(bool)$opts);\n\t\tif (!isset($opts['authz_reuse'])) $opts['authz_reuse']=true;\n\n\t\t$diff=array_diff_key(\n\t\t\t$opts,\n\t\t\tarray_flip(array('authz_reuse','notAfter','notBefore'))\n\t\t);\n\n\t\tif (!empty($diff)){\n\t\t\tthrow new Exception('getCertificateChain(s): Invalid option \"'.key($diff).'\"');\n\t\t}\n\n\t\treturn $opts;\n\t}", "final public static function load_ini($from) {\n if ( ! is_file($from)) {\n return FALSE;\n }\n\n\n $out = parse_ini_file($from, FALSE);\n\n return $out;\n }", "function mb_options()\n {\n }", "protected function flatSettings(array $settings)/*# : array */\n {\n return array_replace(\n $settings,\n ['seperator' => ' ', 'indent' => '']\n );\n }", "abstract public function setUTF();", "public function test_OffsetSetException_WrongValueType()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to set 'a' to '30' for Config_Dir '{$this->dir}': Creating a section requires setting an array or Config_File object.\");\n $config = new Config_Dir($this->dir, array('ext'=>'mock')); \n $config['a'] = 30;\n }", "protected final function _explodeString16($value, $limit = null)\n {\n $i = 0;\n $array = array();\n while (count($array) < $limit - 1 || $limit === null) {\n $start = $i;\n do {\n $i = strpos($value, \"\\x00\\x00\", $i);\n if ($i === false) {\n $array[] = substr($value, $start);\n return $array;\n }\n } while ($i & 0x1 != 0 && $i++); // make sure its aligned\n $array[] = substr($value, $start, $i - $start);\n $i += 2;\n }\n $array[] = substr($value, $i);\n return $array;\n }", "public function offsetSet($offset, $value){\n\t\t\tif(($value instanceof \\Aurora\\Addon\\WebUI) === false){\n\t\t\t\tthrow new InvalidArgumentException('Only instances of Aurora::Addon::WebUI can be added to instances of Aurora::Addon::WebUI::Configs');\n\t\t\t}else if(isset($offset) === true && is_integer($offset) === false){\n\t\t\t\tthrow new InvalidArgumentException('Only integer offsets allowed.');\n\t\t\t}\n\n\t\t\t$offset = isset($offset) ? $offset : $this->count();\n\n\t\t\tif(isset($this[$offset]) === true){\n\t\t\t\tthrow new InvalidArgumentException('Configs cannot be overwritten.');\n\t\t\t}\n\n\t\t\t$this->data[$offset] = $value;\n\t\t}", "function ZimAPI_checkPresetSetting(&$array_setting, &$errors = array(), $input = TRUE) {\r\n\tif ($input == TRUE) {\r\n\t\t$array_check = array(\r\n\t\t\t\t'layer_height',\r\n\t\t\t\t'first_layer_height',\r\n\t\t\t\t'perimeters',\r\n\t\t\t\t'spiral_vase',\r\n\t\t\t\t'top_solid_layers',\r\n\t\t\t\t'bottom_solid_layers',\r\n\t\t\t\t'extra_perimeters',\r\n\t\t\t\t'avoid_crossing_perimeters',\r\n\t\t\t\t// old for 1.0\r\n// \t\t\t\t'start_perimeters_at_concave_points',\r\n// \t\t\t\t'start_perimeters_at_non_overhang',\r\n\t\t\t\t// end of old for 1.0\r\n\t\t\t\t'thin_walls',\r\n\t\t\t\t'overhangs',\r\n// \t\t\t\t'randomize_start', // old for 1.0\r\n\t\t\t\t'seam_position', // new for 1.1.7\r\n\t\t\t\t'external_perimeters_first',\r\n\t\t\t\t'fill_density',\r\n\t\t\t\t'fill_pattern',\r\n\t\t\t\t'solid_fill_pattern',\r\n\t\t\t\t'infill_every_layers',\r\n\t\t\t\t'infill_only_where_needed',\r\n\t\t\t\t'solid_infill_every_layers',\r\n\t\t\t\t'fill_angle',\r\n\t\t\t\t'solid_infill_below_area',\r\n\t\t\t\t'only_retract_when_crossing_perimeters',\r\n\t\t\t\t'infill_first',\r\n\t\t\t\t'perimeter_speed',\r\n\t\t\t\t'small_perimeter_speed',\r\n\t\t\t\t'external_perimeter_speed',\r\n\t\t\t\t'infill_speed',\r\n\t\t\t\t'solid_infill_speed',\r\n\t\t\t\t'top_solid_infill_speed',\r\n\t\t\t\t'support_material_speed',\r\n\t\t\t\t'bridge_speed',\r\n\t\t\t\t'gap_fill_speed',\r\n\t\t\t\t'support_material_interface_speed', // new for 1.1.7\r\n\t\t\t\t'travel_speed',\r\n\t\t\t\t'first_layer_speed',\r\n\t\t\t\t'skirts',\r\n\t\t\t\t'skirt_distance',\r\n\t\t\t\t'skirt_height',\r\n\t\t\t\t'min_skirt_length',\r\n\t\t\t\t'brim_width',\r\n\t\t\t\t'support_material',\r\n\t\t\t\t'support_material_threshold',\r\n\t\t\t\t'support_material_enforce_layers',\r\n\t\t\t\t'raft_layers',\r\n\t\t\t\t'support_material_pattern',\r\n\t\t\t\t'support_material_spacing',\r\n\t\t\t\t'support_material_angle',\r\n\t\t\t\t'support_material_interface_layers',\r\n\t\t\t\t'support_material_interface_spacing',\r\n\t\t\t\t'dont_support_bridges', // new for 1.1.7\r\n\t\t\t\t'perimeter_extruder',\r\n\t\t\t\t'infill_extruder',\r\n\t\t\t\t'support_material_extruder',\r\n\t\t\t\t'support_material_interface_extruder',\r\n\t\t\t\t'ooze_prevention',\r\n\t\t\t\t'standby_temperature_delta',\r\n\t\t\t\t// new for 1.1.7\r\n\t\t\t\t'interface_shells',\r\n\t\t\t\t'fan_always_on',\r\n\t\t\t\t'cooling',\r\n\t\t\t\t'min_fan_speed',\r\n\t\t\t\t'max_fan_speed',\r\n\t\t\t\t'bridge_fan_speed',\r\n\t\t\t\t'disable_fan_first_layers',\r\n\t\t\t\t'fan_below_layer_time',\r\n\t\t\t\t'slowdown_below_layer_time',\r\n\t\t\t\t'min_print_speed',\r\n\t\t\t\t// end of new for 1.1.7\r\n\t\t\t\t'extrusion_width',\r\n\t\t\t\t'first_layer_extrusion_width',\r\n\t\t\t\t'perimeter_extrusion_width',\r\n\t\t\t\t'infill_extrusion_width',\r\n\t\t\t\t'solid_infill_extrusion_width',\r\n\t\t\t\t'top_infill_extrusion_width',\r\n\t\t\t\t'support_material_extrusion_width',\r\n\t\t\t\t'bridge_flow_ratio',\r\n\t\t\t\t'resolution',\r\n\t\t);\r\n\t\tforeach ($array_check as $value) {\r\n\t\t\tif (!array_key_exists($value, $array_setting)) {\r\n\t\t\t\t$errors['input'] = $value;\r\n\t\t\t\treturn FALSE;\r\n\t\t\t\tbreak; // never reach here\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// check no any losing settings\r\n\t//TODO add value checking\r\n\t// layers and perimeters\r\n\tif (!array_key_exists('layer_height', $array_setting)) {\r\n\t\t$array_setting['layer_height'] = 0.4;\r\n\t}\r\n\tif (!array_key_exists('first_layer_height', $array_setting)) {\r\n\t\t$array_setting['first_layer_height'] = 0.35;\r\n\t}\r\n\tif (!array_key_exists('perimeters', $array_setting)) {\r\n\t\t$array_setting['perimeters'] = 3;\r\n\t}\r\n\tif (!array_key_exists('spiral_vase', $array_setting)) {\r\n\t\t$array_setting['spiral_vase'] = 0;\r\n\t}\r\n\tif (!array_key_exists('top_solid_layers', $array_setting)) {\r\n\t\t$array_setting['top_solid_layers'] = 3;\r\n\t}\r\n\tif (!array_key_exists('bottom_solid_layers', $array_setting)) {\r\n\t\t$array_setting['bottom_solid_layers'] = 3;\r\n\t}\r\n\tif (!array_key_exists('extra_perimeters', $array_setting)) {\r\n\t\t$array_setting['extra_perimeters'] = 1;\r\n\t}\r\n\tif (!array_key_exists('avoid_crossing_perimeters', $array_setting)) {\r\n\t\t$array_setting['avoid_crossing_perimeters'] = 0;\r\n\t}\r\n\t// old for 1.0\r\n// \tif (!array_key_exists('start_perimeters_at_concave_points', $array_setting)) {\r\n// \t\t$array_setting['start_perimeters_at_concave_points'] = 0;\r\n// \t}\r\n// \tif (!array_key_exists('start_perimeters_at_non_overhang', $array_setting)) {\r\n// \t\t$array_setting['start_perimeters_at_non_overhang'] = 0;\r\n// \t}\r\n\t// end of old for 1.0\r\n\tif (!array_key_exists('thin_walls', $array_setting)) {\r\n\t\t$array_setting['thin_walls'] = 1;\r\n\t}\r\n\tif (!array_key_exists('overhangs', $array_setting)) {\r\n\t\t$array_setting['overhangs'] = 1;\r\n\t}\r\n// \tif (!array_key_exists('randomize_start', $array_setting)) { // old for 1.0\r\n// \t\t$array_setting['randomize_start'] = 0;\r\n// \t}\r\n\tif (!array_key_exists('seam_position', $array_setting)) { // new for 1.1.7\r\n\t\t$array_setting['seam_position'] = 'random';\r\n\t}\r\n\tif (!array_key_exists('external_perimeters_first', $array_setting)) {\r\n\t\t$array_setting['external_perimeters_first'] = 0;\r\n\t}\r\n\t// infill\r\n\tif (!array_key_exists('fill_density', $array_setting)) {\r\n\t\t$array_setting['fill_density'] = 0.4;\r\n\t}\r\n\tif (!array_key_exists('fill_pattern', $array_setting)) {\r\n\t\t$array_setting['fill_pattern'] = 'honeycomb';\r\n\t}\r\n\tif (!array_key_exists('solid_fill_pattern', $array_setting)) {\r\n\t\t$array_setting['solid_fill_pattern'] = 'rectilinear';\r\n\t}\r\n\tif (!array_key_exists('infill_every_layers', $array_setting)) {\r\n\t\t$array_setting['infill_every_layers'] = 1;\r\n\t}\r\n\tif (!array_key_exists('infill_only_where_needed', $array_setting)) {\r\n\t\t$array_setting['infill_only_where_needed'] = 0;\r\n\t}\r\n\tif (!array_key_exists('solid_infill_every_layers', $array_setting)) {\r\n\t\t$array_setting['solid_infill_every_layers'] = 0;\r\n\t}\r\n\tif (!array_key_exists('fill_angle', $array_setting)) {\r\n\t\t$array_setting['fill_angle'] = 45;\r\n\t}\r\n\tif (!array_key_exists('solid_infill_below_area', $array_setting)) {\r\n\t\t$array_setting['solid_infill_below_area'] = 70;\r\n\t}\r\n\tif (!array_key_exists('only_retract_when_crossing_perimeters', $array_setting)) {\r\n\t\t$array_setting['only_retract_when_crossing_perimeters'] = 1;\r\n\t}\r\n\tif (!array_key_exists('infill_first', $array_setting)) {\r\n\t\t$array_setting['infill_first'] = 0;\r\n\t}\r\n\t// speed\r\n\tif (!array_key_exists('perimeter_speed', $array_setting)) {\r\n\t\t$array_setting['perimeter_speed'] = 30;\r\n\t}\r\n\tif (!array_key_exists('small_perimeter_speed', $array_setting)) {\r\n\t\t$array_setting['small_perimeter_speed'] = 30;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tmp = $array_setting['small_perimeter_speed'];\r\n\t\t$pos = strpos($tmp, \"%\");\r\n\t\tif (($pos !== FALSE && (substr($tmp, 0, $pos) < 20 || substr($tmp, 0, $pos) > 100))\r\n\t\t\t\t|| ($pos === FALSE && ($tmp < 10 || $tmp > 200)))\r\n\t\t{\r\n\t\t\t$errors['small_perimeter_speed'] = '[20,100] OR [10%,200%]';\r\n// \t\t\treturn FALSE;\r\n\t\t}\r\n\t}\r\n\tif (!array_key_exists('external_perimeter_speed', $array_setting)) {\r\n\t\t$array_setting['external_perimeter_speed'] = '70%';\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tmp = $array_setting['external_perimeter_speed'];\r\n\t\t$pos = strpos($tmp, \"%\");\r\n\t\tif (($pos !== FALSE && (substr($tmp, 0, $pos) < 20 || substr($tmp, 0, $pos) > 100))\r\n\t\t\t\t|| ($pos === FALSE && ($tmp < 10 || $tmp > 200)))\r\n\t\t{\r\n\t\t\t$errors['external_perimeter_speed'] = '[20,100] OR [10%,200%]';\r\n// \t\t\treturn FALSE;\r\n\t\t}\r\n\t}\r\n\tif (!array_key_exists('infill_speed', $array_setting)) {\r\n\t\t$array_setting['infill_speed'] = 60;\r\n\t}\r\n\tif (!array_key_exists('solid_infill_speed', $array_setting)) {\r\n\t\t$array_setting['solid_infill_speed'] = 60;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tmp = $array_setting['solid_infill_speed'];\r\n\t\t$pos = strpos($tmp, \"%\");\r\n\t\tif (($pos !== FALSE && (substr($tmp, 0, $pos) < 20 || substr($tmp, 0, $pos) > 100))\r\n\t\t\t\t|| ($pos === FALSE && ($tmp < 10 || $tmp > 200)))\r\n\t\t{\r\n\t\t\t$errors['solid_infill_speed'] = '[20,100] OR [10%,200%]';\r\n// \t\t\treturn FALSE;\r\n\t\t}\r\n\t}\r\n\tif (!array_key_exists('top_solid_infill_speed', $array_setting)) {\r\n\t\t$array_setting['top_solid_infill_speed'] = 50;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tmp = $array_setting['top_solid_infill_speed'];\r\n\t\t$pos = strpos($tmp, \"%\");\r\n\t\tif (($pos !== FALSE && (substr($tmp, 0, $pos) < 20 || substr($tmp, 0, $pos) > 100))\r\n\t\t\t\t|| ($pos === FALSE && ($tmp < 10 || $tmp > 200)))\r\n\t\t{\r\n\t\t\t$errors['top_solid_infill_speed'] = '[20,100] OR [10%,200%]';\r\n// \t\t\treturn FALSE;\r\n\t\t}\r\n\t}\r\n\tif (!array_key_exists('support_material_speed', $array_setting)) {\r\n\t\t$array_setting['support_material_speed'] = 60;\r\n\t}\r\n\tif (!array_key_exists('bridge_speed', $array_setting)) {\r\n\t\t$array_setting['bridge_speed'] = 60;\r\n\t}\r\n\tif (!array_key_exists('gap_fill_speed', $array_setting)) {\r\n\t\t$array_setting['gap_fill_speed'] = 20;\r\n\t}\r\n\tif (!array_key_exists('travel_speed', $array_setting)) {\r\n\t\t$array_setting['travel_speed'] = 130;\r\n\t}\r\n\tif (!array_key_exists('first_layer_speed', $array_setting)) { // new for 1.1.7\r\n\t\t$array_setting['first_layer_speed'] = '30%';\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tmp = $array_setting['first_layer_speed'];\r\n\t\t$pos = strpos($tmp, \"%\");\r\n\t\tif (($pos !== FALSE && (substr($tmp, 0, $pos) < 20 || substr($tmp, 0, $pos) > 100))\r\n\t\t\t\t|| ($pos === FALSE && ($tmp < 10 || $tmp > 200)))\r\n\t\t{\r\n\t\t\t$errors['first_layer_speed'] = '[20,100] OR [10%,200%]';\r\n// \t\t\treturn FALSE;\r\n\t\t}\r\n\t}\r\n\tif (!array_key_exists('support_material_interface_speed', $array_setting)) {\r\n\t\t$array_setting['support_material_interface_speed'] = '100%';\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tmp = $array_setting['support_material_interface_speed'];\r\n\t\t$pos = strpos($tmp, \"%\");\r\n\t\tif (($pos !== FALSE && (substr($tmp, 0, $pos) < 20 || substr($tmp, 0, $pos) > 100))\r\n\t\t\t\t|| ($pos === FALSE && ($tmp < 10 || $tmp > 200)))\r\n\t\t{\r\n\t\t\t$errors['support_material_interface_speed'] = '[20,100] OR [10%,200%]';\r\n// \t\t\treturn FALSE;\r\n\t\t}\r\n\t}\r\n\t// skirt and brim\r\n\tif (!array_key_exists('skirts', $array_setting)) {\r\n\t\t$array_setting['skirts'] = 1;\r\n\t}\r\n\tif (!array_key_exists('skirt_distance', $array_setting)) {\r\n\t\t$array_setting['skirt_distance'] = 6;\r\n\t}\r\n\tif (!array_key_exists('skirt_height', $array_setting)) {\r\n\t\t$array_setting['skirt_height'] = 1;\r\n\t}\r\n\tif (!array_key_exists('min_skirt_length', $array_setting)) {\r\n\t\t$array_setting['min_skirt_length'] = 0;\r\n\t}\r\n\tif (!array_key_exists('brim_width', $array_setting)) {\r\n\t\t$array_setting['brim_width'] = 0;\r\n\t}\r\n\t// support material\r\n\tif (!array_key_exists('support_material', $array_setting)) {\r\n\t\t$array_setting['support_material'] = 0;\r\n\t}\r\n\tif (!array_key_exists('material_threshold', $array_setting)) {\r\n\t\t$array_setting['material_threshold'] = 0;\r\n\t}\r\n\tif (!array_key_exists('support_material_enforce_layers', $array_setting)) {\r\n\t\t$array_setting['support_material_enforce_layers'] = 0;\r\n\t}\r\n\tif (!array_key_exists('raft_layers', $array_setting)) {\r\n\t\t$array_setting['raft_layers'] = 0;\r\n\t}\r\n\tif (!array_key_exists('support_material_pattern', $array_setting)) {\r\n\t\t$array_setting['support_material_pattern'] = 'honeycomb';\r\n\t}\r\n\tif (!array_key_exists('support_material_spacing', $array_setting)) {\r\n\t\t$array_setting['support_material_spacing'] = 2.5;\r\n\t}\r\n\tif (!array_key_exists('support_material_angle', $array_setting)) {\r\n\t\t$array_setting['support_material_angle'] = 0;\r\n\t}\r\n\tif (!array_key_exists('support_material_interface_layers', $array_setting)) {\r\n\t\t$array_setting['support_material_interface_layers'] = 3;\r\n\t}\r\n\tif (!array_key_exists('support_material_interface_spacing', $array_setting)) {\r\n\t\t$array_setting['support_material_interface_spacing'] = 0;\r\n\t}\r\n\tif (!array_key_exists('dont_support_bridges', $array_setting)) { // new for 1.1.7\r\n\t\t$array_setting['dont_support_bridges'] = 1;\r\n\t}\r\n\t// multiple extruders\r\n\tif (!array_key_exists('perimeter_extruder', $array_setting)) {\r\n\t\t$array_setting['perimeter_extruder'] = 1;\r\n\t}\r\n\tif (!array_key_exists('infill_extruder', $array_setting)) {\r\n\t\t$array_setting['infill_extruder'] = 1;\r\n\t}\r\n\tif (!array_key_exists('support_material_extruder', $array_setting)) {\r\n\t\t$array_setting['support_material_extruder'] = 1;\r\n\t}\r\n\tif (!array_key_exists('support_material_interface_extruder', $array_setting)) {\r\n\t\t$array_setting['support_material_interface_extruder'] = 1;\r\n\t}\r\n\tif (!array_key_exists('ooze_prevention', $array_setting)) {\r\n\t\t$array_setting['ooze_prevention'] = 0;\r\n\t}\r\n\tif (!array_key_exists('standby_temperature_delta', $array_setting)) {\r\n\t\t$array_setting['standby_temperature_delta'] = -5;\r\n\t}\r\n\tif (!array_key_exists('interface_shells', $array_setting)) { // new for 1.1.7\r\n\t\t$array_setting['interface_shells'] = 0;\r\n\t}\r\n\t// cooling fan (all new for 1.1.7)\r\n\tif (!array_key_exists('fan_always_on', $array_setting)) {\r\n\t\t$array_setting['fan_always_on'] = 0;\r\n\t}\r\n\tif (!array_key_exists('cooling', $array_setting)) {\r\n\t\t$array_setting['cooling'] = 1;\r\n\t}\r\n\tif (!array_key_exists('min_fan_speed', $array_setting)) {\r\n\t\t$array_setting['min_fan_speed'] = 35;\r\n\t}\r\n\tif (!array_key_exists('max_fan_speed', $array_setting)) {\r\n\t\t$array_setting['max_fan_speed'] = 100;\r\n\t}\r\n\tif (!array_key_exists('bridge_fan_speed', $array_setting)) {\r\n\t\t$array_setting['bridge_fan_speed'] = 100;\r\n\t}\r\n\tif (!array_key_exists('disable_fan_first_layers', $array_setting)) {\r\n\t\t$array_setting['disable_fan_first_layers'] = 1;\r\n\t}\r\n\tif (!array_key_exists('fan_below_layer_time', $array_setting)) {\r\n\t\t$array_setting['fan_below_layer_time'] = 60;\r\n\t}\r\n\tif (!array_key_exists('slowdown_below_layer_time', $array_setting)) {\r\n\t\t$array_setting['slowdown_below_layer_time'] = 30;\r\n\t}\r\n\tif (!array_key_exists('min_print_speed', $array_setting)) {\r\n\t\t$array_setting['min_print_speed'] = 10;\r\n\t}\r\n\t// advanced\r\n\tif (!array_key_exists('extrusion_width', $array_setting)) {\r\n\t\t$array_setting['extrusion_width'] = 0;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tmp = $array_setting['extrusion_width'];\r\n\t\t$pos = strpos($tmp, \"%\");\r\n\t\tif (($pos !== FALSE && (substr($tmp, 0, $pos) < 50 || substr($tmp, 0, $pos) > 300))\r\n\t\t\t\t|| ($pos === FALSE && ($tmp != 0 && ($tmp < 0.25 || $tmp > 0.5))))\r\n\t\t{\r\n\t\t\t$errors['extrusion_width'] = '[0.25,0.5] OR [50%,300%]';\r\n// \t\t\treturn FALSE;\r\n\t\t}\r\n\t}\r\n\tif (!array_key_exists('first_layer_extrusion_width', $array_setting)) {\r\n\t\t$array_setting['first_layer_extrusion_width'] = '200%';\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tmp = $array_setting['first_layer_extrusion_width'];\r\n\t\t$pos = strpos($tmp, \"%\");\r\n\t\tif (($pos !== FALSE && (substr($tmp, 0, $pos) < 50 || substr($tmp, 0, $pos) > 300))\r\n\t\t\t\t|| ($pos === FALSE && ($tmp != 0 && ($tmp < 0.25 || $tmp > 0.5))))\r\n\t\t{\r\n\t\t\t$errors['first_layer_extrusion_width'] = '[0.25,0.5] OR [50%,300%]';\r\n// \t\t\treturn FALSE;\r\n\t\t}\r\n\t}\r\n\tif (!array_key_exists('perimeter_extrusion_width', $array_setting)) {\r\n\t\t$array_setting['perimeter_extrusion_width'] = 0;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tmp = $array_setting['perimeter_extrusion_width'];\r\n\t\t$pos = strpos($tmp, \"%\");\r\n\t\tif (($pos !== FALSE && (substr($tmp, 0, $pos) < 25 || substr($tmp, 0, $pos) > 150))\r\n\t\t\t\t|| ($pos === FALSE && ($tmp != 0 && ($tmp < 0.25 || $tmp > 0.5))))\r\n\t\t{\r\n\t\t\t$errors['perimeter_extrusion_width'] = '[0.25,0.5] OR [50%,150%]';\r\n// \t\t\treturn FALSE;\r\n\t\t}\r\n\t}\r\n\tif (!array_key_exists('infill_extrusion_width', $array_setting)) {\r\n\t\t$array_setting['infill_extrusion_width'] = 0;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tmp = $array_setting['infill_extrusion_width'];\r\n\t\t$pos = strpos($tmp, \"%\");\r\n\t\tif (($pos !== FALSE && (substr($tmp, 0, $pos) < 50 || substr($tmp, 0, $pos) > 150))\r\n\t\t\t\t|| ($pos === FALSE && ($tmp != 0 && ($tmp < 0.25 || $tmp > 0.5))))\r\n\t\t{\r\n\t\t\t$errors['infill_extrusion_width'] = '[0.25,0.5] OR [50%,150%]';\r\n// \t\t\treturn FALSE;\r\n\t\t}\r\n\t}\r\n\tif (!array_key_exists('solid_infill_extrusion_width', $array_setting)) {\r\n\t\t$array_setting['solid_infill_extrusion_width'] = 0;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tmp = $array_setting['solid_infill_extrusion_width'];\r\n\t\t$pos = strpos($tmp, \"%\");\r\n\t\tif (($pos !== FALSE && (substr($tmp, 0, $pos) < 50 || substr($tmp, 0, $pos) > 300))\r\n\t\t\t\t|| ($pos === FALSE && ($tmp != 0 && ($tmp < 0.25 || $tmp > 0.5))))\r\n\t\t{\r\n\t\t\t$errors['solid_infill_extrusion_width'] = '[0.25,0.5] OR [50%,300%]';\r\n// \t\t\treturn FALSE;\r\n\t\t}\r\n\t}\r\n\tif (!array_key_exists('top_infill_extrusion_width', $array_setting)) {\r\n\t\t$array_setting['top_infill_extrusion_width'] = 0;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tmp = $array_setting['top_infill_extrusion_width'];\r\n\t\t$pos = strpos($tmp, \"%\");\r\n\t\tif (($pos !== FALSE && (substr($tmp, 0, $pos) < 25 || substr($tmp, 0, $pos) > 150))\r\n\t\t\t\t|| ($pos === FALSE && ($tmp != 0 && ($tmp < 0.25 || $tmp > 0.5))))\r\n\t\t{\r\n\t\t\t$errors['top_infill_extrusion_width'] = '[0.25,0.5] OR [50%,150%]';\r\n// \t\t\treturn FALSE;\r\n\t\t}\r\n\t}\r\n\tif (!array_key_exists('support_material_extrusion_width', $array_setting)) {\r\n\t\t$array_setting['support_material_extrusion_width'] = 0;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tmp = $array_setting['support_material_extrusion_width'];\r\n\t\t$pos = strpos($tmp, \"%\");\r\n\t\tif (($pos !== FALSE && (substr($tmp, 0, $pos) < 50 || substr($tmp, 0, $pos) > 150))\r\n\t\t\t\t|| ($pos === FALSE && ($tmp != 0 && ($tmp < 0.25 || $tmp > 0.5))))\r\n\t\t{\r\n\t\t\t$errors['support_material_extrusion_width'] = '[0.25,0.5] OR [50%,150%]';\r\n// \t\t\treturn FALSE;\r\n\t\t}\r\n\t}\r\n\tif (!array_key_exists('bridge_flow_ratio', $array_setting)) {\r\n\t\t$array_setting['bridge_flow_ratio'] = 1;\r\n\t}\r\n\tif (!array_key_exists('resolution', $array_setting)) {\r\n\t\t$array_setting['resolution'] = 0;\r\n\t}\r\n\t\r\n\t// return false if error\r\n\tif (count($errors)) {\r\n\t\treturn FALSE;\r\n\t}\r\n\t\r\n\treturn TRUE;\r\n}", "public function getOptions($encoding = 'UTF-8') {}", "function parse_line($line)\n{\n $GREASE = array(\"0x0a0a\", \"0x1a1a\", \"0x2a2a\", \"0x3a3a\", \"0x4a4a\", \"0x5a5a\", \"0x6a6a\", \"0x7a7a\", \"0x8a8a\", \"0x9a9a\", \"0xaaaa\", \"0xbaba\", \"0xcaca\", \"0xdada\", \"0xeaea\", \"0xfafa\");\n // ignore SCSV cipher suite values when compiling a browser fingerprint (see rfc5746 and rfc7507)\n $SCSV = array(\"TLS_EMPTY_RENEGOTIATION_INFO_SCSV\", \"TLS_FALLBACK_SCSV\");\n $tmp = explode('\"', trim($line));\n $fp = array(\n 'ua' => $tmp[1],\n 'ciphers' => $tmp[3],\n 'curves' => $tmp[5] == '-' ? '' : $tmp[5],\n 'count' => 1\n );\n // exclude GREASE and SCSV suits from fingerprint\n $fp_ciphers = explode(':', $fp['ciphers']);\n $fp_ciphers = array_diff($fp_ciphers, $GREASE, $SCSV);\n $fp['ciphers'] = implode(':', $fp_ciphers);\n $fp_curves = explode(':', $fp['curves']);\n $fp_curves = array_diff($fp_curves, $GREASE);\n $fp['curves'] = implode(':', $fp_curves);\n return $fp;\n}", "public function fixCharsets() {}", "public static function getIniBytes($iniVarName)\n {\n $iniVarValue = ini_get($iniVarName);\n if (($iniVarValue == '') || $iniVarValue === false) {\n return false;\n }\n return self::parseShortHandSize($iniVarValue);\n }", "public static function getDefaultFormatSettings(): array\n {\n return static::$defaultFormatSettings;\n }", "function convertPHPSizeToBytes($sSize) \n{ \n if ( is_numeric( $sSize) ) {\n return $sSize;\n }\n $sSuffix = substr($sSize, -1); \n $iValue = substr($sSize, 0, -1); \n switch(strtoupper($sSuffix)){ \n case 'P':\n $iValue *= 1024;\n case 'T':\n $iValue *= 1024;\n case 'G':\n $iValue *= 1024;\n case 'M':\n $iValue *= 1024;\n case 'K':\n $iValue *= 1024;\n break;\n } \n return $iValue;\n}", "protected final function _explodeString8($value, $limit = null)\n {\n return preg_split(\"/\\\\x00/\", $value, $limit);\n }", "function array_iconv(&$val, $key, $userdata)\n{\n\t$val = mb_convert_encoding($val,$userdata[1],$userdata[0]);\n\t//audit(serialize($userdata),'error');\n}", "public function parse_opts() : array {\n\t\tself::$opts = (object) json_decode( @file_get_contents( __DIR__.\"/opts.json\" ) );\n\t\tself::$opts = [ self::$opts->paste, self::$opts->expire ];\n\t\treturn self::$opts;\n\t}", "private function parseConfig(){\n\t\t\treturn parse_ini_file(BASE_PATH . 'config' . DIRECTORY_SEPARATOR . 'config.ini');\n\t\t}", "private function getSettings($content) {\n\t\t$options = array();\n\t\tpreg_match(\"/\\[hashee_display(.*)\\]/\", $content, $userOptions);\n\t\tif(array_key_exists(1, $userOptions)) {\n\t\t\tforeach ($this->optionDefaults as $key => $value) {\n\t\t\t\tpreg_match('/'.$key.'=\"([^\"]*)\"/', $userOptions[1], $matches);\n\t\t\t\tif(array_key_exists(1, $matches)) {\n\t\t\t\t\t$options[$key] = $matches[1];\n\t\t\t\t}else {\n\t\t\t\t\tif($value == null) {\n\t\t\t\t\t\treturn array();\n\t\t\t\t\t}else {\n\t\t\t\t\t\t$options[$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $options;\n\t}", "public static function formatFromInt8($byte) {}", "public static function readMetadata($value, $types = false, &$offset = 0){\n\t\t$offset = 0;\n\t\t$m = [];\n\t\t$b = ord($value{$offset});\n\t\t++$offset;\n\t\twhile($b !== 127 and isset($value{$offset})){\n\t\t\t$bottom = $b & 0x1F;\n\t\t\t$type = $b >> 5;\n\t\t\tswitch($type){\n\t\t\t\tcase 0:\n\t\t\t\t\t$r = self::readByte($value{$offset});\n\t\t\t\t\t++$offset;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$r = self::readLShort(substr($value, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$r = self::readLInt(substr($value, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$r = self::readLFloat(substr($value, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$len = self::readLShort(substr($value, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\t$r = substr($value, $offset, $len);\n\t\t\t\t\t$offset += $len;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$r = [];\n\t\t\t\t\t$r[] = self::readLShort(substr($value, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\t$r[] = ord($value{$offset});\n\t\t\t\t\t++$offset;\n\t\t\t\t\t$r[] = self::readLShort(substr($value, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t$r = [];\n\t\t\t\t\tfor($i = 0; $i < 3; ++$i){\n\t\t\t\t\t\t$r[] = self::readLInt(substr($value, $offset, 4));\n\t\t\t\t\t\t$offset += 4;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\t$r = self::readLLong(substr($value, $offset, 4));\n\t\t\t\t\t$offset += 8;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn [];\n\n\t\t\t}\n\t\t\tif($types === true){\n\t\t\t\t$m[$bottom] = [$r, $type];\n\t\t\t}else{\n\t\t\t\t$m[$bottom] = $r;\n\t\t\t}\n\t\t\t$b = ord($value{$offset});\n\t\t\t++$offset;\n\t\t}\n\n\t\treturn $m;\n\t}" ]
[ "0.5891323", "0.5847121", "0.5652638", "0.5475815", "0.5448631", "0.5427061", "0.54184324", "0.5204507", "0.50616807", "0.47969723", "0.47937164", "0.47230864", "0.46664613", "0.4657962", "0.46568787", "0.4625947", "0.4576941", "0.45601052", "0.45364356", "0.45355237", "0.4506921", "0.4478501", "0.4474098", "0.44522274", "0.44021082", "0.43943828", "0.43863487", "0.43545663", "0.43508315", "0.43333486", "0.42892084", "0.42729998", "0.4251932", "0.42442062", "0.42315483", "0.4229486", "0.42099607", "0.4206016", "0.42043328", "0.4202773", "0.42022914", "0.41976145", "0.4176235", "0.41592044", "0.41545472", "0.41537282", "0.41482517", "0.41355777", "0.41250253", "0.4113445", "0.41114825", "0.41062558", "0.41030082", "0.40931988", "0.40806273", "0.4078014", "0.4069597", "0.4060133", "0.40600413", "0.40497726", "0.40434965", "0.4032511", "0.40242854", "0.40148568", "0.4012271", "0.4007263", "0.39899394", "0.39865762", "0.39827752", "0.3974522", "0.39555907", "0.39486796", "0.39471745", "0.39378238", "0.393622", "0.39267504", "0.3920527", "0.39192235", "0.39145648", "0.39135852", "0.39127886", "0.39124405", "0.391021", "0.39084613", "0.38950402", "0.3892984", "0.38885993", "0.38862836", "0.38843182", "0.38759303", "0.3873314", "0.38705206", "0.38703287", "0.38662955", "0.38662598", "0.386275", "0.38624126", "0.38623214", "0.3860209", "0.38582745", "0.3857883" ]
0.0
-1
Get current time in seconds
protected function time() { $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; return $time; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getCurrentTime()\n {\n return time();\n }", "private function getCurrentTime() {\n return microtime( true );\n }", "private function getCurrentTime()\n {\n return microtime(true);\n }", "function getElapsedSeconds() {\n\t\treturn $this->time;\n\t}", "function getCurrentTime()\n\t\t{\n\t\t\t$time = date('h:i:s a');\n\t\t\treturn $time;\n\t\t}", "public static function get_miliseconds_now()\n {\n $milliseconds = round(microtime(true) * 1000);\n return $milliseconds;\n }", "static public function getSessionTime(){\n if (!isset($_SESSION['start_time'])){\n return 0;\n } else {\n return time() - $_SESSION['start_time'];\n }\n }", "public function getCurrentTime()\n {\n // Get current DateTime obj\n $curDateTime = $this->getCurrentDateTime();\n\n // Return current time formatted nicely as string\n return $curDateTime->format('H:i:s');\n }", "public function GetCurrentTime(){\n\t\treturn date('y-m-d H:i:s', time());\n\t}", "public static function currentTimeMillis()\n {\n return microtime(true) * 10000;\n }", "public function time() {\n return $this->info['total_time'];\n }", "public function getSeconds() : string\n {\n return date('s', $this->getUnixTimestamp());\n }", "public function getSessionTime(){\n return $this->_session->get('time');\n }", "public static function getTimer()\n {\n return microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n }", "protected static function _timeToCake()\n {\n return TIME_START - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "public static function get_elapsed_time()\n {\n return microtime( true ) - $_SESSION['time']['script_start_time'];\n }", "public function getTime()\n {\n return time();\n }", "public static function nowInMs(): int\n {\n return ceil(microtime(true) * 1000);\n }", "public function currentTime();", "function time_now() {\n return date(\"H:i:s\");\n}", "public function getTime()\n {\n return (float)sprintf(\"%.1f\", 1000*(microtime(true) - $this->startTime));\n }", "protected function nowInMilliseconds(): int\n {\n $mt = explode(' ', microtime());\n return ((int) $mt[1]) * 1000 + ((int) round((int) $mt[0] * 1000));\n }", "public static function time_seconds($time) {\n //Convert oanda time from microseconds to seconds\n\t\t\treturn floor($time/1000000);\n\t\t}", "protected function getTime()\n {\n return time();\n }", "protected static function _timeToStopwatch()\n {\n return self::$_startupTime - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "public function get_time() {\r\n\t\t\t$date = $this->get_date( 'U' );\r\n\t\t\treturn is_numeric( $date ) ? $date : time(); //time wrong? use now\r\n\t\t}", "public function getCurrentTime() {\n $timestamp = $this->getInfo();\n $http_code = $timestamp->code;\n $current_time = 'Time not set yet';\n if ($http_code == 200) {\n $current_time = date('H:i', $timestamp->data->date->timestamp);\n }\n return $current_time;\n }", "function now() {\n return microtime(true)*1000;\n}", "public function time()\n\t{\n\t\treturn $this->endTimer-$this->startTimer;\n\t}", "private static function time()\n {\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n }", "function gmt_time() {\r\n\t\t$now = time ();\r\n\t\t$tz = $this->gmt_timezone ();\r\n\t\t$seconds = 3600 * $tz;\r\n\t\treturn $now - $seconds;\r\n\t}", "public function elapsedtime() {\n return fmod(floatval($this->servertime()),$this->waitingtime());\n\t}", "public function getTime() : int\n {\n $eventTime = $this->getTimeStamp();\n $eventStartTime = static::getStartTime();\n \n return number_format((($eventTime - $eventStartTime) * 1000), 0, '', '');\n \n }", "public function getSecondsActive()\n {\n $seconds_active = null;\n $seconds = Configuration::get('MULTISAFEPAY_TIME_ACTIVE');\n $timeUnit = Configuration::get('MULTISAFEPAY_TIME_UNIT');\n\n if (empty($seconds)) {\n return $seconds_active;\n }\n\n switch ($timeUnit) {\n case 'days':\n $seconds_active = $seconds * 24 * 60 * 60;\n break;\n case 'hours':\n $seconds_active = $seconds * 60 * 60;\n break;\n case 'seconds':\n $seconds_active = $seconds;\n break;\n default:\n $seconds_active = null;\n }\n\n return $seconds_active;\n }", "function second()\r\n {\r\n $value = $this->SecondsElapsed;\r\n\r\n $second = $value % 60;\r\n\r\n return $second;\r\n }", "protected function getTime() {\n return microtime(true);\n }", "public function getTime(): float\n {\n return $this->time;\n }", "public function getTime(): int {\n\t\treturn $this->time;\n\t}", "public function getUserIdleSeconds()\n {\n try\n {\n $luats = $this->getInstanceUserActionTimestamp();\n $now = time();\n $diff = $now - $luats;\n return $diff;\n } catch (\\Exception $ex) {\n throw $ex;\n }\n }", "protected static function _time()\n\t{\n\t\treturn time();\n\t}", "protected function getTime()\n {\n return microtime(true);\n }", "public static function timeSinceStart(): float\n {\n return \\microtime(true) - self::getRequestTime();\n }", "static function ts(){\r\n $dt = microtime(true) - self::$starttime;\r\n return self::mtformat($dt);\r\n }", "public function getSeconds(): int\n {\n return $this->seconds;\n }", "public function getCurrentTimeUTC()\n {\n return (int)$this->data['currentTimeUTC'];\n }", "public function getTotalTime()\n {\n return $this->info->total_time * 1000;\n }", "public static function getStartTime() : float\n {\n if (!isset(static::$startTime)) {\n static::$startTime = microtime(true);\n }//end if\n \n return static::$startTime;\n \n }", "public function get_time() {\n return $this->_time;\n }", "public static function timestamp() {\n return time(); \n }", "public static function getStartTime(): float\n {\n return self::$startTimer;\n }", "static public function get_time() {\n // By Zach Buller ([email protected])\n $time1 = \\microtime();\n \\settype($time1, 'string'); //convert to string to keep trailing zeroes\n $time2 = explode(\" \", $time1);\n $sub_secs = \\preg_replace('/0./', '', $time2[0], 1);\n $time3 = ($time2[1].$sub_secs)/100;\n return $time3;\n }", "public function getCurrentTime()\n\t{\n\t\techo date(\"h-s-m\");\n\t\n\t}", "function getAsSeconds()\n {\n return $this->seconds;\n }", "public function getSpentSeconds()\n {\n $diff = $this->dateStarted->diff(new \\DateTime('now', new \\DateTimeZone('UTC')));\n $seconds = ($diff->y * TimeSpent::YEAR)\n + ($diff->m * TimeSpent::MONTH)\n + ($diff->d * TimeSpent::DAY)\n + ($diff->h * TimeSpent::HOUR)\n + ($diff->i * TimeSpent::MINUTE)\n + $diff->s;\n\n return $seconds;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "protected function getElapsedTimeInMs()\n {\n return (microtime(true) - $this->start) * 1000;\n }", "public function getTime() {\n return $this->time;\n }", "function now(): float\n{\n return (float) \\hrtime(true) / 1_000_000_000;\n}", "public function getStartTime() {\n\t\t$gentime = explode(' ',microtime());\n\t\t$gentime = $gentime[1] + $gentime[0];\n\t\treturn $gentime;\n\t}", "function getSystemTime()\n{\n $time = @gettimeofday();\n $resultTime = $time['sec'] * 1000;\n $resultTime += floor($time['usec'] / 1000);\n return $resultTime;\n}", "public function getTime() {\n\t\treturn $this->_time;\n\t}", "function getsystime() {\n\n return date('Y-m-d H:i:s');\n\n}", "public function getTime()\n {\n return $this->get(self::_TIME);\n }", "public function getTime()\n {\n return $this->get(self::_TIME);\n }", "public function getTime()\n {\n return $this->get(self::_TIME);\n }", "public static function timestamp(){\n $timestamp = time();\n return $timestamp;\n }", "public static function getTimeFromStart()\n {\n return sprintf('%.0f', (microtime(true) - dm::getStartTime()) * 1000);\n }", "public function getTotalSeconds(): float\n {\n return $this->getTotalMilliseconds() / 1000;\n }", "public function time()\n {\n return $this->_requestTime;\n }", "public static function ms(): int\n {\n return round((static::elapsed() * 1000), 0);\n }", "public static function getTimestamp(){\r\n\t\treturn time();\r\n\t}", "public static function timeElapsedInSeconds($time){\n $date_time = date_create($time);\n return time() - $date_time->format('U');\n }", "public function GetSystemTime() {\r\n return $this->_client->doGetSystemTime(\r\n self::COUNTRY_CODE, $this->_config['allegro_key']\r\n );\r\n }", "public function getTime(): int {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->get(self::TIME);\n }", "function usersCurrentTimeStr() {\n return $this->currentTimeStr($this->controller->User->getTimeZone(\n $this->controller->authd_user_id));\n }", "public static function unixTimeNow(): int\n {\n return time();\n }", "public function cChrono(){\n\t\treturn round(getMicrotime()-PLX_MICROTIME,3).'s';\n\t}", "function Now($seconds_to_add=0);", "public function now()\n {\n return $this->current;\n }", "public function getSpeakTime()\n {\n return $this->get(self::_SPEAK_TIME);\n }", "public function getUseSeconds()\n {\n return $this->use_seconds;\n }", "private function getTime() {\n // Get the current microtime string as `microseconds seconds`\n $time_arr = microtime();\n // Add the two numbers together\n $time = array_sum(explode(' ', $time_arr));\n // Multiply by 1000 and return a 13 digit timestamp\n $microtime = $time * 1000;\n return substr($microtime, 0, 13); \n }", "public function getTime();", "public function getTime();", "public function getEncryptedTime()\n {\n return Crypt::encrypt(time());\n }", "private function currentTime()\n\t{\n\t\treturn Carbon::now()->format('Ymdhis');\n\t}", "static function getTimeInMs() {\n\t\treturn round(microtime(true) * 1000);\n\t}", "function secondsElapsed()\r\n {\r\n return $this->SecondsElapsed;\r\n }" ]
[ "0.77175754", "0.77125806", "0.76925564", "0.740111", "0.7326574", "0.7256872", "0.7203192", "0.71893406", "0.7176922", "0.7057095", "0.70336956", "0.7022913", "0.69788796", "0.69640225", "0.69485277", "0.6911663", "0.68615353", "0.6834106", "0.6826285", "0.6824054", "0.681873", "0.6802945", "0.6777949", "0.6766243", "0.675998", "0.67564684", "0.67534506", "0.6752727", "0.67420036", "0.67370784", "0.6729901", "0.67261094", "0.67239046", "0.67220634", "0.6720267", "0.67006415", "0.66989815", "0.66909504", "0.66854686", "0.66797113", "0.6670835", "0.6669258", "0.66671294", "0.6663059", "0.66451836", "0.6635826", "0.6630839", "0.6627905", "0.660318", "0.65994835", "0.6598985", "0.65981597", "0.6595658", "0.6573052", "0.6572611", "0.6572611", "0.6572611", "0.6572611", "0.6572611", "0.6572611", "0.6572611", "0.6572611", "0.6572611", "0.6572611", "0.6572611", "0.6571567", "0.65681565", "0.65677047", "0.65632933", "0.65608954", "0.6551206", "0.6539353", "0.65301824", "0.65301716", "0.65301716", "0.6527565", "0.65242153", "0.65192026", "0.6510435", "0.6507498", "0.6506569", "0.65042776", "0.64998305", "0.64933306", "0.64801335", "0.647704", "0.6471853", "0.6465927", "0.64602196", "0.6455876", "0.6449931", "0.6444046", "0.6433929", "0.6431153", "0.6430521", "0.6430521", "0.64294124", "0.6422913", "0.64081424", "0.6407116" ]
0.65171224
78
Checks if calls are over recursion limit
protected function isRecursionLimit() { return ($this->maxRecursionLimit > 0 && $this->totalRecursion >= $this->maxRecursionLimit); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function checkXdebugMaxNestingLevel() {}", "public function isLimitExceeded();", "public function isAPICallLimitErr() {\n // create implementation of this function inside gogoLib for trademe\n // it's easier to hook it there for api call limit checks\n // also if call limit occurs. create log at /var/tragento/apicalllimit.log\n // with dates. than when running new cron process check if date in call is less than 1 hour.\n // actually check if it is in current hour. if current hour than don't execute tragento cron\n // it's nice but requires coding time. don't overcomplicate error handling\n\n // $response->is_ok()\n // $response->error_message()\n // You have exceeded your API call quota for the current hour\n // it's a state for the life of trademe model. when api limit reached it can't be changed to ok later.\n // hovewer in next 5 minutes there will be another call from cron with clear state\n return $this->trademe->isAPICallLimitErr();\n }", "public function getCallStackLimit(): int {\n\t\treturn $this->callStackLimit;\n\t}", "public function hasLimit()\n {\n //check is little different than other stuff\n return ($this->_count > 0 || $this->_offset > 0);\n }", "private function limitCalls()\n {\n if ($this->lastCallTimestamp > 0) {\n $callsLimit = $this->shopifyClient->callLimit();\n $callsMade = $this->shopifyClient->callsMade();\n $callsLeft = $this->shopifyClient->callsLeft();\n\n Log::debug(\"ShopifyApi.limitCalls: callsLimit=$callsLimit, callsMade=$callsMade, callsLeft=$callsLeft\");\n $currentTimestamp = microtime(true);\n $deltaTimestamp = ($this->lastCallTimestamp > 0) ? $currentTimestamp - $this->lastCallTimestamp : 0;\n Log::debug(\"ShopifyApi.limitCalls: deltaTimestamp=$deltaTimestamp\");\n\n if ($callsLeft < 10) {\n Log::debug(\"ShopifyApi.limitCalls: DELTA < 10: wait 0.5 seconds\");\n usleep(500000);\n }\n } else {\n Log::debug(\"ShopifyApi.limitCalls: first call\");\n }\n $this->lastCallTimestamp = microtime(true);\n }", "private function check_for_no_recursion() {\n $parent_id=$this->navi_parent_page_id;\n if($parent_id=='0') return true;\n for($i=0;$parent_id!='0'&&$i<20;$i++) {\n if(strpos($parent_id,'s')===0) {\n $parent_id=substr($parent_id,1);\n if($parent_id==$this->page_id) return false;\n\n try {\n /** @noinspection PhpUndefinedMethodInspection */\n $stm=$this->uFunc->pdo(\"pages\")->prepare(\"SELECT\n navi_parent_page_id\n FROM\n u235_pages_html\n WHERE\n page_id=:page_id AND\n site_id=:site_id\n \");\n $site_id=site_id;\n /** @noinspection PhpUndefinedMethodInspection */$stm->bindParam(':page_id', $parent_id,PDO::PARAM_INT);\n /** @noinspection PhpUndefinedMethodInspection */$stm->bindParam(':site_id', $site_id,PDO::PARAM_INT);\n /** @noinspection PhpUndefinedMethodInspection */$stm->execute();\n }\n catch(PDOException $e) {$this->uFunc->error('120'/*.$e->getMessage()*/);}\n\n /** @noinspection PhpUndefinedVariableInspection PhpUndefinedMethodInspection */\n if(!$qr=$stm->fetch(PDO::FETCH_OBJ)) return false;\n $parent_id=$qr->navi_parent_page_id;\n if($parent_id=='0') return true;\n }\n elseif(strpos($parent_id,'p')===0) {\n $parent_id=substr($parent_id,1);\n if($parent_id==$this->page_id) return false;\n\n try {\n /** @noinspection PhpUndefinedMethodInspection */\n $stm=$this->uFunc->pdo(\"uPage\")->prepare(\"SELECT\n navi_parent_page_id\n FROM\n u235_pages\n WHERE\n page_id=:page_id AND\n site_id=:site_id\n \");\n $site_id=site_id;\n /** @noinspection PhpUndefinedMethodInspection */$stm->bindParam(':page_id', $parent_id,PDO::PARAM_INT);\n /** @noinspection PhpUndefinedMethodInspection */$stm->bindParam(':site_id', $site_id,PDO::PARAM_INT);\n /** @noinspection PhpUndefinedMethodInspection */$stm->execute();\n }\n catch(PDOException $e) {$this->uFunc->error('130'/*.$e->getMessage()*/);}\n\n /** @noinspection PhpUndefinedVariableInspection PhpUndefinedMethodInspection */\n if(!$qr=$stm->fetch(PDO::FETCH_OBJ)) return false;\n $parent_id=$qr->navi_parent_page_id;\n if($parent_id=='0') return true;\n }\n else return true;\n }\n return false;\n }", "protected function checkMaxExecutionTime() {}", "public function hasTimeLimitReached(): bool;", "protected function exceededRateLimit()\n {\n return $this->cache->get($this->config['keys']['requests']) > $this->config['limit'];\n }", "public function isLimited()\n {\n return ($this->limit > 0);\n }", "public function limitExceeded(): bool\n {\n return $this->limit !== 0 && $this->users()->count() >= $this->limit;\n }", "static public function IsRequestMemoryLimitReached() {\n if (self::$memoryLimit === false) {\n return false;\n }\n return memory_get_peak_usage(true) >= self::$memoryLimit;\n }", "public function isRequestLimitReached(): bool\n {\n if ($this->requestLimit === 0) {\n return true;\n }\n return app(RateLimiter::class)->tooManyAttempts($this->rateLimiterKey, $this->requestLimit, $this->decayTime);\n }", "public function canRepeat() {\n return (\n -1 === $this->repeat || // Unlimited repeats, or...\n $this->actualCalls < $this->repeat // Limit reached\n );\n }", "function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }", "private function isTimeLimitReached() \n {\n return $this->timeLimit < (microtime(true) - $this->startTime);\n }", "private function validateModificationCount()\n {\n if (count($this) >= self::ITEM_LIMIT) {\n throw new \\OverflowException(\n sprintf('You must not do more than %d modifications per request', self::ITEM_LIMIT)\n );\n }\n }", "function sizeLimitExceeded()\n {\n return ($this->getErrorCode() == 4);\n }", "public function getLimitReached() {\n return $this->_limitReached = (((int) self::model()->countByAttributes(array('ip'=>$this->ipAddr))) >= self::MAX_REQUESTS);\n }", "function canReach($hops)\n{\n $left = 1;\n\n for ($i = 0 ; $i < count($hops)-1; $i++) {\n $left = max($left-1, $hops[$i]);\n if ($left === 0) {\n return false;\n }\n }\n\n return true;\n}", "protected function isErrorModeRecursive()\n {\n return true === $this->is_error_mode_recursive;\n }", "function test()\r\n{\r\n static $count = 0; //here a static variable is used to remember the count between\r\n //function calls. Static variables are initialized only in the\r\n //first call of function\r\n $count++;\r\n echo $count;\r\n if ($count < 10) {\r\n test(); //Recursively call the function your in test() while $count < 10\r\n } //it will call it recursively 9 times, when it reaches 10\r\n //there will be no more recursive calls and then it will begin\r\n $count--; //finishing off every unfinished rec call decreasing the count everytime\r\n echo $count;\r\n}", "protected function exceededMaxRuntime(): bool\n {\n return (($this->maxRuntime > 0) && (time() - $this->startTime) > $this->maxRuntime);\n }", "public function hasStackTrace(){\n return $this->_has(7);\n }", "private function checkApiRequestsLimit()\n {\n $tempTime = time() - $this->startTime;\n if($this->apiRequestsCount >= $this->apiRequestsLimit && $tempTime < $this->apiTimeLimit) {\n usleep(($this->apiTimeLimit - $tempTime)*1000000);\n $this->apiRequestsCount = 1;\n $this->startTime = time();\n } else {\n $this->apiRequestsCount++;\n }\n }", "private function isLastMethodCallInChainCall(MethodCall $methodCall): bool\n {\n if (! $methodCall->var instanceof MethodCall) {\n return false;\n }\n\n $nextNode = $methodCall->getAttribute(AttributeKey::NEXT_NODE);\n\n // is last chain call\n return $nextNode === null;\n }", "public function getOmittedMaximumDepthOfXReachedMessage(): string;", "public function hasLimit()\n\t\t{\n\t\t\treturn is_array($this->limit);\n\t\t}", "public function getMaxRecursionDepth() {\n\t\treturn $this->_maxRecursionDepth;\n\t}", "public function has_children()\n {\n return ($this->size > 2);\n }", "function is_max_login_attempts_exceeded()\n\t{\n\t\t$this->ci->load->model('dx_auth/login_attempts', 'login_attempts');\n\t\t\n\t\treturn ($this->ci->login_attempts->check_attempts($this->ci->input->ip_address())->num_rows() >= $this->ci->config->item('DX_max_login_attempts'));\n\t}", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function valid()\n {\n return $this->_key + 1 <= $this->_limit;\n }", "public function isLimitReached(Event $event) :bool\n {\n return $event->is_limit_reached;\n }", "public function stepOutOfScope();", "public function check(): bool\n {\n if (0 == $this->limit) {\n return false;\n }\n\n $key = $this->parseKey();\n\n if ($this->limit > $this->count($key, $this->time)) {\n $this->hit($key, $this->time);\n\n return false;\n }\n\n return true;\n }", "function checkRecursive($x, $n, $curr_num = 1,$curr_sum = 0)\n{\n // Initialize number of ways to express\n // x as n-th powers of different natural\n // numbers\n $results = 0;\n \n // Calling power of 'i' raised to 'n'\n $p = power($curr_num, $n);\n $p + $curr_sum;\n while ($p + $curr_sum < $x)\n {\n // Recursively check all greater values of i\n $results += checkRecursive($x, $n, $curr_num+1,$p+$curr_sum);\n $curr_num++;\n $p = power($curr_num, $n);\n }\n \n // If sum of powers is equal to x\n // then increase the value of result.\n echo $p + $curr_sum;\n echo \"\\n\";\n if ($p + $curr_sum == $x)\n $results++;\n \n // Return the final result\n return $results;\n}", "public function reached()\r\n {\r\n $max = (int) $this->config->get('image_optimizer::settings.tiny_png.max_optimizations_per_month');\r\n\r\n if (empty($max)) {\r\n return false;\r\n }\r\n\r\n if ((bool) $this->config->get('image_optimizer::settings.tiny_png.enabled')\r\n && $this->config->get('image_optimizer::settings.tiny_png.api_key')\r\n ) {\r\n $tinyPngCount = $this->getTinyPngNumberOfCompressions();\r\n\r\n return $tinyPngCount >= $max;\r\n }\r\n\r\n return false;\r\n }", "private function validate_usage_limit() {\n\t\tif ( $this->usage_limit > 0 && $this->usage_count >= $this->usage_limit ) {\n\t\t\tthrow new Exception( self::E_WC_COUPON_USAGE_LIMIT_REACHED );\n\t\t}\n\t}", "function hasMore()\n {\n return ($this->bufferSize > 0);\n }", "function check_max_number_of_members($value)\n{\n\t$max_member_no_limit = $value['max_member_no_limit'];\n\tif ($max_member_no_limit == MEMBER_PER_GROUP_NO_LIMIT)\n\t{\n\t\treturn true;\n\t}\n\t$max_member = $value['max_member'];\n\treturn is_numeric($max_member);\n}", "public function check_rate_limit( $echo = FALSE ){\n\n\t\t\t// check rate-limiting (per IP)\n\t\t\t$raw_response = wp_remote_get( $this->api_urls['ratelimit'], array( 'sslverify' => $this->sslverify ) );\n\n\t\t\tif( is_wp_error( $raw_response ) ){\n\n\t\t\t\t$this->error = TRUE;\n\t\t\t\t$this->set_error(\n\t\t\t\t\t\t'warning',\n\t\t\t\t\t\tsprintf( '%s: %s', __( 'An error occurred while fetching the rate-limit', self::LANG ), $raw_response->get_error_message() )\n\t\t\t\t);\n\n\t\t\t} else {\n\n\t\t\t\t$headers = &$raw_response['headers'];\n\n\t\t\t\tself::$api_calls_remaining = $headers['x-ratelimit-remaining'];\n\t\t\t\tself::$api_calls_ratelimit = $headers['x-ratelimit-limit'];\n\n\t\t\t\tif( 0 >= self::$api_calls_remaining ){\n\n\t\t\t\t\t$this->error = TRUE;\n\t\t\t\t\t$this->set_error( 'warning', sprintf( __( 'Rate limit of %d api-calls is exceeded.', self::LANG ), self::$api_calls_ratelimit ) );\n\t\t\t\t\treturn FALSE;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn ( FALSE !== $echo ) ? sprintf( '%d out of %d api calls remaining.', self::$api_calls_remaining, self::$api_calls_ratelimit ) : TRUE;\n\n\t\t}", "function check_access() {\n foreach ($this->children as $child) {\n if ($child->check_access()) {\n return true;\n }\n }\n return false;\n }", "protected function checkLimits()\n {\n if ($this->isTimeLimit() || $this->isJobLimit()) {\n $this->stop();\n }\n }", "public function hasMaxcount(){\n return $this->_has(10);\n }", "private function validateMaxConnections(Channel $channel, ConnectionInterface $conn)\n {\n if ($channel->max_connections == 0) {\n return true;\n }\n\n $current_active = $channel->current_users();\n if ($current_active >= $channel->max_connections) {\n qlog(\"Hit the maximum amount of active connections on {$channel->name} for {$channel->site->name}.\");\n $conn->close();\n }\n\n return false;\n }", "public function check() : bool\n { \n foreach($this->caller->numbersCalled as $key => $number)\n {\n \n foreach ($this->card->numbers as $key => $cardLine) \n {\n \n if(in_array($number, $cardLine)){\n $this->confirmations++;\n continue 2;\n }\n\n }\n }\n\n if($this->confirmations<24)\n {\n return false;\n }\n\n return true;\n }", "function Count_Max_Reattempts($schedule, $origin_id=null)\n{\n\tstatic $recursion_level;\n\tif (empty($origin_id))\n\t{\n\t\t$max_level = 0;\n\t\t$reatt_count = 0;\n\t\tfor($x = 0; $x < count($schedule); $x++)\n\t\t{\n\t\t\t$e = $schedule[$x];\n\t\t\t$recursion_level = 1;\n\t\t\tif ($e->origin_id !== NULL && $e->origin_id > 0)\n\t\t\t{\n\t\t\t\t$reatt_count = max($reatt_count, Count_Max_Reattempts($schedule, $e->origin_id));\n\t\t\t\t$recursion_level--;\n\t\t\t\tif($recursion_level > $max_level) $max_level = $recursion_level;\n\t\t\t}\n\t\t}\n\t\t//return $reatt_count;\n\t\treturn $max_level;\n\t}\n\telse\n\t{\n\t\t$recursion_level++;\n\t\tfor($i = 0; $i < count($schedule); $i++)\n\t\t{\n\t\t\t$e = $schedule[$i];\n\t\t\tif ($e->transaction_register_id === $origin_id)\n\t\t\t{\n\t\t\t\tif ($e->origin_id === NULL) return 0;\n\t\t\t\telse return (Count_Max_Reattempts($schedule, $e->origin_id) + 1);\n\t\t\t}\n\t\t}\n\t}\n}", "function abp01_wrapper_increase_limits() {\n if (function_exists('set_time_limit')) {\n\t\t@set_time_limit(ABP01_WRAPPED_SCRIPT_MAX_EXECUTION_TIME_MINUTES * 60);\n\t}\n\tif (function_exists('ini_set')) {\n\t\t@ini_set('memory_limit', ABP01_WRAPPED_SCRIPT_MAX_MEMORY);\n\t\t//If the xdebubg extension is loaded, \n\t\t//\tattempt to increase the max_nesting_level setting, \n\t\t//\tsince (as is the case with large GPX files) \n\t\t//\tthe simplify algorithm will fail due to its recursive nature \n\t\t//\treaching that limit quickly if it's set too low\n\t\tif (extension_loaded('xdebug')) {\n\t\t\t@ini_set('xdebug.max_nesting_level', 1000000);\n\t\t}\n\t}\n}", "public function isDownloadLimitReached() {\r\n\t\treturn ($limit = $this->get('download_limit')) && $this->get('hits', 0) >= $limit;\r\n\t}", "function errorlog_inCallerStack() {\r\n $functionStack = array_column( debug_backtrace(), 'function' );\r\n $inCallerStack = array_search('_errorlog_logErrorRecord', $functionStack) !== false;\r\n return $inCallerStack;\r\n}", "public function hasStackFrame(){\n return $this->_has(1);\n }", "protected function isJobLimit(): bool\n {\n return $this->jobCount >= $this->options->jobLimit;\n }", "public function testResolveIteratorFailureRecursionDetected()\n {\n $testCb = $this->createCallable(function ($it) { return $it instanceof Iterator; });\n // Less than the amount of nested iterators\n $limit = 100;\n $iterator = $this->createIteratorAggregateRecursive();\n\n $subject = $this->createInstance();\n $_subject = $this->reflect($subject);\n\n $this->setExpectedException('OutOfRangeException');\n $_subject->_resolveIterator($iterator, $testCb, $limit);\n }", "public function incActualCalls() {\n $this->actualCalls+= 1;\n }", "protected function isMemoryOverflow()\n {\n $mem = memory_get_usage();\n if ($mem > ($this->_memory * 1024 * 1024)) {\n return true;\n }\n return false;\n }", "protected function calltreeCount( $stack, $start ) {\n\t\t$level = $stack[$start][1];\n\t\t$count = 0;\n\t\tfor ( $i = $start -1; $i >= 0 && $stack[$i][1] > $level; $i-- ) {\n\t\t\t$count ++;\n\t\t}\n\t\treturn $count;\n\t}", "function qa_post_limit_exceeded()\n{\n\tif (in_array($_SERVER['REQUEST_METHOD'], array('POST', 'PUT')) && empty($_POST) && empty($_FILES)) {\n\t\t$postmaxsize = ini_get('post_max_size'); // Gets the current post_max_size configuration\n\t\t$unit = substr($postmaxsize, -1);\n\t\tif (!is_numeric($unit)) {\n\t\t\t$postmaxsize = substr($postmaxsize, 0, -1);\n\t\t}\n\t\t// Gets an integer value that can be compared against the size of the HTTP request\n\t\t$postmaxsize = convert_to_bytes($unit, $postmaxsize);\n\t\treturn $_SERVER['CONTENT_LENGTH'] > $postmaxsize;\n\t}\n}", "public function accept() {\r\n\t\treturn $this->getInnerIterator()->getDepth() >= $this->minDepth;\r\n\t}", "public function isInitialCall();", "function isOverExecuted()\n {\n if ($this->start_time+$this->max_execution_time<time()) return true;\n else return false;\n }", "public function isFull()\n\t{\n\t\treturn count($this->_data) >= $this->_limit;\n\t}", "protected function memory_exceeded() {\n\t\t\t$memory_limit = $this->get_memory_limit() * 0.9; // 90% of max memory\n\t\t\t$current_memory = memory_get_usage( true );\n\n\t\t\tif ( $current_memory >= $memory_limit ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "function has_children(){\n\t\tglobal $post;\n\t\t$pages = get_pages('child_of='.$post->ID);\n\t\treturn count($pages);\n\t}", "public function tooManyFailedLogins()\n\t{\n\t\treturn $this->FailedLoginAttempts >\n\t\t\tYii::app()->params['authentication']['accountLocking']['failedLogins'];\n\t}", "protected function currentPageHasSubPages() {}", "function errorlog_is_limitlogin() {\n return defined(LIMIT_LOGIN_LOCKOUT_NOTIFY_ALLOWED);\n}", "protected function reachedMaxMoves(){\r\n if($this->totalMoves == $this->board->getMaxMoves()){\r\n return true;\r\n }\r\n return false;\r\n }", "protected function isOverTotalLimit($user) {\n\t\tif($this->totalLimit) {\n\t\t\t$current = $this->getTotalRequests($user);\n\t\t\tif($current >= $this->totalLimit->limit) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function depthCheck( $segments = [] )\n {\n $count = count( $segments, true );\n\n if( $count > Route::SEGMENT_DEPTH_LIMIT )\n {\n throw new \\Exception(\n 'Route Error :: Route Segment Limit Exceeded ( ' . $count . ' )'\n , Status::BAD_REQUEST\n );\n }\n }", "protected function checkCounter($c)\r\n {\r\n $c++;\r\n if (self::$LIMIT && $c > self::$LIMIT)\r\n die(\"counter exceeded \" . self::$LIMIT);\r\n }", "function check_ten($ten)\n{\n\treturn TRUE;\n}", "function MAD_checkMemoryCanBeSet()\n{\n $phpMemoryLimitInBytes = MAD_getMemoryLimitSizeInBytes();\n // Unlimited memory, no need to check if it can be set\n if ($phpMemoryLimitInBytes == -1) {\n return true;\n }\n MAD_increaseMemoryLimit($phpMemoryLimitInBytes + 1);\n $newPhpMemoryLimitInBytes = MAD_getMemoryLimitSizeInBytes();\n $memoryCanBeSet = ($phpMemoryLimitInBytes != $newPhpMemoryLimitInBytes);\n\n // Restore previous limit\n @ini_set('memory_limit', $phpMemoryLimitInBytes);\n return $memoryCanBeSet;\n}", "function call(){\n\n static $i = 0;\n\n echo $i . '';\n\n $i++;\n\n if($i<10){\n\n call();\n\n }\n\n}", "protected function limitCallRate()\n {\n if (!$this->callRateLimit) {\n return;\n }\n $now = microtime(true);\n $callIntervalActual = $now - $this->callTimeLast;\n $callIntervalNeeded = 1 / $this->callRateLimit;\n $callDelayNeeded = $callIntervalNeeded - $callIntervalActual;\n if ($callDelayNeeded > 0) {\n usleep($callDelayNeeded * 1000000); // Seconds to microseconds\n }\n $this->callTimeLast = $now;\n }", "function isFull()\n {\n return ($this->tail + 1) % $this->count == $this->head;\n }", "public function checkSubExtObj() {}", "public function isExceededAttempts()\n { \n $attempts = $this->con->prepare(\"SELECT attempts, last_attempts FROM login_attempts WHERE user_id = ? AND ip = ? \");\n $attempts->bind_param('is', $this->user_id, $this->ip);\n $attempts->execute();\n $attempts->store_result();\n $attempts->bind_result( $number_attempts, $last_attempts);\n $attempts->fetch();\n $rows_attempts = $attempts->num_rows;\n $attempts->free_result();\n $attempts->close();\n \n if( $attempts and $rows_attempts > 0)\n {\n $last_attempts = $this->calcIntervalAttempts($last_attempts);\n if($number_attempts >= self::$max_attempts and $last_attempts <= self::$time_bloq)\n {\n return self::$time_bloq - $last_attempts;\n } \n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n }", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "private function _isListMemberLimitReached($listname)\r\n {\r\n $members = $this->getMembers($listname);\r\n return self::LIST_MEMBER_LIMIT < count($members->users->user);\r\n }", "final public function hasChildren(): bool\n {\n return $this->valid() && $this->current()->hasPages();\n }", "function test()\n{\n static $count = 0;\n\n $count++;\n echo \"see:\".$count;\n if ($count < 10) {\n test();\n echo $count.\"<br>\";\n }\n $count--;\n}", "public function hasChildren()\n {\n }", "public function hasChildren()\n {\n }", "function updateLimitEnabled()\r\n\t{\r\n\t\treturn true;\r\n\t}", "function isPowerOverloaded($extra_consumption = 0)\n{\n global $game;\n\n // Calculate buildings energy consumption\n $buildings = $game->planet['building_1'] +\n $game->planet['building_2'] + \n $game->planet['building_3'] + \n $game->planet['building_4'] + \n $game->planet['building_10'] + \n $game->planet['building_6'] + \n $game->planet['building_7'] + \n $game->planet['building_8'] +\n $game->planet['building_9'] + \n $game->planet['building_11'] + \n $game->planet['building_12'] +\n $game->planet['building_13'];\n\n // Consider extra consumption from queued buildings\n $buildings += $extra_consumption;\n\n // Check if the active planet is the user's capital\n if ($game->player['user_capital']==$game->planet['planet_id'])\n $available_power = $game->planet['building_5']*11+14;\n else\n $available_power = $game->planet['building_5']*15+3;\n\n return ($buildings >= $available_power);\n}", "public function hasNumRowsLimit(){\n return $this->_has(7);\n }", "#[ReturnTypeWillChange]\n public function hasChildren()\n {\n return $this->iterator->hasChildren();\n }", "private function _checkMaxConnectionsPerIp($ip)\n {\n if(empty($ip))\n {\n return false;\n }\n if(!isset ($this->_ipStorage[$ip]))\n {\n return true;\n }\n return ($this->_ipStorage[$ip] > $this->_maxConnectionsPerIp) ? false : true;\n }", "public function __invoke($data): bool\n {\n return !(is_object($data))\n || count(get_object_vars($data)) >= $this->minimum;\n }", "public function hasQuotaUnlock(){\n return $this->_has(10);\n }" ]
[ "0.64803374", "0.62775165", "0.6108257", "0.60986096", "0.59806573", "0.5966221", "0.59483224", "0.5866838", "0.5866479", "0.58570784", "0.5793295", "0.567655", "0.56548727", "0.56530756", "0.56471217", "0.5550599", "0.5508779", "0.549021", "0.5431311", "0.5427538", "0.53953665", "0.53787845", "0.53688145", "0.53283453", "0.531954", "0.5316791", "0.5250496", "0.5242981", "0.52292484", "0.5224631", "0.52037954", "0.5195046", "0.51808006", "0.51808006", "0.51808006", "0.51808006", "0.51808006", "0.51630384", "0.51477534", "0.51437193", "0.5125197", "0.51211786", "0.5101006", "0.50962406", "0.5092867", "0.5092692", "0.5081342", "0.5063654", "0.5049328", "0.50468916", "0.50369394", "0.50341374", "0.5033504", "0.5031238", "0.50199616", "0.50152844", "0.5011948", "0.5009175", "0.49995878", "0.49814713", "0.49807435", "0.49769434", "0.4976567", "0.49714828", "0.49695224", "0.496206", "0.49369395", "0.49318126", "0.49240148", "0.49107626", "0.49101016", "0.49098662", "0.4901738", "0.4901365", "0.4899107", "0.48990726", "0.48948044", "0.4884781", "0.48840988", "0.48818627", "0.48761448", "0.48583642", "0.48571858", "0.48549855", "0.48540157", "0.48540157", "0.48540157", "0.48540157", "0.4852311", "0.48481166", "0.4847781", "0.4845873", "0.4845873", "0.48429444", "0.48425367", "0.48345804", "0.48295116", "0.4827659", "0.48250392", "0.48247787" ]
0.75162834
0
Throw a errror message via json and stop further execution
public function returnException($message = '') { wp_die( json_encode( [ 'job' => isset($this->options->currentJob) ? $this->options->currentJob : '', 'status' => false, 'message' => $message, 'error' => true ] ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function throw()\n {\n $response = new JsonResponse($this->getResponse(), $this->code);\n\n die($response->send());\n }", "protected function error()\n {\n $this->response = $this->response->withStatus(500);\n $this->jsonBody([\n 'input' => $this->payload->getInput(),\n 'error' => $this->payload->getOutput(),\n ]);\n }", "function error($message){\n die(json_encode([\"error\"=>true,\"data\"=>$message]));\n}", "public function throwErrorAction() {\n $message = $this->getRequestParam(\"message\", null);\n if (($error_code = $this->getRequestParam(\"error_code\")) && !empty($error_code)) {\n if (!empty($message))\n $this->respondWithValidationError($error_code, $message);\n else\n $this->respondWithError($error_code);\n }\n\n return;\n }", "function errorJSON(){\n header('Content-Type: application/json');\n $output['Error'] = \"Invalid Request\";\n die(json_encode($output));\n }", "protected function failure()\n {\n $this->response = $this->response->withStatus(400);\n $this->jsonBody($this->payload->getInput());\n }", "private function throwJsonError($status, $error)\n\t\t{\n\t\t\t$response = array('status' => $status, 'error' => $error);\n\t\t\techo json_encode($response);\n\t\t\texit;\n\t\t}", "public function failAction()\n {\n //====================================================================//\n // Return Dummy Response\n return new JsonResponse(array('result' => 'Ko'), 500);\n }", "function errorJson($msg){\n\tprint json_encode(array('error'=>$msg));\n\texit();\n}", "function exitWithError($errorMessage) {\n global $result;\n $result['errorMessage'] = \"Database error: \" . $errorMessage;\n echo json_encode($result);\n exit(1);\n }", "protected function get_json_last_error()\n {\n }", "protected static function checkJsonError() {\n if (json_last_error()) {\n throw new Exception('Invalid JSON data: ' . json_last_error_msg());\n }\n }", "static function throw_json_last_error (): void {\n if (StaticHandler::supervisor() == false) {\n return;\n }\n\n switch (json_last_error()) {\n case JSON_ERROR_NONE: {\n throw new Exception('JSON_LAST_ERROR: No errors');\n break;\n }\n case JSON_ERROR_DEPTH: {\n throw new Exception('JSON_LAST_ERROR: Maximum stack depth exceeded');\n break;\n }\n case JSON_ERROR_STATE_MISMATCH: {\n throw new Exception('JSON_LAST_ERROR: Underflow or the modes mismatch');\n break;\n }\n case JSON_ERROR_CTRL_CHAR: {\n throw new Exception('JSON_LAST_ERROR: Unexpected control character found');\n break;\n }\n case JSON_ERROR_SYNTAX: {\n throw new Exception('JSON_LAST_ERROR: Syntax error, malformed JSON');\n break;\n }\n case JSON_ERROR_UTF8: {\n throw new Exception('JSON_LAST_ERROR: Malformed UTF-8 characters, possibly incorrectly encoded');\n break;\n }\n default: {\n throw new Exception('JSON_LAST_ERROR: Unknown error');\n break;\n }\n }\n }", "private function error()\n {\n $json = array_merge($this->data, ['message' => $this->error, 'class' => 'error']);\n wp_send_json($json);\n }", "function returnWithError( $err )\n\t{\n\t\t$retValue = json_encode($err);\n\t\tsendResultInfoAsJson( $retValue, JSON_FORCE_OBJECT);\n\t}", "function error($sql) {\n\tif (defined('DEBUG')) {\n\t\tdie($sql);\n\t}\n\theader('Content-Type: application/json');\n\tdie('{\"result\":\"error\"}');\n}", "public function actionError() {\n if ($error = Yii::app()->errorHandler->error) {\n\t\t\t$this->sendRestResponse(500,array(\n\t\t\t\t'status' => false,\n\t\t\t\t'message' => $error['message'],\n\t\t\t\t'data' => $error,\n\t\t\t));\t\t\t\n }\n\t}", "function sendError($errorText){\n echo json_encode(array(\n 'status' => '50x',\n 'infotext' => $errorText\n ));\n die();\n}", "function sendFailure( $message ) {\n\t\t$obj = new stdClass();\n\n\t\t$obj->success = false;\n\t\t$obj->errorMessage = $this->escapeJsonString( $message );\n\n\t\t$this->sendJSON( $obj );\n\t}", "public function sendError($message=null, $endApplication = false) {\n $error = json_encode(array(\n 'jsonrpc' => $this->version,\n 'id' => isset($this->_request['id']) ? $this->_request['id'] : null,\n 'error' => $message,\n ));\n if ($endApplication) {\n die($error);\n } else {\n echo $error;\n }\n }", "function showjson_error($message) {\n\theader('Content-type: application/json');\n\techo json_encode( array(\"error\" => $message) );\n\texit();\n}", "function returnWithError($err)\n\t{\n\t\t$retVal = '{\"id\" : -1, \"error\":\"' . $err . '\"}';\n\t\tsendResultInfoAsJson($retVal);\n\t}", "private function fail() {\n\t\theader('HTTP/1.1 400 BAD REQUEST');\n\t\tdie('400 BAD REQUEST');\n\t}", "function Error(){\n header('Content-Type: application/json');\n echo ('false');\n http_response_code(200);\n }", "function failure($error) {\r\n $data = array();\r\n $data['success'] = false;\r\n $data['error'] = $error;\r\n\r\n header('Content-Type: application/json');\r\n exit(json_encode($data));\r\n}", "protected function notValid()\n {\n $this->response = $this->response->withStatus(422);\n $this->jsonBody([\n 'input' => $this->payload->getInput(),\n 'output' => $this->payload->getOutput(),\n 'messages' => $this->payload->getMessages(),\n ]);\n }", "function returnWithError( $err ) {\r\n\t\t$retValue = array('error' => $err);\r\n\t\tsendResultInfoAsJson( $retValue );\r\n\t}", "function respondWithError($message, $httpCode = 500) {\n header('Content-Type: application/json');\n http_response_code($httpCode);\n $json = json_encode([\n 'ok' => false,\n 'error' => $message,\n ], JSON_PRETTY_PRINT);\n echo $json;\n exit();\n}", "function error(){}", "function report_error($msg) {\n print json_encode ( array (\n \"ResultSet\" => array(\"Result\" => array()),\n \"Message\" => $msg\n ));\n exit;\n}", "public function testError()\n {\n $error = $this->response->error(404, 'File Not Found');\n json_decode($error);\n $checkJson = (json_last_error() == JSON_ERROR_NONE);\n\n $this->assertTrue($checkJson);\n }", "function raiseError($errorMessage, $responseCode){\n\t global $errors;\n\n\t\thttp_response_code($responseCode);\n\n\t die(json_encode(array(\n\t \t\"error\" => $errorMessage\n\t )));\n\t}", "protected function _checkJsonError()\n {\n $jsonError = json_last_error();\n if ($jsonError !== JSON_ERROR_NONE) {\n // find appropriate error message\n $message = 'Unknown JSON Error';\n if (isset($this->_jsonErrorMessages[$jsonError])) {\n $message = $this->_jsonErrorMessages[$jsonError];\n }\n\n throw new \\Exception(\n 'JSON Encoding / Decoding error: ' . $message . var_export(func_get_arg(0), true),\n $jsonError\n );\n }\n }", "function showError(){\n\t\techo json_encode(array(\n\t\t\t\"alert\" => \"error\",\n\t\t\t\"title\" => \"Failed to Update!\",\n\t\t\t\"message\" => \"Program Updating has been Failed\"\n\t\t));\n\t}", "function newErr($type, $message) {\n $response = array(\n 'error' => $type,\n 'message' => $message\n );\n return json_encode($response);\n \n }", "public function throwError();", "function errorResponse ($messsage) {\n header('HTTP/1.1 500 Internal Server Error');\n die(json_encode(array('message' => $messsage)));\n }", "function HTTPFail($message)\n{\n\terrorlog_withlevel(\"message=====>\".$message,3);\n\tprint json_encode(array('error'=>$message));\n\texit(0);\n}", "function showError(){\n\t\techo json_encode(array(\n\t\t\t\"alert\" => \"error\",\n\t\t\t\"title\" => \"Failed to Create!\",\n\t\t\t\"message\" => \"Course Creation has been Failed\"\n\t\t));\n\t}", "public function actionError()\n {\n if($error=Yii::app()->errorHandler->error)\n {\n if($error['code'] != 404 || !isset($aErrorMsg[$error['errorCode']])){\n Yii::log(' error : ' . $error['file'] .\":\". $error['line'] .\":\". $error['message'], 'error', 'system');\n }\n $ret = new ReturnInfo(FAIL_RET, Yii::t('exceptions', $error['message']), intval($error['errorCode']));\n if(Yii::app()->request->getIsAjaxRequest()){\n echo json_encode($ret);\n \n }else{\n if( empty($error['errorCode']) ){\n if(isset($this->aErrorMsg[$error['code']])){\n if(empty($this->aErrorMsg[$error['code']]['message'])) {\n $this->aErrorMsg[$error['code']]['message'] = $error['message'];\n }\n $this->render('error', $this->aErrorMsg[$error['code']]);\n }else{\n $this->render('error', $this->aErrorMsg['1000']);\n }\n }else{\n $this->render('error', $this->aErrorMsg[ $error['errorCode'] ]);\n \n }\n }\n \n } \n }", "function json_error ($msg='', $retval=null, $jqremote = false)\r\n {\r\n if (!empty($msg))\r\n {\r\n $msg = Lang::get($msg);\r\n }\r\n $result = array('done' => false , 'msg' => $msg);\r\n if (isset($retval)) $result['retval'] = $retval;\r\n\r\n $this->json_header();\r\n $json = ecm_json_encode($result);\r\n if ($jqremote === false)\r\n {\r\n $jqremote = isset($_GET['jsoncallback']) ? trim($_GET['jsoncallback']) : false;\r\n }\r\n if ($jqremote)\r\n {\r\n $json = $jqremote . '(' . $json . ')';\r\n }\r\n\r\n echo $json;\r\n }", "function report_error_and_return( $msg ) {\n $status_encoded = json_encode( \"error\" );\n $msg_encoded = json_encode( '<b><em style=\"color:red;\" >Error:</em></b>&nbsp;'.$msg );\n print <<< HERE\n{\n \"status\": {$status_encoded},\n \"ResultSet\": {\n \"Status\": {$status_encoded},\n \"Message\": {$msg_encoded}\n }\n}\nHERE;\n exit;\n}", "function loginFail($type) {\n echo json_encode(['code'=>$type]);\n\n exit();\n}", "function is_json_error( $json ) {\n\treturn isset_not_empty( $json, 'code' ) && isset_not_empty( $json, 'message' ) && get_array_var( $json, 'code' ) !== 'success';\n}", "function return_error($code) {\n $return[\"error\"] = $code;\n echo json_encode($return);\n exit();\n}", "function report_error( $msg ) {\n $status_encoded = json_encode( \"error\" );\n $msg_encoded = json_encode( '<b><em style=\"color:red;\" >Error:</em></b>&nbsp;'.$msg );\n print <<< HERE\n{\n \"ResultSet\": {\n \"Status\": {$status_encoded},\n \"Message\": {$msg_encoded}\n }\n}\nHERE;\n exit;\n}", "public function failed();", "function errorHandler($message, $code){\n echo '{\"errors\":\"'.$message.'\"}';\n http_response_code($code);\n return false;\n }", "private function badRequest($msg) {\r\n $this->getHttpResponse()->setCode(400);\r\n $this->sendResponse(new JsonErrorResponse($msg));\r\n }", "function json_error($message, $extra = NULL, $die = TRUE){\r\n\t$json_out = array(\r\n\t\t\"status\" => \"2\",\r\n\t\t\"message\" => $message\r\n\t);\r\n\tif(is_array($extra)){\r\n\t\t$json_out = array_merge($json_out, $extra);\r\n\t}\r\n\tif($die){\r\n\t\tdie(json_encode($json_out));\r\n\t}else{\r\n\t\treturn $json_out;\r\n\t}\r\n}", "public function throwException($code, $message)\n {\n header(\"content-type: application/json\"); // ; charset=utf-8\n $error_message = json_encode([\n 'error' => [\n 'status' => $code,\n 'message' => $message\n ]\n ]);\n echo $error_message;\n exit();\n }", "public function Access_error ()\n\t\t{\n\t\t\t$errMsg[0]['error'] = \"Invalid URL!\";\n\t\t\treturn json_encode ($errMsg);\n\t\t}", "private function returnError($message){\n return response()->json([\n 'status' => 'error',\n 'error' => $message\n ], 200);\n }", "public static function send_http_error( $data )\n {\n \\HttpResponse::status( 400 );\n \\HttpResponse::setContentType( 'application/json' ); \n \\HttpResponse::setData( $data );\n \\HttpResponse::send();\n }", "function api_error($code=5000, $data = [], $msg = '')\n{\n if (empty($data)) $data = (object)[];\n if ($msg == '') {\n $msg = config('api_response_code')[$code];\n }\n $json = [\n 'code'=>$code,\n 'data'=>$data,\n 'msg'=>$msg\n ];\n return response()->json($json);\n}", "private function _throwJSONException( $e ) {\n\t\treturn new JsonResponse( array('success'=>false, 'errorMessage'=>$e->getMessage(), 'errorCode'=>$e->getCode() ) );\n\t}", "protected function errorAction() {}", "public function error();", "function api_error($err_code, $err_message, $err_data = null, $id = null) {\n $err = ['code'=>$err_code, 'message'=>$err_message];\n if (!is_null($err_data)) $err['data'] = $err_data;\n return api_return($err, $id, 'error');\n}", "private function examineResponse($json) {\n $decoded = json_decode($json);\n\n if ( isset($decoded->error) ) {\n error_log('Web Service Responded With Error: ' . $decoded->error->message . ' : ' . $decoded->error->code);\n throw new EmmaDashboardServiceException('Service Error, please contact Administrator.');\n }\n }", "public function failError()\n {\n if (\n ($packet = $this->getPacket()) and\n $packet['status'] !== Job::STATUS_FAILED and\n ($e = json_decode($packet['exception'], true))\n ) {\n return empty($e['error']) ? var_export($e, true) : $e['error'];\n }\n\n return 'Unknown exception';\n }", "public function errorOccured();", "function error($message) {\n die(\"{\\\"error\\\":\\\"$message\\\"}\");\n }", "private static function sendBackError() {\n $supported_versions['ERROR'] = JText::_('COM_EASYSDI_SERVICE_FORM_DESC_SERVICE_NEGOTIATION_ERROR');\n echo json_encode($supported_versions);\n die();\n }", "private function jsonException($data)\n {\n $meta = $data->meta;\n return $meta->status.' '.$meta->description.' '.$meta->message.' For more info please visit: '.$meta->moreInfo;\n }", "private function error($response) {\n\t\tif(property_exists($response, \"error\") AND $response->code != 200) {\n\t\t\tthrow new MystoreAPI_exception(\"Error \".$response->code.\"<br />\".$response->error->message);\n\t\t}\n\t}", "public function displayException($i) {\n if (!headers_sent())\n header('X-Error: By Brid Api');\n $error = array('name' => $i->getMessage(), 'message' => $i->getFile(), 'error' => $i->getMessage(), 'class' => get_class($i));\n if ($i->getCode() != 0) {\n $error['code'] = $i->getCode();\n }\n\n echo json_encode($error);\n }", "public function makeErrorAction()\n {\n // test this\n\n $this->app->abort(404, 'I am a code generated 404 error message');\n\n }", "public abstract function onFail();", "public function testInvalidJsonProcessing()\n {\n $mock = new MockHandler(\n [\n new Response(200, [], '{\"malformedJSON\":[]]}'),\n ]\n );\n $handler = HandlerStack::create($mock);\n $client = new Client(['handler' => $handler]);\n\n // We want a proper exception, not a fatal error nor a silent fail.\n $this->expectException(JsonDecodingError::class);\n (new TestService(new ApiClient($client)))->getTest();\n }", "protected function invalidResponse(){\n return response()->json([\n 'ResultCode' => 1,\n 'ResultDesc' => 'Failed to complete the transaction',\n 'ThirdPartyTransID' => 0\n ]);\n\n }", "abstract public function error();", "public static function error()\n {\n if ($error = static::$errorHandler) {\n admin_exit($error());\n }\n\n if (Helper::isAjaxRequest()) {\n abort(403, trans('admin.deny'));\n }\n\n admin_exit(\n Content::make()->withError(trans('admin.deny'))\n );\n }", "protected function reportJsonDeserializationError()\n {\n $error = json_last_error();\n switch ($error) {\n case JSON_ERROR_NONE:\n return;\n default:\n trigger_error(\n sprintf('Error deserializing JSON (%d)', $error),\n E_USER_WARNING\n );\n break;\n }\n }", "public static function throwError($message) {\n header('HTTP/1.0 404 Not Found');\n\n $this->_sendResponse(200, CJSON::encode(array('DoTransaction' => (array('ErrorMessage' => $message)))));\n }", "public static function error($status,$message){\r\n throw new \\Luracast\\Restler\\RestException($status, $message);\r\n }", "public static function sendError($errMessage = \"\") {\n //TODO: send 404\n $responseObj = new Response();\n $body = array();\n $body['error']['code'] = 400;\n $body['error']['type'] = \"error_unknown\";\n $body['error']['message'] = $errMessage;\n $responseObj->setContent(json_encode($body));\n $responseObj->setStatus('400');\n $responseObj->setHeader('Content-Type: application/json');\n\n $responseObj->sendResponse();\n }", "public function testErrorMessageBadFormat()\n {\n $errorResponse = json_decode('{\n \"error\": {\n \"code\": \"UNPROCESSABLE_ENTITY\",\n \"message\": {\n \"errors\": [\n \"Bad format\",\n \"Bad format 2\"\n ],\n \"bad_data\": [\n {\n \"first_message\": \"Bad format 3\",\n \"second_message\": \"Bad format 4\",\n \"thrid_message\": \"Bad format 5\"\n }\n ]\n },\n \"errors\": []\n }\n }', true);\n\n\n try {\n Requestor::handleApiError(null, 404, $errorResponse);\n } catch (EasyPostException $error) {\n $this->assertEquals(\n 'Bad format, Bad format 2, Bad format 3, Bad format 4, Bad format 5',\n $error->getMessage()\n );\n }\n }", "function errorOutput($output, $code = 500) {\n http_response_code($code);\n echo json_encode($output);\n}", "protected function showMessageError($argMsg) {\n echo(json_encode(array('code' => 3, 'message' => $argMsg)));\n }", "public function actionError()\n\t{\n\t\t$this->layout = '//layouts/error';\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif ( empty($error['message']) && isset(Config::$errors[ $error['code'] ]) ) {\n\t\t\t\t$error['message'] = Config::$errors[$error['code']];\n\t\t\t}\n\n\t\t\tif(Yii::app()->getRequest()->getIsAjaxRequest()) {\n\t\t\t\tYii::app()->end( json_encode( array('error'=>$error['code'], 'message'=>$error['message']), JSON_NUMERIC_CHECK ) );\n\t\t\t} else\n\t\t\t\t$this->render('error',array('error' => $error));\n\t\t}\n\t}", "function Generic_deny($message = \"An error has occured\")\n{\n exit(\n json_encode(\n array(\n \"message\"=>$message,\n \"tracking_id\"=>LoggingEngine::$TRACKING_ID\n )\n )\n );\n}", "public function runFailed();", "public function failed()\n {\n // Do nothing\n }", "function admin_error($code = 5000, $data = [], $msg = '')\n{\n if (empty($data)) $data = (object)[];\n if ($msg == '') {\n $msg = config('admin_response_code')[$code];\n }\n $json = [\n 'code'=>$code,\n 'data'=>$data,\n 'msg'=>$msg\n ];\n return response()->json($json);\n}", "public function fail($message) {\n\t\tdie('cobweb: ' . $message . \"\\n\");\t\n\t}", "function throw_user_error($error_code, $error_text) {\n http_response_code($error_code);\n echo $error_text;\n exit;\n}", "public function failedValidation(Validator $validator)\n {\n $data_error = [];\n $error = $validator->errors()->all(); #if validation fail print error messages\n foreach ($error as $key => $errors):\n $data_error['status'] = 400;\n $data_error['message'] = $errors;\n endforeach;\n //write your bussiness logic here otherwise it will give same old JSON response\n throw new HttpResponseException(response()->json($data_error, 400));\n }", "private function failure() : void\n {\n (new Repository())->disconnect();\n (new Session())->set('user','success', 'Une erreur est survenue nous vous prions de réessayer ultèrieurement');\n header('Location:' . self::REDIRECT_HOME);\n die();\n }", "protected function handleJsonRpcErrors($response) {\n if (isset($response->error)) {\n $error = $response->error;\n switch($error->code) {\n case -32601:\n throw new JsonRpcException($error->message, $error->code);\n case -32602:\n throw new JsonRpcException(\n $error->message, $error->code);\n default:\n throw new JsonRpcException(\n $error->message.\"\\nStacktrace : \" . $error->data->stacktrace,\n $error->code);\n }\n }\n }", "protected function renderAsError() {}", "public function isError(): bool\n {\n return $this->get('json', 'error') === true;\n }", "public function throwValidation(array $errors = [])\n {\n $response = new JsonResponse($errors, 422);\n\n die($response->send());\n }", "public static function throwInputNotFoundException()\n {\n return Response::json([\n 'message' => 'Could not get data from request'\n ], 422);\n\n /**\n * if running tests on call\n */\n if (app()->environment() === 'testing') {\n dd('Could not get data from request');\n }\n }", "function APIerror() {\n\t\t$session = JFactory::getSession();\n\n\t\t$order_id = $session->get('wbtypayments.order_id', 0);\n\n\t\t// Initialize database\n\t\t$db = JFactory::getDBO();\n\n\t\tsession_start();\n\t\t$resArray=$_SESSION['reshash'];\n\n\t\t// Get any URL errors\n\t\tif(isset($_SESSION['curl_error_no'])) {\n\t\t\t$errorCode= $_SESSION['curl_error_no'] ;\n\t\t\t$errorMessage=$_SESSION['curl_error_msg'] ;\n\t\t\tsession_unset();\n\t\t} else {\n\t\t\t// Create a new row in the errors table with this order ID\n\t\t\t$query = \"INSERT INTO #__wbty_payments_errors (`number`,`message`,`order_id`) VALUES ('\".$resArray['L_ERRORCODE0'].\"','\".$resArray['L_LONGMESSAGE0'].\"','$order_id')\";\n\t\t\t$db->setQuery($query);\n\t\t\t$db->query();\n\t\t\t$error_id = $db->insertid();\n\n\t\t\tforeach($resArray as $key => $value) {\n\t\t\t\tswitch ($key) {\n\t\t\t\t\tcase 'L_ERRORCODE0':\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'L_LONGMESSAGE0':\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$query = \"INSERT INTO #__wbty_payments_error_extra_items (`error_id`,`name`,`value`) VALUES ('\".$error_id.\"','\".$key.\"','\".$value.\"')\";\n\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t$db->query();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "private function json_error($error)\n {\n return response()->json($error,500);\n }", "public static function sendErrorResponse($error = null){\n http_response_code(500);\n echo $error;\n die();\n }", "public function databaseError($errorArray)\n { \n $errorArray = json_encode($errorArray, JSON_PRETTY_PRINT);\n header(\"HTTP/1.0 400 Bad request\");\n header(\"Content-type: application/json\");\n exit($errorArray);\n }", "function json_bad()\n{\n\treturn '{\"sessionStatus\":false}';\n}", "public function handleError($e)\n {\n $code = (int) $e->getCode();\n $message = $e->getMessage();\n if ( !in_array($code, $this->_allowedErrorCodes) && $this->isDebugging ) {\n $code = self::ERROR_UNKNOWN;\n }\n \n $this->_server->fault($message, $code, null);\n \n /*\n * Due to a bug in Zend_Json_Server_Error, we have to modify the error\n * response to make sure the custom error code makes it to the client.\n */\n $badJson = $this->_server->getResponse()->toJson();\n \n $decoded = Zend_Json::decode($badJson);\n if ( isset($decoded['error']) \n && isset($decoded['error']['code']) ) {\n $decoded['error']['code'] = $code;\n }\n \n $json = Zend_Json::encode($decoded);\n \n if ($code == self::ERROR_CREDENTIALS_INVALID \n || $code == self::ERROR_DIGEST_INVALID \n || $code == self::ERROR_DIGEST_MISSING) {\n $this->sendAuthChallengeHeader();\n }\n \n header('Content-Type: application/json');\n if (isset($_GET['d'])) die($_GET['jsoncallback'].\"(\".$json.\")\");\n else die($json);\n }" ]
[ "0.7286752", "0.71994686", "0.7082114", "0.6931237", "0.68939364", "0.68295175", "0.68233883", "0.6803885", "0.6764631", "0.6746284", "0.67190915", "0.66572684", "0.6633592", "0.66039854", "0.6554429", "0.6547174", "0.65447205", "0.6543288", "0.65015733", "0.6497367", "0.6479155", "0.6390942", "0.63902235", "0.63814574", "0.63701445", "0.6366224", "0.636057", "0.6356513", "0.6310272", "0.6297915", "0.62974185", "0.6291611", "0.6277286", "0.6238377", "0.6231477", "0.6221558", "0.6215159", "0.62106097", "0.62089765", "0.6184969", "0.6181617", "0.6181565", "0.61738896", "0.6164651", "0.61422294", "0.6129911", "0.6121163", "0.61085266", "0.6101201", "0.6078698", "0.6014281", "0.6012272", "0.5995758", "0.5987204", "0.59388125", "0.59341955", "0.5921053", "0.59070486", "0.5901479", "0.58994436", "0.5897136", "0.5886804", "0.58822614", "0.5879709", "0.58794737", "0.58740807", "0.58626604", "0.5861149", "0.58611315", "0.58606946", "0.5853078", "0.5851356", "0.5845368", "0.58440614", "0.5840283", "0.58261234", "0.58116966", "0.5810796", "0.5808659", "0.58073384", "0.5799628", "0.5791266", "0.5787606", "0.57836616", "0.57652426", "0.5764672", "0.576377", "0.57577735", "0.57453555", "0.5737265", "0.5737", "0.57351506", "0.5732451", "0.5724825", "0.5722116", "0.5718308", "0.57182944", "0.5717342", "0.57168424", "0.5710334" ]
0.6378874
24
Delete all product orders
public function updateOrder(Request $request){ $ids_product_to_delete = array(); $order_details = OrderDetails::select('id')->where('order_id','=',$request->order_id)->get()->toArray(); foreach($order_details as $value){ array_push($ids_product_to_delete,$value); } DB::table('order_details')->whereIn('id', $ids_product_to_delete)->delete(); // Insert lại product $arr_product_id = $request->product_id; $dataInsert = array(); $order_total_price = 0; foreach($arr_product_id as $key => $value){ $product = Product::select('price')->where('id',$key)->get()->toArray(); $arrayPush = array('order_id'=> $request->order_id,'product_id'=> $key,'quantity' => $value,'price' => $product[0]['price'],'total_price'=>$product[0]['price'] * $value); array_push($dataInsert,$arrayPush); $order_total_price = $order_total_price + ($product[0]['price'] * $value); } DB::table('order_details')->insert($dataInsert); // Query Builder $order_update = Orders::find($request->order_id); $order_update->total_price = $order_total_price; $order_update->save(); $user_current_login = Auth::user()->id; $orderProcessing = new OrderProcessing(); $orderProcessing->order_id = $request->order_id; $orderProcessing->user_id = $user_current_login; $orderProcessing->status = 1; $orderProcessing->note = 'Cập nhật lại chi tiết đơn hàng'; $orderProcessing->order_status = $request->order_status; $orderProcessing->save(); return response()->json(['msg' => 'Cập nhật chi tiết đơn hàng thành công!']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteAllOrdersInBasket() {\n\n //$delete = $this->delete($where);\n // first we need the basketID\n $basketUser = $this->getBasketUserFromAuth();\n // then we delete all detail of the basket\n $result = null;\n if ($basketUser != null) {\n $basketDetailModel = new Application_Model_BasketDetail();\n $result = $basketDetailModel->deleteAllOrdersInBasket($basketUser);\n }\n\n // then the basket\n try {\n $basketID = $basketUser['basketID'];\n// $result = $this->delete(Zend_Db_Table::SELECT_WITH_FROM_PART)\n// ->where('basketID = ?', $basketID);\n \n $condition = array(\n 'basketID = ?' => $basketID\n );\n $this->delete($condition);\n \n } catch (Exception $ex) {\n \n }\n }", "public function delete_OrderPage(){\n $id_product = $_REQUEST[\"id_product\"];\n $id_order = $_REQUEST[\"id_order\"];\n $query = \"DELETE FROM order_u\n WHERE order_u.id = $id_order;\";\n $data = $this->connection->query($query);\n\n $query = \"DELETE FROM order_product\n WHERE order_product.order_id = $id_order;\";\n $data = $this->connection->query($query);\n \n }", "public function destroy(Order $order){\n foreach ($order->products as $product){\n $product->update([\n 'stock'=>$product->stock +$product->pivot->quantity\n ]);\n }//end of foreach\n $order->products()->detach();\n $order->delete();\n session()->flash('success',__('site.deleted_successfully'));\n return redirect()->route('dashboard.orders.index');\n }", "public function clear_all_orders()\n {\n if(request('sabotaj') == 'Sabotaj'){\n\n //Delete all orders\n $all_orders = Order::pluck('id');\n Order::whereIn('id',$all_orders)->delete();\n\n //Delete all product options\n CartProductOption::truncate();\n\n //Delete cart items\n $all_cart_items = CartItem::pluck('id');\n CartItem::whereIn('id',$all_cart_items)->delete();\n\n //Delete cart products\n $all_cart_products = CartProduct::pluck('id');\n CartProduct::whereIn('id',$all_cart_products)->delete();\n\n //Delete all carts\n $all_carts = Cart::pluck('id');\n Cart::whereIn('id',$all_carts)->delete();\n\n return 'Silindi';\n }\n }", "public function destroy(orders $orders)\n {\n //\n }", "public function removeAll()\n {\n echo $this->_em->createQueryBuilder()->delete('Tdms\\Entity\\Product', 'p')->getQuery()->execute();\n }", "public function sDeleteBasketOrder()\r\n {\r\n $sessionId = Shopware()->Session()->get('sessionId');\r\n\r\n if (empty($sessionId)) return;\r\n\r\n $deleteWholeOrder = Shopware()->Db()->fetchAll(\"\r\n SELECT * FROM s_order_basket WHERE sessionID = ?\r\n \",array($sessionId));\r\n\r\n foreach ($deleteWholeOrder as $orderDelete) {\r\n Shopware()->Db()->executeUpdate(\"\r\n DELETE FROM s_order_basket WHERE id = ?\r\n \",array($orderDelete[\"id\"]));\r\n }\r\n }", "public function destroy(Orders $orders)\r\n {\r\n //\r\n }", "public function destroy(Order $orders)\n {\n //\n }", "public function destroy(Orders $orders)\n {\n //\n }", "public function destroy(Orders $orders)\n {\n //\n }", "public function product_delete()\n\t\t\t\t{\n\t\t\t\t}", "public function deleted(Order $order)\n {\n foreach (OrderProduct::where('order_id',$order->id)->get() as $orderProduct) {\n $product = Product::find($orderProduct->product_id);\n $cardController = new GlobalCardController();\n $product->count = $cardController->countProduct($orderProduct->product_id);\n $product->save();\n }\n }", "public function deleteUnpublished()\n {\n /**\n * @var OrderProduct[] $products\n */\n $products = $this->products;\n foreach ($products as $product) {\n $product->delete();\n }\n \n $this->delete();\n }", "public function destroy($id)\n {\n // get all record table orders where products.id = orders.product_id\n $orders = Orders::where('product_id',$id)->get();\n\n foreach($orders as $order) {\n // get order_id\n $orderId = $order->id;\n\n // get transaction_id\n $transactionId = $order->transaction_id;\n\n // delete record table order_histories where order_histrories.order_id = orders.id\n $orderhistory = Order_histories::where('order_id',$orderId);\n if($orderhistory) {\n $orderhistory->delete();\n }\n\n\n // delete record table rate where rate.order_id = orders.id\n $rate = Rate::where('order_id',$orderId);\n if($rate){\n $rate->delete();\n }\n \n // delete record table orders follow transaction_id\n $o = Orders::where('transaction_id',$transactionId);\n if($o){\n $o->delete();\n }\n // Orders::destroy($orderId);\n\n // delete record table trasactions where transactions.id = orders.transaction_id\n Transactions::destroy($transactionId);\n }\n\n\n\n\n // delete record table carts where carts.product_id = products.id\n $cart = Cart::where('product_id',$id);\n if($cart){\n $cart->delete();\n }\n\n // delete record table comments where carts.product_id = products.id\n $comment = Comments::where('product_id',$id);\n if($comment){\n $comment->delete();\n }\n\n // delete record table products\n Products::destroy($id);\n\n return redirect('products');\n }", "public function edd_gdpr_delete_orders($email)\n { \n /*\n * delete order with all information\n */\n global $wpdb;\n \n $delete_customermeta = $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->prefix}edd_customermeta WHERE customer_id IN (SELECT user_id FROM {$wpdb->prefix}edd_customers WHERE email = %s)\",$email));\n\n $delete_customer = $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->prefix}edd_customers WHERE email =%s\",$email)); \n \n $delete_purchase = $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->prefix}posts WHERE ID IN (SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_key = %s AND meta_value = %s)\",'_edd_payment_user_email',$email));\n \n\t\t$delete_purchasemeta = $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->prefix}postmeta WHERE post_id IN (select edd_id from(SELECT post_id as edd_id FROM {$wpdb->prefix}postmeta WHERE meta_key = %s AND meta_value = %d) post_ids)\",'_edd_payment_user_email',$email));\n }", "public function delete()\n {\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers_payment_options;\");\n }", "public function destroy(Order $order)\n {\n foreach ($order->products as $product) {\n\n $product->update([\n 'stock' => $product->stock + $product->pivot->quantity\n ]);\n\n }//end of for each\n\n $order->delete();\n session()->flash('success', __(' تم الحذف بنجاح'));\n return redirect()->route('dashboard.orders.index');\n \n }", "public function deleteOrder($id){\n $orders = Order_Ecommerces::find($id);\n \n //PRENDO L'ARRAY CHE TORNA DALLA QUERY PRECEDENTE E CONFRONTO L'ID DELL'ORDINE CON L'ID DELLA RELAZIONE TRA ORDINE E LA TABELLA ORDER_ECOMMERCE_PRODUCT\n $orderProductId=Order_Ecommerce_product::where('order_ecommerce_id', '=', $orders['id'])->get();\n \n\n foreach ($orderProductId as $item) {\n \n //UNA VOLTA RECUPERATO L'ID DELL'ORDINE TRAMITE LA RELAZIONE, POSSO ASSEGNARE A UNA VARIABILE LA QUANTITA ORDINATA IN FASE DI ORDINE DEL PRODOTTO \n $quantita_bloccata=$item['quantita'];\n //SELEZIONO LA TABELLA SECTORS E LA COLONNA PRODUCT_ID E LA CONFRONTO CON IL PRODUCT_ID DELL'ORDINE SE IL VALORE è UGUALE, CHIEDO ALLA QUERY DI DECREMENTARE IL VALORE DELLA QUANTITà BLOCCATA DI QUELL'ORDINE CON LA COLONNA PRESENTE NELLA TABELLA SECTOR, IN MODO CHE QUANDO CANCELLERò L'ORDINE, LA QUANTITà SARà DI NUOVO DISPONIBILE\n $updateQty=DB::table('sectors')->where('product_id', '=', $item['product_id'])->decrement('quantita_bloccata', $quantita_bloccata);\n }\n\n\n\n //UNA VOLTA CHE HO FATTO TUTTI I CONTROLLI E RESETTATO LO STATO DELLE QUANTITA A PRIMA CHE L'ORDINE VENISSE CREATO, SETTO L'ORDINE STESSO SU STATO ANNULLATO, IL DATO NON VERRà CANCELLATO DAL DATABASE IN MODO DA POTERLO USARE PIU AVANTI PER FINI STATISTICI\n $orderDelete= DB::table('order_Ecommerces')->where('id', '=', $id)->update(['annullato' => 1]);\n\n return redirect()->back();\n }", "public function delete_order()\n\t{\n\t\tif ($this->checkLogin('A') == '') {\n\t\t\tredirect('admin');\n\t\t} else {\n\t\t\t$order_id = $this->uri->segment(4, 0);\n\t\t\t$condition = array('id' => $order_id);\n\t\t\t$old_order_details = $this->order_model->get_all_details(PRODUCT, array('id' => $order_id));\n\t\t\t$this->update_old_list_values($order_id, array(), $old_order_details);\n\t\t\t$this->update_user_order_count($old_order_details);\n\t\t\t$this->order_model->commonDelete(PRODUCT, $condition);\n\t\t\t$this->setErrorMessage('success', 'Order deleted successfully');\n\t\t\tredirect('admin/order/display_order_list');\n\t\t}\n\t}", "public function clearOrder() {\n\t\t\t$this->order->clearOrder();\n\t\t}", "public function delete()\n\t{\n\t\t$res = $this->getDB()->delete('quotes',['quote_id'=>$this->getId()]);\n\n\t\t// Check to see if the query ran properly.\n\t\tif(!$res)\n\t\t{\n\t\t\tthrow new Exception('The product was not deleted from the quote/order.');\n\t\t}\n\t}", "private function detach_order($order)\n {\n foreach ($order->products as $product) {\n\n $product->update([\n 'stock' => $product->stock + $product->pivot->quantity\n ]);\n\n }//end of for each\n\n $order->delete();\n\n }", "public function delete_all()\n {\n }", "static function cleanup()\n {\n $db = eZDB::instance();\n $rows = $db->arrayQuery( \"SELECT productcollection_id FROM ezorder\" );\n\n $db = eZDB::instance();\n $db->begin();\n if ( count( $rows ) > 0 )\n {\n $productCollectionIDList = array();\n foreach ( $rows as $row )\n {\n $productCollectionIDList[] = $row['productcollection_id'];\n }\n eZProductCollection::cleanupList( $productCollectionIDList );\n }\n // Who deletes which order in shop should be logged.\n eZAudit::writeAudit( 'order-delete', array( 'Comment' => 'Removed all orders from the database: eZOrder::cleanup()' ) );\n\n eZOrderItem::cleanup();\n $db->query( \"DELETE FROM ezorder_status_history\" );\n $db->query( \"DELETE FROM ezorder\" );\n $db->commit();\n }", "public function deleteOrder($order_id);", "public function actionDelete($id)\n {\n \n $Product = ProductsOrders::find()->where('id_order = :id_order', ['id_order' => $id])->all();\n foreach ($Product as $product):\n //echo $product->count;\n $modelProd = Products::find()->where('id_product = :id_product', [':id_product' => $product->id_product])->one();\n $modelProd->count = $modelProd->count + $product->count;\n $modelProd->update();\n endforeach;\n\n $this->findModel($id)->delete();\n $ProdOrders = ProductsOrders::find()->where('id_order = :id_order', [':id_order' => $id])->all();\n foreach ($ProdOrders as $prodOrd) {\n $prodOrd->delete();\n }\n return $this->redirect(['index']);\n }", "private function deleteOldProducts(): void\n {\n DB::table('products')\n ->whereIn('id', array_keys($this->databaseProducts))\n ->delete();\n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function clearProducts()\n\t{\n\t\t$sql=\"SET FOREIGN_KEY_CHECKS = 0\";\n\t\t$this->exec_stmt($sql);\n\t\t$tables=array(\"catalog_product_bundle_option\",\n\t\t\t\t\t \"catalog_product_bundle_option_value\",\n\t\t\t\t\t \"catalog_product_bundle_selection\",\n\t\t\t\t\t \"catalog_product_entity_datetime\",\n\t\t\t\t\t \"catalog_product_entity_decimal\",\n\t\t\t\t\t \"catalog_product_entity_gallery\",\n\t\t\t\t\t \"catalog_product_entity_int\",\n\t\t\t\t\t \"catalog_product_entity_media_gallery\",\n\t\t\t\t\t \"catalog_product_entity_media_gallery_value\",\n\t\t\t\t\t \"catalog_product_entity_text\",\n\t\t\t\t\t \"catalog_product_entity_tier_price\",\n\t\t\t\t\t \"catalog_product_entity_varchar\",\n\t\t\t\t\t \"catalog_product_entity\",\n\t\t\t\t\t \"catalog_product_option\",\n\t\t\t\t\t \"catalog_product_option_price\",\n\t\t\t\t\t \"catalog_product_option_title\",\n\t\t\t\t\t \"catalog_product_option_type_price\",\n\t\t\t\t\t \"catalog_product_option_type_title\",\n\t\t\t\t\t \"catalog_product_option_type_value\",\t\t\n\t\t\t\t\t \"catalog_product_super_attribute_label\",\n\t\t\t\t\t \"catalog_product_super_attribute_pricing\",\n\t\t\t\t\t \"catalog_product_super_attribute\",\n\t\t\t\t\t \"catalog_product_super_link\",\n\t\t\t\t\t \"catalog_product_relation\",\n\t\t\t\t\t \"catalog_product_enabled_index\",\n\t\t\t\t\t \"catalog_product_website\",\n\t\t\t\t\t \"catalog_category_product_index\",\n\t\t\t\t\t \"catalog_category_product\",\n\t\t\t\t\t \"cataloginventory_stock_item\",\n\t\t\t\t\t \"cataloginventory_stock_status\");\n\n\n\t\tforeach($tables as $table)\n\t\t{\n\t\t\t$this->exec_stmt(\"TRUNCATE TABLE `\".$this->tablename($table).\"`\");\n\t\t}\n\n\t\t$sql=\"SET FOREIGN_KEY_CHECKS = 1\";\n\n\t\t$this->exec_stmt($sql);\n\t}", "public function deleteOrderDetails($product_code,$order_id=NULL,$quantity,$token=NULL);", "public function clearTable()\n {\n return $this->getEntityManager()\n ->createQuery(\n 'DELETE CsvBundle:Product p'\n )\n ->getResult();\n }", "public function orders_delete($app, $collection_id = null, $order_id = null) {\n\t\t//Delete order\n\t\t$success = Elementorder::delete($order_id);\n\n\t\treturn $app->toJSON(['status' => $success]);\n\t}", "public function destroy(ProductOrder $productOrder)\n {\n //\n }", "public function orderpro_delete($id)\n { \n Orderproduct::where('id',$id)->delete();\n Session::flash('flash_message_success', 'Order products deleted successfully');\n return redirect()->back();\n }", "public function testDeleteOrder() {\n $order_item = $this->createEntity('commerce_order_item', [\n 'type' => 'default',\n 'unit_price' => [\n 'number' => '999',\n 'currency_code' => 'USD',\n ],\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'order_items' => [$order_item],\n 'uid' => $this->loggedInUser,\n 'store_id' => $this->store,\n ]);\n $order->delete();\n\n $order_exists = (bool) Order::load($order->id());\n $order_item_exists = (bool) OrderItem::load($order_item->id());\n $this->assertEmpty($order_exists, 'The new order has been deleted from the database.');\n $this->assertEmpty($order_item_exists, 'The matching order item has been deleted from the database.');\n }", "public function Delete() {\n $DeleteProduct = \"DELETE * FROM Products \";\n }", "public function sDeleteTemporaryOrder()\n {\n $sessionId = $this->getSession()->offsetGet('sessionId');\n\n if (empty($sessionId)) {\n return;\n }\n\n $deleteWholeOrder = $this->db->fetchAll('\n SELECT * FROM s_order WHERE temporaryID = ? LIMIT 2\n ', [$this->getSession()->offsetGet('sessionId')]);\n\n foreach ($deleteWholeOrder as $orderDelete) {\n $this->db->executeUpdate('\n DELETE FROM s_order WHERE id = ?\n ', [$orderDelete['id']]);\n\n $this->db->executeUpdate('\n DELETE FROM s_order_details\n WHERE orderID=?\n ', [$orderDelete['id']]);\n }\n }", "function deleteOrder($orderId);", "public function deleteAll(): void;", "abstract public function deleteAll();", "function tep_remove_order($order_id, $restock = false)\n{\n if ($restock == 'on')\n {\n $order_query = tep_db_query(\"select products_id, products_quantity from \" . TABLE_ORDERS_PRODUCTS . \" where orders_id = '\" . (int)$order_id . \"'\");\n\n while ($order = tep_db_fetch_array($order_query))\n {\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_quantity = products_quantity + \" . $order['products_quantity'] . \", products_ordered = products_ordered - \" . $order['products_quantity'] . \" where products_id = '\" . (int)$order['products_id'] . \"'\");\n }\n\n }\n\n tep_db_query(\"delete from \" . TABLE_ORDERS . \" where orders_id = '\" . (int)$order_id . \"'\");\n tep_db_query(\"delete from \" . TABLE_ORDERS_PRODUCTS . \" where orders_id = '\" . (int)$order_id . \"'\");\n tep_db_query(\"delete from \" . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . \" where orders_id = '\" . (int)$order_id . \"'\");\n tep_db_query(\"delete from \" . TABLE_ORDERS_STATUS_HISTORY . \" where orders_id = '\" . (int)$order_id . \"'\");\n tep_db_query(\"delete from \" . TABLE_ORDERS_TOTAL . \" where orders_id = '\" . (int)$order_id . \"'\");\n}", "public function delete()\n {\n // Get current Cart\n $order=\\App\\Order::where('user_id', Auth::user()->id)->where('status_order',1)->first();\n \n // Delete specific ordered product\n DB::table('order_lists')->where('id', $_POST['_productId'])->delete();\n \n $array = array();\n $currentOrder=$order[\"id\"];\n \n // Get current products according to ordered products\n foreach(\\App\\Order_list::where('order_id', $order[\"id\"])->get() as $order)\n {\n array_push($array, \\App\\Product::find($order->product_id));\n }\n \n $sumVat = 0;\n $sumWithoutVat = 0;\n \n // Get current sum of price and price (without VAT)\n \n foreach(\\App\\Order_list::where('order_id',$currentOrder)->get() as $order_list)\n { \n $sumVat=$sumVat+$order_list->price; \n $sumWithoutVat=$sumWithoutVat+$order_list->price_without_vat;\n }\n \n // Updating order's prices\n \n DB::table('orders')\n ->where('id', $currentOrder)\n ->update(array( \n 'price' => $sumVat,\n 'price_without_vat' => $sumWithoutVat\n ));\n \n // Get user's orders\n $myOrders=\\App\\Order::where('user_id',Auth::user()->id)->where('price','!=',0)->get();\n \n // Passes into home view all ordered products in Cart, POST headers, user's changed sum\n $data = array(\n 'orders' => $array,\n 'sum' => $sumVat,\n 'myOrders' => $myOrders\n );\n \n $_POST[\"status_msg\"]=1;\n $_POST[\"status_msg_body\"]=\"Successfully removed from Cart\";\n \n return view('home', $data);\n }", "private function detach_order($order){\n foreach ($order->products as $product){\n $product->update([\n 'stock'=>$product->stock + $product->pivot->quantity,\n ]);\n $order->delete();\n }\n }", "public function actionDeleteProduct()\n {\n $order = Order::model()->findByPk(Yii::app()->request->getPost('order_id'));\n\n if (!$order)\n $this->error404(Yii::t('CartModule.admin', 'ORDER_NOT_FOUND'));\n\n if ($order->is_deleted)\n throw new CHttpException(404, Yii::t('CartModule.admin', 'ORDER_ISDELETED'));\n\n $order->deleteProduct(Yii::app()->request->getPost('id'));\n }", "public function deleting(Order $Order)\n {\n //code...\n }", "public function actionDeleteProduct()\n\t{\n\t\t$model = OrderProduct::model()->findByPk($_POST['product_id']);\n\t\tif($model)\n\t\t\t$model->delete();\n\t}", "public function destroy(Products $products)\n {\n\n\n }", "public function EliminarProductos()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\t$sql = \" select codproducto from detalleventas where codproducto = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\n\t\t\t$sql = \" delete from productos where codproducto = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codproducto);\n\t\t\t$codproducto = base64_decode($_GET[\"codproducto\"]);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" delete from kardexproductos where codproducto = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codproducto);\n\t\t\t$codproducto = base64_decode($_GET[\"codproducto\"]);\n\t\t\t$stmt->execute();\n\n\t\t\theader(\"Location: productos?mesage=1\");\n\t\t\texit;\n\n\t\t}else {\n\n\t\t\theader(\"Location: productos?mesage=2\");\n\t\t\texit;\n\t\t}\n\n\t} else {\n\n\t\theader(\"Location: productos?mesage=3\");\n\t\texit;\n\t}\t\n}", "public function delete() {\n\t\tglobal $wpdb;\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_tax_rates' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'wc_tax_rate_classes' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_order_items' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_order_itemmeta' );// phpcs:ignore\n\t\t$this->order = null;\n\t\t$this->product = null;\n\t\t$this->tax_rate_ids = array();\n\t}", "public function deleteOrderProd($id){\n\t \t$query = $this->db->delete('client_order_prodcts',array('id'=>$id));\n\t\treturn 1;\n\t }", "public function delete() {\n\t\t$sql = 'delete from cart_orders_products_attributes where orders_products_attributes_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t}", "function deleteOrder () {\n\t//\terror_log ( 'addOrder\\n', 3, '/var/tmp/php.log' );\n\t$request = Slim::getInstance ()->request ();\n\t$orderId = json_decode ( $request->getBody () );\n\ttry {\n\t\t$db = new DbOperation();\n\t\t$db->deleteOrder ( $orderId->orderId );\n\t\techo '{\"deleteStatus\":\"YES\"}';\n\t} catch ( Exception $e ) {\n\t\t//\t\terror_log ( $e->getMessage (), 3, '/var/tmp/php.log' );\n\t\techo '{\"errorText\":\"Delete order fail with text as\", \"text\":}' . $e->getMessage () . $e . '}';\n\t}\n}", "public function destroy(Order $order)\n {\n\n }", "public function deleteAll(){\n try {\n $this->getTable()->delete();\n } catch (\\Exception $e) {\n $this->handleException($e);\n }\n return;\n }", "public function destroy(Order $order)\n {\n \n $order->order_lines()->delete();\n $order->delete(); \n return redirect()->route('orders.index');\n }", "function deleteall() {\n\t\t$this->_query( \"DELETE FROM $0\" );\n\t}", "public function clear()\n {\n BasketProductPeer::deleteAllProductsByBasketId($this->getId());\n }", "public function delete() {\r\n\r\n if ( ! current_user_can( 'activate_plugins' ) ) {\r\n return;\r\n }\r\n\r\n $this->deleteOrdersTable();\r\n delete_option( 'ce_option' );\r\n delete_option( 'ce_coins_alerts' );\r\n delete_transient( 'ce_flush_rules' );\r\n flush_rewrite_rules();\r\n\r\n }", "static function deleteAll()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM stores;\");\n $GLOBALS['DB']->exec(\"DELETE FROM stores_brands;\");\n }", "public function delete_sales_order() {\n\t\t$values=array(\"rstatus\"=>\"C\");\n\t\t$rowIndex = $_POST['row_index'];\n\t\t$where =array(\"id\"=>$_POST['so_id']);\n\t\tif($this->update(\"sales_order\",$values,$where)) {\t\t\t\n\t\t\techo '{\"salesOrderList\":{\"updateFlag\":\"void\",\"rowIndex\":'.$rowIndex.'}}';\n\t\t}\n\t\telse\n\t\t\techo 'Error while inserting sales tbl';\n\t}", "public function onBeforeDelete() {\n // Delete all items attached to this order\n foreach($this->Items() as $item) {\n $item->delete();\n }\n\n parent::onBeforeDelete();\n }", "function MyShop_OrderDelete($args) {\n global $_TABLES;\n\n $sql = \"DELETE FROM {$_TABLES['myshop_order']} WHERE orderid = '{$args['orderid']}'\";\n DB_query($sql);\n}", "public function delete()\n {\n // get request\n $request = $this->getRequest()->request;\n // get product ID from request\n $product_id = $request['a'];\n // get product ids from session\n $compareProducts = $this->View()->getSession('compare', $compareProducts)?$this->View()->getSession('compare', $compareProducts):array();\n\n if (in_array($product_id, $compareProducts)) {\n // unseting product from compare session\n $key = array_search($product_id, $compareProducts);\n unset($compareProducts[$key]);\n }\n\n $this->View()->setSession('compare', $compareProducts);\n\n if ($request['XHR']) {\n die(json_encode([\n 'success' => true,\n 'message' => $this->View()->translating('compare_item_deleted'),\n 'count' => count($compareProducts),\n ]));\n }\n\n Router::redirect('compare');\n }", "public function deleteAll(){\n if(APPLICATION_ENV == 'production'){\n throw new Exception(\"Not Allowed\");\n }\n $this->getMapper()->deleteAll();\n }", "public function destroy(int $id)\n {\n $order = Order::where('product_id', $id)->first();\n $order->delete();\n }", "public function deleteProduct(Product $product);", "public function destroy(order $order)\n {\n //\n }", "public function delete_product_purchase()\n\t{\n\t\tif(empty($this->request->data['id_cliente']) || empty($this->request->data['produto_id']))\n\t\t{\n\t\t\t$this->Return = false;\n\t\t\t$this->Message = 'Informar produto e codigo do cliente';\n\t\t\t$this->EncodeReturn();\t\n\t\t}\n\n\t\t$CartSession = json_decode(base64_decode($this->request->data['carrinho']), 1);\n\n\t\t$i = 0;\t\t\t\t\n\t\tforeach ($CartSession['item'] as $item) \n\t\t{\n\t\t\tif($item['Produto']['id'] == $this->request->data['produto_id'] && $i == $this->request->data['indice'])\n\t\t\t{\n\t\t\t\tunset($CartSession['item'][$i]);\t\t\t\t\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\t\t\n\n\t\tsort($CartSession['item']);\t\n\n\t\t##realiza soma de valores\n\t\t$this->CountPurchase($CartSession);\t\n\t\t$this->EncodeReturn();\t\n\t}", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "public function item_delete($id)\n{\n $product_items = ProductItem::where('product_id','=',$id)->get();\n\n foreach ($product_items as $key => $productitem) {\n\n $productItem = ProductItem::find($productitem->id);\n $productItem->delete();\n }\n\n}", "public function order_remove_products($products)\n {\n foreach($products as $product)\n {\n $product_id = $product->id;\n\n $order_id = $this->id;\n\n $quantity = $product->pivot->quantity;\n\n $in_cart_product = $this->product()->where('product_id',$product_id)->wherePivot('deleted_at',null)->first();\n\n if(is_null($in_cart_product))\n\n continue;\n\n if ($quantity >= $in_cart_product->pivot->quantity )\n {\n $this->removeProduct($product);\n }\n else\n {\n $update_quantity = $quantity - $in_cart_product->pivot->quantity;\n\n $in_cart_product->pivot->update(compact('update_quantity'));\n }\n \n }\n\n }", "public function destroy(Order $order)\n {\n //\n }", "protected function _delete()\n {\n $photoTable = Engine_Api::_()->getItemTable('socialstore_product_photo');\n $photoSelect = $photoTable->select()->where('album_id = ?', $this->getIdentity());\n foreach( $photoTable->fetchAll($photoSelect) as $productPhoto ) {\n $productPhoto->delete();\n }\n\n parent::_delete();\n }", "public function destroy(Products $products)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function order(Request $request)\n {\n $items = $request->all();\n unset($items['_token']);\n $client = Auth::user()->client()->first();\n $order = Orders::create([\n 'client_id' => $client->id,\n ]);\n $numb = 0;\n foreach($items as $key => $value)\n {\n if($value == 0)\n {\n continue;\n }\n OrderDetails::create([\n 'order_id' => $order->id,\n 'article_id' => $key,\n 'quantity' => $value,\n 'description' => 'hey',\n ]);\n $numb++;\n }\n if($numb == 0)\n {\n $order->delete();\n }\n $cart = new Shoppingcart($request);\n $cart->removeAll(); \n\n return redirect()->to('/home');\n }", "public function orderelements_delete($app, $collection_id = null, $order_id = null, $orderelement_id = null) {\n\t\t//Delete order\n\t\t$success = Orderelement::delete($orderelement_id);\n\n\t\treturn $app->toJSON(['status' => $success]);\n\t}", "function uc_order_edit_products_remove($form, &$form_state) {\n $form_state['refresh_products'] = TRUE;\n\n $order_product_id = intval($form_state['triggering_element']['#return_value']);\n\n if (module_exists('uc_stock')) {\n // Replace stock immediately.\n $product = uc_order_product_load($order_product_id);\n uc_stock_adjust($product->model, $product->qty);\n }\n\n uc_order_product_delete($order_product_id);\n\n $order = $form_state['build_info']['args'][0];\n $matches = array();\n preg_match('/products\\[(\\d+)\\]/', $form_state['triggering_element']['#name'], $matches);\n $key = $matches[1];\n\n unset($order->products[$key]);\n $order->products = array_values($order->products);\n}" ]
[ "0.74484295", "0.7284402", "0.71858174", "0.69368607", "0.6928705", "0.6926994", "0.6918711", "0.6909996", "0.6853684", "0.68527776", "0.68527776", "0.6844658", "0.6830891", "0.6820455", "0.67776", "0.6758542", "0.67324024", "0.67176944", "0.6672855", "0.6639976", "0.65909255", "0.65593565", "0.65360767", "0.65337753", "0.6516926", "0.6474221", "0.6472125", "0.64566255", "0.64564276", "0.64564276", "0.64564276", "0.64527893", "0.6442332", "0.6419789", "0.64080435", "0.6407834", "0.63920957", "0.63904446", "0.637472", "0.63716686", "0.6365714", "0.6356928", "0.6323767", "0.6319847", "0.63188714", "0.63180304", "0.6293347", "0.6285628", "0.62738526", "0.6266153", "0.62571114", "0.6250028", "0.6235531", "0.619205", "0.61838675", "0.6175202", "0.6166135", "0.6157691", "0.61536264", "0.6148472", "0.614804", "0.61441934", "0.6136665", "0.6133537", "0.6131265", "0.6116234", "0.6103653", "0.60914975", "0.6086698", "0.60803246", "0.6076546", "0.607594", "0.6063075", "0.6050603", "0.6045248", "0.6040121", "0.6035858", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60253", "0.60248375", "0.60210025", "0.6015473" ]
0.0
-1
Renvoie un batiment d'identifiant donne TODO utiliser le cache
public function getByIdAndLanguage($id, $language) { $select = $this->_createSelectQuery(); // batiment $select->field('id', $this->_tableName); $select->field('nom_' . $language, $this->_tableName, 'nom'); $select->field('description_' . $language, $this->_tableName, 'description'); $select->field('image', $this->_tableName); $select->field('niveau', $this->_tableName); $select->field('cout', $this->_tableName); $select->field('entretien', $this->_tableName); $select->field('duree_construction', $this->_tableName); $select->field('duree_recolte', $this->_tableName); $select->field('duree_hospitalisation', $this->_tableName); $select->field('cout_hospitalisation', $this->_tableName); $select->field('gain', $this->_tableName); $select->field('capacite', $this->_tableName); $select->field('visibilite', $this->_tableName); $select->field('id_prev', $this->_tableName); // Batiment Suivant $select->field('id', 'batiment_suivant', 'id_next'); // type_batiment 1 niveau $select->field('id', 'type1_batiment', 'id_type1'); $select->field('id_parent', 'type1_batiment', 'id_parent_type1'); $select->field('nom_' . $language, 'type1_batiment', 'nom_type1'); $select->field('is_unique', 'type1_batiment', 'is_unique_type1'); // type_batiment 2 niveau $select->field('id', 'type2_batiment', 'id_type2'); $select->field('id_parent', 'type2_batiment', 'id_parent_type2'); $select->field('nom_' . $language, 'type2_batiment', 'nom_type2'); $select->field('is_unique', 'type2_batiment', 'is_unique_type2'); // From et jointures $select->from($this->_tableName); $select->innerJoin('type_batiment', array('batiment.id_type = type1_batiment.id'), 'type1_batiment'); $select->leftJoin('type_batiment', array('type1_batiment.id_parent = type2_batiment.id'), 'type2_batiment'); $select->leftJoin('batiment', array('batiment_suivant.id_prev = batiment.id'), 'batiment_suivant'); // Conditions $select->addConditionEquals('batiment.id', $id); return $this->_mapper->buildObjectFromRow($this->_selectFirst($select)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNewId();", "public function obtenerID();", "public function obtenerId() {}", "protected function _makeId()\n\t{\n\t\treturn JCache::makeId();\n\t}", "public function cache() {\n if(!array_key_exists($this->steamId64, self::$steamIds)) {\n self::$steamIds[$this->steamId64] = $this;\n if(!empty($this->customUrl) &&\n !array_key_exists($this->customUrl, self::$steamIds)) {\n self::$steamIds[$this->customUrl] = $this;\n }\n }\n }", "private static function get_unique_id(){\n\t\tself::$u_id+=1;\n\t\treturn (string) self::$u_id;\n\t}", "public function tempId()\n {\n $this->id = uniqid('item');\n }", "protected static function getCacheIdentifier() {}", "function load_id(){\r\n $db = new Database();\r\n $sql = \"select * from \" . Interest::TABLE_NAME . \" where name=:name\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':name', $this->name);\r\n $stm->execute();\r\n if ($stm->rowCount() > 0){\r\n $row = $stm->fetch();\r\n $this->id = $row[\"id\"];\r\n }\r\n else{\r\n $this->save();\r\n $this->id = $db->pdo->lastInsertId();\r\n }\r\n }", "function obtener_sal()\n{\n\treturn uniqid('', true);\n}", "function generateNewId(){\n\t\t$id = null;\n\t\t//while ( $this->getSessionData($id) !== null ){\n\t\t\t$id = rand(0,100000);\n\t\t//}\n\t\treturn $id;\n\t}", "public function fetch_the_id() {}", "public function buscarID()\n {\n $sentencia = \"SELECT id, cl FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n foreach ($registros as $r) {\n $id = $r->id;\n }\n return $id;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "protected function get_cache_id() {\n\t\treturn wponion_hash_string( $this->module() . '_' . $this->unique() );\n\t}", "function getID();", "abstract public function getIdent();", "abstract public function getUniqueId();", "function getId();", "abstract public function getId();", "public function getID();", "public function getID();", "public function getID();", "abstract public function get_id();", "private function get_cache_id() {\n $handlername = get_class($this);\n if($this->id)\n $cache_id = '_cache_' . $handlername . '_' . $this->id;\n else \n $cache_id = '_cache_' . $handlername . '_all'; \n return $cache_id;\n\t}", "public function GetId () ;", "protected function cargaIdUbicacion() {\n $dao = new PGDAO();\n $strSql = $this->COLECCIONMAPEOUBICA . $this->propiedad->getId_ubica();\n $arrayDatos = $this->leeDBArray($dao->execSql($strSql));\n $id = $arrayDatos[0]['zpubica'];\n return $id;\n }", "abstract function getId();", "function getCacheId() {\n return get_class($this).\"_\".$this->id;\n }", "public function id()\n {\n return $this->getFromCache(\n ['type' => 'id']\n );\n }", "public function modifyId(){\n ini_set('memory_limit', '1024M');\n $components = DB::table('components')->get()->pluck('name');\n foreach ($components as $key => $component) {\n $myModel = 'App\\IC\\\\'.$component;\n $instance = new $myModel();\n try {\n $tableName = $instance->getTable();\n\n session()->put('table', $tableName);\n if (count(DB::table($tableName)->get()) > 0) {\n $tableName = session('table');\n\n DB::table($tableName)->orderBy('id')->chunkById(1600, function ($queries) {\n foreach ($queries as $key => $query) {\n $tableName = session('table');\n DB::table($tableName)->where('id', $query->id)->update(['id' => $key + 1]);\n }\n });\n echo $tableName;\n }\n }catch (\\Exception $exception){\n\n }\n\n }\n\n }", "function fetch_user_by_id($id) {\n if(!cache_isset('taxi_!uid_'.$id)) {\n if(cache_isset('taxi_uid_'.$id)) {\n return cache_get('taxi_uid_'.$id);\n } else {\n global $DB;\n connect_db();\n $result=$DB->users->findOne(['id'=>$id]);\n if(is_array($result)) {\n cache_set('taxi_uid_'.$id,$result);\n } else {\n cache_set('taxi_!uid_'.$id,true)\n }\n return $result;\n }\n }\n}", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public static function getHolderID();", "public function getLiveId() {}", "public function determineId() {}", "function put_id() {\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n // if we stop using the session id- we should remove the session id from\n // the current QUERYSTRING/ or the HTTP_GET_VARS ????\n die(\"This has not been coded yet.\");\n }", "abstract public function unique_id();", "private function getCacheId()\n\t{\n\t\treturn self::CACHE_ID_PREFIX . '_' . $this->exportId . '_' . $this->type;\n\t}", "public function getIdentificacao();", "protected function IdUserListReproduction ()\n {\n $lista = Model_listas::find('all', array\n (\n 'where' => array\n (\n array('id_usuario'=>$this->userID()),\n array('titulo'=>'reproducidas')\n )\n ));\n if(!empty($lista))\n {\n $id=0;\n foreach ($lista as $key => $value)\n {\n $id = $lista[$key]->id;\n } \n return $id; \n }\n }", "abstract public function getUnique($id);", "protected function getID()\n {\n return rand();\n }", "function generateCacheId() {\r\n $viewId = \"\";\r\n foreach ($this->_data as $key => $value) $viewId.= \"$key=$value\";\r\n $viewId = md5($viewId);\r\n return $viewId;\r\n }", "public function emptyIdCache()\n {\n self::$userIdCache = [];\n }", "public function track_identity()\n {\n }", "public function get_id();", "public function get_id();", "private function getId(): int|string\n {\n return '/'.($_SESSION['rfe']['lastUsedItemId']++);\n }", "public function regenerateId(): self;", "abstract public function HighId();", "function UniqueID(){\n\t\treturn uniqid ('Depari', true);\n\t}", "abstract public function getId();", "abstract public function getId();", "abstract public function getId();", "public function getid(){\r\n\t\tif($this::isLoggedIn()){\r\n\t\t\t$id2=$this->id;\r\n\t\t\treturn $id2;}\r\n\t\telse {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\t//throw new Exception('Nessun utente loggato!');}\r\n\t}", "public function updateId() {\n $this->Id = session_id();\n }", "abstract public function LowId();", "public function getInstanceIdent() {}", "private function cacheKey()\n {\n return sprintf('contact-permissons-%s', $this->client->patientContactId);\n }", "public function get_id()\n {\n }", "function get_id() {\n \n $id_okay = true;\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n if(\"\" == ($id = isset($_GET[$this->name]) ? $_GET[$this->name] : \"\")) {\n $id = isset($_POST[$this->name]) ? $_POST[$this->name] : \"\";\n }\n \n ## check if the id consists of chars that make up a session\n if(ereg('[^a-z0-9]', $id)){\n\t\t$id_okay = false;\n\t}\n \n if( \"\" == $id || !$id_okay) {\n $newid=true;\n // I'll have to work on this class to figure out how this link works\n $id = md5(uniqid($this->magic));\n }\n \n if(isset($_SERVER['QUERY_STRING'])) {\n $_SERVER['QUERY_STRING'] = ereg_replace(\"(^|&)\".quotemeta(urlencode($this->name)).\"=(.)*(&|$)\",\"\\\\1\", $_SERVER['QUERY_STRING']);\n }\n \n $this->id = $id;\n }", "function new_main_user_id() {\n global $db;\n global $config;\n\n // sprawdz ilosc produktow w bazie\n\t$maxid=1;\n\n\t$query=\"SELECT max(id) AS maxid FROM main\";\n\t$result=$db->Query($query);\n\tif ($result!=0) {\n\t $num_rows=$db->NumberOfRows($result);\n\t if ($num_rows>0) {\t\t\n\t\t$maxid=$db->FetchResult($result,0,\"maxid\");\n\t\t$maxid++;\n\t }\n\t} else die ($db->Error());\n \n\treturn $maxid;\n }", "public function iniciar() {\r\n session_regenerate_id();\r\n }", "public function nextId(){ }", "abstract public function objId();", "function accesgroupes_trouve_id_utilisateur() {\t\t\t\t\t\r\n\t\t\t\t $login_utilisateur = $GLOBALS['auteur_session']['login'];\r\n\r\n\t\t\t\t\t$sql502 = \"SELECT id_auteur FROM spip_auteurs WHERE login = '$login_utilisateur' LIMIT 1\";\r\n\t\t\t\t\t$result502 = spip_query($sql502);\r\n\t\t\t\t\t$row502 = spip_fetch_array($result502);\r\n\t\t\t\t\t$id_utilisateur = $row502['id_auteur'];\r\n\t\t\t\t\treturn $id_utilisateur;\t\t\t\t \r\n}", "function buscarPorId($id) {\r\n \r\n }", "public function getCacheId() {\n\t\treturn parent::getCacheId();\n\t}", "public function getUniqueId();", "public function getUniqueId();", "public function getUniqueId();", "private function computeId(): void\n {\n /** @noinspection JsonEncodingApiUsageInspection */\n $this->id = md5(\n json_encode(\n [\n $this->simulation->id,\n $this->fn,\n $this->useEndpoints,\n $this->usePerturbation,\n collect($this->findByTags)->map(fn($t) => strtolower($t))->sort()->toArray(),\n $this->searchMode\n ]\n )\n );\n }", "function getId() {\n\t$this->load();\n\treturn $this->mId;\n }", "public function getUniqueObjectIdentifier();", "static function getnerateIdByName($name)\n\t{\n\t\treturn md5(strtolower($name));\n\t}", "public function generate_archieve_reconcill_partially_id() {\n $result = $this->db2->query(\"SELECT archieve_id FROM `gstr_2a_reconciliation_partially_match_summary_history` ORDER BY archieve_id DESC LIMIT 0,1\");\n if ($result->num_rows() > 0) {\n $data = $result->row();\n $archieve_id = $data->archieve_id;\n//generate user_id\n $archieve_id = str_pad( ++$archieve_id, 5, '0', STR_PAD_LEFT);\n return $archieve_id;\n } else {\n $archieve_id = 'archieve_1001';\n return $archieve_id;\n }\n }", "public function hashString(){ return $this->ulA->db->ID . \"_\" . $this->ulA->ID . \"_\" . $this->ulB->db->ID . \"_\" . $this->ulB->ID; }", "public function getIdfa();", "public function nextId() {\n\t}", "public function ID();", "function waktudunia_createid( $tbl_waktudunia ){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_waktudunia ORDER BY id DESC\"); \n\t\t$data =\tmysql_fetch_array($sql);\n\t\t$UID = $data[\"id\"];\n\t\t$UID = $UID+1; \n\t\treturn $UID;\n\t}", "public function getId() ;", "function new_id(): int {\n static $ids = 1000;\n return $ids++;\n}", "protected function _getId ()\n {\n return session_id();\n }", "public function getID(): string;", "public function modifyCommonId(){\n ini_set('memory_limit', '1024M');\n\n $num = 100;\n\n\n DB::table('commons')->orderBy('id')->chunkById($num, function ($queries) use($num) {\n foreach ($queries as $key => $query) {\n\n DB::table('commons')->where('id', $query->id)->update(['id' => $this->add + $key + 1]);\n if(fmod($key,100) == 99 ){\n $this->add = $this->add + 100;\n }\n }\n });\n }", "protected function _getAdditionalCacheId()\n\t{\n\t\treturn md5('CONTAINER_ORDERS_' . $this->_placeholder->getAttribute('cache_id'));\n\t}", "function getId(){\n\n\t\t return $this->_id;\n\t}", "function CriaCodigo() { //Gera numero aleatorio\r\n for ($i = 0; $i < 40; $i++) {\r\n $tempid = strtoupper(uniqid(rand(), true));\r\n $finalid = substr($tempid, -12);\r\n return $finalid;\r\n }\r\n }", "function getUniqueId()\n {\n $a = count($this->_ref_store);\n while(in_array($a, $this->_ref_store)) {\n $a++;\n }\n return $a;\n }", "function bd_usuarios_hash($id){\n return sql2value(\"\n SELECT clave\n FROM usuarios\n WHERE id LIKE '{$id}'or email LIKE '{$id}'\n LIMIT 1;\n \");\n}", "public function getID() : string;", "public function getObjectIdent() {}" ]
[ "0.637864", "0.63666236", "0.6334305", "0.63067317", "0.6259508", "0.6257808", "0.62526435", "0.6163532", "0.6130416", "0.6083993", "0.60776883", "0.6061837", "0.60077876", "0.598774", "0.5984884", "0.59676456", "0.59628224", "0.5948035", "0.5945641", "0.59442484", "0.59442484", "0.59442484", "0.59406024", "0.5922005", "0.5914475", "0.5905127", "0.5893672", "0.58924294", "0.5867074", "0.5851366", "0.5809807", "0.5809189", "0.5809189", "0.5809189", "0.5809189", "0.5809189", "0.5809189", "0.5809189", "0.5809189", "0.5809189", "0.58024627", "0.58001745", "0.5791076", "0.57883185", "0.5786975", "0.5785767", "0.5782493", "0.57805514", "0.5778277", "0.5776928", "0.5776354", "0.5767881", "0.5763405", "0.57554007", "0.57554007", "0.5747839", "0.5744649", "0.57180285", "0.5700206", "0.5690028", "0.5690028", "0.5690028", "0.56883293", "0.5676153", "0.56731564", "0.5665742", "0.5664063", "0.56625247", "0.5659559", "0.56571096", "0.5646997", "0.564593", "0.5645137", "0.5645009", "0.56438076", "0.56430745", "0.56285864", "0.56285864", "0.56285864", "0.5626701", "0.56234616", "0.5617363", "0.5615964", "0.5612105", "0.55980545", "0.5597511", "0.5595164", "0.5592069", "0.55875146", "0.5576996", "0.55767834", "0.5573281", "0.5572346", "0.55682325", "0.5567513", "0.5565042", "0.55508673", "0.5549167", "0.5545543", "0.55448806", "0.55387926" ]
0.0
-1
Renvoie la liste de tous les batiments TODO utiliser le cache
public function findBatiments($language) { $select = $this->_createSelectQuery(); // batiment $select->field('id', $this->_tableName); $select->field('nom_' . $language, $this->_tableName, 'nom'); $select->field('description_' . $language, $this->_tableName, 'description'); $select->field('image', $this->_tableName); $select->field('niveau', $this->_tableName); $select->field('cout', $this->_tableName); $select->field('entretien', $this->_tableName); $select->field('duree_construction', $this->_tableName); $select->field('duree_recolte', $this->_tableName); $select->field('duree_hospitalisation', $this->_tableName); $select->field('cout_hospitalisation', $this->_tableName); $select->field('gain', $this->_tableName); $select->field('capacite', $this->_tableName); $select->field('visibilite', $this->_tableName); $select->field('id_prev', $this->_tableName); // Batiment Suivant $select->field('id', 'batiment_suivant', 'id_next'); // type_batiment 1 $select->field('id', 'type1_batiment', 'id_type1'); $select->field('id_parent', 'type1_batiment', 'id_parent_type1'); $select->field('nom_' . $language, 'type1_batiment', 'nom_type1'); $select->field('is_unique', 'type1_batiment', 'is_unique_type1'); // type_batiment 2 $select->field('id', 'type2_batiment', 'id_type2'); $select->field('id_parent', 'type2_batiment', 'id_parent_type2'); $select->field('nom_' . $language, 'type2_batiment', 'nom_type2'); $select->field('is_unique', 'type2_batiment', 'is_unique_type2'); // From et jointures $select->from($this->_tableName); $select->innerJoin('type_batiment', array('batiment.id_type = type1_batiment.id'), 'type1_batiment'); $select->leftJoin('type_batiment', array('type1_batiment.id_parent = type2_batiment.id'), 'type2_batiment'); $select->leftJoin('batiment', array('batiment_suivant.id_prev = batiment.id'), 'batiment_suivant'); // Ordre $select->order('batiment.niveau'); return $this->_mapper->buildObjectsFromRows($this->_selectAll($select)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _getBans()\r\n\t{\r\n\t\t$ban_file_name = md5($this->CI->config->config['encryption_key'].$this->ban_file);\r\n\t\t\r\n\t\t// Check if the cache file previously exists\r\n\t\tif(file_exists(CACHEPATH . $ban_file_name))\r\n\t\t{\r\n\t\t\t// Dont wast time with the DB, load the cached version\r\n\t\t\t$this->ban_list = unserialize(base64_decode($this->CI->load->file(CACHEPATH . $ban_file_name, true)));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Get group object from DB\r\n\t\t\t$bans = $this->db->get_where('bans', array('type' => 'user'));\r\n\t\t\tforeach($bans->result() as $ban)\r\n\t\t\t{\r\n\t\t\t\t$this->ban_list[] = array('ip' => $ban->ip, 'time' => $ban->time, 'type' => 'user');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Save the group object to cache for increased performance\r\n\t\t\tfile_put_contents(CACHEPATH . $ban_file_name, base64_encode(serialize($this->ban_list)));\r\n\t\t}\r\n\t}", "public function getBzList() {\n if ($this->cached['Bz']) return array_values($this->cache['Bz']);\n return XPClass::forName('de.uska.db.Progress')\n ->getMethod('getPeer')\n ->invoke()\n ->doSelect(new Criteria(\n array('bz_id', $this->getBz_id(), EQUAL)\n ));\n }", "public function listeBatiments()\n\t{\n\t\t$adapter = $this->tableGateway->getAdapter ();\n\t\t$sql = new Sql ( $adapter );\n\t\t$select = $sql->select ();\n\t\t$select->from(array('bat'=>'batiment'));\n\t\t$select->columns(array ('IdBatiment'=>'id_batiment', 'IdSalle'=>'intitule'));\n\t\t$select->join(array('s'=>'salle'), 's.id_batiment = bat.id_batiment', array('*'));\n\t\t$select->join(array('l'=>'lit'), 'l.id_salle = s.id_salle', array('*'))\n\t\t->where(array('disponible'=> 0));\n\t\t$select->order('bat.id_batiment ASC');\n\t\t$stmt = $sql->prepareStatementForSqlObject($select);\n\t\t$result = $stmt->execute();\n\t\tforeach ($result as $data) {\n\t\t\t$options[$data['IdBatiment']] = $data['IdSalle'];\n\t\t}\n\t\treturn $options;\n\t}", "function listBillets(){ \n\t\t$billets = array();\n\n\t\t$bdd = new PDO('mysql:host=localhost;dbname=test;charset=utf8','root','',array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));\n\t\t$req = $bdd->query('SELECT * FROM billets ORDER BY date_creation DESC LIMIT 5');\n\t\t\n\t\twhile($billet = $req->fetch(PDO::FETCH_ASSOC)){\n\t\t\t$billets[] = $billet;\n\t\t}\n\t\t\n\t\treturn $billets ;\n\t}", "public function retrieveAllList()\n {\n if ($list = $this->memcache->get('API::' . $this->numInstance . '::referentiel')) {\n return json_decode($list, true);\n } else {\n $list = $this->refIdRepository->findAllAsArray();\n $this->memcache->set(\n 'API::' . $this->numInstance . '::referentiel',\n json_encode($list),\n 0,\n 86400\n );\n return $list;\n }\n }", "public function getBlackWordListFromDB(){\n\t\t$sql = \" SELECT find \"\n\t\t\t.\" FROM bbs_words \";\n\t\t$dbw = Sw_Db_Wrapper::getInstance();\n\t\t$data = $dbw->getFlatCached(\"club\", $sql, 10 * 10,\"BlackWordList\");\n\t\tif (count($data) > 0){\n\t\t\t$this->mem->set(\"BlackWordList\", $data, 1800);\n\t\t\t$this->bwl = $data;\n\t\t}\n\t}", "public function fetchList();", "function babies_liste ($bgalg_id = 0, $modus = \"\")\n\t{\n\t\t$temp_return = array();\n\n\t\tif ($bgalg_id) {\n\t\t\t$temp_sql_add_join = \"\";\n\t\t\t$temp_sql_add_galerie = sprintf(\"WHERE t1.bgalb_bgalg_id='%d'\", $bgalg_id);\n\t\t\t$temp_sql_add_limit = $this->db->escape($this->weiter->sqllimit);\n\n\t\t\tswitch ($modus) {\n\t\t\tcase \"ALL\":\n\t\t\t\t$temp_sql_add_limit = \"\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"ALL_ALL\":\n\t\t\t\t$temp_sql_add_join = sprintf(\"LEFT JOIN %s AS t2 ON (t1.bgalb_bgalg_id = t2.bgalg_id)\", $this->db_praefix.\"ecard_galerien\");\n\t\t\t\t$temp_sql_add_galerie = \"\";\n\t\t\t\t$temp_sql_add_limit = \"\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$sql = sprintf(\"SELECT * FROM %s AS t1\n\t\t\t\t\t\t\t%s\n\t\t\t\t\t\t\t%s\n\t\t\t\t\t\t\tORDER BY t1.bgalb_datum DESC %s\",\n\t\t\t\t$this->db_praefix.\"ecard_data\",\n\t\t\t\t$temp_sql_add_join,\n\t\t\t\t$temp_sql_add_galerie,\n\t\t\t\t$temp_sql_add_limit\n\t\t\t);\n\t\t\t$temp_return = $this->db->get_results($sql, ARRAY_A);\n\t\t}\n\t\treturn $temp_return;\n\t}", "public function getBbCodeCache()\n\t{\n\t\treturn array(\n\t\t\t'mediaSites' => $this->getBbCodeMediaSitesForCache()\n\t\t);\n\t}", "public function banks()\n {\n return Cache::remember('banks', $this->cacheTime, function () {\n return collect(Paymentmethods::getBanks(10))->pluck('name', 'id');\n });\n }", "static function getAll()\n\t\t{\n\t\t\t$returned_brands = $GLOBALS['DB']->query(\"SELECT * FROM brands;\");\n\t\t\t$all_brands = [];\n\t\t\tforeach($returned_brands as $brand){\n\t\t\t\t$name = $brand['name'];\n\t\t\t\t$id = $brand['id'];\n\t\t\t\t$new_brand = new Brand($name, $id);\n\t\t\t\tarray_push($all_brands, $new_brand);\n\t\t\t}\n\t\t\treturn $all_brands;\n\t\t}", "public function getList();", "public function getList();", "public function get_all(){\n $cache_data_list=[];\n if($this->driver=='file'){\n foreach ($cache_list=$this->file->file_walk($this->path) as $value){\n $cache_data_list[]=$this->file->read_file($value);\n }\n }\n if($this->driver==\"redis\"){\n foreach ($this->redis->hGetAll($this->path) as $key=>$value){\n $cache_data_list[]=$value;\n }\n }\n return $cache_data_list;\n }", "abstract public function getList();", "private function listado_obras(){\n \treturn Sesion::where(\"inicio\",\">\",Carbon::now())->distinct()->get(['nombre_obra']);\n }", "function recuperer_bsm_entier(){\n global $db;\n $sql = \"SELECT * FROM bsm \";\n $req = $db->prepare($sql);\n $req-> execute();\n $results = array();\n while($rows = $req->fetchObject()){\n $results[] = $rows;\n }\n return $results;\n}", "function bidList()\n {\n return $this->p_bidList;\n }", "public function listb()\n\t{\n\t\t$id_usuario_session = $this->session->userdata(\"id\");\n\t\t$data = [\n\t\t 'monedas_mercado_busco' => $this->Mercadom_model->listb($id_usuario_session)\n\t\t];\n\n\t\t$this->layout->view(\"list_busqueda\",$data);\n\n\t}", "public function dict_cables() {\n $list = array();\n $sql = \"SELECT * FROM {$this->connection->database}.dict_cable ORDER BY name\";\n $result = $this->connection->query ( $sql );\n $nrows = mysql_numrows( $result );\n for( $i = 0; $i < $nrows; $i++ )\n array_push (\n $list,\n new NeoCaptarDictCable (\n $this->connection,\n $this,\n mysql_fetch_array( $result, MYSQL_ASSOC )));\n\n return $list;\n }", "public function dict_cables() {\n $list = array();\n $sql = \"SELECT * FROM {$this->connection->database}.dict_cable ORDER BY name\";\n $result = $this->connection->query ( $sql );\n $nrows = mysql_numrows( $result );\n for( $i = 0; $i < $nrows; $i++ )\n array_push (\n $list,\n new NeoCaptarDictCable (\n $this->connection,\n $this,\n mysql_fetch_array( $result, MYSQL_ASSOC )));\n\n return $list;\n }", "public function fetchAll()\r\n {\r\n \t// get from mem if available\r\n \t$memcache = new \\Memcached();\r\n \t$memcache->addServer('localhost', 11211);\r\n \t$key = md5(catalogProductList::MEMCACHED_FETCH_ALL);\r\n \t$cache_data = $memcache->get($key);\r\n \tif ($cache_data) {\r\n \t\t$this->log->addInfo('cache hit', array(\"key\" => $key));\r\n \t\t$this->data = $cache_data;\r\n \t} else {\r\n\t\t\t$this->data = $this->client->catalogProductList($this->sessionid);\r\n\t\t\t$memcache->set($key, $this->data, 60*1);\r\n \t}\r\n }", "public static function getBrandsAll()\n {\n $pdo = Database::getPDO();\n $sql = \"SELECT * FROM `\". static::$table .\"` \n WHERE `order` > 0\n ORDER BY `order` ASC \";\n \n $statement = $pdo->query( $sql );\n $modelListFromDatabase = $statement->fetchAll( PDO::FETCH_ASSOC );\n\n // Etape 2 : On vérifie qu'on a des résultats\n if( $modelListFromDatabase === false ) :\n exit( static::$table.\" not found !\" );\n endif;\n \n // Etape 3 : On prépare un tableau d'objets\n $modelsArray = [];\n\n // Etape 4 : On parcours nos résultats pour créer les objets\n // à partir des données récupérées en BDD\n foreach( $modelListFromDatabase as $modelDataFromDatabase ) :\n $model = new static( $modelDataFromDatabase );\n $modelsArray[] = $model;\n endforeach;\n\n // Etape 5 : On renvoi notre tableau d'objets (ici de type Brand)\n return $modelsArray;\n }", "public function get_list_berita(){\n\t\t$requestParam \t\t\t= $_REQUEST;\n\n\t\t$getData \t\t\t\t= $this->M_berita->get_list_news ( $requestParam, 'nofilter' );\n\t\t$totalAllData \t\t\t= $this->M_berita->get_list_news ( $requestParam, 'nofilter', 'all' )->num_rows ();\n\t\t$totalDataFiltered \t\t= $this->M_berita->get_list_news ( $requestParam, 'nofilter', 'all' )->num_rows ();\n\t\t\n\t\tif (empty ( $requestParam ['search'] ['value'] ) > 1) {\n\t\t\t$getData \t\t\t= $this->M_berita->get_list_news ( $requestParam );\n\t\t\t$totalDataFiltered \t= $getData->num_rows ();\n\t\t}\n\t\t\n\t\t$listData = array ();\n\t\t$no = ($requestParam['start']+1);\n\t\t\n\t\tforeach( $getData->result () AS $value){\n\t\t\t$rowData = array();\n\n\t\t\t/*========================================= BEGIN BUTTON STUFF =========================================*/\n\t\t\t$button = \"\";\n\t\t\t$button .= \t'\n\t\t\t\t\t\t\t<button class=\"btn btn-danger btn-sm\" onClick=\"is_delete(\\''.base_url('cms/berita/doDelete/'.$value->id).'\\')\" title=\"Delete\"><i class=\"fa fa-trash\"></i></button>\n\t\t\t\t\t\t\t<a href=\"'.base_url('cms/berita/edit/'.$value->id).'\" class=\"btn btn-primary btn-sm\" title=\"Edit / Detail\"><i class=\"fa fa-edit\"></i></a>\n\t\t\t\t\t\t';\n\n\t\t\t// $button .= '\n\t\t\t// \t\t\t<div class=\"btn-group\">\n\t\t\t// \t\t\t <button type=\"button\" class=\"btn btn-dark dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n\t\t\t// \t\t\t Action\n\t\t\t// \t\t\t </button>\n\t\t\t// \t\t\t <div class=\"dropdown-menu\">\n\t\t\t// \t\t\t <a class=\"dropdown-item\" href=\"'.base_url('cms/dokter/edit/'.$value->id).'\"><i class=\"fa fa-edit\"></i> Edit</a>\n\t\t\t// \t\t\t <a class=\"dropdown-item\" onClick=\"is_delete(\\''.base_url('cms/dokter/doDelete/'.$value->id).'\\')\"><i class=\"fa fa-trash\"></i> Hapus</a>\n\t\t\t// \t\t\t <div class=\"dropdown-divider\"></div>\n\t\t\t// \t\t\t <a class=\"dropdown-item\" href=\"'.base_url('cms/dokter/status/'.$value->id).'\"><i class=\"fa fa-check\"></i> Active/Non-active</a>\n\t\t\t// \t\t\t </div>\n\t\t\t// \t\t\t</div>\n\t\t\t// \t\t';\n\n\t\t\t// $status = \"\";\n\t\t\t// if ($value->is_active != 0) {\n\t\t\t// \t$status .= '<span class=\"badge badge-pill badge-success\">Yes</span>';\n\t\t\t// }else{\n\t\t\t// \t$status .= '<span class=\"badge badge-pill badge-danger\">No</span>';\n\t\t\t// }\n\t\t\t/*========================================= END BUTTON STUFF =========================================*/\n\n\t\t\t$rowData[] = $no++;\n\t\t\t$rowData[] = $value->title;\n\t\t\t$rowData[] = $value->category_name;\n\t\t\t$rowData[] = $button;\n\t\t\t\n\t\t\t$listData[] = $rowData;\n\t\t\t\n\t\t\t$json_data = array (\n\t\t\t\t\"draw\" => intval ( $requestParam ['draw'] ), // for every request/draw by clientside , they send a number as a parameter, when they recieve a response/data they first check the draw number, so we are sending same number in draw.\n\t\t\t\t\"recordsTotal\" => intval ( $totalAllData ), // total number of records\n\t\t\t\t\"recordsFiltered\" => intval ( $totalDataFiltered ), // total number of records after searching, if there is no searching then totalFiltered = totalData\n\t\t\t\t\"data\" => $listData \n\t\t\t); // total data array\n\t\t}\n\t\tif(empty($json_data)){\n\t\t\t$json_data = array (\n\t\t\t\t\"draw\" => 0, // for every request/draw by clientside , they send a number as a parameter, when they recieve a response/data they first check the draw number, so we are sending same number in draw.\n\t\t\t\t\"recordsTotal\" => 0, // total number of records\n\t\t\t\t\"recordsFiltered\" => 0, // total number of records after searching, if there is no searching then totalFiltered = totalData\n\t\t\t\t\"data\" => \"\"\n\t\t\t); // total data array\n\t\t}\n\t\theader ( 'Content-Type: application/json;charset=utf-8' );\n\t\techo json_encode ($json_data);\n\t\t\n\t\tdie();\n\t}", "public function getAllBreeds(){\n\t\treturn $this->getBreedsFromGET(self::GET_STRING_ALL_BREEDS);\n\t}", "public static function list(){\r\n\t\t$app = Aplicacion::getSingleton();\r\n\t\t$conn = $app->conexionBd();\r\n\t\t\r\n\t\t$query= sprintf(\"SELECT * FROM abono\");\r\n\t\t$resultado = $conn->query($query);\r\n\t\twhile($fila = mysqli_fetch_assoc($resultado)){\r\n\t\t\t$abono = new TOAbono();\r\n\t\t\t$abono->setTipoAbono($fila['tipo']);\r\n\t\t \t$abono->setCoste($fila['coste']);\r\n\t\t\t$abono->setDuracion($fila['duracion']);\r\n\t\t\t$abonos[] = $abono;\r\n\t\t}\r\n\t\treturn $abonos;\r\n\t}", "function spiplistes_listes_boite_abonnements ($id_liste, $statut_liste, $tri, $debut, $script_retour) {\n\n\t$boite_abonnements = \"\"\n\t\t. \"<div id='\" . _SPIPLISTES_ID_GROSSE_BOITE . \"' class='verdana1'>\\n\"\n\t\t. spiplistes_listes_boite_abonnes($id_liste, $statut_liste, $tri, $debut, $script_retour)\n\t\t. spiplistes_listes_boite_elligibles ($id_liste, $statut_liste, $tri, $debut)\n\t\t. \"</div>\\n\"\n\t\t;\n\treturn($boite_abonnements);\n}", "public function getBreadcrumbs()\n\t\t{\n\t\t\t// ziskame aktualni stranku, postupne z jejiho ID urezavame casti, pridavame odpovidajici stranky a itemy\n\t\t\t$items = [];\n\t\t\t$currentPage = $this->getCurrentPage();\n\n\t\t\tif ($currentPage !== NULL) {\n\t\t\t\tdo {\n\t\t\t\t\tif (isset($this->pages[$currentPage])) { // pokud stranka existuje\n\t\t\t\t\t\tif (isset($this->afterItems[$currentPage])) { // array_reverse\n\t\t\t\t\t\t\t$items = array_merge($items, array_reverse($this->afterItems[$currentPage]));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($this->pages[$currentPage]->isVisibleInBreadcrumbs()) {\n\t\t\t\t\t\t\t$items[] = $this->pages[$currentPage];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isset($this->beforeItems[$currentPage])) { // array_reverse\n\t\t\t\t\t\t\t$items = array_merge($items, array_reverse($this->beforeItems[$currentPage]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// urizneme cast\n\t\t\t\t\tif ($currentPage === '') {\n\t\t\t\t\t\tbreak; // currentPage = NULL\n\t\t\t\t\t}\n\n\t\t\t\t\t$currentPage = Helpers::getParent($currentPage);\n\n\t\t\t\t} while ($currentPage !== NULL);\n\n\t\t\t\t$items = array_reverse($items);\n\t\t\t}\n\n\t\t\tforeach ($this->items as $item) {\n\t\t\t\t$items[] = $item;\n\t\t\t}\n\n\t\t\treturn $items;\n\t\t}", "public function list();", "public function list();", "public function list();", "function recuperer_produit_bsm($id){\n global $db;\n $i = array(\n 'id' => $id\n );\n $sql = \"SELECT * FROM bsm WHERE id=:id\";\n $req = $db->prepare($sql);\n $req-> execute($i);\n $results = array();\n while($rows = $req->fetchObject()){\n $results[] = $rows;\n }\n return $results;\n}", "function __lst($bid){\r\n\t\tif( @$this->params['url']['keyword'] || @$this->params['url']['category'] ){\r\n\t\t\t$this->passedArgs = $this->data['Board'] = $this->params['url'];\r\n\r\n\t\t\tunset($this->data['Board']['url']);\r\n\t\t\tunset($this->passedArgs['url']);\r\n\t\t\t$this->params['named'] = $this->passedArgs;\t\t\r\n\t\t}else{\r\n\t\t\t$this->data['Board'] = $this->passedArgs;\t\t\r\n\t\t}\r\n\t\t$this->passedArgs[0] = $bid;\r\n\t\t\r\n\t\t$conditions = $this->create_conditions($bid);\r\n\t\t\r\n\t\t$rows = $this->paginate('Board',$conditions);\r\n\r\n\t\t\t\r\n\t\tif( ereg(\"L|T|G\",trim(@$this->params['url']['ls'])) ){\r\n\t\t\t$this->setup['list_style'] = trim($this->params['url']['ls']);\r\n\t\t}\r\n\r\n\t\t\r\n\t\t$datas = array();\r\n\t\tforeach($rows as $i=>$row){\r\n\t\t\t$datas[$i] = $row;\r\n\r\n\t\t\t$spacer = '';\r\n\t\t\tfor($depth = 0 ; $depth < $row['Board']['sort_depth']; $depth++){\r\n\t\t\t\t$spacer .= '&nbsp;&nbsp;';\r\n\t\t\t}\r\n\t\t\t$datas[$i]['Board']['spacer'] = $spacer;\r\n\t\t\t$datas[$i]['Board']['subject'] = strcut($row['Board']['subject'],$this->setup['maxlength']);\r\n\t\t\t$datas[$i]['Board']['crypt_userid']='';\r\n\t\t\tif( $row['Board']['userid'] )\r\n\t\t\t{\r\n\t\t\t\t$datas[$i]['Board']['crypt_userid'] = $this->Crypter->encrypt($row['Board']['userid'].'⇋'.time().'⇋'.$row['Board']['no']);\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\t$datas[$i]['Fileattach'] = array();\r\n\t\t\t//파일\r\n\t\t\tif( $this->setup['use_file'] || eregi('T|G',$this->setup['list_style']) ){\r\n\r\n\t\t\t\tif( eregi('T|G',$this->setup['list_style']) ){\r\n\t\t\t\t\t$conditions = array(\r\n\t\t\t\t\t\t\t'plugin'=>'board',\r\n\t\t\t\t\t\t\t'parent_id'=>$row['Board']['no'],\r\n\t\t\t\t\t\t\t'deleted'=>null,\r\n\t\t\t\t\t\t\t'type RegExp'=>'^image',\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$limit = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$conditions = array(\r\n\t\t\t\t\t\t\t'plugin'=>'board',\r\n\t\t\t\t\t\t\t'parent_id'=>$row['Board']['no'],\r\n\t\t\t\t\t\t\t'deleted'=>null\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$limit = null;\r\n\t\t\t\t}\r\n\t\t\t\t$files = $this->Fileattach->find('first',\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'conditions'=>$conditions,\r\n\t\t\t\t\t\t'fields'=>array('name','fsname'),\r\n\t\t\t\t\t\t'order'=>array('expose'=>'desc'),\r\n\t\t\t\t\t\t'limit'=>$limit\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\r\n\t\t\t\tif( @$files['Fileattach']['name'] ){\r\n\t\t\t\t\t$datas[$i]['Fileattach'] = $files['Fileattach'];\r\n\t\t\t\t\t$datas[$i]['Fileattach']['ext'] = $this->Fileattach->getFileExtension($files['Fileattach']['name']);\r\n\r\n\t\t\t\t\t//thumb 경로\r\n\t\t\t\t\t$folder = new Folder();\r\n\t\t\t\t\t$dir_thumb = APP.'webroot/files/board/'.$bid.'/thumb/';\r\n\r\n\r\n\t\t\t\t\t$folder->create($dir_thumb);\r\n\r\n\t\t\t\t\tif( $this->setup['list_style'] == \"T\" ){\r\n\t\t\t\t\t\tlist($w,$h) = explode('x',$this->setup['thumb_size_list']);\t\t\t\t\t\r\n\t\t\t\t\t\t$newImage = $bid.'_'.$w.'x'.$h.'_'.$datas[$i]['Fileattach']['fsname'];\r\n\t\t\t\t\t\tif( !file_exists($dir_thumb.$newImage) ){\r\n\t\t\t\t\t\t\t$this->Image->resizeImage('resizeCrop',APP.'webroot/files/board/'.$bid, $datas[$i]['Fileattach']['fsname'], $dir_thumb , $newImage,$w,$h);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}elseif( $this->setup['list_style'] == \"G\" ){\r\n\r\n\t\t\t\t\t\tlist($w,$h) = explode('x',$this->setup['thumb_size_gallery']);\r\n\t\t\t\t\t\t$newImage = $bid.'_'.$w.'x'.$h.'_'.$datas[$i]['Fileattach']['fsname'];\r\n\t\t\t\t\t\tif( !file_exists($dir_thumb.$newImage) ){\r\n\t\t\t\t\t\t\t$this->Image->resizeImage('resizeCrop',APP.'webroot/files/board/'.$bid, $datas[$i]['Fileattach']['fsname'], $dir_thumb, $newImage,$w,$h);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif( @$newImage ) $datas[$i]['Fileattach']['thumb'] = '/files/board/'.$bid.'/thumb/'.$newImage;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$datas[$i]['Fileattach']['ext'] = 'none';\r\n\t\t\t\t}\r\n\t\t\t}//end of files\r\n\t\t}\r\n\r\n//공지글\r\n\t\t$nrows = array();\r\n\t\tif( @$this->setup['use_notice'] ){\r\n\t\t\t$nrows = $this->Board->find('all',array(\r\n\t\t\t\t'conditions'=>array('Board.opt_notice'=>'1','Board.bid'=>$bid,'Board.deleted'=>null),\r\n\t\t\t\t'fields'=>array('Board.no',\r\n\t\t\t\t\t\t\t\t\t\t'Board.sort_depth',\r\n\t\t\t\t\t\t\t\t\t\t'Board.userid',\r\n\t\t\t\t\t\t\t\t\t\t'Board.email',\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t'Board.category',\r\n\t\t\t\t\t\t\t\t\t\t'Board.name',\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t'Board.subject',\r\n\t\t\t\t\t\t\t\t\t\t'Board.content',\r\n\t\t\t\t\t\t\t\t\t\t'Board.total_comment',\r\n\t\t\t\t\t\t\t\t\t\t'Board.hit',\r\n\t\t\t\t\t\t\t\t\t\t'Board.created',\r\n\t\t\t\t\t\t\t\t\t\t'BoardCategory.name',\r\n\t\t\t\t\t\t\t\t\t\t'User.profile'),\r\n\t\t\t\t'order'=>array('Board.created'=>'DESC')\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\tforeach($nrows as $Tkey=>$noti){\r\n\t\t\t\t$noti['Board']['crtypt_userid']='';\r\n\t\t\t\tif( $noti['Board']['userid'] )\r\n\t\t\t\t{\r\n\t\t\t\t\t$noti['Board']['crtypt_userid'] = $this->Crypter->encrypt($noti['Board']['userid'].'⇋'.time().'⇋'.$noti['Board']['no']);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$noti['Board']['subject'] = strcut($noti['Board']['subject'],$this->setup['maxlength']);\t\r\n\t\t\t\r\n\r\n\t\t\tif( $this->setup['use_file'] ){\r\n\t\t\t\t\t$conditions = array(\r\n\t\t\t\t\t\t\t'plugin'=>'board',\r\n\t\t\t\t\t\t\t'parent_id'=>$noti['Board']['no'],\r\n\t\t\t\t\t\t\t'deleted'=>null\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$limit = null;\r\n\t\t\t\t$files = $this->Fileattach->find('first',\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'conditions'=>$conditions,\r\n\t\t\t\t\t\t'fields'=>array('name','fsname'),\r\n\t\t\t\t\t\t'limit'=>$limit\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t\tif( @$files['Fileattach']['name'] ){\r\n\t\t\t\t\t$nrows[$Tkey]['Fileattach'] = $files['Fileattach'];\r\n\t\t\t\t\t$nrows[$Tkey]['Fileattach']['ext'] = $this->Fileattach->getFileExtension($files['Fileattach']['name']);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$nrows[$Tkey]['Fileattach']['ext'] = 'none';\r\n\t\t\t\t}\r\n\t\t\t}//end of files\r\n\r\n\t\t}\r\n\t}\r\n\t\t$this->set('nrows',$nrows);\r\n\t\t\t\r\n\t\t//동영상 타입인 경우 최근 게시물 하나 셋\r\n\t\tif( @$this->setup['list_style'] == 'M' ){\r\n\r\n\t\t\tif( empty($this->passedArgs['no']) ){\r\n\t\t\t\t$this->data = $this->Board->find('first',array('conditions'=>array('Board.deleted'=>null,'Board.bid'=>$bid),'order'=>array('Board.sort_no'=>'asc')));\r\n\t\t\t}else{\r\n\t\t\t\t$this->data = $this->Board->find('first',array('conditions'=>array('Board.deleted'=>null,'Board.bid'=>$bid,'Board.no'=>$this->passedArgs['no'])));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->set('rows',$datas);\t\r\n\t}", "static function listaClanaka(){\n\t\trequire_once(MODEL_ABS.'DB_DAO/Broker_baze.php');\n\t\trequire_once(MODEL_ABS.'DB_DAO/Clanak.php');\n\t\t\n\t\t$broker=new Broker();\n\t\t$clanak=new Clanak($broker);\n\t\t(isset($_GET['pag'])) ? $pag=$_GET['pag'] : $pag=0;\n\t\t(isset($_GET['korak'])) ? $korak=$_GET['korak'] : $korak=5;\n\t\t\n\t\t$rezultat['clanci']=$clanak->limitClanci($pag,$korak);\n\t\t$br_clanaka=$clanak->brojanjeClanaka();\n\t\t$rezultat['pags']=ceil($br_clanaka/$korak);\n\t\t$rezultat['pag']=$pag;\n\t\t\n\t\treturn $rezultat;\n\t}", "static public function getList() {\n\t\t$mComponentcache=new Maerdo_Model_Componentcache();\n\t\t$result=$mComponentcache->fetchAll();\n\t\treturn($result);\n\t}", "function list_all() {\n $ssql = \"select nombre from TBL_FRONTS where estado=\" . I_ACTIVE;\n $this->DBobj->loadRS($ssql);\n if (!$this->DBobj->noEmpty)\n return null;\n $i = 0;\n $list = array();\n while ($idV = $this->DBobj->get_vector()) {\n $list[$i] = $this->objsCache->get_object(get_class(), $idV[0]);\n $i++;\n }\n return $list;\n }", "public function findAll()\n {\n return DatabaseBackup::where('status', 1)\n ->where('user_id', Auth::user()->id)\n ->orderBy('id','desc')\n ->get();\n }", "function get_all_branch_wilayah()\n {\n \t$param = array();\n\t\t$branch_code = $this->session->userdata('branch_code');\n\t\t$flag_all_branch = $this->session->userdata('flag_all_branch');\n\n $sql = \"SELECT \n \t\t\t\t branch_id\n \t\t\t\t,branch_code \n \t\t\t\t,branch_name\n \t\tFROM \n \t\t\t\t mfi_branch\n\t\t\t\tWHERE \n\t\t\t\t\t\tbranch_class=1\n\t\t\t\t\";\n\n\t\tif($flag_all_branch!='1'){ // tidak punya akses seluruh cabang\n\t\t\t$sql .= \" AND branch_code in(select branch_code from mfi_branch_member where branch_induk=?)\";\n\t\t\t$param[] = $branch_code;\n\t\t}\n\n\t\t$sql .= \" ORDER BY 2 \";\n\n\t\t$query = $this->db->query($sql,$param);\n\n\t\treturn $query->result_array();\n }", "private static function loadItems()\n\t{\n\t\tself::$_items=array();\t\t\t\t\t\t//FIXME Сделать критерию с селект где не будет лишних полей\n\t\t$models=self::model()->findAll();\n\t\tforeach($models as $model)\n\t\t\tself::$_items[$model->code]=$model->value;\n\t}", "public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }", "function listadeMembroativosDao(){\r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objDao = Connection::getInstance();\r\n \r\n $resultado = mysql_query(\"Select Matricula,Nome,Naturalidade,Fone from membros where Status = 'ATIVO' order by Nome\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $listaMembro = array();\r\n \r\n $i=0;\r\n \r\n while ($registro = mysql_fetch_array($resultado, MYSQL_ASSOC)){\r\n \r\n\t $membro = new objetoMembro();\r\n \r\n $membro->setMatricula($registro['Matricula']);\r\n $membro->setNome($registro['Nome']);\r\n $membro->setNatural($registro['Naturalidade']); \r\n\t $membro->setFone($registro['Fone']); \r\n \r\n\t $listaMembro[$i] = $membro;\r\n \r\n\t $i++;\r\n\t}\r\n\r\n\t\treturn $listaMembro;\r\n\t\tmysql_free_result($resultado);\r\n $objDao->freebanco();\r\n \r\n }", "public function listAll();", "public function listAll();", "function get_breadcrumbs($breadcrumbs_id_list)\n {\n if(trim($breadcrumbs_id_list)!='')\n {\n $breadcrumb_ids = explode(',',$breadcrumbs_id_list);\n $breadcrumb_ids = array_map('intval', $breadcrumb_ids);\n #if(isset($breadcrumb_ids))\n # {\n $ids = implode(',', $breadcrumb_ids);\n $dbr = Database::$content->query(\"SELECT id, page, title FROM \".Database::$db_settings['pages_table'].\" WHERE id IN(\".$ids.\")\");\n while($data = $dbr->fetch())\n {\n $unordered_breadcrumbs[$data['id']]['page'] = $data['page'];\n $unordered_breadcrumbs[$data['id']]['title'] = $data['title'];\n }\n // order:\n foreach($breadcrumb_ids as $id)\n {\n if(isset($unordered_breadcrumbs[$id])) $breadcrumbs[] = $unordered_breadcrumbs[$id];\n }\n /* // the same with several database requests (1 per breadcrumb):\n $dbr = Database::$content->prepare(\"SELECT page, title FROM \".Database::$db_settings['pages_table'].\" WHERE id=:id\");\n $i=0;\n Database::$content->beginTransaction();\n foreach($breadcrumb_ids as $breadcrumb_id)\n {\n $dbr->bindValue(':id', $breadcrumb_id, PDO::PARAM_INT);\n $dbr->execute();\n $data = $dbr->fetch();\n if(isset($data['page']))\n {\n $breadcrumbs[$i]['page'] = $data['page'];\n $breadcrumbs[$i]['title'] = $data['title'];\n ++$i;\n unset($data);\n }\n }\n Database::$content->commit();\n */\n #}\n if(isset($breadcrumbs))\n {\n return $breadcrumbs;\n }\n }\n return false;\n }", "public function getAll()\n\t{\n\t\treturn $this->db->get('tabel_b')->result();\n\t}", "function fetch_beb_list($idx = 0,$data=array() ){\n #\texit('erere');\n\n\t\tswitch ($idx) {\n\t\t\tcase 0:\n\t\t\tswitch ($data['level']) {\n\n#fetching Archived BEBs\n\n\t\t\t\tcase 'archive':\n\t\t\t\t\t# code...\n\t\t\t\t\t$userid = $this->session->userdata['userid'];\n\t\t\t\t\t\t$pde = mysql_query(\"select * from users where userid =\".$userid);\n\t\t\t\t\t\t$q = mysql_fetch_array($pde);\n\t\t\t\t\t\t#$query = $this->Query_reader->get_query_by_code('view_bebs', array('SEARCHSTRING' => ' and 1 and 1 and bidinvitations.procurement_id in ( select procurement_ref_id FROM contracts ) \tand users.userid = '.$userid.' ORDER BY bestevaluatedbidder.dateadded DESC','limittext'=>'limit 10' ));\n\t\t\t\t\t\t#print_r($query); exit();\n\t\t\t\t\t\tif($this->session->userdata('isadmin') == 'N'){\n\t\t\t\t\t\t\t$result = paginate_list($this, $data, 'view_bebs', array('SEARCHSTRING' => ' and 1 and 1 and bidinvitations.procurement_id in ( select procurement_ref_id FROM contracts )\tand users.userid = '.$userid.' ORDER BY bestevaluatedbidder.dateadded DESC' ),10);\n\t\t\t \t return $result;\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$result = paginate_list($this, $data, 'view_bebs', array('SEARCHSTRING' => ' and 1 and 1 and bidinvitations.procurement_id in ( select procurement_ref_id FROM contracts )\t ORDER BY bestevaluatedbidder.dateadded DESC' ),10);\n\t\t\t \t return $result;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\n\t\t\t\t\tbreak;\n\n#fetch active BEBs\n\t\t\tcase 'active':\n\t \n\t\t\t\t\t\t$userid = $this->session->userdata['userid'];\n\t\t\t\t\t\t$pde = mysql_query(\"select * from users where userid =\".$userid);\n\t\t\t\t\t\t$q = mysql_fetch_array($pde);\n\t\t\t\t\t\t#$query = $this->Query_reader->get_query_by_code('view_bebs', array('SEARCHSTRING' => ' and 1 and 1 and bidinvitations.procurement_id not in ( select procurement_ref_id FROM contracts ) \tand users.userid = '.$userid.' ORDER BY bestevaluatedbidder.dateadded DESC','limittext'=>10 ));\n\t\t\t\t\t\t#print_r($query); exit();\n\n\t\n\t\t\t\t\t if($this->session->userdata('isadmin') == 'N'){\n\t\t\t\t\t\t$result = paginate_list($this, $data, 'view_bebs', array('SEARCHSTRING' => ' and 1 and 1 and bidinvitations.procurement_id not in ( select procurement_ref_id FROM contracts ) \tand users.userid = '.$userid.' ORDER BY bestevaluatedbidder.dateadded DESC' ),10);\n\t\t\t \t return $result;\n\t\t\t \t }\n\t\t\t \t else\n\t\t\t \t {\n\t\t\t \t $result = paginate_list($this, $data, 'view_bebs', array('SEARCHSTRING' => ' and 1 and 1 and bidinvitations.procurement_id not in ( select procurement_ref_id FROM contracts ) \t ORDER BY bestevaluatedbidder.dateadded DESC' ),10);\n\t\t\t \t return $result;\t\t\t \t \t\n\t\t\t \t }\n\n\t\t\t\t\tbreak;\t\n\n\n\t\t\t\tdefault:\n\t\t\t\t\t\t$userid = $this->session->userdata['userid'];\n\t\t\t\t\t\t$pde = mysql_query(\"select * from users where userid =\".$userid);\n\t\t\t\t\t\t$q = mysql_fetch_array($pde);\n\n\t\t\t\t\t\t if($this->session->userdata('isadmin') == 'N'){\n\t\t\t\t\t\t$result = paginate_list($this, $data, 'view_bebs', array('SEARCHSTRING' => ' and 1 and 1 and bidinvitations.procurement_id not in ( select procurement_ref_id FROM contracts ) and \tusers.userid = '.$userid.' ORDER BY bestevaluatedbidder.dateadded DESC' ),10);\n\t\t\t \t return $result;\n\t\t\t \t }\n\t\t\t\t \t else\n\t\t\t\t \t {\n\t\t\t\t \t \t$result = paginate_list($this, $data, 'view_bebs', array('SEARCHSTRING' => ' and 1 and 1 and bidinvitations.procurement_id not in ( select procurement_ref_id FROM contracts ) ORDER BY bestevaluatedbidder.dateadded DESC' ),10);\n\t\t\t \t return $result;\n\t\t\t\t \t }\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\n\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\t}", "protected abstract function fetchLists();", "function listadeTodosLiderDao(){\r\n require_once (\"../conexao.php\");\r\n require_once (\"../modelo/objetoMembro.php\");\r\n \r\n $objDao = Connection::getInstance();\r\n \r\n $resultado = mysql_query(\"Select Matricula,Nome from membros where LiderCelula = 'S' order by Nome\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $listaMembro = array();\r\n \r\n $i=0;\r\n \r\n \r\n while ($registro = mysql_fetch_assoc($resultado)){\r\n \r\n if($registro[\"Nome\"] != \"\"){\r\n \r\n\t $membro = new objetoMembro();\r\n \r\n $membro->setMatricula($registro['Matricula']);\r\n $membro->setNome($registro['Nome']);\r\n \r\n\t $listaMembro[$i] = $membro;\r\n\t}\r\n $i++;\r\n }\r\n\t\treturn $listaMembro;\r\n\t\tmysql_free_result($resultado);\r\n $objDao->freebanco();\r\n }", "function getBankLists() {\r\n\t\t$idealPlugin = os_payments::loadPaymentMethod('os_ideal');\t\t\r\n\t\t$params = new JRegistry($idealPlugin->params) ;\t\t\r\n\t\t$partnerId = $params->get('partner_id');\r\n\t\t$ideal = new iDEAL_Payment($partnerId) ;\r\n\t\t$bankLists = $ideal->getBanks();\r\n\t\treturn $bankLists ;\r\n\t}", "public function listarbiofinCE(){\n $stmt = $this->objPDO->prepare(\"SELECT b.id_biopsia,b.num_biopsia,b.fecha_ingreso,db.fecha_informe,(e.emp_nombres||' '||e.emp_appaterno||' '||e.emp_apmaterno) as medico,\n list(m.descr_muestra)as muestras from sisanatom.biopsia b \n inner join sisanatom.detalle_bioce db on b.id_biopsia=db.id_biopsia\n inner join sisanatom.muestras_biopsia mb on b.id_biopsia=mb.id_biopsia inner join empleados e on b.patologo_responsable=e.emp_id\n inner join sisanatom.muestra m on m.id_muestra=mb.id_muestrarem\n where b.estado_biopsia=3 and b.condicion_biopsia='A'\n group by b.id_biopsia,b.num_biopsia,b.fecha_ingreso,db.fecha_informe,medico\");\n $stmt->execute();\n $pacientes = $stmt->fetchAll(PDO::FETCH_OBJ);\n return $pacientes;\n }", "public function tree_backup_list() {\n global $db;\n\n return $db->fetch_table(\"SELECT * FROM `\".$this->table.\"_restore` ORDER BY STAMP DESC\");\n }", "function loadlist() {\n//\t\t$this->db->where(\"active\",true);\n\t\t$rows=null;\n\t\tif($q=$this->db->get($this->table_name)){\n\t\t\tforeach($q->result() as $r) {\n\t\t\t\t$rows[]=$r;\n\t\t\t}\n\t\t}\n\t\treturn $rows;\n\t}", "function listar_boletines() {\n\t\t$query = \"SELECT newsletters.*\n\t\tFROM newsletters\n\t\tORDER BY fecha_publicacion desc\";\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 function getBrochures(){\n\t\n\t\tif( empty($this->_brochures) ){\n\t\n\t\t\t$query\t= $this->_db->getQuery(true);\n\t\t\t\n\t\t\t$query->select( 'b.bro_id AS value, b.bro_title AS text' );\n\t\t\t$query->from( '#__zbrochure_brochures AS b' );\n\t\t\t$query->where( 'b.bro_published = 1' );\n\t\t\t\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$this->_brochures = $this->_db->loadObjectList();\n\n\t\t}\n\t\t\n\t\treturn $this->_brochures;\n\t\n\t}", "public static function allBundles(): Collection;", "public function get_all ();", "public function getAll()\n\t{\n\t\treturn $this->db->get('data_b')->result();\n\t}", "public function getBannedAccountsList() {\n\t\t$result = $this->db->queryFetch(\"SELECT \"._CLMN_MEMBID_.\", \"._CLMN_USERNM_.\", \"._CLMN_EMAIL_.\" FROM \"._TBL_MI_.\" WHERE \"._CLMN_BLOCCODE_.\" = 1 ORDER BY \"._CLMN_MEMBID_.\" ASC\");\n\t\tif(!is_array($result)) return;\n\t\treturn $result;\n\t}", "function getBrands()\n {\n $returned_brands = $GLOBALS['DB']->query(\"SELECT brands.* FROM stores\n JOIN stores_brands ON (stores.id = stores_brands.store_id)\n JOIN brands ON (stores_brands.brand_id = brands.id)\n WHERE stores.id = {$this->getId()};\");\n\n $brands = array();\n foreach($returned_brands as $brand) {\n $brand_name = $brand['brand_name'];\n $id = $brand['id'];\n $new_brand = new Brand($brand_name, $id);\n array_push($brands, $new_brand);\n }\n return $brands;\n }", "public function getAll()\n {\n return DB::table('bukus')->all();\n }", "public abstract function get_lists();", "function get_all_brands() {\n $this->db->order_by('name', 'asc');\n return $this->db->get('brands')->result_array();\n }", "function listadeTodosMembroDao(){\r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objDao = Connection::getInstance();\r\n \r\n $resultado = mysql_query(\"Select Matricula,Nome,Naturalidade,Fone from membros order by Nome\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $listaMembro = array();\r\n \r\n $i=0;\r\n \r\n \r\n while ($registro = mysql_fetch_assoc($resultado)){\r\n \r\n if($registro[\"Nome\"] != \"\"){\r\n \r\n\t $membro = new objetoMembro();\r\n \r\n $membro->setMatricula($registro['Matricula']);\r\n $membro->setNome($registro['Nome']);\r\n $membro->setNatural($registro['Naturalidade']); \r\n\t $membro->setFone($registro['Fone']); \r\n \r\n\t $listaMembro[$i] = $membro;\r\n \r\n\t}\r\n $i++;\r\n }\r\n\t\treturn $listaMembro;\r\n\t\tmysql_free_result($resultado);\r\n $objDao->freebanco();\r\n \r\n }", "public function findAll() {\n $sql = \"select * from billets order by billet_id desc\";\n $result = $this->getDb()->fetchAll($sql);\n \n // Convert query result to an array of domain objects\n $billets = array();\n foreach ($result as $row) {\n $billetId = $row['billet_id'];\n $nbComment = $this->commentDAO->countAllByBillet($billetId);\n $billets[$billetId] = $this->buildDomainObject($row);\n $billets[$billetId]->setNbComment($nbComment);\n }\n return $billets;\n }", "public function lists();", "function afficherhotels(){\n\t\t$sql=\"SElECT * From hotel order by id\";\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}", "public function plxMinifyCacheList(){\n\t\tfunction real($i,$a){$a=explode(' ',$a);return $a[$i];}# found url & more in last comment in cached source\n\t\t$cache_size = 0;\n\t\t$filesCache = array();\n\t\tif (extension_loaded('glob')){\n\t\t\t$cached = glob(PLX_CACHE.\"*.php\");\n\t\t\tforeach ($cached as $file){\n\t\t\t\t$cache_size += filesize(PLX_CACHE.$file);\n\t\t\t\t$filesCache [$this->get_time($file)] = array((basename($file)), $this->get_info($file), $this->get_info($file,'url'));\n\t\t\t}\n\t\t\tunset($cached);\n\t\t}\n\t\telse{\n\t\t\tif($cached = opendir(PLX_CACHE)){\n\t\t\t\twhile(($file = readdir($cached))!== false){\n\t\t\t\t\tif( $file == '.' || $file == '..' )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif(strtolower(strrchr($file,'.')==\".php\")){\n\t\t\t\t\t\t$cache_size += filesize(PLX_CACHE.$file);\n\t\t\t\t\t\t$filesCache [$this->get_time($file)] = array((basename($file)), $this->get_info($file), $this->get_info($file,'url'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclosedir($cached);\n\t\t\t}\n\t\t}\n\t\tkrsort($filesCache);\n\t\t$expire = ($this->getParam(\"freeze\")?0:time() - $this->getParam(\"delay\"));\n\t\techo '<img id=\"mc_mode\" class=\"icon_pmc\" src=\"'.PLX_PLUGINS.'plxMinifyCache/img/'.($this->getParam(\"freeze\")?'':'un').'lock.png\" title=\"Mode : '.($this->getParam(\"freeze\")?'Frozen':'Normal').'\" alt=\"Freeze Mode\" />&nbsp;';\n\t\techo $this->getLang('L_CACHE_LIST').' ('.count($filesCache).') : '.date('Y-m-d H:i:s').' - '.$this->getLang('L_TOT').' : '.$this->size_readable($cache_size, $decimals = 2).'<hr /><pre id=\"CacheList\" class=\"brush_bash\">';\n\t\tforeach($filesCache as $ts => $name)#findicons.com free\n\t\t\techo '<a class=\"hide\" title=\"'.L_DELETE.' '.$name[0].'\" href=\"javascript:clean(\\''.$name[0].'\\');\"><img class=\"icon_pmc del_file\" src=\"'.PLX_PLUGINS.'plxMinifyCache/img/del.png\" title=\"'.L_DELETE.'\" alt=\"del\" /></a><b style=\"color:'.($ts < $expire?'red\" title=\"expired\">':'green\">').' <a title=\"'.$name[0].PHP_EOL.$name[2].'\" target=\"_blank\" style=\"color:unset;\" href=\"'.PLX_ROOT.'cache/'.$name[0].'\">'.date('Y-m-d H:i:s',$ts).'<i class=\"mc-sml-hide\"> : '.$name[0].'</i></a></b> : <a title=\"'.real(2,$name[2]).PHP_EOL.real(1,$name[2]).'\" target=\"_blank\" href=\"'.PLX_ROOT.real(1,$name[2]).'\">'.$name[1].'</a><br />';\n\t\techo '<br /></pre>';\n\t}", "public function allBoons() {\n\n // retrieve all Boons\n $boonModel = new Boon();\n $boonList = $boonModel->findAllBoons(); // array of objects\n\n // Send the datas to the view\n $this->show('boons', [\n 'boonList' => $boonList\n ]);\n }", "public function list_cache()\n {\n $result = $this->_db->find('all');\n\n $return_list = array();\n $ttl_expiry = time() - $this->_cacheTTL;\n\n foreach ($result as $i => $cache_item) {\n $expired = false;\n $ttl = $cache_item[$this->_db->name]['created'];\n\n if ($ttl < $ttl_expiry) {\n $expired = true;\n }\n\n $return_list[] = array(\n 'item_name' => $cache_item[$this->_db->name]['request_hash'],\n 'contents' => $cache_item[$this->_db->name]['request_response'],\n 'location' => $cache_item[$this->_db->name]['request_hash'],\n 'ttl' => $ttl,\n 'expired' => $expired\n );\n }\n\n return $return_list;\n }", "public static function cleanAllLists() {\r\n \tself::$list=array();\r\n }", "function getAllLists()\n {\n $stmt = self::$_db->prepare(\"SELECT * FROM list\");\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function findAllLoaded() {}", "public function getAllMerekBajuAktif()\n {\n $sql = \"SELECT DISTINCT mb.id_merek_baju AS idMerekBaju, mb.nama_merek_baju AS merekBaju \n FROM merek_baju mb \n JOIN baju ba ON mb.id_merek_baju = ba.id_merek_baju\";\n $query = koneksi()->query($sql);\n $hasil = [];\n while ($data = $query->fetch_assoc()) {\n $hasil[] = $data;\n }\n return $hasil;\n }", "public function getAll($cache = true) {}", "public function &items();", "public function getItemsList(){\n return $this->_get(4);\n }", "function carrinho(){\n\t\t\t$this->items = array();\n\t\t}", "public function load()\n\t{\n\t\tif (!$this->cache->contains($this->cache_id)) {\n\t\t\t$this->generateCacheList();\n\t\t}\n\n\t\t$this->list = $this->cache->fetch($this->cache_id);\n\n\t\t$this->num = count($this->list);\n\t\t$this->unique = (boolean)($this->num == 1);\n\t}", "public function getAllPossibleRefits()\n {\n // Get the SEs filtered by Permissible Refits, or same SB and are Incomplete\n $sb_list = SkeletalBone::where('refit' ,'=' , true)->orWhere('id', $this->sb_id)->pluck('id')->toArray();\n return SkeletalElement::whereIn('sb_id', $sb_list)->where('completeness', '=', 'Incomplete')->get();\n }", "public function readAll()\n {\n\n \t$list = $this->dao->readAll();\n\n if (!is_array($list) && $list != false){ // si no hay nada cargado, readall devuelve false\n $array[] = $list; \n $list = $array; // para que devuelva un arreglo en caso de haber solo 1 objeto // esto para cuando queremos hacer foreach al listar, ya que no se puede hacer foreach sobre un objeto ni sobre un false\n }\n\n return $list;\n }", "public function getBcc(): iterable;", "public function all() {return $this->requete(\"SELECT * FROM \" . $this->table . \" ORDER BY marque\");}", "function listadeMembroPorNome($nome){\r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objDao = Connection::getInstance();\r\n \r\n $resultado = mysql_query(\"SELECT Matricula,Nome,Naturalidade,Fone FROM membros WHERE Nome LIKE '%$nome%'\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $listaMembro = array();\r\n \r\n $i=0;\r\n \r\n \r\n while ($registro = mysql_fetch_assoc($resultado)){\r\n \r\n// if($registro[\"Nome\"] != \"\"){\r\n \r\n\t $membro = new objetoMembro();\r\n \r\n $membro->setMatricula($registro['Matricula']);\r\n $membro->setNome($registro['Nome']);\r\n $membro->setNatural($registro['Naturalidade']); \r\n\t $membro->setFone($registro['Fone']); \r\n \r\n\t $listaMembro[$i] = $membro;\r\n \r\n//\t}\r\n $i++;\r\n }\r\n\t\treturn $listaMembro;\r\n\t\tmysql_free_result($resultado);\r\n $objDao->freebanco();\r\n }", "function bm_get_books($all=false) {\n\n $now = time();\n $books = array();\n $data = @getXML(BMBOOKCACHE);\n \n \n foreach ($data->item as $item) {\n if ($all || $item->private != 'Y' && strtotime($item->date) < $now)\n $books[] = $item;\n }\n return $books;\n}", "public function getItens() {\n\n if (count($this->aItens) == 0) {\n \n $oDaoProcessoItemLote = new cl_processocompraloteitem; \n $sQueryItemLote = $oDaoProcessoItemLote->sql_query_file(null, \n \"pc69_sequencial\", \n null, \n \"pc69_processocompralote = {$this->getCodigo()}\"\n );\n \n $rsDadosItem = $oDaoProcessoItemLote->sql_record($sQueryItemLote); \n if ($oDaoProcessoItemLote->numrows > 0) {\n \n for ($iItem = 0; $iItem < $oDaoProcessoItemLote->numrows; $iItem++) {\n \n $iCodigoItem = db_utils::fieldsMemory($rsDadosItem, $iItem);\n $this->aItens[] = ItemProcessoCompraRepository::getItemByCodigo($iCodigoItem);\n }\n } \n }\n return $this->aItens;\n }", "function listar_historial(){\n\t\tif (isset($_POST['buscar']))\n\t\t\t$_SESSION['buscar']=$_POST['buscar'];\n\t\t\n\t\t$sql=\"SELECT * FROM historial ORDER BY id_his\";\n\t\t\n\t\t$consulta=mysql_query($sql);\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "function buscar_links($id){\n $this->asignar_valores();\n $sql=\"SELECT * FROM linkxsub, sublink WHERE link_rel='$id' AND sublink_rel=id_sub ORDER BY prioridad_sub\";\n $buscar=mysql_query($sql);\n unset($this->listado2);\n while ($resultado = mysql_fetch_array($buscar)){\n $this->mensaje=\"si\";\n $this->listado2[] = $resultado;\n }\n\n }", "function listadeMembrodaDao($nome){\r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objDao = Connection::getInstance();\r\n \r\n $resultado = mysql_query(\"Select * from membros where Nome LIKE '%$nome%'\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $listaMembro = array();\r\n \r\n $i=0;\r\n $achou=FALSE;\r\n \r\n if($resultado != \"\"){\r\n \r\n while ($registro = mysql_fetch_assoc($resultado)){\r\n \r\n\t $membro = new objetoMembro();\r\n \r\n $membro->setMatricula($registro['Matricula']);\r\n $membro->setNome($registro['Nome']);\r\n $membro->setSexo($registro['Sexo']); \r\n $membro->setData($registro['DataNascimento1']); \r\n $membro->setRg($registro['Rg']);\r\n $membro->setCpf($registro['Cpf']); \r\n $membro->setEstadocivil($registro['EstadoCivil']);\r\n $membro->setNatural($registro['Naturalidade']); \r\n $membro->setProfissao($registro['Profissao']); \r\n $membro->setEscola($registro['Escolaridade']); \r\n $membro->setPai($registro['Pai']); \r\n $membro->setMae($registro['Mae']); \r\n $membro->setNecessidade($registro['NecessidadeEspeciais']);\r\n\t $membro->setFone($registro['Fone']); \r\n $membro->setFilho($registro['Filho']); \r\n $membro->setFormacao($registro['FormacaoEclesiatica']);\r\n $membro->setMembrasia($registro['IntegracaoMembrasia']); \r\n $membro->setFuncao($registro['Funcao']); \r\n $membro->setParticipou($registro['JaParticipou']);\r\n\t $membro->setTrabalhando($registro['Trabalhando']); \r\n $membro->setViajando($registro['EstadoAtual']); \r\n $membro->setCongrega($registro['Congrega']); \r\n $membro->setRua($registro['Rua']); \r\n $membro->setBairro($registro['Bairro']); \r\n $membro->setCasa($registro['Casa']); \r\n $membro->setStatus($registro['Status']);\r\n \r\n\t $listaMembro[$i] = $membro;\r\n \r\n\t $i++;\r\n $achou = true;\r\n\t}\r\n \r\n }\r\n\t\treturn $listaMembro;\r\n if($achou){\r\n mysql_free_result($registro);\r\n }\r\n\t\tmysql_free_result($resultado);\r\n $objDao->freebanco(); \r\n }", "public function getLinksList()\n {\n $sql = 'SELECT bwl.*, bwll.`title`, bwll.`url`\n FROM `'._DB_PREFIX_.'bwcatbanner_link` bwl\n LEFT JOIN `'._DB_PREFIX_.'bwcatbanner_link_lang` bwll\n ON (bwl.`id_item` = bwll.`id_item`)\n WHERE bwl.`id_shop` = '.(int)Context::getContext()->shop->id.'\n AND bwll.`id_lang` = '.(int)Context::getContext()->language->id;\n\n return Db::getInstance()->executeS($sql);\n }", "function my_list()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['list'] = $this->_bid->my_list();\n\t\t\n\t\t$this->load->view('bids/my_list', $data);\n\t}", "function list_billable() {\n\t\n\t$graph_items = db_fetch_assoc(\"SELECT \n\t\t\ti.id AS item_id, \n\t\t\ti.local_graph_id, \n\t\t\ti.task_item_id, \n\t\t\ti.text_format, \n\t\t\tg.id AS graph_id, \n\t\t\tg.title_cache,\n\t\t\td.local_data_id,\n\t\t\td.data_source_name\n\t\tFROM \n\t\t\tgraph_templates_item AS i, \n\t\t\tgraph_templates_graph AS g,\n\t\t\tdata_template_rrd as d\n\t\tWHERE \n\t\t\ti.local_graph_id = g.local_graph_id AND \n\t\t\ti.task_item_id = d.id AND\n\t\t\ti.local_graph_id <> 0 AND \n\t\t\ti.task_item_id <> 0 AND \n\t\t\ti.graph_type_id = 1 AND \n\t\t\ttext_format LIKE '%|%|%'\n\t\tORDER BY\n\t\t\ti.local_graph_id;\n\t\t\");\n\n\t$local_graph_id_prev = 0;\n\t$count_graph = 0;\n\t$count_graph_item = 0;\n\t$item_type = \"N/A\";\n\t$match = array();\n\tif (sizeof($graph_items) > 0) {\n\t\tprintf(\"\\n%-80s\\n\",\"Cacti Billable Graphs List\");\n\t\tprintf(\"%'=80s\\n\",\"\");\n\t\tprintf(\"%-10s%-70s\\n\",\"Graph ID\",\"Graph Title\");\n\t\tprintf(\"%2s%'--78s\\n\",\"\",\"\");\n\t\tprintf(\"%2s%-7s%-25s%-46s\\n\",\"\",\"ID\",\"Item Type\",\"Example Output\");\n\t\tprintf(\"%'=80s\\n\",\"\");\n\t\tforeach ($graph_items as $graph_item) {\n\t\t\t$item_type = \"N/A\";\n\t\t\t$match = array();\n\t\t\tif (preg_match('/\\|sum\\:.*\\|/',$graph_item[\"text_format\"]) > 0) { \n\t\t\t\t$item_type = \"Bandwidth Summation\";\n\t\t\t} elseif (preg_match('/\\|([0-9]{1,2})\\:[\\:0-9a-z_]+\\|/',$graph_item[\"text_format\"], $match) > 0) { \n\t\t\t\t$item_type = get_pretty_nth_value($match[1]);\n\t\t\t}\n\t\t\tif ($graph_item[\"local_graph_id\"] <> $local_graph_id_prev) {\t\n\t\t\t\tif ($local_graph_id_prev <> 0) {\n\t\t\t\t\tprintf(\"%'=80s\\n\",\"\");\n\t\t\t\t}\n\t\t\t\tprintf(\"%-10s%-80s\\n\", $graph_item[\"local_graph_id\"], $graph_item[\"title_cache\"]);\n\t\t\t\tprintf(\"%2s%'--78s\\n\",\"\",\"\");\n\t\t\t\t$count_graph++;\n\t\t\t}\n\t\t\t$count_graph_item++;\n\t\t\tprintf(\"%2s%-7s%-25s%-46s\\n\",\"\", $graph_item[\"item_id\"],$item_type, process_variables($graph_item[\"text_format\"],$graph_item));\n\t\t\t$local_graph_id_prev = $graph_item[\"local_graph_id\"];\n\t\t}\n\t\tprintf(\"%'=80s\\n\",\"\");\n\t\tprintf(\"Totals: Graphs: %d Items: %d\\n\\n\", $count_graph, $count_graph_item);\n\t} else {\n\t\tprint \"\\n No items found \\n\";\n\t}\n\t\n}", "function read_all_items() {\n $db = GetGlobal('db');\n\t $lan = GetReq('lan')>=0?GetReq('lan'):getlocal();\t//in case of post sitemap set lan param uri \n\t $itmname = $lan?'itmname':'itmfname';\n\t $itmdescr = $lan?'itmdescr':'itmfdescr';\t \n\t $start = GetReq('start');\n\t //$headcat = GetReq('headcat')?GetReq('headcat'):\"\";\t \n\t //$meter = $start?$start-1:0; \t \n\t \n\t \t\n $sSQL = \"select id,itmname,itmfname,cat0,cat1,cat2,cat3,cat4,itmdescr,itmfdescr,itmremark,\".$this->getmapf('code').\" from products \";\n\t $sSQL .= \" WHERE \";\n\t $sSQL .= \"itmactive>0 and active>0 \";\t\n\t //$sSQL .= \" GROUP BY cat0,$itmname\";\n\t $sSQL .= \" ORDER BY cat0,cat1,cat2,cat3,cat4,$itmname asc \";\n\t $sSQL .= $start ? \" LIMIT $start,10000\" : \" LIMIT 10000\";\t\t\t\n\t //echo $sSQL;\n\t\t\n\t $resultset = $db->Execute($sSQL,2);\t\n\t // $result = $resultset;\n\t $this->result = $resultset; \n \t $this->max_items = $db->Affected_Rows();//count($this->result);\t \n return (null);//$this->max_items);\t\t \n\t}", "function get_banned_user_list()\r\n{\r\n\tglobal $db, $user, $phpbb_root_path, $phpEx;\r\n\t$user->add_lang('mods/inactive_users');\r\n\r\n\t$sql = 'SELECT ban_userid, ban_end\r\n\t\tFROM ' . BANLIST_TABLE . '\r\n\t\tWHERE (ban_end > ' . time() . ' OR ban_end = 0)\r\n\t\t\tAND ban_exclude <> 1'; \r\n\t$result = $db->sql_query($sql, 3600);\r\n\t//To disable 3600 seconds cache, comment the line above and uncomment the line below\r\n\t//$result = $db->sql_query($sql);\r\n\t\r\n\t$banned_users[] = '';\r\n\twhile ($row = $db->sql_fetchrow($result))\r\n\t{\r\n\t\t$banned_users[$row['ban_userid']] = $row['ban_end'];\r\n\t}\t\r\n\t$db->sql_freeresult($result);\r\n\t\r\n\treturn $banned_users;\r\n\t\r\n}", "public function get_Banco(){\r\n $conectar=parent::conexion();\r\n parent::set_names();\r\n $sql=\"select * from banco;\";\r\n $sql=$conectar->prepare($sql);\r\n $sql->execute();\r\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\r\n }", "public function getList()\n\t{\n\t\treturn $this->crud->orderby('id DESC')\n\t\t\t\t\t->read(10)\n\t\t;\t\n\t}", "protected function getBannerItems()\n {\n $self = $this;\n\n return Cache::remember(\n 'home_banner_items',\n config('kosher.cache_expiration_time'),\n function () use ($self) {\n $recipes = Recipe::banner()->with('categories')->get();\n $articles = Article::banner()->published()->with('category')->get();\n $shows = Show::banner()->get();\n\n $banner = $recipes->merge($articles)\n ->merge($shows)\n ->shuffle()\n ->take(config('kosher.pagination.home_banner_items'));\n\n if (0 == $banner->count()) {\n $recipes = Recipe::featured()->with('categories')->get();\n $articles = Article::featured()->published()->with('category')->get();\n $shows = Show::featured()->get();\n\n $banner = $recipes->merge($articles)\n ->merge($shows)\n ->shuffle()\n ->take(config('kosher.pagination.home_banner_items'));\n }\n\n if (0 == $banner->count()) {\n $banner = Recipe::published()\n ->with('categories')\n ->take(config('kosher.pagination.home_banner_items'))\n ->get();\n $self->mergeReceivedRecipes($banner);\n } else {\n $recipes = collect();\n foreach ($banner as $item) {\n if ($item->isRecipe()) {\n $recipes->push($item);\n }\n }\n $self->mergeReceivedRecipes($recipes);\n }\n\n return $banner;\n }\n );\n }", "function listarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_sel';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('id_cuenta_bancaria_boa','int4');\n\t\t$this->captura('banco','int4');\n\t\t$this->captura('cuenta','varchar');\n\t\t$this->captura('desc_cuenta','varchar');\n\t\t$this->captura('moneda','int4');\n\t\t$this->captura('tipo_cuenta','bpchar');\n\t\t$this->captura('estado_cuenta','bpchar');\n\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('desc_cuenta_banco','varchar');\n\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function liste__() {\n\n // lecture des informations\n $this->db->select(\"rgl_id,rgl_reference,rgl_date,rgl_montant,rgl_type,vtr_type,rgl_cheque,rgl_banque,rgl_client,ctc_nom\",false);\n $this->db->join('v_types_reglements','vtr_id=rgl_type','left');\n $this->db->join('t_contacts','ctc_id=rgl_client','left');\n $this->db->where('rgl_inactif is null');\n $this->db->order_by(\"rgl_date desc\");\n $this->db->order_by(\"rgl_id desc\");\n $query = $this->db->get_compiled_select('t_reglements');\n //log_message('DEBUG', 'M_reglements '.$query);\n $q = $this->db->query($query);\n if ($q->num_rows() > 0) {\n $result = $q->result();\n foreach($result as $r) {\n $query = $this->db->where('ipu_reglement',$r->rgl_id)\n ->where('ipu_inactif is null')\n ->select('ipu_facture,fac_reference,ipu_avoir,avr_reference')\n ->join('t_factures','fac_id=ipu_facture','left')\n ->join('t_avoirs','avr_id=ipu_avoir','left')\n ->get_compiled_select('t_imputations');\n //log_message('DEBUG', 'M_reglements '.$query);\n $q = $this->db->query($query);\n $pieces = '';\n $sep = '';\n foreach ($q->result() as $p) {\n $pieces .= $sep;\n if ($p->fac_reference != '') {\n $pieces .= anchor_popup('factures/detail2/'.$p->ipu_facture,$p->fac_reference);\n }\n else if ($p->avr_reference != '') {\n $pieces .= anchor_popup('avoirs/detail2/'.$p->ipu_avoir,$p->avr_reference);\n }\n $sep = '<br />';\n }\n $r->pieces = $pieces;\n if ( $pieces!='' )\n log_message('DEBUG', 'M_reglements ipu_reglement:'.$r->rgl_id.' pieces:'.$pieces);\n }\n return $result;\n }\n else {\n return array();\n }\n }", "public static function fetch_all_in_a_list()\n\t{\n\t return Company::orderBy( 'name' )->lists( 'name' , 'id' );\n\n\t}", "public static function getShopBackgroundList()\n {\n\t\t$key = 'BackgroundList';\n\t\t$cache = Hapyfish_Cache_Memcached::getInstance();\n\t\t$list = $cache->get($key);\n\t\tif ($list === false) {\n\t\t\t//load from database\n\t\t\t$db = Hapyfish_Island_Dal_Shop::getDefaultInstance();\n\t\t\t$list = $db->getBackgroundList();\n\t\t\tif ($list) {\n\t\t\t\t$cache->add($key, $list, Hapyfish_Cache_Memcached::LIFE_TIME_ONE_MONTH);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $list;\n }", "public function getTabularItems()\n {\n return SATabularListM::model()->findAll(array('order'=>'tabularlist_block'),array('tabularlist_aktif'=>TRUE));\n // return Yii::app()->db->createCommand('SELECT tabularlist_id, tabularlist_block FROM tabularlist_m WHERE tabularlist_aktif=TRUE')->queryAll();\n }" ]
[ "0.66875595", "0.66161966", "0.6536415", "0.641037", "0.6178357", "0.6120532", "0.6109238", "0.60359925", "0.6029658", "0.5949941", "0.59477276", "0.59362024", "0.59362024", "0.59203494", "0.59199154", "0.58672845", "0.58555084", "0.58313066", "0.5803488", "0.5799098", "0.5799098", "0.57808", "0.577576", "0.57574654", "0.5757271", "0.57447326", "0.5737753", "0.5732865", "0.5689588", "0.5689588", "0.5689588", "0.5678244", "0.5674582", "0.56741345", "0.5669383", "0.5648235", "0.5638989", "0.5634864", "0.5623004", "0.5620926", "0.56065035", "0.5595599", "0.5595599", "0.5595539", "0.559222", "0.55874646", "0.5586215", "0.55796593", "0.55788237", "0.5575968", "0.5575251", "0.55747485", "0.5569394", "0.5563623", "0.55606127", "0.55595416", "0.55576783", "0.55562615", "0.55549794", "0.5551915", "0.555081", "0.55485785", "0.5544492", "0.55323416", "0.5528096", "0.55175877", "0.55087465", "0.55011994", "0.54990673", "0.54976386", "0.54913235", "0.54913086", "0.5489967", "0.5474339", "0.5459128", "0.54571724", "0.5447263", "0.544331", "0.5440796", "0.54369605", "0.5436639", "0.54323035", "0.5427029", "0.5426535", "0.5425447", "0.54251605", "0.5419775", "0.5419466", "0.5418028", "0.5415364", "0.5412064", "0.5406561", "0.5403573", "0.540337", "0.5398152", "0.539769", "0.5397069", "0.5396567", "0.53867424", "0.5386677", "0.53858054" ]
0.0
-1
If the timer is stopped the returned value is the time passed between start() and stop() If called when the timer is started, the method returns the currently passed time.
public function getTimePassed(): float { if ($this->started) { return microtime(true) - $this->start_time; } else { return $this->stop_time - $this->start_time; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function time()\n\t{\n\t\treturn $this->endTimer-$this->startTimer;\n\t}", "function timer(){\n static $start;\n\n if (is_null($start))\n {\n $start = microtime(true);\n }\n else\n {\n $diff = round((microtime(true) - $start), 4);\n $start = null;\n return $diff;\n }\n}", "public function getElapsedTimeInSeconds()\n {\n if(!$this->_timeStartInMicroSeconds)\n {\n return 0;\n }\n\n $microSecsStart = $this->_timeStartInMicroSeconds;\n $microSecsStop = $this->_timeStopInMicroSeconds;\n\n if($microSecsStop == 0)\n {\n // The function stopTimer was not called.\n $microSecsStop = microtime(true);\n }\n\n $seconds = $microSecsStop - $microSecsStart;\n\n return round($seconds, 4);\n }", "public static function getStartTime(): float\n {\n return self::$startTimer;\n }", "public function startTime() {\n return intval($this['started']);\n }", "function timer_stop(){\n\t\t$mtime = explode(' ', microtime());\n\t\t$time_end = $mtime[1] + $mtime[0];\n\t\t$time_total = $time_end - $this->time_start;\n\t\treturn $time_total;\n\t}", "public function getRunningTime()\n\t{\n\t\treturn $this->microtime_float() - $this->start_time;\n\t}", "function elapsedSeconds() {\n if (null === $this->startMicrotime) {\n throw new InvalidArgumentException(\"Start time was not marked\");\n }\n if (null === $this->endMicrotime) {\n // Not stopped so return time from start to now\n return microtime(true) - $this->startMicrotime;\n }\n // Stopped so show total elapsed time between start and stop\n return $this->endMicrotime - $this->startMicrotime;\n }", "public static function getTimer()\n {\n return microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n }", "public static function timer_stop() {\n $mtime = microtime();\n $mtime = explode(' ', $mtime);\n $time_end = $mtime[1] + $mtime[0];\n $time_total = $time_end - self::$time_start;\n return $time_total;\n }", "public function getTimer()\n {\n return $this->_timer;\n }", "public function getTimer()\n {\n return $this->_timer;\n }", "public function getElapsedTime();", "function getElapsedSeconds() {\n\t\treturn $this->time;\n\t}", "public function getTiming()\n {\n return $this->timing;\n }", "protected static function _timeToStopwatch()\n {\n return self::$_startupTime - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "private function elapsedRaw($timer = 'default', $stop = true)\r\n\t{\r\n\t\tif ($stop)\r\n\t\t{\r\n\t\t\tstatic::stop($timer);\r\n\t\t}\r\n\r\n\t\t$end = static::isStopped($timer)\r\n\t\t\t\t? static::$stoppedAt[$timer]\r\n\t\t\t\t: microtime(true);\r\n\r\n\t\treturn abs($end - static::$startedAt[$timer]);\r\n\t}", "public function elapsedtime() {\n return fmod(floatval($this->servertime()),$this->waitingtime());\n\t}", "public function getTimeTaken(){\r\n return round($this->getEndTime() - $this->getStartTime(), 6);\r\n }", "public function get_time_since_ended() {\r\n\t\tif ( 0 !== $this->get_seconds_left() ) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\treturn current_time( 'timestamp' ) - $this->get_end_time();\r\n\t}", "public function getTimeElapsed()\n {\n $start_time = $this->getStartTime();\n\n if (isset($start_time)) {\n $end_time = $this->getEndTime();\n\n if (!isset($end_time)) {\n $end_time = microtime(true);\n }\n\n return $end_time - $this->getStartTime();\n }\n\n return false;\n }", "private function get_time_interval() {\n if ($this->microtime_start === null) {\n $this->microtime_start = microtime(true);\n return 0.0;\n }\n $now = microtime(true);\n $dif = $now - $this->microtime_start;\n $this->microtime_start = $now;\n return $dif;\n }", "private static function stopTimer(): float\n {\n return (float)(microtime(true) - self::$TimerBegin);\n }", "protected function getElapsedTimeInMs()\n {\n return (microtime(true) - $this->start) * 1000;\n }", "public static function elapsed($timerName = 'default') {\n return microtime(true) - self::$startTimes[$timerName];\n }", "public static function getStartTime() : float\n {\n if (!isset(static::$startTime)) {\n static::$startTime = microtime(true);\n }//end if\n \n return static::$startTime;\n \n }", "public static function elapsed($timerName = 'default') {\n return microtime(true) - self::$startTimes[$timerName];\n }", "public static function stop()\n {\n if (self::$time === null) {\n throw new \\Exception('The timer is not started');\n }\n\n $elapsedTime = microtime(true) - self::$time;\n\n self::$time = null;\n\n return $elapsedTime;\n }", "public static function stop(): float\n {\n $elapsed = static::elapsed();\n\n static::clear();\n\n return $elapsed;\n }", "protected function calculateTime()\n {\n return $this->start->diffInHours($this->end) +\n round(\n ($this->start->diffInMinutes($this->end) - ($this->start->diffInHours($this->end) * 60)) / 60,\n 1\n );\n }", "function second()\r\n {\r\n $value = $this->SecondsElapsed;\r\n\r\n $second = $value % 60;\r\n\r\n return $second;\r\n }", "public static function timeSinceStart(): float\n {\n return \\microtime(true) - self::getRequestTime();\n }", "public function getElapsed()\n {\n $elapsedTime = array_sum($this->_totalTime);\n\n // No elapsed time or currently running? take/add current running time\n if ($this->_start !== null) {\n $elapsedTime += microtime(true) - $this->_start;\n }\n\n return $elapsedTime;\n }", "public function getTime()\n {\n return (float)sprintf(\"%.1f\", 1000*(microtime(true) - $this->startTime));\n }", "public static function getTimeToRun();", "public static function get_elapsed_time()\n {\n return microtime( true ) - $_SESSION['time']['script_start_time'];\n }", "public function getElapsedTime() {\n\t\treturn self::$elapsedTime;\n\t}", "public function time() {\n return $this->info['total_time'];\n }", "protected static function _timeFromCakeToStopwatch(): float\n {\n return self::$_startupTime - TIME_START;\n }", "public function getTime()\n {\n $time = 0;\n foreach ($this->data['calls'] as $call) {\n $time += $call['time'];\n }\n\n return $time;\n }", "static public function getSessionTime(){\n if (!isset($_SESSION['start_time'])){\n return 0;\n } else {\n return time() - $_SESSION['start_time'];\n }\n }", "private function elapsed($timer = 'default', $stop = true)\r\n\t{\r\n\t\treturn sprintf($this->getFormat(), static::elapsedRaw($timer, $stop));\r\n\t}", "function elapsed($event) {\n $endTime = Timer::getMicroTime();\n if (Timer::isStopped($event)) {\n $endTime = Timer::getEndTime($event);\n }\n return round($endTime - Timer::getStartTime($event), 4);\n }", "public function getTimeDiff()\n {\n $start = ServiceUtil::getManager()->getArgument('debug.toolbar.panel.rendertime.start');\n $end = microtime(true);\n\n $diff = $end - $start;\n return $diff;\n }", "public function getElapsed() {\n if ($this->hasStarted() && $this->hasStopped()) {\n return number_format($this->stoppedAt - $this->startedAt, 7);\n }\n throw new StopwatchException('Cannot get elapsed time, insufficient data');\n }", "public function duration()\n\t{\n\t\t$dif = $this->runEnd->difference( $this->runStart );\n\n\t\t$minutes = (int) $dif->getMinutes( true );\n\t\t$seconds = $dif->getSeconds( true );\n\n\t\t// Since $seconds includes the minutes, calc the extra\n\t\t$seconds = $seconds - ( $minutes * 60 );\n\n\t\treturn str_pad( (string) $minutes, 2, '0', STR_PAD_LEFT ) . ':' . str_pad( (string) $seconds, 2, '0', STR_PAD_LEFT );\n\t}", "public static function getTimeFromStart()\n {\n return sprintf('%.0f', (microtime(true) - dm::getStartTime()) * 1000);\n }", "public function get_exec_time()\n\t\t{\n\t\t\treturn $this->stop_time - $this->start_time;\n\t\t}", "public function get_seconds_left() {\r\n\t\tif ( $this->is_endless() ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$time_left = $this->get_end_time() - current_time( 'timestamp' );\r\n\t\treturn $time_left < 0 ? 0 : $time_left;\t\r\n\t}", "function secondsElapsed()\r\n {\r\n return $this->SecondsElapsed;\r\n }", "function elapsed_time($start_time, $finish_time){\n\treturn sc_strtotime($finish_time) - sc_strtotime($start_time);\n}", "protected function getFinalTime()\n {\n $currentTime = $this->getTime();\n $result = $currentTime - $this->startTime;\n\n return $result;\n }", "public static function ms(): int\n {\n return round((static::elapsed() * 1000), 0);\n }", "public function startTime(): int\n {\n return $this->startTime;\n }", "protected function getFinalTime() {\n $currentTime = $this->getTime();\n \n $result = $currentTime - $this->startTime;\n \n return $result;\n }", "protected function getStepTime()\n {\n $currentTime = $this->getTime();\n $result = $currentTime - $this->latsStepTime;\n $this->latsStepTime = $currentTime;\n\n return $result;\n }", "public function getInvocationTiming()\n {\n return $this->invocation_timing;\n }", "protected function startTime()\n {\n return microtime(true);\n }", "public function getTimeStart() {\n return $this->time_start;\n }", "public function get_meterTimer(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::METERTIMER_INVALID;\n }\n }\n $res = $this->_meterTimer;\n return $res;\n }", "public function getDelayTime() {}", "public function getTime(): int {\n\t\treturn $this->time;\n\t}", "function timer()\n {\n return hrtime(true);\n }", "public function getTotalTime(){\n return $this->totalTime;\n }", "public function getTime() : int\n {\n $eventTime = $this->getTimeStamp();\n $eventStartTime = static::getStartTime();\n \n return number_format((($eventTime - $eventStartTime) * 1000), 0, '', '');\n \n }", "public function get_total_time() {\n\t\t\treturn $this->total_time;\n\t\t}", "protected function getElapsedTime($start)\n {\n return round((microtime(true) - $start) * 1000, 2);\n }", "public function passedTicks() {\r\n\t\t$seconds = 300;\r\n\r\n\t\t$lastUpdate = (int)($this->lastUpdate() / $seconds);\r\n\t\t$now = (int)(TIME / $seconds);\r\n\r\n\t\treturn ($now - $lastUpdate);\r\n\t}", "protected function getElapsedTime($start)\n {\n return round ( (microtime ( true ) - $start) * 1000, 2 );\n }", "public function getWorkedTime() {\n if (!isset($this->workedTime)) {\n $start = new DateTime($this->start);\n $end = new DateTime($this->end);\n $break = new DateTime($this->break);\n\n $work = $start->diff($end)->format(\"%H:%i:%S\");\n $work = new DateTime($work);\n\n //for what ever reason we need to add the break to the work\n $work->add($break->diff(new DateTime(\"00:00:00\")));\n\n $this->workedTime = $work->format(\"H:i:s\");\n }\n\n return $this->workedTime;\n }", "function getTimeDuration();", "public function getTime(): float\n {\n return $this->time;\n }", "public function getSeconds() {\n $seconds = 0;\n foreach ($this->steps ?? [] as $step):\n $parser = explode(':', $step->getDuration());\n $seconds += (($parser[0] ?? 0) * 60 * 60) + (($parser[1] ?? 0) * 60) + $parser[2] ?? 0;\n endforeach;\n $this->seconds = $seconds;\n return $this->seconds;\n }", "protected function getStepTime() {\n $currentTime = $this->getTime();\n \n $result = $currentTime - $this->latsStepTime;\n \n $this->latsStepTime = $currentTime;\n \n return $result;\n }", "private static function time()\n {\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n }", "public function getTotalTime()\n {\n return $this->info->total_time * 1000;\n }", "public static function totalDuration()\n {\n return microtime(true) - static::initialTime();\n }", "public function get_time() {\n return $this->_time;\n }", "public function timeCaptureStart() { return $this->_m_timeCaptureStart; }", "public function getTime()\n {\n $value = $this->get(self::TIME);\n return $value === null ? (double)$value : $value;\n }", "public function getRelativeTime() : float\n {\n return ($this->timeStamp - static::$startTime);\n \n }", "public function getDurationTime()\n {\n return $this->duration * 60 * 60;\n }", "public function getTime()\n {\n $time = 0;\n foreach ($this->data['commands'] as $command) {\n $time += $command['executionMS'];\n }\n\n return $time;\n }", "public function getTime_start()\n {\n return $this->time_start;\n }", "public function getSpentTime() {\n\t\treturn $this->spentTime;\n\t}", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTotalTime()\n {\n return 0; //@todo\n }", "public function getTime() {\n\t\treturn $this->_time;\n\t}", "public function getDuration()\n {\n if (!isset($this->data['events']['__section__'])) {\n return $this->getData('duration', 0);\n }\n\n /** @var \\Symfony\\Component\\Stopwatch\\StopwatchEvent $event */\n $event = $this->data['events']['__section__'];\n\n return $event->getDuration();\n }", "public function getTime() {\n return $this->time;\n }" ]
[ "0.78012633", "0.71666104", "0.69945776", "0.6935704", "0.6892228", "0.68796", "0.68100804", "0.68027616", "0.67837566", "0.67712915", "0.6749795", "0.6749795", "0.67477113", "0.6682063", "0.66339284", "0.6618404", "0.6617332", "0.66017705", "0.6531413", "0.6525499", "0.6520241", "0.64696395", "0.64676017", "0.6445312", "0.6434171", "0.64317673", "0.6421539", "0.6383184", "0.63722366", "0.63624156", "0.6342212", "0.63150924", "0.6313376", "0.6280663", "0.6272714", "0.62569", "0.6246665", "0.6238515", "0.62268597", "0.621724", "0.6209621", "0.61910856", "0.61898685", "0.6159092", "0.61485004", "0.6141253", "0.6112031", "0.6111657", "0.61071694", "0.6102008", "0.6096905", "0.60882026", "0.6077422", "0.60636073", "0.6048812", "0.60018814", "0.5973088", "0.5963808", "0.59610003", "0.5960281", "0.59557515", "0.59557104", "0.5952099", "0.5946725", "0.5938489", "0.593659", "0.59252596", "0.59206647", "0.5909206", "0.5904704", "0.58935535", "0.58914566", "0.5890758", "0.58796513", "0.5864792", "0.58645445", "0.58624274", "0.5861929", "0.58607996", "0.5850032", "0.5838925", "0.5837511", "0.58126247", "0.58048666", "0.57934564", "0.57902086", "0.57902086", "0.57902086", "0.57902086", "0.57902086", "0.57902086", "0.57902086", "0.57902086", "0.57902086", "0.57902086", "0.57902086", "0.5787853", "0.57866514", "0.5785217", "0.57800335" ]
0.71786827
1
Retrieves a list of models based on the current search/filter conditions. Typical usecase: Initialize the model fields with values from filter form. Execute this method to get CActiveDataProvider instance which will filter models according to data in model fields. Pass data provider to CGridView, CListView or any similar widget.
public function search() { // @todo Please modify the following code to remove attributes that should not be searched. $criteria=new CDbCriteria; $criteria->compare('id_node_type',$this->id_node_type,true); $criteria->compare('translit',$this->translit,true); $criteria->compare('name',$this->name,true); $criteria->compare('description',$this->description,true); $criteria->compare('comments',$this->comments); $criteria->compare('adate',$this->adate,true); $criteria->compare('udate',$this->udate,true); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, 'pagination'=>array( 'pageSize'=>100, ), 'sort'=>array( 'defaultOrder'=>'id_node_type', ), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id);\n $criteria->compare('model_id',$this->model_id,true);\n $criteria->compare('color',$this->color,true);\n $criteria->compare('is_in_pare',$this->is_in_pare);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('idmodel',$this->idmodel);\n\t\t$criteria->compare('usuario_anterior',$this->usuario_anterior);\n\t\t$criteria->compare('usuario_nuevo',$this->usuario_nuevo);\n\t\t$criteria->compare('estado_anterior',$this->estado_anterior,true);\n\t\t$criteria->compare('estado_nuevo',$this->estado_nuevo,true);\n\t\t$criteria->compare('fecha',$this->fecha,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('generator_id',$this->generator_id,true);\n\t\t$criteria->compare('serial_number',$this->serial_number,true);\n\t\t$criteria->compare('model_number',$this->model_number,true);\n\t\t$criteria->compare('manufacturer_name',$this->manufacturer_name,true);\n\t\t$criteria->compare('manufacture_date',$this->manufacture_date,true);\n\t\t$criteria->compare('supplier_name',$this->supplier_name,true);\n\t\t$criteria->compare('date_of_purchase',$this->date_of_purchase,true);\n\t\t$criteria->compare('date_of_first_use',$this->date_of_first_use,true);\n\t\t$criteria->compare('kva_capacity',$this->kva_capacity);\n\t\t$criteria->compare('current_run_hours',$this->current_run_hours);\n\t\t$criteria->compare('last_serviced_date',$this->last_serviced_date,true);\n\t\t$criteria->compare('engine_make',$this->engine_make,true);\n\t\t$criteria->compare('engine_model',$this->engine_model,true);\n\t\t$criteria->compare('fuel_tank_capacity',$this->fuel_tank_capacity);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('sex',$this->sex);\n\t\t$criteria->compare('car',$this->car,true);\n\t\t$criteria->compare('source_id',$this->source_id,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('client_type_id',$this->client_type_id,true);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('link',$this->link,true);\n\t\t$criteria->compare('other',$this->other,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('UserID',$this->UserID);\n\t\t$criteria->compare('ProviderID',$this->ProviderID);\n\t\t$criteria->compare('Date',$this->Date,true);\n\t\t$criteria->compare('RawID',$this->RawID);\n\t\t$criteria->compare('Document',$this->Document,true);\n\t\t$criteria->compare('State',$this->State,true);\n\t\t$criteria->compare('Temperature',$this->Temperature,true);\n\t\t$criteria->compare('Conditions',$this->Conditions,true);\n\t\t$criteria->compare('Expiration',$this->Expiration,true);\n\t\t$criteria->compare('Comments',$this->Comments,true);\n\t\t$criteria->compare('Quantity',$this->Quantity,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n \t'pageSize'=>Yii::app()->params['defaultPageSize'], \n ),\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t// $criteria->compare('text',$this->text,true);\n\t\t// $criteria->compare('record',$this->record,true);\n\t\t$criteria->compare('user',$this->user,true);\n\t\t$criteria->compare('createdBy',$this->createdBy,true);\n\t\t$criteria->compare('viewed',$this->viewed);\n\t\t$criteria->compare('createDate',$this->createDate,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('comparison',$this->comparison,true);\n\t\t// $criteria->compare('value',$this->value,true);\n\t\t$criteria->compare('modelType',$this->modelType,true);\n\t\t$criteria->compare('modelId',$this->modelId,true);\n\t\t$criteria->compare('fieldName',$this->fieldName,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('Currency_ID',$this->Currency_ID);\n\t\t$criteria->compare('CurrencyNo',$this->CurrencyNo,true);\n\t\t$criteria->compare('ExchangeVND',$this->ExchangeVND,true);\n\t\t$criteria->compare('AppliedDate',$this->AppliedDate,true);\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('firm',$this->firm,true);\n\t\t$criteria->compare('change_date',$this->change_date,true);\n\t\t$criteria->compare('item_id',$this->item_id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('availability',$this->availability,true);\n\t\t$criteria->compare('price',$this->price,true);\n\t\t$criteria->compare('bonus',$this->bonus,true);\n\t\t$criteria->compare('shipping_cost',$this->shipping_cost,true);\n\t\t$criteria->compare('product_page',$this->product_page,true);\n\t\t$criteria->compare('sourse_page',$this->sourse_page,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('column_id',$this->column_id);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type',$this->type);\n\t\t$criteria->compare('condition',$this->condition,true);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('industry',$this->industry,true);\n\t\t$criteria->compare('industry_sub',$this->industry_sub,true);\n\t\t$criteria->compare('area',$this->area,true);\n\t\t$criteria->compare('province',$this->province,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('contact_name',$this->contact_name,true);\n\t\t$criteria->compare('contact_tel',$this->contact_tel,true);\n\t\t$criteria->compare('ip',$this->ip,true);\n\t\t$criteria->compare('source',$this->source,true);\n $criteria->compare('status',$this->status);\n\t\t$criteria->compare('update_time',$this->update_time);\n\t\t$criteria->compare('create_time',$this->create_time);\n\t\t$criteria->compare('notes',$this->notes);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('university',$this->university,true);\n\t\t$criteria->compare('major',$this->major,true);\n\t\t$criteria->compare('gpa',$this->gpa,true);\n\t\t$criteria->compare('appl_term',$this->appl_term);\n\t\t$criteria->compare('toefl',$this->toefl);\n\t\t$criteria->compare('gre',$this->gre);\n\t\t$criteria->compare('appl_major',$this->appl_major,true);\n\t\t$criteria->compare('appl_degree',$this->appl_degree,true);\n\t\t$criteria->compare('appl_country',$this->appl_country,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that should not be searched.\n\t\t$criteria = new \\CDbCriteria;\n\n\t\tforeach (array_keys($this->defineAttributes()) as $name)\n\t\t{\n\t\t\t$criteria->compare($name, $this->$name);\n\t\t}\n\n\t\treturn new \\CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('goods_code',$this->goods_code,true);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('brand_id',$this->brand_id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('kind',$this->kind,true);\n\t\t$criteria->compare('color',$this->color,true);\n\t\t$criteria->compare('size',$this->size,true);\n\t\t$criteria->compare('material',$this->material,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('purchase_price',$this->purchase_price,true);\n\t\t$criteria->compare('selling_price',$this->selling_price,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('meta_title',$this->meta_title,true);\n\t\t$criteria->compare('meta_keywords',$this->meta_keywords,true);\n\t\t$criteria->compare('meta_description',$this->meta_description,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ContractsDetailID',$this->ContractsDetailID,true);\n\t\t$criteria->compare('ContractID',$this->ContractID,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\t\t$criteria->compare('CustomerID',$this->CustomerID,true);\n\t\t$criteria->compare('Share',$this->Share);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria = $this->criteriaSearch();\r\n\t\t$criteria->limit = 10;\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria' => $criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('organizationName',$this->organizationName,true);\n\t\t$criteria->compare('contactNo',$this->contactNo,true);\n\t\t$criteria->compare('partnerType',$this->partnerType);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('area',$this->area,true);\n\t\t$criteria->compare('category',$this->category,true);\n\t\t$criteria->compare('emailId',$this->emailId,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('firstName',$this->firstName,true);\n\t\t$criteria->compare('lastName',$this->lastName,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_ID,$this->{Globals::FLD_NAME_ACTIVITY_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_TASK_ID,$this->{Globals::FLD_NAME_TASK_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_BY_USER_ID,$this->{Globals::FLD_NAME_BY_USER_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_TYPE,$this->{Globals::FLD_NAME_ACTIVITY_TYPE},true);\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_SUBTYPE,$this->{Globals::FLD_NAME_ACTIVITY_SUBTYPE},true);\n\t\t$criteria->compare(Globals::FLD_NAME_COMMENTS,$this->{Globals::FLD_NAME_COMMENTS},true);\n\t\t$criteria->compare(Globals::FLD_NAME_CREATED_AT,$this->{Globals::FLD_NAME_CREATED_AT},true);\n\t\t$criteria->compare(Globals::FLD_NAME_SOURCE_APP,$this->{Globals::FLD_NAME_SOURCE_APP},true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('manufacturers_image',$this->manufacturers_image,true);\n\t\t$criteria->compare('date_added',$this->date_added);\n\t\t$criteria->compare('last_modified',$this->last_modified);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_clicked',$this->url_clicked);\n\t\t$criteria->compare('date_last_click',$this->date_last_click);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('date',$this->date);\n\t\t$criteria->compare('del',$this->del);\n\t\t$criteria->compare('action_id',$this->action_id);\n\t\t$criteria->compare('item_id',$this->item_id);\n\t\t$criteria->compare('catalog',$this->catalog,true);\n\t\t$criteria->compare('is_new',$this->is_new);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('case',$this->case);\n\t\t$criteria->compare('basis_doc',$this->basis_doc);\n\t\t$criteria->compare('calc_group',$this->calc_group);\n\t\t$criteria->compare('time',$this->time,true);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('data_attributes_fields',$this->data_attributes_fields,true);\n\t\t$criteria->compare('is_active',$this->is_active);\n\t\t$criteria->compare('created',$this->created,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('competition',$this->competition);\n\t\t$criteria->compare('partner',$this->partner);\n\t\t$criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('website',$this->website,true);\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('skill_id',$this->skill_id);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('account_id',$this->account_id);\n\t\t$criteria->compare('field_name',$this->field_name);\n\t\t$criteria->compare('content',$this->content);\n\t\t$criteria->compare('old_data',$this->old_data,true);\n\t\t$criteria->compare('new_data',$this->new_data,true);\n\t\t$criteria->compare('status',$this->status);\n\t\t$criteria->compare('type',$this->type);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_updated',$this->date_updated,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('company_id',$this->company_id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('validator',$this->validator,true);\n\t\t$criteria->compare('position',$this->position);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n $criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('display_name',$this->display_name,true);\n $criteria->compare('actionPrice',$this->actionPrice);\n\t\t$criteria->compare('translit',$this->translit,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('display_description',$this->display_description,true);\n\t\t$criteria->compare('meta_keywords',$this->meta_keywords,true);\n\t\t$criteria->compare('meta_description',$this->meta_description,true);\n\t\t$criteria->compare('editing',$this->editing);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'pagination' => array(\n 'pageSize' => 15,\n ),\n\t\t));\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('BrandID', $this->BrandID);\n $criteria->compare('BrandName', $this->BrandName, true);\n $criteria->compare('Pinyin', $this->Pinyin, true);\n $criteria->compare('Remarks', $this->Remarks, true);\n $criteria->compare('OrganID', $this->OrganID);\n $criteria->compare('UserID', $this->UserID);\n $criteria->compare('CreateTime', $this->CreateTime);\n $criteria->compare('UpdateTime', $this->UpdateTime);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('code', $this->code, true);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('printable_name', $this->printable_name, true);\n\t\t$criteria->compare('iso3', $this->iso3, true);\n\t\t$criteria->compare('numcode', $this->numcode);\n\t\t$criteria->compare('is_default', $this->is_default);\n\t\t$criteria->compare('is_highlight', $this->is_highlight);\n\t\t$criteria->compare('is_active', $this->is_active);\n\t\t$criteria->compare('date_added', $this->date_added);\n\t\t$criteria->compare('date_modified', $this->date_modified);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('componente_id',$this->componente_id);\n\t\t$criteria->compare('tipo_dato',$this->tipo_dato,true);\n\t\t$criteria->compare('descripcion',$this->descripcion,true);\n\t\t$criteria->compare('cruce_automatico',$this->cruce_automatico,true);\n\t\t$criteria->compare('sw_obligatorio',$this->sw_obligatorio,true);\n\t\t$criteria->compare('orden',$this->orden);\n\t\t$criteria->compare('sw_puntaje',$this->sw_puntaje,true);\n\t\t$criteria->compare('sw_estado',$this->sw_estado,true);\n\t\t$criteria->compare('todos_obligatorios',$this->todos_obligatorios,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('real_name',$this->real_name,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('zip_code',$this->zip_code,true);\n\t\t$criteria->compare('province_id',$this->province_id);\n\t\t$criteria->compare('city_id',$this->city_id);\n\t\t$criteria->compare('district_id',$this->district_id);\n\t\t$criteria->compare('district_address',$this->district_address,true);\n\t\t$criteria->compare('street_address',$this->street_address,true);\n\t\t$criteria->compare('is_default',$this->is_default);\n\t\t$criteria->compare('create_time',$this->create_time);\n\t\t$criteria->compare('update_time',$this->update_time);\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('EMCE_ID',$this->EMCE_ID);\n\t\t$criteria->compare('MOOR_ID',$this->MOOR_ID);\n\t\t$criteria->compare('EVCR_ID',$this->EVCR_ID);\n\t\t$criteria->compare('EVES_ID',$this->EVES_ID);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('customerName',$this->customerName,true);\n\t\t$criteria->compare('agencyHead',$this->agencyHead,true);\n\t\t$criteria->compare('region_id',$this->region_id);\n\t\t$criteria->compare('province_id',$this->province_id);\n\t\t$criteria->compare('municipalityCity_id',$this->municipalityCity_id);\n\t\t$criteria->compare('barangay_id',$this->barangay_id);\n\t\t$criteria->compare('houseNumber',$this->houseNumber,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('fax',$this->fax,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('nature_id',$this->nature_id);\n\t\t$criteria->compare('industry_id',$this->industry_id);\n\t\t$criteria->compare('created_by',$this->created_by);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('update_time',$this->update_time,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->name,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('state',$this->address,true);\n\t\t$criteria->compare('country',$this->address,true);\n\t\t$criteria->compare('contact_number',$this->contact_number,true);\n\t\t$criteria->compare('created_by',$this->created_by,true);\n\t\t$criteria->compare('is_deleted',$this->is_deleted);\n\t\t$criteria->compare('deleted_by',$this->deleted_by,true);\n\t\t$criteria->compare('created_at',$this->created_at,true);\n\t\t$criteria->compare('updated_at',$this->updated_at,true);\n\t\tif(YII::app()->user->getState(\"role\") == \"admin\") {\n\t\t\t$criteria->condition = 'is_deleted = 0';\n\t\t}\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('industry_id',$this->industry_id);\n\t\t$criteria->compare('professional_status_id',$this->professional_status);\n\t\t$criteria->compare('birthday',$this->birthday);\n\t\t$criteria->compare('location',$this->location);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('memo',$this->memo,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\r\n\t{\r\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\r\n\r\r\n\t\t$criteria=new CDbCriteria;\r\r\n\r\r\n\t\t$criteria->compare('id',$this->id);\r\r\n\t\t$criteria->compare('user_id',$this->user_id);\r\r\n\t\t$criteria->compare('adds',$this->adds);\r\r\n\t\t$criteria->compare('edits',$this->edits);\r\r\n\t\t$criteria->compare('deletes',$this->deletes);\r\r\n\t\t$criteria->compare('view',$this->view);\r\r\n\t\t$criteria->compare('lists',$this->lists);\r\r\n\t\t$criteria->compare('searches',$this->searches);\r\r\n\t\t$criteria->compare('prints',$this->prints);\r\r\n\r\r\n\t\treturn new CActiveDataProvider($this, array(\r\r\n\t\t\t'criteria'=>$criteria,\r\r\n\t\t));\r\r\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('applyId',$this->applyId);\n\t\t$criteria->compare('stuId',$this->stuId);\n\t\t$criteria->compare('stuName',$this->stuName,true);\n\t\t$criteria->compare('specification',$this->specification,true);\n\t\t$criteria->compare('assetName',$this->assetName,true);\n\t\t$criteria->compare('applyTime',$this->applyTime,true);\n\t\t$criteria->compare('loanTime',$this->loanTime,true);\n\t\t$criteria->compare('returnTime',$this->returnTime,true);\n\t\t$criteria->compare('RFID',$this->RFID,true);\n\t\t$criteria->compare('stuTelNum',$this->stuTelNum,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=$this->getBaseCDbCriteria();\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('itemcode', $this->itemcode, true);\n $criteria->compare('product_id', $this->product_id, true);\n $criteria->compare('delete_flag', $this->delete_flag);\n $criteria->compare('status', $this->status);\n $criteria->compare('expire', $this->expire, true);\n $criteria->compare('date_input', $this->date_input, true);\n $criteria->compare('d_update', $this->d_update, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('verid',$this->verid);\n\t\t$criteria->compare('appversion',$this->appversion,true);\n\t\t$criteria->compare('appfeatures',$this->appfeatures,true);\n\t\t$criteria->compare('createtime',$this->createtime,true);\n\t\t$criteria->compare('baseNum',$this->baseNum);\n\t\t$criteria->compare('slave1Num',$this->slave1Num);\n\t\t$criteria->compare('packagename',$this->packagename,true);\n\t\t$criteria->compare('ostype',$this->ostype);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('client_id',$this->client_id,true);\n\t\t$criteria->compare('extension',$this->extension,true);\n\t\t$criteria->compare('rel_type',$this->rel_type,true);\n\t\t$criteria->compare('rel_id',$this->rel_id,true);\n\t\t$criteria->compare('meta_key',$this->meta_key,true);\n\t\t$criteria->compare('meta_value',$this->meta_value,true);\n\t\t$criteria->compare('date_entry',$this->date_entry,true);\n\t\t$criteria->compare('date_update',$this->date_update,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('column_id',$this->column_id,true);\n\t\t$criteria->compare('research_title',$this->research_title,true);\n\t\t$criteria->compare('research_url',$this->research_url,true);\n\t\t$criteria->compare('column_type',$this->column_type);\n\t\t$criteria->compare('filiale_id',$this->filiale_id,true);\n\t\t$criteria->compare('area_name',$this->area_name,true);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('trigger_config',$this->trigger_config);\n\t\t$criteria->compare('status',$this->status);\n $criteria->compare('terminal_type',$this->terminal_type);\n\t\t$criteria->compare('start_time',$this->start_time,true);\n\t\t$criteria->compare('end_time',$this->end_time,true);\n\t\t$criteria->compare('explain',$this->explain,true);\n\t\t$criteria->compare('_delete',$this->_delete);\n\t\t$criteria->compare('_create_time',$this->_create_time,true);\n\t\t$criteria->compare('_update_time',$this->_update_time,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function backendSearch()\n {\n $criteria = new CDbCriteria();\n\n return new CActiveDataProvider(\n __CLASS__,\n array(\n 'criteria' => $criteria,\n )\n );\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('birthday',$this->birthday,true);\n\t\t$criteria->compare('sex',$this->sex);\n\t\t$criteria->compare('photo',$this->photo,true);\n\t\t$criteria->compare('is_get_news',$this->is_get_news);\n\t\t$criteria->compare('user_id',$this->user_id);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('tbl_customer_supplier', $this->tbl_customer_supplier, true);\n $criteria->compare('id_customer', $this->id_customer, true);\n $criteria->compare('id_supplier', $this->id_supplier, true);\n $criteria->compare('title', $this->title, true);\n $criteria->compare('date_add', $this->date_add, true);\n $criteria->compare('date_upd', $this->date_upd, true);\n $criteria->compare('active', $this->active);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('order_id',$this->order_id);\n\t\t$criteria->compare('device_id',$this->device_id,true);\n\t\t$criteria->compare('money',$this->money,true);\n\t\t$criteria->compare('status',$this->status);\n\t\t$criteria->compare('add_time',$this->add_time);\n\t\t$criteria->compare('recharge_type',$this->recharge_type);\n\t\t$criteria->compare('channel',$this->channel,true);\n\t\t$criteria->compare('version_name',$this->version_name,true);\n\t\t$criteria->compare('pay_channel',$this->pay_channel);\n\t\t$criteria->compare('chanel_bid',$this->chanel_bid);\n\t\t$criteria->compare('chanel_sid',$this->chanel_sid);\n\t\t$criteria->compare('versionid',$this->versionid);\n\t\t$criteria->compare('chanel_web',$this->chanel_web);\n\t\t$criteria->compare('dem_num',$this->dem_num);\n\t\t$criteria->compare('last_watching',$this->last_watching,true);\n\t\t$criteria->compare('pay_type',$this->pay_type);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n {\r\n // @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n $criteria = new CDbCriteria;\r\n\r\n $criteria->compare('id', $this->id);\r\n $criteria->compare('country_id', $this->country_id);\r\n $criteria->compare('user_id', $this->user_id);\r\n $criteria->compare('vat', $this->vat);\r\n $criteria->compare('manager_coef', $this->manager_coef);\r\n $criteria->compare('curator_coef', $this->curator_coef);\r\n $criteria->compare('admin_coef', $this->admin_coef);\r\n $criteria->compare('status', $this->status);\r\n\r\n return new CActiveDataProvider($this, array(\r\n 'criteria' => $criteria,\r\n ));\r\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('fname',$this->fname,true);\n\t\t$criteria->compare('mname',$this->mname,true);\n\t\t$criteria->compare('lname',$this->lname,true);\n\t\t$criteria->compare('photo',$this->photo,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\t\t$criteria->compare('date_of_birth',$this->date_of_birth,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('landline',$this->landline,true);\n\t\t$criteria->compare('em_contact_name',$this->em_contact_name,true);\n\t\t$criteria->compare('em_contact_relation',$this->em_contact_relation,true);\n\t\t$criteria->compare('em_contact_number',$this->em_contact_number,true);\n\t\t$criteria->compare('created_by',$this->created_by,true);\n\t\t$criteria->compare('created_date',$this->created_date,true);\n\n return new CActiveDataProvider( $this, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => Yii::app()->user->getState( 'pageSize', Yii::app()->params[ 'defaultPageSize' ] ),\n ),\n ) );\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('code',$this->code,true);\n\t\t$criteria->compare('purchase_price',$this->purchase_price);\n\t\t$criteria->compare('sell_price',$this->sell_price);\n\t\t$criteria->compare('amount',$this->amount);\n\t\t$criteria->compare('measurement',$this->measurement,true);\n\t\t$criteria->compare('date_create',$this->date_create,true);\n\t\t$criteria->compare('date_update',$this->date_update,true);\n\t\t$criteria->compare('date_out',$this->date_out,true);\n\t\t$criteria->compare('date_in',$this->date_in,true);\n\t\t$criteria->compare('firma_id',$this->firma_id,true);\n\t\t$criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('instock',$this->instock);\n\t\t$criteria->compare('user_id',$this->user_id);\n $criteria->compare('warning_amount',$this->warning_amount);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t\n\t\t$criteria=new CDbCriteria;\n\t\t\n\t\t$criteria->compare('COMPETITOR_ID',$this->COMPETITOR_ID);\n\t\t$criteria->compare('WSDC_NO',$this->WSDC_NO);\n\t\t$criteria->compare('FIRST_NAME',$this->FIRST_NAME,true);\n\t\t$criteria->compare('LAST_NAME',$this->LAST_NAME,true);\n\t\t$criteria->compare('COMPETITOR_LEVEL',$this->COMPETITOR_LEVEL);\n\t\t$criteria->compare('REMOVED',$this->REMOVED);\n\t\t$criteria->compare('ADDRESS',$this->ADDRESS,true);\n\t\t$criteria->compare('CITY',$this->CITY,true);\n\t\t$criteria->compare('STATE',$this->STATE,true);\n\t\t$criteria->compare('POSTCODE',$this->POSTCODE);\n\t\t$criteria->compare('COUNTRY',$this->COUNTRY,true);\n\t\t$criteria->compare('PHONE',$this->PHONE,true);\n\t\t$criteria->compare('MOBILE',$this->MOBILE,true);\n\t\t$criteria->compare('EMAIL',$this->EMAIL,true);\n\t\t$criteria->compare('LEADER',$this->LEADER);\n\t\t$criteria->compare('REGISTERED',$this->REGISTERED);\n\t\t$criteria->compare('BIB_STATUS',$this->BIB_STATUS);\n\t\t$criteria->compare('BIB_NUMBER',$this->BIB_NUMBER);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('sys_name',$this->sys_name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('CustomerId',$this->CustomerId,true);\n\t\t$criteria->compare('AddressId',$this->AddressId,true);\n\t\t$criteria->compare('CustomerStatusId',$this->CustomerStatusId,true);\n\t\t$criteria->compare('DateMasterId',$this->DateMasterId,true);\n\t\t$criteria->compare('FirstName',$this->FirstName,true);\n\t\t$criteria->compare('LastName',$this->LastName,true);\n\t\t$criteria->compare('CustomerPhoto',$this->CustomerPhoto,true);\n\t\t$criteria->compare('CustomerCode',$this->CustomerCode);\n\t\t$criteria->compare('Telephone',$this->Telephone,true);\n\t\t$criteria->compare('Mobile',$this->Mobile,true);\n\t\t$criteria->compare('EmailId',$this->EmailId,true);\n\t\t$criteria->compare('Status',$this->Status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('city_id',$this->city_id);\n\t\t$criteria->compare('locality',$this->locality,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$parameters = array('limit'=>ceil(Profile::getResultsPerPage()));\n\t\t$criteria->scopes = array('findAll'=>array($parameters));\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('itemId',$this->itemId);\n\t\t$criteria->compare('changedBy',$this->changedBy,true);\n\t\t$criteria->compare('recordName',$this->recordName,true);\n\t\t$criteria->compare('fieldName',$this->fieldName,true);\n\t\t$criteria->compare('oldValue',$this->oldValue,true);\n\t\t$criteria->compare('newValue',$this->newValue,true);\n\t\t$criteria->compare('diff',$this->diff,true);\n\t\t$criteria->compare('timestamp',$this->timestamp);\n\n\t\treturn new SmartActiveDataProvider(get_class($this), array(\n\t\t\t'sort'=>array(\n\t\t\t\t'defaultOrder'=>'timestamp DESC',\n\t\t\t),\n\t\t\t'pagination'=>array(\n\t\t\t\t'pageSize'=>Profile::getResultsPerPage(),\n\t\t\t),\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('company_id', $this->company_id);\n\t\t$criteria->compare('productId', $this->productId);\n\t\t$criteria->compare('upTo', $this->upTo);\n\t\t$criteria->compare('fixPrice', $this->fixPrice);\n\t\t$criteria->compare('isActive', $this->isActive);\n\t\t$criteria->order = 'company_id';\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('id',$this->id);\r\n\t\t$criteria->compare('user_id',$this->user_id);\r\n\t\t$criteria->compare('mem_type',$this->mem_type);\r\n\t\t$criteria->compare('business_type',$this->business_type);\r\n\t\t$criteria->compare('product_name',$this->product_name,true);\r\n\t\t$criteria->compare('panit',$this->panit,true);\r\n\t\t$criteria->compare('sex',$this->sex);\r\n\t\t$criteria->compare('tname',$this->tname);\r\n\t\t$criteria->compare('ftname',$this->ftname,true);\r\n\t\t$criteria->compare('ltname',$this->ltname,true);\r\n\t\t$criteria->compare('etname',$this->etname);\r\n\t\t$criteria->compare('fename',$this->fename,true);\r\n\t\t$criteria->compare('lename',$this->lename,true);\r\n\t\t$criteria->compare('birth',$this->birth,true);\r\n\t\t$criteria->compare('email',$this->email,true);\r\n\t\t$criteria->compare('facebook',$this->facebook,true);\r\n\t\t$criteria->compare('twitter',$this->twitter,true);\r\n\t\t$criteria->compare('address',$this->address,true);\r\n\t\t$criteria->compare('province',$this->province);\r\n\t\t$criteria->compare('prefecture',$this->prefecture);\r\n\t\t$criteria->compare('district',$this->district);\r\n\t\t$criteria->compare('postcode',$this->postcode,true);\r\n\t\t$criteria->compare('tel',$this->tel,true);\r\n\t\t$criteria->compare('mobile',$this->mobile,true);\r\n\t\t$criteria->compare('fax',$this->fax,true);\r\n\t\t$criteria->compare('high_education',$this->high_education);\r\n\t\t$criteria->compare('career',$this->career);\r\n\t\t$criteria->compare('skill_com',$this->skill_com);\r\n\t\t$criteria->compare('receive_news',$this->receive_news,true);\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('item_id',$this->item_id);\n\t\t$criteria->compare('table_id',$this->table_id);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('cou_id',$this->cou_id);\n\t\t$criteria->compare('thm_id',$this->thm_id);\n\t\t$criteria->compare('cou_nom',$this->cou_nom,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=$this->getBaseCDbCriteria();\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n// $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n// $criteria->compare('alias', $this->alias, true);\n// $criteria->compare('module', $this->module, true);\n $criteria->compare('crud', $this->crud, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('idempleo',$this->idempleo);\n\t\t$criteria->compare('administrativo',$this->administrativo,true);\n\t\t$criteria->compare('comercial',$this->comercial,true);\n\t\t$criteria->compare('artes',$this->artes,true);\n\t\t$criteria->compare('informatica',$this->informatica,true);\n\t\t$criteria->compare('salud',$this->salud,true);\n\t\t$criteria->compare('marketing',$this->marketing,true);\n\t\t$criteria->compare('servicio_domestico',$this->servicio_domestico,true);\n\t\t$criteria->compare('construccion',$this->construccion,true);\n\t\t$criteria->compare('agricultura',$this->agricultura,true);\n\t\t$criteria->compare('ganaderia',$this->ganaderia,true);\n\t\t$criteria->compare('telecomunicaciones',$this->telecomunicaciones,true);\n\t\t$criteria->compare('atencion_cliente',$this->atencion_cliente,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID_VALOR',$this->ID_VALOR);\n\t\t$criteria->compare('ID_UBICACION',$this->ID_UBICACION);\n\t\t$criteria->compare('ID_VISITA',$this->ID_VISITA);\n\t\t$criteria->compare('VALOR',$this->VALOR);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t\n\t\t$criteria->compare('id_aspecto',$this->id_aspecto,true);\n\t\t$criteria->compare('tbl_Programa_id_programa',$this->tbl_Programa_id_programa,true);\n\t\t$criteria->compare('tbl_Factor_id_factor',$this->tbl_Factor_id_factor);\n\t\t$criteria->compare('tbl_caracteristica_id_caracteristica',$this->tbl_caracteristica_id_caracteristica,true);\n\t\t$criteria->compare('num_aspecto',$this->num_aspecto,true);\n\t\t$criteria->compare('aspecto',$this->aspecto,true);\n\t\t$criteria->compare('instrumento',$this->instrumento,true);\n\t\t$criteria->compare('fuente',$this->fuente,true);\n\t\t$criteria->compare('documento',$this->documento,true);\n\t\t$criteria->compare('link',$this->link,true);\n\t\t$criteria->compare('Observaciones',$this->Observaciones,true);\n\t\t$criteria->compare('cumple',$this->cumple,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('sex',$this->sex,true);\n\t\t$criteria->compare('website_url',$this->website_url,true);\n\t\t$criteria->compare('summary',$this->summary,true);\n\t\t$criteria->compare('user_name',$this->user_name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('created_datetime',$this->created_datetime,true);\n\t\t$criteria->compare('icon_src',$this->icon_src,true);\n\t\t$criteria->compare('show_r18',$this->show_r18);\n\t\t$criteria->compare('show_bl',$this->show_bl);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('creationDate',$this->creationDate,true);\n\t\t$criteria->compare('year',$this->year);\n\t\t$criteria->compare('term',$this->term,true);\n\t\t$criteria->compare('activated',$this->activated);\n\t\t$criteria->compare('startingDate',$this->startingDate,true);\n\t\t$criteria->compare('activation_userId',$this->activation_userId);\n\t\t$criteria->compare('parent_catalogId',$this->parent_catalogId);\n $criteria->compare('isProspective', $this->isProspective);\n $criteria->compare('creatorId', $this->creatorId);\n $criteria->compare('isProposed', $this->isProposed);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('FirstName',$this->FirstName,true);\n\t\t$criteria->compare('LastName',$this->LastName,true);\n\t\t$criteria->compare('location',$this->location);\n\t\t$criteria->compare('theripiest',$this->theripiest);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\t\t$criteria->compare('dob',$this->dob,true);\n\t\t$criteria->compare('inurancecompany',$this->inurancecompany,true);\n\t\t$criteria->compare('injurydate',$this->injurydate,true);\n\t\t$criteria->compare('therapy_start_date',$this->therapy_start_date,true);\n\t\t$criteria->compare('ASIA',$this->ASIA,true);\n\t\t$criteria->compare('injury',$this->injury,true);\n\t\t$criteria->compare('medication',$this->medication,true);\n\t\t$criteria->compare('notes',$this->notes,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('imputetype_id',$this->imputetype_id);\n\t\t$criteria->compare('project_id',$this->project_id);\n\n\t\treturn new ActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search () {\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('formId', $this->formId, true);\n\t\t$criteria->compare('data', $this->data, true);\n\t\t$criteria->compare('ctime', $this->ctime);\n\t\t$criteria->compare('mtime', $this->mtime);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t 'criteria' => $criteria,\n\t\t ));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('category_id',$this->category_id);\n\t\t$criteria->compare('amount',$this->amount);\n\t\t$criteria->compare('price_z',$this->price_z);\n\t\t$criteria->compare('price_s',$this->price_s);\n\t\t$criteria->compare('price_m',$this->price_m);\n\t\t$criteria->compare('dependence',$this->dependence,true);\n\t\t$criteria->compare('barcode',$this->barcode,true);\n\t\t$criteria->compare('unit',$this->unit,true);\n\t\t$criteria->compare('minimal_amount',$this->minimal_amount);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'pagination' => array('pageSize' => 100),\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('image',$this->image,true);\n\t\t$criteria->compare('manager',$this->manager);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('realname',$this->realname,true);\n\t\t$criteria->compare('identity',$this->identity,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('bussiness_license',$this->bussiness_license,true);\n\t\t$criteria->compare('bankcode',$this->bankcode,true);\n\t\t$criteria->compare('banktype',$this->banktype,true);\n\t\t$criteria->compare('is_open',$this->is_open,true);\n\t\t$criteria->compare('introduction',$this->introduction,true);\n\t\t$criteria->compare('images_str',$this->images_str,true);\n\t\t$criteria->compare('gmt_created',$this->gmt_created,true);\n\t\t$criteria->compare('gmt_modified',$this->gmt_modified,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('id_user',$this->id_user);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('email_admin',$this->email_admin,true);\n\t\t$criteria->compare('password_api',$this->password_api,true);\n\t\t$criteria->compare('url_result_api',$this->url_result_api,true);\n\t\t$criteria->compare('id_currency_2',$this->id_currency_2);\n\t\t$criteria->compare('id_currency_1',$this->id_currency_1,true);\n\t\t$criteria->compare('is_test_mode',$this->is_test_mode);\n\t\t$criteria->compare('is_commission_shop',$this->is_commission_shop);\n\t\t$criteria->compare('commission',$this->commission);\n\t\t$criteria->compare('is_enable',$this->is_enable);\n\t\t$criteria->compare('is_active',$this->is_active);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('mod_date',$this->mod_date,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID,true);\n\t\t$criteria->compare('userID',$this->userID,true);\n\t\t$criteria->compare('mtID',$this->mtID,true);\n\t\t$criteria->compare('fxType',$this->fxType);\n\t\t$criteria->compare('leverage',$this->leverage);\n\t\t$criteria->compare('amount',$this->amount,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t/*\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('percent_discount',$this->percent_discount,true);\n\t\t$criteria->compare('taxable',$this->taxable);\n\t\t$criteria->compare('id_user_created',$this->id_user_created);\n\t\t$criteria->compare('id_user_modified',$this->id_user_modified);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_modified',$this->date_modified,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t*/\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('surname',$this->surname,true);\n\t\t$criteria->compare('comany_name',$this->comany_name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('uuid',$this->uuid,true);\n\t\t$criteria->compare('is_admin',$this->is_admin);\n\t\t$criteria->compare('paid_period_start',$this->paid_period_start,true);\n\t\t$criteria->compare('ftp_pass',$this->ftp_pass,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('price',$this->price,true);\n\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('breed',$this->breed,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('date_birthday',$this->date_birthday,true);\n\t\t$criteria->compare('sex',$this->sex,true);\n\t\t$criteria->compare('color',$this->color,true);\n\t\t$criteria->compare('tattoo',$this->tattoo,true);\n\t\t$criteria->compare('sire',$this->sire,true);\n\t\t$criteria->compare('dame',$this->dame,true);\n\t\t$criteria->compare('owner_type',$this->owner_type,true);\n\t\t$criteria->compare('honors',$this->honors,true);\n\t\t$criteria->compare('photo_preview',$this->photo_preview,true);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('pet_status',$this->pet_status,true);\n\t\t$criteria->compare('about',$this->about,true);\n\t\t$criteria->compare('uid',$this->uid);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('veterinary',$this->veterinary,true);\n\t\t$criteria->compare('vaccinations',$this->vaccinations,true);\n\t\t$criteria->compare('show_class',$this->show_class,true);\n\t\t$criteria->compare('certificate',$this->certificate,true);\n $criteria->compare('neutered_spayed',$this->certificate,true);\n \n\n $criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('city',$this->city,true);\n\n \n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('HISTORY',$this->HISTORY,true);\n\t\t$criteria->compare('WELCOME_MESSAGE',$this->WELCOME_MESSAGE,true);\n\t\t$criteria->compare('LOCATION',$this->LOCATION,true);\n\t\t$criteria->compare('PHONES',$this->PHONES,true);\n\t\t$criteria->compare('FAX',$this->FAX,true);\n\t\t$criteria->compare('EMAIL',$this->EMAIL,true);\n\t\t$criteria->compare('MISSION',$this->MISSION,true);\n\t\t$criteria->compare('VISION',$this->VISION,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('company_id', Yii::app()->user->company_id);\n $criteria->compare('zone_id', $this->zone_id, true);\n $criteria->compare('low_qty_threshold', $this->low_qty_threshold);\n $criteria->compare('high_qty_threshold', $this->high_qty_threshold);\n $criteria->compare('created_date', $this->created_date, true);\n $criteria->compare('created_by', $this->created_by, true);\n $criteria->compare('updated_date', $this->updated_date, true);\n $criteria->compare('updated_by', $this->updated_by, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('orgName',$this->orgName,true);\n\t\t$criteria->compare('noEmp',$this->noEmp);\n\t\t$criteria->compare('phone',$this->phone);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('addr1',$this->addr1,true);\n\t\t$criteria->compare('addr2',$this->addr2,true);\n\t\t$criteria->compare('state',$this->state,true);\n\t\t$criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('orgType',$this->orgType,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('fax',$this->fax);\n\t\t$criteria->compare('orgId',$this->orgId,true);\n\t\t$criteria->compare('validity',$this->validity);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('category',$this->category,true);\n\t\t$criteria->compare('sortorder',$this->sortorder,true);\n\t\t$criteria->compare('fullname',$this->fullname,true);\n\t\t$criteria->compare('shortname',$this->shortname,true);\n\t\t$criteria->compare('idnumber',$this->idnumber,true);\n\t\t$criteria->compare('summary',$this->summary,true);\n\t\t$criteria->compare('summaryformat',$this->summaryformat);\n\t\t$criteria->compare('format',$this->format,true);\n\t\t$criteria->compare('showgrades',$this->showgrades);\n\t\t$criteria->compare('sectioncache',$this->sectioncache,true);\n\t\t$criteria->compare('modinfo',$this->modinfo,true);\n\t\t$criteria->compare('newsitems',$this->newsitems);\n\t\t$criteria->compare('startdate',$this->startdate,true);\n\t\t$criteria->compare('marker',$this->marker,true);\n\t\t$criteria->compare('maxbytes',$this->maxbytes,true);\n\t\t$criteria->compare('legacyfiles',$this->legacyfiles);\n\t\t$criteria->compare('showreports',$this->showreports);\n\t\t$criteria->compare('visible',$this->visible);\n\t\t$criteria->compare('visibleold',$this->visibleold);\n\t\t$criteria->compare('groupmode',$this->groupmode);\n\t\t$criteria->compare('groupmodeforce',$this->groupmodeforce);\n\t\t$criteria->compare('defaultgroupingid',$this->defaultgroupingid,true);\n\t\t$criteria->compare('lang',$this->lang,true);\n\t\t$criteria->compare('theme',$this->theme,true);\n\t\t$criteria->compare('timecreated',$this->timecreated,true);\n\t\t$criteria->compare('timemodified',$this->timemodified,true);\n\t\t$criteria->compare('requested',$this->requested);\n\t\t$criteria->compare('enablecompletion',$this->enablecompletion);\n\t\t$criteria->compare('completionnotify',$this->completionnotify);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('zipcode',$this->zipcode,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('role',$this->role,true);\n\t\t$criteria->compare('active',$this->active);\n\t\t$criteria->compare('camaras',$this->camaras);\n\t\t$criteria->compare('freidoras',$this->freidoras);\n\t\t$criteria->compare('cebos',$this->cebos);\n\t\t$criteria->compare('trampas',$this->trampas);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('attribute',$this->attribute,true);\n\t\t$criteria->compare('displayName',$this->displayName,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('value_type',$this->value_type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('cod_venda',$this->cod_venda,true);\n\t\t$criteria->compare('filial_cod_filial',$this->filial_cod_filial,true);\n\t\t$criteria->compare('funcionario_cod_funcionario',$this->funcionario_cod_funcionario,true);\n\t\t$criteria->compare('cliente_cod_cliente',$this->cliente_cod_cliente,true);\n\t\t$criteria->compare('data_2',$this->data_2,true);\n\t\t$criteria->compare('valor_total',$this->valor_total);\n\t\t$criteria->compare('forma_pagamento',$this->forma_pagamento,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('state', $this->state);\n $criteria->compare('type','0');\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('sex', $this->sex);\n $criteria->compare('mobile', $this->mobile, true);\n $criteria->compare('idcard', $this->idcard, true);\n $criteria->compare('password', $this->password, true);\n $criteria->compare('place_ids', $this->place_ids, true);\n $criteria->compare('depart_id', $this->depart_id);\n $criteria->compare('bank', $this->bank, true);\n $criteria->compare('bank_card', $this->bank_card, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('education', $this->education, true);\n $criteria->compare('created', $this->created);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->buscar,'OR');\n\t\t$criteria->compare('fecha',$this->buscar,true,'OR');\n\t\t$criteria->compare('fechaUpdate',$this->buscar,true,'OR');\n\t\t$criteria->compare('idProfesional',$this->buscar,'OR');\n\t\t$criteria->compare('importe',$this->buscar,'OR');\n\t\t$criteria->compare('idObraSocial',$this->buscar,'OR');\n\t\t$criteria->compare('estado',$this->buscar,true,'OR');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('codop',$this->codop,true);\n\t\t$criteria->compare('codcatval',$this->codcatval,true);\n\t\t$criteria->compare('cuentadebe',$this->cuentadebe,true);\n\t\t$criteria->compare('cuentahaber',$this->cuentahaber,true);\n\t\t$criteria->compare('desop',$this->desop,true);\n\t\t$criteria->compare('descat',$this->descat,true);\n\t\t$criteria->compare('debe',$this->debe,true);\n\t\t$criteria->compare('haber',$this->haber,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array('pagesize'=>100),\n\t\t));\n\t}" ]
[ "0.7212874", "0.7136809", "0.7094321", "0.70936954", "0.6985914", "0.69613945", "0.6948008", "0.694271", "0.6934379", "0.69245327", "0.69107914", "0.69031674", "0.6899002", "0.6898315", "0.6892818", "0.6882706", "0.6880382", "0.68744856", "0.68505204", "0.6849779", "0.68372285", "0.6826622", "0.6815651", "0.68068975", "0.68040293", "0.6798117", "0.67966306", "0.6796176", "0.67959374", "0.67945284", "0.6791063", "0.6785676", "0.67853564", "0.67842", "0.67815816", "0.67810893", "0.6779331", "0.67779416", "0.67775124", "0.67767435", "0.6775741", "0.6775741", "0.6775741", "0.6775741", "0.6775741", "0.6775741", "0.6775741", "0.6775741", "0.67737114", "0.6769196", "0.6767252", "0.6766567", "0.67626524", "0.6762648", "0.6761567", "0.6760193", "0.6759846", "0.6759452", "0.6753733", "0.67532396", "0.67521536", "0.67480385", "0.6747781", "0.6746191", "0.6746126", "0.6745607", "0.67447597", "0.67447513", "0.67446786", "0.674385", "0.6742896", "0.67420584", "0.6740848", "0.67398083", "0.6737021", "0.6736684", "0.67343587", "0.6732267", "0.67314774", "0.67252463", "0.67232674", "0.6723096", "0.67223144", "0.6713136", "0.6712838", "0.67112136", "0.6709133", "0.670655", "0.670589", "0.6705604", "0.67039806", "0.6702649", "0.6701081", "0.66982555", "0.66967833", "0.6695559", "0.669506", "0.6694146", "0.6693512", "0.6693467", "0.6691734" ]
0.0
-1
Returns the static model of the specified AR class. Please note that you should have this exact method in all your CActiveRecord descendants!
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function model() {\n return parent::model(get_called_class());\n }", "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }" ]
[ "0.7573804", "0.7530022", "0.7271674", "0.7270135", "0.72620845", "0.72142005", "0.72139233", "0.7131974", "0.71288854", "0.71288854", "0.7102769", "0.7102769", "0.7102521", "0.7074754", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285", "0.7064285" ]
0.0
-1