query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Json representation is object with 'start' and 'end' properties
public function jsonSerialize(): array { return [ 'start' => (string) $this->start, 'end' => (string) $this->end, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function jsonSerialize()\n {\n $json = array();\n $json['endCursor'] = $this->endCursor;\n $json['hasNextPage'] = $this->hasNextPage;\n $json['hasPrevPage'] = $this->hasPrevPage;\n $json['startCursor'] = $this->startCursor;\n\n return $json;\n }", "function jsonSerialize()\n {\n return [\n 'start' => $this->start->format('d/m/Y h:i:s'),\n 'end' => $this->end->format('d/m/Y h:i:s'),\n 'description' => $this->description,\n 'questions' => $this->questions,\n ];\n }", "public function jsonSerialize() {\n\t\t$fields = get_object_vars($this);\n\t\t$fields[\"eventStartDate\"] = intval($this->eventStartDate->format(\"U\")) * 1000;\n\t\t$fields[\"eventEndDate\"] = intval($this->eventEndDate->format(\"U\")) * 1000;\n\t\treturn($fields);\n\t}", "function jsonSerialize()\n {\n return [\n 'meta' => [\n 'offset' => $this->page->getOffset(),\n 'limit' => $this->page->getLimit(),\n 'total' => $this->total,\n ],\n 'data' => $this->results,\n ];\n }", "public function toJson();", "public function toJson();", "public function jsonSerialize()\n {\n $json = array();\n $json['driverId'] = $this->driverId;\n $json['endMs'] = $this->endMs;\n $json['groupId'] = $this->groupId;\n $json['startMs'] = $this->startMs;\n\n return $json;\n }", "function jsonSerialize()\n {\n return [\n 'id' => $this->getId(),\n 'duration' => $this->getDuration(),\n 'name' => $this->getName()\n ];\n }", "public function jsonSerialize()\n {\n return ['environment' => $this->environment,'stepResults' => $this->stepResults, 'duration' => number_format($this->duration,2),'message' => $this->message];\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['id'] = $this->id;\n $json['owner'] = $this->owner;\n $json['applicationId'] = $this->applicationId;\n $json['time'] = $this->time;\n $json['segmentCount'] = $this->segmentCount;\n $json['direction'] = $this->direction;\n $json['to'] = $this->to;\n $json['from'] = $this->from;\n $json['media'] = $this->media;\n $json['text'] = $this->text;\n $json['tag'] = $this->tag;\n\n return $json;\n }", "function jsonSerialize()\n {\n\n $this->points = array_reverse($this->points);\n\n for ($i=0; $i< count($this->points); $i++) {\n foreach ($this->points[$i] as $key => $value) {\n if ($key == \"LOCATION_ID\")\n continue;\n\n if ($key == 'time')\n $this->points[$i][$key] = strtotime($this->points[$i][$key]) * 1000;\n else\n $this->points[$i][$key] = round($this->points[$i][$key], 2);\n }\n }\n return $this->points;\n/*\n\n $lines = [];\n foreach ($this->points as $point) {\n $i = 0;\n foreach ($point as $key => $value) {\n if ($key == \"LOCATION_ID\")\n continue;\n\n if (!isset($lines[$i])) {\n $lines[$i] = [];\n }\n\n if ($key == 'time')\n $lines[$i][] = strtotime($point['time']) * 1000;\n else\n $lines[$i][] = round($point[$key], 2);\n\n $i++;\n }\n }\n return $lines;*/\n }", "public function to_array()\r\n {\r\n $d = array();\r\n if($this->start) {\r\n $d['start'] = PiplApi_Utils::piplapi_date_to_str($this->start);\r\n }\r\n if($this->end){\r\n $d['end'] = PiplApi_Utils::piplapi_date_to_str($this->end);\r\n }\r\n return $d;\r\n }", "public function jsonSerialize(){\n if( ! $this->isPersisted() ){\n $properties = (object) get_object_vars($this);\n unset($properties->id);\n return $properties;\n }\n $properties = (object) get_object_vars($this);\n $properties->startUTC = $properties->startUTC->format('c');\n $properties->endUTC = $properties->endUTC->format('c');\n $properties->repeatEndUTC = !is_null($properties->repeatEndUTC) ? $properties->repeatEndUTC->format('c') : null;\n $properties->weeklyDays = is_null($properties->weeklyDays) ? array() :\n // All this does is cast the exploded values from strings to integers\n array_map(function($day){ return (int)$day; }, explode(',',$properties->weeklyDays));\n return $properties;\n }", "public function json(){ return json_encode( $this->objectify() ); }", "public function buildJson();", "public function jsonSerialize()\n {\n return [\n 'x' => $this->x,\n 'y' => $this->y,\n ];\n }", "function jsonSerialize()\n {\n\n $clone = $this->getArrayCopy();\n\n if(count($this) == 0)\n return $clone;\n\n $clone['departure'] = $this['departure']->format('Y-m-d H:i:00');\n $clone['arrival'] = $this['arrival']->format('Y-m-d H:i:00');\n return $clone;\n }", "public function getJson() {\n\t\t\treturn json_encode($this->getIterator());\n\t\t}", "public function getJson() {\n\t\t\treturn json_encode($this->getIterator());\n\t\t}", "public function getJson() {\n\t\t\treturn json_encode($this->getIterator());\n\t\t}", "public function jsonSerialize()\n {\n return [\n \"str\"=>$this->getStr(),\n 'total' => $this->getTotal()\n ];\n }", "public function toArray()\n {\n $objectArray = get_object_vars($this);\n\n //Specific data\n if (null !== $objectArray['dateStart']) {\n $objectArray['dateStart'] = $objectArray['dateStart']->format('Y-m-d');\n $objectArray['dateEnd'] = $this->getDateStart()->add(new DateInterval('P7D'))->format('Y-m-d');\n }\n\n return $objectArray;\n }", "function jsonSerialize()\n\t{\n\t\treturn [\n\t\t\t'key' => $this->key,\n\t\t\t'stage' => $this->targetStep->stepId,\n\t\t\t'name' => $this->name\n\t\t];\n\t}", "public function __toString()\n {\n return get_called_class()\n . \"[\"\n . \"start={$this->getStart()},\"\n . \"end={$this->getEnd()}\"\n . \"]\";\n }", "public function toJSON () {\r\n \treturn json_encode($this->_response);\r\n }", "public function getTagsByBeginAction($begin) {\n $output = new JsonResponse();\n $output->setData($this->get('ebmkm.tag')->getTagsByBeginning($begin));\n return $output;\n }", "function toJSON() {\r\n $unjsoned = array();\r\n \r\n $schedules = $this->has_schedules();\r\n $assignments = BPSP_Assignments::has_assignments();\r\n $entries = array_merge( $assignments, $schedules );\r\n foreach ( $entries as $e ) {\r\n setup_postdata( $e );\r\n if( $e->post_type == \"schedule\" )\r\n $entry = array(\r\n \"id\" => get_the_ID(),\r\n \"title\" => get_the_title( $e->ID ),\r\n \"start\" => date( 'c', strtotime( $e->start_date ) ),\r\n \"end\" => date( 'c', strtotime( $e->end_date ) ),\r\n \"url\" => $e->permalink,\r\n );\r\n elseif( $e->post_type == \"assignment\" )\r\n $entry = array(\r\n \"id\" => get_the_ID(),\r\n \"title\" => get_the_title( $e->ID ),\r\n \"start\" => date( 'c', strtotime( $e->due_date ) ),\r\n \"end\" => date( 'c', strtotime( $e->due_date ) ),\r\n \"url\" => $e->permalink,\r\n );\r\n \r\n if( !empty( $entry['end'] ) )\r\n $entry['allDay'] = false;\r\n \r\n $unjsoned[] = $entry;\r\n }\r\n \r\n header(\"HTTP/1.1 200 OK\");\r\n die( json_encode( $unjsoned ) );\r\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['width'] = $this->width;\n $json['height'] = $this->height;\n $json['length'] = $this->length;\n\n return $json;\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['service_id'] = $this->serviceId;\n $json['date_recurs_by'] = $this->dateRecursBy;\n $json['days'] = $this->days;\n $json['end_date'] = $this->endDate;\n $json['end_time'] = $this->endTime;\n $json['frequency'] = $this->frequency;\n $json['occurrence'] = $this->occurrence;\n $json['recurs_by'] = $this->recursBy;\n $json['resource_id'] = $this->resourceId;\n $json['start_date'] = $this->startDate;\n $json['start_time'] = $this->startTime;\n $json['total_minutes'] = $this->totalMinutes;\n $json['user_id'] = $this->userId;\n\n return $json;\n }", "public function jsonSerialize();" ]
[ "0.6889343", "0.6701645", "0.65143967", "0.5916348", "0.5827126", "0.5827126", "0.57765275", "0.5775196", "0.5738229", "0.5711419", "0.56690735", "0.56563604", "0.56383", "0.563226", "0.5625815", "0.5609264", "0.56091946", "0.5602312", "0.5602312", "0.5602312", "0.55724186", "0.5512002", "0.5498362", "0.54959524", "0.5492469", "0.5487416", "0.54873013", "0.5480932", "0.54729986", "0.54539853" ]
0.7248712
0
Test whether a particular date range is completely contained within this range
public function contains(DateRange $range): bool { return $this->start->isBeforeOrSameAs($range->start) && $this->end->isAfterOrSameAs($range->end); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_within_date_range( $time, $range_start, $range_end ) {\n\tif ( ! is_int( $range_start ) ) {\n\t\t$range_start = strtotime( $range_start );\n\t}\n\n\tif ( ! is_int( $range_end ) ) {\n\t\t$range_end = strtotime( $range_end );\n\t}\n\n\treturn $time > $range_start && $time < $range_end;\n}", "private function CheckDateOverlapping()\n\t{\n\t\t$rid = MicroGrid::GetParameter('rid');\n\t\t$start_date = MicroGrid::GetParameter('start_date', false);\n\t\t$finish_date = MicroGrid::GetParameter('finish_date', false);\n\t\t$hotel_id = MicroGrid::GetParameter('hotel_id', false);\n\n\t\t$sql = 'SELECT * FROM '.TABLE_HOTEL_PERIODS.'\n\t\t\t\tWHERE\n\t\t\t\t\tid != '.(int)$rid.' AND\n\t\t\t\t\thotel_id = '.(int)$hotel_id.' AND\n\t\t\t\t\t(((\\''.$start_date.'\\' >= start_date) AND (\\''.$start_date.'\\' <= finish_date)) OR\n\t\t\t\t\t((\\''.$finish_date.'\\' >= start_date) AND (\\''.$finish_date.'\\' <= finish_date))) ';\t\n\t\t$result = database_query($sql, DATA_AND_ROWS, FIRST_ROW_ONLY);\n\t\tif($result[1] > 0){\n\t\t\t$this->error = _TIME_PERIOD_OVERLAPPING_ALERT;\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function erp_check_date_range_in_range_exist( $start_date, $end_date, $user_date_start, $user_date_end ) {\n\n if ( erp_check_date_in_range( $start_date, $end_date, $user_date_start ) ) {\n return true;\n }\n\n if ( erp_check_date_in_range( $start_date, $end_date, $user_date_end ) ) {\n return true;\n }\n\n return false;\n}", "protected function isWithin() {\n if(isset($this->listeners['within']) && \n $this->start_time instanceof \\DateTime &&\n $this->since_start instanceof \\DateTime) {\n foreach($this->listeners['within'] as $listener) {\n list($increment,$period) = $listener;\n $diff = $this->start_time->diff($this->since_start);\n if($diff->$period < $increment) {\n return true;\n }\n }\n } else {\n return true;\n }\n \n return false;\n }", "public function overlaps(Range $range) {\n return $range->contains($this->start) || $range->contains($this->end) || $this->includes($range);\n }", "function is_valid_date_range($date_start, $date_end){\n $d1 = strtotime($date_start);\n $d2 = strtotime($date_end);\n\n if($d2 >= $d1){\n return true;\n }else{\n return false;\n }\n\n}", "public function checkDateRange($date,$dateRange){\r\r\n\t\t\t//provide date in format m/d/y\r\r\n\t\t\tlist($month, $day, $year) = split(\"/\", $date);\r\r\n\t\t\t$month = (int)$month;\r\r\n\t\t\t$day = (int)$day;\r\r\n\t\t\t$year = (int)$year;\r\r\n\t\t\t$fails = false;\r\r\n\t\t\tif ($year >= $dateRange['startYear'] && $year <= $dateRange['endYear']){\r\r\n\t\t\t\t//if year is within B-E\r\r\n\t\t\t\tif($year == $dateRange['startYear'] ){\r\r\n\t\t\t\t\t//Y=B\r\r\n\t\t\t\t\tif($month >= $dateRange['startMonth']){\r\r\n\t\t\t\t\t\tif($month == $dateRange['startMonth']){\r\r\n\t\t\t\t\t\t\tif($day >= $dateRange['startDay']){\r\r\n\t\t\t\t\t\t\t\t// start < contactDate\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$fails = true;\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t$fails = true;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\r\r\n\t\t\t\tif($year == $dateRange['endYear'] ){\r\r\n\t\t\t\t\tif($month <= $dateRange['endMonth']){\r\r\n\t\t\t\t\t\tif($month == $dateRange['endMonth']){\r\r\n\t\t\t\t\t\t\tif($day <= $dateRange['endDay']){\r\r\n\t\t\t\t\t\t\t\t// end > contactDate\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$fails = true;\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t$fails = true;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\r\r\n\t\t\t}else{\r\r\n\t\t\t\t$fails = true;\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\tif($fails){\r\r\n\t\t\t\treturn false;\r\r\n\t\t\t} else {\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t}", "public function inPeriod(\\DateTime $date)\n {\n return $date >= $this->startDate && $date <= $this->endDate;\n }", "public function hasRange()\n {\n return ($this->getOffset() !== false && $this->getOffset() >= 0 && $this->getNumberOfEntries() !== false && $this->getNumberOfEntries() > 0);\n }", "private function checkDate($start_date, $end_date, $start_date_2, $end_date_2) {\n // Convert to timestamp\n $date['start'] = strtotime($start_date);\n $date['end'] = strtotime($end_date);\n $date2['start'] = strtotime($start_date_2);\n $date2['end'] = strtotime($end_date_2);\n \n // check if intervals overlap\n if(($date['start'] <= $date2['end']) && ($date['end'] >= $date2['start'])) {\n return FALSE;\n }\n \n return TRUE;\n }", "public function overlaps(DateTimePeriod $period): bool\n {\n return\n $this->getStart() < $period->getStart() &&\n $this->getEnd() < $period->getEnd() &&\n $period->getStart() < $this->getEnd();\n }", "protected function isWithinTimedBannerRange()\n {\n // First fetch the server datetime and then convert that exact datetime to UTC so that it's compatible\n // with the UTC given start and end datetimes\n $oCurrentDateTime = $this->getLocale()->date(null, $this->getDateTimeFormat());\n $oCurrentDateTime = new Zend_Date($oCurrentDateTime->toString(), $this->getDateTimeFormat(), $this->getLocale()->getLocaleCode());\n\n $oStart = $this->getStart();\n $oEnd = $this->getEnd();\n\n // There is only a start and it's now or before\n if ($oStart && !$oEnd && $oCurrentDateTime >= $oStart) { return true; }\n // Both start and end are present and now is between them\n if ($oStart && $oEnd && $oCurrentDateTime >= $oStart && $oCurrentDateTime <= $oEnd) { return true; }\n // There is no start but there is an end and now is before the end\n if (!$oStart && $oEnd && $oCurrentDateTime <= $oEnd) { return true; }\n\n return false;\n }", "private function containsDatePoint(DateTimeInterface $datepoint, string $bounds): bool\n {\n return match ($bounds) {\n self::EXCLUDE_ALL => $datepoint > $this->startDate && $datepoint < $this->endDate,\n self::INCLUDE_ALL => $datepoint >= $this->startDate && $datepoint <= $this->endDate,\n self::EXCLUDE_START_INCLUDE_END => $datepoint > $this->startDate && $datepoint <= $this->endDate,\n default => $datepoint >= $this->startDate && $datepoint < $this->endDate,\n };\n }", "public function includes(Range $range) {\n if(is_null($range) || $range == self::EMPTY_RANGE) return true;\n return $this->contains($range->start) && $this->contains($range->end);\n }", "public static function is_reservtion_possible(DateTime $date1, DateTime $date2, Room $room_for_check){\r\n if ($date1>$date2) return false;\r\n \r\n $unavailable_dates = (new self)->all_unavailable_dates($room_for_check);\r\n// var_dump($unavailable_dates); \r\n $unav_dates_between = array();\r\n foreach($unavailable_dates as $the_date){\r\n if (self::is_date_greater($the_date, $date1) && self::is_date_greater($date2, $the_date)){\r\n $unav_dates_between[] = $the_date;\r\n// var_dump($the_date);\r\n break;\r\n \r\n }\r\n }\r\n// var_dump($unav_dates_between);\r\n return empty($unav_dates_between);\r\n}", "public static function inDateRange($startDate, $endDate)\r\n\t{\r\n\t\tif(self::datesEqual($startDate, $endDate) || self::dateGreater($endDate, $startDate))\r\n\t\t{\r\n\t\t\treturn true;\t\t\t\r\n\t\t}else\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function isWithinInterval($lowerBoundDate, $upperBoundDate) {\n\n\t\t$minday = $minday = date('Y-m-d', strtotime($lowerBoundDate));\n\t\t$maxday = date('Y-m-d', strtotime($upperBoundDate));\n\n\t\t$thisday = $this->getISOFormat();\n\n\t\treturn ( empty($lowerBoundDate) || $thisday >= $minday)\n\t\t\t&& ( empty($upperBoundDate) || $thisday <= $maxday);\n\t}", "public static function checkDatesDontOverlap($start_date_hour, $ending_date_hour) {\n $results = DB::select(\n 'SELECT * FROM events \n\t\t\tWHERE ( start_date_hour BETWEEN ? AND ? OR\n\t\t\tending_date_hour BETWEEN ? AND ? ) OR\n\t\t\t( start_date_hour < ? AND ending_date_hour > ? )', array(\n $start_date_hour, $ending_date_hour,\n $start_date_hour, $ending_date_hour,\n $start_date_hour, $ending_date_hour,\n ));\n if ($results != NULL) {\n $response['fail'] = array(\n 'event' => [trans('fail.event.overlap')],\n );\n } else {\n $response = true;\n }\n return $response;\n }", "public function isNowInRange()\n {\n $now = (new \\DateTime())->format('H:i:s');\n return $this->start->__toString() <= $now\n && $this->end->__toString() >= $now;\n }", "private function hasEventForRange($ical, $start, $end)\n {\n return ! empty($ical->eventsFromRange($start, $end));\n }", "public function within_bounds($date, $participant_id)\n\t{\n\t\t$this->db->where('participant_id', $participant_id);\n\t\t$this->db->where('from <=', $date);\n\t\t$this->db->where('to >', $date);\n\t\t$this->db->from('impediment');\n\t\treturn $this->db->count_all_results() > 0;\n\t}", "function erp_check_date_in_range( $start_date, $end_date, $date_from_user ) {\n // Convert to timestamp\n $start_ts = strtotime( $start_date );\n $end_ts = strtotime( $end_date );\n $user_ts = strtotime( $date_from_user );\n\n // Check that user date is between start & end\n if ( ( $user_ts >= $start_ts ) && ( $user_ts <= $end_ts ) ) {\n return true;\n }\n\n return false;\n}", "public function checkOverlap()\n {\n global $zdb;\n\n try {\n $select = $zdb->select(self::TABLE, 'c');\n $select->columns(\n array('date_debut_cotis', 'date_fin_cotis')\n )->join(\n array('ct' => PREFIX_DB . ContributionsTypes::TABLE),\n 'c.' . ContributionsTypes::PK . '=ct.' . ContributionsTypes::PK,\n array()\n )->where(Adherent::PK . ' = ' . $this->_member)\n ->where(array('cotis_extension' => new Expression('true')))\n ->where->nest->nest\n ->greaterThanOrEqualTo('date_debut_cotis', $this->_begin_date)\n ->lessThan('date_debut_cotis', $this->_end_date)\n ->unnest\n ->or->nest\n ->greaterThan('date_fin_cotis', $this->_begin_date)\n ->lessThanOrEqualTo('date_fin_cotis', $this->_end_date);\n\n if ( $this->id != '' ) {\n $select->where(self::PK . ' != ' . $this->id);\n }\n\n $results = $zdb->execute($select);\n $result = $results->current();\n if ( $result !== false ) {\n $d = new \\DateTime($result->date_debut_cotis);\n\n return _T(\"- Membership period overlaps period starting at \") .\n $d->format(_T(\"Y-m-d\"));\n }\n return true;\n } catch (\\Exception $e) {\n Analog::log(\n 'An error occured checking overlaping fee. ' . $e->getMessage(),\n Analog::ERROR\n );\n return false;\n }\n }", "public function checkOverlap()\n {\n\n $args = array('pre_burn_id'=>null,'start_date'=>null,'end_date'=>null);\n extract(merge_args(func_get_args(), $args));\n\n $result = false;\n\n if (empty($end_date)) {\n $end_date = $start_date;\n }\n\n if (empty($start_date)) {\n $start_date = $end_date;\n }\n\n $overlaps = fetch_one(\n \"SELECT COUNT(burn_id) as overlaps\n FROM burns\n WHERE pre_burn_id = ?\n AND (\n ? BETWEEN start_date AND end_date\n OR ? BETWEEN start_date AND end_date\n );\",\n array($pre_burn_id, $start_date, $end_date)\n );\n\n if ($overlaps > 0) {\n $result = true;\n }\n\n return json_encode($result);\n }", "private function containsInterval(self $period): bool\n {\n return match (true) {\n $this->startDate < $period->startDate && $this->endDate > $period->endDate\n => true,\n $this->startDate == $period->startDate && $this->endDate == $period->endDate\n => $this->bounds === $period->bounds || '[]' === $this->bounds,\n $this->startDate == $period->startDate\n => ($this->bounds[0] === $period->bounds[0] || '[' === $this->bounds[0])\n && $this->containsDatePoint($this->startDate->add($period->dateInterval()), $this->bounds),\n $this->endDate == $period->endDate\n => ($this->bounds[1] === $period->bounds[1] || ']' === $this->bounds[1])\n && $this->containsDatePoint($this->endDate->sub($period->dateInterval()), $this->bounds),\n default\n => false,\n };\n }", "public function between(string $lowerDate, string $upperDate) : bool\r\n {\r\n return ($this->getTimestamp() >= strtotime($lowerDate) && $this->getTimestamp() <= strtotime($upperDate));\r\n }", "public function overlaps(self $timeSlot): bool\n {\n return !$this->abuts($timeSlot)\n && $this->startDate < $timeSlot->endDate\n && $this->endDate > $timeSlot->startDate;\n }", "public function checkHireDateisinRange($year,$dateRange){\r\r\n\t\t\t// some employee hire dates are entered in 'xx' some in 'xxxx' - this filters them out and compares accordingly\r\r\n\t\t\t$year = (int)$year;\r\r\n\t\t\tif($year < 100){ // if year was sloppily entered in 2 digit format\r\r\n\t\t\t\tif($year >= 50){ // safe to assume the 2digit year is from the 1900s\r\r\n\t\t\t\t\t$year = $year + 1900;\r\r\n\t\t\t\t}elseif($year < 50 ){ // safe to assume the 2 digit year is from the 2000s\r\r\n\t\t\t\t\t$year = $year + 2000;\r\r\n\t\t\t\t}\r\r\n\t\t\t} \r\r\n\r\r\n\t\t\tif( $year <= $dateRange['endYear']){\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t} else{\r\r\n\t\t\t\treturn false;\r\r\n\t\t\t}\r\r\n\t\t}", "function check_in_range($start_date, $end_date, $date_from_user)\n{\n // Convert to timestamp\n $start_ts = strtotime($start_date);\n $end_ts = strtotime($end_date);\n $user_ts = strtotime(date('Y-m-d', strtotime($date_from_user)));\n\n // Check that user date is between start & end\n return (($user_ts >= $start_ts) && ($user_ts <= $end_ts));\n}", "public function containsDate($date) {\n // if my time period starts AFTER the date, then it doesn't contain it.\n if ($date < $this->eff_date) {\n return false;\n }\n\n // if my time period never expires then we know we're ok at this point\n if (is_null($this->exp_date)) {\n return true;\n }\n\n // if my time period ends before or on date, then I don't contain it.\n if (is_null($date)) {\n return false;\n }\n if ($this->exp_date <= $date) {\n return false;\n }\n\n // no more failure scenarios.\n return true;\n }" ]
[ "0.72426397", "0.7241391", "0.7008008", "0.68345153", "0.6767573", "0.67662233", "0.6749946", "0.67207533", "0.6711818", "0.66846484", "0.655969", "0.65348613", "0.6494709", "0.64334685", "0.6421759", "0.64104366", "0.6406525", "0.64023274", "0.63684803", "0.6358056", "0.6351794", "0.6319686", "0.63015854", "0.630041", "0.6297298", "0.62830365", "0.6277564", "0.6251857", "0.62502915", "0.62151986" ]
0.74093854
0
Get a generator which splits the range into subranges The supplied callback function will be applied to each date in the range, and consecutive dates for which the callback returns equal values will be grouped together into a subrange. This function returns a generator which will yield each of these contiguous subranges in turn, together with the callback value. The yield values will be in the format of an array with 'value' and 'range' keys.
public function iterateSubRanges(callable $value_fn, array $opts = []): Generator { $backwards = (bool) ($opts['backwards'] ?? false); $step = $backwards ? -1 : 1; $end = $backwards ? $this->start : $this->end; $sub_range_start = $backwards ? $this->end : $this->start; $sub_range_end = $sub_range_start; $sub_range_value = $value_fn($sub_range_start); while (! $sub_range_end->isSameAs($end)) { $next_date = $sub_range_end->addDays($step); $next_value = $value_fn($next_date); if ($next_value != $sub_range_value) { // Value has changed yield [ 'range' => DateRange::eitherWayRound($sub_range_start, $sub_range_end), 'value' => $sub_range_value, ]; // Start a new current range $sub_range_start = $next_date; $sub_range_value = $next_value; } $sub_range_end = $next_date; } // Finish the current range yield [ 'range' => DateRange::eitherWayRound($sub_range_start, $sub_range_end), 'value' => $sub_range_value, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function split($interval)\n {\n $startDate = $this->startDate;\n $interval = static::filterDateInterval($interval);\n do {\n $endDate = $startDate->add($interval);\n if ($endDate > $this->endDate) {\n $endDate = $this->endDate;\n }\n yield new static($startDate, $endDate);\n\n $startDate = $endDate;\n } while ($startDate < $this->endDate);\n }", "public function split($interval)\n {\n $startDate = $this->startDate;\n $interval = static::filterDateInterval($interval);\n do {\n $endDate = $startDate->add($interval);\n if ($endDate > $this->endDate) {\n $endDate = $this->endDate;\n }\n yield new static($startDate, $endDate);\n\n $startDate = $endDate;\n } while ($startDate < $this->endDate);\n }", "public function dateRanges(): DateRangeCollection;", "public function partition($callback)\n {\n $callback = \\PHPF\\Closure::getAsCallable($callback);\n\n $valid = array();\n $invalid = array();\n\n foreach ($this->data as $key => $value) {\n if ($callback($value, $key, $this)) {\n $valid[$key] = $value;\n\n } else {\n $invalid[$key] = $value;\n }\n }\n\n return array(new static($valid), new static($invalid));\n }", "protected function groupIntoRange(array $values, array $ranges): array\n\t{\n\t\t$groupedValues = [];\n\n\t\tforeach ($values as $value) {\n\t\t\t$key = 0;\n\t\t\tfor ($i = 0; $i < sizeof($ranges); $i++) {\n\t\t\t\t$firstValue = $ranges[$i];\n\t\t\t\t$secondValue = null;\n\n\t\t\t\tif (array_key_exists($i + 1, $ranges) === true) {\n\t\t\t\t\t$secondValue = $ranges[$i + 1];\n\t\t\t\t}\n\n\t\t\t\tif ($secondValue === null) {\n\t\t\t\t\t$key = $i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ($value >= $firstValue && $value < $secondValue) {\n\t\t\t\t\t$key = $i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (! isset($groupedValues[$key]) || ! is_array($groupedValues[$key])) {\n\t\t\t\t$groupedValues[$key] = [];\n\t\t\t}\n\n\t\t\tarray_push($groupedValues[$key], $value);\n\t\t}\n\n\t\treturn $groupedValues;\n\t}", "public function mapToGroups(callable $callback)\n {\n $groups = $this->map($callback)->reduce(function ($groups, $pair) {\n $groups[key($pair)][] = reset($pair);\n\n return $groups;\n }, []);\n\n return (new static($groups))->map([$this, 'make']);\n }", "public function splitBackwards($interval)\n {\n $endDate = $this->endDate;\n $interval = static::filterDateInterval($interval);\n do {\n $startDate = $endDate->sub($interval);\n if ($startDate < $this->startDate) {\n $startDate = $this->startDate;\n }\n yield new static($startDate, $endDate);\n\n $endDate = $startDate;\n } while ($endDate > $this->startDate);\n }", "public function group($callback)\n {\n $callback = \\PHPF\\Closure::getAsCallable($callback);\n\n $groups = array();\n\n foreach ($this->data as $key => $value) {\n $index = $callback($value, $key, $this);\n\n if (!isset($groups[$index])) {\n $groups[$index] = array();\n }\n\n $groups[$index][$key] = $value;\n }\n\n $this->data = $groups;\n\n return $this;\n }", "protected function _getRanges() {}", "public function map(Closure $closure): self\n {\n $intervals = [];\n foreach ($this->periods as $offset => $period) {\n $intervals[$offset] = $closure($period, $offset);\n }\n\n if ($intervals === $this->periods) {\n return $this;\n }\n\n $mapped = new self();\n $mapped->periods = $intervals;\n\n return $mapped;\n }", "public function map(callable $callback): self\n {\n $keys = $this->keys();\n $values = array_map($callback, $this->values(), $this->keys());\n\n $fluentArray = $this->derive();\n\n foreach ($values as $index => $value) {\n $key = $keys[$index];\n $fluentArray->set($key, $value);\n }\n\n return $fluentArray;\n }", "function jt_cmb2_date_year_range_get_split_values( $no_override, $object_id, $args, $field ) {\n\tif ( 'date_year_range' !== $field->args( 'type' ) || ! $field->args( 'split_values' ) ) {\n\t\treturn $no_override;\n\t}\n\n\t$value = array(\n\t\t'start' => get_post_meta( $object_id, $args['field_id'] . '_start', 1 ),\n\t\t'finish' => get_post_meta( $object_id, $args['field_id'] . '_finish', 1 ),\n\t);\n\n\treturn $value;\n}", "public function getRanges(): UnitRangesCollection;", "public static function range($lowerBound, $upperBound, $unit = DAY) {\n\t\t\tif(is_string($lowerBound)) {\n\t\t\t\t$lowerBound = strtotime($lowerBound);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(empty($upperBound)) {\n\t\t\t\t$upperBound = self::now();\n\t\t\t}\n\t\t\t\n\t\t\tif(is_string($upperBound)) {\n\t\t\t\t$upperBound = strtotime($upperBound);\n\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t$range = range($lowerBound, $upperBound, $unit);\n\t\t\t\n\t\t\treturn array_map(function($date) { return date('Y-m-d', $date); }, $range);\n\t\t}", "public function getRange(): array\n {\n if ($this->getPageCount() < $this->rangeLimit) { // Not enough pages to apply range limit\n $start = 1;\n $stop = $this->getPageCount();\n } else { // Enough page to apply range limit\n if ($this->getPage() <= $this->rangeLimit / 2) { // Cannot center, current page too far on the left\n $start = 1;\n $stop = $start + $this->rangeLimit - 1;\n } elseif ($this->getPage() + ceil($this->rangeLimit / 2) > $this->getPageCount()\n ) { // Cannot center, current page too far on the right\n $stop = $this->getPageCount();\n $start = $stop - $this->rangeLimit + 1;\n } else { // Enough space on both sides, we can center\n $start = $this->getPage() - floor($this->rangeLimit / 2) + 1;\n $stop = $start + $this->rangeLimit - 1;\n }\n }\n\n return range($start, $stop);\n }", "public function age_range()\r\n {\r\n if (empty($this->date_range)){\r\n return array(NULL, NULL);\r\n }\r\n if(empty($this->date_range->start) || empty($this->date_range->end)){\r\n return array($this->age(), $this->age());\r\n }\r\n\r\n $start_date = new PiplApi_DateRange($this->date_range->start, $this->date_range->start);\r\n $end_date = new PiplApi_DateRange($this->date_range->end, $this->date_range->end);\r\n $start_age = new PiplApi_DOB(array('date_range' => $start_date));\r\n $start_age = $start_age->age();\r\n $end_age = new PiplApi_DOB(array('date_range' => $end_date));\r\n $end_age = $end_age->age();\r\n\r\n return (array($end_age, $start_age));\r\n }", "public function splitAt(float $value): RangeCollection\n {\n if ($this->includesValue($value))\n {\n return new RangeCollection([\n new static($this->getLeft(), new Margin($value)),\n new static(new Margin($value), $this->getRight())\n ]);\n }\n throw new SplitValueIsOutOfRangeException(sprintf(\"Cannot split %s at %.2d\", $this, $value));\n }", "function createDateRangeArray($strDateFrom,$strDateTo)\n{\n // inclusive array of the dates between the from and to dates.\n\n // could test validity of dates here but I'm already doing\n // that in the main script\n $i=0;\n $aryRange=array();\n\n//$aryRange[] = array(\"DATA\"=>\"\");\n\n $iDateFrom=mktime(1,0,0,substr($strDateFrom,5,2), substr($strDateFrom,8,2),substr($strDateFrom,0,4));\n $iDateTo=mktime(1,0,0,substr($strDateTo,5,2), substr($strDateTo,8,2),substr($strDateTo,0,4));\n\n if ($iDateTo>=$iDateFrom)\n {\n// array_push($aryRange,date('Y-m-d',$iDateFrom)); // first entry\n// array_push($aryRange[\"DATA\"],date('Y-m-d',$iDateFrom)); // first entry\n$aryRange[] = array(\"DATE\"=>date('Y-m-d',$iDateFrom), 'KEY=>'.$i);\n$i=$i+1;\n\n//$array[] = $var;\n\n while ($iDateFrom<$iDateTo)\n {\n $iDateFrom+=86400; // add 24 hours\n// array_push($aryRange,date('Y-m-d',$iDateFrom));\n// array_push($aryRange[\"DATA\"],date('Y-m-d',$iDateFrom));\n//$aryRange[] = array(\"DATE\"=>date('Y-m-d',$iDateFrom));\n$aryRange[] = array(\"DATE\"=>date('Y-m-d',$iDateFrom), 'KEY=>'.$i);\n$i=$i+1;\n\n }\n }\n$aryRange=array_reverse($aryRange);\n\n return $aryRange;\n}", "public function eachSpread(callable $callback)\n {\n return $this->each(function ($chunk) use ($callback) {\n return $callback(...$chunk);\n });\n }", "public function generateChunked(int $queryChunkSize = 500, callable $callback = null) {\n\n\t\t\t$this->enforceOrderBy();\n\n\t\t\t$page = 1;\n\n\t\t\tdo {\n\t\t\t\t$results = $this->forPage($page, $queryChunkSize)->get();\n\n\t\t\t\t$count = $results->count();\n\n\t\t\t\t// invoke callback if one exists\n\t\t\t\tif ($callback && $count) {\n\t\t\t\t\t$results = call_user_func($callback, $results, $page);\n\n\t\t\t\t\tif (!is_iterable($results))\n\t\t\t\t\t\tthrow new RuntimeException('Callback passed to generateChunked() must return an iterable, got ' . (is_object($results) ? get_class($results) : strtolower(gettype($results))));\n\t\t\t\t}\n\n\t\t\t\t// yield results (do not use yield from, to generate new unique keys)\n\t\t\t\tforeach ($results as $curr) {\n\t\t\t\t\tyield $curr;\n\t\t\t\t}\n\n\t\t\t\tunset($results);\n\n\t\t\t\t++$page;\n\n\t\t\t} while ($count >= $queryChunkSize);\n\t\t}", "public function ranges()\n {\n return [];\n }", "private function generateDateRange(Carbon $start_date, DateInterval $interval, int $recurrences, int $exclusive = 1): array\n {\n $period = new DatePeriod($start_date, $interval, $recurrences, $exclusive);\n $dates = collect();\n\n foreach ($period as $date) {\n $dates->push($date->format('Y-m-d'));\n }\n\n return $dates->toArray();\n }", "public function split(Period|Duration|DateInterval $duration): iterable\n {\n $duration = self::filterDuration($duration);\n /** @var DateTimeImmutable $startDate */\n foreach ($this->toDatePeriod($duration) as $startDate) {\n $endDate = $startDate->add($duration);\n if ($endDate > $this->endDate) {\n $endDate = $this->endDate;\n }\n\n yield new self($startDate, $endDate, $this->bounds);\n }\n }", "public function map(callable $callback)\n {\n $literal = array();\n\n for ($i = 0; $i < $this->rows; $i++) {\n $row = array();\n\n for ($j = 0; $j < $this->columns; $j++) {\n $row[] = $callback($this->get($i, $j), $i, $j, $this);\n }\n\n $literal[] = $row;\n }\n\n return new static($literal);\n }", "public function each(): Generator\n {\n for ($day = $this->start; $day->isBeforeOrSameAs($this->end); $day = $day->nextDay()) {\n yield $day;\n }\n }", "public function map(callable $callback)\n {\n $literal = [];\n\n for ($i = 0; $i < $this->getRowCount(); $i++) {\n $row = [];\n\n for ($j = 0; $j < $this->getColumnCount(); $j++) {\n $row[] = $callback($this->get($i, $j), $i, $j, $this);\n }\n\n $literal[] = $row;\n }\n\n return new static($literal);\n }", "public function groupBy(callable $callback): Stream {\n\t\t$values = [];\n\t\t$keys = [];\n\t\tforeach ($this as $value) {\n\t\t\t$key = $callback($value);\n\t\t\t$hashed_keys = is_object($key) ? spl_object_hash($key) : $key;\n\t\t\t$values[$hashed_keys][] = $value;\n\t\t\t$keys[$hashed_keys] = $key;\n\t\t}\n\n\t\t$generator = function (array $values, array $keys) {\n\t\t\tforeach ($keys as $hashed_keys => $key) {\n\t\t\t\tyield [$key, Stream::of($values[$hashed_keys])];\n\t\t\t}\n\t\t};\n\n\t\treturn new Stream($generator($values, $keys));\n\t}", "protected function _getDateRange()\n {\n if (is_null($this->_dateRange)) {\n $this->_dateRange = array();\n $rules = $this->getAttributeObject()->getValidateRules();\n if (isset($rules[self::MIN_DATE_RANGE_KEY])) {\n $this->_dateRange[self::MIN_DATE_RANGE_KEY] = $rules[self::MIN_DATE_RANGE_KEY];\n }\n if (isset($rules[self::MAX_DATE_RANGE_KEY])) {\n $this->_dateRange[self::MAX_DATE_RANGE_KEY] = $rules[self::MAX_DATE_RANGE_KEY];\n }\n }\n return $this->_dateRange;\n }", "public function getRanges()\n {\n return $this->ranges;\n }", "public function getRanges()\n {\n return $this->ranges;\n }" ]
[ "0.5714152", "0.5714152", "0.5421245", "0.53541213", "0.5234432", "0.5207067", "0.5052191", "0.5005233", "0.49579906", "0.49086422", "0.48947716", "0.48820084", "0.48665294", "0.4858393", "0.48096666", "0.48081678", "0.47535062", "0.47512066", "0.4743403", "0.47252494", "0.47013554", "0.47003022", "0.46952352", "0.46926114", "0.46861255", "0.4680887", "0.46592158", "0.46412387", "0.45823258", "0.45823258" ]
0.6914536
0
Specify the consistency level for this query.
public function consistency($consistency) { if ($consistency == self::NOT_BOUNDED) { $this->options['scan_consistency'] = 'not_bounded'; } else if ($consistency == self::REQUEST_PLUS) { $this->options['scan_consistency'] = 'request_plus'; } else if ($consistency == self::STATEMENT_PLUS) { $this->options['scan_consistency'] = 'statement_plus'; } else { throw new CouchbaseException('invalid option passed.'); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ensureConsistency()\n {\n }", "public function ensureConsistency()\n {\n }", "public function ensureConsistency()\n {\n }", "public function ensureConsistency()\n {\n }", "public function ensureConsistency()\n {\n }", "public function ensureConsistency()\n {\n\n }", "public function ensureConsistency()\n {\n\n }", "public function ensureConsistency()\n\t{\n\n\t}", "public function ensureConsistency()\n\t{\n\n\t}", "public function ensureConsistency()\n\t{\n\n\t}", "public function ensureConsistency()\n\t{\n\n\t}", "public static function transactionLevel()\n {\n }", "public function transactionLevel();", "public function setVerbosity($level)\n {\n }", "public function setVerbosity(int $level);", "public function transactionLevel()\n\t{\n\t\treturn $this->neoeloquent->transactionLevel();\n\t}", "function setCompatibilityLevel($value)\n {\n $this->_props['CompatibilityLevel'] = $value;\n }", "public function setTransactionIsolation($level)\n {\n $this->transactionIsolationLevel = $level;\n\n return $this->executeStatement($this->getDatabasePlatform()->getSetTransactionIsolationSQL($level));\n }", "public function ensureConsistency()\n {\n\n if ($this->aOperations !== null && $this->op_id !== $this->aOperations->getOpId()) {\n $this->aOperations = null;\n }\n if ($this->aRCurrencies !== null && $this->operation_prime_currency_id !== $this->aRCurrencies->getRCurrencyId()) {\n $this->aRCurrencies = null;\n }\n if ($this->aRRewardTypes !== null && $this->operation_prime_r_reward_type_id !== $this->aRRewardTypes->getRRewardTypeId()) {\n $this->aRRewardTypes = null;\n }\n if ($this->aRRewardExpeditionModes !== null && $this->operation_prime_r_reward_expedition_mode_id !== $this->aRRewardExpeditionModes->getRRewardExpeditionModeId()) {\n $this->aRRewardExpeditionModes = null;\n }\n if ($this->aRRewardTransporters !== null && $this->operation_prime_r_reward_transporter_id !== $this->aRRewardTransporters->getRRewardTransporterId()) {\n $this->aRRewardTransporters = null;\n }\n }", "public function ensureConsistency()\n {\n\n if ($this->aSucursal !== null && $this->idsucursal !== $this->aSucursal->getIdsucursal()) {\n $this->aSucursal = null;\n }\n }", "public function ensureConsistency()\n {\n\n if ($this->aJenisPrasarana !== null && $this->jenis_prasarana_id !== $this->aJenisPrasarana->getJenisPrasaranaId()) {\n $this->aJenisPrasarana = null;\n }\n if ($this->aSekolah !== null && $this->sekolah_id !== $this->aSekolah->getSekolahId()) {\n $this->aSekolah = null;\n }\n if ($this->aTanah !== null && $this->id_tanah !== $this->aTanah->getIdTanah()) {\n $this->aTanah = null;\n }\n if ($this->aPtk !== null && $this->ptk_id !== $this->aPtk->getPtkId()) {\n $this->aPtk = null;\n }\n if ($this->aJenisHapusBuku !== null && $this->id_hapus_buku !== $this->aJenisHapusBuku->getIdHapusBuku()) {\n $this->aJenisHapusBuku = null;\n }\n if ($this->aStatusKepemilikanSarpras !== null && $this->kepemilikan_sarpras_id !== $this->aStatusKepemilikanSarpras->getKepemilikanSarprasId()) {\n $this->aStatusKepemilikanSarpras = null;\n }\n }", "public function setLevel($level);", "public function setErrorCorrectionLevel($level) {\n\t\t\tif($level !== 'L' && $level !== 'M' && $level !== 'Q' && $level !== 'H')\n\t\t\t\tthrow new \\InvalidArgumentException('Invalid error correction level.');\n\t\t\t$this->errorCorrectionLevel = $level;\n\t\t}", "public function setVerbosity($level)\n {\n $this->decoratedOutput->setVerbosity($level);\n }", "public function setBoost($documentBoostValue) {}", "public function ensureConsistency()\n {\n\n if ($this->aSekolah !== null && $this->sekolah_id !== $this->aSekolah->getSekolahId()) {\n $this->aSekolah = null;\n }\n if ($this->aSemester !== null && $this->semester_id !== $this->aSemester->getSemesterId()) {\n $this->aSemester = null;\n }\n if ($this->aSumberAirRelatedBySumberAirId !== null && $this->sumber_air_id !== $this->aSumberAirRelatedBySumberAirId->getSumberAirId()) {\n $this->aSumberAirRelatedBySumberAirId = null;\n }\n if ($this->aSumberAirRelatedBySumberAirMinumId !== null && $this->sumber_air_minum_id !== $this->aSumberAirRelatedBySumberAirMinumId->getSumberAirId()) {\n $this->aSumberAirRelatedBySumberAirMinumId = null;\n }\n }", "public function durabilityLevel($level): IncrementOptions\n {\n if (gettype($level) == \"integer\") {\n $level = Deprecations::convertDeprecatedDurabilityLevel(__METHOD__, $level);\n }\n $this->durabilityLevel = $level;\n return $this;\n }", "public function setLevel($level) {\n $this->level = $level;\n }", "public function consistentRead(bool $mode): Builder\n {\n $this->consistentRead = $mode;\n\n return $this;\n }", "public function level(string $level): self\n {\n $this->level = $level;\n\n return $this;\n }" ]
[ "0.54391", "0.54391", "0.54391", "0.54391", "0.54391", "0.539124", "0.539124", "0.53371596", "0.53371596", "0.53371596", "0.53371596", "0.48485973", "0.471771", "0.46443698", "0.45958912", "0.45412344", "0.45077625", "0.44904783", "0.4417916", "0.44117102", "0.44077125", "0.43384445", "0.43227354", "0.43222508", "0.42658523", "0.42457053", "0.42340606", "0.4225537", "0.41910452", "0.4190474" ]
0.72178763
0
Test case for addVendorComplianceSurvey Create a vendorComplianceSurvey.
public function testAddVendorComplianceSurvey() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addVendorComplianceSurvey($body)\n {\n list($response) = $this->addVendorComplianceSurveyWithHttpInfo($body);\n return $response;\n }", "public function testUpdateVendorComplianceSurvey()\n {\n }", "public function testAddVendorComplianceSurveyTag()\n {\n }", "public function addVendorComplianceSurveyAsync($body)\n {\n return $this->addVendorComplianceSurveyAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function testAddVendorComplianceSurveyFile()\n {\n }", "public function testDeleteVendorComplianceSurvey()\n {\n }", "protected function addVendorComplianceSurveyAuditRequest($vendor_compliance_survey_id, $vendor_compliance_survey_audit)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyAudit'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_audit' is set\n if ($vendor_compliance_survey_audit === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_audit when calling addVendorComplianceSurveyAudit'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/audit/{vendorComplianceSurveyAudit}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_audit !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyAudit' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_audit),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testAddVendorComplianceSurveyAudit()\n {\n }", "protected function addVendorComplianceSurveyRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling addVendorComplianceSurvey'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function addVendorComplianceSurveyTagRequest($vendor_compliance_survey_id, $vendor_compliance_survey_tag)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyTag'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_tag' is set\n if ($vendor_compliance_survey_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_tag when calling addVendorComplianceSurveyTag'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/tag/{vendorComplianceSurveyTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyTag' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function deleteVendorComplianceSurveyRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling deleteVendorComplianceSurvey'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function addVendorComplianceSurveyWithHttpInfo($body)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey';\n $request = $this->addVendorComplianceSurveyRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 405:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Infoplus\\Infoplus\\Model\\ApiResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function testGetDuplicateVendorComplianceSurveyById()\n {\n }", "public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }", "protected function getDuplicateVendorComplianceSurveyByIdRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getDuplicateVendorComplianceSurveyById'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/duplicate/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testGetVendorComplianceSurveyById()\n {\n }", "public function add_reseller_program_survey()\n {\n $this->loadModel('ResellerProgramSurveys');\n if (!$this->request->is('post')) {\n throw new MethodNotAllowedException(__('BAD_REQUEST'));\n }\n \n $resellerProgramId = $this->Auth->user('id');\n $this->request->data['reseller_program_id'] = $resellerProgramId;\n $resellerProgramSurveys=$this->request->data;\n\n $resellerProgramSurveys = $this->ResellerProgramSurveys->newEntity($resellerProgramSurveys);\n //pr($resellerProgramSurveys); die;\n if ($this->ResellerProgramSurveys->save($resellerProgramSurveys)) {\n $this->set('resellerProgramSurveys', $resellerProgramSurveys);\n $this->set('response', ['status' => \"OK\"]);\n } else {\n //pr($resellerProgramSurveys->errors()); die;\n throw new InternalErrorException(__('Internal Error'));\n }\n $data =array();\n $data['status']=true;\n $data['data']['id']=$resellerProgramSurveys->id;\n $this->set('response',$data);\n $this->set('_serialize', ['response']);\n }", "public function add_reseller_program_survey_question()\n {\n $this->loadModel('ResellerProgramSurveyQuestions');\n if (!$this->request->is('post')) {\n throw new MethodNotAllowedException(__('BAD_REQUEST'));\n }\n $resellerProgramSurveyQuestion=$this->request->data;\n $resellerProgramSurveyQuestion = $this->ResellerProgramSurveyQuestions->newEntity($resellerProgramSurveyQuestion);\n if ($this->ResellerProgramSurveyQuestions->save($resellerProgramSurveyQuestion)) {\n $this->set('resellerProgramSurveyQuestion', $resellerProgramSurveyQuestion);\n $this->set('response', ['status' => \"OK\"]);\n } else {\n throw new InternalErrorException(__('Internal Error'));\n }\n $data =array();\n $data['status']=true;\n $data['data']['id']=$resellerProgramSurveyQuestion->id;\n $this->set('response',$data);\n $this->set('_serialize', ['response']);\n }", "protected function getVendorComplianceSurveyByIdRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getVendorComplianceSurveyById'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testCreateSurvey0()\n {\n }", "public function testCreateSurvey0()\n {\n }", "public function testGetVendorComplianceSurveyByFilter()\n {\n }", "public function testAddVendorComplianceSurveyFileByURL()\n {\n }", "protected function addVendorComplianceSurveyFileRequest($vendor_compliance_survey_id, $file_name)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyFile'\n );\n }\n // verify the required parameter 'file_name' is set\n if ($file_name === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $file_name when calling addVendorComplianceSurveyFile'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/file/{fileName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($file_name !== null) {\n $resourcePath = str_replace(\n '{' . 'fileName' . '}',\n ObjectSerializer::toPathValue($file_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updateVendorComplianceSurvey($body)\n {\n $this->updateVendorComplianceSurveyWithHttpInfo($body);\n }", "public function addVendorComplianceSurveyAsyncWithHttpInfo($body)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey';\n $request = $this->addVendorComplianceSurveyRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function test_can_vendor_create(){\n $data = [\n 'Name' => $this->faker->name,\n 'category' => $this->faker->category,\n ];\n\n $this->json('POST','/api/vendor_create',$data);\n }", "public function actionCreate($vendor_id)\n\t{\n\t\t//die('here');\n\t\t$w_id = '';\n\t\tif(isset(Yii::app()->session['w_id']) && !empty(Yii::app()->session['w_id'])){\n\t\t\t$w_id = Yii::app()->session['w_id'];\n\t\t}\n\t\tif(!$this->checkAccessByData('VendorCreditEditor', array('warehouse_id'=>$w_id))){\n\t\t\tYii::app()->user->setFlash('premission_info', 'You dont have permission.! Bitch');\n\t\t\tYii::app()->controller->redirect(\"index.php?r=vendor/admin&w_id=\".$w_id);\n\t\t}\n $initial_pending_date = VendorDao::getInitialPendingDate();\n\t\t$model=new VendorPayment;\n\t\t$model->vendor_id = $vendor_id;\n\t\t$vendor = Vendor::model()->findByPk($vendor_id);\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['VendorPayment']))\n\t\t{\n if(strtotime($_POST['VendorPayment']['date']) <= strtotime($initial_pending_date)){\n Yii::app()->user->setFlash('error', \"Can't create payment to be created before base_date. Please Ask Developer\" );\n Yii::app()->controller->redirect(\"index.php?r=vendorPayment/admin&w_id=\".$w_id);\n }\n\t\t\t$model->attributes=$_POST['VendorPayment'];\n\t\t\t$model->created_at = date('Y-m-d');\n\t\t\tif($model->save()){\n\t\t\t\t$vendor->total_pending_amount-= $model->paid_amount;\n\t\t\t\tif(!$vendor->save()){\n\t\t\t\t\techo '<pre>';\n\t\t\t\t\tdie(print_r($vendor->getErrors()));\n\t\t\t\t}\n\t\t\t\t$this->redirect(array('vendor/admin'));\n\t\t\t}\n\t\t}\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t\t'vendor' => $vendor,\n\t\t\t));\n\t}", "public function testVenueSubmitSurvey()\n {\n $this->buildVenueSurvey();\n\n $venueG = $this->venueGroup;\n $venueQ = $this->venueQuestion;\n\n $response = $this->json('POST', 'survey/submit', [\n 'slot_id' => $this->slot->id,\n 'type' => Survey::TRAINING,\n 'survey' => [\n [\n 'survey_group_id' => $venueG->id,\n 'answers' => [\n [\n 'survey_question_id' => $venueQ->id,\n 'response' => 'a response'\n ]\n ]\n ],\n ]\n ]);\n\n $response->assertStatus(200);\n\n $this->assertDatabaseHas('survey_answer', [\n 'person_id' => $this->user->id,\n 'slot_id' => $this->slot->id,\n 'survey_question_id' => $venueQ->id,\n 'response' => 'a response'\n ]);\n }", "private function buildVenueSurvey()\n {\n $this->year = current_year();\n\n $this->trainer = Person::factory()->create();\n\n $this->survey = Survey::factory()->create(['year' => $this->year, 'position_id' => Position::TRAINING]);\n $surveyId = $this->survey->id;\n\n $this->venueGroup = SurveyGroup::factory()->create(['survey_id' => $surveyId, 'sort_index' => 1]);\n $this->venueQuestion = SurveyQuestion::factory()->create(['survey_id' => $surveyId, 'survey_group_id' => $this->venueGroup->id]);\n\n $this->trainerGroup = SurveyGroup::factory()->create(['survey_id' => $surveyId, 'type' => 'trainer', 'sort_index' => 2]);\n $this->trainerQuestion = SurveyQuestion::factory()->create(['survey_id' => $surveyId, 'survey_group_id' => $this->trainerGroup->id]);\n\n $this->slot = Slot::factory()->create([\n 'description' => 'Venue 1',\n 'position_id' => Position::TRAINING,\n 'begins' => \"{$this->year}-01-01 00:00\",\n 'ends' => \"{$this->year}-01-01 00:01\"\n ]);\n PersonSlot::factory()->create(['person_id' => $this->user->id, 'slot_id' => $this->slot->id]);\n TraineeStatus::factory()->create(['person_id' => $this->user->id, 'slot_id' => $this->slot->id, 'passed' => true]);\n $this->trainerSlot = Slot::factory()->create([\n 'description' => 'Venue 1',\n 'position_id' => Position::TRAINER,\n 'begins' => \"{$this->year}-01-01 00:00\",\n 'ends' => \"{$this->year}-01-01 00:01\"\n ]);\n PersonSlot::factory()->create(['person_id' => $this->trainer->id, 'slot_id' => $this->trainerSlot->id]);\n TrainerStatus::factory()->create([\n 'person_id' => $this->trainer->id,\n 'slot_id' => $this->slot->id,\n 'trainer_slot_id' => $this->trainerSlot->id,\n 'status' => TrainerStatus::ATTENDED\n ]);\n }" ]
[ "0.7047817", "0.6537694", "0.61607873", "0.6111061", "0.6014949", "0.60021234", "0.5973309", "0.5960863", "0.5832383", "0.5815311", "0.58092386", "0.58035237", "0.5728759", "0.5726923", "0.57082355", "0.5653393", "0.56231815", "0.55713123", "0.55346024", "0.5522425", "0.5522425", "0.5449154", "0.5434106", "0.5409703", "0.5400502", "0.53976375", "0.53871757", "0.5356595", "0.5348249", "0.5346178" ]
0.67274946
1
Test case for addVendorComplianceSurveyAudit Add new audit for a vendorComplianceSurvey.
public function testAddVendorComplianceSurveyAudit() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function addVendorComplianceSurveyAuditRequest($vendor_compliance_survey_id, $vendor_compliance_survey_audit)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyAudit'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_audit' is set\n if ($vendor_compliance_survey_audit === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_audit when calling addVendorComplianceSurveyAudit'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/audit/{vendorComplianceSurveyAudit}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_audit !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyAudit' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_audit),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testAddVendorComplianceSurvey()\n {\n }", "public function testUpdateVendorComplianceSurvey()\n {\n }", "public function addVendorComplianceSurvey($body)\n {\n list($response) = $this->addVendorComplianceSurveyWithHttpInfo($body);\n return $response;\n }", "public function testAddVendorComplianceSurveyTag()\n {\n }", "public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }", "public function testGetDuplicateVendorComplianceSurveyById()\n {\n }", "public function testAddVendorComplianceSurveyFile()\n {\n }", "public function addVendorComplianceSurveyAuditAsync($vendor_compliance_survey_id, $vendor_compliance_survey_audit)\n {\n return $this->addVendorComplianceSurveyAuditAsyncWithHttpInfo($vendor_compliance_survey_id, $vendor_compliance_survey_audit)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function addVendorComplianceSurveyAuditWithHttpInfo($vendor_compliance_survey_id, $vendor_compliance_survey_audit)\n {\n $returnType = '';\n $request = $this->addVendorComplianceSurveyAuditRequest($vendor_compliance_survey_id, $vendor_compliance_survey_audit);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function addVendorComplianceSurveyAudit($vendor_compliance_survey_id, $vendor_compliance_survey_audit)\n {\n $this->addVendorComplianceSurveyAuditWithHttpInfo($vendor_compliance_survey_id, $vendor_compliance_survey_audit);\n }", "public function testGetVendorComplianceSurveyById()\n {\n }", "public function testDeleteVendorComplianceSurvey()\n {\n }", "public function addAudit(Audit $audit);", "protected function addVendorComplianceSurveyTagRequest($vendor_compliance_survey_id, $vendor_compliance_survey_tag)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyTag'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_tag' is set\n if ($vendor_compliance_survey_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_tag when calling addVendorComplianceSurveyTag'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/tag/{vendorComplianceSurveyTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyTag' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function test_addLegacyLowstockContactAudit() {\n\n }", "public function addVendorAudit($vendor_id, $vendor_audit)\n {\n list($response, $statusCode, $httpHeader) = $this->addVendorAuditWithHttpInfo ($vendor_id, $vendor_audit);\n return $response; \n }", "public function testGetVendorComplianceSurveyByFilter()\n {\n }", "public function testAddVendorComplianceSurveyFileByURL()\n {\n }", "public function addVendorComplianceSurveyAsync($body)\n {\n return $this->addVendorComplianceSurveyAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function addVendorComplianceSurveyWithHttpInfo($body)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey';\n $request = $this->addVendorComplianceSurveyRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 405:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Infoplus\\Infoplus\\Model\\ApiResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function add_reseller_program_survey_question()\n {\n $this->loadModel('ResellerProgramSurveyQuestions');\n if (!$this->request->is('post')) {\n throw new MethodNotAllowedException(__('BAD_REQUEST'));\n }\n $resellerProgramSurveyQuestion=$this->request->data;\n $resellerProgramSurveyQuestion = $this->ResellerProgramSurveyQuestions->newEntity($resellerProgramSurveyQuestion);\n if ($this->ResellerProgramSurveyQuestions->save($resellerProgramSurveyQuestion)) {\n $this->set('resellerProgramSurveyQuestion', $resellerProgramSurveyQuestion);\n $this->set('response', ['status' => \"OK\"]);\n } else {\n throw new InternalErrorException(__('Internal Error'));\n }\n $data =array();\n $data['status']=true;\n $data['data']['id']=$resellerProgramSurveyQuestion->id;\n $this->set('response',$data);\n $this->set('_serialize', ['response']);\n }", "function survey_add($d){\n $url = $this->url.\"survey_add\";\n $data['case_id'] =$d['case_id'] ;\n $data['satisfactoriness'] =$d['satisfactoriness'] ;\n $data['satisfied_reason'] =$d['satisfied_reason'] ;\n $data['submitter'] =$d['submitter'] ;\n $this->setTransactionToLog(\"method:\".__METHOD__);\n $result = $this->_exec($url,$data);\n }", "protected function getDuplicateVendorComplianceSurveyByIdRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getDuplicateVendorComplianceSurveyById'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/duplicate/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "private function ensure_auditing()\n {\n // ignore if auditing is not enabled\n $setting_manager = bus\\setting_manager::self();\n if( !$setting_manager->get_setting( 'audit_db', 'enabled' ) ) return;\n\n // check the primary key value\n $primary_key_name = static::get_primary_key_name();\n if( is_null( $this->$primary_key_name ) )\n {\n log::warning( 'Cannot ensure auditing for phase with no id.' );\n return;\n }\n \n // check the sid\n if( is_null( $this->sid ) )\n {\n log::warning( 'Cannot ensure auditing for phase with no sid.' );\n return;\n }\n \n $survey_table = $setting_manager->get_setting( 'survey_db', 'prefix' ).'survey_'.$this->sid;\n $audit_table = $setting_manager->get_setting( 'audit_db', 'prefix' ).'survey_'.$this->sid;\n\n // check to see if the audit table already exists\n $count = static::db()->get_one( sprintf(\n ' SELECT COUNT(*)'.\n ' FROM information_schema.TABLES'.\n ' WHERE TABLE_SCHEMA = %s'.\n ' AND TABLE_NAME = %s',\n database::format_string( $setting_manager->get_setting( 'audit_db', 'database' ) ),\n database::format_string( $audit_table ) ) );\n \n if( 0 == $count )\n {\n $audit_db = bus\\session::self()->get_audit_database();\n $survey_db = bus\\session::self()->get_survey_database();\n\n // get the survey table's create syntax\n $row = $survey_db->get_row( 'SHOW CREATE TABLE '.$survey_table );\n $sql = $row['Create Table'];\n\n // add a timestamp\n $insert_pos = strpos( $sql, '`submitdate`' );\n $insert_sql =\n substr( $sql, 0, $insert_pos ).\n '`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP'.\n \" ON UPDATE CURRENT_TIMESTAMP,\\n\".\n substr( $sql, $insert_pos );\n\n // remove the auto increment\n $insert_sql = preg_replace( '/ AUTO_INCREMENT(=[0-9]+)?/', '', $insert_sql );\n\n // remove the primary key\n $insert_sql = str_replace( \",\\nPRIMARY KEY (`id`)\", '', $insert_sql );\n\n // set the table name\n $insert_sql = preg_replace( '/`'.$survey_table.'` \\(\\n/',\n '`'.$audit_table.\"` ( \\n\", $insert_sql );\n\n $audit_db->execute( $insert_sql );\n\n // TODO: need to add the trigger\n }\n }", "function add()\n\t{\n\t\t$companies = $this->company_model->get_many_by(array('active_status' => 1));\n\t\t$violation_levels = $this->violation_level_model->get_many_by(array('active_status' => 1));\n\t\t$violation_types = $this->violation_type_model->get_many_by(array('active_status' => 1));\n\t\t\n\t\t$this->data = array(\n 'page_header' \t=> 'Add New Violation',\n 'notification' \t=> array(\"sound\"=>false),\n\t\t\t'companies'\t\t=> $companies,\n\t\t\t'violation_levels'\t=>$violation_levels,\n\t\t\t'violation_types'\t=>$violation_types\n );\n\t\t$this->load_view('forms/violation-add');\n\t}", "public function addVendorComplianceSurveyAuditAsyncWithHttpInfo($vendor_compliance_survey_id, $vendor_compliance_survey_audit)\n {\n $returnType = '';\n $request = $this->addVendorComplianceSurveyAuditRequest($vendor_compliance_survey_id, $vendor_compliance_survey_audit);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function test_addCustomerAudit() {\n\n }", "public function testAddConsent(): void\n\t{\n\t\t$request = $this->httpClient->post('ApprovalsRegister/Record', \\App\\Utils::merge(['json' => [\n\t\t\t'subject' => 'Text',\n\t\t\t'approvalsid' => self::$approvalId,\n\t\t\t'contactid' => self::$recordId,\n\t\t\t'approvals_register_type' => 'PLL_ACCEPTANCE',\n\t\t\t'approvals_register_status' => 'PLL_ACCEPTED',\n\t\t\t'registration_date' => date('Y-m-d H:i:s'),\n\t\t]], self::$requestOptions));\n\t\t$this->logs = $body = $request->getBody()->getContents();\n\t\t$response = \\App\\Json::decode($body);\n\t\tstatic::assertSame(200, $request->getStatusCode(), 'ApprovalsRegister/RecordAPI error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);\n\t\tstatic::assertSame(1, $response['status'], 'ApprovalsRegister/Record API error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);\n\t\tstatic::assertNotEmpty($response['result'], 'ApprovalsRegister/Record result is empty and should have at least one entry.');\n\t\tstatic::assertNotEmpty($response['result']['id'], 'ApprovalsRegister/Record record should not be empty');\n\t\tself::assertResponseBodyMatch($response, self::$schemaManager, '/webservice/ManageConsents/ApprovalsRegister/Record', 'post', 200);\n\t\t\\ApprovalsRegister_Module_Model::reloadApprovals(self::$recordId);\n\t}", "public function testGetVendorComplianceSurveyFiles()\n {\n }" ]
[ "0.70903134", "0.6212814", "0.61721814", "0.6085663", "0.58962935", "0.57401407", "0.57172084", "0.570038", "0.56519437", "0.56224126", "0.55424285", "0.5507082", "0.5494336", "0.5437067", "0.53705806", "0.52649516", "0.5234765", "0.5205509", "0.5186142", "0.5152541", "0.509666", "0.5080372", "0.5059036", "0.5055914", "0.5055309", "0.5049971", "0.5037004", "0.5025901", "0.500429", "0.49790755" ]
0.68058395
1
Test case for addVendorComplianceSurveyFile Attach a file to a vendorComplianceSurvey.
public function testAddVendorComplianceSurveyFile() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function addVendorComplianceSurveyFileRequest($vendor_compliance_survey_id, $file_name)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyFile'\n );\n }\n // verify the required parameter 'file_name' is set\n if ($file_name === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $file_name when calling addVendorComplianceSurveyFile'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/file/{fileName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($file_name !== null) {\n $resourcePath = str_replace(\n '{' . 'fileName' . '}',\n ObjectSerializer::toPathValue($file_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function addVendorComplianceSurveyFileByURLRequest($body, $vendor_compliance_survey_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling addVendorComplianceSurveyFileByURL'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyFileByURL'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testAddVendorComplianceSurveyFileByURL()\n {\n }", "protected function deleteVendorComplianceSurveyFileRequest($vendor_compliance_survey_id, $file_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling deleteVendorComplianceSurveyFile'\n );\n }\n // verify the required parameter 'file_id' is set\n if ($file_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $file_id when calling deleteVendorComplianceSurveyFile'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/file/{fileId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($file_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fileId' . '}',\n ObjectSerializer::toPathValue($file_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testGetVendorComplianceSurveyFiles()\n {\n }", "public function testDeleteVendorComplianceSurveyFile()\n {\n }", "protected function getVendorComplianceSurveyFilesRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getVendorComplianceSurveyFiles'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testIsVendorFileReturnsTrueIfFileIsLocatedInVendorDirectory()\n {\n $this->assertTrue(VendorResources::isVendorFile($this->getVendorFilePath()));\n }", "public function testIsVendorFileReturnsTrueIfFileThatIsReferencedByFileObjectIsLocatedInVendorDirectory()\n {\n $this->assertTrue(VendorResources::isVendorFile(new \\SplFileInfo($this->getVendorFilePath())));\n }", "public function testUpdateVendorComplianceSurvey()\n {\n }", "public function attach_file($file){\n\t \t\t//ERROR CHECKNG , SET OJESCT ATTRIBUTESss\n\t \t\tif(!$file || empty($file) || !is_array($file)){\n\t \t\t\t$this->errors[] = \"No file was uploaded. \";\n\t \t\t\treturn false;\n\t \t\t}elseif($file['error'] != 0){\n\t \t\t\t$this->errors[] = $this->upload->errors[$file['error']];\n\t \t\t\treturn false;\n\t \t\t}else{\n\t \t\t\tif (!isset($this->testimony_id)) \n\t \t\t\t\t$this->setTestimonyid();\n\n\t \t\t\t$this->temp_path = $file['tmp_name'];\n\t \t\t\t$this->passport = str_replace(\"/\", \"_\", $this->testimony_id).\".\".basename($file[\"type\"]);\n\t \t\t\t$this->type = $file['type'];\n\t \t\t\t$this->size = $file['size'];\n\t \t\t\treturn true;\n\t \t\t}\n\t \t}", "public function addVendorComplianceSurveyFileAsync($vendor_compliance_survey_id, $file_name)\n {\n return $this->addVendorComplianceSurveyFileAsyncWithHttpInfo($vendor_compliance_survey_id, $file_name)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function addVendorComplianceSurveyFile($vendor_compliance_survey_id, $file_name)\n {\n $this->addVendorComplianceSurveyFileWithHttpInfo($vendor_compliance_survey_id, $file_name);\n }", "public function attach_file($file){\n\t \t\t//ERROR CHECKNG , SET OJESCT ATTRIBUTESss\n\t \t\tif(!$file || empty($file) || !is_array($file)){\n\t \t\t\t$this->errors[] = \"No file was uploaded. \";\n\t \t\t\treturn false;\n\t \t\t}elseif($file['error'] != 0){\n\t \t\t\t$this->errors[] = $this->upload->errors[$file['error']];\n\t \t\t\treturn false;\n\t \t\t}else{\n\t \t\t\tif (!isset($this->interview_id)) \n\t \t\t\t\t$this->setInterviewid();\n\n\t \t\t\t$this->temp_path = $file['tmp_name'];\n\t \t\t\t$this->passport = str_replace(\"/\", \"_\", $this->interview_id).\".\".basename($file[\"type\"]);\n\t \t\t\t$this->type = $file['type'];\n\t \t\t\t$this->size = $file['size'];\n\t \t\t\treturn true;\n\t \t\t}\n\t \t}", "protected function addVendorComplianceSurveyAuditRequest($vendor_compliance_survey_id, $vendor_compliance_survey_audit)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyAudit'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_audit' is set\n if ($vendor_compliance_survey_audit === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_audit when calling addVendorComplianceSurveyAudit'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/audit/{vendorComplianceSurveyAudit}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_audit !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyAudit' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_audit),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testAddVendorComplianceSurvey()\n {\n }", "public function attach_file($file) {\r\n // Perform error checking on the form parameters\r\n if(!$file || empty($file) || !is_array($file)) {\r\n // error: nothing uploaded or wrong argument usage\r\n $this->errors[] = \"No file was uploaded.\";\r\n return FALSE;\r\n } elseif ($file['error'] != 0 ) {\r\n // error: report what PHP says went wrong\r\n $this->errors[] = $this->upload_errors[$file['error']];\r\n return FALSE;\r\n } else {\r\n // Set object attributes to the form parameters.\r\n $this->temp_path = $file['tmp_name'];\r\n $this->passport_path = basename($file['name']);\r\n\r\n return TRUE;\r\n }\r\n }", "public function testIsVendorFileReturnsTrueIfVendorDirectoryIsProvided()\n {\n $directory = dirname($this->getVendorFilePath());\n $this->assertTrue(VendorResources::isVendorFile($directory));\n }", "public function uploadFileVendors(){\r\n\r\n $file = Input::file('file');\r\n $vendorId = Input::get('CONSULTANT');\r\n $consultantVendor = Consultant::find($vendorId);\r\n $rol = $this->getRol($vendorId);\r\n $projectId = Input::get('PROJECT');\r\n $now = new \\DateTime('now');\r\n if($projectId != 0){\r\n $project = Project::find($projectId);\r\n if($project!=null){\r\n if($file){\r\n $fileName = $file->getClientOriginalName();\r\n $file->move(public_path().'/files/projects/'.$project->lead->fileno.'/'.$project->id.'/vendors', $fileName);\r\n\r\n //create the row in upload file\r\n $uploadFile = UploadedFiles::where(['fileName'=>$fileName,'admin_id'=>$vendorId,'project_id'=>$projectId])->first();\r\n if($uploadFile != null){\r\n $uploadFile->delete();\r\n }\r\n $uploadFile = new UploadedFiles();\r\n $uploadFile->project_id = $projectId;\r\n $uploadFile->url = \"files/projects/\".$project->lead->fileno.\"/\".$project->id.\"/vendors/$fileName\";\r\n $uploadFile->fileName = $fileName;\r\n $uploadFile->$rol = 1;\r\n $uploadFile->admin_id = $vendorId;\r\n $uploadFile->ip = $_SERVER[\"REMOTE_ADDR\"];\r\n $uploadFile->save();\r\n\r\n //complete the row for that project.\r\n $projectVendor = ProjectProduction::where(['consultant_id'=>$vendorId,'project_id'=>$projectId])->where('completed','<>',1)->first();\r\n if($projectVendor!=null){\r\n $projectVendor->completed = 1;\r\n $projectVendor->completedDate = $now->format(\"Y-m-d H:i:s\");\r\n $projectVendor->save();\r\n }\r\n\r\n //create the row in inbox to let Production know\r\n $msg = \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msg .= \"Pin: \".$project->id.\"\\r\\n\";\r\n $msg .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n $msg .= \"File Name: \".$fileName.\"\\r\\n\";\r\n\r\n $extArray = explode(\".\",$fileName);\r\n $ext = $extArray[count($extArray)-1];\r\n\r\n //let consultant and production know that the patent search was uploaded be the attorney\r\n if($consultantVendor != null){\r\n if(strpos($consultantVendor->rol, 'attorney')!== false){\r\n $uploadFile->internal = 1;\r\n $uploadFile->save();\r\n if($ext == 'doc'|| $ext == 'docx'){\r\n Inbox::createInbox($project->lead->id, $project->consultant_id, \"Patent Search uploaded by the attorney.\\r\\n\".$msg, 'PRODUCTION', 'PRODUCTION');\r\n Inbox::createInbox($project->lead->id, 30, \"Patent Search uploaded by the attorney.\\r\\n\".$msg, 'FILE UPLOADED', 'PRODUCTION');\r\n Transaction::createTransaction($vendorId,'','','UPLOAD_FILE_VENDOR','Patent Search: '.$fileName,$projectId,'','','','','');\r\n }\r\n }else{\r\n //if is not an attorney let production know\r\n Inbox::createInbox($project->lead->id, 30, \"File uploaded By Vendor.\\r\\n\".$msg, 'FILE UPLOADED', 'PRODUCTION');\r\n Transaction::createTransaction($vendorId,'','','UPLOAD_FILE_VENDOR',$fileName,$projectId,'','','','','');\r\n }\r\n }\r\n }\r\n }\r\n }else{\r\n if($file){\r\n $fileName = $file->getClientOriginalName();\r\n $myProjects = ProjectProduction::where(['consultant_id'=>$vendorId])->where('completed','<>',1)->get();\r\n foreach($myProjects as $projectVendor){\r\n $project = $projectVendor->project;\r\n if(strpos(strval($fileName),strval($project->lead->fileno)) !== false){\r\n $file->move(public_path().'/files/projects/'.$project->lead->fileno.'/'.$project->id.'/vendors', $fileName);\r\n //create the row in upload file\r\n $uploadFile = UploadedFiles::where(['fileName'=>$fileName,'admin_id'=>$vendorId,'project_id'=>$project->id])->first();\r\n if($uploadFile != null){\r\n $uploadFile->delete();\r\n }\r\n $uploadFile = new UploadedFiles();\r\n $uploadFile->project_id = $project->id;\r\n $uploadFile->url = \"files/projects/\".$project->lead->fileno.\"/\".$project->id.\"/vendors/$fileName\";\r\n $uploadFile->fileName = $fileName;\r\n $uploadFile->$rol = 1;\r\n $uploadFile->admin_id = $vendorId;\r\n $uploadFile->save();\r\n\r\n $projectVendor->completed = 1;\r\n $projectVendor->completedDate = $now->format(\"Y-m-d H:i:s\");\r\n $projectVendor->save();\r\n\r\n //create the row in inbox to let Production know\r\n $msg = \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msg .= \"Pin: \".$project->id.\"\\r\\n\";\r\n $msg .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n $msg .= \"File Name: \".$fileName.\"\\r\\n\";\r\n Inbox::createInbox($project->lead->id, 30, \"File uploaded By Vendor.\\r\\n\".$msg, 'FILE UPLOADED', 'PRODUCTION');\r\n\r\n\r\n $extArray = explode(\".\",$fileName);\r\n $ext = $extArray[count($extArray - 1)];\r\n //let consultant know that the patent search was uploaded be the attorney\r\n if($consultantVendor != null && strpos($consultantVendor->rol, 'attorney')!== false && ($ext == 'doc'|| $ext == 'docx')){\r\n Inbox::createInbox($project->lead->id, $project->consultant_id, \"Patent Search uploaded for the attorney.\\r\\n\".$msg, 'PRODUCTION', 'PRODUCTION');\r\n $uploadFile->internal = 1;\r\n $uploadFile->save();\r\n }\r\n\r\n Transaction::createTransaction($vendorId,'','','UPLOAD_FILE_VENDOR',$fileName,$project->id,'','','','','');\r\n }\r\n }\r\n }\r\n }\r\n\r\n }", "public function addVendorComplianceSurveyFileWithHttpInfo($vendor_compliance_survey_id, $file_name)\n {\n $returnType = '';\n $request = $this->addVendorComplianceSurveyFileRequest($vendor_compliance_survey_id, $file_name);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }", "public function addVendorComplianceSurvey($body)\n {\n list($response) = $this->addVendorComplianceSurveyWithHttpInfo($body);\n return $response;\n }", "public function addFile($file);", "public function add_case_study_via_file($deal_id,$mem_id,$partner_id,$partner_type,$caption,$access_rule_code,$file_field_name,$file_destination_path,$is_approved,&$validation_passed,&$err_arr){\n\t\t$validation_passed = true;\n\t\t\n\t\t//validation\n\t\tif($partner_id == \"\"){\n\t\t\t$validation_passed = false;\n\t\t\t$err_arr['partner_id'] = \"Please specify the partner\";\n\t\t}\n\t\tif($caption == \"\"){\n\t\t\t$validation_passed = false;\n\t\t\t$err_arr['caption'] = \"Please specify a caption\";\n\t\t}\n\t\tif($_FILES[$file_field_name]['name']==\"\"){\n\t\t\t$validation_passed = false;\n\t\t\t$err_arr['filename'] = \"Please specify the file\";\n\t\t}else{\n\t\t\t/*******************************************************************\n\t\t\tsng:17/Nov/2011\n\t\t\tfilename specified, get the extension and check against the list\n\t\t\tof accepted extensions\n\t\t\t***********/\n\t\t\t$file_extension = get_file_extension($_FILES[$file_field_name]['name']);\n\t\t\t$valid_filetypes = $this->file_extensions_for_case_studies();\n\t\t\tif(!array_key_exists($file_extension,$valid_filetypes)){\n\t\t\t\t$validation_passed = false;\n\t\t\t\t$err_arr['filename'] = \"Files of this type is not accepted\";\n\t\t\t}\n\t\t}\n\t\tif(!$validation_passed){\n\t\t\treturn true;\n\t\t}\n\t\t//basic validation passed passed, now check if the firm was in the deal\n\t\t$q = \"select count(*) as cnt from \".TP.\"transaction_partners where transaction_id='\".$deal_id.\"' and partner_id='\".$partner_id.\"' and partner_type='\".$partner_type.\"'\";\n\t\t$res = mysql_query($q);\n\t\tif(!$res){\n\t\t\treturn false;\n\t\t}\n\t\t$row = mysql_fetch_assoc($res);\n\t\tif(0 == $row['cnt']){\n\t\t\t//not found, this firm did not worked in this deal\n\t\t\t$validation_passed = false;\n\t\t\t$err_arr['partner_id'] = \"This firm was not involved in the deal\";\n\t\t}\n\t\t//check again\n\t\tif(!$validation_passed){\n\t\t\treturn true;\n\t\t}\n\t\t//validation passed\n\t\t//be careful with space in file name\n\t\t$upload_file_name = time().\"_\".clean_filename(basename($_FILES[$file_field_name]['name']));\n\t\t$upload_path = $file_destination_path.\"/\".$upload_file_name;\n\t\t$upload_src = $_FILES[$file_field_name]['tmp_name'];\n\t\t$success = move_uploaded_file($upload_src,$upload_path);\n\t\tif(!$success){\n\t\t\treturn false;\n\t\t}\n\t\t//file uploaded, insert data\n\t\t$q = \"insert into \".TP.\"transaction_case_studies set transaction_id='\".$deal_id.\"',mem_id='\".$mem_id.\"',partner_id='\".$partner_id.\"',partner_type='\".$partner_type.\"',caption='\".$caption.\"',access_rule_code='\".$access_rule_code.\"',filename='\".$upload_file_name.\"',uploaded_on='\".date('Y-m-d').\"',is_approved='\".$is_approved.\"'\";\n\t\t$result = mysql_query($q);\n\t\tif(!$result){\n\t\t\t//echo mysql_error();\n\t\t\treturn false;\n\t\t}\n\t\t//data inserted\n\t\t/*******************************\n\t\tsng:18/nov/2011\n\t\tNotify admin that a case study has been uploaded. Problem is, we have many admins.\n\t\tSo let us send the email to a site email. We cannot use the curent admin id because\n\t\tnow admin no longer upload case study. This code is triggered by front end.\n\t\t*******************************/\n\t\t\n\t\trequire_once(\"classes/class.sitesetup.php\");\n\t\tglobal $g_site;\n\t\t$site_emails = NULL;\n\t\t$success = $g_site->get_site_emails($site_emails);\n\t\tif(!$success){\n\t\t\t//do not bother\n\t\t\treturn true;\n\t\t}\n\t\t$to = $site_emails['contact_email'];\n\t\t$from = $site_emails['mem_related_email'];\n\t\t\n\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t$headers .= 'Content-type: text/plain;charset=iso-8859-1' . \"\\r\\n\";\n\t\t$headers .= \"From: \".$from.\"\\r\\n\";\n\t\t\n\t\t$subject = \"data-cx.com case study uploaded\";\n\t\t\n\t\t\n\t\t$msg = \"A case study has been uploaded. The details are:\\r\\n\";\n\t\t$msg.=\"Caption: \".$caption.\"\\r\\n\";\n\t\t$msg.=\"Filename: \".$upload_file_name.\"\\r\\n\";\n\t\t\n\t\trequire_once(\"classes/class.mailer.php\");\n\t\t$mailer = new mailer();\n\t\t\n\t\t$to = $work_email;\n\t\t/**********\n\t\tsng:18/nov/2011\n\t\tIgnore mailer exception\n\t\t**************/\n\t\ttry{\n\t\t\t$mailer->mail($to,$subject,$msg);\n\t\t}catch(Exception $e){}\n\t\treturn true;\n\t}", "public function addVendorComplianceSurveyFileAsyncWithHttpInfo($vendor_compliance_survey_id, $file_name)\n {\n $returnType = '';\n $request = $this->addVendorComplianceSurveyFileRequest($vendor_compliance_survey_id, $file_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "abstract public function attachFile($filePath, $name = null);", "public function attach_file($file){\n\t\tif(!$file || empty($file) || !is_array($file)) {\n\t\t\t // error: nothing uploaded or wrong argument usage\n\t\t\t $this->errors[] = \"No file was uploaded.\";\n\t\t\t return false;\n\t\t} elseif($file['error'] != 0) {\n\t\t\t // error: report what PHP says went wrong\n\t\t\t $this->errors[] = $this->upload_errors[$file['error']];\n\t\t\t return false;\n\t\t} else {\n\t\t\t//set object attributes\n\t\t\t $this->temp_path = $file['tmp_name'];\n\t\t\t\t$this->filename = basename($file['name']);\n\t\t\t\t$this->type = $file['type'];\n\t\t\t\t$this->size = $file['size'];\n\t\t\t\treturn true;\n\t\t}\n\t\t\n\t}", "public function testIsVendorFileReturnsFalseIfFileIsNotLocatedInVendorDirectory()\n {\n $this->assertFalse(VendorResources::isVendorFile(__FILE__));\n }", "protected function add_valid_file( $file ) {\r\n\t\t\t$file['isvalid'] = true;\r\n\t\t\t$file['name'] = ( empty( $file['name'] ) ) ? self::uniqString() : $file['name'];\r\n\t\t\t\r\n\t\t\t$this->Files_valid[] = $file;\r\n\t\t\t$this->Files_valid_count++;\r\n\t\t}", "public function addVendorComplianceSurveyAsync($body)\n {\n return $this->addVendorComplianceSurveyAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }" ]
[ "0.7099123", "0.6453667", "0.6424213", "0.5979541", "0.5956533", "0.5840125", "0.5657401", "0.56251615", "0.5587976", "0.55585176", "0.5544165", "0.54320997", "0.5431144", "0.54178476", "0.5410682", "0.5382054", "0.5372956", "0.53595155", "0.5335313", "0.53324795", "0.5315624", "0.53032243", "0.5281137", "0.5256384", "0.51951855", "0.51800394", "0.515328", "0.5141675", "0.5132355", "0.51276326" ]
0.66960925
1
Test case for addVendorComplianceSurveyFileByURL Attach a file to a vendorComplianceSurvey by URL..
public function testAddVendorComplianceSurveyFileByURL() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddVendorComplianceSurveyFile()\n {\n }", "protected function addVendorComplianceSurveyFileByURLRequest($body, $vendor_compliance_survey_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling addVendorComplianceSurveyFileByURL'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyFileByURL'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testAddExternalShipmentFileByURL()\n {\n }", "public function testAddReplenishmentFileByURL()\n {\n }", "public function testGetVendorComplianceSurveyFiles()\n {\n }", "public function testAddPackingPlanFileByURL()\n {\n }", "protected function addVendorComplianceSurveyFileRequest($vendor_compliance_survey_id, $file_name)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyFile'\n );\n }\n // verify the required parameter 'file_name' is set\n if ($file_name === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $file_name when calling addVendorComplianceSurveyFile'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/file/{fileName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($file_name !== null) {\n $resourcePath = str_replace(\n '{' . 'fileName' . '}',\n ObjectSerializer::toPathValue($file_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function add_case_study_via_file($deal_id,$mem_id,$partner_id,$partner_type,$caption,$access_rule_code,$file_field_name,$file_destination_path,$is_approved,&$validation_passed,&$err_arr){\n\t\t$validation_passed = true;\n\t\t\n\t\t//validation\n\t\tif($partner_id == \"\"){\n\t\t\t$validation_passed = false;\n\t\t\t$err_arr['partner_id'] = \"Please specify the partner\";\n\t\t}\n\t\tif($caption == \"\"){\n\t\t\t$validation_passed = false;\n\t\t\t$err_arr['caption'] = \"Please specify a caption\";\n\t\t}\n\t\tif($_FILES[$file_field_name]['name']==\"\"){\n\t\t\t$validation_passed = false;\n\t\t\t$err_arr['filename'] = \"Please specify the file\";\n\t\t}else{\n\t\t\t/*******************************************************************\n\t\t\tsng:17/Nov/2011\n\t\t\tfilename specified, get the extension and check against the list\n\t\t\tof accepted extensions\n\t\t\t***********/\n\t\t\t$file_extension = get_file_extension($_FILES[$file_field_name]['name']);\n\t\t\t$valid_filetypes = $this->file_extensions_for_case_studies();\n\t\t\tif(!array_key_exists($file_extension,$valid_filetypes)){\n\t\t\t\t$validation_passed = false;\n\t\t\t\t$err_arr['filename'] = \"Files of this type is not accepted\";\n\t\t\t}\n\t\t}\n\t\tif(!$validation_passed){\n\t\t\treturn true;\n\t\t}\n\t\t//basic validation passed passed, now check if the firm was in the deal\n\t\t$q = \"select count(*) as cnt from \".TP.\"transaction_partners where transaction_id='\".$deal_id.\"' and partner_id='\".$partner_id.\"' and partner_type='\".$partner_type.\"'\";\n\t\t$res = mysql_query($q);\n\t\tif(!$res){\n\t\t\treturn false;\n\t\t}\n\t\t$row = mysql_fetch_assoc($res);\n\t\tif(0 == $row['cnt']){\n\t\t\t//not found, this firm did not worked in this deal\n\t\t\t$validation_passed = false;\n\t\t\t$err_arr['partner_id'] = \"This firm was not involved in the deal\";\n\t\t}\n\t\t//check again\n\t\tif(!$validation_passed){\n\t\t\treturn true;\n\t\t}\n\t\t//validation passed\n\t\t//be careful with space in file name\n\t\t$upload_file_name = time().\"_\".clean_filename(basename($_FILES[$file_field_name]['name']));\n\t\t$upload_path = $file_destination_path.\"/\".$upload_file_name;\n\t\t$upload_src = $_FILES[$file_field_name]['tmp_name'];\n\t\t$success = move_uploaded_file($upload_src,$upload_path);\n\t\tif(!$success){\n\t\t\treturn false;\n\t\t}\n\t\t//file uploaded, insert data\n\t\t$q = \"insert into \".TP.\"transaction_case_studies set transaction_id='\".$deal_id.\"',mem_id='\".$mem_id.\"',partner_id='\".$partner_id.\"',partner_type='\".$partner_type.\"',caption='\".$caption.\"',access_rule_code='\".$access_rule_code.\"',filename='\".$upload_file_name.\"',uploaded_on='\".date('Y-m-d').\"',is_approved='\".$is_approved.\"'\";\n\t\t$result = mysql_query($q);\n\t\tif(!$result){\n\t\t\t//echo mysql_error();\n\t\t\treturn false;\n\t\t}\n\t\t//data inserted\n\t\t/*******************************\n\t\tsng:18/nov/2011\n\t\tNotify admin that a case study has been uploaded. Problem is, we have many admins.\n\t\tSo let us send the email to a site email. We cannot use the curent admin id because\n\t\tnow admin no longer upload case study. This code is triggered by front end.\n\t\t*******************************/\n\t\t\n\t\trequire_once(\"classes/class.sitesetup.php\");\n\t\tglobal $g_site;\n\t\t$site_emails = NULL;\n\t\t$success = $g_site->get_site_emails($site_emails);\n\t\tif(!$success){\n\t\t\t//do not bother\n\t\t\treturn true;\n\t\t}\n\t\t$to = $site_emails['contact_email'];\n\t\t$from = $site_emails['mem_related_email'];\n\t\t\n\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t$headers .= 'Content-type: text/plain;charset=iso-8859-1' . \"\\r\\n\";\n\t\t$headers .= \"From: \".$from.\"\\r\\n\";\n\t\t\n\t\t$subject = \"data-cx.com case study uploaded\";\n\t\t\n\t\t\n\t\t$msg = \"A case study has been uploaded. The details are:\\r\\n\";\n\t\t$msg.=\"Caption: \".$caption.\"\\r\\n\";\n\t\t$msg.=\"Filename: \".$upload_file_name.\"\\r\\n\";\n\t\t\n\t\trequire_once(\"classes/class.mailer.php\");\n\t\t$mailer = new mailer();\n\t\t\n\t\t$to = $work_email;\n\t\t/**********\n\t\tsng:18/nov/2011\n\t\tIgnore mailer exception\n\t\t**************/\n\t\ttry{\n\t\t\t$mailer->mail($to,$subject,$msg);\n\t\t}catch(Exception $e){}\n\t\treturn true;\n\t}", "public function testAddItemSubCategoryFileByURL()\n {\n }", "public function testDeleteVendorComplianceSurveyFile()\n {\n }", "public function testAddLowStockFileByURL()\n {\n }", "function testVerifyFileSubmission()\n {\n $this->deleteLog($this->logfilename);\n //Verify file exists in the database\n $query = $this->db->query(\"SELECT buildid, fileid FROM build2uploadfile\");\n if(count($query) == 0)\n {\n $this->fail('No build2upload records were added to the database');\n return;\n }\n $this->BuildId = $query[0]['buildid'];\n\n $content = $this->connect($this->url.\"/viewFiles.php?buildid=$this->BuildId\");\n if(!$content)\n {\n return;\n }\n \n $this->assertClickable('http://www.kitware.com/company/about.html');\n \n $this->clickLink('CMakeCache.txt');\n if(!$this->checkLog($this->logfilename))\n {\n return;\n }\n\n //Verify symlink and content exist on disk\n $query = $this->db->query(\"SELECT id, sha1sum FROM uploadfile WHERE filename='CMakeCache.txt'\");\n if(count($query) == 0)\n {\n $this->fail('CMakeCache.txt was not added to the uploadfile table');\n return;\n }\n $this->FileId = $query[0]['id'];\n $this->Sha1Sum = $query[0]['sha1sum'];\n\n global $cdashpath;\n global $CDASH_DOWNLOAD_RELATIVE_URL;\n $dirName = $cdashpath.'/'.$CDASH_DOWNLOAD_RELATIVE_URL.'/'.$this->Sha1Sum;\n if(!is_dir($dirName))\n {\n $this->fail(\"Directory $dirName was not created\");\n return;\n }\n if(!file_exists($dirName.'/'.$this->Sha1Sum))\n {\n $this->fail(\"File contents were not written to $dirName/$this->Sha1Sum\");\n return;\n }\n if(!file_exists($dirName.'/CMakeCache.txt'))\n {\n $this->fail(\"File symlink was not written to $dirName/CMakeCache.txt\");\n return;\n }\n $this->pass('Uploaded file exists in database and on disk');\n }", "public function attach_file($file){\n\t \t\t//ERROR CHECKNG , SET OJESCT ATTRIBUTESss\n\t \t\tif(!$file || empty($file) || !is_array($file)){\n\t \t\t\t$this->errors[] = \"No file was uploaded. \";\n\t \t\t\treturn false;\n\t \t\t}elseif($file['error'] != 0){\n\t \t\t\t$this->errors[] = $this->upload->errors[$file['error']];\n\t \t\t\treturn false;\n\t \t\t}else{\n\t \t\t\tif (!isset($this->testimony_id)) \n\t \t\t\t\t$this->setTestimonyid();\n\n\t \t\t\t$this->temp_path = $file['tmp_name'];\n\t \t\t\t$this->passport = str_replace(\"/\", \"_\", $this->testimony_id).\".\".basename($file[\"type\"]);\n\t \t\t\t$this->type = $file['type'];\n\t \t\t\t$this->size = $file['size'];\n\t \t\t\treturn true;\n\t \t\t}\n\t \t}", "private function submitFile()\n {\n\n $encoded_url = urlencode($this->getFileUrl());\n\n wp_remote_get(self::GOOGLE_WEBMASTER_TOOLS_URL . $encoded_url);\n wp_remote_get(self::BING_WEBMASTER_TOOLS_URL . $encoded_url);\n\n }", "public function add_file_from_url( $url ) {\r\n\t\t\t$url = ( substr( $url, 0, 4 ) !== 'http' ) ? 'http://' . str_replace( '//', '', $url ) : $url;\r\n\t\t\t\r\n\t\t\t$file = self::FILE_OBJECT_TEMPLATE;\r\n\t\t\t$file['path'] = $url;\r\n\t\t\t$file['origname'] = $url;\r\n\t\t\t$file['name'] = self::strip_to_valid_filename( substr( strrchr( $url, '/' ), 1 ) );\r\n\t\t\t$file['isurl'] = true;\r\n\t\t\t\r\n\t\t\t$this->process_file_add( $file, true );\r\n\t\t}", "function setPurchaseInvoiceCreditNoteAttachment() {\n header('Content-Type:application/json; charset=utf-8');\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"SET NAMES utf8\";\n $this->q->fast($sql);\n }\n $sql = null;\n $qqfile = null;\n $uploader = new \\qqFileUploader($this->getAllowedExtensions(), $this->getSizeLimit());\n $result = $uploader->handleUpload($this->getUploadPath());\n if (isset($_GET['qqfile'])) {\n $qqfile = $_GET['qqfile'];\n }\n// to pass data through iframe you will need to encode all html tags\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n INSERT INTO `purchaseinvoicecreditnotetemp`(\n `companyId`,\n `staffId`,\n `leafId`,\n `purchaseInvoiceCreditNoteTempName`, \n `isNew`, \n `executeBy`, \n `executeTime`\n ) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->getStaffId() . \"',\n 120,\n '\" . $this->strict($qqfile, 'w') . \"',\n 1,\n '\" . $_SESSION['staffId'] . \"',NOW())\";\n } else if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n INSERT INTO [purchaseInvoiceCreditNoteTemp](\n [companyId],\n [staffId],\n [leafId],\n [purchaseInvoiceCreditNoteTempName],\n [isNew],\n [executeBy],\n [executeTime]\n ) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->getStaffId() . \"',\n 120,\n '\" . $this->strict($_GET['qqfile'], 'w') . \"',\n 1,\n '\" . $_SESSION['staffId'] . \"',NOW())\";\n } else if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n INSERT INTO PURCHASEINVOICECREDITNOTETEMP(\n COMPANYID,\n STAFFID,\n LEAFID,\n PURCHASEINVOICECREDITNOTETEMPNAME,\n ISNEW,\n EXECUTEBY,\n EXECUTETIME\n ) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->getStaffId() . \"',\n 120,\n '\" . $this->strict($_GET['qqfile'], 'w') . \"',\n 1,\n '\" . $_SESSION['staffId'] . \"',NOW())\";\n }\n try {\n $this->q->create($sql);\n } catch (\\Exception $e) {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n echo htmlspecialchars(json_encode($result), ENT_NOQUOTES);\n exit();\n }", "private function json_submitSurvey()\n {\n\n // Gets the input data entered in the Front-End\n $input = json_decode(file_get_contents(\"php://input\"));\n $title = $_POST['title'];\n $description = $_POST['description'];\n $question = $_POST['question'];\n $file = $_FILES['file']['name'];\n\n // Gets the last SurveyID\n $query = \"SELECT surveyID FROM Surveys ORDER BY surveyID DESC LIMIT 1;\";\n $params = [];\n $resLastSurveyID = json_decode($this->recordset->getJSONRecordSet($query, $params), true);\n $currentSurveyID = $resLastSurveyID['data']['0']['surveyID'] + 1;\n\n // Gets the last QuestionID\n $query = \"SELECT questionID FROM Questions ORDER BY questionID DESC LIMIT 1;\";\n $params = [];\n $resLastQuestionID = json_decode($this->recordset->getJSONRecordSet($query, $params), true);\n $currentQuestionID = $resLastQuestionID['data']['0']['questionID'] + 1;\n\n // Create the Uploads Directory\n $uploadsDirectory = dirname(__FILE__, 2) . \"/uploads\";\n $surveyDirectory = $uploadsDirectory . \"/\" . $currentSurveyID;\n $questionDirectory = $surveyDirectory . \"/\" . $currentQuestionID;\n// $questionDirectory = $questionDirectory . \"/\";\n\n // File Permissions\n if (!file_exists($questionDirectory)) {\n mkdir($questionDirectory, 0777, true);\n }\n\n // File Checks\n $path = pathinfo($file);\n $filename = $path['filename'];\n $ext = $path['extension'];\n $temp_name = $_FILES['file']['tmp_name'];\n $path_filename_ext = $questionDirectory . \"/\" . $filename . \".\" . $ext;\n if (file_exists($path_filename_ext)) {\n // echo \"Sorry, File Already Exists.\";\n } else {\n move_uploaded_file($temp_name, $path_filename_ext);\n // echo \"Congratulations! File Uploaded Successfully.\";\n }\n $media_url = \"uploads/\" . $currentSurveyID . \"/\" . $currentQuestionID . \"/\" . $_FILES['file']['name'];\n\n // Insert survey data into the Survey table\n $createSurveyQuery = \"INSERT INTO Surveys (surveyTitle, surveyDescription) VALUES (:surveyTitle, :surveyDescription);\";\n\n $createSurveyParams =\n [\n \":surveyTitle\" => $title,\n \":surveyDescription\" => $description,\n ];\n\n $resCreateSurvey = json_decode($this->recordset->getJSONRecordSet($createSurveyQuery, $createSurveyParams), true);\n\n print_r($resCreateSurvey);\n\n // Insert question data into the Questions table\n $createQuestionQuery = \"INSERT INTO Questions (question, mediaPath, surveyID) VALUES (:question, :media_url, :surveyID);\";\n\n $createQuestionParams =\n [\n \":question\" => $question,\n \":media_url\" => $media_url,\n \":surveyID\" => $currentSurveyID,\n ];\n\n $resCreateQuestion = json_decode($this->recordset->getJSONRecordSet($createQuestionQuery, $createQuestionParams), true);\n\n $res['status'] = 200;\n $res['filename'] = $file;\n $res['dirnametest'] = dirname(__FILE__, 2);\n $res['lastSurveyID'] = $resLastSurveyID;\n $res['lastQuestionID'] = $resLastQuestionID;\n $res['questionDirectory'] = $questionDirectory;\n\n return json_encode($res);\n }", "public function testAddExternalShipmentFile()\n {\n }", "public function testInboundDocumentAddAttachment()\n {\n }", "public function attach_file($file){\n\t \t\t//ERROR CHECKNG , SET OJESCT ATTRIBUTESss\n\t \t\tif(!$file || empty($file) || !is_array($file)){\n\t \t\t\t$this->errors[] = \"No file was uploaded. \";\n\t \t\t\treturn false;\n\t \t\t}elseif($file['error'] != 0){\n\t \t\t\t$this->errors[] = $this->upload->errors[$file['error']];\n\t \t\t\treturn false;\n\t \t\t}else{\n\t \t\t\tif (!isset($this->interview_id)) \n\t \t\t\t\t$this->setInterviewid();\n\n\t \t\t\t$this->temp_path = $file['tmp_name'];\n\t \t\t\t$this->passport = str_replace(\"/\", \"_\", $this->interview_id).\".\".basename($file[\"type\"]);\n\t \t\t\t$this->type = $file['type'];\n\t \t\t\t$this->size = $file['size'];\n\t \t\t\treturn true;\n\t \t\t}\n\t \t}", "public function addFile($file);", "public function testUpdateVendorComplianceSurvey()\n {\n }", "public function test_uploadedfile_route() {\n global $CFG;\n list($user, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // current time\n $now = time();\n\n // create a talkpoint\n $this->loadDataSet($this->createArrayDataSet(array(\n 'talkpoint_talkpoint' => array(\n array('id', 'instanceid', 'userid', 'title', 'uploadedfile', 'nimbbguid', 'mediatype', 'closed', 'timecreated', 'timemodified'),\n array(1, $talkpoint->id, $user->id, 'Talkpoint 001', 'mod_talkpoint_web_test.txt', null, 'file', 0, $now, $now),\n ),\n )));\n\n // spit a dummy existing file\n check_dir_exists($CFG->dataroot . '/into/mod_talkpoint/' . $talkpoint->id . '/1');\n file_put_contents($CFG->dataroot . '/into/mod_talkpoint/' . $talkpoint->id . '/1/mod_talkpoint_web_test.txt', 'dummy contents');\n\n // request the file\n $client = new Client($this->_app);\n $client->request('GET', '/uploadedfile/1');\n $this->assertTrue($client->getResponse()->isOk());\n }", "public function uploadFileManufacturer(){\r\n $file = Input::file('file');\r\n $manufacturerId = Input::get('MANUFACTURER');\r\n $adminId = Input::get('CONSULTANT');\r\n $manufacturer = Project::find($manufacturerId);\r\n if($manufacturer!=null){\r\n if($file){\r\n $fileName = $file->getClientOriginalName();\r\n if(!File::exists(\"files/manufacturerFiles/\".$manufacturerId.\"/\")) {\r\n File::makeDirectory(\"files/manufacturerFiles/\".$manufacturerId.\"/\", 0755, true);\r\n }\r\n $file->move(public_path().'/files/manufacturerFiles/'.$manufacturerId.'/', $fileName);\r\n //create the row in upload file\r\n $uploadFile = new UploadedFiles();\r\n $uploadFile->project_id = 0;\r\n $uploadFile->manufacturer_id = $manufacturerId;\r\n $uploadFile->url = \"files/manufacturerFiles/\".$manufacturerId.\"/$fileName\";\r\n $uploadFile->fileName = $fileName;\r\n $uploadFile->admin_id = $adminId;\r\n $uploadFile->ip = $_SERVER[\"REMOTE_ADDR\"];\r\n $uploadFile->save();\r\n Transaction::createTransaction($adminId,'','','UPLOAD_FILE_FROM_MANUFACTURER',$fileName,'','','','','','');\r\n }\r\n }\r\n }", "public function testAddVendorComplianceSurvey()\n {\n }", "public function testPostFile()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function test_File($file)\n{\n // print_r($file);\n global $uploadedFile;\n\n // $err = array();\n\n // Upload attachment file\n if (!empty($file[\"name\"])) {\n\n // File path config\n // make sure submitted file is not too large, can't be larger than 1 MB\n if ($file['size'] > (1024000)) {\n return array('valid' => false, \"msg\" => \"the File must be less than 1 MB in size.\");\n }\n $targetDir = \"../app/uploads/\";\n $fileName = time() . basename($file[\"name\"]);\n $targetFilePath = __DIR__ . '/' . $targetDir . $fileName;\n // echo $targetFilePath;\n $fileType = pathinfo($targetFilePath, PATHINFO_EXTENSION);\n\n // Allow certain file formats\n $allowTypes = array('pdf','PDF', 'doc','DOC', 'docx','DOCX', 'rtf','RTF','txt','TXT');\n if (in_array($fileType, $allowTypes)) {\n // Upload file to the server\n // make sure the 'uploads' folder exists if not, create it\n if (!is_dir($targetDir)) {\n mkdir($targetDir);\n }\n\n if (move_uploaded_file($file[\"tmp_name\"], $targetFilePath)) {\n $uploadedFile .= $fileName;\n }else{\n return array('valid' => false, \"msg\" => \"Sorry, Failed while uploading the file.\");\n }\n\n\n\n } else {\n return array('valid' => false, \"msg\" => \"Sorry, only PDF, DOC,DOCX,RTF and TXT files are allowed to upload.\");\n }\n }\n return array('valid' => true, \"msg\" => \"\");\n}", "public function import_survey_file($session_key, $sid, $sSurveyfile) \n\t{\n\t\tYii::app()->loadHelper('admin/import');\n\t\tif ($this->_checkSessionKey($session_key))\n { \n\t\t\tif (Yii::app()->session['USER_RIGHT_CREATE_SURVEY'])\n\t\t\t{\t\t\t\t\n\t\t\t\t$surveyidExists = Survey::model()->findByPk($sid);\n\t\t\t\tif (isset($surveyidExists))\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Survey already exists', 27);\n\n\t\t\t\t//Assuming that surveys should be in the upload/surveys directory\n\t\t\t\t$sFullFilepath = Yii::app()->getConfig('uploaddir').'/surveys/'.$sSurveyfile;\n\t\t\t\tif ($sSurveyfile!='' && file_exists($sFullFilepath))\n\t\t\t\t{\t\n\t\t\t\t\t$aPathInfo = pathinfo($sFullFilepath);\n\t\t\t\t\t$sExtension = $aPathInfo['extension'];\n\n\t\t\t\t\tif (isset($sExtension) && strtolower($sExtension)=='csv')\n\t\t\t\t\t{\n\t\t\t\t\t\t$aImportResults=CSVImportSurvey($sFullFilepath,$sid);\n\t\t\t\t\t}\n\t\t\t\t\telseif (isset($sExtension) && strtolower($sExtension)=='lss')\n\t\t\t\t\t{\n\t\t\t\t\t\t$aImportResults=XMLImportSurvey($sFullFilepath,NULL,NULL,$sid);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid input', 21);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(array_key_exists('error',$aImportResults))\n\t\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception($aImportResults['error'], 29);\n\n\t\t\t\t\tif($aImportResults['newsid']==NULL )\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Import failed', 29);\n\t\t\t\t\t\texit;\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$iNewSid = $aImportResults['newsid'];\n\t\t\t\t\t\tSurvey::model()->updateByPk($iNewSid, array('datecreated'=> date(\"Y-m-d\")));\n\t\t\t\t\t\treturn $iNewSid;\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Survey file does not exist (in server)', 21);\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('No permission', 2);\t\n\t\t\t\n }\t\t\n\t}", "function add_attach_file($file, $encoding = \"base64\", $dispo = \"attachment\", $type = \"application/octet-stream\") {\n\t\t$file_str = $this->get_file_data($file);\n\t\tif ($file_str == \"\") {\n\t\t\treturn;\n\t\t}else{\n\t\t\tif ($encoding == \"base64\"){\n\t\t\t\t$file_str = base64_encode($file_str);\n\t\t\t\t}\n\t\t\t$this->att_files[] = array(\n\t\t\t\t\"data\"=>chunk_split($file_str),\n\t\t\t\t\"name\"=>basename($file), \n\t\t\t\t\"cont_type\"=>$type, \n\t\t\t\t\"trans_enc\"=>$encoding,\n\t\t\t\t\"disposition\"=>$dispo);\n\t\t\t}\n\t\t}", "public function uploadFileVendors(){\r\n\r\n $file = Input::file('file');\r\n $vendorId = Input::get('CONSULTANT');\r\n $consultantVendor = Consultant::find($vendorId);\r\n $rol = $this->getRol($vendorId);\r\n $projectId = Input::get('PROJECT');\r\n $now = new \\DateTime('now');\r\n if($projectId != 0){\r\n $project = Project::find($projectId);\r\n if($project!=null){\r\n if($file){\r\n $fileName = $file->getClientOriginalName();\r\n $file->move(public_path().'/files/projects/'.$project->lead->fileno.'/'.$project->id.'/vendors', $fileName);\r\n\r\n //create the row in upload file\r\n $uploadFile = UploadedFiles::where(['fileName'=>$fileName,'admin_id'=>$vendorId,'project_id'=>$projectId])->first();\r\n if($uploadFile != null){\r\n $uploadFile->delete();\r\n }\r\n $uploadFile = new UploadedFiles();\r\n $uploadFile->project_id = $projectId;\r\n $uploadFile->url = \"files/projects/\".$project->lead->fileno.\"/\".$project->id.\"/vendors/$fileName\";\r\n $uploadFile->fileName = $fileName;\r\n $uploadFile->$rol = 1;\r\n $uploadFile->admin_id = $vendorId;\r\n $uploadFile->ip = $_SERVER[\"REMOTE_ADDR\"];\r\n $uploadFile->save();\r\n\r\n //complete the row for that project.\r\n $projectVendor = ProjectProduction::where(['consultant_id'=>$vendorId,'project_id'=>$projectId])->where('completed','<>',1)->first();\r\n if($projectVendor!=null){\r\n $projectVendor->completed = 1;\r\n $projectVendor->completedDate = $now->format(\"Y-m-d H:i:s\");\r\n $projectVendor->save();\r\n }\r\n\r\n //create the row in inbox to let Production know\r\n $msg = \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msg .= \"Pin: \".$project->id.\"\\r\\n\";\r\n $msg .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n $msg .= \"File Name: \".$fileName.\"\\r\\n\";\r\n\r\n $extArray = explode(\".\",$fileName);\r\n $ext = $extArray[count($extArray)-1];\r\n\r\n //let consultant and production know that the patent search was uploaded be the attorney\r\n if($consultantVendor != null){\r\n if(strpos($consultantVendor->rol, 'attorney')!== false){\r\n $uploadFile->internal = 1;\r\n $uploadFile->save();\r\n if($ext == 'doc'|| $ext == 'docx'){\r\n Inbox::createInbox($project->lead->id, $project->consultant_id, \"Patent Search uploaded by the attorney.\\r\\n\".$msg, 'PRODUCTION', 'PRODUCTION');\r\n Inbox::createInbox($project->lead->id, 30, \"Patent Search uploaded by the attorney.\\r\\n\".$msg, 'FILE UPLOADED', 'PRODUCTION');\r\n Transaction::createTransaction($vendorId,'','','UPLOAD_FILE_VENDOR','Patent Search: '.$fileName,$projectId,'','','','','');\r\n }\r\n }else{\r\n //if is not an attorney let production know\r\n Inbox::createInbox($project->lead->id, 30, \"File uploaded By Vendor.\\r\\n\".$msg, 'FILE UPLOADED', 'PRODUCTION');\r\n Transaction::createTransaction($vendorId,'','','UPLOAD_FILE_VENDOR',$fileName,$projectId,'','','','','');\r\n }\r\n }\r\n }\r\n }\r\n }else{\r\n if($file){\r\n $fileName = $file->getClientOriginalName();\r\n $myProjects = ProjectProduction::where(['consultant_id'=>$vendorId])->where('completed','<>',1)->get();\r\n foreach($myProjects as $projectVendor){\r\n $project = $projectVendor->project;\r\n if(strpos(strval($fileName),strval($project->lead->fileno)) !== false){\r\n $file->move(public_path().'/files/projects/'.$project->lead->fileno.'/'.$project->id.'/vendors', $fileName);\r\n //create the row in upload file\r\n $uploadFile = UploadedFiles::where(['fileName'=>$fileName,'admin_id'=>$vendorId,'project_id'=>$project->id])->first();\r\n if($uploadFile != null){\r\n $uploadFile->delete();\r\n }\r\n $uploadFile = new UploadedFiles();\r\n $uploadFile->project_id = $project->id;\r\n $uploadFile->url = \"files/projects/\".$project->lead->fileno.\"/\".$project->id.\"/vendors/$fileName\";\r\n $uploadFile->fileName = $fileName;\r\n $uploadFile->$rol = 1;\r\n $uploadFile->admin_id = $vendorId;\r\n $uploadFile->save();\r\n\r\n $projectVendor->completed = 1;\r\n $projectVendor->completedDate = $now->format(\"Y-m-d H:i:s\");\r\n $projectVendor->save();\r\n\r\n //create the row in inbox to let Production know\r\n $msg = \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msg .= \"Pin: \".$project->id.\"\\r\\n\";\r\n $msg .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n $msg .= \"File Name: \".$fileName.\"\\r\\n\";\r\n Inbox::createInbox($project->lead->id, 30, \"File uploaded By Vendor.\\r\\n\".$msg, 'FILE UPLOADED', 'PRODUCTION');\r\n\r\n\r\n $extArray = explode(\".\",$fileName);\r\n $ext = $extArray[count($extArray - 1)];\r\n //let consultant know that the patent search was uploaded be the attorney\r\n if($consultantVendor != null && strpos($consultantVendor->rol, 'attorney')!== false && ($ext == 'doc'|| $ext == 'docx')){\r\n Inbox::createInbox($project->lead->id, $project->consultant_id, \"Patent Search uploaded for the attorney.\\r\\n\".$msg, 'PRODUCTION', 'PRODUCTION');\r\n $uploadFile->internal = 1;\r\n $uploadFile->save();\r\n }\r\n\r\n Transaction::createTransaction($vendorId,'','','UPLOAD_FILE_VENDOR',$fileName,$project->id,'','','','','');\r\n }\r\n }\r\n }\r\n }\r\n\r\n }" ]
[ "0.64774317", "0.64061517", "0.62513965", "0.6089294", "0.6080073", "0.6044074", "0.6038264", "0.5878985", "0.5844206", "0.58036274", "0.5672194", "0.54980135", "0.5432378", "0.53772897", "0.53339636", "0.53320974", "0.5321754", "0.531954", "0.5303674", "0.5252528", "0.5241457", "0.522773", "0.5196118", "0.5187221", "0.5169956", "0.51592803", "0.5144927", "0.51069635", "0.5086967", "0.50483227" ]
0.77354425
0
Test case for addVendorComplianceSurveyTag Add new tags for a vendorComplianceSurvey..
public function testAddVendorComplianceSurveyTag() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetVendorComplianceSurveyTags()\n {\n }", "public function testDeleteVendorComplianceSurveyTag()\n {\n }", "public function testAddVendorComplianceSurvey()\n {\n }", "public function testAddVendorComplianceSurveyAudit()\n {\n }", "protected function addVendorComplianceSurveyTagRequest($vendor_compliance_survey_id, $vendor_compliance_survey_tag)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyTag'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_tag' is set\n if ($vendor_compliance_survey_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_tag when calling addVendorComplianceSurveyTag'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/tag/{vendorComplianceSurveyTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyTag' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function test_addLegacyLowstockContactTag() {\n\n }", "public function testUpdateVendorComplianceSurvey()\n {\n }", "public function testAddVendorComplianceSurveyFile()\n {\n }", "public function testGetDuplicateVendorComplianceSurveyById()\n {\n }", "public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }", "public function testDeleteVendorComplianceSurvey()\n {\n }", "public function test_addCustomerTag() {\n\n }", "public function test_addExternalShipmentTag() {\n\n }", "public function test_addLowStockTag() {\n\n }", "protected function getVendorComplianceSurveyTagsRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getVendorComplianceSurveyTags'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/tag';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function test_addReplenishmentProcessTag() {\n\n }", "public function testGetVendorComplianceSurveyById()\n {\n }", "public function test_addOrderLineActivityTag() {\n\n }", "public function test_attachTagRequest() {\n\n }", "public function testGetVendorComplianceSurveyByFilter()\n {\n }", "public function testAddVendorComplianceSurveyFileByURL()\n {\n }", "public function testAddItemSubCategoryTag()\n {\n }", "public function test_addItemCategoryTag() {\n\n }", "public function test_createTagRequest() {\n\n }", "protected function deleteVendorComplianceSurveyTagRequest($vendor_compliance_survey_id, $vendor_compliance_survey_tag)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling deleteVendorComplianceSurveyTag'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_tag' is set\n if ($vendor_compliance_survey_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_tag when calling deleteVendorComplianceSurveyTag'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/tag/{vendorComplianceSurveyTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyTag' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "private function addTag()\n {\n $params = array();\n $params['db_link'] = $this->db;\n $params['ticket_id'] = $_REQUEST['ticket_id'];\n \n $data = array();\n $tagTitle = stripslashes(trim($_REQUEST['tag']));\n $tag = Utils::sanitize($tagTitle);\n \n $Tickets = new Tickets($params);\n $Tickets->addTag($tag, $tagTitle);\n \n echo '[{\"isError\":0, \"message\":\"Successfully added tag\"}]';\n exit;\n }", "public function testAddPackingPlanTag()\n {\n }", "public function testGetVendorComplianceSurveyFiles()\n {\n }", "public function testAddLowStockTag()\n {\n }", "public function testAddExternalShipmentTag()\n {\n }" ]
[ "0.7272383", "0.684376", "0.6710105", "0.6561944", "0.63787377", "0.6318094", "0.6198338", "0.61687243", "0.6005345", "0.5990046", "0.5942052", "0.5940935", "0.5906524", "0.58989793", "0.58268875", "0.5817135", "0.5784253", "0.57697695", "0.5754871", "0.5754049", "0.5744009", "0.5737061", "0.57267195", "0.566082", "0.5628685", "0.5582454", "0.55750924", "0.5531544", "0.5488488", "0.5459753" ]
0.7894823
0
Test case for deleteVendorComplianceSurvey Delete a vendorComplianceSurvey.
public function testDeleteVendorComplianceSurvey() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDeleteVendorComplianceSurveyTag()\n {\n }", "protected function deleteVendorComplianceSurveyRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling deleteVendorComplianceSurvey'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testDeleteVendorComplianceSurveyFile()\n {\n }", "public function testDeleteSurvey()\n {\n $survey = Survey::factory()->create();\n $surveyId = $survey->id;\n\n $response = $this->json('DELETE', \"survey/{$surveyId}\");\n\n $response->assertStatus(204);\n $this->assertDatabaseMissing('survey', ['id' => $surveyId]);\n }", "public function testDeleteSurvey0()\n {\n }", "public function testDeleteSurvey0()\n {\n }", "public function testDeleteSurveyQuestionChoice0()\n {\n }", "public function testDeleteSurveyQuestionChoice0()\n {\n }", "public function testUpdateVendorComplianceSurvey()\n {\n }", "protected function deleteVendorComplianceSurveyTagRequest($vendor_compliance_survey_id, $vendor_compliance_survey_tag)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling deleteVendorComplianceSurveyTag'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_tag' is set\n if ($vendor_compliance_survey_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_tag when calling deleteVendorComplianceSurveyTag'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/tag/{vendorComplianceSurveyTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyTag' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testDeleteSurveyQuestion0()\n {\n }", "public function testDeleteSurveyQuestion0()\n {\n }", "function deleteSurveyRecord()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_svy WHERE survey_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\n\t\t$result = $ilDB->queryF(\"SELECT questionblock_fi FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$questionblocks = array();\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tarray_push($questionblocks, $row[\"questionblock_fi\"]);\n\t\t}\n\t\tif (count($questionblocks))\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulate(\"DELETE FROM svy_qblk WHERE \" . $ilDB->in('questionblock_id', $questionblocks, false, 'integer'));\n\t\t}\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$this->deleteAllUserData();\n\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_anonymous WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t\n\t\t// delete export files\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\t$directory = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tif (is_dir($directory))\n\t\t{\n\t\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t\tilUtil::delDir($directory);\n\t\t}\n\n\t\tinclude_once(\"./Services/MediaObjects/classes/class.ilObjMediaObject.php\");\n\t\t$mobs = ilObjMediaObject::_getMobsOfObject(\"svy:html\", $this->getId());\n\t\t// remaining usages are not in text anymore -> delete them\n\t\t// and media objects (note: delete method of ilObjMediaObject\n\t\t// checks whether object is used in another context; if yes,\n\t\t// the object is not deleted!)\n\t\tforeach($mobs as $mob)\n\t\t{\n\t\t\tilObjMediaObject::_removeUsage($mob, \"svy:html\", $this->getId());\n\t\t\t$mob_obj =& new ilObjMediaObject($mob);\n\t\t\t$mob_obj->delete();\n\t\t}\n\t}", "public function destroy(ClientSurvey $clientSurvey)\n {\n //\n }", "public function delete($vendor_id);", "public function destroy(Survey $survey)\n {\n //\n }", "public function testDeleteSurveyGroup()\n {\n $surveyGroup = SurveyGroup::factory()->create();\n $surveyGroupId = $surveyGroup->id;\n\n $response = $this->json('DELETE', \"survey-group/{$surveyGroupId}\");\n\n $response->assertStatus(204);\n $this->assertDatabaseMissing('survey_group', [ 'id' => $surveyGroupId ]);\n }", "public function deleteVendorComplianceSurveyWithHttpInfo($vendor_compliance_survey_id)\n {\n $returnType = '';\n $request = $this->deleteVendorComplianceSurveyRequest($vendor_compliance_survey_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function testAddVendorComplianceSurvey()\n {\n }", "public function deleted(CustomerInquiry $customerInquiry)\n {\n\n }", "public function testGetVendorComplianceSurveyById()\n {\n }", "protected function deleteVendorComplianceSurveyFileRequest($vendor_compliance_survey_id, $file_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling deleteVendorComplianceSurveyFile'\n );\n }\n // verify the required parameter 'file_id' is set\n if ($file_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $file_id when calling deleteVendorComplianceSurveyFile'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/file/{fileId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($file_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fileId' . '}',\n ObjectSerializer::toPathValue($file_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testDeletePromotionCampaignApplicationUsingDELETE()\n {\n }", "public function delete(SurveyService $surveyService, QuestionService $questionService)\n {\n $type = \\request('type', 'survey');\n $id = \\request('id', 0);\n if (0 == $id) {\n return $this->error('params error');\n }\n if ('survey' == $type) {\n $ret = $surveyService->delete($id);\n } else {\n $ret = $questionService->delete($id);\n }\n\n if (empty($ret)) {\n return $this->error('failed to delete it');\n }\n return $this->success('delete success');\n }", "public function testDeleteCampaignFromPromotionUsingDELETE()\n {\n }", "public function testGetDuplicateVendorComplianceSurveyById()\n {\n }", "public function destroy(Survey $survey)\n {\n $survey->delete();\n return Redirect::route('surveys');\n }", "function admin_delete_vendor($vendor_id = null){\n\t\t\n\t\t$this->layout = \"\";\n\t\t$this->autoRender = false;\n\t\t$vendor_id = DECRYPT_DATA($vendor_id);\n\t\tif(isset($vendor_id)){\n\t\t\t$this->Vendor->updateAll(array(\"Vendor.is_deleted\"=>\"'1'\"),array(\"Vendor.id\"=>$vendor_id));\n\t\t\tApp::import(\"Model\",\"Product\");\n\t\t\t$this->Product = new Product();\n\t\t\t$this->Product->updateAll(array(\"Product.is_deleted\"=>\"'1'\"),array(\"Product.vendor_id\"=>$vendor_id));\n\t\t\tApp::import(\"Model\",\"Coupon\");\n\t\t\t$this->Coupon = new Coupon();\n\t\t\t$this->Coupon->updateAll(array(\"Coupon.is_deleted\"=>\"'1'\"),array(\"Coupon.vendor_id\"=>$vendor_id));\n\t\t\t$this->Session->setFlash(RECORD_DELETED, 'message/green');\n\t\t}\n\t\t$this->redirect($this->referer());exit();\t\n\t}", "public function deleteSportsVenue($venue);", "protected function getDuplicateVendorComplianceSurveyByIdRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getDuplicateVendorComplianceSurveyById'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/duplicate/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
[ "0.6932628", "0.6759162", "0.6747259", "0.64157975", "0.63229185", "0.63229185", "0.60964894", "0.60964894", "0.60822535", "0.6078156", "0.6064927", "0.6064927", "0.5869132", "0.5758861", "0.5694972", "0.5688069", "0.5595517", "0.5561817", "0.5528854", "0.5476757", "0.54456836", "0.54426533", "0.5435283", "0.53867465", "0.5377395", "0.53028786", "0.5279576", "0.5246026", "0.52156645", "0.52115995" ]
0.7542483
0
Test case for deleteVendorComplianceSurveyFile Delete a file for a vendorComplianceSurvey..
public function testDeleteVendorComplianceSurveyFile() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDeleteVendorComplianceSurvey()\n {\n }", "public function testDeleteReplenishmentFile()\n {\n }", "public function testDeleteVendorComplianceSurveyTag()\n {\n }", "public function testDeleteExternalShipmentFile()\n {\n }", "public function testDeleteFile()\n {\n\n }", "public function testDeletePackingPlanFile()\n {\n }", "public function testDeleteFile()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testDeleteOrderFile()\n {\n }", "public function testGetVendorComplianceSurveyFiles()\n {\n }", "public function testDeleteLowStockFile()\n {\n }", "protected function deleteVendorComplianceSurveyFileRequest($vendor_compliance_survey_id, $file_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling deleteVendorComplianceSurveyFile'\n );\n }\n // verify the required parameter 'file_id' is set\n if ($file_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $file_id when calling deleteVendorComplianceSurveyFile'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/file/{fileId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($file_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fileId' . '}',\n ObjectSerializer::toPathValue($file_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testDeleteSurvey0()\n {\n }", "public function testDeleteSurvey0()\n {\n }", "function deleteSurveyRecord()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_svy WHERE survey_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\n\t\t$result = $ilDB->queryF(\"SELECT questionblock_fi FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$questionblocks = array();\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tarray_push($questionblocks, $row[\"questionblock_fi\"]);\n\t\t}\n\t\tif (count($questionblocks))\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulate(\"DELETE FROM svy_qblk WHERE \" . $ilDB->in('questionblock_id', $questionblocks, false, 'integer'));\n\t\t}\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$this->deleteAllUserData();\n\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_anonymous WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t\n\t\t// delete export files\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\t$directory = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tif (is_dir($directory))\n\t\t{\n\t\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t\tilUtil::delDir($directory);\n\t\t}\n\n\t\tinclude_once(\"./Services/MediaObjects/classes/class.ilObjMediaObject.php\");\n\t\t$mobs = ilObjMediaObject::_getMobsOfObject(\"svy:html\", $this->getId());\n\t\t// remaining usages are not in text anymore -> delete them\n\t\t// and media objects (note: delete method of ilObjMediaObject\n\t\t// checks whether object is used in another context; if yes,\n\t\t// the object is not deleted!)\n\t\tforeach($mobs as $mob)\n\t\t{\n\t\t\tilObjMediaObject::_removeUsage($mob, \"svy:html\", $this->getId());\n\t\t\t$mob_obj =& new ilObjMediaObject($mob);\n\t\t\t$mob_obj->delete();\n\t\t}\n\t}", "public function testAddVendorComplianceSurveyFile()\n {\n }", "public function testDeleteItemSubCategoryFile()\n {\n }", "function _webform_delete_file($data, $component) {\r\n // Delete an individual submission file.\r\n $filedata = unserialize($data['value']['0']);\r\n if (isset($filedata['filepath']) && is_file($filedata['filepath'])) {\r\n unlink($filedata['filepath']);\r\n db_query(\"DELETE FROM {files} WHERE filepath = '%s'\", $filedata['filepath']);\r\n }\r\n}", "public function testDeleteSurveyQuestion0()\n {\n }", "public function testDeleteSurveyQuestion0()\n {\n }", "public function deleteFile(){\n\t\t$db = $this->db;\n\t\t$id = $_GET[\"id\"];\n\t\t\n\t\t$file = $db->fetchRow($db->select()->from(array(\"tbf\"=>\"tb_applicant_files\"))->where(\"id = ?\", $id));\n\t\tif ($file){\n\t\t\tif ($file[\"userid\"]!=$_SESSION[\"userid\"]){\n\t\t\t\treturn array(\"success\"=>false);\n\t\t\t}\n\t\t\t//$db->delete(\"tb_applicant_files\", $db->quoteInto(\"id = ?\", $id));\n\t\t\t$db->update(\"tb_applicant_files\", array(\"is_deleted\" => 1), $db->quoteInto(\"id = ?\", $id));\n $db->delete(\"solr_candidates\", $db -> quoteInto(\"userid=?\",$_SESSION[\"userid\"]));\n\t\t\t\n\t\t\tglobal $base_api_url;\n\t\t\t\n\t\t\tfile_get_contents($base_api_url . \"/solr-index/sync-candidates/\");\n\t\t\t\n\t\t\tif (file_exists(getcwd().\"/../applicants_files/\".$file[\"name\"])){\n\t\t\t\tunlink(getcwd().\"/../applicants_files/\".$file[\"name\"]);\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tfile_get_contents($base_api_url . \"/mongo-index/sync-candidates-files/?userid=\" . $_SESSION[\"userid\"]);\n\t\t\t\n\t\t\t\n\t\t\treturn array(\"success\"=>true);\n\t\t}else{\n\t\t\treturn array(\"success\"=>false);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function deleteFile($adapter)\n {\n }", "public function delete($file) {\n\t}", "abstract function delete_file($filepath);", "public function testDeleteSurveyQuestionChoice0()\n {\n }", "public function testDeleteSurveyQuestionChoice0()\n {\n }", "public function delete_file(){\n if($this->file_name != 'sample.jpg'){\n unlink($this->dir_location . $this->file_name);\n }\n }", "function deleteFile() {\r\n\t\tif (file_exists($this->data[$this->alias]['path'])) {\r\n\t\t\tunlink($this->data[$this->alias]['path']);\r\n\t\t}\r\n\t}", "public function testAddVendorComplianceSurveyFileByURL()\n {\n }", "function cemhub_delete_file($file_name) {\n $successfully_deleted = FALSE;\n\n $file_details = cemhub_retrieve_file_details($file_name);\n if (!empty($file_details)) {\n $successfully_deleted = file_delete($file_details, TRUE);\n }\n else {\n $repository_path = cemhub_get_files_repository_path(TRUE);\n $successfully_deleted = file_unmanaged_delete($repository_path . '/' . $file_name);\n }\n\n if ($successfully_deleted) {\n watchdog('cemhub', 'The file \"' . $file_name . '\" was deleted successfully.');\n }\n else {\n watchdog('cemhub', 'It was not possible to delete file \"' . $file_name . '\", checks the Drupal file log to view more details.');\n }\n\n return $successfully_deleted;\n}", "public function delete_file(){\n\t\t$api_url \t= \"https://api002.backblazeb2.com\";\n\t\t$auth_token = \"4_002147cd01b5a680000000000_018d4c36_d47af5_acct_8SQ4r2LRCypwp1wl0rPo1ySwDm4=\"; \n\t\t$file_id \t= \"4_zd184771c8d50b17b65ba0618_f10273ca4a9b98700_d20190704_m095545_c002_v0001126_t0048\"; \n\t\t$file_name = \"main.html\"; \n\n\t\t$session = curl_init($api_url . \"/b2api/v2/b2_delete_file_version\");\n\t\n\t\t$data = array(\"fileId\" => $file_id, \"fileName\" => $file_name);\n\t\t$post_fields = json_encode($data);\n\t\tcurl_setopt($session, CURLOPT_POSTFIELDS, $post_fields); \n\n\t\t$headers = array();\n\t\t$headers[] = \"Authorization: \" . $auth_token;\n\t\tcurl_setopt($session, CURLOPT_HTTPHEADER, $headers); \n\n\t\tcurl_setopt($session, CURLOPT_POST, true); \n\t\tcurl_setopt($session, CURLOPT_RETURNTRANSFER, true); \n\t\t$server_output = curl_exec($session); \n\t\tcurl_close ($session); \n\t\techo ($server_output); \n\t}" ]
[ "0.7365383", "0.69776917", "0.6969207", "0.68709624", "0.6763314", "0.67562115", "0.6615763", "0.654256", "0.6489594", "0.6449828", "0.6433483", "0.63997024", "0.63997024", "0.63175905", "0.6317303", "0.6243808", "0.61395884", "0.61081845", "0.61081845", "0.6054983", "0.6025742", "0.6023213", "0.60138136", "0.6010102", "0.6010102", "0.6000354", "0.5993523", "0.5972774", "0.5924301", "0.5924002" ]
0.8609572
0
Test case for deleteVendorComplianceSurveyTag Delete a tag for a vendorComplianceSurvey..
public function testDeleteVendorComplianceSurveyTag() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDeleteVendorComplianceSurvey()\n {\n }", "public function testDeleteReplenishmentTag()\n {\n }", "public function testDeleteVendorComplianceSurveyFile()\n {\n }", "public function test_deleteReplenishmentProcessTag() {\n\n }", "public function test_deleteLegacyLowstockContactTag() {\n\n }", "public function test_deleteExternalShipmentTag() {\n\n }", "public function testDeleteExternalShipmentTag()\n {\n }", "public function testDeletePackingPlanTag()\n {\n }", "protected function deleteVendorComplianceSurveyTagRequest($vendor_compliance_survey_id, $vendor_compliance_survey_tag)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling deleteVendorComplianceSurveyTag'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_tag' is set\n if ($vendor_compliance_survey_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_tag when calling deleteVendorComplianceSurveyTag'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/tag/{vendorComplianceSurveyTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyTag' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testDeleteOrderTag()\n {\n }", "public function test_deleteCustomerTag() {\n\n }", "public function test_deleteLowStockTag() {\n\n }", "public function test_deleteTagRequest() {\n\n }", "public function testDeleteSurvey0()\n {\n }", "public function testDeleteSurvey0()\n {\n }", "public function test_deleteOrderLineActivityTag() {\n\n }", "public function testDeleteLowStockTag()\n {\n }", "public function test_deleteItemCategoryTag() {\n\n }", "public function testAddVendorComplianceSurveyTag()\n {\n }", "public function testDeleteSurveyQuestion0()\n {\n }", "public function testDeleteSurveyQuestion0()\n {\n }", "public function test_deleteBillingCodeTypeTag() {\n\n }", "public function testDeleteSurveyQuestionChoice0()\n {\n }", "public function testDeleteSurveyQuestionChoice0()\n {\n }", "public function testDeleteItemSubCategoryTag()\n {\n }", "public function testGetVendorComplianceSurveyTags()\n {\n }", "public function testDeleteTagAdmin(): void\n {\n // given\n $expectedStatusCode = 200;\n $adminUser = $this->createUser([User::ROLE_USER, User::ROLE_ADMIN]);\n $this->logIn($adminUser);\n\n $expectedTag = new Tag();\n $expectedTag->setName('Test Tag To Delete');\n $tagRepository = self::$container->get(TagRepository::class);\n $tagRepository->save($expectedTag);\n\n // when\n $crawler = $this->httpClient->request('GET', '/tag/'.$expectedTag->getId().'/delete');\n $resultStatusCode = $this->httpClient->getResponse()->getStatusCode();\n $form = $crawler->selectButton('usuń')->form();\n $this->httpClient->submit($form);\n $this->httpClient->followRedirect();\n\n // then\n $this->assertEquals($expectedStatusCode, $resultStatusCode);\n $this->assertStringContainsString('Usuwanie powiodło się', $this->httpClient->getResponse()->getContent());\n }", "public function test_deleteCartonActivityTag() {\n\n }", "public function testDeletePromotionCampaignApplicationUsingDELETE()\n {\n }", "public function delete($vendor_id);" ]
[ "0.75001514", "0.70544374", "0.7025557", "0.68971145", "0.6834549", "0.6813373", "0.6797553", "0.6786324", "0.67576134", "0.67004544", "0.66620636", "0.6638457", "0.66014445", "0.66011566", "0.66011566", "0.6531757", "0.6512446", "0.6496821", "0.6480844", "0.64776444", "0.64776444", "0.63997287", "0.6386554", "0.6386554", "0.6349866", "0.6319847", "0.62040997", "0.61802703", "0.61467", "0.6131901" ]
0.8647851
0
Test case for getDuplicateVendorComplianceSurveyById Get a duplicated a vendorComplianceSurvey by id.
public function testGetDuplicateVendorComplianceSurveyById() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getDuplicateVendorComplianceSurveyByIdRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getDuplicateVendorComplianceSurveyById'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/duplicate/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testDuplicateSurvey()\n {\n $year = 2018;\n $currentYear = current_year();\n $origSurvey = Survey::factory()->create(['year' => $year, 'title' => \"$year Survey Title\"]);\n $origGroup = SurveyGroup::factory()->create(['survey_id' => $origSurvey->id]);\n $origQuestion = SurveyQuestion::factory()->create(['survey_id' => $origSurvey->id, 'survey_group_id' => $origGroup->id]);\n\n $response = $this->json('POST', \"survey/{$origSurvey->id}/duplicate\");\n $response->assertStatus(200);\n $newId = $response->json('survey_id');\n\n $this->assertDatabaseHas('survey', ['id' => $newId, 'title' => \"$currentYear Survey Title\"]);\n $this->assertDatabaseHas('survey_group', ['survey_id' => $newId, 'title' => $origGroup->title]);\n $this->assertDatabaseHas('survey_question', ['survey_id' => $newId, 'description' => $origQuestion->description]);\n }", "public function getDuplicateVendorComplianceSurveyByIdWithHttpInfo($vendor_compliance_survey_id)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey';\n $request = $this->getDuplicateVendorComplianceSurveyByIdRequest($vendor_compliance_survey_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function testGetVendorComplianceSurveyById()\n {\n }", "protected function getVendorComplianceSurveyByIdRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getVendorComplianceSurveyById'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function duplicateQuestionForSurvey($question_id, $a_force = false)\n\t{\n\t\tglobal $ilUser;\n\t\t\n\t\t$questiontype = $this->getQuestionType($question_id);\n\t\t$question_gui = $this->getQuestionGUI($questiontype, $question_id);\n\n\t\t// check if question is a pool question at all, if not do nothing\n\t\tif($this->getId() == $question_gui->object->getObjId() && !$a_force)\n\t\t{\n\t\t\treturn $question_id;\n\t\t}\n\n\t\t$duplicate_id = $question_gui->object->duplicate(true);\n\t\treturn $duplicate_id;\n\t}", "protected function deleteVendorComplianceSurveyRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling deleteVendorComplianceSurvey'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function dataProcessingsDuplicateRequest($id, $workspace_id, $tenant_id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling dataProcessingsDuplicate'\n );\n }\n // verify the required parameter 'workspace_id' is set\n if ($workspace_id === null || (is_array($workspace_id) && count($workspace_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $workspace_id when calling dataProcessingsDuplicate'\n );\n }\n // verify the required parameter 'tenant_id' is set\n if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $tenant_id when calling dataProcessingsDuplicate'\n );\n }\n\n $resourcePath = '/v1/tenant/{tenantId}/ws/{workspaceId}/DataProcessings/{id}/duplicate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($workspace_id !== null) {\n $resourcePath = str_replace(\n '{' . 'workspaceId' . '}',\n ObjectSerializer::toPathValue($workspace_id),\n $resourcePath\n );\n }\n // path params\n if ($tenant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'tenantId' . '}',\n ObjectSerializer::toPathValue($tenant_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testUpdateVendorComplianceSurvey()\n {\n }", "public function testDeleteVendorComplianceSurvey()\n {\n }", "protected function addVendorComplianceSurveyAuditRequest($vendor_compliance_survey_id, $vendor_compliance_survey_audit)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyAudit'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_audit' is set\n if ($vendor_compliance_survey_audit === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_audit when calling addVendorComplianceSurveyAudit'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/audit/{vendorComplianceSurveyAudit}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_audit !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyAudit' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_audit),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getDuplicateVendorComplianceSurveyByIdAsyncWithHttpInfo($vendor_compliance_survey_id)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey';\n $request = $this->getDuplicateVendorComplianceSurveyByIdRequest($vendor_compliance_survey_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function getDuplicateVendorByIdWithHttpInfo($vendor_id)\n {\n \n // verify the required parameter 'vendor_id' is set\n if ($vendor_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $vendor_id when calling getDuplicateVendorById');\n }\n \n // parse inputs\n $resourcePath = \"/beta/vendor/duplicate/{vendorId}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());\n \n \n \n // path params\n \n if ($vendor_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"vendorId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($vendor_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('API-Key');\n if (strlen($apiKey) !== 0) {\n $headerParams['API-Key'] = $apiKey;\n }\n \n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'GET',\n $queryParams, $httpBody,\n $headerParams, '\\Infoplus\\Model\\Vendor'\n );\n \n if (!$response) {\n return array(null, $statusCode, $httpHeader);\n }\n\n return array(\\Infoplus\\ObjectSerializer::deserialize($response, '\\Infoplus\\Model\\Vendor', $httpHeader), $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 200:\n $data = \\Infoplus\\ObjectSerializer::deserialize($e->getResponseBody(), '\\Infoplus\\Model\\Vendor', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n }", "public function testGetDuplicatePackingPlanById()\n {\n }", "public function getDuplicateVendorById($vendor_id)\n {\n list($response, $statusCode, $httpHeader) = $this->getDuplicateVendorByIdWithHttpInfo ($vendor_id);\n return $response; \n }", "public function test_getDuplicateLegacyLowstockContactById() {\n\n }", "public function test_getDuplicateExternalShipmentById() {\n\n }", "public function getDuplicateVendorComplianceSurveyByIdAsync($vendor_compliance_survey_id)\n {\n return $this->getDuplicateVendorComplianceSurveyByIdAsyncWithHttpInfo($vendor_compliance_survey_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function duplicateInvoice($id) {\n\t\ttry{\n\t\t\t$invoiceTbl = $this->_serviceManager->get('Invoice\\Model\\InvoiceTable');\n\t\n\t\t\t$invoiceItems = $invoiceTbl->fetchInvoiceItemsById($id);\n\t\t\t\n\t\t\t$invoiceData = $invoiceTbl->getInvoiceDetailsById($id);\n\t\t\t\n\t\t\t$xml = $this->generateDuplicateXml($invoiceData, $invoiceItems);\n\t\t\t\n\t\t\t$response = $this->_XeroOAuth->request('POST', $this->_XeroOAuth->url('Invoices', 'core'), array(), $xml);\n\t\t\t\n\t\t\tif ($this->_XeroOAuth->response['code'] == 200) {\n\t\t\t\t$invoice = $this->_XeroOAuth->parseResponse($this->_XeroOAuth->response['response'], $this->_XeroOAuth->response['format']);\n\t\t\t\t\n\t\t\t\tif (count($invoice->Invoices[0]) > 0) {\n\t\t\t\t\t$data = (array) $invoiceTbl->getInvoiceById($id);\n\t\t\t\t\tunset($data['id']);\n\t\t\t\t\t$data['invoice_id'] = $invoice->Invoices[0]->Invoice->InvoiceID;\n\t\t\t\t\t$data['invoice_number'] = $invoice->Invoices[0]->Invoice->InvoiceNumber;\n\t\t\t\t\t\n\t\t\t\t\t$invoice_id = $this->saveDuplicateData($data, $invoiceItems);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false; \n\t\t}catch(\\Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . urldecode($response['response']) . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n }", "public function test_getDuplicateReplenishmentProcessById() {\n\n }", "public function testGetDuplicateReplenishmentById()\n {\n }", "public function test_getDuplicateCustomerById() {\n\n }", "public function testDuplicate()\n {\n $this->duplicate(\n [\n 'catalogId' => 1,\n 'catalogInstanceId' => 1,\n 'count' => 1,\n 'status' => 0,\n ],\n [\n 'count' => ['minValue']\n ]\n );\n }", "public function store($vendorId)\n\t{\n\t\tInput::merge(array_map('trim', Input::all()));\n $validator = Validator::make(\n array('intVendorId' => $vendorId),\n array('intVendorId' => 'required')\n );\n\n if ($validator->fails()) {\n return $this->respondBadRequest('Invalid Vendor Id.');\n }\n\n $validator = Validator::make(\n Input::get(),\n array(\n 'contactName' => 'required|max:200',\n 'contactDesignation' => 'sometimes|max:200',\n 'contactEmail' => 'sometimes|email|max:200',\n 'contactPhone1' => 'sometimes|max:20',\n 'contactPhone2' => 'sometimes|max:20'\n ));\n if ($validator->fails()) {\n return $this->respondBadRequest('Invalid input.', array('app_error' => $validator->messages()->toArray()));\n }\n\n $vendor = Vendor::find($vendorId);\n if (!$vendor) {\n return $this->respondNotFound('Vendor does not exist.');\n }\n\n $vendorContact = new VendorContact;\n $vendorContact->intVendorId = $vendorId;\n $vendorContact->strContactFullName =Input::get('contactName');\n $vendorContact->strContactDesgnation =Input::get('contactDesignation');\n $vendorContact->strContactEmail =Input::get('contactEmail');\n $vendorContact->strContactPhone1 =Input::get('contactPhone1');\n $vendorContact->strContactPhone2 =Input::get('contactPhone2');\n\n try {\n $vendorContact->save();\n } catch (\\Exception $e) {\n return $this->respondInternalError('Unable to save Vendor contact.');\n }\n $insertedVendorContact = VendorContact::find($vendorContact->intVendorContactId);\n return $this->setStatusCode(ApiController::HTTP_CREATED)->respond($this->vendorContactTransformer->transform($insertedVendorContact));\n\n\t}", "public function testGetDuplicateExternalShipmentById()\n {\n }", "public function testAddVendorComplianceSurvey()\n {\n }", "public function check_duplicate()\n {\n }", "function getSurveyId()\n\t{\n\t\treturn $this->survey_id;\n\t}", "public function duplicate($id, EstAsistencium $estAsistencium)\n\t{\n\t\t$estAsistencium=$estAsistencium->find($id);\n\t\treturn view('estAsistencias.duplicate', compact('estAsistencium'))\n\t\t\t->with( 'list', EstAsistencium::getListFromAllRelationApps() );\n\t}", "public function duplicate( $id ) {\r\r\n global $wpdb;\r\r\n\r\r\n $this->refresh = true;\r\r\n\r\r\n return $wpdb->query(\r\r\n $wpdb->prepare(\"\r\r\n INSERT INTO \" . wd_asp()->db->table('main') . \"( name, data )\r\r\n SELECT CONCAT(name, ' duplicate'), data FROM \" . wd_asp()->db->table('main') . \"\r\r\n WHERE id=%d;\"\r\r\n , $id)\r\r\n );\r\r\n }" ]
[ "0.7375955", "0.67451006", "0.61819744", "0.57770336", "0.552282", "0.5482857", "0.5471979", "0.5366605", "0.51834106", "0.517411", "0.5128608", "0.51049936", "0.50872576", "0.50774026", "0.5064416", "0.50637686", "0.50333077", "0.5033139", "0.50024766", "0.49658948", "0.4956812", "0.4931161", "0.4910086", "0.48761582", "0.48260272", "0.47944808", "0.47771698", "0.47631815", "0.47595224", "0.47554427" ]
0.70179504
1
Test case for getVendorComplianceSurveyByFilter Search vendorComplianceSurveys by filter.
public function testGetVendorComplianceSurveyByFilter() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVendorComplianceSurveyByFilter($filter = null, $page = null, $limit = null, $sort = null)\n {\n list($response) = $this->getVendorComplianceSurveyByFilterWithHttpInfo($filter, $page, $limit, $sort);\n return $response;\n }", "protected function getVendorComplianceSurveyByFilterRequest($filter = null, $page = null, $limit = null, $sort = null)\n {\n\n $resourcePath = '/beta/vendorComplianceSurvey/search';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($filter !== null) {\n $queryParams['filter'] = ObjectSerializer::toQueryValue($filter);\n }\n // query params\n if ($page !== null) {\n $queryParams['page'] = ObjectSerializer::toQueryValue($page);\n }\n // query params\n if ($limit !== null) {\n $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);\n }\n // query params\n if ($sort !== null) {\n $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function _getVendorCollection()\n {\n if (is_null($this->_vendorCollection)) {\n $queryText = $this->getQueryText();\n $vendorShoptable = $this->_resourceConnection->getTableName('ced_csmarketplace_vendor_shop');\n $this->_vendorCollection = $this->_collectionFactory->create();\n $this->_vendorCollection->addAttributeToSelect('*');\n //$this->_vendorCollection->getSelect()->join(['vendor_shop' => $vendorShoptable], 'e.entity_id=vendor_shop.vendor_id AND vendor_shop.shop_disable=' . Vshop::ENABLED, ['shop_disable']);\n\n $this->_vendorCollection->addAttributeToFilter('meta_keywords', ['like' => '%' . $queryText . '%']);\n if ($this->_csmarketplaceHelper->isSharingEnabled()) {\n $this->_vendorCollection->addAttributeToFilter('website_id', $this->_storeManager->getStore()->getWebsiteId());\n }\n\n if ($this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::MODULE_ENABLE)) {\n //------------------- Custom Filter----------------[START]\n\n $savedLocationFromSession = $this->_hyperlocalHelper->getShippingLocationFromSession();\n $filterType = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::FILTER_TYPE);\n $radiusConfig = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::FILTER_RADIUS);\n $distanceType = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::DISTANCE_TYPE);\n $apiKey = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::API_KEY);\n $filterProductsBy = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::FILTER_PRODUCTS_BY);\n\n if ($filterProductsBy == 'vendor_location' || $filterType == 'distance') {\n $vendorIds = [0];\n if ($savedLocationFromSession) {\n\n /** Filter Products By Vendor Location */\n if ($filterType == 'city_state_country') {\n\n //------------------- Filter By City,country & state----------------[START]\n $locationCollection = $this->_hyperlocalHelper->getFilteredlocationByCityStateCountry($savedLocationFromSession);\n if ($locationCollection) {\n $vendorIds = $locationCollection->getColumnValues('vendor_id');\n }\n\n //------------------- Filter By City,country & state----------------[END]\n } elseif ($filterType == 'zipcode' && isset($savedLocationFromSession['filterZipcode'])) {\n\n //------------------- Filter By Zipcode----------------[START]\n $resource = $this->_resourceConnection;\n $tableName = $resource->getTableName('ced_cshyperlocal_shipping_area');\n $this->zipcodeCollection->getSelect()->joinLeft($tableName, 'main_table.location_id = ' . $tableName . '.id', ['status', 'is_origin_address']);\n $this->zipcodeCollection->addFieldToFilter('main_table.zipcode', $savedLocationFromSession['filterZipcode'])\n ->addFieldToFilter('status', Shiparea::STATUS_ENABLED);\n $this->zipcodeCollection->getSelect()->where(\"`is_origin_address` IS NULL OR `is_origin_address` = '0'\");\n $vendorIds = $this->zipcodeCollection->getColumnValues('vendor_id');\n //------------------- Filter By Zipcode----------------[END]\n } elseif ($filterType == 'distance') {\n $tolat = $savedLocationFromSession['latitude'];\n $tolong = $savedLocationFromSession['longitude'];\n $vIds = [];\n if ($tolat != '' && $tolong != '') {\n $vendorCollection = $this->_collectionFactory->create();\n $vendorCollection->addAttributeToSelect('*');\n if ($vendorCollection->count()) {\n foreach ($vendorCollection as $vendor) {\n $distance = $this->_hyperlocalHelper->calculateDistancebyHaversine($vendor->getLatitude(), $vendor->getLongitude(), $tolat, $tolong);\n if ($distance <= $radiusConfig) {\n $vendorIds[] = $vendor->getId();\n }\n }\n }\n }\n }\n $this->_vendorCollection->addAttributeToFilter('entity_id', ['in' => $vendorIds]);\n }\n }\n //------------------- Custom Filter ----------------[END]\n }\n\n $this->prepareSortableFields();\n }\n return $this->_vendorCollection;\n }", "public function testUpdateVendorComplianceSurvey()\n {\n }", "public function getVendorComplianceSurveyByFilterAsync($filter = null, $page = null, $limit = null, $sort = null)\n {\n return $this->getVendorComplianceSurveyByFilterAsyncWithHttpInfo($filter, $page, $limit, $sort)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "protected function getVendorComplianceSurveyByIdRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getVendorComplianceSurveyById'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testGetVendorComplianceSurveyById()\n {\n }", "public function testAddVendorComplianceSurvey()\n {\n }", "protected function deleteVendorComplianceSurveyRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling deleteVendorComplianceSurvey'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }", "public function getVendorComplianceSurveyByFilterWithHttpInfo($filter = null, $page = null, $limit = null, $sort = null)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey[]';\n $request = $this->getVendorComplianceSurveyByFilterRequest($filter, $page, $limit, $sort);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function testComAdobeGraniteLicenseImplLicenseCheckFilter()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.license.impl.LicenseCheckFilter';\n\n $crawler = $client->request('POST', $path);\n }", "protected function getVendorComplianceSurveyTagsRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getVendorComplianceSurveyTags'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/tag';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function addVendorComplianceSurvey($body)\n {\n list($response) = $this->addVendorComplianceSurveyWithHttpInfo($body);\n return $response;\n }", "public function testDeleteVendorComplianceSurvey()\n {\n }", "protected function getVendorComplianceSurveyFilesRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getVendorComplianceSurveyFiles'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getDuplicateVendorComplianceSurveyByIdRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getDuplicateVendorComplianceSurveyById'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/duplicate/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updateVendorComplianceSurvey($body)\n {\n $this->updateVendorComplianceSurveyWithHttpInfo($body);\n }", "public function getVendorComplianceSurveyByFilterAsyncWithHttpInfo($filter = null, $page = null, $limit = null, $sort = null)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey[]';\n $request = $this->getVendorComplianceSurveyByFilterRequest($filter, $page, $limit, $sort);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "protected function addVendorComplianceSurveyRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling addVendorComplianceSurvey'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function test_getLegacyLowstockContactByFilter() {\n\n }", "function wcfmgs_group_manager_enquery_filter( $sql ) {\r\n \t\r\n \tif( !wcfm_is_vendor() && empty( $_POST['enquiry_vendor'] ) ) {\r\n \t\t$is_marketplace = wcfm_is_marketplace();\r\n\t\t\tif( $is_marketplace ) {\r\n\t\t\t\t$allow_vendors = $this->wcfmgs_group_manager_allow_vendors_list( array(0), $is_marketplace );\r\n\t\t\t\t$sql .= \" AND `vendor_id` IN (\" . implode( ',', $allow_vendors ) . \")\";\r\n\t\t\t}\r\n \t}\r\n \t\r\n \treturn $sql;\r\n }", "public function getVendorComplianceSurveyByIdWithHttpInfo($vendor_compliance_survey_id)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey';\n $request = $this->getVendorComplianceSurveyByIdRequest($vendor_compliance_survey_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function addVendorComplianceSurveyWithHttpInfo($body)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey';\n $request = $this->addVendorComplianceSurveyRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Infoplus\\Infoplus\\Model\\VendorComplianceSurvey',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 405:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Infoplus\\Infoplus\\Model\\ApiResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "protected function addVendorComplianceSurveyAuditRequest($vendor_compliance_survey_id, $vendor_compliance_survey_audit)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyAudit'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_audit' is set\n if ($vendor_compliance_survey_audit === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_audit when calling addVendorComplianceSurveyAudit'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/audit/{vendorComplianceSurveyAudit}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_audit !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyAudit' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_audit),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testComDayCqWcmCoreImplWCMDeveloperModeFilter()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.wcm.core.impl.WCMDeveloperModeFilter';\n\n $crawler = $client->request('POST', $path);\n }", "public function testGetVendorComplianceSurveyFiles()\n {\n }", "public function testApplyFiltersLicence()\n {\n $sut = m::mock(ComplaintRepo::class)->makePartial()->shouldAllowMockingProtectedMethods();\n\n $qb = m::mock(QueryBuilder::class);\n $query = m::mock(QueryInterface::class);\n\n $query->shouldReceive('getCase')->with()->andReturn(null);\n $query->shouldReceive('getIsCompliance')->with()->andReturn(null);\n $query->shouldReceive('getLicence')->with()->andReturn(33);\n $query->shouldReceive('getApplication')->with()->andReturn(null);\n\n $qb->shouldReceive('expr->eq')->with('ca.licence', ':licence')->once()->andReturn('EXPR');\n $qb->shouldReceive('andWhere')->with('EXPR')->once()->andReturnSelf();\n $qb->shouldReceive('setParameter')->with('licence', 33)->once()->andReturnSelf();\n\n $mockQb = m::mock(\\Dvsa\\Olcs\\Api\\Domain\\QueryBuilder::class);\n $sut->shouldReceive('getQueryBuilder')->with()->once()->andReturn($mockQb);\n $mockQb->shouldReceive('with')->with('case', 'ca')->once()->andReturnSelf();\n\n $sut->applyListFilters($qb, $query);\n }", "public function testApplyFiltersCompliance()\n {\n $sut = m::mock(ComplaintRepo::class)->makePartial()->shouldAllowMockingProtectedMethods();\n\n $qb = m::mock(QueryBuilder::class);\n $query = m::mock(QueryInterface::class);\n\n $query->shouldReceive('getCase')->with()->andReturn(null);\n $query->shouldReceive('getIsCompliance')->with()->andReturn(324);\n $query->shouldReceive('getLicence')->with()->andReturn(null);\n $query->shouldReceive('getApplication')->with()->andReturn(null);\n\n $qb->shouldReceive('expr->eq')->with('m.isCompliance', ':isCompliance')->once()->andReturn('EXPR');\n $qb->shouldReceive('andWhere')->with('EXPR')->once()->andReturnSelf();\n $qb->shouldReceive('setParameter')->with('isCompliance', 324)->once()->andReturnSelf();\n\n $sut->applyListFilters($qb, $query);\n }", "protected function updateVendorComplianceSurveyRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling updateVendorComplianceSurvey'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
[ "0.65983975", "0.6440524", "0.60063905", "0.5990527", "0.5842516", "0.56278217", "0.5604441", "0.5356904", "0.5316118", "0.52802116", "0.52200514", "0.5216986", "0.51793104", "0.51576316", "0.5118981", "0.50689995", "0.5038304", "0.502875", "0.5018832", "0.50145", "0.49898386", "0.49700508", "0.49518743", "0.49495512", "0.4931179", "0.49031204", "0.487443", "0.4859499", "0.4795649", "0.47679278" ]
0.6682606
0
Test case for getVendorComplianceSurveyFiles Get the files for a vendorComplianceSurvey..
public function testGetVendorComplianceSurveyFiles() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getVendorComplianceSurveyFilesRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getVendorComplianceSurveyFiles'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function get_survey_licensed_files($surveyid)\n\t{\t\t\n\t\t$where=\" survey_id=$surveyid AND (dctype like '%dat/micro]%' OR dctype like '%dat]%') \";\n\t\t\n\t\t$this->db->select('title,filename,resource_id');\n\t\t$this->db->from('resources');\n\t\t$this->db->select('title,filename,resource_id,changed');\n\t\t$this->db->where($where,NULL,FALSE);\n\t\t$query = $this->db->get();\n\n\t\tif ($query)\n\t\t{\n\t\t\treturn $query->result_array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new MY_Exception($this->db->_error_message());\n\t\t}\t\n\t}", "function get_request_files($surveyid, $requestid)\n\t{\t\n\t\t//get all survey licensed files\n\t\t$files=$this->get_survey_licensed_files($surveyid);\t\t\n\t\t\t\n\t\t//get download options already set\n\t\t$options=$this->get_request_download_options($requestid);\t\t\n\t\t$result=NULL;\t\t\n\t\tif ($files)\n\t\t{\n\t\t\tforeach($files as $file)\n\t\t\t{\n\t\t\t\tif ($options)\n\t\t\t\t{\n\t\t\t\t\tforeach($options as $option)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($file['resource_id']==$option['fileid'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$file['download']=$option;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t$result[]=$file;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn $result;\n\t}", "public function loadFilesVendor()\r\n {\r\n $id = Input::get('ID');\r\n $uid = Input::get('UID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null)\r\n {\r\n $rol = $this->getRol($uid);\r\n $internalFiles = $project->filesByType(array('vendor',$rol));\r\n foreach($internalFiles as $file)\r\n {\r\n $files[]=['id'=>$file->id,'name'=>$file->fileName,'url'=>$file->url];\r\n }\r\n }\r\n return json_encode($files);\r\n }", "public function testAddVendorComplianceSurveyFileByURL()\n {\n }", "public function testAddVendorComplianceSurveyFile()\n {\n }", "function getInquiryFiles($inquiryId) {\n\t\t$sql = \"\n\t\t\tSELECT\n\t\t\t\tF.Id AS Id,\n\t\t\t\tF.Name AS Name\n\t\t\tFROM ServiceRequestFiles SRF, Files F\n\t\t\tWHERE\n\t\t\t\tSRF.ServiceRequest_Id = \".$inquiryId.\" AND\n\t\t\t\tSRF.File_Id = F.Id\";\n\t\t$result = mysql_query($sql);\n\t\tif (!$result) {\n\t\t\treturn;\n\t\t}\n\n\t\t$files = array();\n\t\twhile ($row = mysql_fetch_assoc($result)) {\n\t\t\t$files[] = array('name' => $row['Name'], 'idAndChecksum' => $row['Id'].':'.CheckSum($row['Id']));\n\t\t}\n\n\t\tmysql_free_result($result);\n\t\treturn $files;\n\t}", "protected function addVendorComplianceSurveyFileRequest($vendor_compliance_survey_id, $file_name)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyFile'\n );\n }\n // verify the required parameter 'file_name' is set\n if ($file_name === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $file_name when calling addVendorComplianceSurveyFile'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/file/{fileName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($file_name !== null) {\n $resourcePath = str_replace(\n '{' . 'fileName' . '}',\n ObjectSerializer::toPathValue($file_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getFiles() {}", "public function getFiles ();", "public function testDeleteVendorComplianceSurveyFile()\n {\n }", "public function getFiles();", "public function getFiles();", "public function getFiles();", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "protected function addVendorComplianceSurveyFileByURLRequest($body, $vendor_compliance_survey_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling addVendorComplianceSurveyFileByURL'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyFileByURL'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function get_files()\n {\n }", "public function getFiles() {\r\n\r\n $files = array();\r\n\r\n $userId= $this->userId;\r\n $trackingId = $this->trackingFormId;\r\n $dir = FILEPATH . $userId. '/' . $trackingId;\r\n\r\n if (is_dir($dir)) {\r\n if ($dh = opendir($dir)) {\r\n while (($file = readdir($dh)) !== false) {\r\n if($file != '.' && $file != '..') {\r\n $size = $this->Size($dir . '/' . $file);\r\n array_push($files, array('name'=>$file,\r\n 'urlfilename'=>urlencode($file),\r\n 'size'=>$size));\r\n }\r\n }\r\n closedir($dh);\r\n }\r\n }\r\n\r\n return $files;\r\n }", "public function testIsVendorFileReturnsTrueIfFileIsLocatedInVendorDirectory()\n {\n $this->assertTrue(VendorResources::isVendorFile($this->getVendorFilePath()));\n }", "public function get_file_requests(){\n\t\t\t\t$res = [];\n\t\t\t\t$my_id = $this->session->userdata(\"user_id\");\n\t\t\t\t$param[\"where\"] = array(\"user_id\"=> $my_id, \"status \"=> \"joined\");\n\t\t\t\t$param[\"select\"] = \"company_id\";\n\t\t\t\t$getCom = $this->MY_Model->getRows(\"tbl_user_company\", $param, \"obj\");\n\t\t\t\t$my_comp = [];\n\t\t\t if(!empty($getCom)){\n\t\t\t\tforeach ($getCom as $comp) {\n\t\t\t\t\tarray_push($my_comp, $comp->company_id);\n\t\t\t\t}\n\t\t\t }\n\t\t\t\t$request_data = $this->db->\n\t\t\t\t\tselect(\"*\")->\n\t\t\t\t\tfrom('tbl_requests r')->\n\t\t\t\t\tjoin('tbl_companies c', \"r.company_id = c.company_id\")->\n\t\t\t\t\twhere_in(\"r.company_id\", $my_comp)->\n\t\t\t\t\tget()->result();\n\t\t\t\tif(!empty($request_data)){\n\t\t\t\t\t$results = $request_data;\n\t\t\t\t\tforeach ($results as $result) {\n\t\t\t\t\t\tif($result->request_status == \"Completed\"){\n\t\t\t\t\t\t\t$r_id = $result->request_id;\n\t\t\t\t\t\t\t$approvedData = $this->db->\n\t\t\t\t\t\t\t\t\tselect(\"*\")->\n\t\t\t\t\t\t\t\t\tfrom('tbl_files f')->\n\t\t\t\t\t\t\t\t\tjoin('tbl_requested_files rf', \"f.files_id = rf.fk_file_id\")->\n\t\t\t\t\t\t\t\t\tjoin('tbl_requests r', \"r.request_id = rf.fk_requested_id \")->\n\t\t\t\t\t\t\t\t\tjoin('tbl_companies c', \"r.company_id = c.company_id\")->\n\t\t\t\t\t\t\t\t\twhere(\"r.request_id\", $r_id)->\n\t\t\t\t\t\t\t\t\tget()->result();\n\t\t\t\t\t\t\tif(!empty($approvedData)){\n\t\t\t\t\t\t\t\t$get_attached = $this->db->\n\t\t\t\t\t\t\t\t\tselect(\"file_name\")->\n\t\t\t\t\t\t\t\t\tfrom('tbl_files f')->\n\t\t\t\t\t\t\t\t\tjoin('tbl_requested_files rf', \"f.files_id = rf.fk_file_id\")->\n\t\t\t\t\t\t\t\t\twhere('rf.fk_requested_id', $r_id)->\n\t\t\t\t\t\t\t\t\tget()->result_array();\n\t\t\t\t\t\t\t\t\t$approvedData[0]->{\"attachments\"} = $get_attached;\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t array_push($res, $approvedData[0]);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tarray_push($res, $result);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t echo json_encode($res);\n\t\t}", "function &getCVs() {\n $suppFileDao =& DAORegistry::getDAO('SuppFileDAO');\n return $suppFileDao->getSuppFilesByArticleTypeAndAssocId($this->getArticleId(), SUPP_FILE_CV, $this->getId());\n\t}", "public function loadFilesProduction()\r\n {\r\n $id = Input::get('ID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null)\r\n {\r\n $internalFiles = $project->filesByType(array('vendor','university','designer','writer','attorney','2d'));\r\n foreach($internalFiles as $file)\r\n {\r\n $files[]=['id'=>$file->id,'name'=>$file->fileName,'url'=>$file->url,'date'=>$file->created_at];\r\n }\r\n }\r\n return json_encode($files);\r\n }", "public function testGetVendorComplianceSurveyByFilter()\n {\n }", "public function testIsVendorFileReturnsTrueIfVendorDirectoryIsProvided()\n {\n $directory = dirname($this->getVendorFilePath());\n $this->assertTrue(VendorResources::isVendorFile($directory));\n }", "public function getOtherFiles(): array;", "public function loadFilesILCVendors()\r\n {\r\n $id = Input::get('ID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null)\r\n {\r\n $internalFiles = $project->filesByType(array('ilcVendors'));\r\n foreach($internalFiles as $file)\r\n {\r\n $created = date('m-d-Y',strtotime(str_replace('-','/',$file->created_at)));\r\n $files[]=['id'=>$file->id,'name'=>$file->fileName,'url'=>$file->url,'created'=>$created];\r\n }\r\n }\r\n return json_encode($files);\r\n }" ]
[ "0.6860435", "0.66414535", "0.65964895", "0.6038706", "0.58677894", "0.5808163", "0.57320565", "0.5643674", "0.561282", "0.55950725", "0.55810714", "0.55452764", "0.55452764", "0.55452764", "0.5507607", "0.5507478", "0.550697", "0.550697", "0.550697", "0.55004233", "0.54698414", "0.5431033", "0.53923273", "0.5384807", "0.5382782", "0.5381707", "0.534928", "0.5282745", "0.5266334", "0.5241549" ]
0.6881038
0
Test case for getVendorComplianceSurveyTags Get the tags for a vendorComplianceSurvey..
public function testGetVendorComplianceSurveyTags() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getVendorComplianceSurveyTagsRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getVendorComplianceSurveyTags'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/tag';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testAddVendorComplianceSurveyTag()\n {\n }", "public function getTags() {}", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTagList();", "public function generateTags() : array\n {\n return ['company'];\n }", "public function test_getLegacyLowstockContactTags() {\n\n }", "public function listTags() {\n\t\t$request = $this->send(\"GET\", \"contacts/\" . $this->contactId . '/tags', [\n\t\t\t'headers' => [\n\t\t\t\t'Accept' => 'application/json, */*',\n\t\t\t],\n\t\t]);\n\t\treturn $request;\n\t}", "protected function addVendorComplianceSurveyTagRequest($vendor_compliance_survey_id, $vendor_compliance_survey_tag)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyTag'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_tag' is set\n if ($vendor_compliance_survey_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_tag when calling addVendorComplianceSurveyTag'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/tag/{vendorComplianceSurveyTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyTag' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getTags():array;", "public function getTags() {\n try {\n $getTagsOperation = new GetTags();\n\n $getTagsResponse = $this->apiCall($getTagsOperation);\n $tagsList = $getTagsResponse->getData();\n\n if ($getTagsResponse->isSuccess()) {\n\n $response = [];\n\n if(is_array($tagsList) && count($tagsList) > 0) {\n foreach ($tagsList as $item) {\n $response[] = [\n 'id' => $item['tagId'],\n 'name' => $item['name']\n ];\n }\n }\n return $response;\n }\n }catch (\\Exception $e){\n throw new \\Exception($e->getMessage());\n }\n }", "public function getTagsValues() {}", "public function getTagsValues() {}", "public function getTagsValues() {}", "public function getTagsValues() {}", "public function getTags() {\n\t\t$sql = \"SELECT tags FROM question\";\n\t\t$this->db->execute($sql);\n\t\treturn $this->db->fetchAll();\n\t}", "public function testDeleteVendorComplianceSurveyTag()\n {\n }", "function gettagdata()\n{\n\t$cf = new Fwcore();\n\t\n\t$data = array();\n\t$data['auth_token'] = $_POST['auth_token'];\n\t$data['tag_id'] = $_POST['category_id'];\n $data['api_version'] = $_POST['api_version'];\n\t$data['app_id'] = isset($_POST['app_id']) != '' ? $_POST['app_id'] : '';\n\t$cf->viewProductsTagList($data);\n}", "function getTagsToOmitt() {\n\t\t$tagArray = array();\n\n\t\t// if there are tags to exclude: add them to the list\n\t\tif ($this->conf['excludeTags']) {\n\t\t\t$tagArray = GeneralUtility::trimExplode(',', $this->conf['excludeTags'], 1);\n\t\t}\n\n\t\t// if configured: add tags used by the term definitions\n\t\tif ($this->conf['autoExcludeTags'] > 0) {\n\t\t\t;\n\t\t\tforeach ($this->conf['types.'] as $key => $type) {\n\t\t\t\tif (!empty($type['tag']) && !in_array($type['tag'], $tagArray)) {\n\t\t\t\t\t$tagArray[] = $type['tag'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$tagList = implode(',', $tagArray);\n\n\t\treturn $tagList;\n\t}", "private function get_tags()\n\t{\n\t\t$this->n_tags = true;\n\t\treturn $this->m_tags;\n\t}", "private function get_tags()\n\t{\n\t\t$this->n_tags = true;\n\t\treturn $this->m_tags;\n\t}", "public function getTags()\n {\n $response = $this->client->post('tags', $this->config);\n\n $tags = new IntegrationTagsCollection;\n if ($response->getStatusCode() == 200 and $result = @json_decode($response->getBody())) {\n\n if (is_array($result) && count($result) > 0) {\n foreach ($result as $key => $tag) {\n $tags->push(new IntegrationTag([\n 'id' => $tag->tag_id,\n 'name' => $tag->tag_name,\n ]));\n }\n }\n }\n\n return $tags;\n }", "public function get_tags(){\n\t \n\t return $this->tags;\n\t}", "protected function deleteVendorComplianceSurveyTagRequest($vendor_compliance_survey_id, $vendor_compliance_survey_tag)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling deleteVendorComplianceSurveyTag'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_tag' is set\n if ($vendor_compliance_survey_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_tag when calling deleteVendorComplianceSurveyTag'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/tag/{vendorComplianceSurveyTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyTag' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getTags()\n {\n return $this->data['fields']['tags'];\n }", "public function testTags()\n\t{\n\t\t$this->call('GET', '/api/tags');\n\t}" ]
[ "0.6616804", "0.5905149", "0.5772295", "0.56880504", "0.56880504", "0.56880504", "0.56880504", "0.56880504", "0.5607604", "0.55937177", "0.5513079", "0.5506694", "0.55006987", "0.54496014", "0.5432742", "0.53936124", "0.53936124", "0.53936124", "0.53936124", "0.5388668", "0.5307429", "0.530137", "0.5270046", "0.5268478", "0.5268478", "0.52682704", "0.5268052", "0.52676255", "0.52658683", "0.5236465" ]
0.6943422
0
Test case for updateVendorComplianceSurvey Update a vendorComplianceSurvey.
public function testUpdateVendorComplianceSurvey() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }", "public function updateVendorComplianceSurvey($body)\n {\n $this->updateVendorComplianceSurveyWithHttpInfo($body);\n }", "public function testDeleteVendorComplianceSurvey()\n {\n }", "protected function deleteVendorComplianceSurveyRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling deleteVendorComplianceSurvey'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testUpdateSurvey0()\n {\n }", "public function testUpdateSurvey0()\n {\n }", "public function testUpdateSurvey()\n {\n $survey = Survey::factory()->create();\n\n $response = $this->json('PATCH', \"survey/{$survey->id}\", [\n 'survey' => ['epilogue' => 'epilogue your behind']\n ]);\n\n $response->assertStatus(200);\n $this->assertDatabaseHas('survey', ['id' => $survey->id, 'epilogue' => 'epilogue your behind']);\n }", "public function testUpdateSurveyQuestion0()\n {\n }", "public function testUpdateSurveyQuestion0()\n {\n }", "public function testAddVendorComplianceSurvey()\n {\n }", "public function testGetVendorComplianceSurveyById()\n {\n }", "protected function addVendorComplianceSurveyAuditRequest($vendor_compliance_survey_id, $vendor_compliance_survey_audit)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling addVendorComplianceSurveyAudit'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_audit' is set\n if ($vendor_compliance_survey_audit === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_audit when calling addVendorComplianceSurveyAudit'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/audit/{vendorComplianceSurveyAudit}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_audit !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyAudit' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_audit),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function updateVendorComplianceSurveyRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling updateVendorComplianceSurvey'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updateVendorComplianceSurveyWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateVendorComplianceSurveyRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "protected function getDuplicateVendorComplianceSurveyByIdRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getDuplicateVendorComplianceSurveyById'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/duplicate/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updateVendorComplianceSurveyAsync($body)\n {\n return $this->updateVendorComplianceSurveyAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function update(Request $request, ClientSurvey $clientSurvey)\n {\n //\n }", "public function testUpdateSurveyQuestionChoice0()\n {\n }", "public function testUpdateSurveyQuestionChoice0()\n {\n }", "protected function getVendorComplianceSurveyByIdRequest($vendor_compliance_survey_id)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling getVendorComplianceSurveyById'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updated(CustomerInquiry $customerInquiry)\n {\n\n }", "public function addVendorComplianceSurvey($body)\n {\n list($response) = $this->addVendorComplianceSurveyWithHttpInfo($body);\n return $response;\n }", "public function testGetDuplicateVendorComplianceSurveyById()\n {\n }", "public function update($vendor);", "public function testDeleteVendorComplianceSurveyTag()\n {\n }", "protected function deleteVendorComplianceSurveyTagRequest($vendor_compliance_survey_id, $vendor_compliance_survey_tag)\n {\n // verify the required parameter 'vendor_compliance_survey_id' is set\n if ($vendor_compliance_survey_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_id when calling deleteVendorComplianceSurveyTag'\n );\n }\n // verify the required parameter 'vendor_compliance_survey_tag' is set\n if ($vendor_compliance_survey_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vendor_compliance_survey_tag when calling deleteVendorComplianceSurveyTag'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/{vendorComplianceSurveyId}/tag/{vendorComplianceSurveyTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($vendor_compliance_survey_id !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyId' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_id),\n $resourcePath\n );\n }\n // path params\n if ($vendor_compliance_survey_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'vendorComplianceSurveyTag' . '}',\n ObjectSerializer::toPathValue($vendor_compliance_survey_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function update(Request $request, Survey $survey)\n {\n //\n }", "public function update($vendorId, $vendorContactId)\n\t{\n\t\t$validator = Validator::make(\n array('intVendorId'=>$vendorId,'intVendorContactId' => $vendorContactId),\n array('intVendorId'=>'required|numeric','intVendorContactId' => 'required|numeric')\n );\n\n if($validator->fails())\n {\n return $this->respondBadRequest('Invalid Inputs.');\n }\n $vendorContact = VendorContact::find($vendorContactId);\n\n if (!$vendorContact) {\n return $this->respondNotFound('Vendor contact does not exist.');\n }\n if ($vendorContact->intVendorId != $vendorId) {\n return $this->respondBadRequest('Vendor and contact mismatch.');\n }\n $validator = Validator::make(\n Input::get(),\n array(\n 'contactName' => 'sometimes|alpha_spaces|max:200',\n 'contactDesignation' => 'sometimes|alpha_spaces|max:200',\n 'contactEmail' => 'sometimes|email|max:200',\n 'contactPhone1' => 'sometimes|alpha_spaces|max:20',\n 'contactPhone2' => 'sometimes|alpha_spaces|max:20'\n ));\n if ($validator->fails()) {\n return $this->respondBadRequest('Invalid input.', array('app_error' => $validator->messages()->toArray()));\n }\n\n $vendorContact->strContactFullName =Input::get('contactName')?Input::get('contactName'):$vendorContact->strContactFullName;\n $vendorContact->strContactDesgnation =Input::get('contactDesignation')?Input::get('contactDesignation'):$vendorContact->strContactDesgnation;\n $vendorContact->strContactEmail =Input::get('contactEmail')?Input::get('contactEmail'):$vendorContact->strContactEmail;\n $vendorContact->strContactPhone1 =Input::get('contactPhone1')?Input::get('contactPhone1'):$vendorContact->strContactPhone1;\n $vendorContact->strContactPhone2 =Input::get('contactPhone2')?Input::get('contactPhone2'):$vendorContact->strContactPhone2;\n\n try {\n $vendorContact->save();\n } catch (\\Exception $e) {\n return $this->respondInternalError('Unable to save Vendor contact.');\n }\n $insertedVendorContact = VendorContact::find($vendorContact->intVendorContactId);\n return $this->setStatusCode(ApiController::HTTP_CREATED)->respond($this->vendorContactTransformer->transform($insertedVendorContact));\n\n\n\t\t\n\t}", "public function testDeleteVendorComplianceSurveyFile()\n {\n }", "public function testWebinarRegistrantQuestionUpdate()\n {\n }" ]
[ "0.75309944", "0.6505394", "0.64308417", "0.6350889", "0.6316221", "0.6316221", "0.6225809", "0.60116196", "0.60116196", "0.58700883", "0.5862898", "0.5855638", "0.58488756", "0.58447593", "0.5816928", "0.57988924", "0.5793409", "0.57602024", "0.57602024", "0.57500476", "0.566911", "0.5662243", "0.5645011", "0.56076694", "0.5607439", "0.5531243", "0.5459324", "0.5434977", "0.5345367", "0.53319" ]
0.86415166
0
Test case for updateVendorComplianceSurveyCustomFields Update a vendorComplianceSurvey custom fields.
public function testUpdateVendorComplianceSurveyCustomFields() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateVendorComplianceSurveyCustomFields($body)\n {\n $this->updateVendorComplianceSurveyCustomFieldsWithHttpInfo($body);\n }", "public function testUpdateVendorComplianceSurvey()\n {\n }", "public function test_updateReplenishmentProcessCustomFields() {\n\n }", "public function testUpdateReplenishmentCustomFields()\n {\n }", "public function test_updateCustomerCustomFields() {\n\n }", "public function updateVendorComplianceSurveyCustomFieldsAsync($body)\n {\n return $this->updateVendorComplianceSurveyCustomFieldsAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function updateVendorComplianceSurveyCustomFieldsWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateVendorComplianceSurveyCustomFieldsRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "protected function updateVendorComplianceSurveyCustomFieldsRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling updateVendorComplianceSurveyCustomFields'\n );\n }\n\n $resourcePath = '/beta/vendorComplianceSurvey/customFields';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updateVendorCustomFields($body)\n {\n list($response, $statusCode, $httpHeader) = $this->updateVendorCustomFieldsWithHttpInfo ($body);\n return $response; \n }", "public function testUpdateExternalShipmentCustomFields()\n {\n }", "public function testUpdatePackingPlanCustomFields()\n {\n }", "public function test_updateBillingCodeTypeCustomFields() {\n\n }", "public function testUpdateOrderCustomFields()\n {\n }", "public function test_updateExternalShipmentCustomFields() {\n\n }", "public function updateVendorComplianceSurveyCustomFieldsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateVendorComplianceSurveyCustomFieldsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "function update($spec, $fields, $custom_fields=array()) {\n\t\t$set = array();\n\t\tforeach($fields as $field) $set[] = \"{{$field}}=?\";\n\t\t$set = array_merge($set, $custom_fields);\n\t\t$set = implode(', ', $set);\n\t\t$base = \"UPDATE {$spec['from']} SET {$set} \";\n\t\tif(isset($spec['join'])) {\n\t\t\t$spec['where'] = array(\"{$spec['select'][0]} IN ({$this->select($spec)})\");\n\t\t\t$spec['join'] = null;\n\t\t}\n\t\t$spec['select'] = $spec['from'] = $spec['order_by'] = $spec['offset'] = null; // irrelevant fields\n\t\treturn $this->quoteIdentifiers($this->aliasFields($base . $this->compile($spec), false));\n\t}", "public function testUpdateExtraFields(): void { }", "public function updated(CustomerInquiry $customerInquiry)\n {\n\n }", "public function modifyCustomFields(array $documentFields = array())\n {\n # PUT /accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/fields\n }", "public function saveCustom()\n {\n // Look through all of the updated fields to see if there are any Custom fields\n foreach ($this->updatedFields as $id => $updatedField) {\n\n // Translates WarrantyExpiration to \"Warranty Expiration\" for use with searching for the customID\n if (array_key_exists($updatedField, $this->customFieldMap)) {\n $realField = $this->customFieldMap[$updatedField];\n } else {\n $realField = $updatedField;\n }\n\n // Now see if Warranty Expiration is in the list of Custom fields\n if (array_key_exists($realField, $this->customFields)) {\n\n // If it is, get the ID needed for the API call\n $customID = $this->customFields[$realField];\n\n $args = [];\n $args['fieldId'] = $customID;\n // The value is stored in the main details array using WarrantyExpiration\n $args['value'] = $this->details->$updatedField;\n $args['id'] = $this->ID;\n $this->api->_request('POST', '/api/SetCustomFieldForAsset'.\"?\".http_build_query($args));\n // Remove it from the updatedFields list so the main save() doesn't try to update it\n unset($this->updatedFields[$id]);\n }\n }\n\n }", "protected function _updatefields() {}", "function add_vendor_custom_fields() {\n\n\twp_nonce_field( basename( __FILE__ ), 'vendor_custom_fields_nonce' );\n\t?>\n\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-firstname\"><?php esc_html_e( 'First Name', 'woocommerce-product-vendors' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" class=\"input-text\" name=\"firstname\" id=\"wcpv-firstname\" value=\"<?php if ( ! empty( $_POST['firstname'] ) ) echo esc_attr( trim( $_POST['firstname'] ) ); ?>\" tabindex=\"1\" />\n\t</div>\n\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-lastname\"><?php esc_html_e( 'Last Name', 'woocommerce-product-vendors' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" class=\"input-text\" name=\"lastname\" id=\"wcpv-lastname\" value=\"<?php if ( ! empty( $_POST['lastname'] ) ) echo esc_attr( trim( $_POST['lastname'] ) ); ?>\" tabindex=\"2\" />\n\t</div>\n\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-date_of_birth\"><?php esc_html_e( 'Date of birth', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"date\" name=\"date_of_birth\" id=\"wcpv-date_of_birth\" value=\"<?php if ( ! empty( $_POST['date_of_birth'] ) ) echo esc_attr( trim( $_POST['date_of_birth'] ) ); ?>\" placeholder=\"DD / MM / YY\" />\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-address\"><?php esc_html_e( 'Personal Address', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"address\" id=\"wcpv-address\" value=\"<?php if ( ! empty( $_POST['address'] ) ) echo esc_attr( trim( $_POST['address'] ) ); ?>\" />\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-city\"><?php esc_html_e( 'City', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"city\" id=\"wcpv-city\" value=\"<?php if ( ! empty( $_POST['city'] ) ) echo esc_attr( trim( $_POST['city'] ) ); ?>\" />\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-zipcode\"><?php esc_html_e( 'Zip', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"zipcode\" id=\"wcpv-zipcode\" value=\"<?php if ( ! empty( $_POST['zipcode'] ) ) echo esc_attr( trim( $_POST['zipcode'] ) ); ?>\" />\n\t</div>\n\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-taxid\"><?php esc_html_e( 'Tax ID', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"taxid\" id=\"wcpv-taxid\" value=\"<?php if ( ! empty( $_POST['taxid'] ) ) echo esc_attr( trim( $_POST['taxid'] ) ); ?>\" />\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-business_address\"><?php esc_html_e( 'Business Address', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"business_address\" id=\"wcpv-business_address\" value=\"<?php if ( ! empty( $_POST['business_address'] ) ) echo esc_attr( trim( $_POST['business_address'] ) ); ?>\" />\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-bcity\"><?php esc_html_e( 'Business City', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"bcity\" id=\"wcpv-bcity\" value=\"<?php if ( ! empty( $_POST['bcity'] ) ) echo esc_attr( trim( $_POST['bcity'] ) ); ?>\" />\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-bzipcode\"><?php esc_html_e( 'Business Zip', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"bzipcode\" id=\"wcpv-bzipcode\" value=\"<?php if ( ! empty( $_POST['bzipcode'] ) ) echo esc_attr( trim( $_POST['bzipcode'] ) ); ?>\" />\n\t</div>\n\n\t<?php\n}", "function update( $update_fields ) {\n\n $query = \"UPDATE \" . $this->partner_code_table . \" \" .\n \"SET pc_name = '\" . $this->gCI->db->escape_string( $update_fields['pc_name'] ) . \"', \" .\n \"pc_code = '\" . $this->gCI->db->escape_string( $update_fields['pc_code'] ) . \"', \" .\n \"pc_location = '\" . $update_fields['pc_location'] . \"', \" .\n \"pc_order = '\" . $update_fields['pc_order'] . \"', \" .\n \"pc_exclusions = '\" . $update_fields['pc_exclusions'] . \"' \" .\n \"WHERE pc_id='\" . $update_fields['pc_id'] . \"'\";\n return ( $this->gCI->db->query( $query ) );\n }", "public function testCustomerCustomFieldsAreInvalid(): void\n {\n $customer = $this->createConfiguredMock(CustomerEntity::class, [\n 'getCustomFields' => ['mollie_payments' => 'foo']\n ]);\n\n $search = $this->createConfiguredMock(EntitySearchResult::class, [\n 'first' => $customer\n ]);\n\n $this->customerRepository->entitySearchResults = [$search];\n\n $customerStruct = $this->customerService->getCustomerStruct('fakeId', $this->createMock(Context::class));\n\n $actual = json_encode($customerStruct);\n $expected = '{\"extensions\":[]}';\n\n $this->assertEquals($actual, $expected);\n }", "public function testCustomFields()\n {\n // create\n $customField = $this->_getCustomField();\n $createdCustomField = $this->_instance->addCustomField($customField);\n $this->_objects[] = $createdCustomField;\n $this->assertEquals($customField->name, $createdCustomField->name);\n $this->assertNotNull($createdCustomField->getId());\n \n // fetch\n $application = Tinebase_Application::getInstance()->getApplicationByName('Tinebase');\n $appCustomFields = $this->_instance->getCustomFieldsForApplication(\n $application->getId()\n );\n $this->assertGreaterThan(0, count($appCustomFields));\n $this->assertEquals($application->getId(), $appCustomFields[0]->application_id);\n\n // check with model name\n $appCustomFieldsWithModelName = $this->_instance->getCustomFieldsForApplication(\n $application->getId(),\n $customField->model\n );\n $this->assertGreaterThan(0, count($appCustomFieldsWithModelName));\n $this->assertEquals($customField->model, $appCustomFieldsWithModelName[0]->model, 'didn\\'t get correct model name');\n \n // check if grants are returned\n $this->_instance->resolveConfigGrants($appCustomFields);\n $accountGrants = $appCustomFields->getFirstRecord()->account_grants;\n sort($accountGrants);\n $this->assertEquals(Tinebase_Model_CustomField_Grant::getAllGrants(), $accountGrants);\n \n // delete\n $this->_instance->deleteCustomField($createdCustomField);\n $this->setExpectedException('Tinebase_Exception_NotFound');\n $this->_instance->getCustomField($createdCustomField->getId());\n $this->_objects = array();\n }", "public function test_updateLegacyLowstockContact() {\n\n }", "public function testCustomerPaymentMethodUpdateCustomerPaymentMethodBycustomerIdcustomerPaymentMethodId()\n {\n }", "public function testDeleteVendorComplianceSurvey()\n {\n }", "protected function addOrderCustomFields(): void\n {\n $custom_field_set_id = md5('Viacash custom_field_set');\n\n $this->container->get('custom_field_set.repository')->upsert(\n [\n [\n 'id' => $custom_field_set_id,\n 'name' => 'custom_viacash',\n 'config' => [\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Viacash\", \"en-GB\" => \"Viacash\"]),\n \"translated\" => true\n ],\n 'active' => true,\n 'global' => false,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field_set_relation.repository')->upsert(\n [\n [\n 'id' => md5('Viacash custom_field_set_relation'),\n 'customFieldSetId' => $custom_field_set_id,\n 'entityName' => 'order',\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_checkout_token'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_checkout_token',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Checkout-Token\", \"en-GB\" => \"Viacash Checkout-Token\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 1\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_slip_id'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_slip_id',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Slip-ID\", \"en-GB\" => \"Viacash Slip-ID\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 2\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_division_id'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_division_id',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Interne Barzahlen Divisions-Nummer\", \"en-GB\" => \"Internal Viacash division number\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 3\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_is_sandboxed'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_is_sandboxed',\n 'type' => 'switch',\n 'config' => [\n 'type' => 'switch',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Sandbox-Transaktion\", \"en-GB\" => \"Viacash sandboxed transaction\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"switch\",\n \"customFieldPosition\" => 4\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_refundable_amount'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_refundable_amount',\n 'type' => 'number',\n 'config' => [\n 'type' => 'number',\n \"label\" => $this->injectFallbackLanguage([\n \"de-DE\" => \"Verbleibender per Barzahlen erstattbarer Betrag\",\n \"en-GB\" => \"Remaining amount that can be refunded with Viacash\",\n ]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"number\",\n \"customFieldPosition\" => 5\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_validity_days'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_validity_days',\n 'type' => 'number',\n 'config' => [\n 'type' => 'number',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Gültigkeitsdauer des Zahlscheins in Tagen\", \"en-GB\" => \"Days of payslip validity.\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"number\",\n \"customFieldPosition\" => 5\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n }", "function updateCustomFields($dbData, $xmlSAMLAssertion, $settings)\n\t{\n\t\t$customFields = $this->getCustomFields($settings, 'update');\n\n\t\tif (count($customFields) == 0)\n\t\t{\n\t\t\t$GLOBALS['log']->debug(\"No custom fields! So returning 0.\"); // JMH\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$user = new User();\n\t\t$user->retrieve($dbData['id']);\n\t\t$GLOBALS['log']->debug(\"updateCF()... userid={$user->id}\"); // JMH\n\t\t\n\t\t$xmlDoc = new DOMDocument();\n\t\t$xmlDoc->loadXML(base64_decode($xmlSAMLAssertion));\n\t\t$xpath = new DOMXpath($xmlDoc);\n\t\t$GLOBALS['log']->debug(\"Created xpath object.\"); // JMH\n\t\t\n\t\t$customFieldUpdated = false;\n\t\t\n\t\tforeach ($customFields as $field)\n\t\t{\n\t\t\t$GLOBALS['log']->debug(\"Top of fields loop with $field.\"); // JMH\n\t\t\tif (!array_key_exists($field, $dbData))\n\t\t\t{\n\t\t\t\t$GLOBALS['log']->debug(\"$field is not in \\$dbData. \\n\\$dbData=\" . var_export($dbData, TRUE)); // JMH\n\t\t\t\t// custom field not listed in db query results!\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$customFieldValue = $dbData[$field];\n\t\t\t\n\t\t\t$xmlNodes = $xpath->query($settings->saml_settings['update'][$field]);\n\t\t\tif ($xmlNodes === false)\n\t\t\t{\n\t\t\t\t// malformed xpath!\n\t\t\t\t$GLOBALS['log']->debug(\"$field contains bad xpath: \" . $settings->saml_settings['update'][$field]); // JMH\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$GLOBALS['log']->debug(\"updateCF(): 3\"); // JMH\n\t\t\tif ($xmlNodes->length == 0)\n\t\t\t{\n\t\t\t\t// no nodes match xpath!\n\t\t\t\t$GLOBALS['log']->debug(\"$field no nodes match this xpath: \" . $settings->saml_settings['update'][$field]); // JMH\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$xmlValue = $xmlNodes->item(0)->nodeValue;\n\t\t\t$GLOBALS['log']->debug(\"$field xpath returned $xmlValue\"); // JMH\n\t\t\t\n\t\t\tif ($customFieldValue != $xmlValue)\n\t\t\t{\n\t\t\t\t// need to update our user record.\n\t\t\t\t$customFieldUpdated = true;\n\t\t\t\t$user->$field = $xmlValue;\n\t\t\t\t$GLOBALS['log']->debug(\"db is out of date. setting {$field} to {$xmlValue}\"); // JMH\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($customFieldUpdated)\n\t\t{\n\t\t\t$GLOBALS['log']->debug(\"updateCustomFields calling user->save() and returning 0\"); // JMH\n\t\t\t$user->save();\n\t\t\treturn 1;\n\t\t}\n\t\t\n\t\t$GLOBALS['log']->debug(\"updateCustomFields found no fields to update. Returning -1\"); // JMH\n\t\treturn -1;\n\t}" ]
[ "0.7293148", "0.70978254", "0.64022875", "0.63926035", "0.63646907", "0.6311234", "0.6274791", "0.6111963", "0.6109123", "0.6102106", "0.60357696", "0.5958321", "0.58887213", "0.58794284", "0.56927675", "0.5485317", "0.54340416", "0.541211", "0.54019564", "0.5349201", "0.5318303", "0.5302795", "0.5241631", "0.5202273", "0.5186028", "0.51796687", "0.51186717", "0.50695634", "0.50635284", "0.4999448" ]
0.86562884
0
Adds an expectation to this stage.
public function expect(TestStageExpectationInterface $expectation): self { $this->composite->addExpectation($expectation); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function expectAddEvent()\n {\n $this->eventPublisher->expects($this->once())\n ->method('addEvent')\n ->with(['uuid' => '123']);\n }", "public function addAssertions($assertions) {\n $total = $this->getAssertions() + $assertions;\n $this->setAssertions($total);\n }", "public function add_requirement( sn\\base\\requirement\\I_Requirement $requirement );", "public function addAssertion(Assertion\\AssertionInterface $assertion, $name = null)\n {\n if (null === $name) {\n $name = strtolower((new \\ReflectionClass($assertion))->getShortName());\n }\n\n $this->assertions[$name] = $assertion;\n }", "public function add(Actor $actor): self ;", "public function attachObserver(ISimulatorObserver $observer) {\r\n \t$this->_observers[] = $observer;\r\n }", "public function incAssertions()\n {\n $this->assertions += 1;\n }", "function testAdd() {\n $this->drupalGet(Url::fromRoute('linkit.matcher.add', [\n 'linkit_profile' => $this->linkitProfile->id(),\n ]));\n\n $edit = array();\n $edit['plugin'] = 'dummy_matcher';\n $this->drupalPostForm(NULL, $edit, t('Save and continue'));\n\n // Load the saved profile.\n $this->linkitProfile = Profile::load($this->linkitProfile->id());\n\n $matcher_ids = $this->linkitProfile->getMatchers()->getInstanceIds();\n /** @var \\Drupal\\linkit\\MatcherInterface $plugin */\n $plugin = $this->linkitProfile->getMatcher(current($matcher_ids));\n\n $this->assertRaw(t('Added %label matcher.', ['%label' => $plugin->getLabel()]));\n $this->assertNoText(t('No matchers added.'));\n }", "public function addAspect(IAspect $aspect);", "public function testAppendToItself()\n {\n $model1 = Animal::findOne(1);\n \n $this->expectExceptionMessage('You cannot move node relevant or under itself');\n \n $model1->appendTo($model1);\n }", "public function addAudit(Audit $audit);", "public function expectThat(string $expectation): TestGuy;", "public function add()\n {\n $calculator = new Calculator();\n $this->assertSame(4, $calculator->add(3, 1));\n }", "public function addAward(\\GT\\CriteriaAward $award){\n \n // If it already exists, don't append another one, update the existing object\n if ($award->isValid()){\n if ($this->awards){\n foreach($this->awards as $key => $awrd){\n if ($awrd->getID() == $award->getID()){\n $this->awards[$key] = $award;\n return;\n }\n }\n }\n }\n \n // Otherwise just append\n $this->awards[] = $award;\n }", "public function testAddRelated($screen_name, $expected_result, $message = '')\n {\n $this->intent->addRelated($screen_name);\n\n $related = self::getProperty($this->intent, 'related');\n $related = array_keys($related);\n $related = reset($related);\n $this->assertEquals(strtolower($expected_result), $related, $message);\n }", "public function addElement(TestInterface $element);", "private function setExpectations()\n {\n\n if ($this->status === $this->wish) {\n $this->bodyToClass();\n } else {\n $this->bodyToErrors();\n }\n }", "public function addFailures($failures) {\n $total = $this->getFailures()\n + $failures;\n $this->setFailures($total);\n }", "public function add_attachment(Attachment $attachment);", "public function testAdd()\n {\n $result = $this->calculator->add(1, 2);\n $this->assertEquals(3, $result);\n }", "public function addRequirements($team, array $requirements = []);", "public static function plus( Matcher $matcher ) {\n\t\treturn new static( $matcher, 1, INF, false );\n\t}", "public function add_test($test)\n {\n array_push($this->tests, $test);\n }", "public function expectsMethod($methodName) {\n\t\t\t$expectation = new InvocationExpectation($methodName);\n\t\t\tMockRegistry::addExpectation($this->className, $expectation);\n\t\t\treturn $expectation;\n\t\t}", "private function expect( $item, $type ) {\n\t\tif ( ! isset( $this->expected[ $type ] ) ) {\n\t\t\t$this->expected[ $type ] = array();\n\t\t}\n\t\t$this->expected[ $type ][] = $item;\n\t}", "public function addAnswer(AnswerInterface $answer);", "public function testAddReplenishmentAudit()\n {\n }", "public function addActor_addActorsToMovie() {\n // Arrange\n /** @var Movie */\n $movie = factory(Movie::class)->create();\n /** @var Actor */\n $actor = factory(Actor::class)->create();\n\n // Act\n $movie->addActor($actor);\n\n // Assert\n $returnedValue = $movie->hasActor($actor);\n assertTrue($returnedValue);\n }", "public function testAddOperation()\n\t{\n\t\t$this->adder->setA(42);\n\t\t$this->adder->add();\n\t\t$this->assertEquals(42, $this->adder->getSum(), 'dont added correctly');\n\t}", "public function addTestAssert($name, $arguments = null, $passed = true, $trace = null)\n\t{\n\t\t$this->testAsserts[] = [\n\t\t\t'name' => $name,\n\t\t\t'arguments' => (new Serializer)->normalize($arguments),\n\t\t\t'trace' => $trace,\n\t\t\t'passed' => $passed\n\t\t];\n\t}" ]
[ "0.55663633", "0.53616834", "0.50647366", "0.48396227", "0.48369572", "0.48033783", "0.47368506", "0.4664504", "0.46631527", "0.46377322", "0.45926043", "0.4503272", "0.4486392", "0.43957382", "0.4380737", "0.43514243", "0.43463093", "0.4341807", "0.43369317", "0.43289477", "0.4325335", "0.43157068", "0.4309212", "0.43031293", "0.42934582", "0.42933792", "0.42933142", "0.42470068", "0.4246819", "0.42442334" ]
0.63520926
0
Data that should be preloaded for the container. Templates/phrases may be accidentally (or intentionally) rendered in the view or before the container is set to be rendered. Preloading data here can allow all the data to be fetched at once.
protected function _preloadContainerData() { $this->preloadTemplate('page_nav'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _preload() {\n }", "protected function LoadData()\n\t{\n\t\t$head = $this->GetProject()->GetHeadCommit();\n\t\t$this->tpl->assign(\"head\",$head);\n\n\t\t$this->tpl->assign('page', $this->params['page']);\n\t\t$skip = $this->params['page'] * 100;\n\n\t\t$headlist = $this->GetProject()->GetHeadList()->GetOrderedHeads('-committerdate', 101, $skip);\n\t\tif (isset($headlist) && (count($headlist) > 0)) {\n\t\t\tif (count($headlist) > 100) {\n\t\t\t\t$headlist = array_slice($headlist, 0, 100);\n\t\t\t\t$this->tpl->assign('hasmoreheads', true);\n\t\t\t}\n\t\t\t$this->tpl->assign(\"headlist\", $headlist);\n\t\t}\n\t}", "public function before() {\n // Run anything that needs to run before this.\n parent::before();\n\n if ($this->auto_render) {\n // Initialize empty values\n $this->template->title = '';\n $this->template->meta_keywords = '';\n $this->template->meta_description = '';\n $this->template->meta_copywrite = '';\n $this->template->header = '';\n $this->template->content = '';\n $this->template->footer = '';\n $this->template->styles = array();\n $this->template->scripts = array();\n }\n }", "protected function preprocessData() {}", "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 }", "public function before()\n {\n // set data to display in view\n foreach ($this->_records as $row) {\n $this->data[] = [\n 'id' => $row->id,\n 'title' => $row->getLocaled('title'),\n 'date' => Date::convertToDatetime($row->created_at, Date::FORMAT_TO_HOUR)\n ];\n }\n }", "protected function prepareData()\n {\n parent::prepareData();\n $this->prepareConfigurableProductOptions();\n $this->prepareAttributeSet();\n }", "public static function loadTemplateData()\n {\n $templateId = 0;\n $app = Factory::getApplication();\n\n if ($app->isClient('site'))\n {\n $currentTemplate = $app->getTemplate(true);\n $templateId = $currentTemplate->id ?? 0;\n\n\t\t\t/**\n\t\t\t * If a page/menu is assigned to a specific template\n\t\t\t * then get the template ID.\n\t\t\t */\n\t\t\t$activeMenu = $app->getMenu()->getActive();\n\n\t\t\tif (!empty($activeMenu) && !empty($activeMenu->template_style_id))\n\t\t\t{\n\t\t\t\t$templateId = $activeMenu->template_style_id;\n\t\t\t}\n }\n else\n {\n if ($app->input->get('option') === 'com_ajax' && $app->input->get('helix') === 'ultimate')\n {\n $templateId = $app->input->get('id', 0, 'INT');\n }\n }\n\n\t\tif (empty($templateId))\n\t\t{\n\t\t\t$templateId = $app->input->get('helix_id', 0, 'INT');\n\t\t}\n\n if($templateId)\n {\n $template = [];\n\n $draftKeyOptions = [\n 'option' => 'com_ajax',\n 'helix' => 'ultimate',\n 'status' => 'draft',\n 'id' => $templateId\n ];\n\n $draftKey = self::generateKey($draftKeyOptions);\n $cache = new HelixCache($draftKey);\n\n /**\n * Check the fetch destination. If it is iframe then load the settings\n * from draft, otherwise if it is document that means this request\n * comes from the original site visit. So load from saved cache.\n */\n $requestFromIframe = $app->input->get('helixMode', '') === 'edit';\n \n if ($cache->contains() && $requestFromIframe)\n {\n $template = $cache->loadData();\n }\n else\n {\n $keyOptions = [\n 'option' => 'com_ajax',\n 'helix' => 'ultimate',\n 'status' => 'init',\n 'id' => $templateId\n ];\n \n $key = self::generateKey($keyOptions);\n $cache->setCacheKey($key);\n \n if ($cache->contains())\n {\n $template = $cache->loadData();\n }\n else\n {\n $template = self::getTemplateStyle($templateId); \n }\n }\n\n\t\t\tif (isset($template->template) && !empty($template->template))\n\t\t\t{\n\t\t\t\tif (!empty($template->params) && \\is_string($template->params))\n\t\t\t\t{\n\t\t\t\t\t$template->params = new Registry($template->params);\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * If params field is found empty in the database or cache then\n\t\t\t\t * read the default options.json file from the template and assign\n\t\t\t\t * the options as template params.\n\t\t\t\t */\n\t\t\t\telseif (empty($template->params))\n\t\t\t\t{\n\t\t\t\t\t$filePath = JPATH_ROOT . '/templates/' . $template->template . '/' . 'options.json';\n\n\t\t\t\t\tif (\\file_exists($filePath))\n\t\t\t\t\t{\n\t\t\t\t\t\t$defaultParams = \\file_get_contents($filePath);\n\t\t\t\t\t\t$template->params = new Registry($defaultParams);\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$template->params = new Registry;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn $template;\n\t\t\t}\n }\n\n $template = new \\stdClass;\n $template->template = 'system';\n $template->params = new Registry;\n\n return $template;\n }", "public function preInit()\n {\n $this->_viewEngine = Bigace_Services::get()->getService('view');\n }", "public function before()\n {\n parent::before();\n if($this->auto_render===TRUE)\n {\n \t// Load the template\n \t$this->template = View::factory($this->template);\n \t\n // Initialize empty values\n $this->template->title = 'Site name here';\n $this->template->meta_keywords = '';\n $this->template->meta_description = '';\n $this->template->meta_copywrite = 'Open Classifieds '.Core::version;\n $this->template->header = View::factory('header');\n $this->template->content = '';\n $this->template->footer = View::factory('footer');\n $this->template->styles = array();\n $this->template->scripts = array();\n }\n }", "public function before()\n {\n parent::before();\n\n if ($this->auto_render === TRUE)\n {\n // Load the template\n $this->template = View::factory($this->template);\n }\n }", "protected function prepareForPresentation()\n {\n if ($this->prepared) {\n return;\n }\n\n $this->permissionGroups = new Collection;\n $this->ungroupedPermissions = [];\n $this->groupedPermissionIndex = [];\n\n $this->loadPermissionsFromModules()\n ->loadCustomPermissions()\n ->loadCustomPermissionGroups()\n ->addUngroupedPermissionGroup()\n ->filterEmptyGroups();\n }", "public function __construct()\n {\n $this->templateData = array(\n // Any data that belongs to every template.\n );\n $this->before();\n }", "public function preRetrieve();", "public function prepareVars()\n {\n $this->vars['posts'] = $this->prepareHtml();\n $this->vars['model'] = $this->model;\n }", "public function toPreload()\n\t{\n\t\treturn array('web.Broker', 'template.Opt');\n\t}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }", "public function toPreload()\n\t{\n\t\treturn array('template.Opt');\n\t}", "public function prepareData()\r\n\t{\r\n\r\n\t\t// Get title and encode it\r\n\t\tif (empty($this->title)) {\r\n\t\t\t$this->title = urlencode(urlencode(html_entity_decode(get_the_title(), ENT_COMPAT, 'UTF-8')));\r\n\t\t}\r\n\r\n\t\t// Get current post permalink and encode it\r\n\t\tif (empty($this->shared_url)) {\r\n\t\t\t$this->shared_url = get_permalink(get_the_ID());\r\n\t\t}\r\n\r\n\t\t// Get excerpt and format it for Twitter\r\n\t\tif (empty($this->tweet)) {\r\n\t\t\t$tweet = (strlen(get_the_excerpt()) > 140) ? substr(get_the_excerpt(), 0, 140) . '...' : get_the_excerpt();\r\n\t\t\t$this->tweet = $tweet . ' ' . $this->shared_url;\r\n\t\t}\r\n\t}", "public function preRender()\n {\n }", "public function preRender()\n {\n }", "public function preRender()\n {\n }", "function block_editor_rest_api_preload(array $preload_paths, $block_editor_context)\n {\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n }", "public function generatePage_preProcessing() {}", "public function prepareShow()\n {\n $this->location();\n $this->type;\n $this->amenityIds();\n $this->utilityIds();\n $this->reviewCount();\n $this->user->location();\n $this->user->profilePicture();\n $this->user->reviewCount();\n $this->reviews = $this->reviews()->select('reviews.*')->withReviewer()->get();\n $this->coordinates;\n $this->imageRoutes();\n $this->image_ids = $this->images->pluck('id');\n }", "public function postLoad() {}", "public function prepareVars()\n {\n $this->vars['defaultCurrency'] = $this->defaultCurrency;\n $this->vars['defaultValue'] = $this->getPriceValue($this->defaultCurrency->id);\n $this->vars['currencies'] = Currency::orderBy('sort_order', 'ASC')->get();\n $this->vars['field'] = $this->formField;\n }", "protected function preProcess() {}", "private function initData()\n {\n $data = $this->cache->load($this->cacheId);\n if (false === $data) {\n /** @var Reader $reader */\n $reader = $this->readerFactory->create(\n ['fileName' => sprintf(self::SEARCH_PATTERN, $this->componentName)]\n );\n $data = $reader->read();\n $this->cache->save($this->serializer->serialize($data), $this->cacheId);\n } else {\n $data = $this->serializer->unserialize($data);\n }\n\n if (!empty($data)) {\n $this->data[$this->componentName] = [Converter::DATA_ATTRIBUTES_KEY => ['name' => $this->componentName]];\n $this->merge([$this->componentName => $data]);\n $this->data = $this->evaluateComponentArguments($this->data);\n }\n }" ]
[ "0.6343314", "0.61794156", "0.6103424", "0.60131645", "0.5975002", "0.59183383", "0.58694077", "0.58108115", "0.5806258", "0.57801545", "0.57638407", "0.576372", "0.5746515", "0.56977963", "0.56902516", "0.567335", "0.56337726", "0.56140476", "0.56065905", "0.5603404", "0.5603404", "0.5603404", "0.5557101", "0.55535144", "0.5547495", "0.5547046", "0.55449134", "0.5524521", "0.5524397", "0.5514614" ]
0.7710511
0
Fallback for rendering an "unrepresentable" message.
public function renderUnrepresentable() { return $this->renderError(new XenForo_Phrase('requested_page_is_unrepresentable_in_html')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function renderMessage() {}", "protected function renderAsError() {}", "public function render(): string\n {\n $message = new TextNode($this->notSupportedMessege);\n\n return $this->open() . $this->renderChildren() . $message . $this->close();\n }", "public function __toString()\n {\n try {\n return $this->render();\n } catch (ViewException $e) {\n return $e->getMessage();\n }\n }", "abstract protected function getNotFoundMessage();", "public function renderForNoPublicationHashSetInPiVarsReturnsPublishFailedMessage()\n {\n self::assertEquals(\n $this->fixture->translate('message_publishingFailed'),\n $this->fixture->render()\n );\n }", "public function testCellImplictRenderWithError(): void\n {\n $capture = function ($errno, $msg): void {\n restore_error_handler();\n $this->assertSame(E_USER_WARNING, $errno);\n $this->assertStringContainsString('Could not render cell - Cell template file', $msg);\n };\n set_error_handler($capture);\n\n $cell = $this->View->cell('Articles::teaserList');\n $cell->viewBuilder()->setTemplate('nope');\n (string)$cell;\n }", "public function testFlashFallback() {\n\t\t$result = $this->Flash->render('default');\n\t\t$expected = '<div class=\"message\">Default</div>';\n\t\t$this->assertContains($expected, $result);\n\t}", "public function render()\n {\n return $this->throw();\n }", "abstract public function renderHtmlMessage();", "public function handleRenderingFailureEvent(object $message): void;", "public function getUnknownText(): string\n {\n return htmlentities(__('[Unknown]'));\n }", "public function testViewWithBadTemplateOnRender()\n {\n (new BadTemplateView(new CalculatorModel(), 'badTemplate'))->render();\n }", "public function RenderNotFound () {\n\t\tif ($this->application->IsNotFoundDispatched()) return;\n\t\tthrow new \\ErrorException(\n\t\t\t\"Page not found: `\" . htmlspecialchars($this->request->GetFullUrl()) . \"`.\", 404\n\t\t);\n\t}", "public function notfoundAction()\n {\n $this->render('error/notfound');\n }", "public final function maybe_render()\n {\n }", "public final function maybe_render()\n {\n }", "public final function maybe_render()\n {\n }", "public function not_supported() {\n $this->load->view('errors/not-supported');\n }", "protected function message() {\n return sprintf(\n 'The [%s] object does not implement [%s]. It cannot be used to ' .\n 'decorate [%s]',\n $this->presenter,\n Presentable::class,\n get_class($this->presentable)\n );\n }", "protected function renderJsonNotFoundOutput()\n {\n return '{\"message\":\"Not found\"}';\n }", "protected function renderAsPlain() {}", "public function RenderError404PlainText ();", "public function RenderNotFound ($exceptionMessage = '');", "function render_error($message = 'error by unknown reason', $map = null) {\n\trender_page(\"error\", $message, $map);\n}", "public function formatNotFoundError()\n {\n return 'Given resource could not be found.';\n }", "public function NotFound() {\r\n\t\t$this->PrepareController();\r\n\t\t$this->View = 'notfound';\r\n\t\t$this->Render();\r\n }", "public static function missingContent()\n {\n return new static('Notification was not sent. You should specify message, stiker_id or attachment param.');\n }", "protected function getErrorMsgTemplate()\n {\n return 'The %s cast is ';\n }", "public function fallback()\n {\n throw new Horde_Tree_Exception('No fallback renderer found.');\n }" ]
[ "0.65093213", "0.63625646", "0.6214522", "0.59946907", "0.589575", "0.5884664", "0.58260334", "0.58171207", "0.57887864", "0.57400423", "0.5733457", "0.57104826", "0.5695828", "0.5675146", "0.56742424", "0.56395656", "0.56389743", "0.5638401", "0.5608438", "0.5605906", "0.5556121", "0.5555908", "0.55516577", "0.55470175", "0.55301195", "0.5502639", "0.5498721", "0.54984653", "0.54922277", "0.54656065" ]
0.7660824
0
Generate the form key based on IP address
private function generateFormkey() { $ip = $_SERVER['REMOTE_ADDR']; // mt_rand() is better than rand() $uniqid = uniqid(mt_rand(), true); return md5($ip . $uniqid); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getKey()\n {\n\treturn 'ip:' . $this->ip;\n }", "public static function generateKey()\n {\n return openssl_digest(php_uname() . \"-\" . $_SERVER[\"REMOTE_ADDR\"], 'MD5', true);\n }", "abstract protected function generateKey();", "function mswProdKeyGen() {\n $_SERVER['HTTP_HOST'] = (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : uniqid(rand(),1));\n $_SERVER['REMOTE_ADDR'] = (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] ? $_SERVER['REMOTE_ADDR'] : uniqid(rand(),1));\n if (function_exists('sha1')) {\n $c1 = sha1($_SERVER['HTTP_HOST'].date('YmdHis').$_SERVER['REMOTE_ADDR'].time());\n $c2 = sha1(uniqid(rand(),1).time());\n $prodKey = substr($c1.$c2,0,60);\n } elseif (function_exists('md5')) {\n $c1 = md5($_SERVER['HTTP_POST'].date('YmdHis').$_SERVER['REMOTE_ADDR'].time());\n $c2 = md5(uniqid(rand(),1),time());\n $prodKey = substr($c1.$c2,0,60);\n } else {\n $c1 = str_replace('.','',uniqid(rand(),1));\n $c2 = str_replace('.','',uniqid(rand(),1));\n $c3 = str_replace('.','',uniqid(rand(),1));\n $prodKey = substr($c1.$c2.$c3,0,60);\n }\n return strtoupper($prodKey);\n}", "function generate_key()\n\t{\n\t\treturn $this->key_prefix . md5( $this->key_prefix . microtime() . uniqid() . 'teamps' );\n\t}", "function generate_fingerprint() \n\t{\n\t\t//We don't use the ip-adress, because it is subject to change in most cases\n// \t\tforeach(array('ACCEPT_CHARSET', 'ACCEPT_ENCODING', 'ACCEPT_LANGUAGE', 'USER_AGENT') as $name) {\n// \t\t\t$key[] = empty($_SERVER['HTTP_'. $name]) ? NULL : $_SERVER['HTTP_'. $name];\n// \t\t}\n// \t\t//Create an MD5 has and return it\n// \t\treturn md5(implode(\"\\0\", $key));\n\t\t$secure_word = 'a39ccdef11305d5999dbccddcf4';\n\t\treturn md5($secure_word.$_SERVER['HTTP_USER_AGENT']);\t\t\n\t}", "private function generateKey(): string\n\t{\n\t\t// `+` and `/` are replaced by `-` and `_`, resp.\n\t\t// The other characters (a-z, A-Z, 0-9) are legal within an URL.\n\t\t// As the number of bytes is divisible by 3, no trailing `=` occurs.\n\t\treturn strtr(base64_encode(random_bytes(3 * self::RANDOM_ID_LENGTH / 4)), '+/', '-_');\n\t}", "function key_gen($str=''){\n\treturn str_replace('=','',base64_encode(md5($str)));\n}", "public function createKey()\n {\n return md5('Our-Calculator') . (time() + 60);\n }", "public function generateAuthKey() {\n $this->llaveAutenticacion = Yii::$app->security->generateRandomString();\n }", "public function generateKey()\n\t{\n\t\treturn substr(md5(uniqid(mt_rand(), true)), 0, 3) . substr(md5(uniqid(mt_rand(), true)), 0, 2);\n\t}", "public function generateKey()\n {\n return 'do.' . $this->token->user->id . '.' . preg_replace('/\\//', '.', $this->getUrl());\n }", "protected function _genRequestKey()\n {\n $hash = sprintf(\"%u\", crc32(serialize($this->_request)));\n $this->_setLastRequestKey($hash);\n return $hash;\n }", "private function generateApiKey(){\n\n return md5(uniqid(rand(), true));\n\n }", "private function buildSigningKey(): string {\r\n return \"$this->secret&$this->userSecret\";\r\n }", "function generate_key()\n{\n $pool = \"qwertzupasdfghkyxcvbnm\";\n $pool .= \"23456789\";\n $pool .= \"WERTZUPLKJHGFDSAYXCVBNM\";\n srand ((double)microtime()*1000000);\n for($index = 0; $index < 10; $index++)\n {\n $akti .= substr($pool,(rand()%(strlen ($pool))), 1);\n }\n return $akti;\n}", "public function generate_config_ftp_key()\n\t{\n\t\treturn random_str(32);\n\t}", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key() {\n\t\treturn \"Address\";\n\t}", "protected function generateEncryptionKeyIfNeeded() {}", "public function getFormkey()\n {\n // generate the key and store it inside the class\n $this->formkey = $this->generateFormkey();\n // store the form key in the session\n $_SESSION['formkey'] = $this->formkey;\n // output the form key\n return \"<input type='hidden' name='formkey' value='\" . $this->formkey . \"' />\";\n }", "private function generateApiKey()\n {\n return md5(uniqid(rand(), true));\n }" ]
[ "0.6912268", "0.68697757", "0.6544286", "0.64752644", "0.6238394", "0.61175805", "0.60931057", "0.6042118", "0.6022244", "0.59811956", "0.5977744", "0.59616995", "0.594829", "0.5937962", "0.5913995", "0.5904669", "0.58925515", "0.58887124", "0.58887124", "0.58887124", "0.58887124", "0.58887124", "0.58887124", "0.58887124", "0.58887124", "0.58887124", "0.58870214", "0.58481836", "0.5840574", "0.58319247" ]
0.800465
0
Return the form key for inclusion in HTML
public function getFormkey() { // generate the key and store it inside the class $this->formkey = $this->generateFormkey(); // store the form key in the session $_SESSION['formkey'] = $this->formkey; // output the form key return "<input type='hidden' name='formkey' value='" . $this->formkey . "' />"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFormKey()\n {\n return $this->getBlockHtml('form_key');\n }", "private function key() {\n return sprintf('form_%s_%d', $this->module->name, $this->module->id);\n }", "public function getFormKey()\n {\n return Mage::getSingleton('core/session')->getFormKey();\n }", "public function getFormKey()\n {\n return $this->formKey->getFormKey();\n }", "function getFormHtmlIdPrefix() {\n\t\t\tif ($this->hasForm( )) {\n\t\t\t\treturn $this->getForm( )->getFormHtmlIdPrefix( );\n\t\t\t}\n\n\t\t}", "public function FormName()\n {\n return $this->getTemplateHelper()->generateFormID($this);\n }", "function add_form_key($form_name)\n{\n\tglobal $config, $template, $user;\n\n\t$now = time();\n\t$token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : '';\n\t$token = sha1($now . $user->data['user_form_salt'] . $form_name . $token_sid);\n\n\t$s_fields = build_hidden_fields(array(\n\t\t'creation_time' => $now,\n\t\t'form_token'\t=> $token,\n\t));\n\n\t$template->assign_vars(array(\n\t\t'S_FORM_TOKEN'\t=> $s_fields,\n\t));\n}", "public function getFormKey()\n\t{\n\t\treturn encrypt((new \\ReflectionClass($this))->getShortName());\n\t}", "function getFormHtmlId() {\n\t\t\tif ($this->hasForm( )) {\n\t\t\t\treturn $this->getForm( )->getHtmlId( );\n\t\t\t}\n\n\t\t}", "public function getFormName();", "public function getFormName();", "public function getFormId()\n\t{\n\t\treturn strtolower($this->_removeNonAlphaCharacters($this->tag));\n\t}", "function shorten_keys_form() {\n $form = drupal_get_form('shorten_keys');\n return drupal_render($form);\n}", "public function getFormId() {\n return 'ever_form';\n }", "abstract protected function getFormName();", "protected function getForm( $html=false ) { return $this->form_name; }", "function setFormKey($key);", "public function getFormPrefix() {}", "public function get_input_name() {\n\t\treturn 'input_' . md5( 'recaptchav3' . gf_recaptcha()->get_version() . $this->formId );\n\t}", "public function getFormName(){\n return $this->form_name ?? 'form';\n }", "final public function getFormName(): string\n {\n\n return str_replace('.', '__', $this->getName());\n }", "public function getFormId() {\n return 'alexandrie_config_form';\n }", "private function generateFormkey()\n {\n $ip = $_SERVER['REMOTE_ADDR'];\n // mt_rand() is better than rand()\n $uniqid = uniqid(mt_rand(), true);\n\n return md5($ip . $uniqid);\n }", "public function getFormTemplate(): string\n {\n return static::FORM_TEMPLATE;\n }", "public function get_field_key() {\n\t\treturn $this->get_field_attr( 'field_key' );\n\t}", "function getKeyField() \n {\n return \"navbarlink_textKey\";\n }", "function getKeyField() \n {\n return 'label_key';\n }", "public function getFormId()\n {\n return 'pubcid_cookie_management_settings';\n }", "public function getKey(): string\n {\n if ($this->key) {\n return $this->key;\n }\n\n // If the user has set a custom key.\n if ($this->config->has('key')) {\n $key = Key::validate($this->config->get('key'), 'field');\n\n $this->key = $key;\n\n return $key;\n }\n\n // For fields which doesn't require name attribute use label instead.\n if (\n !$this->config->has('name') &&\n in_array($this->getType(), ['accordion', 'message', 'tab'])\n ) {\n $key = $this->config->get('label');\n } else {\n $key = $this->config->get('name');\n }\n\n $key = sprintf('%s_%s', $this->parentKey, Key::sanitize($key));\n\n $this->key = $key;\n\n return $key;\n }", "function tpl_key ($key) {\n \n return AUTHORING ? \"data-designmode=\\\"$key\\\"\" : '';\n \n }" ]
[ "0.83583146", "0.78992873", "0.7845595", "0.7843136", "0.71532387", "0.7141773", "0.7122179", "0.69783", "0.68587714", "0.6747576", "0.6747576", "0.67470694", "0.66598237", "0.66060126", "0.66047627", "0.65835524", "0.6565458", "0.65635806", "0.655621", "0.6521787", "0.6502904", "0.6473814", "0.64607024", "0.64562154", "0.64475495", "0.64285994", "0.6421776", "0.6415429", "0.6344177", "0.63239765" ]
0.8145737
1
Validate the form key against the one previously set
public function validate() { return $_POST['formkey'] === $this->oldFormkey; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function validate_key( $key ) {\n \treturn self::$instance->validate( $key );\n }", "private function checkPresharedkeyForm(){\n\t\tif(!isset($_POST['services_ipsec_key_pskey'])){\n\t\t\tErrorHandler::addError('formerror','services_ipsec_key_pskey');\n\t\t}\n\t\t\n\t\tif(ErrorHandler::errorCount() > 0){\n\t\t\tthrow new Exception('There is invalid form input');\n\t\t}\n\t}", "function eve_api_enter_api_form_validate($form, &$form_state) {\n $key_id = (int) $form_state['values']['keyID'];\n $v_code = (string) $form_state['values']['vCode'];\n\n if (empty($key_id) || empty($v_code) || preg_match('/[^a-z0-9]/i', $v_code) || preg_match('/[^0-9]/', $key_id) || strlen($key_id) > 15 || strlen($v_code) > 64 || strlen($v_code) < 20) {\n form_set_error('keyID', t('Invalid input, please try again.'));\n form_set_error('vCode');\n return;\n }\n\n $result = db_query('SELECT apiID FROM {eve_api_keys} WHERE keyID = :keyID AND vCode =:vCode', array(\n ':keyID' => $key_id,\n ':vCode' => $v_code,\n ));\n\n if ($result->rowCount()) {\n form_set_error('keyID', t('API Key already exists!'));\n form_set_error('vCode');\n return;\n }\n\n $query = array(\n 'keyID' => $key_id,\n 'vCode' => $v_code,\n );\n\n $characters = eve_api_get_api_key_info_api($query);\n\n if (isset($characters['error'])) {\n form_set_error('keyID', t('There was an error with the API.'));\n form_set_error('vCode');\n }\n else {\n $whitelist = array();\n\n if (!empty($characters)) {\n foreach ($characters['characters'] as $character) {\n $whitelist[] = (int) $character['characterID'];\n }\n }\n\n $result = db_query('SELECT characterID FROM {eve_api_whitelist} WHERE characterID IN (:characterIDs)', array(\n ':characterIDs' => $whitelist,\n ));\n\n $allow_expires = variable_get('eve_api_require_expires', FALSE) ? FALSE : !empty($characters['expires']);\n $allow_type = variable_get('eve_api_require_type', TRUE) ? $characters['type'] != 'Account' : FALSE;\n\n if ($result->rowCount()) {\n if ($allow_expires || ($characters['accessMask'] & 8388680) != 8388680) {\n form_set_error('keyID', t('Your account has been whitelisted, please ensure that the \"Type\" drop down box is set to \"Character\", and that the \"No Expiry\" checkbox is ticked. Only (Public Information -> (Characterinfo and FacWarStats), (Private Information) -> (CharacterSheet)) are required.'));\n form_set_error('vCode');\n }\n }\n else {\n if ($allow_expires || $allow_type || ($characters['accessMask'] & variable_get('eve_api_access_mask', 268435455)) != variable_get('eve_api_access_mask', 268435455)) {\n form_set_error('keyID', t('Please ensure that all boxes are highlighted and selected for the API, the \"Character\" drop down box is set to \"All\", the \"Type\" drop down box is set to \"Character\", and that the \"No Expiry\" checkbox is ticked.'));\n form_set_error('vCode');\n }\n }\n\n if (!eve_api_verify_blue($characters) && !variable_get('eve_api_require_blue', FALSE)) {\n form_set_error('keyID', t('No characters associated with your key are currently blue to this alliance.'));\n form_set_error('vCode');\n }\n\n if ($chars = eve_api_characters_exist($characters)) {\n form_set_error('keyID', t('Characters on this key have already been registered. Characters registered: @chars', array('@chars' => implode(\", \", $chars))));\n form_set_error('vCode');\n }\n }\n}", "function setFormKey($key);", "protected function is_valid_key($key)\n {\n }", "private function validateReviewerKey(){\n\t\treturn true;\n\t}", "function invalid_form_element($key) {\n $errors = Session::getErrors();\n if ($errors != null) {\n if (array_key_exists($key, $errors)) {\n echo 'invalid';\n }\n }\n}", "function validate_key($key)\n{\n if ($key == 'PhEUT5R251')\n return true;\n else\n return false;\n}", "public function isValid(string $key) : bool;", "function campaignion_newsletters_dotmailer_admin_validate($form, &$form_state) {\n $keys = &$form_state['values']['dotmailer']['api_keys'];\n foreach ($keys as $key => $data) {\n if (empty($data['name']) && empty($data['username']) && empty($data['password'])) {\n continue;\n }\n if (empty($data['name'])) {\n form_set_error('dotmailer][api_keys][' . $key . '][name', t('The API key has to have a unique name.'));\n }\n }\n}", "function check_form_key($form_name, $timespan = false, $return_page = '', $trigger = false)\n{\n\tglobal $config, $user;\n\n\tif ($timespan === false)\n\t{\n\t\t// we enforce a minimum value of half a minute here.\n\t\t$timespan = ($config['form_token_lifetime'] == -1) ? -1 : max(30, $config['form_token_lifetime']);\n\t}\n\n\tif (isset($_POST['creation_time']) && isset($_POST['form_token']))\n\t{\n\t\t$creation_time\t= abs(request_var('creation_time', 0));\n\t\t$token = request_var('form_token', '');\n\n\t\t$diff = time() - $creation_time;\n\n\t\t// If creation_time and the time() now is zero we can assume it was not a human doing this (the check for if ($diff)...\n\t\tif ($diff && ($diff <= $timespan || $timespan === -1))\n\t\t{\n\t\t\t$token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : '';\n\t\t\t$key = sha1($creation_time . $user->data['user_form_salt'] . $form_name . $token_sid);\n\n\t\t\tif ($key === $token)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($trigger)\n\t{\n\t\ttrigger_error($user->lang['FORM_INVALID'] . $return_page);\n\t}\n\n\treturn false;\n}", "private function validateInput($key) {\n if (!array_key_exists($key, $_POST)) {\n return false;\n } else {\n $_POST[$key] = trim($_POST[$key]);\n if ($_POST[$key] == \"\") {\n return false;\n }\n }\n return $_POST[$key];\n }", "function check_formkey($formkey)\r\n\t{\r\n\t\t$code = decrypt($formkey);\r\n\t\t\r\n\t\treturn (($code >= 1199116800 && REQUEST_TIME - $code <= FORMKEY_TIMEOUT) ? true : false);\r\n\t\t\r\n\t}", "public function validate()\n {\n // generate Token String\n $idTokenString = $this->getTokenString($this->_key);\n return ($idTokenString == $this->_tokenString);\n }", "function validate_form($key) {\n $errors = Session::getErrors();\n if ($errors !== NULL) {\n if (array_key_exists($key, $errors)) {\n echo $errors[$key];\n }\n }\n}", "function postageapp_admin_form_validate($form, &$form_state) { \n //\n $api_key = $form_state['values']['postageapp_api_key'];\n \n if ($api_key) {\n $postage = new PostageApp($api_key);\n $valid_key = $postage->get_project_info();\n \n if ($valid_key->response->status == 'ok') {\n drupal_set_message(t('Your API key is valid. Welcome to PostageApp.'), \"status\");\n drupal_set_message(t('To complete settings add \"$conf[\\'mail_system\\'][\\'default-system\\'] = \\'PostageappDrupalMail\\';\" to settings.php (without duoble quotes). This settings override default mail system in Drupal to use Postageapp as mail delivery service.'), 'info');\n }\n else {\n form_set_error('postageapp_api_key', t($valid_key->response->message));\n }\n }\n}", "function _eventbrite_sboc_config_form_validate($form, &$form_state){\n $eventbrite_api_key = $form_state['values']['eventbrite_api_key'];\n $eventbrite_api_user_key = $form_state['values']['eventbrite_api_user_key'];\n \n if (empty($eventbrite_app_key) || empty($eventbrite_api_user_key)) {\n\t form_set_error('API Credentials', t('Eventbrite API Key and API Usere Keys are required.'));\n } \n }", "function SetupKeyValues($key) {\r\n\t\t$arrKeyFlds = explode($GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"], $key);\r\n\t\tif (count($arrKeyFlds) >= 2) {\r\n\t\t\t$this->identries->setFormValue($arrKeyFlds[0]);\r\n\t\t\tif (!is_numeric($this->identries->FormValue))\r\n\t\t\t\treturn FALSE;\r\n\t\t\t$this->id->setFormValue($arrKeyFlds[1]);\r\n\t\t\tif (!is_numeric($this->id->FormValue))\r\n\t\t\t\treturn FALSE;\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}", "public function validateAuthKey($authKey){\n }", "function SetupKeyValues($key) {\n\t\t$arrKeyFlds = explode($GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"], $key);\n\t\tif (count($arrKeyFlds) >= 1) {\n\t\t\t$this->id->setFormValue($arrKeyFlds[0]);\n\t\t\tif (!is_numeric($this->id->FormValue))\n\t\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "function SetupKeyValues($key) {\n\t\t$arrKeyFlds = explode($GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"], $key);\n\t\tif (count($arrKeyFlds) >= 1) {\n\t\t\t$this->id->setFormValue($arrKeyFlds[0]);\n\t\t\tif (!is_numeric($this->id->FormValue))\n\t\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "function SetupKeyValues($key) {\n\t\t$arrKeyFlds = explode($GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"], $key);\n\t\tif (count($arrKeyFlds) >= 1) {\n\t\t\t$this->id->setFormValue($arrKeyFlds[0]);\n\t\t\tif (!is_numeric($this->id->FormValue))\n\t\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "function SetupKeyValues($key) {\n\t\t$arrKeyFlds = explode($GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"], $key);\n\t\tif (count($arrKeyFlds) >= 1) {\n\t\t\t$this->id->setFormValue($arrKeyFlds[0]);\n\t\t\tif (!is_numeric($this->id->FormValue))\n\t\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "private function check_key_valid() {\n $license = get_transient('wcis_license');\n\n // if key doesn't exist, abort\n if(!isset($license['key']) ) { return false; }\n\n // if valid, return success\n if(isset($license['valid']) && $license['valid'] === true) {\n $msg = __('API Connected!', 'wcis');\n $this->form_fields['key']['description'] = '<span style=\"color: #4caf50;\">' . $msg . '</span>';\n }\n else {\n $msg = __('Invalid API Key. Is there empty space before / after it?', 'wcis');\n $this->form_fields['key']['description'] = '<span style=\"color:#f44336;\">' . $msg . '</span>';\n }\n\n return $license['valid'];\n }", "public function validation()\n {\n $this->validate(\n new Uniqueness(\n array(\n 'field' => 'reset_key'\n )\n )\n );\n\n if ($this->validationHasFailed() == true) {\n return false;\n }\n }", "public static function validatePasskey( $key ) {\n\t\t$pk = self::getPasskey( $key );\n\n\t\tif ( ( $pk == 'false' ) || ( $pk === false ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\tif ( empty( $pk->active ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $pk->type_def['valid'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $pk->trials <= 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\n\t\treturn true;\n\t}", "function check($key) {\n\t\tswitch ($key) {\n\t\t\tcase 'name':\n\t\t\tcase 'email':\n\t\t\tcase 'type_demande':\n\t\t\t\t// field(s) is(are) compulsory\n\t\t\t\treturn $this->checkEmpty($key);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// any other field is fine as it is\n\t\t\t\treturn true;\n\t\t}\n\t\treturn true;\n\t}", "function SetupKeyValues($key) {\r\n\t\t$arrKeyFlds = explode($GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"], $key);\r\n\t\tif (count($arrKeyFlds) >= 1) {\r\n\t\t\t$this->Id_Proveedor->setFormValue($arrKeyFlds[0]);\r\n\t\t\tif (!is_numeric($this->Id_Proveedor->FormValue))\r\n\t\t\t\treturn FALSE;\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}", "function SetupKeyValues($key) {\n\t\t$arrKeyFlds = explode($GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"], $key);\n\t\tif (count($arrKeyFlds) >= 1) {\n\t\t\t$this->userlevelid->setFormValue($arrKeyFlds[0]);\n\t\t\tif (!is_numeric($this->userlevelid->FormValue))\n\t\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "public function valid()\n {\n return !is_null($this->key());\n }" ]
[ "0.68630564", "0.669512", "0.66931117", "0.6677665", "0.66311616", "0.65796393", "0.65443856", "0.6451032", "0.64331216", "0.64252746", "0.63272274", "0.631559", "0.62736934", "0.62583804", "0.6240612", "0.6170513", "0.61204606", "0.6116328", "0.6066981", "0.6053776", "0.6053776", "0.6053776", "0.6053776", "0.6042922", "0.60420996", "0.60338354", "0.6023836", "0.60178787", "0.599823", "0.5987213" ]
0.74740344
0
Get the table qualified key name.
public function getQualifiedKeyName() { return $this->getKeyName(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getQualifiedKeyName()\n {\n return $this->getTable().'.'.$this->getKeyName();\n }", "public function getTableKeyName()\n\t{\n\t\treturn \"id\".$this->getTableName();\n\t}", "public function getTableKeyName()\r\n\t{\r\n\t\treturn \"id\".$this->getTableName();\r\n\t}", "public function getQualifiedKeyName();", "public function getKeyName();", "public function getKeyName();", "public function getKeyName();", "public function getKeyName()\n {\n return $this->keyName ?: 'id';\n }", "public function getKeyName()\n {\n return $this->keyName ?: 'id';\n }", "public function getKeyName()\n {\n return isset($this->primaryKey) ? $this->primaryKey : static::$defaultPrimaryKey;\n }", "protected function associated_key()\n {\n return $this->model->table() . '.' . $this->model->key();\n }", "public function getKeyField()\n {\n $class = get_class($this);\n $parts = explode('\\\\', $class);\n $name = $parts[count($parts)-1];\n return strtolower($name) . '_id';\n }", "protected abstract function getKeyName();", "public function getKeyName(): string\n {\n return 'id';\n }", "public function getQualifiedFirstKeyName()\n {\n return $this->throughChild->qualifyColumn($this->firstKey);\n }", "protected function getPrimaryKeyName(): string\n {\n return $this->query->getModel()->getKeyName();\n }", "public function getKeyName()\n {\n return $this->primaryKey;\n }", "public function getKeyName()\n {\n return $this->primaryKey;\n }", "public function getQualifiedFarKeyName()\n {\n return $this->getQualifiedForeignKeyName();\n }", "public function getQualifiedParentKeyName()\n {\n return $this->parent->qualifyColumn($this->localKey);\n }", "private function getTableCacheKey(){\n return $this->dataCacheKeyPrefix .'.' . strtoupper($this->table);\n }", "public function getModelKeyName()\n {\n // Create an instance of the model to get primary key name\n // I couldn't find a better solution \n $model = $this->getModel();\n $model = new $model;\n return $model->getKeyName();\n }", "public function qualifyKey(string $key){\n\t\treturn $this->getTable().'.'.$key;\n\t}", "protected function getPrimaryKeyColumnName()\n {\n return ColumnKeys::PATH;\n }", "public function getForeignKey()\n {\n $keyName = $this->getKeyName();\n\n if ($keyName[0] != '_') {\n $keyName = '_' . $keyName;\n }\n\n return Str::snake(class_basename($this)) . $keyName;\n }", "public function get_key ()\n {\n $_key = $this->key;\n\n if ( ! empty( $_key ) && is_array( $_key ) )\n {\n $_key = join( ':', $_key );\n }\n\n return sanitise_key( $_key );\n }", "public static function keyPrefix()\n {\n return Inflector::camel2id(StringHelper::basename(get_called_class()), '_');\n }", "public function getKeyName()\n {\n return 'uuid';\n }", "public function getSearchKeyName(): string\n {\n return $this->getKeyName();\n }", "public function getQualifiedFirstLocalKeyName(): string\n {\n return $this->through_parents->last()->getQualifiedKeyName();\n }" ]
[ "0.82437223", "0.7845539", "0.78281224", "0.75498474", "0.749619", "0.749619", "0.749619", "0.7448933", "0.7448933", "0.7405522", "0.7359289", "0.72581494", "0.7206322", "0.720019", "0.7191427", "0.717617", "0.7169424", "0.7169424", "0.71456957", "0.7088998", "0.7030091", "0.6999792", "0.69947696", "0.699139", "0.69887877", "0.6973382", "0.69563663", "0.6955599", "0.6954964", "0.69416547" ]
0.8038287
1
Get a fresh timestamp for the model.
public function freshTimestamp() { return Carbon::now()->timestamp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function freshTimestamp()\n {\n return Date::now();\n }", "private function _timestamp()\n \t{\n \t\t$this->updated_at = time();\n \t\tif (!$this->exists) $this->created_at = $this->updated_at;\n \t}", "public function timestamp() {\n\t\t$this->updated_at = new \\DateTime;\n\n\t\tif ( ! $this->exists) $this->created_at = $this->updated_at;\n\t}", "function getTimestamp() {\n return $this->time_stamp;\n }", "public function getTimestamp()\n { return $this->get('timestamp'); }", "public static function timestamp() {}", "public function freshTimestampString()\n {\n if(!is_null($this->dateFormat)){\n return date($this->dateFormat);\n }\n return time();\n }", "function getTimestamp() {\r\r\n\t\treturn $this->timestamp;\r\r\n\t}", "public function timestamp();", "public function getTimestamp() { \n\t\tif ($this->change) {\n\t\t\t$this->_calc();\n\t\t}\n\t\t\n\t\treturn $this->timestamp; \n\t}", "public function getTimestamp();", "public function getTimestamp();", "public function getTimestamp();", "public function getTimestamp()\n {\n }", "public function freshTimestampString()\n {\n return $this->fromDateTime($this->freshTimestamp());\n }", "public static function getTimestamp(){\r\n\t\treturn time();\r\n\t}", "public function timestampableOnPrePersist()\n {\n return $this->fulfillUTCNow();\n }", "public function getTimestamp()\n {\n return time();\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\r\n {\r\n return $this->_timestamp;\r\n }" ]
[ "0.77480716", "0.74730635", "0.741787", "0.69703996", "0.6961526", "0.6960642", "0.694699", "0.69048434", "0.68742687", "0.6872147", "0.68649566", "0.68649566", "0.68649566", "0.6842163", "0.68233126", "0.6806291", "0.6789799", "0.67573124", "0.6732114", "0.6732114", "0.6732114", "0.6732114", "0.6732114", "0.6732114", "0.6732114", "0.6732114", "0.6732114", "0.6732114", "0.6732114", "0.6728029" ]
0.76497746
1
Convert a DateTime to a storable UTCDateTime object.
public function fromDateTime($value) { // If the value is already a UTCDateTime instance, we don't need to parse it. if ($value instanceof Timestamp) { return $value; } // Let Eloquent convert the value to a DateTime instance. if (!$value instanceof DateTime) { $value = parent::asDateTime($value); } return new Timestamp($value->timestamp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function dateToUTC(\\DateTime $dateTime)\n {\n return (clone $dateTime)->setTimezone(new \\DateTimeZone('UTC'));\n }", "public function convertFromUserTimezonetoUTC($datetime,$user) {\n\n //$user_tz = 'America/New_York';\n $user_tz = $user->getPreferences()->getTimezone();\n\n //echo \"input datetime=\".$datetime->format('Y-m-d H:i').\"<br>\";\n $datetimeTz = new \\DateTime($datetime->format('Y-m-d H:i'), new \\DateTimeZone($user_tz) );\n $datetimeUTC = $datetimeTz->setTimeZone(new \\DateTimeZone('UTC'));\n //echo \"output datetime=\".$datetimeUTC->format('Y-m-d H:i').\"<br>\";\n\n return $datetimeUTC;\n }", "public function fromDateTime($value)\n {\n // ensure that if the datetime or carbon object we were given contained a timezone, we convert to the app timezone (instead of stripping it) before outputting a storable string\n if ($value) {\n return $this->asDateTime($value)->setTimeZone(config('app.timezone'))->format($this->getDateFormat());\n }\n\n return $value;\n }", "static function getDateTimeUTCTimestamp()\n {\n isset(self::$_data[self::KEY_PHP_DATETIME_UTC_TIMESTAMP]) || self::$_data[self::KEY_PHP_DATETIME_UTC_TIMESTAMP] = new \\DateTime(NULL, new \\DateTimeZone(\"UTC\"));\n return clone self::$_data[self::KEY_PHP_DATETIME_UTC_TIMESTAMP];\n }", "public function utcdate($datetime)\n {\n return R::isodatetime(strtotime($datetime) - date('Z'));\n }", "protected static function convertDateTime(DateTime $datetime)\n {\n static $useFromMutable;\n\n if (null === $useFromMutable) {\n $useFromMutable = method_exists(new DateTimeImmutable(), 'createFromMutable');\n }\n\n if ($useFromMutable) {\n return DateTimeImmutable::createFromMutable($datetime);\n }\n\n return new DateTimeImmutable($datetime->format(self::DATE_LOCALE), $datetime->getTimeZone());\n }", "public function utcDateTime()\n\t{\n\t\treturn new \\DateTime('now', new \\DateTimezone('UTC'));\n\t}", "public static function to_server_datetime( $datetime, $format = 'Y-m-d H:i:s' )\n {\n if( is_null( $datetime ) || !is_string( $datetime ) ) return $datetime;\n\n $datetime_obj = self::get_datetime_object( $datetime );\n $datetime_obj->setTimeZone( self::get_timezone_object( true ) );\n return $datetime_obj->format( $format );\n }", "public static function get_datetime_object( $datetime = NULL, $server = false )\n {\n return new \\DateTime( $datetime, self::get_timezone_object( $server ) );\n }", "public function toDateTime() : \\DateTime\n {\n return new \\DateTime($this->format('Y-m-d H:i:s.u'), $this->getTimezone());\n }", "private function createQVariantDateTime(\\DateTime $dt)\n {\n // properties. Instead, convert everything to UTC so we send absolute\n // timestamps irrespective of actual timezone.\n if ($this->protocol->isLegacy()) {\n $dt = clone $dt;\n $dt->setTimeZone(new \\DateTimeZone('UTC'));\n }\n\n // legacy protocol uses limited QTime while newer datagram protocol uses proper QDateTime\n return new QVariant($dt, $this->protocol->isLegacy() ? Types::TYPE_QTIME : Types::TYPE_QDATETIME);\n }", "public function toDateTime()\n {\n $dateTime = new DateTime('', $this->getTimezone());\n $dateTime->setTimestamp(parent::getTimestamp());\n\n return $dateTime;\n }", "public function setByDateTime(\\DateTime $dateTime) {}", "public function toDateTime() : DateTimeInterface\n {\n if (!is_int($this->y) || !is_int($this->m) || !is_int($this->d)) {\n throw new \\LogicException('DateTime can not be created from incompletely populated DateTimeData.');\n }\n\n $datetime = new DateTime();\n $datetime->setTimezone($this->timezone);\n $datetime->setDate($this->y, $this->m, $this->d);\n $datetime->setTime(0, 0, 0);\n\n if (is_int($this->h) && is_int($this->i) && is_int($this->s)) {\n $datetime->setTime($this->h, $this->i, $this->s);\n }\n\n return $datetime;\n }", "private function createUTCDateTime($date)\n {\n $dateTime = new \\DateTime($date);\n $dateTime->setTimezone(new \\DateTimeZone('UTC'));\n\n return $dateTime;\n }", "public static function from_server_datetime( $datetime, $format = 'Y-m-d H:i:s' )\n {\n if( is_null( $datetime ) || !is_string( $datetime ) ) return $datetime;\n\n $datetime_obj = self::get_datetime_object( $datetime, true ); // server's timezone\n $datetime_obj->setTimeZone( self::get_timezone_object() );\n return $datetime_obj->format( $format );\n }", "public function SetFromDateTime( DateTime $date_time ){\r\n\t\t\t$this->SetFromTimestamp( $date_time->format( 'U' ) );\r\n\t\t}", "public function toDateTime(): \\DateTime\n {\n return \\DateTime::createFromImmutable($this->value);\n }", "public static function convertToDateTime($value)\n {\n if ($value instanceof \\DateTime) {\n return $value;\n }\n\n if (substr($value, -1) == 'Z') {\n $value = substr($value, 0, strlen($value) - 1);\n }\n\n return new \\DateTime($value, new \\DateTimeZone('UTC'));\n }", "public function toDateTime(): \\DateTime\n {\n return new \\DateTime($this->getTimestamp());\n }", "public function setDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('dateTime', $value);\n }", "public function GetAsDateTime(){\r\n\t\t\treturn new DateTime( $this->GetAsMySQLDateTime() );\r\n\t\t}", "public function getDatetimeObject($datetime = null)\n {\n if ($datetime instanceof DateTimeInterface) {\n return $datetime;\n }\n\n if (is_integer($datetime)) {\n $datetime = date('Y-m-d H:i:s', $datetime);\n }\n\n return new DateTime($datetime);\n }", "function convertDateTimeToUsersTimeZone(\n $strDateTime, \n $user_id,\n $unixTimeStamp = false){\n\n $origPhpTimeZone = date_default_timezone_get();\n date_default_timezone_set('GMT');\n $dateTime = new DateTime($strDateTime);\n $strTimeZone = \n $this->controller->User->getTimeZone($user_id);\n //$this->log(\"New time zone: \" . $strTimeZone . \"\\n\" , LOG_DEBUG);\n $dateTimeZone = new DateTimeZone($strTimeZone);\n $dateTime->setTimezone($dateTimeZone);\n //$unixTimeStamp = $dateTime->format('U');\n // DB stores times as GMT, format like \"2008-05-06 03:35:01\"\n $dbFormatTimeStamp = $dateTime->format(MYSQL_DATETIME_FORMAT);\n /**$this->log(\"DT from DB (GMT): \" . $strDateTime .\n \". Applying time zone: \" . $dateTimeZone->getName() .\n \". Time w/ time zone applied, in DB format: \" . \n $dbFormatTimeStamp .\n \". Time w/ time zone applied, in U format: \" . \n strtotime($dbFormatTimeStamp) .\n \"\\n\" , LOG_DEBUG);*/\n if ($unixTimeStamp === true){\n $dbFormatTimeStamp = strtotime($dbFormatTimeStamp);\n }\n\n // set back to ini, just to be safe\n date_default_timezone_set($origPhpTimeZone);\n \n return $dbFormatTimeStamp;\n }", "public function reverseTransform($datetime)\n {\n // datetime optional\n if (!$datetime) {\n return null;\n }\n\n return date_create_from_format('d/m/Y H:i', $datetime, new \\DateTimeZone('Europe/Paris'));\n }", "public function convertToUtc(): self\n {\n if ($this->value->getTimezone()->getName() !== 'UTC') {\n return new self(value: $this->value->setTimezone(new DateTimeZone('UTC')));\n }\n\n return $this;\n }", "function toUTC()\r\n {\r\n if($this->tz->getOffset($this) > 0) {\r\n $this->subtrairSegundos(intval($this->tz->getOffset($this) / 1000));\r\n } else {\r\n $this->adSegundos(intval(abs($this->tz->getOffset($this)) / 1000));\r\n }\r\n $this->tz = new Date_TimeZone('UTC');\r\n }", "protected function asDateTime($value)\n {\n // Convert UTCDateTime instances.\n if ($value instanceof Timestamp) {\n return Carbon::createFromTimestamp($value->time());\n }\n\n return parent::asDateTime($value);\n }", "function convertTimeToUTCzone($str, $userTimezone, $format = 'Y-m-d H:i:s') {\n\n $new_str = new DateTime($str, new DateTimeZone($userTimezone));\n\n $new_str->setTimeZone(new DateTimeZone('UTC'));\n\n return $new_str->format( $format);\n}", "public function getDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('dateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'dateTime'\");\n }" ]
[ "0.6910591", "0.60874796", "0.6073676", "0.60513127", "0.6008658", "0.5777059", "0.57535815", "0.5712304", "0.57007563", "0.56607574", "0.56308347", "0.5531322", "0.5436431", "0.5433232", "0.53906256", "0.5370014", "0.5357331", "0.53539264", "0.53218454", "0.5265373", "0.52517205", "0.52252275", "0.5205912", "0.5172954", "0.5150856", "0.5148983", "0.50564843", "0.5047558", "0.5046375", "0.5033646" ]
0.6142845
1
Get the parent relation.
public function getParentRelation() { return $this->parentRelation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parent()\n {\n return $this->hasOne($this,'id', 'parent_id');\n }", "public function getRelationParentId();", "public function parent(){\n return $this->where('id', $this->parent_id)->first();\n }", "protected function get_parent()\r\n {\r\n return $this->parent;\r\n }", "function get_parent() {\n return $this->get_mapped_property('parent');\n }", "public function parent() {\n return $this->belongsTo(self::class, 'parent_id');\n }", "public function get_parent() {\n\t\treturn $this->parent();\n\t}", "public function parent()\n {\n return $this->belongsTo(self::class, 'parent_id');\n }", "public function parent()\n {\n return $this->belongsTo(self::class, 'parent_id');\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }" ]
[ "0.8066419", "0.78975856", "0.7741461", "0.7730668", "0.77237266", "0.7598691", "0.75645393", "0.75500625", "0.75500625", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722", "0.7547722" ]
0.8587196
0
Determine if the new and old values for a given key are numerically equivalent.
protected function originalIsNumericallyEquivalent($key) { $current = $this->attributes[$key]; $original = $this->original[$key]; // Date comparison. if (in_array($key, $this->getDates())) { $current = $current instanceof Timestamp ? $this->asDateTime($current) : $current; $original = $original instanceof Timestamp ? $this->asDateTime($original) : $original; return $current == $original; } return parent::originalIsNumericallyEquivalent($key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function originalIsNumericallyEquivalent($key)\n {\n $current = $this->attributes[$key];\n\n $original = $this->original[$key];\n\n return is_numeric($current) && is_numeric($original) && strcmp((string) $current, (string) $original) === 0;\n }", "protected function compare($new, $old)\n {\n $numeric = is_numeric($new) && is_numeric($old);\n if ($numeric) {\n // numeric, compare loosely\n return $new == $old;\n } else {\n // non-numeric, compare strictly\n return $new === $old;\n }\n }", "public function testUpdateValuesContainNumbers(): void { }", "public function isNumeric()\n {\n if ($this->isEmpty()) {\n return false;\n }\n\n foreach ($this->getKeys() as $key) {\n if (!is_int($key)) {\n return false;\n }\n }\n\n return true;\n }", "private function isChangedElement(array $old, array $new): bool\n\t{\n\t\t$checkedFields = [\n\t\t\t'STORE_FROM' => 'intval',\n\t\t\t'STORE_TO' => 'intval',\n\t\t\t'ELEMENT_ID' => 'intval',\n\t\t\t'AMOUNT' => 'floatval',\n\t\t\t'PURCHASING_PRICE' => 'floatval',\n\t\t\t'BASE_PRICE' => 'floatval',\n\t\t\t'BASE_PRICE_EXTRA' => 'floatval',\n\t\t\t'BASE_PRICE_EXTRA_RATE' => 'strval',\n\t\t\t'COMMENT' => 'strval',\n\t\t];\n\n\t\tforeach ($checkedFields as $name => $typeCallback)\n\t\t{\n\t\t\t$oldValue = call_user_func($typeCallback, $old[$name] ?? null);\n\t\t\t$newValue = call_user_func($typeCallback, $new[$name] ?? null);\n\n\t\t\tif ($oldValue !== $newValue)\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 isEqual(string $key, $val) : bool;", "public static function compareParams(array $oldParams, array $newParams): bool\n\t{\n\t\t// todo: or compare just file ids?\n\t\tunset(\n\t\t\t$oldParams['valueBefore'], $newParams['valueBefore'],\n\t\t\t$oldParams['type'], $newParams['type']\n\t\t);\n\n\t\treturn $oldParams === $newParams;\n\t}", "public static function compareParams(array $oldParams, array $newParams): bool\n\t{\n\t\treturn $oldParams === $newParams;\n\t}", "function record_event_equal($old_data,$new_data) {\n\t\tforeach(array_reverse($old_data) as $i => $data) {\n\t\t\tif($data[\"record\"] == $new_data[\"record\"] && $data[\"event\"] == $new_data[\"event\"]) {\n\t\t\t\tif($data[\"field_name\"] == $new_data[\"field_name\"] && $data[\"value\"] == $new_data[\"value\"]) {return true;}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function compareDataTo($key, BL_CustomGrid_Object $object)\n {\n $value = $this->getData($key);\n $otherValue = $object->getData($key);\n return ($value > $otherValue ? 1: ($value < $otherValue ? -1 : 0));\n }", "function accept()\n {\n return is_numeric($this->key());\n }", "public function compareIntDataTo($key, BL_CustomGrid_Object $object)\n {\n $value = (int) $this->getData($key);\n $otherValue = (int) $object->getData($key);\n return ($value > $otherValue ? 1: ($value < $otherValue ? -1 : 0));\n }", "function _are_attrs_modified($old_slice, $new_slice) {\n return $old_slice['index'] != $new_slice['index'];\n }", "private function isInverseMatch(): bool\n {\n return is_int($this->min) and is_int($this->max) and ($this->min > $this->max);\n }", "protected function willChange($key)\n {\n return null !== $this->getCurrent($key);\n }", "public function getValueCompare();", "public function testIsNumeric() {\n $this->assertTrue(Hash::isNumeric(array('123', 456)));\n $this->assertTrue(Hash::isNumeric(array('foo' => 123, 'number' => '456')));\n\n $this->assertFalse(Hash::isNumeric(array('foo', 'bar')));\n $this->assertFalse(Hash::isNumeric(array('foo' => 'bar', 'number' => '123')));\n $this->assertFalse(Hash::isNumeric(array('bar', '123')));\n $this->assertFalse(Hash::isNumeric(array(null)));\n $this->assertFalse(Hash::isNumeric(array(true)));\n $this->assertFalse(Hash::isNumeric(array(false)));\n $this->assertFalse(Hash::isNumeric(array(array())));\n $this->assertFalse(Hash::isNumeric(array(new stdClass())));\n }", "public function testAssertEqualsWithDelta() {\n\t\t$this->assertEqualsWithDelta( 2.3, 2.5, 0.5 );\n\t}", "function d2d_public_key_eql($key1, $key2) {\n\t$key1 = d2d_clean_public_key($key1);\n\t$key2 = d2d_clean_public_key($key2);\n\treturn $key1 === $key2;\n}", "private function checkNumberField ($attribute)\n {\n $currentValue = $this->model->getAttribute($attribute);\n $originalValue = $this->model->getOriginal($attribute);\n\n if ( !( is_numeric($currentValue) || is_numeric($originalValue) ) ) return true;\n\n if ( round($currentValue, 2) == round($originalValue, 2) ) return false;\n\n return true;\n }", "function compare_array_item($setting, $existing) {\r\n\t$existing = (array)$existing;\r\n\tunset($setting['site_id']);\r\n\tunset($setting['_id']);\r\n\tunset($existing['_id']);\r\n\tunset($existing['site_id']);\r\n\tforeach($setting as $key => $value) {\r\n\t\tif(!is_array($setting[$key])) {\r\n\t\t\tif($setting[$key] != $existing[$key]){\r\n\t\t\t\techo \"setting key {$key} value {$value} differs from {$existing[$key]} - \";\r\n\t\t\t\t// print_r($setting);\r\n\t\t\t\tprint_r($existing);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(is_array($setting[$key])) {\r\n\t\t\t$diff = array();\r\n\t\t\t$diff = array_diff_assoc($setting[$key], (array)$existing[$key]);\r\n\t\t\tif(!empty($diff)) {\r\n\t\t\t\techo \"setting subkey {$key} differs diff count \". count($diff).\"\\n\";\r\n\t\t\t\t// print_r($diff);\r\n\t\t\t\t// print_r($setting);\r\n\t\t\t\t// print_r($existing);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "public function testKeyCasting()\n {\n $arr = [];\n $arr[] = 'a';\n $arr[\"1\"] = 'b';\n $arr[\"01\"] = 'c';\n $arr[true] = 'd';\n $arr[0.5] = 'e';\n $arr[false] = 'f';\n $arr[null] = 'g';\n\n // Which keys will have $arr\n //$this->assertEquals(?, array_keys($arr));\n\n // Which values will have $arr\n //$this->assertEquals(?, array_values($arr));\n }", "public function hasOldPrice(){\n return $this->_has(17);\n }", "public function checkDiff()\n {\n if ($this->tokensOriginal !== $this->tokensMutated) {\n return true;\n }\n\n return false;\n }", "final protected function shouldHaveNumericalKeys ($value) {\n\t\t$arguments = func_get_args();\n\t\tforeach ($arguments as $argument) {\n\t\t\tif (!is_array($argument)) {\n\t\t\t\treturn $this->fail();\n\t\t\t} else {\n\n\t\t\t\t// Fail if incorrect key found\n\t\t\t\tforeach (array_keys($argument) as $key) {\n\t\t\t\t\tif (!is_int($key)) {\n\t\t\t\t\t\treturn $this->fail();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn $this->pass();\n\t}", "private function save_plus_minus_votes()\n {\n $result = true;\n foreach ($this->votes_plus as $vote) {\n if (! empty( $vote)) {\n if (! $this->save_one_vote( $vote, 1,0) ) {\n $result = false;\n }\n }\n }\n foreach ($this->votes_minus as $vote) {\n if (! empty( $vote)) {\n if (! $this->save_one_vote( $vote, 0,1)) {\n $result = false;\n };\n }\n }\n return $result;\n }", "public function isSameScoreDifference() {\n \n if (false === isset($this->intRealHomeScore) || false === isset($this->intBetHomeScore)) {\n throw new \\BadMethodCallException(\"Real and bet results must be set\");\n }\n \n return $this->intRealHomeScore - $this->intRealAwayScore === $this->intBetHomeScore - $this->intBetAwayScore;\n }", "protected function isEqual($key, $value1, $value2) {\n\t\tif($key) {} // intentional to avoid unused argument notice\n\t\t// $key intentionally not used here, but may be used by descending classes\n\t\treturn $value1 === $value2; \t\n\t}", "function SetupKeyValues($key) {\n\t\t$sKeyFld = $key;\n\t\tif (!is_numeric($sKeyFld))\n\t\t\treturn FALSE;\n\t\t$this->product_id->CurrentValue = $sKeyFld;\n\t\treturn TRUE;\n\t}", "public function renameNx(string $key, string $newKey): bool\n {\n return $this->redis->renameNx($key, $newKey);\n }" ]
[ "0.7283312", "0.60791534", "0.54558617", "0.5333096", "0.53295165", "0.52890915", "0.5142135", "0.51371664", "0.5067589", "0.50477076", "0.49775463", "0.49620834", "0.49551982", "0.49467552", "0.4941775", "0.4924749", "0.49034137", "0.48963267", "0.48748446", "0.486926", "0.48505148", "0.48436335", "0.48143485", "0.48064947", "0.48016685", "0.4797029", "0.4786312", "0.47791687", "0.4778154", "0.47498852" ]
0.7721899
0
$this>db>query("SELECT FROM products WHERE description LIKE '%$search%' where productLine LIKE '%$search%' where `upplier LIKE '%$search%'");
public function Search($search) { //$this->db->query("SELECT * FROM products WHERE description LIKE '%$search%' "); //$this->db->query(" SELECT produceCode,description,productLine,supplier,quantityInStock,bulkBuyPrice,bulkSalePrice,Photo FROM products WHERE description LIKE '%$search%' "); $query = $this->db->get(); return $query->result(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchProduct($search)\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table WHERE name LIKE ? OR description LIKE ? OR category LIKE ?;\";\n $resultset = $this->db->executeFetchAll($sql, array_fill(0, 3, \"%\" . $search . \"%\"));\n return $resultset;\n }", "function cari($keyword)\n{\n $query = \"SELECT * FROM produk WHERE namaproduk LIKE '%$keyword%' OR \n namapenjual LIKE '%$keyword%' OR \n harga LIKE '%$keyword%' OR \n toko LIKE '%$keyword%'\";\n\n return query($query);\n}", "function getProductsbySearch($Search){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT * \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `name` LIKE ? OR \n\t\t\t\t\t\t\t\t\t`description` LIKE ? OR\n\t\t\t\t\t\t\t\t\t`large_description` LIKE ? AND `stock`>0\");\n\t\t$Search = '%'.$Search.'%';\n\t\t$Search = str_replace(\" \", \"%\", $Search);\n\t\t$sth \t-> execute(array($Search, $Search, $Search));\n\n\t\treturn \t$sth;\n\t}", "function search_product_result($conditions_array=array(),$rows_per_page=10,$start=0){\n\t\t$this->db->from('red_support_product as rsp');\n\t\t$this->db->where($conditions_array);\n\t\tif($this->input->post('search_text')){\n\t\t\t$search_text=$this->input->post('search_text');\n\t\t}else{\n\t\t\t$search_text=\"\";\n\t\t}\n\t\t$this->db->where(\"(product like'%$search_text%' or description like'%$search_text%')\");\n\t\t$this->db->limit($rows_per_page, $start);\n\t\t$result=$this->db->get();\n\t\tforeach($result->result_array() as $row)\n\t\t{\n\t\t\t$rows[]=$row;\n\t\t}\n\t\treturn $rows;\n\t}", "public function search($input) {\r\n $con = database::connectDB();\r\n $query = \"select * \"\r\n . \"from tbl_product pr \"\r\n . \"INNER JOIN tbl_categories cate on pr.CATE_id = cate.CATE_id\"\r\n . \"where \"\r\n . \"pr.PRODUCT_id LIKE '%\" . $input . \"%' OR pr.PRODUCT_name LIKE '%\" . $input . \"%'\"\r\n . \"OR cate.CATE_name LIKE '%\" . $input . \"%'\";\r\n $result = mysqli_query($con, $query);\r\n database::close();\r\n\r\n return $result;\r\n }", "function find_product_by_title($product_name){\n global $db;\n $p_name = remove_junk($db->escape($product_name));\n $sql = \"SELECT name FROM products WHERE name like '%$p_name%' LIMIT 5\";\n $result = find_by_sql($sql);\n return $result;\n }", "public function searchProducts($searchString)\n {\n $sql = \"SELECT\n P.id,\n (select COUNT(id) FROM Product) as rows,\n P.name,\n P.description,\n P.image,\n P.recommended,\n GROUP_CONCAT(DISTINCT PC.category) AS category,\n P.price,\n Offer.new_price,\n I.items\n FROM Product AS P\n INNER JOIN Prod2Cat AS P2C\n -- LEFT OUTER JOIN Prod2Cat AS P2C\n ON P.id = P2C.prod_id\n INNER JOIN ProdCategory AS PC\n -- LEFT OUTER JOIN ProdCategory AS PC\n ON PC.id = P2C.cat_id\n LEFT OUTER JOIN Offer\n ON P.id = Offer.product\n LEFT OUTER JOIN Inventory AS I\n ON P.id = I.prod_id\n WHERE P.name LIKE '%$searchString%'\n OR P.description LIKE '%$searchString&'\";\n\n $this->db->execute($sql);\n $res = $this->db->fetchAll();\n\n return $res;\n }", "public function search($keyword)\n\t{\n\t\t// $builder = $this->table('tbl_customer');\n\t\t// $builder->like('name', $keyword);\n\t\t// return $builder;\n\n\n\t\treturn $this->table('tbl_suppliers')->like('supplier_name', $keyword)->orLike('address', $keyword)->orLike('no_telp', $keyword);\n\t}", "function searchByKeyword($searchTerm) {\n $searchTerm=striptags(htmlspecialchars($searchTerm));\n $query=\"SELECT * FROM ads WHERE description LIKE '%{$searchTerm}%'\";\n }", "function search_view_sql($txtsearch)\n {\n\n $sql1=\"select * from categories where c_name like '%$txtsearch%' or description like '%$txtsearch%' and status=1\";\n $res=mysqli_query($this->con,$sql1);\n return $res;\n }", "function searchProductByName($keyword){\n //$regex=\"^(?=.*?(std|8))(?=.*?(std|8)).*$\";\n //$where='MATCH(prod_name) AGAINST(\"'.$keyword.'\" IN BOOLEAN MODE)';\n $this->db->select('*');\n $this->db->from('cld_products');\n $this->db->like('prod_name',$keyword);\n //$this->db->where($where);\n //$this->db->like('prod_name',$regex);\n $this->db->where('user_id',$this->session->userdata['logged_in']['id']);\n //$this->db->order_by($where,'DESc');\n \n $query=$this->db->get();\n \n return $query->result_array();\n }", "Function getlisteproduit($search=false)\n{\n $query='SELECT PR.idpr,PR.prix,PR.description,PR.titre as titre,PR.prix,PR.photo,PR.ref,PR.description,PR.idcat,CA.titre as cat_titre from produits PR, categories CA where PR.idcat=CA.idcat';\n if($search){\n $query=$query.' and pr.titre like \"%'.$search.'%\";';\n }\n $result=selectTable($query);\n // test si resultat est ok et gérer renvoi\n if($result==false){\n return false;\n }else{\n return $result;\n }\n\n}", "function newskomentar_searchdata( $tbl_newskomentar, $cari ){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_newskomentar WHERE \n\t\t\tjudul LIKE '$cari' OR\n\t\t\tpesan LIKE '$cari' \n\t\t\t\tORDER BY id ASC \n\t\t\"); \n \t\treturn $sql;\n}", "function getSearchProducts($bdd, $search, $order = 0){\n\t$query = 'SELECT * FROM products WHERE name LIKE :search ORDER BY price';\n\tif($order){\n\t\t$query .= ' DESC';\n\t}\n\t$reponse = $bdd->prepare($query);\n\t$reponse->bindValue(':search', '%' . $search . '%', PDO::PARAM_INT);\n\t$reponse->execute();\n\treturn $reponse->fetchAll();\n\n}", "public static function find($search) {\n global $lC_Database, $lC_Language, $lC_Currencies, $lC_Image;\n\n $Qproducts = $lC_Database->query('select SQL_CALC_FOUND_ROWS p.*, pd.products_name, pd.products_description, pd.products_keyword from :table_products p, :table_products_description pd where p.parent_id = 0 and p.products_id = pd.products_id and pd.language_id = :language_id');\n\n $Qproducts->appendQuery('and (pd.products_name like :products_name or pd.products_keyword like :products_keyword) order by pd.products_name');\n $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);\n $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);\n $Qproducts->bindInt(':language_id', $lC_Language->getID());\n $Qproducts->bindValue(':products_name', '%' . $search . '%');\n $Qproducts->bindValue(':products_keyword', '%' . $search . '%');\n\n $Qproducts->execute();\n\n $cnt = 0;\n $result = '<table id=\"liveSearchTable\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" onMouseover=\"bgcolor:#cccccc;\">';\n while ( $Qproducts->next() ) {\n if ($Qproducts->valueInt('products_status') > -1) {\n $price = $lC_Currencies->format($Qproducts->value('products_price'));\n //$products_status = ($Qproducts->valueInt('products_status') === 1);\n $products_status = ($Qproducts->valueInt('products_status'));\n $products_quantity = $Qproducts->valueInt('products_quantity');\n $products_name = $Qproducts->value('products_name');\n $products_description = $Qproducts->value('products_description');\n $products_keyword = $Qproducts->value('products_keyword');\n\n if ( $Qproducts->valueInt('has_children') === 1 ) {\n $Qvariants = $lC_Database->query('select min(products_price) as min_price, max(products_price) as max_price, sum(products_quantity) as total_quantity, min(products_status) as products_status from :table_products where parent_id = :parent_id');\n $Qvariants->bindTable(':table_products', TABLE_PRODUCTS);\n $Qvariants->bindInt(':parent_id', $Qproducts->valueInt('products_id'));\n $Qvariants->execute();\n\n $products_status = ($Qvariants->valueInt('products_status') === 1);\n $products_quantity = '(' . $Qvariants->valueInt('total_quantity') . ')';\n\n $price = $lC_Currencies->format($Qvariants->value('min_price'));\n\n if ( $Qvariants->value('min_price') != $Qvariants->value('max_price') ) {\n $price .= '&nbsp;-&nbsp;' . $lC_Currencies->format($Qvariants->value('max_price'));\n }\n }\n\n $Qimage = $lC_Database->query(\"select image from :table_products_images where products_id = '\" . $Qproducts->valueInt('products_id') . \"'\");\n $Qimage->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);\n $Qimage->execute();\n\n $products_image = $Qimage->value('image');\n $products_link = lc_href_link(FILENAME_PRODUCTS, $products_keyword);\n\n $rowClass = ($cnt & 1) ? 'liveSearchRowOdd' : 'liveSearchRowEven';\n $result .= '<tr onclick=\"window.location=\\'' . $products_link . '\\';\" class=\"' . $rowClass . '\"><td valign=\"top\">' .\n ' <ol class=\"liveSearchListing\">' .\n ' <li>' .\n ' <span class=\"liveSearchListingSpan\" style=\"width: ' . $lC_Image->getWidth('mini') . 'px;\">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $products_keyword), $lC_Image->show($products_image, $products_name, null, 'mini')) . '</span>' .\n ' <div class=\"liveSearchListingDiv\">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $products_keyword), $products_name) . '</div>' .\n ' <div class=\"liveSearchListingPrice\">' . $price . '</div>' .\n ' <div style=\"clear: both;\"></div>' .\n ' </li>' .\n ' </ol>' .\n '</td></tr></a>';\n $cnt++;\n }\n }\n $result .= '</table>';\n\n $Qproducts->freeResult();\n\n return $result;\n }", "function select_search($searchText)\n{\n $query =\n \"SELECT * FROM posts WHERE `title` LIKE '%$searchText' OR\n `information` LIKE '%$searchText'\";\n $result = DB::get()->query($query);\n return $result;\n}", "function search_query($query){\n\t\tglobal $bBlog;\n\t\t$query = $this->replace($query);\n\t\t$words = explode(' ', $query);\n\t \n\t\t$sql = '';\n\t\tforeach ($words as $word){\n\t\t\t$this->make_tmp($word);\n\t\t\t$sql .= \" OR `string` = '\".$word.\"'\";\n\t\t}\n\t\treturn $bBlog->db->get_results(\"\n\t \tSELECT \n\t\t\t`article_id` AS `id`,\n\t\t\tSUM(points) AS points_sum\n\t\tFROM `\".T_SEARCH_TMP.\"`\n\t\tWHERE 0 \".$sql.\"\n\t\tGROUP BY `id`\n\t\tORDER BY `points_sum` DESC\n\t\tLIMIT 20;\n\t\t\");\n\t}", "function descriptionSearch($conn, $keyword)\n {\n $query = \"SELECT DISTINCT whwp_Advert.advert_id FROM whwp_Advert \"\n . \"WHERE advert_description LIKE :keyword \"\n . \"ORDER BY whwp_Advert.advert_price DESC\";\n $conn->prepQuery($query);\n $conn->bind('keyword', \"%\".$keyword.\"%\");\n $advert = $conn->resultset();\n return $advert;\n }", "function cari($keyword)\n{\n $query_cari = \"SELECT * FROM mahasiswa WHERE \n nama LIKE '%$keyword%' OR \n nip LIKE '%$keyword%' OR \n email LIKE '%$keyword%' OR \n jurusan LIKE '%$keyword%'\n ORDER BY id DESC;\n \";\n\n // memanggil variable query yang pertama \n return query($query_cari);\n}", "public function findlecturersByString ( $str ){\n $sqlQuery = \" SELECT * \";\n $sqlQuery .= \" FROM lecturers \";\n $sqlQuery .= \" WHERE name LIKE ’% $str %’\";\n $result = $this -> getDbManager () -> executeSelectQuery ( $sqlQuery );\n return ( $result );\n }", "function find_all_product_info_by_title($title){\n global $db;\n $sql = \"SELECT * FROM products \";\n $sql .= \" WHERE name ='{$title}'\";\n $sql .=\" LIMIT 1\";\n return find_by_sql($sql);\n }", "function fetch_product_list_select($search){\n \t\t$this->db->select('PRODUCT_ID, PRODUCT');\n \t\t$this->db->from('products');\n \t\t$this->db->where('PRODUCT REGEXP', $search);\n \t\t$query=$this->db->get();\n \t\treturn $query->result_array();\n \t}", "function BasicSearchSQL($Keyword) {\n\t$sKeyword = ew_AdjustSql($Keyword);\n\t$sql = \"\";\n\t$sql .= \"`provee_dig` LIKE '%\" . $sKeyword . \"%' OR \";\n\t$sql .= \"`provee_cat_juri` LIKE '%\" . $sKeyword . \"%' OR \";\n\t$sql .= \"`provee_nombre` LIKE '%\" . $sKeyword . \"%' OR \";\n\t$sql .= \"`provee_paterno` LIKE '%\" . $sKeyword . \"%' OR \";\n\t$sql .= \"`provee_materno` LIKE '%\" . $sKeyword . \"%' OR \";\n\t$sql .= \"`provee_dir` LIKE '%\" . $sKeyword . \"%' OR \";\n\t$sql .= \"`provee_fono` LIKE '%\" . $sKeyword . \"%' OR \";\n\tif (substr($sql, -4) == \" OR \") $sql = substr($sql, 0, strlen($sql)-4);\n\treturn $sql;\n}", "public function filter_coler($params){\n $this->db->select(\"$this->table_product.text_coler\")\n ->from($this->table_product);\n $this->db->distinct();\n if (!empty($params['keyword'])) $this->db->like(\"$this->table_product.text_coler\", $params['keyword']);\n $query = $this->db->get();//var_dump($this->db->last_query()); exit();\n return $query->result();\n }", "public function searchitem($keyword){\n\t\t$this->db->like('ProductSearchKey', $keyword, 'BOTH');\n\t\t$this->db->or_like('ProductName', $keyword, 'BOTH');\n\t\t$this->db->select('Product_Id,ProductName,ProductAuther,ProductRetailPrice,ProductSellingPrice,ProductDiscount,ProductLanguage,ProductBinding,ProductThumbImage,CategoryName');\n\t\t$this->db->from('tbl_product_category');\n\t\t$this->db->join('tbl_products', 'tbl_product_category.Product_Id = tbl_products.ProductId', 'inner');\n\t\t$this->db->join('tbl_category', 'tbl_product_category.Category_Id = tbl_category.CategoryId', 'inner');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function getProductsBySearch ($search) {\n \n $words = explode(' ', $search);\n $regex = implode('|', $words);\n \n $errorCode = 0;\n\t\t$errorMessage = \"\";\n \n if (!empty($search)) {\n \n try {\n\n $query = \"SELECT ea_product.id, upc, brand, product_name, \n product_description, avg_price, ea_category.name\n FROM ea_product, ea_category\n WHERE ea_product.category_id = ea_category.id\n AND ( product_name REGEXP '{$regex}'\n OR brand REGEXP '{$regex}'\n OR upc REGEXP '{$regex}'\n OR ea_category.name REGEXP '{$regex}' )\n ORDER BY avg_price\";\n //print(\"$query\");\n foreach($this->dbo->query($query) as $row) {\n $id = stripslashes($row[0]);\n $upc = strval(stripslashes($row[1]));\n $brand = $this->convertFancyQuotes(stripslashes($row[2]));\n $product_name = $this->convertFancyQuotes(stripslashes($row[3]));\n $product_description = $this->convertFancyQuotes(stripslashes($row[4]));\n $avg_price = stripslashes($row[5]);\n $category_name = $this->convertFancyQuotes(stripslashes($row[6]));\n\n $product[\"id\"] = $id;\n $product[\"upc\"] = $upc;\n $product[\"brand\"] = $brand;\n $product[\"product_name\"] = $product_name;\n $product[\"product_description\"] = $product_description;\n $product[\"avg_price\"] = $avg_price;\n $product[\"category_name\"] = $category_name;\n\n $product[\"image_path\"] = $this->getImagePath($upc);\n\n $products[] = $product;\n }\n\n } catch (PDOException $e) {\n $this->errorCode = 1;\n $errorCode = -1;\n $errorMessage = \"PDOException for getProductsBySearch.\";\n }\t\n \n } else {\n $errorCode = 1;\n\t\t\t$errorMessage = \"No Search value provided.\";\n }\n \n\t\t$error[\"id\"] = $errorCode;\n\t\t$error[\"message\"] = $errorMessage;\n\t\t\n\t\t$data[\"error\"] = $error;\n\t\t\n\t\t$data[\"search\"] = $search;\n $data[\"query\"] = $query;\n \n $data[\"products\"] = $products;\n\n $data = json_encode($data);\n \n\t\treturn $data;\n \n }", "public function findnationalitiesByString ( $str ){\n $sqlQuery = \" SELECT * \";\n $sqlQuery .= \" FROM nationalities \";\n $sqlQuery .= \" WHERE description LIKE ’% $str %’\";\n $result = $this -> getDbManager () -> executeSelectQuery ( $sqlQuery );\n return ( $result );\n }", "public function searchProduct(Request $request){\n\n //dd($request->input('query'));\n $product = Product::\n where('descripcion' , 'like', $request->input('query') . '%')\n ->select(['id', \\DB::raw('SUBSTRING(descripcion, 1, 80) descripcion'), \\DB::raw('precio_venta precio'), 'stock'])->take(20)->get();\n\n return response()->json([\n 'data' => $product\n ]);\n }", "function getSearch($id){\n\t\t\t\t$Q = $this->db->query(\"SELECT product. * , product_type.type_name\n\t\t\t\tFROM product\n\t\t\t\tJOIN product_type ON product_type.product_type_id = product.product_type_id \n\t\t\t\tWHERE product_type.type_name LIKE '%\".$id.\"%'\n\t\t\t\tOR product.product_id LIKE '%\".$id.\"%'\n\t\t\t\tOR product.price LIKE '%\".$id.\"%'\n\t\t\t\tOR product.product_name LIKE '%\".$id.\"%'\");\n\t\t\t\treturn $Q->result_array();\t\t\n\t\t }", "function cariKapal($kunci){\r\n $query = \"SELECT kapalID, jenis, waktu, rute,nama_dermaga,harga,kapasitas,jml_tiket,foto FROM kapal WHERE kapalID LIKE '%$kunci%' OR jenis LIKE '%$kunci%' OR waktu LIKE '%$kunci%' OR harga LIKE '%$kunci%' OR kapasitas LIKE '%$kunci%' OR rute LIKE '%$kunci%' OR nama_dermaga LIKE '%$kunci%'\";\r\n return query($query);\r\n}" ]
[ "0.71933955", "0.7178024", "0.70820934", "0.68026966", "0.674552", "0.6731083", "0.67200667", "0.66667837", "0.66463524", "0.6625593", "0.6617069", "0.6611935", "0.65893465", "0.6491036", "0.64468014", "0.6445937", "0.64253527", "0.6382578", "0.637268", "0.6349834", "0.63438827", "0.6339363", "0.63300335", "0.63265634", "0.63087296", "0.6307222", "0.63053674", "0.62702465", "0.62407905", "0.6237094" ]
0.7336957
0
Get the blueprint that this tech level belongs to
public function blueprint() { return $this->belongsTo('App\Models\Blueprint'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBlueprint() {\n return $this->blueprint;\n }", "public function getBlueprint($path) {\n $blueprints = $this->toObjects();\n // If the blueprint does not exist then return null\n // As blueprints may change over time we don't throw an exception\n if (!isset($blueprints[$path])) { return null; }\n // Return the found blueprint object\n return $blueprints[$path];\n }", "public static function get($class)\n {\n return ModelBlueprint::exists($class) ? ModelBlueprint::$blueprints[$class] : null;\n }", "public function getBlueprints() {\n return $this->blueprints;\n }", "public static function slug($slug)\n {\n foreach(ModelBlueprint::$blueprints as $blueprint)\n {\n if ($blueprint->label('slug') == $slug) {\n return $blueprint;\n }\n }\n return null;\n }", "function getBlueprintPath() {\n $blueprints_path = $this->root . \"/includes/blueprints/\";\n $blueprint = $this->getBlueprint($this->getCurrentPage());\n return $blueprints_path . $blueprint . \".php\";\n }", "public function getBlueprintOrDefault($name)\n {\n if (!$this->getBlueprint($name)) {\n $this->blueprints[$name] = $this->getDefaultBlueprint($name);\n }\n \n return $this->blueprints[$name]->setFactory($this);\n }", "private function get_bridge()\n\t{\n\t\treturn $this->m_bridge;\n\t}", "public function blueprintName(): string\n {\n if (!isset($_POST['blueprint'])) {\n return $this->template();\n }\n\n $post_value = $_POST['blueprint'];\n $sanitized_value = htmlspecialchars(strip_tags($post_value), ENT_QUOTES, 'UTF-8');\n\n return $sanitized_value ?: $this->template();\n }", "public function getResource()\n {\n return $this->dbh;\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 getSchemaBuilder()\n {\n $builder = parent::getSchemaBuilder();\n $builder->blueprintResolver(function($table, $callback){\n return new Blueprint($table, $callback);\n });\n return $builder;\n }", "function getBlueprint($page) {\n if (array_key_exists($page, $this->pages)){\n return $this->pages[$page][2];\n }\n else {\n return \"error\";\n }\n }", "public function getTechnology() {\n\t\treturn self::TECHNOLOGY;\n\t}", "public function getDefaultBlueprint($name)\n {\n return Injector::inst()->create($this->config()->get('default_blueprint'), $name);\n }", "public function get($name)\n {\n if (Shopware::VERSION !== '___VERSION___') {\n if (version_compare(Shopware::VERSION, '4.3.3', '<') && $name === 'dbal_connection') {\n return $this->get('models')->getConnection();\n }\n\n if (version_compare(Shopware::VERSION, '4.2.0', '<')) {\n if ($name === 'loader') {\n return $this->Application()->Loader();\n }\n\n $name = ucfirst($name);\n\n return $this->Application()->Bootstrap()->getResource($name);\n }\n }\n\n return parent::get($name);\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('HotelFacility');\n }", "public function scheme() {\n\t\treturn $this->getScheme();\n\t}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('HotelChain');\n }", "public function getModule()\n\t{\n\t\treturn $this->get('module');\n\t}", "protected function route_base() {\n\t\treturn substr( strrchr( get_class( $this ), '\\\\' ), 1 );\n\t}", "public function getScheme()\n {\n return $this->wrapped->getScheme();\n }", "public function getScheme() {}", "protected function getBinding($modelName = null)\n {\n $modelName = $modelName ?: $this->getModelName();\n return $this->container\n ->get('binding_factory')\n ->build($modelName);\n }", "protected function getModuleFromControllerName() \r\n {\r\n $controller_name = get_class($this);\r\n return strtolower(preg_replace('/_(.*?)$/i', '', $controller_name));\r\n }", "public function getFramework() {\r\n\t\treturn $this->context->getState('framework');\r\n\t}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('HdLafourchette');\n }", "public function getDriver()\n {\n return $this->_list->getDriver();\n }", "public function getBlue()\n {\n return (0.5 + $this->blue) | 0;\n }", "function getComponentName()\n {\n $p = get_class($this);\n\n $reflector = new ReflectionClass($p);\n $path = dirname($reflector->getFileName());\n\n $component = str_replace(BW_PATH_COMPONENTS . DS, '', $path);\n $component = str_replace(DS . 'models', '', $component);\n\n if (bwFolder::is(BW_PATH_COMPONENTS . DS . $component)) {\n return $component;\n } else {\n return NULL;\n }\n }" ]
[ "0.71117496", "0.675427", "0.5904844", "0.58372957", "0.5724282", "0.5671331", "0.5476842", "0.5355502", "0.53109866", "0.5305711", "0.5255011", "0.524373", "0.5213898", "0.5209493", "0.51347756", "0.5037856", "0.5007029", "0.49084666", "0.4883845", "0.48520645", "0.48405612", "0.48227632", "0.48074147", "0.48062503", "0.48036334", "0.47744915", "0.47694004", "0.47600144", "0.47576237", "0.4754416" ]
0.6864308
1
Get DataTable class for the given slug.
private function getDatatable(string $slug) { $datatable = app('boilerplate.datatables')->load(app_path('Datatables'))->getDatatable($slug); if (! $datatable) { abort(404); } return $datatable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBySlug(string $slug);", "public function getBySlug($slug)\n\t{\n\t\treturn $this->doll->with('DollTypes')->where('slug', $slug)->firstOrFail();\n\t}", "public function getRecord($slug){\n return $this->where(\"slug\", $slug)->first();\n }", "public function findBySlug($slug);", "public function findBySlug($slug);", "public function findBySlug($slug);", "public function findBySlug($slug);", "public function findBySlug($slug);", "public function bySlug($slug);", "public function fetchBySlug($slug)\n {\n return $this->fetchByColumn('slug', $slug);\n }", "public function findBySlug(string $slug);", "public function findBySlug(string $slug);", "public function findCategoryBySlug($slug);", "function getDependenceBySlug($slug)\n\t{\n\t\t$query = $this->db->get_where('dependence', array('slug'=>$slug));\n\t\treturn $query->row();\n\t}", "public function getTypeIDBySlug ($slug = '') {\n $this->connection->where('slug', $slug);\n $result = $this->connection->select('id_type', 'types');\n\n if ($result && $result->num_rows > 0) {\n while ($row = $result->fetch_assoc()) {\n return $row['id_type'];\n }\n }\n else {\n return NULL;\n }\n }", "public function findBySlug($slug)\n {\n return $this->model->whereSlug($slug)->first();\n }", "public static function findBySlug($slug, array $columns = ['*'])\n {\n return static::whereSlug($slug)->first($columns);\n }", "public function findBySlug($slug)\n {\n return $this->model->where('slug', $slug)->first();\n }", "public function findBySlug($slug)\n {\n return $this->model->where('slug', $slug)->first();\n }", "static function get_category_by_slug($slug){\n\t\treturn self::$db->where('slug',$slug)->get('categories')->row();\n\t}", "public function getOneBySlug($slug)\n {\n return reset($this->prepare(array(DB::findOne($this->table, 'slug = ?', array($slug)))));\n }", "public function findBySlug(string $slug) {\n return $this->getFirstBy('slug', $slug);\n }", "public function findOneBySlug(Slug $slug);", "public function findOneBySlug(Slug $slug);", "public static function get_class_name( $slug = '' ) {\n\t\t\t$slug = str_replace( '-', ' ', $slug );\n\t\t\t$class = str_replace( ' ', '_', ucwords( $slug ) );\n\n\t\t\treturn $class;\n\t\t}", "public function getDatatable($slug = '')\n {\n $records = array();\n\n if($slug=='all')\n {\n \n\n $records = Quiz::join('quizcategories', 'quizzes.category_id', '=', 'quizcategories.id')\n ->select(['title', 'dueration', 'category', 'is_paid', 'total_marks','tags','quizzes.slug','quizzes.validity','quizzes.cost' ])\n ->where('total_marks', '!=', 0)\n ->where('start_date','<=',date('Y-m-d'))\n ->where('end_date','>=',date('Y-m-d'))\n ->get();\n\n }\n else {\n $category = QuizCategory::getRecordWithSlug($slug);\n \n $records = Quiz::join('quizcategories', 'quizzes.category_id', '=', 'quizcategories.id')\n ->select(['title', 'dueration', 'category', 'is_paid', 'total_marks','quizzes.slug', 'quizzes.validity','quizzes.cost' ])\n ->where('quizzes.category_id', '=', $category->id)\n ->where('total_marks', '!=', 0)\n ->where('start_date','<=',date('Y-m-d'))\n ->where('end_date','>=',date('Y-m-d'))\n ->get();\n }\n\n\n return Datatables::of($records)\n ->addColumn('action', function ($records) {\n \n if(!checkRole(['student']))\n if($records->is_paid)\n return '<a href=\"'.URL_PAYMENTS_CHECKOUT.'exam/'.$records->slug.'\">'.getPhrase('buy_now').'</a>';\n else \n return '-';\n return '<div class=\"dropdown more\">\n <a id=\"dLabel\" type=\"button\" class=\"more-dropdown\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <i class=\"mdi mdi-dots-vertical\"></i>\n </a>\n <ul class=\"dropdown-menu\" aria-labelledby=\"dLabel\">\n <li><a onClick=\"showInstructions(\\''.URL_STUDENT_TAKE_EXAM.$records->slug.'\\')\" href=\"javascript:void(0);\"><i class=\"fa fa-pencil\"></i>'.getPhrase(\"take_exam\").'</a></li>\n \n </ul>\n </div>';\n\n })\n ->editColumn('is_paid', function($records)\n {\n $status = ($records->is_paid) ? '<span class=\"label label-primary\">'.getPhrase('paid') .'</span>' : '<span class=\"label label-success\">'.getPhrase('free').'</span>';\n \n if($records->is_paid) {\n $extra = '<ul class=\"list-unstyled payment-col clearfix\"><li>'.$status.'</li>';\n $extra .='<li><p>Cost: '.getCurrencyCode().' '.$records->cost.'</p><p>Validity: '.$records->validity.' '.getPhrase(\"days\").'</p></li></ul>';\n return $extra;\n }\n return $status;\n\n })\n ->editColumn('dueration', function($records)\n {\n return $records->dueration . ' '.getPhrase('mins');\n })\n ->editColumn('title', function($records) \n {\n if(!checkRole(['student'])) {\n if($records->is_paid) {\n return '<a href=\"'.URL_PAYMENTS_CHECKOUT.'exam/'.$records->slug.'\">'.$records->title.'</a>';\n }\n return $records->title;\n }\n\n $paid_type = false;\n if($records->is_paid && !isItemPurchased($records->id, 'exam')) \n $paid_type = true;\n\n\n\n if($paid_type) {\n return '<a href=\"'.URL_PAYMENTS_CHECKOUT.'exam/'.$records->slug.'\">'.$records->title.'</a>';\n }\n \n return '<a onClick=\"showInstructions(\\''.URL_STUDENT_TAKE_EXAM.$records->slug.'\\')\" href=\"javascript:void(0);\">'.$records->title.'</a>';\n })\n ->removeColumn('tags')\n ->removeColumn('id')\n ->removeColumn('slug')\n ->removeColumn('validity')\n ->removeColumn('cost')\n \n ->make();\n }", "public function findBySlug($slug)\n {\n return Category::where('slug', $slug)\n ->first();\n }", "public function getModelClass($slug, $namespace)\n {\n return \\Str::studly(\"Streams\\Model\\\\_{$namespace}\\\\_{$namespace}_{$slug}_EntryModel\");\n }", "public function findCategoryBySlug($slug)\n {\n return $this->db->fetchRow(\"SELECT * FROM `blog_categories` WHERE `type` = 'cat' AND `slug` = :slug\", [ 'slug' => $slug ]);\n }", "public function getDatatable($slug = '')\n {\n\n if(!checkRole(getUserGrade(2)))\n {\n prepareBlockUserMessage();\n return back();\n }\n\n $records = array();\n\n if($slug=='')\n {\n \n\n $records = Quiz::join('quizcategories', 'quizzes.category_id', '=', 'quizcategories.id')\n ->select(['title', 'dueration', 'category', 'is_paid', 'total_marks','tags','quizzes.slug' ])\n ->orderBy('quizzes.updated_at', 'desc');\n \n\n }\n else {\n $category = QuizCategory::getRecordWithSlug($slug);\n \n $records = Quiz::join('quizcategories', 'quizzes.category_id', '=', 'quizcategories.id')\n ->select(['title', 'dueration', 'category', 'is_paid', 'total_marks','tags','quizzes.slug' ])\n ->where('quizzes.category_id', '=', $category->id)\n ->orderBy('quizcategories.updated_at', 'desc');\n }\n\n\n return Datatables::of($records)\n ->addColumn('action', function ($records) {\n \n $link_data = '<div class=\"dropdown more\">\n <a id=\"dLabel\" type=\"button\" class=\"more-dropdown\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <i class=\"mdi mdi-dots-vertical\"></i>\n </a>\n <ul class=\"dropdown-menu\" aria-labelledby=\"dLabel\">\n <li><a href=\"'.URL_QUIZ_UPDATE_QUESTIONS.$records->slug.'\"><i class=\"fa fa-pencil\"></i>'.getPhrase(\"update_questions\").'</a></li>\n <li><a href=\"'.URL_QUIZ_EDIT.'/'.$records->slug.'\"><i class=\"fa fa-pencil\"></i>'.getPhrase(\"edit\").'</a></li>';\n \n $temp = '';\n if(checkRole(getUserGrade(1))) {\n $temp .= ' <li><a href=\"javascript:void(0);\" onclick=\"deleteRecord(\\''.$records->slug.'\\');\"><i class=\"fa fa-trash\"></i>'. getPhrase(\"delete\").'</a></li>';\n }\n \n $temp .='</ul></div>';\n\n\n $link_data .=$temp;\n return $link_data;\n })\n ->editColumn('is_paid', function($records)\n {\n return ($records->is_paid) ? '<span class=\"label label-primary\">'.getPhrase('paid') .'</span>' : '<span class=\"label label-success\">'.getPhrase('free').'</span>';\n })\n ->editColumn('title',function($records)\n {\n return '<a href=\"'.URL_QUIZ_UPDATE_QUESTIONS.$records->slug.'\">'.$records->title.'</a>';\n })\n ->removeColumn('id')\n ->removeColumn('slug')\n ->removeColumn('tags')\n \n ->make();\n }" ]
[ "0.6035133", "0.58107543", "0.5802353", "0.57914114", "0.57914114", "0.57914114", "0.57914114", "0.57914114", "0.5736294", "0.5733054", "0.5687116", "0.5687116", "0.5597255", "0.55901104", "0.55877244", "0.55502015", "0.5545581", "0.5532963", "0.5532963", "0.5528735", "0.5522853", "0.5506511", "0.5494642", "0.5494642", "0.547883", "0.54441774", "0.5444061", "0.5440501", "0.54267997", "0.535746" ]
0.7550043
0
User or consultant Show form =>show all profile of consultant
public function showProfile() { $user = User::with('consultant','consultantNationality')->find(Auth::user()->get()->id); $nationalities = $user->nationalities(); $specialization = $user->specialization(); $workedcountries = $user->workedcountries(); $skills = $user->skills(); $languages = $user->languages(); $agencies = $user->agencies(); return View::make('user.profile.show', compact('user', 'nationalities','specialization','workedcountries','skills','languages','agencies')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show()\n {\n $user_identifier = $this->session->userdata('identifier');\n $user_details = $this->user_m->read($user_identifier);\n $this->data['user_details'] = $user_details;\n $this->load_view('Profil Akun', 'user/profil');\n }", "public function show($Perprof)\n {\n if(Auth()->guard()->check() && Auth::user()->profornot == 0){\n $idperf=0;\n return redirect('/profile/create');\n }\n else\n {\n $Perprof=Artistprofile::find($Perprof) ?? abort(404);;\n return view(\"profiles.personalprofile\",compact('Perprof')); \n }\n }", "public function show(Userdato $userdato)\n {\n //\n }", "public function show(ProfilUser $profilUser)\n {\n //\n }", "public function index()\n {\n $id = Auth::user()->id;\n $all_profile = EmployeeInfo::where('user_id', $id)->get();\n $all_department = Department::all('dept_name');\n\n $all_designation = Designation::all('designation_name');\n\n //return $all_profile;\n return view('employee.profile.profile', compact('all_profile', 'all_department', 'all_designation'));\n }", "public function show(UserPersonalInfo $userPersonalInfo)\n {\n //\n }", "public function showForm()\n {\n $parent= $this->parentAccountList();\n $people= $this->getBusinessPartners();\n $code= $this->getAccountCode();\n return view('setup.accounts.accounts')->with(\"parent\",$parent)->with(\"people\",$people)->with(\"code\", $code);\n }", "public function show(Profesor $profesor)\n {\n\n }", "public function show(Profesor $profesor)\n {\n //\n }", "public function display_all_supervisor()\n {\n \n if ( ! file_exists(APPPATH.'views/pages/list.php'))\n {\n // Whoops, we don't have a page for that!\n show_404();\n }\n if (!isset($this->session->userdata['user_role']) || $this->session->userdata['user_role'] < 50)\n {\n $this->session->set_flashdata('message', 'Vous devez avoir les droits d\\'administrateur');\n redirect($_SERVER['HTTP_REFERER']); \n } \n \n $data['title'] = 'Liste des superviseurs'; // Capitalize the first letter\n $data['membres'] = $this->member_model->get_by_type('name = \"Superviseur\"');\n \n // breadcrumb\n $data['breadcrumbs'] = $this->breadcrumbs('liste');\n \n $this->load->template('pages/list_members',$data);\n }", "public function show()\n {\n $usuarios = persona::all();\n return view('admin_verusuarios', compact('usuarios'));\n }", "public function profile()\n {\n $testpro = Sentinel::getUser();\n // dd($applicants);\n $user_id = $testpro->id;\n $applicants = Applicant::where('user_id','=', $user_id)->get()->first();\n return view('client.profile')->with('applicants', $applicants);\n }", "public function profile()\n\t{\n\t\t// echo $this->fungsi->user_login()->nik;\n\t\t$query = $this->user_m->get($this->fungsi->user_login()->nik);\n\t\t$data['data'] = $query->row();\n\t\t$this->template->load('template2', 'profile', $data);\n\t}", "public function index()\n {\n //\n $users = User::findOrFail( \\Auth::user()->id );\n return $this->view('user-bundle.profile.edit',compact('users'));\n }", "public function index() {\n if (CheckSession::chk_distuser() === true) {\n $user = \\App\\User::where('idUser', '=', Auth::guard('authority')->User()->idUser)->first();\n $userdesig = $user->userdesig()->whereNotNull('idDistrict')->whereNull('idSubdivision')->whereNull('idBlock')->whereNull('idVillage')->get();\n return view('authority.districts.profile', compact('user', 'userdesig'));\n } else {\n return view('errors.404');\n }\n }", "public function people_show()\n {\n if(Auth::user()->access != 1 )\n {\n abort(403);\n }\n return view('hact.reports.people');\n }", "public function show(Personal $personal)\n {\n //\n }", "public function show(Personal $personal)\n {\n //\n }", "public function index()\n {\n $personalInfo = PersonalInfo::where('user_id', Auth::user()->id)->first();\n if ($personalInfo) {\n return view('user.personal_info', compact('personalInfo'));\n }\n else {\n $personalInfo = new PersonalInfo();\n return view('user.personal_info', compact('personalInfo'));\n }\n }", "public function displayDetails() {\n \n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-show-details') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n $id = $this->uri->segment(3);\n $user = $this->UserModel->getRecord($id);\n $permission_group = $this->UserModel->getUserType($user->id);\n $user->user_role = $permission_group->group_name;\n $this->data['result'] = $user;\n $this->set_view('user/more_details_page', $this->data);\n } else {\n echo \"access denied\";\n }\n }", "public function profile() {\r\n\r\n\t\t$this->input->set('view', 'childprofile');\r\n\r\n\t\treturn parent::display();\r\n\t}", "public function actionPersonal()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t\n\t\t$record = SiteUser::model()->findByAttributes(array('id'=> Yii::app()->user->id));\n\t\t$this->render('personal',array('user'=>$record));\n\t}", "public function displayperson() {\r\n if (isset($_GET['id'])) {\r\n $display = $this->model->displayPerson($_GET['id']);\r\n }\r\n return $this->view('/company/displayperson', $display);\r\n }", "public function profile() {\n $this->restrictToRoleId(2);\n \n // Exécute la view\n $this->show('user/profile');\n }", "public function profil()\n\t{\n $data_profil = $this->m_data->tampil_data('profil')->result();\n\n // di parsing ke view\n $data = array(\n 'profil' => $data_profil, \n );\n\n // menampilkan view index\n\t\t$this->load->view('profil',$data);\n }", "public function information_user()\n {\n //Model\n $username = $_SESSION['username'];\n $rs = $this->Nhansu->get_information_user($username);\n if ($rs) {\n $this->view(\"master_page\", [\n \"page\" => \"information_user\",\n \"url\" => \"../\",\n \"info_user\" => $rs,\n \"phongban\" => $this->Phongban->ListAll(),\n \"chucvu\" => $this->Chucvu->ListAll(),\n\n ]);\n }\n }", "public function profile(){\n \t $student = User::where('id',Auth::user()->id)->first();\n \t return view('admission.profilebtechstudent', compact('student'));\n }", "public function show($RUTP = null)\n {\n $personal = Personal::where('RUTP', $RUTP)->first();\n\n return view('personal.show', [\n 'personal' => $personal,\n ]);\n #$persona = Personal::find('RUTP');\n\t\t#return View('personal.show')->with('personal',$persona);\n }", "public function showAction()\n {\n \n //Vérification de l'existance des données de l'entreprise\n \n $em = $this->getDoctrine()->getManager();\n $user_connected = $this->getUser();\n $entity = $em->getRepository('KbhGestionCongesBundle:Entreprise')->findAll();\n $cp= count($entity);\n \n if($cp != 0){\n $id=1;\n \n // Information de l'entreprise et formulaire\n $entity = $em->getRepository('KbhGestionCongesBundle:Entreprise')->find($id);\n $editForm = $this->createEditForm($entity);\n \n //Fériés et formulaire\n $feries = $em->getRepository('KbhGestionCongesBundle:Feries')->findAll();\n $new_feries = new Feries();\n $feriesForm = $this->createFeriesForm($new_feries);\n \n //ParamPermissions et formulaire\n $Permission = $em->getRepository('KbhGestionCongesBundle:Parampermissions')->findAll();\n $new_permission = new Parampermissions();\n $PermissionForm = $this->createPermissionForm($new_permission);\n \n //ParamCalculDroit\n $calculDroit = $em->getRepository('KbhGestionCongesBundle:Paramcalculsdroits')->find($id);\n $CalculDroitForm = $this->EditParamCalDroitForm($calculDroit);\n \n }\n \n if (in_array(\"ROLE_ADMIN\", $user_connected->getRoles())) {\n return $this->render('KbhGestionCongesBundle:Admin\\Entreprise:show.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'feriesForm' => $feriesForm->createView(),\n 'permissionForm' => $PermissionForm->createView(),\n 'edit_calculDroitForm' => $CalculDroitForm->createView(),\n 'feries' => $feries,\n 'param_permission' => $Permission,\n ));\n }\n if (in_array(\"ROLE_SUPER_ADMIN\", $user_connected->getRoles())) {\n return $this->render('KbhGestionCongesBundle:Super-Admin\\Entreprise:show.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'feriesForm' => $feriesForm->createView(),\n 'permissionForm' => $PermissionForm->createView(),\n 'edit_calculDroitForm' => $CalculDroitForm->createView(),\n 'feries' => $feries,\n 'param_permission' => $Permission,\n ));\n }\n }", "public function showProfil()\n {\n $profils = Profil::all();\n return view('profils/showProfil', ['profils' => $profils]);\n }" ]
[ "0.72175086", "0.6812279", "0.67973906", "0.67820877", "0.6770297", "0.67349076", "0.6717453", "0.6705375", "0.66897005", "0.6646057", "0.6609219", "0.66017866", "0.65792996", "0.6576358", "0.65713227", "0.6558116", "0.65488094", "0.65488094", "0.6543807", "0.6522693", "0.6519043", "0.65149885", "0.65126514", "0.6490649", "0.6477983", "0.6466583", "0.64555496", "0.64342093", "0.64293563", "0.64189553" ]
0.7193861
1
Retrieve searchable attributes list
protected function _getSearchableAttributes() { if (is_null($this->_searchableAttributes)) { /** @var $attributeCollection Mage_Catalog_Model_Resource_Product_Attribute_Collection */ $attributeCollection = Mage::getResourceModel('catalog/product_attribute_collection'); $attributeCollection->addIsSearchableFilter(); foreach ($attributeCollection as $attribute) { $this->_searchableAttributes[] = $attribute->getAttributeCode(); } } return $this->_searchableAttributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getSearchableAttributes()\n {\n if (is_null($this->_searchableAttributes)) {\n /** @var $attributeCollection Mage_Catalog_Model_Resource_Product_Attribute_Collection */\n $attributeCollection = Mage::getResourceModel('catalog/product_attribute_collection');\n $attributeCollection->addIsSearchableFilter();\n foreach ($attributeCollection as $attribute) {\n $this->_searchableAttributes[] = $attribute->getAttributeCode();\n }\n }\n return $this->_searchableAttributes;\n }", "public function getAttributesList()\n {\n }", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "function _searchedAttrs()\n {\n return $this->_searchedAttrs;\n }", "public function getSearchAttributes()\n {\n return $this->searchAttributes;\n }", "public function getAttributes() {}", "public function getAttributes() {}", "public function getAttributes(): iterable;", "public function attributes() {\n return array_merge(parent::attributes(), ['searchText']);\n }", "public function getAttributesList() {\n return $this->_get(9);\n }", "public function getAttributesList() {\n return $this->_get(2);\n }", "public function searchableAttributes() {\n return array(\n 'cn' => _txt('pl.netforumsource.name.sort'),\n 'mail' => _txt('fd.email_address.mail')\n );\n }", "public function getAttributeList(): array;", "public function getAttributesList() {\n return $this->_get(3);\n }", "public function getAttributes(){ }", "public function getAttributesList() {\n return $this->_get(15);\n }", "public function getAttributesList() {\n return $this->_get(15);\n }", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "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}" ]
[ "0.7376163", "0.72983575", "0.7282965", "0.7282965", "0.7282965", "0.7282965", "0.7282965", "0.7282965", "0.7282965", "0.7282965", "0.7282965", "0.7221753", "0.71514755", "0.71006167", "0.70980465", "0.7073783", "0.7045631", "0.7021353", "0.69856626", "0.6977222", "0.6958847", "0.6907227", "0.6883898", "0.6881079", "0.6881079", "0.68618745", "0.68618745", "0.68618745", "0.68618745", "0.6845841" ]
0.7298709
1
/ Determines the direction (theres probably a better term for this) of values/deltas in an array.
function array_direction(Array $ar) { $deltas = array_deltas($ar); $deltas = array_normalize($deltas); $delta = array_average($deltas); if ($delta >= 0.01) return 1; else if ($delta <= -0.01) return -1; else return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDirection() {}", "public function getDirection();", "public function getDirection();", "public function getDirection();", "public function direction()\n {\n return $this->direction;\n }", "public function getDirection()\n\t{\n\t\treturn $this->direction;\n\t}", "public function getDirection()\n {\n return $this->direction;\n }", "public function getDirection()\n {\n return $this->direction;\n }", "public function getDirection()\n {\n return $this->direction;\n }", "function array_deltas(Array $ar) {\n\t$lastV = null;\n\t$deltas = [];\n\n\tforeach($ar AS $i => $v) {\n\t\tif ($i > 0) {\n\t\t\t$deltas[] = $v - $lastV;\n\t\t}\n\n\t\t$lastV = $v;\n\t}\n\n\treturn $deltas;\n}", "public function getDirection() {\r\n return $this->direction;\r\n }", "public function directions(): array;", "public function getDirection() {\n\n\t\treturn trim(\n\t\t\tfile_get_contents(\n\t\t\tself::PINDIR.'/gpio'.$this->iPinNumber.'/direction'\n\t\t\t)\n\t\t);\n\t}", "public function get_direction() {\r\n echo PHP_EOL;\r\n $this->action(\"checking current direction\");\r\n //can easily display the degree, and will, but also do cardinal\r\n\r\n //since North is direction's \"origin\", it occurs when $direction == 0\r\n if ($this->direction == 0) {\r\n $this->action(\"is facing true north\");\r\n }\r\n //other cases are easily handled as well\r\n else {\r\n $this->action(\"is facing {$this->direction}° clockwise from true north\");\r\n if ($this->direction < 90) {\r\n $this->action(\"is facing north east\");\r\n }\r\n //we rotate clockwise, this is east\r\n elseif ($this->direction == 90) {\r\n $this->action(\"is facing east\");\r\n }\r\n elseif ($this->direction < 180) {\r\n $this->action(\"is facing south east\");\r\n }\r\n elseif ($this->direction == 180) {\r\n $this->action(\"is facing south\");\r\n }\r\n elseif ($this->direction < 270) {\r\n $this->action(\"is facing south west\");\r\n }\r\n elseif ($this->direction == 270) {\r\n $this->action(\"is facing west\");\r\n }\r\n else {\r\n //direction must be greater than 270. 360 resets the direction\r\n // back to zero, so first if will catch it, thus we are facing NW\r\n $this->action(\"is facing north west\");\r\n }\r\n }\r\n }", "function forecast_direction(Array $real, Array $predicted, $windowSize = 60, $windowSizePredicted = 15) {\n\t$real = array_splice($real, -$windowSize);\n\t$predicted = array_splice($predicted, 0, $windowSizePredicted);\n\t$samples = array_merge($real, $predicted);\n\n\treturn array_direction($samples);\n}", "public function getDirection()\n {\n if ($this->isSorted()) {\n // If the column is currently being sorted, grab the direction from the query string\n $this->direction = Request::input(config('gbrock-tables.key_direction'));\n }\n\n if (!$this->direction) {\n $this->direction = config('gbrock-tables.default_direction');\n }\n\n return $this->direction;\n }", "public function getDirection(): string;", "private function _getOrderDirection($orderArray, $name)\n\t{\n\t\tforeach ($orderArray as $orderItem) {\n\t\t\t$i_name = $orderItem[0];\n\t\t\t$i_direction = $orderItem[1];\n\t\t\tif ($i_name == $name) {\n\t\t\t\treturn $i_direction;\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}", "public function getDirection()\n {\n if (array_key_exists(\"direction\", $this->_propDict)) {\n if (is_a($this->_propDict[\"direction\"], \"\\Beta\\Microsoft\\Graph\\Model\\CallDirection\") || is_null($this->_propDict[\"direction\"])) {\n return $this->_propDict[\"direction\"];\n } else {\n $this->_propDict[\"direction\"] = new CallDirection($this->_propDict[\"direction\"]);\n return $this->_propDict[\"direction\"];\n }\n }\n return null;\n }", "public function getDirectionRef()\n {\n return $this->directionRef;\n }", "public function get_sort_direction()\r\n\t{\r\n\t\treturn $this->sortdir->get_value();\r\n\t}", "public static function getDirection()\n {\n $lang = self::getLang();\n switch ($lang) {\n // Source: https://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code\n // @codeCoverageIgnoreStart\n case 'ar':\n case 'arc':\n case 'dv':\n case 'fa':\n case 'ha':\n case 'he':\n case 'khw':\n case 'ks':\n case 'ku':\n case 'ps':\n case 'ur':\n case 'yi':\n // @codeCoverageIgnoreEnd\n return 'rtl';\n default:\n return 'ltr';\n }\n }", "public function sortDirection();", "public function getLegDirectionality()\n {\n return $this->LegDirectionality;\n }", "private function getCardinalDirection(): array\n {\n $string = [];\n\n $string[] = '+------------------------------------+';\n $string[] = sprintf('| %s |', $this->green('Cardinal direction'));\n $string[] = '+------------------------------------|';\n $string[] = '| |';\n $string[] = '| 0° |';\n $string[] = '| |';\n $string[] = '| ___ |';\n $string[] = '| -45° ─── 45° |';\n $string[] = '| // N \\\\\\\\ |';\n $string[] = '| NW NE |';\n $string[] = '| | |';\n $string[] = '| -90° || W --+-- E || 90° |';\n $string[] = '| | |';\n $string[] = '| SW SE |';\n $string[] = '| \\\\\\\\ S // |';\n $string[] = '| -135° ─── 135° |';\n $string[] = '| ‾‾‾ |';\n $string[] = '| |';\n $string[] = '| 180° |';\n $string[] = '| |';\n $string[] = '+------------------------------------+';\n\n return $string;\n }", "public function get_directions();", "public function direction(): ?string\n {\n return $this->direction;\n }", "public function get_offset() {\n\t\treturn ( $this->step - 1 ) * $this->per_step;\n\t}", "function get_direction_name($dir){\r\n\tglobal $NORTH,$SOUTH,$EAST,$WEST;\r\n\tif($dir == $NORTH){\r\n\t\treturn \"NORTH\";\r\n\t}\r\n\tif($dir == $SOUTH){\r\n\t\treturn \"SOUTH\";\r\n\t}\r\n\tif($dir == $EAST){\r\n\t\treturn \"EAST\";\r\n\t}\r\n\tif($dir == $WEST){\r\n\t\treturn \"WEST\";\r\n\t}\r\n}", "public function getDirections()\n {\n return $this->directions;\n }" ]
[ "0.64091176", "0.6237101", "0.6237101", "0.6237101", "0.6179278", "0.6094874", "0.60530907", "0.60530907", "0.60530907", "0.59899354", "0.5926546", "0.5906345", "0.57637256", "0.57555753", "0.5588258", "0.55396533", "0.5526342", "0.54993665", "0.5388671", "0.53641814", "0.5339297", "0.5262563", "0.5260225", "0.52307415", "0.5221626", "0.5213242", "0.5140662", "0.51249135", "0.5080179", "0.5072976" ]
0.78534895
0
/ Makes sure all values in an array are scaled to a 0..1 range
function array_normalize(Array $ar) { $max = null; foreach($ar as $v) { $v = abs($v); if ($max == null) { $max = $v; } else { $max = max($max, $v); } } if ($max > 0) foreach($ar as $i => $v) $ar[$i] = $v / $max; return $ar; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function scale() { }", "public function fit(array $values) : void;", "function normalize_benefits(&$sourceCoords,$sourceKey, $isolated_benefits)\n {\n $min = min($isolated_benefits);\n //$min = 1; \n $max = max($isolated_benefits);\n if (!(($min >= 0 && $min <= 1)&&($max >= 0 && $max <= 1))){\n //we're already in the range of normalization, between 0 & 1\n if ($max == $min){\n //we don't want to divide by zero...so do something else here\n echo \"caught prior to dividing by zero inside of normalize_benefits\";\n }else {\n\n $sourceCoords['benefits'] = ($sourceCoords['benefits']-$min)/($max-$min); \n }\n }\n }", "function percentagizeArray($data,$max_value)\n {\n $new_data = array();\n foreach($data as $point)\n {\n if( $max_value > 0 )\n {\n $new_data[] = $point / $max_value * 100;\n }\n else\n {\n $new_data[] = 0;\n }\n }\n return $new_data;\n }", "private function scaleX() : void\n\t{\n\t\t$this->domain = abs($this->rangeXLow) + abs($this->rangeXHigh);\n\n\t\t$this->scaleX = ((float)$this->sizeX / $this->domain);\n\t\t$this->originX = $this->sizeX >> 1;\n\t\t\n\t}", "function fann_scale_output_train_data($train_data, $new_min, $new_max)\n{\n}", "function soryArray($array)\r\n{\r\n //Create a bucket of arrays\r\n $bucket = array_fill(0, 9, array());\r\n $maxDigits = 0;\r\n //Determine the maximum number of digits in the given array.\r\n foreach ($array as $value) {\r\n $numDigits = strlen((string )$value);\r\n if ($numDigits > $maxDigits)\r\n $maxDigits = $numDigits;\r\n }\r\n $nextSigFig = false;\r\n for ($k = 0; $k < $maxDigits; $k++) {\r\n for ($i = 0; $i < count($array); $i++) {\r\n if (!$nextSigFig)\r\n $bucket[$array[$i] % 10][] = $array[$i];\r\n else\r\n $bucket[floor(($array[$i] / pow(10, $k))) % 10][] = $array[$i];\r\n }\r\n //Reset array and load back values from bucket.\r\n $array = array();\r\n for ($j = 0; $j < count($bucket); $j++) {\r\n foreach ($bucket[$j] as $value) {\r\n $array[] = $value;\r\n }\r\n }\r\n //Reset bucket\r\n $bucket = array_fill(0, 9, array());\r\n $nextSigFig = true;\r\n }\r\n return $array;\r\n}", "function length_scale($sqlen){\n global $SPLim,$SPSFac,$LPLim,$LPSFac;\n\t$LS = 1;\n\tif($sqlen < $SPLim){ \n $LS = 1 + $SPSFac * ($SPLim - $sqlen);\n }elseif($sqlen > $LPLim){\n $LS = 1 / (1 + $LPSFac * ($sqlen - $LPLim)); \n }\n\treturn $LS;\n}", "public static function inverse(array $data)\n {\n self::transform_internal($data, +1);\n // Normalize\n $nd = count($data);\n $n = intdiv($nd, 2);\n $norm = 1 / ((double)$n);\n for ($i = 0; $i < $nd; $i++)\n $data[$i] *= $norm;\n }", "public function forceIntegerInRangeForcesIntegerIntoDefaultBoundariesDataProvider() {}", "public function testNormalized()\n {\n // Generate normalized data.\n $data = $this->getData('normalized', $this::INT_BYTES);\n\n // Normalized data should all be native PHP float type.\n $this->assertContainsOnly('float', $data);\n\n // Normalized data should be between 0 and 1.\n $this->assertLessThanOrEqual(1, max($data));\n $this->assertGreaterThanOrEqual(0, min($data));\n\n // The average of normalized data should be about 0.5 and we should have\n // roughly the same number of values between 0 - 0.5 and 0.5 - 1.\n // This is nowhere near a substitute for statistical tests for \"randomness\"\n // (we have to rely on /dev/urandom working as advertised) but we try to\n // raise red flags if something appears to be seriously wrong with our PHP\n // wrapper that is leading to obviously skewed data.\n $average = array_reduce($data, function($carry, $item) { return $carry + $item; }, 0) / count($data);\n $delta = abs(0.5 - $average);\n // 5% tolerance on the mean seems about right for 1000 rounds. Feel free to\n // change this if it causes regular issues for testbots or base it on some\n // non-empirical, actual math.\n $tolerance = 0.05;\n $this->assertLessThanOrEqual($tolerance, $delta);\n\n // Number of values between 0 - 0.5.\n $zero_to_half = array_filter($data, function($item) {\n return $item < 0.5;\n });\n\n // Number of values between 0.5 - 1.\n $half_to_one = array_filter($data, function($item) {\n return $item > 0.5;\n });\n\n // Difference in size of the two ranges.\n $delta = abs(count($zero_to_half) - count($half_to_one));\n\n // 100 tolerance seems about right for 1000 rounds, values of 10-70 are\n // common. Feel free to base this on non-empirical, actual math.\n $tolerance = 100;\n $this->assertLessThanOrEqual($tolerance, $delta);\n\n // For the same reasons as in testInteger, we don't want to see the bounds\n // showing up in our data. These values ARE technically valid data points,\n // but because they're both so unlikely to show up (and could become likely\n // due to bad PHP code) we might as well assert that they don't exist, as a\n // starting point for future investigations.\n $this->assertNotContains((float) 0, $data);\n $this->assertNotContains((float) 1, $data);\n }", "function array_pass($array)\r\n{\r\n $array[0] *= 2;\r\n $array[1] *= 2;\r\n}", "public function scale($scale = 1) {\n\t\tif(stristr($scale, '%') !== false) {\n\t\t\t$scale = (float) preg_replace('/[^0-9\\.]/', '', $scale);\n\t\t\t$scale = $scale/100;\n\t\t}\n\t\t$scale = (float) $scale;\n\t\t$new_width = ceil($this->width * $scale);\n\t\t$new_height = ceil($this->height * $scale);\n\n\t\t$working_image = imagecreatetruecolor($new_width, $new_height);\n\n\t\tif(imagecopyresampled($working_image, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->width, $this->height)) {\n\t\t\t$this->image = $working_image;\n\t\t\t$this->width = $new_width;\n\t\t\t$this->height = $new_height;\n\t\t\treturn true;\n\t\t} else {\n\t\t\ttrigger_error('Resize failed.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}", "function normalize_history(&$sourceCoords,$sourceKey, $isolated_history)\n {\n $min = min($isolated_history);\n $max = max($isolated_history);\n if (!(($min >= 0 && $min <= 1)&&($max >= 0 && $max <= 1))){\n //we're already in the range of normalization, between 0 & 1\n if ($max == $min){\n //we don't want to divide by zero...so do something else here\n echo \"caught prior to dividing by zero inside of normalize_benefits\";\n }else {\n $sourceCoords['history'] = ($sourceCoords['history']-$min)/($max-$min); \n }\n }\n }", "function array_divide($array)\n {\n return Arr::divide($array);\n }", "function array_divide($array)\n {\n return Arr::divide($array);\n }", "function scale_image($arg)\n\t{\n\t\t// max_width, max_height, cur_width, cur_height\n\t\t\n\t\t$ret = array(\n\t\t\t\t\t 'img_width' => $arg['cur_width'],\n\t\t\t\t\t 'img_height' => $arg['cur_height']\n\t\t\t\t\t);\n\t\t\n\t\tif ( $arg['cur_width'] > $arg['max_width'] )\n\t\t{\n\t\t\t$ret['img_width'] = $arg['max_width'];\n\t\t\t$ret['img_height'] = ceil( ( $arg['cur_height'] * ( ( $arg['max_width'] * 100 ) / $arg['cur_width'] ) ) / 100 );\n\t\t\t$arg['cur_height'] = $ret['img_height'];\n\t\t\t$arg['cur_width'] = $ret['img_width'];\n\t\t}\n\t\t\n\t\tif ( $arg['cur_height'] > $arg['max_height'] )\n\t\t{\n\t\t\t$ret['img_height'] = $arg['max_height'];\n\t\t\t$ret['img_width'] = ceil( ( $arg['cur_width'] * ( ( $arg['max_height'] * 100 ) / $arg['cur_height'] ) ) / 100 );\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}", "function resize_scale($scale){\n\n $width = $this->get_width() * $scale / 100;\n $height = $this->get_height() * $scale / 100;\n $this->resize($width, $height);\n\n return true;\n }", "public function setScaling($scaling = 100) {}", "protected function scaleImages() {}", "public function getScaling() {}", "public function analyseArray($array){\n for($i=0;$i<count($array);$i++){\n if(is_numeric($array[$i]) || $array[$i]==\"\" || (int)($array[$i+1])<=0 || (int)($array[$i+1])>=100){\n $this->price=0;\n return True;\n }\n elseif((int)($array[$i+1])<=12){\n $this->price=$this->price+10;\n }\n else{\n $this->price=$this->price+15;\n }\n //For one loop the function analyses 2 elements\n $i=$i+1;\n }\n if($this->box){\n $this->price=$this->price+20;\n }\n return False;\n }", "public static function range(array $data): float\n\t{\n\t\treturn max($data) - min($data);\n\t}", "function array_pass($array)\n{\n $array[0] *= 2;\n $array[1] *= 2;\n}", "public static function valid_die_sizes(array $swingRange) {\n $dieSizeArray = range($swingRange[0], $swingRange[1]);\n\n foreach ($dieSizeArray as $sizeIdx => $size) {\n // remove odd values\n if ($size & 1) {\n unset($dieSizeArray[$sizeIdx]);\n }\n }\n\n return array_values($dieSizeArray);\n }", "function fann_scale_output($ann, $output_vector)\n{\n}", "function sanitizeArray($data = array())\r\n{\r\n foreach ($data as $k => $v) {\r\n if (!is_array($v) && !is_object($v)) { // deep enough to only be values? sanitize them now.\r\n $data[$k] = sanitizeValue($v);\r\n }\r\n if (is_array($v)) { // go deeper\r\n $data[$k] = sanitizeArray($v);\r\n }\r\n }\r\n return $data;\r\n}", "function check_numerical_solutions($numerical_array1, $numerical_array2, $min = 1, $max = 3, $interval = 1){\r\n \r\n $numArg = NULL;\r\n if(count($numerical_array1) == count($numerical_array2)){\r\n $numArg = count($numerical_array1);\r\n \r\n }\r\n else{\r\n //echo \"Lattice sizes do not match up! <br />\";\r\n return FALSE; // lattices do not even appear to match sizes.\r\n }\r\n \r\n \r\n $numSteps = (($max - $min) / $interval) + 1;\r\n // you must check on your own that 'min' will in fact increment to 'max' properly\r\n \r\n $arg_array_numerical = array();\r\n \r\n for($i = 0; $i < $numArg; $i++){\r\n $arg_array_numerical[] = $min; \r\n }\r\n \r\n \r\n $keep_going = TRUE;\r\n while($keep_going){\r\n \r\n $arg_str_numerical = arg_array_to_str($arg_array_numerical);\r\n \r\n //echo \"<br /> test arg_str_numerical: $arg_str_numerical <br />\";\r\n \r\n $value1 = get_arbitrary_dim_array_element($numerical_array1, $arg_array_numerical);\r\n $value2 = get_arbitrary_dim_array_element($numerical_array2, $arg_array_numerical);\r\n \r\n if(!check_approx_equal_to($value1, $value2)){\r\n //echo \" <hr /> <br /> Arrays do not appear to be equal. Values do not match: $value1 and $value2 <br /> <hr />\";\r\n $keep_going = FALSE;\r\n return FALSE;\r\n }\r\n \r\n for($arg_num = 0; $arg_num < $numArg; $arg_num++){\r\n \r\n //echo \"print_r(arg_array) in for loop: \"; print_r($arg_array_numerical); echo \"<br />\";\r\n \r\n if( $arg_array_numerical[$arg_num] < $max ){\r\n //increment that index\r\n $arg_array_numerical[$arg_num] += $interval;\r\n //echo \"Simple increment <br />\";\r\n break; \r\n }\r\n elseif($arg_array_numerical[$arg_num] >= $max AND $arg_num >= $numArg-1){\r\n //all indices are at their maximum. Entire phase space has been sampled\r\n $keep_going = FALSE;\r\n //echo \"finished incrementing <br />\";\r\n break;\r\n }\r\n elseif($arg_array_numerical[$arg_num] >= $max AND $arg_num < $numArg-1){\r\n // phase space for that variable has been sampled. Start back at $min, and increment next highest index (done in next loop iteration)\r\n $arg_array_numerical[$arg_num] = $min;\r\n //echo \"reset and continue to next <br />\";\r\n }\r\n \r\n }\r\n \r\n //echo \"keep_going at end of while loop: $keep_going <br /> <br />\";\r\n }\r\n \r\n return TRUE; //early-returns 'FALSE' if the lattice does not match\r\n }", "function validate_array($array)\n{\n $arrayLng = count($array);\n for ($i = 0; $i < $arrayLng; ++$i) {\n $array[$i] = validate_input($array[$i]);\n }\n $array = array_filter($array);\n return $array;\n}", "function fann_set_input_scaling_params($ann, $train_data, $new_input_min, $new_input_max)\n{\n}" ]
[ "0.5751997", "0.52359784", "0.5171452", "0.51353115", "0.49886486", "0.49558976", "0.49540737", "0.49366724", "0.49161685", "0.48997074", "0.488008", "0.4822818", "0.4815006", "0.47946823", "0.47918874", "0.47918874", "0.47302058", "0.4697648", "0.46970266", "0.4689435", "0.4686201", "0.4663619", "0.46491235", "0.4646448", "0.46391237", "0.46215925", "0.46086705", "0.4602829", "0.45830023", "0.4580697" ]
0.62381905
0
/ Tries to determine the direction the prediction is going
function forecast_direction(Array $real, Array $predicted, $windowSize = 60, $windowSizePredicted = 15) { $real = array_splice($real, -$windowSize); $predicted = array_splice($predicted, 0, $windowSizePredicted); $samples = array_merge($real, $predicted); return array_direction($samples); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDirection() {}", "public function getDirection();", "public function getDirection();", "public function getDirection();", "public function getDirection(): string;", "function array_direction(Array $ar) {\n\t$deltas = array_deltas($ar);\n\t$deltas = array_normalize($deltas);\n\t$delta = array_average($deltas);\n\n\tif ($delta >= 0.01)\n\t\treturn 1;\n\telse if ($delta <= -0.01)\n\t\treturn -1;\n\telse\n\t\treturn 0;\n}", "public function get_directions();", "public function decision() {\n Log::info($this->runId.': New Position Decision Indicators: '.PHP_EOL.' '.$this->logIndicators());\n\n //Simple MACD Crossover\n if ($this->decisionIndicators['emaCrossover'] == \"crossedAbove\" && $this->decisionIndicators['hmaSlowLinReg']['m'] >= $this->hmaSlopeMin) {\n Log::warning($this->runId.': NEW LONG POSITION');\n return \"long\";\n }\n elseif ($this->decisionIndicators['emaCrossover'] == \"crossedBelow\" && $this->decisionIndicators['hmaSlowLinReg']['m'] <= $this->hmaSlopeMin*-1) {\n Log::warning($this->runId.': NEW SHORT POSITION');\n return \"short\";\n }\n else {\n Log::info($this->runId.': Failed Ema Breakthrough');\n return \"none\";\n }\n }", "public function direction()\n {\n return $this->direction;\n }", "public function get_direction() {\r\n echo PHP_EOL;\r\n $this->action(\"checking current direction\");\r\n //can easily display the degree, and will, but also do cardinal\r\n\r\n //since North is direction's \"origin\", it occurs when $direction == 0\r\n if ($this->direction == 0) {\r\n $this->action(\"is facing true north\");\r\n }\r\n //other cases are easily handled as well\r\n else {\r\n $this->action(\"is facing {$this->direction}° clockwise from true north\");\r\n if ($this->direction < 90) {\r\n $this->action(\"is facing north east\");\r\n }\r\n //we rotate clockwise, this is east\r\n elseif ($this->direction == 90) {\r\n $this->action(\"is facing east\");\r\n }\r\n elseif ($this->direction < 180) {\r\n $this->action(\"is facing south east\");\r\n }\r\n elseif ($this->direction == 180) {\r\n $this->action(\"is facing south\");\r\n }\r\n elseif ($this->direction < 270) {\r\n $this->action(\"is facing south west\");\r\n }\r\n elseif ($this->direction == 270) {\r\n $this->action(\"is facing west\");\r\n }\r\n else {\r\n //direction must be greater than 270. 360 resets the direction\r\n // back to zero, so first if will catch it, thus we are facing NW\r\n $this->action(\"is facing north west\");\r\n }\r\n }\r\n }", "function _casetravel($previousloc_X, $previousloc_Z, $previousaisle_X, $previousaisle_Z, $currentaisle_X, $currentaisle_Z, $FIRSTLOC_X, $FIRSTLOC_Z) {\n\n $outeraisle = abs($previousloc_X - $previousaisle_X) + abs($previousloc_Z - $previousaisle_Z); //previous last location to previous parking spot\n $outeraisle += abs($previousaisle_X - $currentaisle_X) + abs($previousaisle_Z - $currentaisle_Z); //previous parking spot to current parking spot\n $outeraisle += abs($currentaisle_X - $FIRSTLOC_X) + abs($currentaisle_Z - $FIRSTLOC_Z);\n\n return $outeraisle;\n}", "public function decision() {\n Log::info($this->runId.': New Position Decision Indicators: '.PHP_EOL.' '.$this->logIndicators());\n\n\n if ($this->decisionIndicators['slowHmaSlopePass'] == \"long\" && $this->decisionIndicators['slowStochOverboughtCheck'] == 'overBoughtShort' && $this->decisionIndicators['fastHmaCrossover'] == 'crossedAbove') {\n Log::warning($this->runId.': NEW LONG POSITION');\n return \"long\";\n }\n elseif ($this->decisionIndicators['slowHmaSlopePass'] == \"short\" && $this->decisionIndicators['slowStochOverboughtCheck'] == 'overBoughtLong' && $this->decisionIndicators['fastHmaCrossover'] == 'crossedBelow') {\n Log::warning($this->runId.': NEW SHORT POSITION');\n return \"short\";\n }\n else {\n Log::info($this->runId.': Failed Ema Breakthrough');\n return \"none\";\n }\n }", "public function getDirection()\n {\n return $this->direction;\n }", "public function getDirection()\n {\n return $this->direction;\n }", "public function getDirection()\n {\n return $this->direction;\n }", "public function getDirection()\n\t{\n\t\treturn $this->direction;\n\t}", "private function getDirection($start_point, $end_point){\n\t\tif($start_point->x == $end_point->y && $start_point->y == $end_point->y)\n\t\t\treturn Direction::NONE;\n\n\t\t$delta_x = $end_point->x - $start_point->x; \n\t\t$delta_y = $end_point->y - $end_point->y;\n\n\t\t$angle = (int)(atan2($delta_y, $delta_x) * 180 / M_PI);\n\t\tif($angle == 0){\n\t\t\treturn Direction::RIGHT;\n\t\t}else if ($angle == 45){\n\t\t\treturn Direction::TOP_RIGHT;\n\t\t}else if($angle == 90){\n\t\t\treturn Direction::TOP;\n\t\t}else if($angle == 135){\n\t\t\treturn Direction::TOP_LEFT;\n\t\t}else if($angle == 180){\n\t\t\treturn Direction::RIGHT;\n\t\t}else if($angle == -135){\n\t\t\treturn Direction::BOTTOM_LEFT;\n\t\t}else if($angle == -90){\n\t\t\treturn Direction::BOTTOM;\n\t\t}else if($angle == -45){\n\t\t\treturn Direction::BOTTOM_RIGHT;\n\t\t}else{\n\t\t\treturn Direction::NONE;\n\t\t}\n\n\n\n\t\t// if($start_point->x < $end_point->x && $start_point->y == $end_point->y)\n\t\t// \treturn Direction::LEFT;\n\n\t\t// if($start_point->x > $end_point->x && $start_point->y == $end_point->y)\n\t\t// \treturn Direction::RIGHT;\n\n\t\t// if($start_point->x == $end_point->x && $start_point->y < $end_point->y)\n\t\t// \treturn Direction::TOP;\n\n\t\t// if($start_point->x == $end_point->x && $start_point->y > $end_point->y)\n\t\t// \treturn Direction::BOTTOM;\n\n\t\t// if($start_point->x < $end_point->x && $start_point->y < $end_point->y)\n\t\t// \treturn Direction::BOTTOM_RIGHT;\n\n\t\t// if($start_point->x < $end_point->x && $start_point->y > $end_point->y)\n\t\t// \treturn Direction::TOP_RIGHT;\n\n\t\t// if($start_point->x > $end_point->x && $start_point->y < $end_point->y)\n\t\t// \treturn Direction::BOTTOM_LEFT;\n\n\t\t// if($start_point->x > $end_point->x && $start_point->y > $end_point->y)\n\t\t// \treturn Direction::TOP_LEFT;\n\t}", "public function getDirection() {\r\n return $this->direction;\r\n }", "protected function _paethPredictor($left, $above, $upperLeft) {}", "public function getDirection() {\n\n\t\treturn trim(\n\t\t\tfile_get_contents(\n\t\t\tself::PINDIR.'/gpio'.$this->iPinNumber.'/direction'\n\t\t\t)\n\t\t);\n\t}", "public function decision() {\n Log::info($this->runId.': Decision Indicators '.json_encode($this->decisionIndicators));\n\n //if (!$this->fullPositionInfo['open']) {\n Log::info($this->runId.': Decision Completely Open.');\n\n if ($this->decisionIndicators['hma'] == 'long' && $this->decisionIndicators['stochOverboughtCheck'] != 'overBoughtLong') {\n Log::warning($this->runId.': NEW LONG POSITION');\n return 'long';\n }\n elseif ($this->decisionIndicators['hma'] == 'short' && $this->decisionIndicators['stochOverboughtCheck'] != 'overBoughtShort') {\n Log::warning($this->runId.': NEW SHORT POSITION');\n return 'short';\n }\n// }\n }", "public function getDirection()\n {\n if ($this->isSorted()) {\n // If the column is currently being sorted, grab the direction from the query string\n $this->direction = Request::input(config('gbrock-tables.key_direction'));\n }\n\n if (!$this->direction) {\n $this->direction = config('gbrock-tables.default_direction');\n }\n\n return $this->direction;\n }", "public function getCaretSlopeRise() {}", "public function processInput()\n {\n $directionsArray = explode(',', $this->input[0]);\n $allVisitedCoordinates = [];\n $currentPositionX = 0;\n $currentPositionY = 0;\n # This represents an angle\n $currentDirection = 0;\n foreach ($directionsArray as $step) {\n $step = trim($step);\n $turn = substr($step, 0, 1);\n $distance = substr($step, -1 * (strlen($step) - 1));\n // Check where we're facing\n $currentDirection += ($turn == 'L' ? -90 : 90);\n if ($currentDirection % 360 == 0) {\n $currentDirection = 0;\n }\n // Move by given distance changing the coordinates\n switch ($currentDirection) {\n case 0:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = $currentPositionX . ':' . ($currentPositionY + $i);\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionY += $distance;\n break;\n case 90:\n case -270:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = ($currentPositionX + $i) . ':' . $currentPositionY;\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionX += $distance;\n break;\n case -90:\n case 270:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = ($currentPositionX - $i) . ':' . $currentPositionY;\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionX -= $distance;\n break;\n case 180:\n case -180:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = $currentPositionX . ':' . ($currentPositionY - $i);\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionY -= $distance;\n break;\n }\n }\n $countArray = [];\n foreach ($allVisitedCoordinates as $key => $coordinates) {\n if (array_key_exists($coordinates, $countArray)) {\n $countArray[$coordinates]++;\n $c = $coordinates;\n break;\n } else {\n $countArray[$coordinates] = 1;\n }\n }\n $coordinates = explode(':', $c);\n $this->distanceTotal = abs($coordinates[0]) + abs($coordinates[1]);\n }", "public function forward()\n {\n $steps = array_reverse($this->getSteps());\n $current = $this->current();\n foreach ($steps as $i => $step) {\n if ($step == $current) {\n return isset($steps[$i - 1]) ? $steps[$i - 1] : $steps[$i];\n }\n }\n }", "public function direction(): ?string\n {\n return $this->direction;\n }", "public function getLegDirectionality()\n {\n return $this->LegDirectionality;\n }", "function addPrediction(){\n\t\n\t}", "function get_direction_name($dir){\r\n\tglobal $NORTH,$SOUTH,$EAST,$WEST;\r\n\tif($dir == $NORTH){\r\n\t\treturn \"NORTH\";\r\n\t}\r\n\tif($dir == $SOUTH){\r\n\t\treturn \"SOUTH\";\r\n\t}\r\n\tif($dir == $EAST){\r\n\t\treturn \"EAST\";\r\n\t}\r\n\tif($dir == $WEST){\r\n\t\treturn \"WEST\";\r\n\t}\r\n}", "public function getDirection()\n {\n if (array_key_exists(\"direction\", $this->_propDict)) {\n if (is_a($this->_propDict[\"direction\"], \"\\Beta\\Microsoft\\Graph\\Model\\CallDirection\") || is_null($this->_propDict[\"direction\"])) {\n return $this->_propDict[\"direction\"];\n } else {\n $this->_propDict[\"direction\"] = new CallDirection($this->_propDict[\"direction\"]);\n return $this->_propDict[\"direction\"];\n }\n }\n return null;\n }" ]
[ "0.63074315", "0.583398", "0.583398", "0.583398", "0.5539379", "0.5520857", "0.55036545", "0.54760486", "0.5419174", "0.54125756", "0.5396324", "0.5391217", "0.53847116", "0.53847116", "0.53847116", "0.5370099", "0.5352947", "0.5265754", "0.52311015", "0.52074724", "0.5205808", "0.520075", "0.5116449", "0.5075769", "0.5069805", "0.50405204", "0.5019514", "0.5012927", "0.49754566", "0.4944402" ]
0.5915877
1
Add oro_au_net_enabled_cim_website foreign keys.
protected function addOroAuthorizeNetEnabledCimWebsiteForeignKeys(Schema $schema) { $table = $schema->getTable('oro_au_net_enabled_cim_website'); $table->addForeignKeyConstraint( $schema->getTable('oro_integration_transport'), ['transport_id'], ['id'], ['onDelete' => 'CASCADE', 'onUpdate' => null] ); $table->addForeignKeyConstraint( $schema->getTable('oro_website'), ['website_id'], ['id'], ['onDelete' => 'CASCADE', 'onUpdate' => null] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wa_wcc_activation($networkwide) {\n\n\t\tif(is_multisite() && $networkwide) {\n\t\t\tglobal $wpdb;\n\n\t\t\t$activated_blogs = array();\n\t\t\t$current_blog_id = $wpdb->blogid;\n\t\t\t$blogs_ids = $wpdb->get_col($wpdb->prepare('SELECT blog_id FROM '.$wpdb->blogs, ''));\n\n\t\t\tforeach($blogs_ids as $blog_id)\n\t\t\t{\n\t\t\t\tswitch_to_blog($blog_id);\n\t\t\t\t$this->activate_single();\n\t\t\t\t$activated_blogs[] = (int)$blog_id;\n\t\t\t}\n\n\t\t\tswitch_to_blog($current_blog_id);\n\t\t\tupdate_site_option('wa_wcc_activated_blogs', $activated_blogs, array());\n\t\t}\n\t\telse\n\t\t\t$this->activate_single();\n\t}", "function creating_db() {\r\n global $wpdb, $clients_page;\r\n\r\n //add table for Client Circles\r\n $sql = \"CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wpc_client_groups (\r\n `group_id` int(11) NOT NULL auto_increment,\r\n `group_name` varchar(255) NOT NULL,\r\n `auto_select` varchar(1) NULL,\r\n `auto_add_clients` varchar(1) NULL,\r\n PRIMARY KEY (`group_id`)\r\n ) DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;\";\r\n\r\n $wpdb->query( $sql );\r\n\r\n\r\n //add table for Redirects\r\n $sql = \"CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wpc_client_login_redirects (\r\n `rul_type` enum('user','role','level','all') NOT NULL,\r\n `rul_value` varchar(255) NOT NULL default '',\r\n `rul_url` LONGTEXT NOT NULL,\r\n `rul_url_logout` LONGTEXT NOT NULL default '',\r\n `rul_order` int(2) NOT NULL default '0',\r\n UNIQUE KEY `rul_type` (`rul_type`,`rul_value`)\r\n )\";\r\n\r\n $wpdb->query( $sql );\r\n\r\n\r\n //add table for Client Circle's CLIENTS\r\n $sql = \"CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wpc_client_group_clients (\r\n `group_id` int(11) NOT NULL,\r\n `client_id` int(11) NOT NULL\r\n ) DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;\";\r\n\r\n $wpdb->query( $sql );\r\n\r\n\r\n $sql = \"CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wpc_client_clients_page (\r\n id mediumint(9) NOT NULL AUTO_INCREMENT,\r\n pagename tinytext NOT NULL,\r\n template tinytext NOT NULL,\r\n users tinytext NOT NULL,\r\n PRIMARY KEY (id)\r\n ) DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;\";\r\n\r\n $wpdb->query( $sql );\r\n\r\n $sql = 'CREATE TABLE IF NOT EXISTS ' . $wpdb->prefix . 'wpc_client_login_redirects (\r\n `rul_type` enum(\\'user\\',\\'role\\',\\'level\\',\\'all\\') NOT NULL,\r\n `rul_value` varchar(255) NOT NULL default \\'\\',\r\n `rul_url` LONGTEXT NOT NULL,\r\n `rul_url_logout` LONGTEXT NULL,\r\n `rul_order` int(2) NOT NULL default \\'0\\',\r\n UNIQUE KEY `rul_type` (`rul_type`,`rul_value`)\r\n )';\r\n\r\n $wpdb->query( $sql );\r\n\r\n }", "public function buildRelations()\n {\n $this->addRelation('Website', '\\\\CE\\\\Model\\\\Website', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':website_id',\n 1 => ':id',\n ),\n), 'CASCADE', 'CASCADE', null, false);\n $this->addRelation('WebsiteRouting', '\\\\CE\\\\Model\\\\WebsiteRouting', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':website_routing_id',\n 1 => ':id',\n ),\n), 'CASCADE', 'CASCADE', null, false);\n }", "function aal_setup_new_blog($blog_id) {\n if ( is_plugin_active_for_network( 'wp-auto-affiliate-links/WP-auto-affiliate-links.php' ) ) {\n switch_to_blog($blog_id);\n \n global $wpdb; \n\t\t\t\t$table_name = $wpdb->prefix . \"automated_links\";\n\t\t\t\t\n\t\t\t\t//TODO: Instead of deleting, check if it is already added;\n\t\t\t\tif(!get_option('aal_target')) add_option( 'aal_target', '_blank');\n\t\t\t\tif(!get_option('aal_notimes')) add_option( 'aal_notimes', '3');\n\t\t\t\tif(!get_option('aal_showhome')) add_option( 'aal_showhome', 'true');\n\t\t\t\tif(!get_option('aal_showlist')) add_option( 'aal_showlist', 'true');\n\t\t\t\t\n\t\t\t\tupdate_option( 'aal_pluginstatus', 'active'); \n\t\t\t\t$displayc[] = 'post';\n\t\t\t\t$displayc[] = 'page';\n\t\t\t\t$dc = json_encode($displayc); \n\t\t\t\tif(!get_option('aal_displayc')) add_option( 'aal_displayc', $dc);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t//if($wpdb->get_var(\"SHOW TABLES LIKE '$table_name'\") != $table_name) {\n\t\t\t\n\t\t\t\t$sql = \"CREATE TABLE \" . $table_name . \" (\n\t\t\t\t id mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t link text NOT NULL,\n\t\t\t\t keywords text,\n\t\t\t\t meta text,\n\t\t\t\t medium varchar(255),\n\t\t\t\t grup int(5),\n\t\t\t\t grup_desc varchar(255),\n\t\t\t\t stats text,\n\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t ) CHARACTER SET utf8 COLLATE utf8_general_ci;\";\n\t\t\t \n\t\t\t require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\t\t\t dbDelta($sql);\n\t\t\t \n\t\t\t \n\t\t\t\t \n\t\t\t\t $sql2 = \"CREATE TABLE \" . $wpdb->prefix . \"aal_statistics (\n\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t link varchar(1000),\n\t\t\t\t time int(50),\n\t\t\t\t linkid int(9),\n\t\t\t\t keyword varchar(200),\n\t\t\t\t loccat varchar(50),\n\t\t\t\t loctype varchar(50),\n\t\t\t\t locid int(9),\n\t\t\t\t locurl varchar(1000),\n\t\t\t\t ip varchar(30),\n\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t ) CHARACTER SET utf8 COLLATE utf8_general_ci;\";\t \n\t\t\t \n\t\t\t dbDelta($sql2); \t\t\t \n\t\t\t \n\t\t\t \n\t\t\t \n\t\t\t \n\t\t\t // $wpdb->last_error;\n // die();\n \n \n \n \n restore_current_blog();\n } \n\n}", "function AddWebsite(&$website)\n\t{\n\t\t$website->supplierId = $this->supplierId;\n\t\t$found = false;\n\t\tforeach($this->_websiteList as $website2)\n\t\t{\n\t\t\tif ($website->websiteId > 0 && $website->websiteId == $website2->websiteId)\n\t\t\t{\n\t\t\t\t$found = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!$found)\n\t\t{\n\t\t\t$this->_websiteList[] = $website;\n\t\t}\n\t}", "function db_install () {\n global $wpdb;\n\n // BLINK_SERVERS\n $table_name = $wpdb->prefix . \"blink_servers\";\n $sql = \"CREATE TABLE IF NOT EXISTS $table_name (\n blsid INTEGER AUTO_INCREMENT,\n server VARCHAR(255) NOT NULL,\n server_weight VARCHAR(255),\n last_successful_update INTEGER,\n last_update INTEGER,\n UNIQUE KEY blsid (blsid)\n );\";\n $wpdb->query($sql);\n\n // Hack to get the default server in\n $sql = \"INSERT INTO \" . $table_name . \"\n (`blsid`, `server`, `server_weight`,\n `last_successful_update`, `last_update`)\n VALUES (1, 'labs.uswebdev.net', '1', NULL, NULL); \";\n $wpdb->query($sql);\n\n // BLINK_GOALS\n $table_name = $wpdb->prefix . \"blink_goals\";\n $sql = \"CREATE TABLE IF NOT EXISTS $table_name (\n gid INTEGER NOT NULL AUTO_INCREMENT,\n goal_uid VARCHAR(255),\n blsid INTEGER,\n kw VARCHAR(255),\n page VARCHAR(500),\n weight INTEGER,\n weight_local INTEGER,\n goal_source VARCHAR(255),\n UNIQUE KEY gid (gid)\n );\";\n $wpdb->query($sql);\n\n // BLINK_LINKS\n $table_name = $wpdb->prefix . \"blink_links\";\n $sql = \"CREATE TABLE IF NOT EXISTS $table_name (\n liid INTEGER NOT NULL AUTO_INCREMENT,\n link_uid VARCHAR(255),\n gid INTEGER,\n pid INTEGER,\n url_override VARCHAR(255),\n li_updated INTEGER,\n UNIQUE KEY liid (liid));\";\n $wpdb->query($sql);\n\n // create a blink_key to register the server\n if (!get_option('blink_key')) {\n $blink_key = uniqid('b', true);\n update_option('blink_key', $blink_key);\n }\n }", "abstract protected function addForeignKeys(&$script);", "public function safeUp()\n {\n $this->createTable('site', array(\n 'client_id' => self::MYSQL_TYPE_UINT,\n 'domain' => 'string NOT NULL'\n ));\n\n $this->addForeignKey('site_client_id', 'site', 'client_id', 'client', 'id', 'CASCADE', 'RESTRICT');\n\n $this->createTable('site_contract', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'contract_id' => self::MYSQL_TYPE_UINT,\n ));\n\n $this->addForeignKey('site_contract_site_id', 'site_contract', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n $this->addForeignKey('site_contract_contract_id', 'site_contract', 'contract_id', 'contract', 'id', 'CASCADE', 'RESTRICT');\n }", "public function addForeignKeys()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$otherModel = new $config[1];\n\t\t\t$otherTable = $otherModel->getTableName();\n\t\t\t$fkName = \"{$table}_{$name}_fk\";\n\n\t\t\tif (isset($config['onDelete']))\n\t\t\t{\n\t\t\t\t$onDelete = $config['onDelete'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (empty($config['required']))\n\t\t\t\t{\n\t\t\t\t\t$onDelete = static::SET_NULL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$onDelete = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tblx()->db->createCommand()->addForeignKey($fkName, $table, $config[2], $otherTable, 'id', $onDelete);\n\t\t}\n\t}", "private function _addExhibitAccessibleURLField()\n {\n $this->db->query(<<<SQL\n ALTER TABLE {$this->db->prefix}neatline_exhibits\n ADD COLUMN accessible_url TEXT NULL;\nSQL\n);\n }", "public function websites()\n {\n\t return $this->hasMany(Website::class, 'platform_id');\n }", "public static function WCH_install () {\n\t\tglobal $wpdb;\n\t\t$table_name = $wpdb->prefix . \"whichet\";\n\t\t$sql = \"CREATE TABLE $table_name (\n\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\ttime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n\t\t\tWCH_id tinytext NOT NULL,\n\t\t\tWCH_category tinytext NOT NULL,\n\t\t\tWCH_A_text text NOT NULL,\n\t\t\tWCH_A_link VARCHAR(55) NOT NULL,\n\t\t\tWCH_A_display_count smallint NOT NULL,\n\t\t\tWCH_A_click_count smallint NOT NULL,\n\t\t\tWCH_B_text text NOT NULL,\n\t\t\tWCH_B_link VARCHAR(55) NOT NULL,\n\t\t\tWCH_B_display_count smallint NOT NULL,\n\t\t\tWCH_B_click_count smallint NOT NULL,\n\t\t\tUNIQUE KEY id (id)\n );\";\n\t\t\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $sql );\n\t}", "public function websites()\n {\n return $this->hasManyThrough(Contact::class, Profile::class)\n ->select([DB::raw('IFNULL(prefix, \"Website\") AS type'), 'value AS url', 'is_primary'])\n ->where('type', 'website');\n }", "function apsa_activation() {\n include_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n global $wpdb;\n $wpdb->show_errors();\n /**\n * Create database tables for storage plugin data\n */\n $charset_collate = $wpdb->get_charset_collate();\n\n /** Create apsa_campaigns table */\n $table_name = $wpdb->prefix . \"apsa_campaigns\";\n\n $sql = \"CREATE TABLE $table_name (\n id int(11) NOT NULL AUTO_INCREMENT,\n name varchar(200) NOT NULL,\n type varchar(20) NOT NULL,\n status varchar(20) NOT NULL,\n creation_date datetime NOT NULL,\n KEY type (type),\n KEY status (status),\n UNIQUE KEY id (id)\n ) $charset_collate;\";\n\n dbDelta($sql);\n\n /** Create apsa_campaign_options table */\n $table_name = $wpdb->prefix . \"apsa_campaign_options\";\n\n $sql = \"CREATE TABLE $table_name (\n id int(11) NOT NULL AUTO_INCREMENT,\n campaign_id int(11) NOT NULL,\n option_name varchar(50) NOT NULL,\n option_value varchar(255) NOT NULL,\n KEY campaign_id (campaign_id),\n KEY option_name (option_name),\n UNIQUE KEY id (id),\n UNIQUE KEY unique_camp_option (campaign_id,option_name)\n ) $charset_collate;\";\n\n dbDelta($sql);\n\n /** Create statistics table */\n $table_name = $wpdb->prefix . \"apsa_element_statistics\";\n\n $sql = \"CREATE TABLE $table_name (\n element_id int(11) NOT NULL,\n type varchar(20) NOT NULL,\n count int(11) NOT NULL,\n date date NOT NULL,\n UNIQUE KEY unique_stat (element_id,type,date)\n ) $charset_collate;\";\n\n dbDelta($sql);\n\n /** Create apsa_elements table */\n $table_name = $wpdb->prefix . \"apsa_elements\";\n\n $sql = \"CREATE TABLE $table_name (\n id int(11) NOT NULL AUTO_INCREMENT,\n campaign_id int(11) NOT NULL,\n title varchar(255) NOT NULL,\n type varchar(20) NOT NULL,\n priority smallint(5) NOT NULL,\n creation_date datetime NOT NULL,\n status varchar(20) NOT NULL,\n KEY campaign_id (campaign_id),\n KEY priority (priority),\n UNIQUE KEY id (id)\n ) $charset_collate;\";\n\n dbDelta($sql);\n\n /** Create apsa_campaign_options table */\n $table_name = $wpdb->prefix . \"apsa_element_options\";\n\n $sql = \"CREATE TABLE $table_name (\n id int(11) NOT NULL AUTO_INCREMENT,\n element_id int(11) NOT NULL,\n option_name varchar(50) NOT NULL,\n option_value longtext NOT NULL,\n KEY element_id (element_id),\n KEY option_name (option_name),\n UNIQUE KEY id (id),\n UNIQUE KEY unique_element_option (element_id,option_name)\n ) $charset_collate;\";\n\n dbDelta($sql);\n\n $apsa_old_extra_option = get_option('apsa_extra_options');\n if ($apsa_old_extra_option === FALSE) {\n $apsa_extra_options = array();\n global $apsa_plugin_data;\n $apsa_extra_options['apsa_custom_css'] = '';\n if ($apsa_plugin_data['anticache'] == 'true')\n $apsa_extra_options['apsa_cache_enabled'] = 'false';\n $apsa_extra_options['apsa_view_count'] = 0;\n update_option('apsa_extra_options', $apsa_extra_options);\n }\n global $apsa_framework_version;\n $apsa_old_framework_version = get_option('apsa_framework_version');\n if ($apsa_old_framework_version === FALSE) {\n update_option('apsa_framework_version', $apsa_framework_version);\n }\n global $apsa_framework_db_version;\n $apsa_old_framework_db_version = get_option('apsa_framework_db_version');\n if ($apsa_old_framework_db_version === FALSE) {\n update_option('apsa_framework_db_version', $apsa_framework_db_version);\n }\n}", "function xmldb_block_user_mnet_hosts_install() {\n global $DB, $CFG;\n\n // If typical user field category does exist, make some for us.\n if (!isset($CFG->accesscategory)) {\n $accesscategory = new stdClass;\n $accesscategory->name = get_string('accesscategorydefault', 'block_user_mnet_hosts');\n $accesscategory->sortorder = 1;\n $id = $DB->insert_record('user_info_category', $accesscategory);\n set_config('accesscategory', $id);\n }\n\n // Create a field for ourself.\n $thishostlabel = user_mnet_hosts_make_accesskey($CFG->wwwroot, true);\n $thishostfield = user_mnet_hosts_make_accesskey($CFG->wwwroot, false);\n if (!$DB->get_record('user_info_field', array('shortname' => $thishostfield))) {\n $newfield = new stdClass;\n $newfield->shortname = $thishostfield;\n $newfield->name = get_string('fieldname', 'block_user_mnet_hosts').' '.$thishostlabel;\n $newfield->datatype = 'checkbox';\n $newfield->locked = 1;\n $newfield->visible = 0;\n $newfield->categoryid = $CFG->accesscategory;\n $DB->insert_record('user_info_field', $newfield);\n }\n\n // We need idnumber being sent over network when using controlled mnet host doors.\n\n $mnetconfig = get_config('moodle', 'mnetprofileexportfields');\n $mnetconfigarr = explode(',', $mnetconfig);\n if (!in_array('idnumber', $mnetconfigarr)) {\n $mnetconfigarr[] = 'idnumber';\n }\n set_config('mnetprofileexportfields', implode(',', $mnetconfigarr));\n\n $mnetconfig = get_config('moodle', 'mnetprofileimportfields');\n $mnetconfigarr = explode(',', $mnetconfig);\n if (!in_array('idnumber', $mnetconfigarr)) {\n $mnetconfigarr[] = 'idnumber';\n }\n set_config('mnetprofileexportfields', implode(',', $mnetconfigarr));\n\n return true;\n}", "public function addForeignKeys($setup)\n {\n /**\n * Add foreign keys for table wk_amazon_mapped_product\n */\n $setup->getConnection()->addForeignKey(\n $setup->getFkName(\n 'wk_amazon_mapped_product',\n 'magento_pro_id',\n 'catalog_product_entity',\n 'entity_id'\n ),\n $setup->getTable('wk_amazon_mapped_product'),\n 'magento_pro_id',\n $setup->getTable('catalog_product_entity'),\n 'entity_id',\n \\Magento\\Framework\\DB\\Ddl\\Table::ACTION_CASCADE\n );\n\n /**\n * Add foreign keys for table wk_amazon_maped_order\n */\n $setup->getConnection()->addForeignKey(\n $setup->getFkName(\n 'wk_amazon_maped_order',\n 'mage_amz_account_id',\n 'wk_amazon_accounts',\n 'entity_id'\n ),\n $setup->getTable('wk_amazon_maped_order'),\n 'mage_amz_account_id',\n $setup->getTable('wk_amazon_accounts'),\n 'entity_id',\n \\Magento\\Framework\\DB\\Ddl\\Table::ACTION_CASCADE\n );\n }", "function extraStatics() {\n\t\treturn array(\n\t\t\t'has_many' => array(\n\t\t\t 'SocialConnections' => 'SocialConnection'\n\t\t\t)\n\t\t);\n\t}", "function cresponsable_add() {\n\t\tglobal $conn;\n\n\t\t// Initialize table object\n\t\t$GLOBALS[\"responsable\"] = new cresponsable();\n\n\t\t// Initialize other table object\n\t\t$GLOBALS['usuario'] = new cusuario();\n\n\t\t// Intialize page id (for backward compatibility)\n\t\tif (!defined(\"EW_PAGE_ID\"))\n\t\t\tdefine(\"EW_PAGE_ID\", 'add', TRUE);\n\n\t\t// Initialize table name (for backward compatibility)\n\t\tif (!defined(\"EW_TABLE_NAME\"))\n\t\t\tdefine(\"EW_TABLE_NAME\", 'responsable', TRUE);\n\n\t\t// Open connection to the database\n\t\t$conn = ew_Connect();\n\t}", "public function safeUp()\n {\n $this->addColumn('compare_estimated_price_table','house_views_comp',\"tinyint(1) NOT NULL DEFAULT '0'\");\n }", "public function up()\n {\n $this->addColumn('iptv_vodlink', 'save_type', \"char(10) not null default 'external'\");\n }", "public function add_network_admin_pages() {\n\n\t\t// Add our main settings page.\n\t\tadd_menu_page(\n\t\t\tsprintf( __( 'Manage %s', 'wpcampus-network' ), 'WPCampus' ),\n\t\t\t'WPCampus',\n\t\t\t'manage_wpc_network',\n\t\t\t'manage-wpc-network',\n\t\t\t[ $this, 'print_manage_network_page' ]\n\t\t);\n\t}", "public function activate($network_wide)\n {\n // do something that will happens on activate plugin.\n $wordpress_required_version = '4.6.0';\n $phpversion_required = '5.5';\n if (function_exists('phpversion')) {\n $phpversion = phpversion();\n }\n if (!isset($phpversion) || (isset($phpversion) && $phpversion === false)) {\n if (defined('PHP_VERSION')) {\n $phpversion = PHP_VERSION;\n } else {\n // can't detect php version\n $phpversion = '4';\n }\n }\n if (version_compare($phpversion, $phpversion_required, '<')) {\n /* translators: %1$s: Current PHP version, %2$s: Required PHP version. */\n wp_die(sprintf(__('You are using PHP %1$s which does not meet minimum requirement. Please consider upgrade PHP version or contact plugin author for this help.<br><br>Minimum requirement:<br>PHP %2$s', 'rd-downloads'), $phpversion, $phpversion_required), __('Minimum requirement of PHP version does not meet.', 'rd-downloads'));\n exit;\n }\n if (version_compare(get_bloginfo('version'), $wordpress_required_version, '<')) {\n /* translators: %1$s: Current WordPress version, %2$s: Required WordPress version. */\n wp_die(sprintf(__('Your WordPress version does not meet the requirement. (%1$s < %2$s).', 'rd-downloads'), get_bloginfo('version'), $wordpress_required_version));\n exit;\n }\n unset($phpversion, $phpversion_required, $wordpress_required_version);\n\n if (is_multisite() && $network_wide) {\n wp_die(__('Unable to network activate, please activate from each site that have to use it only.', 'rd-downloads'));\n exit;\n }\n\n // get wpdb global var.\n global $wpdb;\n $wpdb->show_errors();\n\n // add option to site or multisite -----------------------------\n if (is_multisite()) {\n // this site is multisite. add/update options, create/alter tables on all sites.\n $blog_ids = $wpdb->get_col('SELECT blog_id FROM '.$wpdb->blogs);\n $original_blog_id = get_current_blog_id();\n if ($blog_ids) {\n foreach ($blog_ids as $blog_id) {\n switch_to_blog($blog_id);\n $this->activateCreateAlterTables();\n $this->activateAddUpdateOption();\n }\n }\n switch_to_blog($original_blog_id);\n unset($blog_id, $blog_ids, $original_blog_id);\n } else {\n // this site is single site. add/update options, create/alter tables on current site.\n $this->activateCreateAlterTables();\n $this->activateAddUpdateOption();\n }\n\n // create folder in upload folder.\n $wp_upload_dir = wp_upload_dir();\n if (is_array($wp_upload_dir) && array_key_exists('basedir', $wp_upload_dir)) {\n wp_mkdir_p(realpath($wp_upload_dir['basedir']) . DIRECTORY_SEPARATOR . 'rd-downloads');\n $FileSystem = new \\RdDownloads\\App\\Libraries\\FileSystem();\n $FileSystem->writeFile(realpath($wp_upload_dir['basedir']) . DIRECTORY_SEPARATOR . 'rd-downloads' . DIRECTORY_SEPARATOR . 'index.html', 'Access denied!', false);\n unset($FileSystem);\n }\n unset($wp_upload_dir);\n }", "public function on_plugin_activation( bool $network_wide ): void {\n\t\t$this->add_caps_to_roles();\n\t}", "protected function addForeignKeys()\n {\n // TargetRecord\n $this->addForeignKey(\n $this->db->getForeignKeyName(InitiativeRecord::tableName(), 'id'),\n InitiativeRecord::tableName(),\n 'id',\n ElementRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n\n // TargetRecord\n $this->addForeignKey(\n $this->db->getForeignKeyName(TargetRecord::tableName(), 'elementId'),\n TargetRecord::tableName(),\n 'elementId',\n InitiativeRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n $this->addForeignKey(\n $this->db->getForeignKeyName(TargetRecord::tableName(), 'userId'),\n TargetRecord::tableName(),\n 'userId',\n UserRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n }", "function dwc_activation_functions() {\n\t// Set All Plugin Options when plugin activate\n\t$dwc_plugin_options_data = array(\n\t\t'dwc_shop_wishlist_btn' \t\t=>\t'on',\n\t\t'dwc_shop_wishlist_btn_text' \t=>\t'Wishlist',\n\t\t'dwc_shop_compare_btn' \t\t\t=>\t'on',\n\t\t'dwc_shop_compare_btn_text' \t=>\t'Compare',\n\t\t'dwc_single_wishlist_btn' \t\t=>\t'on',\n\t\t'dwc_single_wishlist_btn_text' \t=>\t'Wishlist',\n\t\t'dwc_single_compare_btn' \t\t=>\t'on',\n\t\t'dwc_single_compare_btn_text' \t=>\t'Compare',\n\t);\n\t// Update Theme Options\n\tupdate_option( 'dwc_plugin_options', $dwc_plugin_options_data, '', 'yes' );\n\n\t// Auto create table when plugin activate\n\tglobal $wpdb;\n\tglobal $jal_db_version;\n\n\t$table_name = $wpdb->prefix . 'liveshoutbox';\n\t\n\t$charset_collate = $wpdb->get_charset_collate();\n\n\t$sql = \"CREATE TABLE $table_name (\n\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\ttime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n\t\tname tinytext NOT NULL,\n\t\ttext text NOT NULL,\n\t\turl varchar(55) DEFAULT '' NOT NULL,\n\t\tUNIQUE KEY id (id)\n\t) $charset_collate;\";\n\n\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\tdbDelta( $sql );\n}", "function create_tables()\n\t{\n\t\tinclude_once(dirname(__FILE__) . '/../../include/class/adodb/adodb.inc.php');\n\t\t$conn = &ADONewConnection($_SESSION['db_type']);\n\t\t$conn->PConnect($_SESSION['db_server'], $_SESSION['db_user'], $_SESSION['db_password'], $_SESSION['db_database']);\n\t\t$config['table_prefix'] = $_SESSION['table_prefix'] . $_SESSION['or_install_lang'] . '_';\n\t\t$config['table_prefix_no_lang'] = $_SESSION['table_prefix'];\n\t\techo $this->lang['install_populate_db'] . '<br />';\n\t\t// include_once('../include/common.php');\n\t\t// removed prefixes because there is already going to be a prefix added.\n\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix_no_lang'] . \"controlpanel (\n\t\t\t controlpanel_version CHAR VARYING(15) NOT NULL ,\n\t\t\t controlpanel_basepath CHAR VARYING(150) NOT NULL,\n\t\t\t controlpanel_baseurl CHAR VARYING(150) NOT NULL,\n\t\t\t controlpanel_admin_name CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_admin_email CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_company_name CHAR VARYING(45),\n\t\t\t controlpanel_company_location CHAR VARYING(45),\n\t\t\t controlpanel_company_logo CHAR VARYING(45),\n\t\t\t controlpanel_url_style INT2 NOT NULL,\n\t\t\t controlpanel_template CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_admin_template CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_listing_template CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_agent_template CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_search_result_template CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_lang CHAR(2) NOT NULL,\n\t\t\t controlpanel_listings_per_page INT4 NOT NULL,\n\t\t\t controlpanel_num_featured_listings INT4 NOT NULL,\n\t\t\t controlpanel_add_linefeeds INT2 NOT NULL,\n\t\t\t controlpanel_strip_html INT2 NOT NULL,\n\t\t\t controlpanel_allowed_html_tags CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_money_sign CHAR VARYING(20) NOT NULL,\n\t\t\t controlpanel_show_no_photo INT2 NOT NULL,\n\t\t\t controlpanel_number_format_style INT4 NOT NULL,\n\t\t\t controlpanel_money_format INT4 NOT NULL,\n\t\t\t controlpanel_date_format INT4 NOT NULL,\n\t\t\t controlpanel_max_listings_uploads INT4 NOT NULL,\n\t\t\t controlpanel_max_listings_upload_size INT4 NOT NULL,\n\t\t\t controlpanel_max_listings_upload_width INT4 NOT NULL,\n\t\t\t controlpanel_max_listings_upload_height INT4 NOT NULL,\n\t\t\t controlpanel_max_user_uploads INT4 NOT NULL,\n\t\t\t controlpanel_max_user_upload_size INT4 NOT NULL,\n\t\t\t controlpanel_max_user_upload_width INT4 NOT NULL,\n\t\t\t controlpanel_max_user_upload_height INT4 NOT NULL,\n\t\t\t controlpanel_max_vtour_uploads INT4 NOT NULL,\n\t\t\t controlpanel_max_vtour_upload_size INT4 NOT NULL,\n\t\t\t controlpanel_max_vtour_upload_width INT4 NOT NULL,\n\t\t\t controlpanel_allowed_upload_extensions CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_make_thumbnail INT2 NOT NULL,\n\t\t\t controlpanel_thumbnail_width INT4 NOT NULL,\n\t\t\t controlpanel_gd_version INT2 NOT NULL,\n\t\t\t controlpanel_thumbnail_prog CHAR VARYING(20) NOT NULL,\n\t\t\t controlpanel_path_to_imagemagick CHAR VARYING(255) NOT NULL,\n\t\t\t controlpanel_resize_img INT2 NOT NULL,\n\t\t\t controlpanel_jpeg_quality INT2 NOT NULL,\n\t\t\t controlpanel_use_expiration INT2 NOT NULL,\n\t\t\t controlpanel_days_until_listings_expire INT4 NOT NULL,\n\t\t\t controlpanel_allow_member_signup INT2 NOT NULL,\n\t\t\t controlpanel_allow_agent_signup INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_active INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_admin INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_feature INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_moderate INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_logview INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_edit_site_config INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_edit_member_template INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_edit_agent_template INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_edit_listing_template INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_canchangeexpirations INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_editpages INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_havevtours INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_num_listings INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_can_export_listings INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_edit_all_users INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_edit_all_listings INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_edit_property_classes INT2 NOT NULL,\n\t\t\t controlpanel_moderate_agents INT2 NOT NULL,\n\t\t\t controlpanel_moderate_members INT2 NOT NULL,\n\t\t\t controlpanel_moderate_listings INT2 NOT NULL,\n\t\t\t controlpanel_export_listings INT2 NOT NULL,\n\t\t\t controlpanel_email_notification_of_new_users INT2 NOT NULL,\n\t\t\t controlpanel_email_notification_of_new_listings INT2 NOT NULL,\n\t\t\t controlpanel_allowed_upload_types CHAR VARYING(95) NOT NULL,\n\t\t\t controlpanel_configured_langs CHAR VARYING(100) NOT NULL,\n\t\t\t controlpanel_email_users_notification_of_new_listings INT2 NOT NULL,\n\t\t\t controlpanel_configured_show_count INT2 NOT NULL,\n\t\t\t controlpanel_map_type CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_map_address CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_map_address2 CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_map_address3 CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_map_address4 CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_map_city CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_map_state CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_map_zip CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_map_country CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_wysiwyg_editor CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_wysiwyg_execute_php INT4 NOT NULL,\n\t\t\t controlpanel_number_decimals_number_fields INT2 NOT NULL,\n\t\t\t controlpanel_number_decimals_price_fields INT2 NOT NULL,\n\t\t\t controlpanel_automatic_update_check INT2 NOT NULL,\n\t\t\t controlpanel_search_sortby CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_search_sorttype CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_show_listedby_admin INT2 NOT NULL,\n\t\t\t controlpanel_show_next_prev_listing_page INT2 NOT NULL,\n\t\t\t controlpanel_multiple_pclass_selection INT2 NOT NULL,\n\t\t\t controlpanel_seo_default_description TEXT NOT NULL,\n\t\t\t controlpanel_seo_default_keywords TEXT NOT NULL,\n\t\t\t controlpanel_seo_listing_description TEXT NOT NULL,\n\t\t\t controlpanel_seo_listing_keywords TEXT NOT NULL,\n\t\t\t controlpanel_seo_default_title TEXT NOT NULL,\n\t\t\t controlpanel_seo_listing_title TEXT NOT NULL,\n\t\t\t controlpanel_template_listing_sections TEXT NOT NULL,\n\t\t\t controlpanel_vtour_template CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vtour_width CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vtour_height CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vt_popup_width CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vt_popup_height CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vtour_fov CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_zero_price INT2 NOT NULL,\n \t\t\t controlpanel_vcard_phone CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vcard_fax CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vcard_mobile CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vcard_address CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vcard_city CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vcard_state CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vcard_zip CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vcard_country CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vcard_notes CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_vcard_url CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_email_information_to_new_users INT2 NOT NULL,\n\t\t\t controlpanel_demo_mode INT2 NOT NULL,\n\t\t\t controlpanel_max_search_results INT4 NOT NULL,\n\t\t\t controlpanel_feature_list_separator CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_search_list_separator CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_use_email_image_verification INT2 NOT NULL,\n\t\t\t controlpanel_rss_title_featured CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_rss_desc_featured CHAR VARYING(255) NOT NULL,\n\t\t\t controlpanel_rss_listingdesc_featured TEXT NOT NULL,\n\t\t\t controlpanel_rss_title_lastmodified CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_rss_desc_lastmodified CHAR VARYING(255) NOT NULL,\n\t\t\t controlpanel_rss_listingdesc_lastmodified TEXT NOT NULL,\n\t\t\t controlpanel_rss_limit_lastmodified INT4 NOT NULL,\n\t\t\t controlpanel_thumbnail_height INT4 NOT NULL,\n\t\t\t controlpanel_resize_thumb_by CHAR VARYING(20) NOT NULL,\n\t\t\t controlpanel_resize_by CHAR VARYING(20) NOT NULL,\n\t\t\t controlpanel_charset VARCHAR( 15 ) NOT NULL,\n\t\t\t controlpanel_wysiwyg_show_edit INT2 NOT NULL,\n\t\t\t controlpanel_textarea_short_chars INT4 NOT NULL,\n\t\t\t controlpanel_main_image_display_by CHAR VARYING(20) NOT NULL,\n\t\t\t controlpanel_main_image_width INT4 NOT NULL,\n\t\t\t controlpanel_main_image_height INT4 NOT NULL,\n\t\t\t controlpanel_number_columns INT4 NOT NULL,\n \t\t\t controlpanel_rss_limit_featured INT4 NOT NULL,\n\t\t\t controlpanel_force_decimals INT2 NOT NULL,\n\t\t\t controlpanel_icon_image_width INT4 NOT NULL,\n\t\t\t controlpanel_icon_image_height INT4 NOT NULL,\n\t\t\t controlpanel_max_listings_file_uploads INT4 NOT NULL,\n\t\t\t controlpanel_max_listings_file_upload_size INT4 NOT NULL,\n\t\t\t controlpanel_allowed_file_upload_extensions CHAR VARYING(255) NOT NULL,\n\t\t\t controlpanel_show_file_icon INT(2) NOT NULL,\n\t\t\t controlpanel_show_file_size INT(2) NOT NULL,\n\t\t\t controlpanel_file_display_option CHAR VARYING(20) NOT NULL,\n\t\t\t controlpanel_include_senders_ip INT(2) NOT NULL,\n\t\t\t controlpanel_agent_default_havefiles INT(2) NOT NULL,\n\t\t\t controlpanel_agent_default_haveuserfiles INT(2) NOT NULL,\n\t\t\t controlpanel_max_users_file_uploads INT4 NOT NULL,\n\t\t\t controlpanel_max_users_file_upload_size INT4 NOT NULL,\n\t\t\t controlpanel_show_notes_field INT2 NOT NULL,\n\t\t\t controlpanel_disable_referrer_check INT2 NOT NULL,\n\t\t\t controlpanel_seo_url_seperator CHAR VARYING(20) NOT NULL,\n\t\t\t controlpanel_search_step_max INT4 NOT NULL,\n\t\t\t controlpanel_special_search_sortby CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_special_search_sorttype CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_price_field CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_users_per_page INT4 NOT NULL,\n\t\t\t controlpanel_use_help_link INT2 NOT NULL,\n\t\t\t controlpanel_main_admin_help_link TEXT NOT NULL,\n\t\t\t controlpanel_add_listing_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_listing_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_user_help_link TEXT NOT NULL,\n\t\t\t controlpanel_user_manager_help_link TEXT NOT NULL,\n\t\t\t controlpanel_page_editor_help_link TEXT NOT NULL,\n\t\t\t controlpanel_modify_listing_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_listing_images_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_vtour_images_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_listing_files_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_agent_template_add_field_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_agent_template_field_order_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_member_template_add_field_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_listing_template_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_listing_template_add_field_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_listings_template_field_order_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_listing_template_search_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_listing_template_search_results_help_link TEXT NOT NULL,\n\t\t\t controlpanel_show_property_classes_help_link TEXT NOT NULL,\n\t\t\t controlpanel_configure_help_link TEXT NOT NULL,\n\t\t\t controlpanel_view_log_help_link TEXT NOT NULL,\n\t\t\t controlpanel_addon_transparentmaps_admin_help_link TEXT NOT NULL,\n\t\t\t controlpanel_addon_transparentmaps_geocode_all_help_link TEXT NOT NULL,\n\t\t\t controlpanel_addon_transparentRETS_config_server_help_link TEXT NOT NULL,\n\t\t\t controlpanel_addon_transparentRETS_config_imports_help_link TEXT NOT NULL,\n\t\t\t controlpanel_user_template_member_help_link TEXT NOT NULL,\n\t\t\t controlpanel_user_template_agent_help_link TEXT NOT NULL,\n\t\t\t controlpanel_modify_property_class_help_link TEXT NOT NULL,\n\t\t\t controlpanel_insert_property_class_help_link TEXT NOT NULL,\n\t\t\t controlpanel_addon_IDXManager_config_help_link TEXT NOT NULL,\n\t\t\t controlpanel_addon_IDXManager_classmanager_help_link TEXT NOT NULL,\n\t\t\t controlpanel_addon_csvloader_admin_help_link TEXT NOT NULL,\n\t\t\t controlpanel_edit_member_template_field_order_help_link TEXT NOT NULL,\n\t\t\t controlpanel_show_admin_on_agent_list INT2 NOT NULL,\n\t\t\t controlpanel_agent_default_num_featuredlistings INT4 NOT NULL,\n\t\t\t controlpanel_use_signup_image_verification INT2 NOT NULL,\n\t\t\t controlpanel_site_email CHAR VARYING(45) NOT NULL,\n\t\t\t controlpanel_mbstring_enabled INT2 NOT NULL,\n\t\t\t controlpanel_require_email_verification INT2 NOT NULL,\n\t\t\t controlpanel_blog_requires_moderation INT2 NOT NULL,\n\t\t\t controlpanel_maintenance_mode INT2 NOT NULL,\n\t \t\t controlpanel_notification_last_timestamp TIMESTAMP NOT NULL DEFAULT now(),\n\t \t\t controlpanel_notify_listings_template CHAR VARYING(45) NOT NULL,\n\t\t\t PRIMARY KEY(controlpanel_version)\n\t\t\t);\";\n\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix_no_lang'] . \"addons (\n\t\t\t addons_version CHAR VARYING(15) NOT NULL,\n\t\t\t addons_name CHAR VARYING(150) NOT NULL,\n\t\t\t PRIMARY KEY(addons_name)\n\t\t\t);\";\n\t\tif (strpos($_SESSION['db_type'], 'postgres') !== false) {\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix_no_lang'] . \"zipdist (\n\t\t\t zipdist_zipcode char(5) NULL,\n\t\t\t zipdist_ziptype char(1) NULL,\n\t\t\t zipdist_cityname CHAR VARYING(64) NULL,\n\t\t\t zipdist_citytype char(1) NULL,\n\t\t\t zipdist_statename CHAR VARYING(64) NULL,\n\t\t\t zipdist_stateabbr char(2) NULL,\n\t\t\t zipdist_areacode char(3) NULL,\n\t\t\t zipdist_latitude decimal(9,6) NULL,\n\t\t\t zipdist_longitude decimal(9,6) NULL,\n\t\t\t zipdist_id SERIAL NOT NULL,\n\t\t\t PRIMARY KEY (zipdist_id)\n\t\t\t);\";\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"activitylog (\n\t\t\t\tactivitylog_id SERIAL NOT NULL,\n\t\t\t\tactivitylog_log_date TIMESTAMP NOT NULL,\n\t\t\t\tuserdb_id INT4 NOT NULL,\n\t\t\t\tactivitylog_action CHAR VARYING(150) NOT NULL,\n\t\t\t\tactivitylog_ip_address CHAR VARYING(15) NOT NULL,\n\t\t\t\tPRIMARY KEY(activitylog_id)\n\t\t\t\t);\";\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"agentformelements (\n\t\t\t\t agentformelements_id SERIAL NOT NULL,\n\t\t\t\t agentformelements_field_type CHAR VARYING(20) NOT NULL,\n\t\t\t\t agentformelements_field_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t agentformelements_field_caption CHAR VARYING(80) NOT NULL,\n\t\t\t\t agentformelements_default_text TEXT NOT NULL,\n\t\t\t\t agentformelements_field_elements TEXT NOT NULL,\n\t\t\t\t agentformelements_rank INT4 NOT NULL,\n\t\t\t\t agentformelements_required CHAR(3) NOT NULL,\n\t\t\t\t agentformelements_display_priv INT4 NOT NULL,\n\t\t\t\t agentformelements_tool_tip TEXT NOT NULL,\n\t\t\t\t PRIMARY KEY(agentformelements_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"listingsdb (\n\t\t\t\t listingsdb_id SERIAL NOT NULL,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t listingsdb_title TEXT NOT NULL,\n\t\t\t\t listingsdb_expiration DATE NOT NULL,\n\t\t\t\t listingsdb_notes TEXT NOT NULL,\n\t\t\t\t listingsdb_creation_date DATE NOT NULL,\n\t\t\t\t listingsdb_last_modified DATETIME NOT NULL,\n\t\t\t\t listingsdb_hit_count INT4 NOT NULL,\n\t\t\t\t listingsdb_featured CHAR(3) NOT NULL,\n\t\t\t\t listingsdb_active CHAR(3) NOT NULL,\n\t\t\t\t listingsdb_mlsexport CHAR(3) NOT NULL,\n\t\t\t\t PRIMARY KEY(listingsdb_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"listingsdbelements (\n\t\t\t\t listingsdbelements_id SERIAL NOT NULL,\n\t\t\t\t listingsdbelements_field_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t listingsdbelements_field_value TEXT NOT NULL,\n\t\t\t\t listingsdb_id INT4 NOT NULL,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t PRIMARY KEY(listingsdbelements_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"listingsformelements (\n\t\t\t\t listingsformelements_id SERIAL NOT NULL,\n\t\t\t\t listingsformelements_field_type CHAR VARYING(20) NOT NULL,\n\t\t\t\t listingsformelements_field_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t listingsformelements_field_caption CHAR VARYING(80) NOT NULL,\n\t\t\t\t listingsformelements_default_text TEXT NOT NULL,\n\t\t\t\t listingsformelements_field_elements TEXT NOT NULL,\n\t\t\t\t listingsformelements_rank INT4 NOT NULL,\n\t\t\t\t listingsformelements_search_rank INT4 NOT NULL,\n\t\t\t\t listingsformelements_search_result_rank INT4 NOT NULL,\n\t\t\t\t listingsformelements_required CHAR(3) NOT NULL,\n\t\t\t\t listingsformelements_location CHAR VARYING(50) NOT NULL,\n\t\t\t\t listingsformelements_display_on_browse CHAR(3) NOT NULL,\n\t\t\t\t listingsformelements_searchable INT4 NOT NULL,\n\t\t\t\t listingsformelements_search_type CHAR VARYING(50) NULL,\n\t\t\t\t listingsformelements_search_label CHAR VARYING(50) NULL,\n\t\t\t\t listingsformelements_search_step CHAR VARYING(25) NULL,\n\t\t\t\t listingsformelements_display_priv INT4 NOT NULL,\n\t\t\t\t listingsformelements_field_length INT4 NULL,\n\t\t\t\t listingsformelements_tool_tip TEXT NULL,\n\t\t\t\t PRIMARY KEY(listingsformelements_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"listingsimages (\n\t\t\t\t listingsimages_id SERIAL NOT NULL,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t listingsimages_caption CHAR VARYING(255) NOT NULL,\n\t\t\t\t listingsimages_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t listingsimages_thumb_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t listingsimages_description TEXT NOT NULL,\n\t\t\t\t listingsdb_id INT4 NOT NULL,\n\t\t\t\t listingsimages_rank INT4 NOT NULL,\n\t\t\t\t listingsimages_active CHAR(3) NOT NULL,\n\t\t\t\t PRIMARY KEY(listingsimages_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"listingsfiles (\n\t\t\t\t listingsfiles_id SERIAL NOT NULL,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t listingsfiles_caption varchar(255) NOT NULL,\n\t\t\t\t listingsfiles_file_name varchar(255) NOT NULL,\n\t\t\t\t listingsfiles_description TEXT NOT NULL,\n\t\t\t\t listingsdb_id INT4 NOT NULL,\n\t\t\t\t listingsfiles_rank INT4 NOT NULL,\n\t\t\t\t listingsfiles_active char(3) NOT NULL,\n\t\t\t\t PRIMARY KEY (listingsfiles_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"usersfiles (\n\t\t\t\t usersfiles_id SERIAL NOT NULL,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t usersfiles_caption varchar(255) NOT NULL,\n\t\t\t\t usersfiles_file_name varchar(255) NOT NULL,\n\t\t\t\t usersfiles_description TEXT NOT NULL,\n\t\t\t\t listingsdb_id INT4 NOT NULL,\n\t\t\t\t usersfiles_rank INT4 NOT NULL,\n\t\t\t\t usersfiles_active char(3) NOT NULL,\n\t\t\t\t PRIMARY KEY (usersfiles_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"vtourimages (\n\t\t\t\t vtourimages_id SERIAL NOT NULL,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t vtourimages_caption CHAR VARYING(255) NOT NULL,\n\t\t\t\t vtourimages_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t vtourimages_thumb_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t vtourimages_description TEXT NOT NULL,\n\t\t\t\t listingsdb_id INT4 NOT NULL,\n\t\t\t\t vtourimages_rank INT4 NOT NULL,\n\t\t\t\t vtourimages_active CHAR(3) NOT NULL,\n\t\t\t\t PRIMARY KEY(vtourimages_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"memberformelements (\n\t\t\t\t memberformelements_id SERIAL NOT NULL,\n\t\t\t\t memberformelements_field_type CHAR VARYING(20) NOT NULL,\n\t\t\t\t memberformelements_field_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t memberformelements_field_caption CHAR VARYING(80) NOT NULL,\n\t\t\t\t memberformelements_default_text TEXT NOT NULL,\n\t\t\t\t memberformelements_field_elements TEXT NOT NULL,\n\t\t\t\t memberformelements_rank INT4 NOT NULL,\n\t\t\t\t memberformelements_required CHAR(3) NOT NULL,\n\t\t\t\t memberformelements_display_priv INT4 NOT NULL DEFAULT 0,\n\t\t\t\t memberformelements_tool_tip TEXT NOT NULL,\n\t\t\t\t PRIMARY KEY(memberformelements_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"pagesmain (\n\t\t\t\t pagesmain_id SERIAL NOT NULL,\n\t\t\t\t pagesmain_title TEXT NOT NULL,\n\t\t\t\t pagesmain_date CHAR VARYING(20) NOT NULL,\n\t\t\t\t pagesmain_summary CHAR VARYING(255) NOT NULL,\n\t\t\t\t pagesmain_full TEXT NOT NULL,\n\t\t\t\t pagesmain_no_visitors INT4 NOT NULL,\n\t\t\t\t pagesmain_complete INT2 NOT NULL,\n\t\t\t\t pagesmain_description TEXT NOT NULL,\n\t\t\t\t pagesmain_keywords TEXT NOT NULL,\n\t\t\t\t PRIMARY KEY(pagesmain_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"userdb (\n\t\t\t\t userdb_id SERIAL NOT NULL,\n\t\t\t\t userdb_user_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t userdb_emailaddress CHAR VARYING(80) NOT NULL,\n\t\t\t\t userdb_user_first_name CHAR VARYING(100) NOT NULL,\n\t\t\t\t userdb_user_last_name CHAR VARYING(100) NOT NULL,\n\t\t\t\t userdb_comments TEXT NOT NULL,\n\t\t\t\t userdb_user_password CHAR VARYING(50) NOT NULL,\n\t\t\t\t userdb_is_admin CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_site_config CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_member_template CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_agent_template CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_listing_template CHAR(3) NOT NULL,\n\t\t\t\t userdb_creation_date DATE NOT NULL,\n\t\t\t\t userdb_can_feature_listings CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_view_logs CHAR(3) NOT NULL,\n\t\t\t\t userdb_last_modified TIMESTAMP NOT NULL,\n\t\t\t\t userdb_hit_count INT4 NOT NULL,\n\t\t\t\t userdb_can_moderate CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_pages CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_have_vtours CHAR(3) NOT NULL,\n\t\t\t\t userdb_is_agent CHAR(3) NOT NULL,\n\t\t\t\t userdb_active CHAR(3) NOT NULL,\n\t\t\t\t userdb_limit_listings INT4 NOT NULL,\n\t\t\t\t userdb_can_edit_expiration CHAR VARYING(100) NOT NULL,\n\t\t\t\t userdb_can_export_listings CHAR VARYING(100) NOT NULL,\n\t\t\t\t userdb_can_edit_all_users CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_all_listings CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_property_classes CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_have_files CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_have_user_files CHAR(3) NOT NULL,\n\t\t\t\t userdb_blog_user_type INT4 NOT NULL DEFAULT 1,\n\t\t\t\t userdb_can_manage_addons CHAR(3) NOT NULL,\n\t\t\t\t userdb_rank INT4 NOT NULL,\n\t\t\t\t userdb_featuredlistinglimit INT4 NOT NULL,\n\t\t\t\t userdb_email_verified CHAR(3) NOT NULL,\n\t\t\t\t PRIMARY KEY(userdb_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"userdbelements (\n\n\t\t\t\t userdbelements_id SERIAL NOT NULL,\n\t\t\t\t userdbelements_field_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t userdbelements_field_value TEXT NOT NULL,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t PRIMARY KEY(userdbelements_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"userfavoritelistings (\n\t\t\t\t userfavoritelistings_id SERIAL NOT NULL,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t listingsdb_id INT4 NOT NULL,\n\t\t\t\t PRIMARY KEY(userfavoritelistings_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"userimages (\n\t\t\t\t userimages_id SERIAL NOT NULL,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t userimages_caption CHAR VARYING(255) NOT NULL,\n\t\t\t\t userimages_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t userimages_thumb_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t userimages_description TEXT NOT NULL,\n\t\t\t\t userimages_rank INT4 NOT NULL,\n\t\t\t\t userimages_active CHAR(3) NOT NULL,\n\t\t\t\t PRIMARY KEY(userimages_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"usersavedsearches (\n\t\t\t\t usersavedsearches_id SERIAL NOT NULL,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t usersavedsearches_title CHAR VARYING(255) NOT NULL,\n\t\t\t\t usersavedsearches_query_string TEXT NOT NULL,\n\t\t\t\t usersavedsearches_last_viewed TIMESTAMP NOT NULL,\n\t\t\t\t usersavedsearches_new_listings INT2 NOT NULL,\n\t\t\t\t usersavedsearches_notify CHAR VARYING(3) NOT NULL,\n\t\t\t\t PRIMARY KEY(usersavedsearches_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix_no_lang'] . \"forgot (\n\t\t\t\t forgot_id SERIAL NOT NULL,\n\t\t\t\t forgot_rand INT4 NOT NULL,\n\t\t\t\t forgot_email CHAR VARYING(45) NOT NULL,\n\t\t\t\t forgot_time TIMESTAMP NOT NULL,\n\t\t\t\t PRIMARY KEY(forgot_id)\n\t\t\t\t);\";\n\t\t\t// Create Tables for property classing\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix_no_lang'] . \"classformelements (\n\t\t\t\t\t\t\t\t classformelements_id SERIAL NOT NULL,\n\t\t\t\t\t\t\t\t class_id INT4 NOT NULL,\n\t\t\t\t\t\t\t\t listingsformelements_id INT4 NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY(classformelements_id)\n\t\t\t\t\t\t\t\t);\";\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix_no_lang'] . \"classlistingsdb (\n\t\t\t\t\t\t\t\t classlistingsdb_id SERIAL NOT NULL,\n\t\t\t\t\t\t\t\t class_id INT4 NOT NULL,\n\t\t\t\t\t\t\t\t listingsdb_id INT4 NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY(classlistingsdb_id)\n\t\t\t\t\t\t\t\t);\";\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"class (\n\t\t\t\t\t\t\t\t class_id SERIAL NOT NULL,\n\t\t\t\t\t\t\t\t class_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t\t\t\t\t class_rank INT2 NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY(class_id)\n\t\t\t\t\t\t\t\t);\";\n\t\t} else {\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix_no_lang'] . \"zipdist (\n\t\t\t zipdist_zipcode char(5) NULL,\n\t\t\t zipdist_ziptype char(1) NULL,\n\t\t\t zipdist_cityname CHAR VARYING(64) NULL,\n\t\t\t zipdist_citytype char(1) NULL,\n\t\t\t zipdist_statename CHAR VARYING(64) NULL,\n\t\t\t zipdist_stateabbr char(2) NULL,\n\t\t\t zipdist_areacode char(3) NULL,\n\t\t\t zipdist_latitude decimal(9,6) NULL,\n\t\t\t zipdist_longitude decimal(9,6) NULL,\n\t\t\t zipdist_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t PRIMARY KEY (zipdist_id)\n\t\t\t);\";\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"activitylog (\n\t\t\t\t activitylog_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t activitylog_log_date TIMESTAMP NOT NULL,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t activitylog_action CHAR VARYING(150) NOT NULL,\n\t\t\t\t activitylog_ip_address CHAR VARYING(15) NOT NULL,\n\t\t\t\t PRIMARY KEY(activitylog_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"agentformelements (\n\t\t\t\t agentformelements_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t agentformelements_field_type CHAR VARYING(20) NOT NULL,\n\t\t\t\t agentformelements_field_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t agentformelements_field_caption CHAR VARYING(80) NOT NULL,\n\t\t\t\t agentformelements_default_text TEXT NOT NULL,\n\t\t\t\t agentformelements_field_elements TEXT NOT NULL,\n\t\t\t\t agentformelements_rank INT4 NOT NULL,\n\t\t\t\t agentformelements_required CHAR(3) NOT NULL,\n\t\t\t\t agentformelements_display_priv INT4 NOT NULL,\n\t\t\t\t agentformelements_tool_tip TEXT NULL,\n\t\t\t\t PRIMARY KEY(agentformelements_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"listingsdb (\n\t\t\t\t listingsdb_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t listingsdb_title TEXT NOT NULL,\n\t\t\t\t listingsdb_expiration DATE NOT NULL,\n\t\t\t\t listingsdb_notes TEXT NOT NULL,\n\t\t\t\t listingsdb_creation_date DATE NOT NULL,\n\t\t\t\t listingsdb_last_modified DATETIME NOT NULL,\n\t\t\t\t listingsdb_hit_count INT4 NOT NULL,\n\t\t\t\t listingsdb_featured CHAR(3) NOT NULL,\n\t\t\t\t listingsdb_active CHAR(3) NOT NULL,\n\t\t\t\t listingsdb_mlsexport CHAR(3) NOT NULL,\n\t\t\t\t PRIMARY KEY(listingsdb_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"listingsdbelements (\n\t\t\t\t listingsdbelements_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t listingsdbelements_field_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t listingsdbelements_field_value TEXT NOT NULL,\n\t\t\t\t listingsdb_id INT4 NOT NULL,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t PRIMARY KEY(listingsdbelements_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"listingsformelements (\n\t\t\t\t listingsformelements_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t listingsformelements_field_type CHAR VARYING(20) NOT NULL,\n\t\t\t\t listingsformelements_field_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t listingsformelements_field_caption CHAR VARYING(80) NOT NULL,\n\t\t\t\t listingsformelements_default_text TEXT NOT NULL,\n\t\t\t\t listingsformelements_field_elements TEXT NOT NULL,\n\t\t\t\t listingsformelements_rank INT4 NOT NULL,\n\t\t\t\t listingsformelements_search_rank INT4 NOT NULL,\n\t\t\t\t listingsformelements_search_result_rank INT4 NOT NULL,\n\t\t\t\t listingsformelements_required CHAR(3) NOT NULL,\n\t\t\t\t listingsformelements_location CHAR VARYING(50) NOT NULL,\n\t\t\t\t listingsformelements_display_on_browse CHAR(3) NOT NULL,\n\t\t\t\t listingsformelements_searchable INT4 NOT NULL,\n\t\t\t\t listingsformelements_search_type CHAR VARYING(50) NULL,\n\t\t\t\t listingsformelements_search_label CHAR VARYING(50) NULL,\n\t\t\t\t listingsformelements_search_step CHAR VARYING(25) NULL,\n\t\t\t\t listingsformelements_display_priv INT4 NOT NULL,\n\t\t\t\t listingsformelements_field_length INT4 NULL,\n\t\t\t\t listingsformelements_tool_tip TEXT NULL,\n\t\t\t\t PRIMARY KEY(listingsformelements_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"listingsimages (\n\t\t\t\t listingsimages_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t listingsimages_caption CHAR VARYING(255) NOT NULL,\n\t\t\t\t listingsimages_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t listingsimages_thumb_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t listingsimages_description TEXT NOT NULL,\n\t\t\t\t listingsdb_id INT4 NOT NULL,\n\t\t\t\t listingsimages_rank INT4 NOT NULL,\n\t\t\t\t listingsimages_active CHAR(3) NOT NULL,\n\t\t\t\t PRIMARY KEY(listingsimages_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"listingsfiles (\n\t\t\t\t listingsfiles_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t listingsfiles_caption CHAR VARYING(255) NOT NULL,\n\t\t\t\t listingsfiles_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t listingsfiles_description TEXT NOT NULL,\n\t\t\t\t listingsdb_id INT4 NOT NULL,\n\t\t\t\t listingsfiles_rank INT4 NOT NULL,\n\t\t\t\t listingsfiles_active CHAR(3) NOT NULL,\n\t\t\t\t PRIMARY KEY (listingsfiles_id)\n\t\t\t\t);\";\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"usersfiles (\n\t\t\t\t usersfiles_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t usersfiles_caption CHAR VARYING(255) NOT NULL,\n\t\t\t\t usersfiles_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t usersfiles_description TEXT NOT NULL,\n\t\t\t\t usersfiles_rank INT4 NOT NULL,\n\t\t\t\t usersfiles_active CHAR(3) NOT NULL,\n\t\t\t\t PRIMARY KEY (usersfiles_id)\n\t\t\t);\";\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"vtourimages (\n\t\t\t\t vtourimages_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t vtourimages_caption CHAR VARYING(255) NOT NULL,\n\t\t\t\t vtourimages_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t vtourimages_thumb_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t vtourimages_description TEXT NOT NULL,\n\t\t\t\t listingsdb_id INT4 NOT NULL,\n\t\t\t\t vtourimages_rank INT4 NOT NULL,\n\t\t\t\t vtourimages_active CHAR(3) NOT NULL,\n\t\t\t\t PRIMARY KEY(vtourimages_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"memberformelements (\n\t\t\t\t memberformelements_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t memberformelements_field_type CHAR VARYING(20) NOT NULL,\n\t\t\t\t memberformelements_field_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t memberformelements_field_caption CHAR VARYING(80) NOT NULL,\n\t\t\t\t memberformelements_default_text TEXT NOT NULL,\n\t\t\t\t memberformelements_field_elements TEXT NOT NULL,\n\t\t\t\t memberformelements_rank INT4 NOT NULL,\n\t\t\t\t memberformelements_required CHAR(3) NOT NULL,\n\t\t\t\t memberformelements_tool_tip TEXT NULL,\n\t\t\t\t PRIMARY KEY(memberformelements_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"pagesmain (\n\t\t\t\t pagesmain_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t pagesmain_title TEXT NOT NULL,\n\t\t\t\t pagesmain_date CHAR VARYING(20) NOT NULL,\n\t\t\t\t pagesmain_summary CHAR VARYING(255) NOT NULL,\n\t\t\t\t pagesmain_full LONGTEXT NOT NULL,\n\t\t\t\t pagesmain_no_visitors INT4 NOT NULL,\n\t\t\t\t pagesmain_complete INT2 NOT NULL,\n\t\t\t\t pagesmain_description LONGTEXT NOT NULL,\n\t\t\t\t pagesmain_keywords LONGTEXT NOT NULL,\n\t\t\t\t PRIMARY KEY(pagesmain_id)\n\t\t\t\t);\";\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"userdb (\n\t\t\t\t userdb_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t userdb_user_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t userdb_emailaddress CHAR VARYING(80) NOT NULL,\n\t\t\t\t userdb_user_first_name CHAR VARYING(100) NOT NULL,\n\t\t\t\t userdb_user_last_name CHAR VARYING(100) NOT NULL,\n\t\t\t\t userdb_comments TEXT NOT NULL,\n\t\t\t\t userdb_user_password CHAR VARYING(50) NOT NULL,\n\t\t\t\t userdb_is_admin CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_site_config CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_member_template CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_agent_template CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_listing_template CHAR(3) NOT NULL,\n\t\t\t\t userdb_creation_date DATE NOT NULL,\n\t\t\t\t userdb_can_feature_listings CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_view_logs CHAR(3) NOT NULL,\n\t\t\t\t userdb_last_modified TIMESTAMP NOT NULL,\n\t\t\t\t userdb_hit_count INT4 NOT NULL,\n\t\t\t\t userdb_can_moderate CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_pages CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_have_vtours CHAR(3) NOT NULL,\n\t\t\t\t userdb_is_agent CHAR(3) NOT NULL,\n\t\t\t\t userdb_active CHAR(3) NOT NULL,\n\t\t\t\t userdb_limit_listings INT4 NOT NULL,\n\t\t\t\t userdb_can_edit_expiration CHAR VARYING(100) NOT NULL,\n\t\t\t\t userdb_can_export_listings CHAR VARYING(100) NOT NULL,\n\t\t\t\t userdb_can_edit_all_users CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_all_listings CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_edit_property_classes CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_have_files CHAR(3) NOT NULL,\n\t\t\t\t userdb_can_have_user_files CHAR(3) NOT NULL,\n\t\t\t\t userdb_blog_user_type INT4 NOT NULL DEFAULT 1,\n\t\t\t\t userdb_can_manage_addons CHAR(3) NOT NULL,\n\t\t\t\t userdb_rank INT4 NOT NULL,\n\t\t\t\t userdb_featuredlistinglimit INT4 NOT NULL,\n\t\t\t\t userdb_email_verified CHAR(3) NOT NULL,\n\t\t\t\t PRIMARY KEY(userdb_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"userdbelements (\n\t\t\t\t userdbelements_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t userdbelements_field_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t userdbelements_field_value TEXT NOT NULL,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t PRIMARY KEY(userdbelements_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"userfavoritelistings (\n\t\t\t\t userfavoritelistings_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t listingsdb_id INT4 NOT NULL,\n\t\t\t\t PRIMARY KEY(userfavoritelistings_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"userimages (\n\t\t\t\t userimages_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t userimages_caption CHAR VARYING(255) NOT NULL,\n\t\t\t\t userimages_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t userimages_thumb_file_name CHAR VARYING(255) NOT NULL,\n\t\t\t\t userimages_description TEXT NOT NULL,\n\t\t\t\t userimages_rank INT4 NOT NULL,\n\t\t\t\t userimages_active CHAR(3) NOT NULL,\n\t\t\t\t PRIMARY KEY(userimages_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"usersavedsearches (\n\t\t\t\t usersavedsearches_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t usersavedsearches_title CHAR VARYING(255) NOT NULL,\n\t\t\t\t usersavedsearches_query_string TEXT NOT NULL,\n\t\t\t\t usersavedsearches_last_viewed TIMESTAMP NOT NULL,\n\t\t\t\t usersavedsearches_new_listings INT2 NOT NULL,\n\t\t\t\t usersavedsearches_notify CHAR VARYING(3) NOT NULL,\n\t\t\t\t PRIMARY KEY(usersavedsearches_id)\n\t\t\t\t);\";\n\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix_no_lang'] . \"forgot (\n\t\t\t\t forgot_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t\t forgot_rand INTEGER UNSIGNED NOT NULL,\n\t\t\t\t forgot_email CHAR VARYING(45) NOT NULL,\n\t\t\t\t forgot_time TIMESTAMP NOT NULL,\n\t\t\t\t PRIMARY KEY(forgot_id)\n\t\t\t\t);\";\n\t\t\t// Create Tables for property classing\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix_no_lang'] . \"classformelements (\n\t\t\t\t\t\t\t\t classformelements_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t class_id INT4 NOT NULL,\n\t\t\t\t\t\t\t\t listingsformelements_id INT4 NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY(classformelements_id)\n\t\t\t\t\t\t\t\t);\";\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix_no_lang'] . \"classlistingsdb (\n\t\t\t\t\t\t\t\t classlistingsdb_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t class_id INT4 NOT NULL,\n\t\t\t\t\t\t\t\t listingsdb_id INT4 NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY(classlistingsdb_id)\n\t\t\t\t\t\t\t\t);\";\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"class (\n\t\t\t\t\t\t\t\t class_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t class_name CHAR VARYING(80) NOT NULL,\n\t\t\t\t\t\t\t\t class_rank INT2 NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY(class_id)\n\t\t\t\t\t\t\t\t);\";\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"blogmain (\n\t\t\t\t blogmain_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t userdb_id INT4 NOT NULL,\n\t\t\t\t blogmain_title TEXT NOT NULL,\n\t\t\t\t blogmain_date CHAR VARYING(20) NOT NULL,\n\t\t\t\t blogmain_full LONGTEXT NOT NULL,\n\t\t\t\t blogmain_description LONGTEXT NOT NULL,\n\t\t\t\t blogmain_keywords LONGTEXT NOT NULL,\n\t\t\t\t blogmain_published INT4 NOT NULL,\n\t\t\t\t PRIMARY KEY(blogmain_id)\n\t\t\t\t);\";\n\t\t\t$sql_insert[] = \"CREATE TABLE \" . $config['table_prefix'] . \"blogcomments (\n\t\t\t\t blogcomments_id INT4 NOT NULL AUTO_INCREMENT,\n\t\t\t\t blogmain_id INT4 NOT NULL,\n\t\t\t\t userdb_id INT4 NULL,\n\t\t\t\t blogcomments_timestamp INT4 NOT NULL,\n\t\t\t\t blogcomments_text LONGTEXT NOT NULL,\n\t\t\t\t blogcomments_moderated BOOLEAN,\n\t\t\t\t PRIMARY KEY(blogcomments_id)\n\t\t\t\t);\";\n\n\t\t}\n\t\t while (list($elementIndexValue, $elementContents) = each($sql_insert)) {\n\t\t\t$recordSet = $conn->Execute($elementContents);\n\t\t\tif ($recordSet === false) {\n\t\t\t\tif ($_SESSION['devel_mode'] == 'no') {\n\t\t\t\t\tdie (\"<strong><span style=\\\"red\\\">ERROR - $elementContents</span></strong><br />\");\n\t\t\t\t}else {\n\t\t\t\t\techo \"<strong><span style=\\\"red\\\">ERROR - $elementContents</span></strong><br />\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo 'Tables Created<br />';\n\t}", "function alr_clima_updbd()\n{\n\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t$sql_table=\"CREATE TABLE IF NOT EXISTS \".$wpdb->prefix.\"clima_provincias (pro_id int(11) NOT NULL, pro_name varchar(100) NOT NULL, PRIMARY KEY pro_id(pro_id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;\";\n\tdbDelta( $sql_table );\n\t\n\t$sql_table2=\"CREATE TABLE IF NOT EXISTS \".$wpdb->prefix.\"clima_localidades (loc_id int(11) NOT NULL, loc_name varchar(100) NOT NULL, loc_pro_id int(11) NOT NULL, loc_lastupd VARCHAR(20), PRIMARY KEY loc_id (loc_id), KEY loc_pro_id(loc_pro_id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;\";\n\tdbDelta( $sql_table2 );\n\t\n\t$sql_table3=\"CREATE TABLE IF NOT EXISTS \".$wpdb->prefix.\"clima_pronosticos (cli_id int(11) NOT NULL AUTO_INCREMENT, cli_loc_id int(11) NOT NULL, cli_min int(2) NOT NULL, cli_max int(2) NOT NULL, cli_ico int(2), cli_estado varchar(100), cli_dia varchar(25), cli_diaano int(3), cli_ano int(4), PRIMARY KEY cli_id(cli_id), KEY cli_loc_id (cli_loc_id), KEY cli_diaano(cli_diaano, cli_ano)) ENGINE=InnoDB DEFAULT CHARSET=utf8;\";\n\tdbDelta( $sql_table3 );\n\t\n\t$response=alr_clima_provincias();\n\t$wpdb->hide_errors();\n\tforeach ($response as $cod=>$prov)\n\t{\t\t\n\t\t$wpdb->query($wpdb->prepare(\"INSERT INTO \".$wpdb->prefix.\"clima_provincias(pro_id, pro_name) VALUES(%d, %s)\",$cod,$prov));\n\t\t$arloc=alr_clima_localidad($cod);\n\t\t$sqlloc=\"\";\n\t\tforeach ($arloc as $lid=>$loc)\n\t\t{\n\t\t\t$sqlloc.=$wpdb->prepare(\"(%d, %s, %d),\", $lid, $loc, $cod);\n\t\t}\n\t\tif($sqlloc!=\"\") \n\t\t{\n\t\t\t$sqlloc=substr($sqlloc, 0, strlen($sqlloc)-1);\n\t\t\t$wpdb->query(\"INSERT INTO \".$wpdb->prefix.\"clima_localidades(loc_id, loc_name, loc_pro_id) VALUES $sqlloc;\");\n\t\t} \n\t}\n\t$wpdb->query($wpdb->prepare(\"INSERT INTO \".$wpdb->prefix.\"clima_provincias(pro_id, pro_name) VALUES(%d, %s)\",13584, \"Ciudad Autonoma de Buenos Aires\"));\n\t$wpdb->query($wpdb->prepare(\"INSERT INTO \".$wpdb->prefix.\"clima_localidades(loc_id, loc_name, loc_pro_id) VALUES (%d, %s, %d)\", 13584, \"Ciudad Autonoma de Buenos Aires\", 13584));\n\tupdate_option(\"alr_clima\",true);\n}", "public function set_WeblinksInfo() {\n\n set_title(self::$locale['web_0000']);\n\n BreadCrumbs::getInstance()->addBreadCrumb(\n [\n 'link' => INFUSIONS.\"weblinks/weblinks.php\",\n 'title' => self::$locale['web_0000']\n ]\n );\n\n $this->def_cat['weblink_tablename'] = self::$locale['web_0000'];\n $this->def_cat['weblink_filter'] += self::get_WeblinkFilters();\n $this->def_cat['weblink_categories'] += self::get_WeblinkCategories();\n\n return (array)$this->def_cat;\n\n }", "public static function add_network_settings() {\n\t\tadd_settings_section(\n\t\t\t'cjur-network-settings-section',\n\t\t\t__( 'CSS JS URL Rewriter', 'css-js-url-rewriter' ),\n\t\t\t'__return_false',\n\t\t\t'cjur-network-settings-page'\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'css_js_url_rewriter_cdn_url',\n\t\t\t__( 'CDN URL', 'css-js-url-rewriter' ),\n\t\t\t[ __CLASS__, 'render_field' ],\n\t\t\t'cjur-network-settings-page',\n\t\t\t'cjur-network-settings-section'\n\t\t);\n\t}", "function upgrade_addWebservicesFeature()\r\n{\r\n global $_TABLES;\r\n\r\n $ft_id = DB_getItem($_TABLES['features'], 'ft_id',\r\n \"ft_name = 'webservices.atompub'\");\r\n $grp_id = DB_getItem($_TABLES['groups'], 'grp_id',\r\n \"grp_name = 'Webservices Users'\");\r\n $rootgrp = DB_getItem($_TABLES['groups'], 'grp_id', \"grp_name = 'Root'\");\r\n\r\n if (($grp_id > 0) && ($ft_id > 0)) {\r\n // add 'webservices.atompub' feature to 'Webservices Users' group\r\n DB_query(\"INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ($ft_id, $grp_id)\");\r\n\r\n // make 'Root' members a member of 'Webservices Users'\r\n if ($rootgrp > 0) {\r\n DB_query(\"INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES ($grp_id, NULL, $rootgrp)\");\r\n }\r\n }\r\n}" ]
[ "0.4868019", "0.46813077", "0.46539247", "0.46389386", "0.4593109", "0.45888263", "0.45174706", "0.45115185", "0.44924554", "0.44784907", "0.44563314", "0.44329885", "0.44283924", "0.44063735", "0.4346143", "0.4321289", "0.4320234", "0.43152604", "0.43025306", "0.4295783", "0.4280379", "0.4278479", "0.42583698", "0.4249911", "0.42396286", "0.42333946", "0.4209567", "0.42046118", "0.4202227", "0.42012113" ]
0.67638546
0
Return array of supported resource actions for this resource If resourceName cannot be found, just return an empty array
public function getSupportedActions($resourceName) { if(empty($resourceName) ) throw new \InvalidArgumentException('Resource name must not be empty.'); // load permission resources file from config file $init_perms_arr = ConfigHelper::getInitPermResources(); if(array_key_exists($resourceName, $init_perms_arr )) { $supported_actions = $init_perms_arr[$resourceName] ; return $supported_actions; } return array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getResourceActions()\n {\n if (array_key_exists(\"resourceActions\", $this->_propDict)) {\n return $this->_propDict[\"resourceActions\"];\n } else {\n return null;\n }\n }", "static protected function get_resource_actions(): array\n\t{\n\t\treturn [\n\n\t\t\tself::ACTION_INDEX => [ '/{name}', Request::METHOD_GET ],\n\t\t\tself::ACTION_NEW => [ '/{name}/new', Request::METHOD_GET ],\n\t\t\tself::ACTION_CREATE => [ '/{name}', Request::METHOD_POST ],\n\t\t\tself::ACTION_SHOW => [ '/{name}/{id}', Request::METHOD_GET ],\n\t\t\tself::ACTION_EDIT => [ '/{name}/{id}/edit', Request::METHOD_GET ],\n\t\t\tself::ACTION_UPDATE => [ '/{name}/{id}', [ Request::METHOD_PUT, Request::METHOD_PATCH ] ],\n\t\t\tself::ACTION_DELETE => [ '/{name}/{id}', Request::METHOD_DELETE ]\n\n\t\t];\n\t}", "protected function getSupportedAttributes()\n {\n return [\n ResourceActions::CREATE,\n ResourceActions::DELETE,\n ResourceActions::INDEX,\n ResourceActions::SHOW,\n ResourceActions::UPDATE,\n ];\n }", "protected function get_available_actions()\n {\n }", "protected function get_available_actions()\n {\n }", "private function parseActions()\n {\n // default controller actions\n $actions = array_keys($this->getObject()->actions());\n $actionMethods = array_filter($this->reflection->getMethods(),\n function ($method) {\n // should match all methods named actionSomeAction\n return preg_match('/action([A-Z]{1}[a-zA-Z]+)/', $method->name, $matches);\n });\n $actionMethods = array_map(function ($method) {\n return Inflector::slug(str_replace('action', '', $method->name));\n }, $actionMethods);\n $actionMethods = array_merge($actions, $actionMethods);\n\n return array_intersect(['index', 'view', 'create', 'update', 'delete', 'options'], $actionMethods);\n }", "private static function allowed_actions() {\n\t\t$key = __CLASS__ . __METHOD__;\n\t\tif ( false == ( $actions = get_transient( $key ) ) ) {\n\t\t\t$dir = trailingslashit( dirname( __FILE__ ) ) . 'actions';\n\t\t\t$files = scandir( $dir );\n\t\t\tforeach ( $files as $file ) {\n\t\t\t\t$path = pathinfo( $file, PATHINFO_EXTENSION );\n\t\t\t\tif ( 'php' == $path ) {\n\t\t\t\t\t$file = str_replace( '.php', '', $file );\n\t\t\t\t\t$actions[] = $file;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tset_transient( $key, $actions, WEEK_IN_SECONDS );\n\n\t\t}\n\n\t\t/**\n\t\t * Filter allowable actions for internal API\n\t\t *\n\t\t * @since 0.1.0\n\t\t *\n\t\t * @param array $actions Actions to allow\n\t\t *\n\t\t * @return array\n\t\t */\n\t\treturn apply_filters( 'ht_dms_internal_api_allowed_actions', $actions );\n\n\t}", "public function getActions(): array;", "public function getActions();", "public function getActions();", "public function getActions(): array\n {\n return $this->actions;\n }", "public function get_actions() {\n $actions = get_post_meta( $this->post_id, '_wcs_actions', true );\n\n if ( ! $actions ) {\n return array();\n }\n\n return (array) $actions;\n }", "public function get_actions(): array;", "protected function getActions() {}", "public function getAllActionsAttribute()\n\t{\n\t\t$output = array();\n\t\t//check if model has default permissions. if so, lets add them.\n\t\tif($defaults = config('alpacajs.model-permissions.'. class_basename($this), false)){\n\t\t\t$output = $defaults;\n\t\t} \n\t\t//check if model exist, if it does then check if it has actions.\n\t\tif($this->exists && $modelActions = $this->actions)\n\t\t{\n\t\t\t$output = array_merge($output, $modelActions);\n\t\t}\n\t\t\n\t\treturn $output;\n\t}", "public function getActionNames()\n {\n return $this->action_names;\n }", "private function getRecordActions()\n {\n return array_filter($this->actions, function($item) {\n return in_array($item, array('show', 'edit'));\n });\n }", "public function getActions() {\n\n\t}", "function actions()\n {\n return[];\n }", "protected function resourceAbilityMap()\n {\n return [\n 'index' => 'view',\n 'create' => 'create',\n 'store' => 'create',\n 'show' => 'view',\n 'edit' => 'update',\n 'update' => 'update',\n 'destroy' => 'delete',\n ];\n }", "protected static function getActions()\n {\n return [\n CrudController::ACTION_ADD => 'created',\n CrudController::ACTION_DELETE => 'removed',\n CrudController::ACTION_DETAILS => 'displayed',\n CrudController::ACTION_EDIT => 'updated',\n CrudController::ACTION_HIDE => 'hidden',\n CrudController::ACTION_VIEW => 'displayed',\n CrudController::ACTION_UNHIDE => 'made visible',\n CrudController::ACTION_ENABLE => 'enabled',\n CrudController::ACTION_DISABLE => 'disabled',\n ];\n }", "protected function resourceAbilityMap()\n {\n return [\n 'edit' => 'update',\n 'update' => 'update',\n 'destroy' => 'delete',\n ];\n }", "public function discoverAction()\n\t{\n\t\t$resourceEntryPoints = [];\n\t\t$actionMethodNames = static::getPublicActionMethods($this->objectManager);\n\t\t$actionMethodParameters = static::getActionMethodParameters($this->objectManager);\n\t\tforeach ($actionMethodNames as $actionMethodName => $isPublic) {\n\t\t\tif (in_array($actionMethodName, ['discoverAction', 'optionsAction'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$actionName = str_replace('Action', '', $actionMethodName);\n\n\t\t\t$arguments = [];\n\t\t\tif (isset($actionMethodParameters[$actionMethodName][static::$RESOURCE_ARGUMENT_NAME])) {\n\t\t\t\tif ($actionMethodParameters[$actionMethodName][static::$RESOURCE_ARGUMENT_NAME]['optional'] === false) {\n\t\t\t\t\t$arguments = [static::$RESOURCE_ARGUMENT_NAME => ['__identity' => '{identifier}']];\n\t\t\t\t} else {\n\t\t\t\t\t$arguments = [static::$RESOURCE_ARGUMENT_NAME => ['__identity' => '({identifier})']];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Map CRUD actions back to generic URI action\n\t\t\t$uriActionName = in_array($actionName, ['show', 'list', 'create', 'update', 'remove']) ? 'index' : $actionName;\n\t\t\t$actionUri = $this->uriBuilder->setCreateAbsoluteUri($this->useAbsoluteUris)->setFormat($this->request->getFormat())->uriFor($uriActionName, $arguments);\n\t\t\t$actionReflection = new MethodReflection($this, $actionMethodName);\n\n\t\t\t$parameterDescriptions = [];\n\t\t\tif ($actionReflection->isTaggedWith('param')) {\n\t\t\t\tforeach ($actionReflection->getTagValues('param') as $parameterDescription) {\n\t\t\t\t\t$descriptionParts = preg_split('/\\s/', $parameterDescription, 3);\n\t\t\t\t\tif (isset($descriptionParts[2])) {\n\t\t\t\t\t\t$parameterName = ltrim($descriptionParts[1], '$');\n\t\t\t\t\t\t$parameterDescriptions[$parameterName] = $descriptionParts[2];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$parameters = array_map(static function($parameterInfo) {\n\t\t\t\treturn [\n\t\t\t\t\t'required' => !$parameterInfo['optional'],\n\t\t\t\t\t'type' => $this->normalizeResourceTypes ? ResourceTypeHelper::normalize($parameterInfo['type']) : $parameterInfo['type'],\n\t\t\t\t\t'default' => $parameterInfo['defaultValue']\n\t\t\t\t];\n\t\t\t}, $actionMethodParameters[$actionMethodName]);\n\t\t\t// PHPSadness.com: array_walk operates in place\n\t\t\tarray_walk($parameters, static function(&$parameterInfo, $parameterName) use ($parameterDescriptions) {\n\t\t\t\t$parameterInfo['description'] = $parameterDescriptions[$parameterName] ?? '';\n\t\t\t});\n\n\t\t\t$return = '';\n\t\t\tif ($actionReflection->isTaggedWith('return')) {\n\t\t\t\t$returnTags = $actionReflection->getTagValues('return');\n\t\t\t\t$returnParts = preg_split('/\\s/', reset($returnTags), 2);\n\t\t\t\t$return = $returnParts[1] ?? '';\n\t\t\t}\n\t\t\t$resourceEntryPoints[$actionName] = [\n\t\t\t\t'uri' => rawurldecode($actionUri),\n\t\t\t\t'parameters' => $parameters,\n\t\t\t\t'description' => $actionReflection->getDescription(),\n\t\t\t\t'return' => $return,\n\t\t\t];\n\t\t}\n\t\t$this->view->assign('description', $resourceEntryPoints);\n\t\tif ($this->view instanceof JsonView) {\n\t\t\t$this->view->setVariablesToRender(['description']);\n\t\t}\n\t}", "public function getActions()\n {\n return $this->actions;\n }", "public function getActions()\n {\n return $this->actions;\n }", "public function getActions()\n {\n return $this->actions;\n }", "public function getActions()\n {\n return self::$actionList;\n }", "public function get(): array\n {\n return $this->actions->toArray();\n }", "public function getActions() {\n $translator = $this->getTranslator();\n\n $actions = array();\n if (!$this->isReadOnly) {\n $actions[self::ACTION_ADD] = $translator->translate($this->translationAdd);\n }\n $actions[''] = $translator->translate($this->translationOverview);\n\n return $actions;\n }", "public static function available() {\n\t\treturn [\n\t\t\t'url' => [ 'url.php', 'Url_Action' ],\n\t\t\t'error' => [ 'error.php', 'Error_Action' ],\n\t\t\t'nothing' => [ 'nothing.php', 'Nothing_Action' ],\n\t\t\t'random' => [ 'random.php', 'Random_Action' ],\n\t\t\t'pass' => [ 'pass.php', 'Pass_Action' ],\n\t\t];\n\t}" ]
[ "0.7930071", "0.7674014", "0.65302354", "0.649807", "0.649807", "0.6366927", "0.63273644", "0.63052773", "0.62988895", "0.62988895", "0.6297878", "0.6281724", "0.622257", "0.62158865", "0.6210286", "0.6206013", "0.6181117", "0.61730576", "0.61724645", "0.615362", "0.61277395", "0.60726714", "0.6065132", "0.6063378", "0.6063378", "0.6063378", "0.6050413", "0.6039045", "0.603856", "0.6032526" ]
0.810912
0
Test that the arguments on the command are reset to 0
public function testCommandHasNoArguments() { $oCompareApp = new CompareApplication(); $oDefinition = $oCompareApp->getDefinition(); $iArgumentCount = $oDefinition->getArgumentCount(); $this->assertEquals(0, $iArgumentCount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "private function setGivenArgumentAmount(): int {\n return $_SERVER['argc'] - 1;\n }", "function test_checkMode_newArgs()\n {\n $result = $this->bax->_checkMode($this->bax->_newArgs());\n $this->assertTrue($result === true);\n }", "#[@test]\n public function argument_count_should_be_considered_when_matching_args() {\n $this->sut->setArguments(array(1, 2));\n $this->assertTrue($this->sut->doesMatchArgs(array(1, 2)));\n $this->assertFalse($this->sut->doesMatchArgs(array()));\n $this->assertFalse($this->sut->doesMatchArgs(array(1)));\n $this->assertFalse($this->sut->doesMatchArgs(array(1, 2, 3)));\n }", "public function testClear()\n {\n $initial_result = $this->callFormatter(\"check-git\");\n if (self::$debug) {\n if ($initial_result['code'] !== 0) {\n fwrite(STDERR, \"Debug for testClear():\\n\");\n fwrite(STDERR, var_export($initial_result, true) . \"\\n\");\n }\n }\n $this->assertEquals(0, $initial_result['code']);\n // no any output on empty directory\n }", "public function testOoCanOutputFlagsWithValues()\n {\n $mainCommand = 'rm';\n $flags = [new Command\\Flag('r', 'remove'), new Command\\Flag('f', 'force')];\n $command = $this->createInstance($mainCommand);\n foreach ($flags as $_flag) {\n $command->addFlag($_flag);\n }\n $this->assertEquals(sprintf('%1$s -r %2$s -f %3$s', $mainCommand, escapeshellarg('remove'), escapeshellarg('force')), (string) $command, 'Must be able to output the command and flags string correctly');\n }", "#[@test]\n public function doesMatch_should_return_false_if_args_are_unequal() {\n $this->sut->setArguments(array('1', 2, 3.0, '4'));\n\n $this->assertFalse($this->sut->doesMatchArgs(array('x', 2, 3.0, '4')));\n }", "public function testOoCanOutputFlags()\n {\n $mainCommand = 'rm';\n $flags = [new Command\\Flag('r'), new Command\\Flag('f')];\n $command = $this->createInstance($mainCommand);\n foreach ($flags as $_flag) {\n $command->addFlag($_flag);\n }\n $this->assertEquals(sprintf('%1$s -r -f', $mainCommand), (string) $command, 'Must be able to output the command and flags string correctly');\n }", "public function CLIAccesWithArgumentsWithAndWithoutValuesBuildsCorrectRequest() {}", "public function testCanSetGetArguments()\n {\n $arguments = ['--human-readable', '--all'];\n $command = $this->createInstance();\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n $this->assertSame($arguments, $command->getArguments(), 'Must be able to get and set multiple arguments');\n }", "public function testExecuteWrongCustomParams()\n {\n $params = [\n '--connection' => 'test',\n '--source' => 'DerpSeeds',\n ];\n $commandTester = $this->getCommandTester($params);\n $migrations = $this->getMigrations();\n $migrations->migrate();\n\n $commandTester->execute([\n 'command' => $this->command->getName(),\n '--connection' => 'test',\n '--source' => 'DerpSeeds',\n ]);\n\n $display = $this->getDisplayFromOutput();\n $this->assertTextNotContains('seeded', $display);\n $migrations->rollback(['target' => 'all']);\n }", "public function testOoCanOutputArguments()\n {\n $mainCommand = 'ls';\n $arguments = [new Command\\Argument('all'), new Command\\Argument('list')];\n $command = $this->createInstance($mainCommand);\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n $this->assertEquals(sprintf('%1$s --all --list', $mainCommand), (string) $command, 'Must be able to output the command and argument string correctly');\n }", "function mdl_cmd_arguments(array $args)\n{\n return array_values(array_filter($args, function ($arg) {\n return substr($arg, 0, 1) !== '-' && substr($arg, 0, 2) !== '--';\n }));\n}", "public function testCommandWithNoPath(): void\n {\n $process = $this->phpbench('run');\n $this->assertExitCode(1, $process);\n $this->assertStringContainsString('You must either specify', $process->getErrorOutput());\n }", "public function testGetArgs0()\n{\n\n $actual = $this->methodCall->getArgs();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "protected function testErreurs()\n\t{\n\t\t$cmd = '';\n\t}", "public static function clearArgv()\n {\n $_SERVER['argv'] = array();\n $_SERVER['argc'] = 0;\n }", "public function testAddCommandNegative()\n {\n $this->expectException(InvalidArgumentException::class);\n $this->calc->addCommand(null, $this->getCommandMock());\n }", "public function cli_validateArgs() {}", "public function testOoCanSetGetArguments()\n {\n $arguments = [new Command\\Argument('all'), new Command\\Argument('list')];\n $command = $this->createInstance();\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n $this->assertSame($arguments, $command->getArguments(), 'Must be able to get and set multiple argument objects');\n }", "public function testExecuteNoPositionSet()\n {\n $this\n ->getServiceContainer()\n ->get('ongr_connections.sync.diff_provider.binlog_diff_provider')\n ->setStartType(BinlogParser::START_TYPE_POSITION);\n $this->setExpectedException(\n 'InvalidArgumentException',\n 'Last sync parameter is not set! To set it,' .\n ' use command: ongr:sync:provide:parameter --set=\"<new value>\" last_sync_position'\n );\n $this->executeCommand(static::$kernel);\n }", "public function testOoCanOutputFlagWithValue()\n {\n $mainCommand = 'rm';\n $flag = new Command\\Flag('r', 'my_document');\n $command = $this->createInstance($mainCommand);\n $command->addFlag($flag);\n $this->assertEquals(sprintf('%1$s -r %2$s', $mainCommand, escapeshellarg('my_document')), (string) $command, 'Must be able to output the command and flag string correctly');\n }", "public function testOoCanOutputArgumentsWithValues()\n {\n $mainCommand = 'ls';\n $arguments = [new Command\\Argument('all', 'yes'), new Command\\Argument('list', 'of course')];\n $command = $this->createInstance($mainCommand);\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n $this->assertEquals(sprintf('%1$s --all %2$s --list %3$s', $mainCommand, escapeshellarg('yes'), escapeshellarg('of course')), (string) $command, 'Must be able to output the command and argument string correctly');\n }", "public function testProcessExitCodeDifferFromZero(): void\n {\n $commandLine = 'aspell';\n $process = $this->prophesize(Process::class);\n\n $process->setTimeout(600)->shouldBeCalled()->willReturn($process);\n $process->setEnv([])->shouldBeCalled()->willReturn($process);\n $process->setInput('')->shouldBeCalled()->willReturn($process);\n $process->run()->shouldBeCalled();\n $process->getCommandLine()->shouldBeCalled()->willReturn($commandLine);\n $process->getErrorOutput()->shouldBeCalled()->willReturn('Error');\n $process->getExitCode()->shouldBeCalled()->willReturn(1);\n\n $source = $this->prophesize(EncodingAwareSource::class);\n $source->getAsString()->shouldBeCalled()->willReturn('');\n\n $mock = $this->getMockForAbstractClass(ExternalSpeller::class, ['aspell']);\n $mock->setProcess($process->reveal());\n\n $this->expectException(ExternalProgramFailedException::class);\n $this->expectExceptionCode(1);\n $this->expectExceptionMessage('Failed to execute \"aspell\": Error');\n\n $mock->checkText($source->reveal(), ['en']);\n }", "public function testGetResultPositive()\n {\n $command = $this->getCommandMock();\n $command->expects($this->once())->method('execute');\n\n }", "function ResetCmd() {\n\n\t\t// Check if reset command\n\t\tif (substr($this->Command,0,5) == \"reset\") {\n\n\t\t\t// Reset search criteria\n\t\t\tif ($this->Command == \"reset\" || $this->Command == \"resetall\")\n\t\t\t\t$this->ResetSearchParms();\n\n\t\t\t// Reset sorting order\n\t\t\tif ($this->Command == \"resetsort\") {\n\t\t\t\t$sOrderBy = \"\";\n\t\t\t\t$this->setSessionOrderBy($sOrderBy);\n\t\t\t\t$this->userlevelid->setSort(\"\");\n\t\t\t\t$this->userlevelname->setSort(\"\");\n\t\t\t}\n\n\t\t\t// Reset start position\n\t\t\t$this->StartRec = 1;\n\t\t\t$this->setStartRecordNumber($this->StartRec);\n\t\t}\n\t}", "public function testBrokeFirstArgumentZero()\n {\n $game = new Game21();\n\n $game->broke(0, 10);\n\n $data = $game->getData();\n\n $expBroke = \"Computer broke - please reset bitcoins\";\n\n $broke = $data[\"broke\"];\n\n $this->assertEquals($expBroke, $broke);\n }", "public function testExecuteUnexpectedValue()\n {\n $managerMock = $this\n ->getMockBuilder('ONGR\\ElasticsearchBundle\\ORM\\Manager')\n ->disableOriginalConstructor()\n ->setMethods(['getConnection', 'updateMapping'])\n ->getMock();\n\n $managerMock->expects($this->once())->method('getConnection')->willReturnSelf();\n $managerMock->expects($this->once())->method('updateMapping')->willReturn(3);\n\n /** @var TypeUpdateCommand|\\PHPUnit_Framework_MockObject_MockObject $command */\n $command = $this->getMockBuilder('ONGR\\ElasticsearchBundle\\Command\\TypeUpdateCommand')\n ->setMethods(['clearMappingCache'])\n ->getMock();\n $command->expects($this->once())->method('clearMappingCache')->willReturn($managerMock);\n\n $app = new Application();\n $app->add($command);\n\n $commandToTest = $app->find('es:type:update');\n $commandTester = new CommandTester($commandToTest);\n $commandTester->execute(\n [\n 'command' => $command->getName(),\n '--force' => true,\n ]\n );\n }", "public function testCanSetGetFlags()\n {\n $flags = ['-h', '-a'];\n $command = $this->createInstance();\n foreach ($flags as $_flag) {\n $command->addFlag($_flag);\n }\n $this->assertSame($flags, $command->getFlags(), 'Must be able to get and set multiple flags');\n }", "public function testCommand(): void\n {\n $process = $this->phpbench('run benchmarks/set4/NothingBench.php');\n $this->assertExitCode(0, $process);\n }" ]
[ "0.63556373", "0.6195474", "0.60131013", "0.59272224", "0.59151995", "0.5813436", "0.58116686", "0.5797995", "0.57846665", "0.578354", "0.57782733", "0.5737364", "0.5723526", "0.5709251", "0.57064253", "0.57017124", "0.5696448", "0.5662", "0.564536", "0.5628304", "0.562682", "0.5614858", "0.5600881", "0.55188984", "0.5518285", "0.54984885", "0.54806185", "0.5429586", "0.5416179", "0.5412057" ]
0.67117864
0
Gets a list of all idle conversations. A conversation is considered idle based on the time of the last message posted and the conversationTTL setting in the controller.
public static function getAllIdleConversations($options = array()) { //Build the list $options = $options + (new RecordList)->getDefaultOptions(); $options['sql'] = "SELECT conversations.id, message FROM conversations LEFT JOIN messages ON (conversations.id = messages.conversations_id) WHERE (SELECT id FROM messages WHERE conversations_id = conversations.id ORDER BY date_created DESC LIMIT 1) = messages.id AND (conversations.method = 'CHAT' OR conversations.method = 'CHATBOT') AND messages.date_created < now() + INTERVAL -" . (int)\UNL\VisitorChat\Controller::$conversationTTL . " MINUTE AND (conversations.status = 'CHATTING' OR conversations.status = 'SEARCHING')"; return self::getBySql($options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getUnreadConversations() {\n return DB::table('conversations')\n ->join('participants', function($join) {\n $join->on('participants.conversation_id', '=', 'conversations.id')\n ->on('participants.last_read', '<', 'conversations.last_message')\n ->where('participants.user_id', '=', Auth::user()->id);\n })\n ->pluck('conversation_id');\n }", "public function getAllConversations()\n {\n return ConversationModel::getMyConversations($this);\n }", "public function get_list_unread(){\n\n\t\tuser_login_required();\n\n\t\t//Get the list of unread conversations of the user\n\t\t$list_unread_conversations = components()->conversations->get_list_unread(userID);\n\n\t\t//Process the results\n\t\tforeach($list_unread_conversations as $num => $conv)\n\t\t\t$list_unread_conversations[$num] = self::UnreadConversationToAPI($conv);\n\n\t\t//Return result\n\t\treturn $list_unread_conversations;\n\t}", "protected function listConversations() {\n $conversations = Participant::where('user_id', Auth::user()->id)->get(['conversation_id']);\n\n return Conversation::with(['participants' => function($query) {\n $query->with(['user' => function($query) {\n $query->select('id', 'username', 'picture');\n }]);\n }])->whereIn('id', $conversations)->get();\n }", "public function action_get_conversation() {\n\n\t\t$sender = ORM::factory('User', $this->request->param(\"id\"));\n\t\t$conversations =array();// ORM::factory('Message')->get_conversations($this->_current_user->id, $sender);\n\t\t$post = $this->request->post();\n\t\t$to = \"\";\n\t\t$from = \"\";\n\t\tif($post) {\n\t\t\t$from = date('Y-m-d',strtotime($post['from']));\n\t\t\t$to = date('Y-m-d',strtotime($post['to']));\n\t\t\tif($to == '1969-12-31') {\n\t\t\t\t$to = date('Y-m-d',strtotime('2030-01-01'));\n\t\t\t}\n\t\t\tif($from == '1969-12-31') {\n\t\t\t\t$from = date('Y-m-d',strtotime('2030-01-01'));\n\t\t\t}\n\t\t\t$conversations = ORM::factory('Message')->get_conversations($this->_current_user->id, $sender, $from, $to);\n\t\t}else {\n\t\t\t$conversations = ORM::factory('Message')->get_conversations($this->_current_user->id, $sender);\n\t\t}\n\t\t$this->_template->set(\"conversation_info\", $sender);\n\n\t\t$this->_template->set(\"filters\", array(\"from\"=>$from,\"to\"=>$to,\"results\"=>$this->_count_all_messages_in_conversation($conversations)));\n\t\t$this->_template->set(\"conversations\", $conversations);\n\t\t$this->_set_content('conversation');\n\t}", "public function getList(){\n\t\tuser_login_required();\n\n\t\t//Try to get the list\n\t\t$conversationsList = CS::get()->components->conversations->getList(userID);\n\n\t\t//Check for errors\n\t\tif($conversationsList === false)\n\t\t\tRest_fatal_error(500, \"Couldn't get conversations list !\");\n\t\t\n\t\t//Process the list of conversation\n\t\tforeach($conversationsList as $num => $conv)\n\t\t\t$conversationsList[$num] = self::ConvInfoToAPI($conv);\n\t\t\n\t\t//Return results\n\t\treturn $conversationsList;\n\t}", "public function action_conversations() {\n\t\t//STEP1: Get contacts with the most recent message\n\t\t$contacts = ORM::factory('Message')->get_inbox_contacts($this->_current_user->id);\n\t\t$this->_template->set('contacts', $contacts);\n\t\t//STEP2: Return the most recent conversation to display first time page loads\n\t\t//Otherwise return conversation based on user_id param passed in url\n\t\t$user2=\"\";\n\t\tif ($this->request->param(\"id\")) {\n\t\t\t$user2 = $this->request->param(\"id\");\n\t\t} else if(count($contacts)) {\n\t\t\t$user2 = $contacts[0]['user_info']['user_id'];\n\t\t}\n\t\t$no_messages = (count($contacts)==0) ? True : False;\n\t\t$sender = ORM::factory('User', $user2);\n\t\t$conversations = ORM::factory('Message')->get_conversations($this->_current_user->id, $sender);\n\t\t$this->_template->set('page_title', 'My Conversations');\n\t\t$this->_template->set(\"conversation_info\", $sender);\n\t\t$this->_template->set(\"no_messages\", $no_messages);\n\t\t$this->_template->set(\"conversations\", $conversations);\n\t\t$this->_set_content('conversations');\n\t}", "public function notifications()\n {\n $notifications = $this->get(\"/api/v1/conversations?as_user_id=sis_user_id:mtm49\");\n return $notifications;\n }", "public function conversations() {\n return $this->hasMany(TicketConversation::class, 'ticket_id');\n }", "function dialogue_get_open_conversations($course) {\n global $DB, $CFG, $USER;\n\n if (empty($USER->id)) {\n return false;\n }\n if ($conversations = $DB->get_records_sql(\"SELECT c.id, d.name AS dialoguename, c.dialogueid, c.timemodified, c.lastid, c.userid\".\n \" FROM {dialogue} d, {dialogue_conversations} c\".\n \" WHERE d.course = ?\".\n \" AND c.dialogueid = d.id\".\n \" AND (c.userid = ? OR c.recipientid = ?)\".\n \" AND c.lastid != ?\".\n \" AND c.closed =0\", array($course->id, $USER->id, $USER->id, $USER->id))) {\n $entry = array();\n foreach ($conversations as $conversation) {\n if (! $user = $DB->get_record('user', array('id' => $conversation->lastid))) {\n // @todo print_error(\"Get open conversations: user record not found\");\n continue;\n }\n if (! $cm = get_coursemodule_from_instance('dialogue', $conversation->dialogueid, $course->id)) {\n print_error('Course Module ID was incorrect');\n }\n $entry[$conversation->id] = new stdClass();\n $entry[$conversation->id]->dialogueid = $conversation->dialogueid;\n $entry[$conversation->id]->time = $conversation->timemodified;\n $entry[$conversation->id]->url = \"view.php?id=$cm->id\";\n $entry[$conversation->id]->firstname = $user->firstname;\n $entry[$conversation->id]->lastname = $user->lastname;\n $entry[$conversation->id]->name = $conversation->dialoguename;\n $entry[$conversation->id]->userid = $conversation->userid;\n }\n return $entry;\n }\n return;\n}", "public function get_conversations($request_id) {\n $conversations = $this->orequest->get_conversation($request_id);\n\n return $this->output->set_content_type('application/json')->set_output($this->return_json($conversations));\n }", "public function getOlderMessages(){\n\n\t\tuser_login_required();\n\n\t\t//Get the ID of the conversation to refresh\n\t\t$conversationID = $this->getSafePostConversationID(\"conversationID\");\n\n\t\t//Get the ID of the oldest message ID\n\t\t$maxID = postInt(\"oldest_message_id\") - 1;\n\n\t\t//Get the limit\n\t\t$limit = postInt(\"limit\");\n\n\t\t//Security\n\t\tif($limit < 1)\n\t\t\t$limit = 1;\n\t\tif($limit > 30)\n\t\t\t$limit = 30;\n\t\t\n\t\t//Retrieve the list of messages in the database\n\t\t$messages = components()->conversations->getOlderMessages($conversationID, $maxID, $limit);\n\n\t\t//Process the list of messages\n\t\tforeach($messages as $num => $process)\n\t\t\t$messages[$num] = self::ConvMessageToAPI($process);\n\t\t\n\t\treturn $messages;\n\t}", "public function fetchAllMessages()\n {\n return Chat::with('user')->get();\n }", "public function getAll()\n\t{\n\t\t$msgs = Message::findByUser($this->getUser());\n\t\t$this->updateQueryTime();\n\t\treturn $msgs;\n\t}", "function getlist()\n {\n $limit_time = $this->db->limit(1)->get_where(\"public.lookup\",array(\"lookupkey\"=>'session_chat_time'))->row()->lookupvalue;\n\n $str = \"select user_id, last_bot_id bot_id, max(status) live_request\n from ai.livechat\n where COALESCE(live_end_time,request_end_time,request_start_time,live_start_time) > now() - interval '$limit_time'\n group by user_id, bot_id\";\n\n $query = $this->db->query($str);\n \n if ($query->num_rows() > 0)\n {\n return $query->result_array();\n }\n else\n return NULL;\n }", "public function getNotOpenedMessagesToFollow()\n {\n // no problem if one message is opened more than one time\n $modifier = Carbon::now()->modify(\"-{$this->getDelayInterval()}\");\n $messages = TrackingLog::select('tracking_logs.*')\n ->leftJoin('open_logs', 'tracking_logs.message_id', '=', 'open_logs.message_id')\n ->join('auto_triggers', 'tracking_logs.auto_trigger_id', '=', 'auto_triggers.id')\n ->join('auto_events', 'auto_triggers.auto_event_id', '=', 'auto_events.id')\n ->where('auto_event_id', $this->previousEvent->id)\n ->whereRaw(sprintf('%s NOT IN (SELECT COALESCE(subscriber_id, 0) FROM %s WHERE auto_event_id = %s)', table('tracking_logs.subscriber_id'), table('auto_triggers'), $this->id))\n ->whereRaw(sprintf('%s IS NULL', table('open_logs.id')))\n ->where('tracking_logs.created_at', '<=', $modifier)\n ->get();\n\n // one message could be opened more than one time\n // @note: use array_uniq_by() helper function for far better performance thant Collection::uniq()\n $unique = array_unique_by($messages, function ($message) {\n return $message->message_id;\n });\n\n return $unique;\n }", "public function getInactiveUsers() {\n\t\t$db = GetGlobal('db');\n\t\t$text = localize('_inactiveuser',getlocal());\n\t\t$sSQL = \"select username,timein from users where active=0 and DATE(timein) BETWEEN DATE( DATE_SUB( NOW() , INTERVAL 30 DAY ) ) AND DATE ( NOW() ) order by DATE(timein) desc\";\n\t\t$result = $db->Execute($sSQL,2);\n\n\t\tforeach ($result as $i=>$rec) {\n\t\t\t$saytime = _m('rccontrolpanel.timeSayWhen use ' . strtotime($rec[1]));\n\t\t\t$msg = \"warning|\" . $text .' '. $rec[0] . \"|$saytime|cpusers.php|\".$rec[0];\n\t\t\t$this->setMessage($msg);\n\t\t}\n\t\treturn null;\n\t}", "public function messages()\n {\n return $this->hasMany(Chat::class, 'conversation_id')\n ->latest();\n }", "public function getAllMeetingRooms() {\n $sql = 'SELECT * FROM ces_meeting_rooms WHERE status = \"L\"';\n \n $stmt = $this->conn->prepare($sql);\n $stmt->execute();\n \n return $stmt->fetchAll();\n }", "public function conversations()\n {\n return $this->hasMany('Infogue\\Conversation');\n }", "public function index($conversation_id)\n { \n $user = JWTAuth::parseToken()->authenticate();\n $offset = Request::get('offset');\n $limit = Request::get('limit');\n \n try {\n $messages = $this->dispatchFromArray(ReadMailboxInboxConversationMessagesCommand::class, ['userId' => $user->id, 'conversation_id' => $conversation_id, 'offset' => $offset, 'limit' => $limit]);\n \n return $this->respond([\n 'data' => $this->mailboxConversationMessagesTransformer->transformCollection($messages)\n ]);\n \n } catch (Exception $ex) {\n\n }\n }", "public function selectAll() {\n if ($this->chatChannelsCached == null) {\n $result = array();\n\n $query = \"SELECT * FROM %s ORDER BY name ASC;\";\n\n $this->database->query($query, array(ImbaConstants::$DATABASE_TABLES_CHAT_CHATCHANNELS));\n while ($row = $this->database->fetchRow()) {\n $channel = new ImbaChatChannel();\n $channel->setId($row[\"id\"]);\n $channel->setName($row[\"name\"]);\n $channel->setLastmessage($row[\"lastmessage\"]);\n $channel->setAllowed($row[\"allowed\"]);\n\n // Check if my Role is allowed:\n $allowed = json_decode($channel->getAllowed(), true);\n\n $amIallowed = false;\n foreach ($allowed as $a) {\n if ($a[\"allowed\"] == true && $a[\"role\"] == ImbaUserContext::getUserRole()) {\n $amIallowed = true;\n }\n }\n\n if ($amIallowed) {\n array_push($result, $channel);\n }\n }\n\n $this->chatChannelsCached = $result;\n }\n\n return $this->chatChannelsCached;\n }", "public function getMessages() {\r\n\t\t$messages = $this->session->messages;\r\n\t\t$this->session->unsetAll ();\r\n\t\treturn $messages;\r\n\t}", "public function action_delete_all_conversations() {\n\t\t$sender = ORM::factory(\"User\", $this->request->param('id'));\n\t\tif ($sender->loaded()) {\n\t\t\t$messages = ORM::factory('Message')->get_user_conversations($this->_current_user->id, $sender->id);\n\t\t\tforeach ($messages as $message) {\n\t\t\t\ttry {\n\t\t\t\t\t$archive = ORM::factory(\"ArchivedMessage\")->archive($message->message_id, $this->_current_user->id);\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t$this->_set_msg('Could not archive conversation\n\t\t\t\t\t thread because this would wipe out other users history!', 'error');\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_set_msg(\"All conversations with \"\n\t\t\t . $sender->personnel_info->personnel_name . ' were removed from your mailbox', 'success');\n\t\t\t$this->redirect($this->request->referrer());\n\t\t}\n\t\t$this->_set_content('message_delete');\n\t}", "public function getOpenedMessagesToFollow()\n {\n $messages = TrackingLog::select('tracking_logs.*')->join('open_logs', 'tracking_logs.message_id', '=', 'open_logs.message_id')->join('auto_triggers', 'tracking_logs.auto_trigger_id', '=', 'auto_triggers.id')->join('auto_events', 'auto_triggers.auto_event_id', '=', 'auto_events.id')->where('auto_event_id', $this->previousEvent->id)->whereRaw(sprintf(table('tracking_logs') . '.subscriber_id NOT IN (SELECT COALESCE(subscriber_id, 0) FROM %s WHERE auto_event_id = %s)', table('auto_triggers'), $this->id))->get();\n\n // one message could be opened more than one time\n // @todo: use array_uniq_by() helper function for far better performance thant Collection::uniq()\n $unique = $messages->unique(function ($item) {\n return $item->message_id;\n });\n\n return $unique;\n }", "public function getUnreadMessages(): Collection;", "public function allOnline()\n {\n return $this->model->where('active', '=', true)\n ->orderBy('created_at', 'DESC')\n ->get();\n }", "public function get_active_subscriptions() {\r\n return $this->get_all_subscriptions( true );\r\n }", "public function index()\n {\n $latest = auth()->user()->conversations()->has(\"messages\")->latest(\"updated_at\")->count();\n if ($latest) {\n return redirect()->route(\"conversation.show\", $latest);\n }\n else {\n return view(\"conversation.index\");\n }\n\n }", "function getClosedChatUsers()\n\t{\n\t\treturn $this->chatCloseUsers;\n\t}" ]
[ "0.63908464", "0.6250145", "0.60021186", "0.5771216", "0.5753393", "0.5634709", "0.5605642", "0.5478655", "0.5407373", "0.53847027", "0.5342065", "0.532252", "0.5243816", "0.5232736", "0.5214624", "0.5194992", "0.5188993", "0.5176792", "0.51290023", "0.51153564", "0.5106208", "0.50886166", "0.50734574", "0.50686574", "0.50335056", "0.49887732", "0.49876997", "0.49850488", "0.4983678", "0.4981439" ]
0.7715345
0
Called when view the creation form.
public function index_onCreateForm() { parent::create(); return $this->makePartial('create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function createForm()\n {\n }", "public function create()\n\t{\t\n\t\t\n\t\t// load the create form (app/views/fbf_presenca/create.blade.php)\n\t\t$this->layout->content = View::make('fbf_presenca.create')\n;\n\t}", "public function createForm();", "public function createForm();", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n // I skip using this create function because I use a modal form for inserting data using modal in index view via index function.\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n $this->title = __('admin.create_personal_information');\n\n //Page content definition\n $this->content = $this->getViewContent('personal_info.personal_info_form',\n [\n 'title' => $this->title\n ]\n );\n\n return $this->renderCurrentView();\n }", "public function create()\n\t{\t\n\t\t\n\t\t// load the create form (app/views/fbf_historico_atleta_cameponato/create.blade.php)\n\t\t$this->layout->content = View::make('fbf_historico_atleta_cameponato.create')\n;\n\t}", "public function create()\n {\n $this->openModal();\n $this->resetInputFields();\n }", "public function create()\n {\n $this->openModal();\n $this->resetInputFields();\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function CreateForm();", "public function create()\n\t{\t\n\t\t\n\t\t// load the create form (app/views/fbf_time/create.blade.php)\n\t\t$this->layout->content = View::make('fbf_time.create')\n;\n\t}", "public function create()\n {\n return view ('forms.create');\n }", "abstract public function createForm();", "abstract public function createForm();", "protected function Form_Create() {\n\t\t\t// Define the Label\n\t\t\t$this->lblMessage = new QLabel($this);\n\t\t\t$this->lblMessage->Text = 'Click the button to change my message.';\n\n\t\t\t// Define the Button\n\t\t\t$this->btnButton = new QButton($this);\n\t\t\t$this->btnButton->Text = 'Click Me!';\n\n\t\t\t// Add a Click event handler to the button\n\t\t\t$this->btnButton->AddAction(new QClickEvent(), new QServerAction('btnButton_Click'));\n\t\t}", "public function create()\n {\n //get view form\n return 'create Method';\n }", "public function xadmin_createform() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\t/* get the form field title */\n\t\t$form_title = $args [1];\n\t\t$form_type = @$args [2] ? $args [2] : 'blank';\n\t\t\n\t\t/* Load Model */\n\t\t$form = $this->getModel ( 'form' );\n\t\t$this->session->returnto ( 'forms' );\n\t\t\n\t\t/* create the form */\n\t\t$form->createNewForm ( $form_title, $form_type );\n\t\t\n\t\t$this->loadPluginModel ( 'forms' );\n\t\t$plug = Plugins_Forms::getInstance ();\n\t\t\n\t\t$plug->_pluginList [$form_type]->onAfterCreateForm ( $form );\n\t\t\n\t\t/* set the view file (optional) */\n\t\t$this->_redirect ( 'xforms' );\n\t\n\t}" ]
[ "0.8177952", "0.79812753", "0.77793795", "0.7682758", "0.7682758", "0.76644146", "0.76644146", "0.76644146", "0.76644146", "0.76185876", "0.7605621", "0.759826", "0.7588477", "0.7561074", "0.75554293", "0.7547765", "0.7547765", "0.75470513", "0.7540081", "0.7528355", "0.7528355", "0.74620134", "0.745221", "0.7440572", "0.7435096", "0.7430378", "0.7430378", "0.7425812", "0.7416338", "0.74139017" ]
0.816507
1
Called when view the update form.
public function index_onUpdateForm() { $record_id = post('record_id'); parent::update($record_id); $this->controller->vars['record_id'] = $record_id; return $this->makePartial('update'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateForm(){\n $new = $this->model->getNew();\n $this->view->updateForm($new);\n }", "private function update_form()\n\t{\n\t\t$this->title = sprintf(lang('update_title'), $this->installed_version, $this->version);\n\t\t$vars['action'] = $this->set_qstr('do_update');\n\t\t$this->set_output('update_form', $vars);\n\t}", "public function updateView(): void\n {\n if (!$this->special) {\n $this->_builder->submitUpdate();\n }\n $this->_data = $this->_entity->fetch($_GET['id'])[0];\n\n require VF . \"{$this->route}/update.php\";\n }", "public function showUpdateForm()\n {\n return view('dashboard.update');\n }", "public function showUpdateInfoForm ()\n {\n return view($this->updateInfoView);\n }", "public function updateView()\n {\n \n }", "function update() {\n\t\tglobal $tpl, $lng;\n\n\t\t$form = $this->initForm(TRUE);\n\t\tif ($form->checkInput()) {\n\t\t\tif ($this->updateElement($this->getPropertiesFromPost($form))) {\n\t\t\t\tilUtil::sendSuccess($lng->txt('msg_obj_modified'), TRUE);\n\t\t\t\t$this->returnToParent();\n\t\t\t}\n\t\t}\n\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHtml());\n\t}", "protected function updateAction()\n {\n }", "public function actionUpdate() {}", "public function actionUpdate() {}", "abstract function performUpdate(Form $arg0);", "public function showUpdateInfoForm ()\n {\n // Get the logged in chiefWardenStaff\n $chiefWardenStaff = ChiefWardenStaff::find(Auth::guard('chiefWardenStaff')->user()->id);\n return view($this->updateInfoView, ['chiefWardenStaff' => $chiefWardenStaff]);\n }", "public function update() {\n parent::update();\n }", "public function updateAction()\n {\n }", "public function successUpdate() {\n $this->loadFrontView('profile/after_update');\n }", "public function modifyView() {\n $this->object = $this->object->readObject($this->id);\n $uiObjectName = $this->type.'_Ui';\n $uiObject = new $uiObjectName($this->object);\n $values = array_merge($this->object->valuesArray(), $this->values);\n return $uiObject->renderForm(array_merge(\n array('values'=>$values,\n 'action'=>url($this->type.'/modify', true),\n 'class'=>'formAdmin formAdminModify'),\n array('submit'=>array('save'=>__('save'),\n 'saveCheck'=>__('saveCheck')))));\n }", "public function noticia_update_form()\r\n {\r\n $array = [\r\n 'user_info' => $this->user->infoUser(),\r\n ];\r\n $post = new PostFix();\r\n $array['info_post'] = $post->getPostId($_GET['id']);\r\n $this->loadTemplate('noticias/update_img', $array);\r\n }", "public function action_update()\n {\n\t $this->template = View::forge('template-admin');\n\n\t\t$get = Input::get();\n\t\t$id = $get[\"id\"];\n\t\t$data[\"update\"] = Model_Event::find_by('id',$id);\n\t\t$data[\"category\"] = Model_Category::find_all();\n\t\t$this->template->title = \"イベント更新\";\n\t\t$this->template->content = View::forge('event/update', $data);\n }", "public function updateForm()\n{\n\n $user = $this->model->getUser();\n $this->view->updateForm($user);\n \n}", "public function update ()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_update');\n $view->title = \"Verein\";\n $view->heading = \"Verein bearbeiten\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->display();\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function update(){\n return view('upr-update');\n }", "public function updating()\n {\n # code...\n }", "public function update() {\n $this->view = $this->template->getView();\n $this->layout = $this->template->getLayout();\n }", "function wck_show_update_form(){\r\n\t\tcheck_ajax_referer( \"wck-edit-entry\" );\t\t\r\n\t\t$meta = sanitize_text_field( $_POST['meta'] );\r\n\t\t$id = absint($_POST['id']);\r\n\t\t$element_id = absint( $_POST['element_id'] );\r\n\r\n do_action( \"wck_before_adding_form_{$meta}\", $id, $element_id );\r\n\r\n\t\techo self::mb_update_form($this->args['meta_array'], $meta, $id, $element_id);\r\n\t\t\r\n\t\tdo_action( \"wck_after_adding_form\", $meta, $id, $element_id );\r\n do_action( \"wck_after_adding_form_{$meta}\", $id, $element_id );\r\n\r\n\t\texit;\r\n\t}", "protected function update(){\n // als er geen gebruiker is ingelogd, check session.. daarna maak session message\n if(!isset($_SESSION['isLoggedIn'])){\n $_SESSION['message'] = \"<div class=\\\"alert alert-dismissible alert-danger\\\">\n <button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\"></button>\n <strong>U moet ingelogd zijn om deze pagina te bezoeken! </strong>\";\n header('Location: '. ROOT_PATH . 'todos/all');\n }\n $viewmodel = new TodoModel();\n $this->returnView($viewmodel->update(),true);\n }", "public function updatePost(){\n\t\t\t//goi ham de update du lieu\n\t\t\t$this->modelUpdate();\n\t\t\t//di chuyen den trang read\n\t\t\techo \"<script>location.href='account/detail';</script>\";\n\t\t}", "protected function _update()\n\t{\n\t}", "public function updateAction() : object\n {\n if (isset($_SESSION['username'])) {\n $form = new UpdateForm($this->di);\n $form->check();\n\n $this->page->add(\"user/crud/update\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $this->page->render([\n \"title\" => \"Update an item\",\n ]);\n }\n $this->di->get(\"response\")->redirect(\"user/login\");\n }", "public function onUpdateField()\n {\n //TODO Validate input\n\n $post = post();\n\n $flags = FieldManager::makeFlags(\n in_array('enabled', $post['flags']),\n in_array('registerable', $post['flags']),\n in_array('editable', $post['flags']),\n in_array('encrypt', $post['flags'])\n );\n\n $validation = $this->makeValidationArray($post);\n\n $data = $this->makeDataArray($post);\n\n $feedback = FieldManager::updateField(\n $post['name'],\n $post['code'],\n $post['description'],\n $post['type'],\n $validation,\n $flags,\n $data\n );\n\n FieldFeedback::with($feedback, true)->flash();\n\n return Redirect::to(Backend::url('clake/userextended/fields/manage'));\n }" ]
[ "0.7787808", "0.76972586", "0.75012714", "0.7350414", "0.7343673", "0.7136632", "0.70738024", "0.70074", "0.6977582", "0.6977582", "0.690154", "0.68174213", "0.6801636", "0.67400956", "0.67120886", "0.6699232", "0.6698965", "0.66947037", "0.6694545", "0.6684002", "0.6680352", "0.6676799", "0.65364754", "0.64784384", "0.6467726", "0.6440637", "0.64375895", "0.64225215", "0.6414317", "0.64053965" ]
0.78059417
0
/ Get vehicle_geofence_assignment by id
function get_vehicle_geofence_assignment($id) { $this->db->select("vga.id,vga.vehicle_id,vga.geofence_id,plate_no,g.name,g.type,vga.status,date(vga.assign_date) as assign_date" . ",date(vga.update_date) as update_date," . "CONCAT(u.first_name,',',u.last_name) as assign_uid," . ",CONCAT(u2.first_name,',',u2.last_name) as update_uid," . "in_alert,out_alert,sms_alert,email_alert") ->from("vehicle_geofence_assignment vga") ->join("vehicles v", "v.vehicle_id = vga.vehicle_id", "right") ->join("users u", "u.user_id = vga.assign_uid", "left") ->join("users u2", "u2.user_id = vga.update_uid", "left") ->join("geofence g", "g.id = vga.geofence_id", "left") ->where("vga.id", $id) ->where("vga.account_id", $this->session->userdata("hawk_account_id")); $query = $this->db->get(); return $query->row_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_vehicle_geofence_assignment($id, $params) {\n $this->db->where('id', $id);\n $response = $this->db->update('vehicle_geofence_assignment', $params);\n if ($response) {\n return \"vehicle_geofence_assignment updated successfully\";\n } else {\n return \"Error occuring while updating vehicle_geofence_assignment\";\n }\n }", "function delete_vehicle_geofence_assignment($id) {\n $response = $this->db->delete('vehicle_geofence_assignment', array('id' => $id));\n if ($response) {\n return \"vehicle_geofence_assignment deleted successfully\";\n } else {\n return \"Error occuring while deleting vehicle_geofence_assignment\";\n }\n }", "public function assignment($id)\n {\n return $this->where('assignment_id', $id);\n }", "function get_all_vehicle_geofence($vehicle_id = null) {\n if (isset($vehicle_id)) {\n $this->db->where(\"vga.vehicle_id\", $vehicle_id);\n }\n $this->db->select(\"vga.id,plate_no,g.name,g.type,vga.status,date(vga.assign_date) as assign_date\"\n . \",date(vga.update_date) as update_date,\"\n . \"CONCAT(u.first_name,',',u.last_name) as assign_uid,\"\n . \",CONCAT(u2.first_name,',',u2.last_name) as update_uid,\"\n . \"in_alert,out_alert,sms_alert,email_alert\")\n ->from(\"vehicle_geofence_assignment vga\")\n ->join(\"vehicles v\", \"v.vehicle_id = vga.vehicle_id\", \"right\")\n ->join(\"users u\", \"u.user_id = vga.assign_uid\", \"left\")\n ->join(\"users u2\", \"u2.user_id = vga.update_uid\", \"left\")\n ->join(\"geofence g\", \"g.id = vga.geofence_id\", \"left\")\n ->where(\"vga.account_id\", $this->session->userdata(\"hawk_account_id\"))\n ->order_by(\"vga.status\", \"desc\");\n\n $query = $this->db->get();\n return $query->result();\n }", "function add_vehicle_geofence_assignment($params) {\n $params['status'] = 1;\n $this->db->insert('vehicle_geofence_assignment', $params);\n return $this->db->insert_id();\n }", "function get_allocation($id){\n\t\t\t$res = query(\"SELECT `id`, `vehicle_id`, `driver_id`, `collect_time`, `return_time`, `start_mileage`, `return_mileage` FROM `tbl_allocation` WHERE `vehicle_id` = ? AND `return_time` IS NULL \",$id);\n\t\t\tif ($res==null) {\n\t\t\t\treturn array('error' => 'allocation does not exist');\n\t\t\t}else{\n\t\t\t\t$this->allocation_id= $res[0][\"id\"];\n\t\t\t\t$this->vehicle_id=$res[0][\"vehicle_id\"];\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn $this->getAllocation();\n\t\t\t\t//TODO: add profile and handle null values\n\t\t\t\t//return array('error' => 'invalid email or password');\n\t\t\t}\n\t\t}", "public function ass($id){\n \n $requete = $this->db->query(\"SELECT * FROM association where ass_id= ?\", $id);\n $ass = $requete->row();\n return $ass; \n }", "function get_ward_assign_by_id($id){\n // return ($get) ? $get : false;\n \n \t$this->db->select('*');\n\t\t$this->db->from('ward');\n\t\t$this->db->join('ward_assign', 'ward_assign.ward_id = ward.id');\n\t\t$this->db->where('ward_assign.id', $id);\n\t\t$query = $this->db->get();\n\t\t$result = $query->row();\n\n\t\tif($query->num_rows() > 0){\n\t\t\treturn $result; \n\t\t}else{\n\t\t\treturn 'no result';\n\t\t}\n }", "protected function findModelAssignment($id)\n {\n $class ='common\\models\\User';\n if (($user = $class::findOne($id)) !== null) {\n return new Assignment($id, $user);\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function getAssignTeam($id){\n\t\t\n\t\t$member_id = DB::table('assign_team')->where('member_id', $id)->first();\n\t\treturn $member_id;\n\t\n\t}", "function getRatingAgencyById($id) {\n global $RATING_AGENCY_BY_ID_SQL;\n \n $SQL = sprintf($RATING_AGENCY_BY_ID_SQL, $id);\n $result = mysql_query($SQL);\n\n $agency = array();\n if (mysql_num_rows($result) == 0) {\n return $agency;\n }\n \n $row = mysql_fetch_array($result);\n \n $agency['id'] = $row['raid'];\n $agency['name'] = $row['name'];\n $agency['fullName'] = $row['fullName'];\n \n return $agency;\n}", "public function getrate($id)\n {\n return CoursesRate::find($id);\n }", "public function show($id)\n {\n return EquityPercentage::findOrFail($id);\n }", "public static function getGradeById($id)\n\t\t{\n\t\t\t$connection = Connection::getConnection();\n\t\t\t$statement = $connection->prepare(\"SELECT id,name_fr as name,age FROM scholar_level WHERE id = ?\");\n\t\t\t$statement->setFetchMode(PDO::FETCH_ASSOC);\n\t\t\t$statement->bindParam(1, $id);\n\t\t\t$statement->execute();\n\n\t\t\t$content = [];\n\n\t\t\tif ($row = $statement->fetch()) {\n\t\t\t\t$content = $row;\n\t\t\t\t// $content[$row[\"id\"]] = $row;\n\t\t\t}\n\n\t\t\treturn $content;\n\t\t}", "public function getAssignmentsForClass($class_id) {\n return $this->get('get_assignments_for_class', ['class_id' => $class_id]);\n }", "function fetch_assign($employee_school_profile_id)\n\t\t{\n\t\t\treturn $this->db->query('select * from employee join driver_bus_route_assgn on employee.employee_profile_id = driver_bus_route_assgn.DBR_driver_id join bus on bus.bus_id = driver_bus_route_assgn.DBR_bus_id join route on route.route_id = driver_bus_route_assgn.DBR_route_no WHERE driver_bus_route_assgn.DBR_school_profile_id = '.$employee_school_profile_id.' AND driver_bus_route_assgn.DBR_expiry_date=\"9999-12-31\"')->result_array();\n\t\t}", "public function getGradeById($id = 0)\n {\n if ($id === 0)\n {\n $query = $this->db->get('grade');\n return $query->result_array();\n }\n\n $query = $this->db->get_where('grade', array('grade_id' => $id));\n return $query->row_array();\n }", "public function show($id)\n {\n $grade = Grade::find($id);\n return $grade;\n\n }", "public function show($id)\n {\n \\Gate::authorize('view', 'competences_evaluations');\n return new Evaluation_competenceResource(EvaluationCompetency::find($id));\n }", "public function getAssignments(): array;", "public function getAssigned($id = '') {\n\n //validations\n if (!is_numeric($id)) {\n return [];\n }\n\n $query = $this->assigned->newQuery();\n $query->leftJoin('users', 'users.id', '=', 'projects_assigned.projectsassigned_userid');\n $query->where('projectsassigned_projectid', $id);\n $query->orderBy('first_name', 'ASC');\n return $query->get();\n }", "function getRoomByID($id){\r\n $common = new \\Cars\\Data\\Common($this->app);\r\n return $common->getRoomByID($id);\r\n }", "public function show($id)\n {\n $record = AssetAssignment::find($id);\n \n if (is_null($record)) {\n return $this->sendError('Record not found.');\n }\n \n return $this->sendResponse(new AssetAssignResource($record), 'Record retrieved successfully.');\n }", "function assignment_get($session_id, $site_id, $assignment_id) {\n $site_id = site_id($session_id, $site_id);\n if (!$site_id) return array('status' => 404);\n $page_id = page_id($session_id, $site_id, 'assignment');\n if (!$page_id) return array('status' => 404);\n return exec_python(\n 'assignment.py',\n '--id', $assignment_id,\n '--page', $page_id,\n '--cookie', fetch_cookies($session_id)\n );\n}", "public function all_assigned_attributes($id)\n\t\t\t{\n\t\t\t\t$query=$this->db->get_where('food_assign_attribute' ,array(\"f_att_id\"=>$id ,\"f_ass_att_del\"=>'0'));\n\t\t\t\tif($query)\n\t\t\t\t{\n\t\t\t\t\treturn $query;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}", "private function load_target_grade($id)\r\n {\r\n global $DB;\r\n $sql = \"SELECT * FROM {block_bcgt_target_grades} WHERE id = ?\";\r\n $record = $DB->get_record_sql($sql, array($id));\r\n if($record)\r\n {\r\n $this->extract_params($record);\r\n }\r\n }", "protected /*array<string,mixed>*/ function getAssignment(/*int*/ $aid)\n\t{\n\t\t$query = $this->db->prepare(\"\n\t\t\tSELECT * FROM `assignments` WHERE `id` = ?;\n\t\t\")->execute($aid);\n\n\t\treturn len($query) ? $query->row : null;\n\t}", "public function getAgencyInfo($id) { \n $select = $this->select();\n $select->where(\"id = '\".$id.\"'\");\n \n if( $this->fetchRow($select) )\n return $this->fetchRow($select)->toArray();\n else\n return false;\n }", "public function campusassigned($id){\n\t\t$this->db->from('campusassigned');\n\t\t$this->db->where('campusassigned.ticketid', $id);\n\t\t$userfind = $this->db->get();\n\n\t\treturn $userfind->result_array();\n\t}", "public function actionAssignments($id)\n {\n if (!isset(Yii::$app->extensions['dektrium/yii2-rbac'])) {\n throw new NotFoundHttpException();\n }\n Url::remember('', 'actions-redirect');\n $user = $this->findModel($id);\n\n return $this->render('_assignments', [\n 'user' => $user,\n ]);\n }" ]
[ "0.65768445", "0.64559877", "0.6339131", "0.6193969", "0.6018292", "0.5611572", "0.5437773", "0.53892237", "0.5293428", "0.52860874", "0.52570254", "0.52543825", "0.5250408", "0.51520956", "0.50781864", "0.5073617", "0.5049677", "0.5021969", "0.5020745", "0.50073355", "0.5002898", "0.4985602", "0.4976465", "0.49558207", "0.49499315", "0.49327973", "0.49316224", "0.49311182", "0.49084914", "0.4906757" ]
0.77601165
0
/ Get all vehicle_geofence_assignment
function get_all_vehicle_geofence($vehicle_id = null) { if (isset($vehicle_id)) { $this->db->where("vga.vehicle_id", $vehicle_id); } $this->db->select("vga.id,plate_no,g.name,g.type,vga.status,date(vga.assign_date) as assign_date" . ",date(vga.update_date) as update_date," . "CONCAT(u.first_name,',',u.last_name) as assign_uid," . ",CONCAT(u2.first_name,',',u2.last_name) as update_uid," . "in_alert,out_alert,sms_alert,email_alert") ->from("vehicle_geofence_assignment vga") ->join("vehicles v", "v.vehicle_id = vga.vehicle_id", "right") ->join("users u", "u.user_id = vga.assign_uid", "left") ->join("users u2", "u2.user_id = vga.update_uid", "left") ->join("geofence g", "g.id = vga.geofence_id", "left") ->where("vga.account_id", $this->session->userdata("hawk_account_id")) ->order_by("vga.status", "desc"); $query = $this->db->get(); return $query->result(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_vehicle_geofence_assignment($id) {\n $this->db->select(\"vga.id,vga.vehicle_id,vga.geofence_id,plate_no,g.name,g.type,vga.status,date(vga.assign_date) as assign_date\"\n . \",date(vga.update_date) as update_date,\"\n . \"CONCAT(u.first_name,',',u.last_name) as assign_uid,\"\n . \",CONCAT(u2.first_name,',',u2.last_name) as update_uid,\"\n . \"in_alert,out_alert,sms_alert,email_alert\")\n ->from(\"vehicle_geofence_assignment vga\")\n ->join(\"vehicles v\", \"v.vehicle_id = vga.vehicle_id\", \"right\")\n ->join(\"users u\", \"u.user_id = vga.assign_uid\", \"left\")\n ->join(\"users u2\", \"u2.user_id = vga.update_uid\", \"left\")\n ->join(\"geofence g\", \"g.id = vga.geofence_id\", \"left\")\n ->where(\"vga.id\", $id)\n ->where(\"vga.account_id\", $this->session->userdata(\"hawk_account_id\"));\n\n $query = $this->db->get();\n return $query->row_array();\n }", "function add_vehicle_geofence_assignment($params) {\n $params['status'] = 1;\n $this->db->insert('vehicle_geofence_assignment', $params);\n return $this->db->insert_id();\n }", "public function getAssignments(): array;", "public function getGeographyConstituencies() {\n return $this->hasMany(Constituency::className(), ['district_id' => 'id']);\n }", "public function competition_geographic_get()\n\t{\n\n\t\tif($_SERVER['REQUEST_METHOD'] != \"GET\")\n\t\t{\n\t\t $this->response('Not Acceptable',406);\n\t\t}\n\t\t$comp_geo_list_arr=array();\n\n\t\t$this->load->model('Table_model');\n\t\t$comp_geo_list_arr=$this->Table_model->GetCompetitionGeographic();\n\t\tif(count($comp_geo_list_arr)>0)\n\t\t{\n\t\t\t$this->response(array('status'=>'success','competition_geographic'=>$comp_geo_list_arr), 200);\n\t\t}\n\t\telse\n\t\t\t$this->response(array('status'=>'failed','message'=>'No records in database'),200);\n\t\n\t\n\t}", "public function assigned_vehicles() {\n return view('clients.client_vehicles');\n /*$user_id = Session::get('user_id');\n $vehicles = User::find($user_id)->vehicles->toArray();\n print_r($vehicles);*/\n }", "public function getAssignments()\n {\n return $this->queryBuilder('tx_deepl_settings')->select('*')\n ->from('tx_deepl_settings')\n ->execute()\n ->fetchAll();\n }", "static public function getAllEngins()\n {\n $stmt=DB::connect()->prepare('SELECT * FROM type_vehicule');\n $stmt->execute();\n return $stmt->fetchAll();\n $stmt->closeCursor();\n $stmt=null;\n }", "function &getIncompleteReviewAssignments() {\n\t\t$reviewAssignments = array();\n\t\t$reviewRoundJoinString = $this->getReviewRoundJoin();\n\t\tif ($reviewRoundJoinString) {\n\t\t\t$result =& $this->retrieve(\n\t\t\t\t\t\t'SELECT\tr.*, r2.review_revision, u.first_name, u.last_name\n\t\t\t\t\t\tFROM\treview_assignments r\n\t\t\t\t\t\t\tLEFT JOIN users u ON (r.reviewer_id = u.user_id)\n\t\t\t\t\t\t\tLEFT JOIN review_rounds r2 ON (' . $reviewRoundJoinString . ')\n\t\t\t\t\t\tWHERE' . $this->getIncompleteReviewAssignmentsWhereString() .\n\t\t\t\t\t\t' ORDER BY r.submission_id'\n\t\t\t);\n\n\t\t\twhile (!$result->EOF) {\n\t\t\t\t$reviewAssignments[] =& $this->_fromRow($result->GetRowAssoc(false));\n\t\t\t\t$result->MoveNext();\n\t\t\t}\n\n\t\t\t$result->Close();\n\t\t\tunset($result);\n\t\t} else {\n\t\t\tassert(false);\n\t\t}\n\n\t\treturn $reviewAssignments;\n\t}", "function update_vehicle_geofence_assignment($id, $params) {\n $this->db->where('id', $id);\n $response = $this->db->update('vehicle_geofence_assignment', $params);\n if ($response) {\n return \"vehicle_geofence_assignment updated successfully\";\n } else {\n return \"Error occuring while updating vehicle_geofence_assignment\";\n }\n }", "public function availabilities()\n {\n return $this->hasMany('App\\Availability', 'location_id', 'location_id');\n }", "function getDetailAllRouteAssignment2InheritEV($parent_admin_id,$DbConnection)\n {\n\t\t$query_db_route_vehicle_ev = \"SELECT DISTINCT vehicle_name,route_name_ev,evening_update_time,remark_ev FROM route_assignment2 USE INDEX(rass2_aid_status) WHERE user_account_id='$parent_admin_id' and status=1\";\n\t\t$result1 = mysql_query($query_db_route_vehicle_ev, $DbConnection);\n\t\twhile($row1=mysql_fetch_object($result1))\n\t\t{\n\t\t /*$vehicle_name=$row1->vehicle_name;\n\t\t $evening_update_time=$row1->evening_update_time;\n\t\t $route_name_ev=$row1->route_name_ev;*/\n\t\t \n\t\t $data[]=array('vehicle_name'=>$row->vehicle_name,'evening_update_time'=>$row->evening_update_time,'route_name_ev'=>$row->route_name_ev);\t\n\t }\n\t return $data;\n }", "public function getElections() {\n $sql = \"SELECT id, jsonData, electionTitle,\n beginDate, endDate, coefficients, appVersion\n FROM tbl_elections\";\n $stmt = $this->db->query($sql);\n $results = [];\n while($row = $stmt->fetch()) {\n $results[] = new ElectionEntity($row);\n }\n return $results;\n }", "public function get_assignments(){\n if($this->ID != NULL){\n $sql = \"SELECT ID FROM assignment WHERE Task=\".$this->ID.\";\";\n $myAssignmentIDs = $this->get_by_query($sql);\n $myAssignmentsList = array();\n foreach ($myAssignmentIDs as &$aID) {\n $myAssignment = new Assignment();\n $myAssignment = $myAssignment->get_by_ID($aID['ID']);\n array_push($myAssignmentsList, $myAssignment);\n }\n return $myAssignmentsList;\n }\n }", "public function getAllGeonodes() {\n\t\t$qb = $this->createQueryBuilder('n');\n\t\t$qb->innerJoin(\"n.relations\",\"rel\",Join::WITH,\n\t\t\t$qb->expr()->eq(\"n.id\",\"rel.startNode\")\n\t\t);\n\t\t$qb->where(\"rel.geometryvalue IS NOT NULL\");\n\t\treturn $qb->getQuery()->getResult();\n\t}", "function getDetailAllRouteAssignment2VSA($parent_admin_id,$DbConnection)\n {\n\t$query_assigned_ev = \"SELECT vehicle_name,route_name_ev,remark_ev FROM route_assignment2 USE INDEX(rass2_aid_status) WHERE user_account_id='$parent_admin_id' AND status=1\";\t\n\t$result_assigned_ev = mysql_query($query_assigned_ev, $DbConnection);\n\twhile($row_ev=mysql_fetch_object($result_assigned_ev))\n\t{\n\t\t/*$vname_assigned_ev = $row_ev->vehicle_name;\n\t\t$route_assigned_ev = $row_ev->route_name_ev;\n\t\t$remark_assigned_ev = $row_ev->remark_ev;*/\n\t\t\n\t $data[]=array('vname_assigned_ev'=>$row->vehicle_name,'route_assigned_ev'=>$row->route_name_ev,'remark_assigned_ev'=>$row->remark_ev);\t\n\t}\n\treturn $data;\n }", "public function getAll()\n {\n return $this->candidateRepository->getAll();\n }", "public function get_all_eco_attributes()\n {\n \t$attribute = Mage::getResourceModel('eav/entity_attribute_collection')->setCodeFilter('eco_attribute')->getFirstItem();\n\n\t\t$options = Mage::getModel('eav/entity_attribute_source_table')->setAttribute($attribute)->getAllOptions(false) ;\n\t\t\n\t\treturn $options;\n \t}", "function getEstablishmentByGeo($lat,$lng,$distance = 1){\n\n\t\t$query = \"SELECT address_id, \n\t\t\t\t(((acos(sin(($lat*pi()/180)) * sin((lat*pi()/180)) + \n\t\t\t\tcos(($lat*pi()/180)) * cos((lat*pi()/180)) * cos((($lng - lng) * \n\t\t\t\tpi()/180)))) * 180 / pi()) * 60 * 1.1515 * 1.609344) as distance\n\t\t\t\tFROM coordinates \n\t\t\t\tINNER JOIN address_coordinates \n\t\t\t\tON (coordinates.id = address_coordinates.coordinate_id)\n\t\t\t\thaving distance <= $distance order by distance\";\n\n\t\t$result = $this->query($query);\n\t\t\n\t\t$result = array_keys(Set::combine($result,'{n}.address_coordinates.address_id'));\n\t\n\t\t$result = $this->AddressEstablishment->find('all',array('conditions'=>array('address_id'=>$result),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'fields'=>'establishment_id')\n\t\t);\n\t\t\t\t\n\t\treturn array_keys(Set::combine($result,'{n}.AddressEstablishment.establishment_id'));\n\t\t\n\t}", "public function getAuthAssignments(){\n return array_keys(Yii::app()->getAuthManager()->getAuthAssignments($this->id));\n }", "function get_all_assignments()\n {\n $this->db->order_by('assignID', 'asc');\n $this->db->where('status !=', 'Archived ');\n return $this->db->get('assignments')->result_array();\n }", "public function GetDuplicateAssignments() {\n\t\t$objStmt = $this->objDb->prepare(\"\n\t\t\tSELECT a.asset_id, a.serial_number, ea.employee_id, da.department_id FROM asset AS a\n\t\t\tJOIN employee_asset AS ea ON a.asset_id = ea.asset_id\n\t\t\tJOIN department_asset AS da ON a.asset_id = da.asset_id\n\t\t\tWHERE (\n\t\t\t\ta.asset_id IN (SELECT ea.asset_id FROM employee_asset AS ea)\n\t\t\t\tAND a.asset_id IN (SELECT da.asset_id FROM department_asset AS da)\n\t\t\t)\n\t\t\tAND a.status_id = 1\n\t\t\tORDER BY a.asset_id;\n\t\t\");\n\t\t$objStmt->execute();\n\t\t$objStmt->bind_result($intAssetId, $strSerialNumber, $intEmployeeId, $intDepartmentId);\n\n\t\t$arrAssets = array();\n\n\t\twhile ($objStmt->fetch()) {\n\t\t\t$arrRow = array();\n\t\t\t$arrRow['asset_id'] = $intAssetId;\n\t\t\t$arrRow['serial_number'] = $strSerialNumber;\n\t\t\t$arrRow['employee_id'] = $intEmployeeId;\n\t\t\t$arrRow['department_id'] = $intDepartmentId;\n\t\t\tarray_push($arrAssets, $arrRow);\n\t\t\tunset($arrRow);\n\t\t}\n\t\t$objStmt->close();\n\n\t\treturn $arrAssets;\n\t}", "public function allEvaluations()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('e, bfg')\n ->from(Evaluation::class, 'e')\n ->join('e.branchForGroup', 'bfg');\n $result = $qb->getQuery()->getResult();\n return $result;\n }", "public function getAssociateRoleAssignments()\n {\n return $this->associateRoleAssignments;\n }", "public function regions()\n {\n return $this->hasManyThrough(FirmLocation::class, CandidateLocation::class, 'candidate_id', 'id', 'id' , 'location_id');\n }", "public function getAddresses() {\n $table = new Yourdelivery_Model_DbTable_Locations();\n return $table->fetchAll('companyId = ' . $this->getId());\n }", "protected function initProjectAssignments(): array\n {\n $projectAssignments = $this->projectReviewerScores;\n foreach ($projectAssignments as &$assignmentsProjectData) {\n foreach ($assignmentsProjectData['scores'] as &$assignmentScore) {\n if ($assignmentScore > 0) {\n $assignmentScore = ReviewRosterService::REVIEWER_UNASSIGNED;\n }\n }\n }\n\n return $projectAssignments;\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 assignments() {\n return $this->hasMany(NodeRelations::class, 'node_id');\n }", "public function getOccupations()\n {\n return $this->hasMany(TaskCategory::className(), ['id' => 'occupation_id'])->viaTable('contractor_occupation', ['contractor_id' => 'id']);\n }" ]
[ "0.69417584", "0.5792541", "0.57728255", "0.5378969", "0.5337486", "0.5317466", "0.5279488", "0.5254071", "0.52165556", "0.52145034", "0.52144593", "0.51434386", "0.5123004", "0.5112198", "0.5075808", "0.5044118", "0.501423", "0.49985194", "0.4985502", "0.49741435", "0.49070284", "0.48962268", "0.48905736", "0.48902327", "0.48764142", "0.48753807", "0.48666877", "0.48283148", "0.48273134", "0.48269153" ]
0.7000169
0
/ function to add new vehicle_geofence_assignment
function add_vehicle_geofence_assignment($params) { $params['status'] = 1; $this->db->insert('vehicle_geofence_assignment', $params); return $this->db->insert_id(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_vehicle_geofence_assignment($id, $params) {\n $this->db->where('id', $id);\n $response = $this->db->update('vehicle_geofence_assignment', $params);\n if ($response) {\n return \"vehicle_geofence_assignment updated successfully\";\n } else {\n return \"Error occuring while updating vehicle_geofence_assignment\";\n }\n }", "function get_vehicle_geofence_assignment($id) {\n $this->db->select(\"vga.id,vga.vehicle_id,vga.geofence_id,plate_no,g.name,g.type,vga.status,date(vga.assign_date) as assign_date\"\n . \",date(vga.update_date) as update_date,\"\n . \"CONCAT(u.first_name,',',u.last_name) as assign_uid,\"\n . \",CONCAT(u2.first_name,',',u2.last_name) as update_uid,\"\n . \"in_alert,out_alert,sms_alert,email_alert\")\n ->from(\"vehicle_geofence_assignment vga\")\n ->join(\"vehicles v\", \"v.vehicle_id = vga.vehicle_id\", \"right\")\n ->join(\"users u\", \"u.user_id = vga.assign_uid\", \"left\")\n ->join(\"users u2\", \"u2.user_id = vga.update_uid\", \"left\")\n ->join(\"geofence g\", \"g.id = vga.geofence_id\", \"left\")\n ->where(\"vga.id\", $id)\n ->where(\"vga.account_id\", $this->session->userdata(\"hawk_account_id\"));\n\n $query = $this->db->get();\n return $query->row_array();\n }", "function delete_vehicle_geofence_assignment($id) {\n $response = $this->db->delete('vehicle_geofence_assignment', array('id' => $id));\n if ($response) {\n return \"vehicle_geofence_assignment deleted successfully\";\n } else {\n return \"Error occuring while deleting vehicle_geofence_assignment\";\n }\n }", "public function addGeopoint($str_name)\n {\n return $this->addField($str_name, self::FIELD_GEOPOINT);\n }", "function get_all_vehicle_geofence($vehicle_id = null) {\n if (isset($vehicle_id)) {\n $this->db->where(\"vga.vehicle_id\", $vehicle_id);\n }\n $this->db->select(\"vga.id,plate_no,g.name,g.type,vga.status,date(vga.assign_date) as assign_date\"\n . \",date(vga.update_date) as update_date,\"\n . \"CONCAT(u.first_name,',',u.last_name) as assign_uid,\"\n . \",CONCAT(u2.first_name,',',u2.last_name) as update_uid,\"\n . \"in_alert,out_alert,sms_alert,email_alert\")\n ->from(\"vehicle_geofence_assignment vga\")\n ->join(\"vehicles v\", \"v.vehicle_id = vga.vehicle_id\", \"right\")\n ->join(\"users u\", \"u.user_id = vga.assign_uid\", \"left\")\n ->join(\"users u2\", \"u2.user_id = vga.update_uid\", \"left\")\n ->join(\"geofence g\", \"g.id = vga.geofence_id\", \"left\")\n ->where(\"vga.account_id\", $this->session->userdata(\"hawk_account_id\"))\n ->order_by(\"vga.status\", \"desc\");\n\n $query = $this->db->get();\n return $query->result();\n }", "public function add_area(Request $request)\n\t{\n\t\t$validator = Validator::make($request->all(), [\n 'area' => 'required',\n 'status' => 'required',\n 'geofence_latlng' => 'required'\n ]);\n\n if($validator->fails()) \n {\n\n $error_messages = implode(',',$validator->messages()->all());\n return back()->with('error', $error_messages)->withInput();\n }else\n {\n $check = $this->addarea->where('area','=',$request->area)->first();\n if(isset($check)==0)\n {\n $add_city_id = $request->id;\n $area = $request->area;\n $status = $request->status;\n \t$add_area = $this->addarea;\n \t$data = array();\n\n \t$data[] = array(\n \t\t\n \t\t'area'=>$area,\n \t\t'status'=>$status,\n \t\t'add_city_id'=>$add_city_id,\n 'latitude' => $request->latitude,\n 'longitude' => $request->longitude,\n 'polygons' => $request->geofence_latlng,\n\n \t);\n \t$add_area->insert($data);\n }\n else\n {\n\n return back()->with('error','This Area was Already Registered!');\n }\n \t\n }\n return redirect('admin/view_areas/'.$request->id)->with('success',trans('constants.add_success_msg',['param'=>'Area']));\n }", "function addAlLocation($allocation_details){\n\t if ($this->db->insert('events_tt',$allocation_details))\n\t\t\t { \n\t\t\t return TRUE;\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t return FALSE;\n\t\t\t }\n }", "public function addVehicle(Request $request){\n // sanitize input (function in Controller parent)\n $this->formatInput($request);\n\n // validation of user input in the form\n $this->validateVehicle($request);\n\n // if VALIDATION went ok proceed to below\n $vehi = new Vehicle();\n\n // get someValue from the name=\"someValue\" key/value pair\n $vehi->fldRegoNo = strtoupper($request->fldRegoNo); // convert to uppercase\n $vehi->fldBrand = $request->fldBrand;\n $vehi->fldSeating = $request->fldSeating;\n $vehi->fldHirePriceCurrent = $request->fldHirePriceCurrent;\n\n // assuming every new vehicle added is not damaged nor retired, so hardcode these values\n $vehi->fldDamaged = 0;\n $vehi->fldRetired = 0;\n\n // set created_at to current date and time\n $vehi->created_at = Carbon::now();\n\n // set fldLocationId to null since we don't implement location/suburb in this assignment\n $vehi->fldLocationId = null;\n\n $vehi->save();\n\n return redirect('vehicles');\n }", "public function addVol()\n {\n self::init();\n self::$_mapper->save($this, 'noVol');\n }", "public function addNewLocation($request)\n {\n $this->deliveryLocation->name = $request->name;\n $this->deliveryLocation->description = $request->description;\n $this->deliveryLocation->price = $request->price;\n if ($this->deliveryLocation->save()) {\n return \"saved\";\n }\n return 'can\\'t be saved';\n }", "public function add() {\n $insertData = $this->data;\n $keepNullFields = [\n 'estimator_id', 'date_requested', 'date_service', 'class_id',\n 'date_service', 'lat', 'lng'\n ];\n foreach ($keepNullFields as $field) {\n if (!$insertData[$field]) {\n $insertData[$field] = null;\n }\n }\n $model = new ReferralModel;\n $ref = $model->create();\n $ref->set($insertData);\n $ref->save();\n $this->renderJson([\n 'success' => true,\n 'message' => 'Job request created successfully',\n 'data' => $ref->asArray()\n ]);\n }", "function gsAddCourse($imageBase, $course, $golfObj=null) {\n $areaArray = $output = $errors = $loc_errors = array();\n $loc_id = 0;\n \n //$image = \"http://devxml.golfswitch.com/img/course/$id/$image\";\n $keys = array(\n 'id' => 'fid',\n 'sCou' => 'golf_country_code',\n 'sReg' => 'golf_region_code',\n 'sAr' => 'golf_district_code',\n 'onReq' => 'on_request',\n 'nm' => 'name',\n 'lat' => 'location_lat', \n 'lon' => 'location_long', \n 'cou' => 'address_country',\n 'st' => 'address_state',\n 'cty' => 'address_city',\n 'advDays' => 'adv_days',\n 'insideDays' => 'inside_days',\n 'dist' => 'length_men',\n 'promo' => 'description',\n 'rating' => 'rating_men',\n 'img' => 'image',\n 'lastUpd' => 'source_updated');\n $loc_keys = array('name', 'location_lat', 'location_long', 'address_city', 'address_state', 'address_country');\n $data = array_copy($course, $keys);\n $fid = $data['fid'];\n\n $data['image_base'] = \"$imageBase/$fid/\";\n //$data['image'] = $data['image'] ? \"$imageBase/$fid/\".$data['image'] : '';\n $data['source_updated'] = date('Y-m-d H:i:s', strtotime($data['source_updated']));\n\n\n // figure out country,region,district\n $city_name = $course->cty;\n $region_name = $course->sAr;\n $cCode = $course->sCou;\n $rCode = $course->sReg;\n $dCode = $course->sAr;\n\n //if(!($course->lat && $course->lon)) return array(0, array(\"Missing lat/long\"));\n //if(!($cCode && $rCode && $dCode)) return array(0, array(\"Missing search area params\"));\n \n list($c_id, $r_id, $d_id) = gsAreaIds($course, $areaArray);\n //if(!($c_id && $r_id && $d_id)) return array(0, array(\"Could not find area ids for $cCode/$rCode/$dCode\"));\n\n $data['golf_country_id'] = $areaArray['country'][$cCode] = $c_id; \n $data['golf_region_id'] = $areaArray['region'][$rCode] = $r_id; \n $data['golf_district_id'] = $areaArray['district'][$dCode] = $d_id; \n \n $golfObj = $golfObj ?: find_object('golf_course', array('fid' => $fid)); // search for existing\n\n if($course->lat && $course->lon) {\n $locData = array_copy($data, $loc_keys);\n $locData['description'] = $data['short_description'];\n $locData['alt_names'] = $data['name'].\" Golf Course $city_name $region_name\";\n $cc = $data['address_country'];\n $country_name = $cc ? get_object('countries', $cc, 'name') : '';\n $locData['address_formatted'] = implode(',', array_filter(array($data['name'], $data['address_city'], $data['address_state'], $country_name)));\n $locData['location_radius'] = 1000;\n $locData['location_bounds'] = json_encode(radius2bounds($locData, 1000));\n $locData['parent_type'] = 'golf_course';\n $locData['parent_id'] = $golf_id;\n $locData['accuracy'] = 8;\n $locData['zoom'] = 17;\n\n // add or update location \n if($loc_id = $golfObj->location_id) {\n $action = 'update';\n //list($loc_id, $loc_errors) = update_object('location', $locData, $loc_id); \n } else {\n $action = 'add';\n list($loc_id, $loc_errors) = add_object('location', $locData); \n }\n if($loc_errors) {echo(\"Failed to $action location\".dump($loc_errors, true));}\n }\n\n // add or update golf course \n if($loc_id) $data['location_id'] = $loc_id;\n \n if($golfObj) {\n list($id, $errors) = update_object('golf_course', $data, $golfObj->id);\n $action = \"update\";\n } else {\n list($id, $errors) = add_object('golf_course', $data);\n $action = \"add\";\n }\n\n if($errors) {echo(\"Failed to $action golf_course\".dump($errors, true));}\n if($id && $loc_id && !$golfObj->location_id) db_query(\"UPDATE location SET parent_id=$id WHERE id=$loc_id\");\n \n return array($id, $errors);\n}", "function createuniversitylocation(){\n\n\t\tif($_POST['other_information']!=\"\" || $_POST['other_information']!=NULL){\n\t\t\t$other_information = $_POST['other_information'];\n\t\t}else{\n\t\t\t$other_information = \"\";\n\t\t}\n\n\t\tif($_POST['website']!=\"\" || $_POST['website']!=NULL){\n\t\t\t$website = $_POST['website'];\n\t\t}else{\n\t\t\t$website = \"\";\n\t\t}\n\n\t\tif($_POST['countrycode']!='')\n\t\t{\n\t\t\t$phone = $_POST['countrycode'].'-'.$_POST['phone'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$phone = $_POST['phone'];\n\t\t}\n\n\t\tif(isset($_POST['ismain']) && $_POST['ismain']==1)\n\t\t{\n\t\t\t$this->db->query(\"UPDATE tbl_university_location SET ismain=0 WHERE universityid = (SELECT uuid FROM tbl_university_registration WHERE userid=\".$this->session->userdata('fuserid').\")\");\n\t\t\t$ismain = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ismain = 0;\n\t\t}\n\n\t\t$currentdate=date(\"Y-m-d H:i:s\");\n\n\t\t$locationQuuid = $this->db->query(\"SELECT uuid() as id\");\n\n\t\tif ($locationQuuid->num_rows() > 0)\n\t\t{\n\t\t\t$datauuid = $locationQuuid->row_array();\n\t\t\t$locationuuid=$datauuid[\"id\"];\n\t\t}\n\n\t\t$data = array(\n\t\t\t'campus_name' => $_POST['campus_name'],\n\t\t\t'name' => $_POST['name'],\n\t\t\t'address' => $_POST['address'],\n\t\t\t'email' => $_POST['email'],\n\t\t\t'phone' => $phone,\n\t\t\t'insertdate' => date('Y-m-d'),\n\t\t\t'universityid' => $_POST['universityid'],\n\t\t\t'other_information' => $other_information,\n\t\t\t'website' => $website,\n\t\t\t'country' => $_POST['countryid'],\n\t\t\t'state' => $_POST['stateid'],\n\t\t\t'city' => $_POST['cityid'],\n\t\t\t'zipcode' => $_POST['zipcode'],\n\t\t\t'event_title' => $_POST['event_title'],\n\t\t\t'locationuuid' => $locationuuid,\n\t\t\t'latitude'\t=> $_POST['latitude'],\n\t\t\t'longitude' => $_POST['longitude'],\n\t\t\t'ismain'\t=> $ismain\n\t\t\t//'opening_time' => $_POST['opening_time'],\n\t\t\t//'closing_time' => $_POST['closing_time'],\n\t\t\t//'action_date' => $currentdate,\n\t\t\t//'userstatus' => 1\n\t\t\t\n\t\t);\n\n\t\t$this->db->INSERT('tbl_university_location',$data);\n\t}", "public function testProjectAssignmentsDefineNew()\n {\n }", "function addHotelRoom(Request $request){\n $oUser = Auth::user();\n $is_organizer=false;\n\n if($oUser->role!='admin'){\n foreach($oUser->traveller->travellersPerTrip as $travellersPerTrip) {\n $is_organizer=$travellersPerTrip->is_organizer;\n }\n }\n if (($oUser->role == 'guide'&& $is_organizer)||($oUser->role=='admin'))\n {\n $oRoom=new RoomsPerHotelPerTrip();\n $oRoom->hotels_per_trip_id=$request->post('hotels_per_trip_id');\n $oRoom->size=$request->post('AantalPersonen');\n $oRoom->save();\n\n return redirect()->back();\n }\n else{\n return redirect()->back();\n }\n }", "public function actionCreateAllocation()\n {\n $model = new AllocationDetails();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $wpLoc = WpLocation::findOne(['id'=>$model->wpLocCode]);\n $model->name = $wpLoc->name;\n \n $year = CurrentYear::getCurrentYear();\n $model->yearId =(string) $year->_id;\n $yearstring =substr($year->yearStartDate,-4).substr($year->yearEndDate,-4);\n $model->allocationID = $model->wpLocCode.$yearstring;\n $model->save();\n return $this->redirect(['view', 'id' => (string)$model->_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function addNewCity($latitude,$lng,$detail_city){\r\n\t\t}", "function add_new_car(){\n }", "function createVehicle($vehicle)\n{\n // Create a connection object using the phpmotors connection function\n $db = phpmotorsConnect();\n // The SQL statement\n $sql = 'INSERT INTO inventory(invMake, invModel, invDescription, invImage, invThumbnail, \n invPrice, invStock, invColor, classificationId)\n VALUES (:invMake, :invModel, :invDescription, :invImage, :invThumbnail, :invPrice, \n :invStock, :invColor, :classificationId)';\n // Create the prepared statement using the phpmotors connection\n $stmt = $db->prepare($sql);\n // The next nine lines replace the placeholders in the SQL\n // statement with the actual values in the variables\n // and tells the database the type of data it is\n //$stmt->bindValue(':invId', $vehicle->invId, PDO::PARAM_STR);\n $stmt->bindValue(':invMake', $vehicle->invMake, PDO::PARAM_STR);\n $stmt->bindValue(':invModel', $vehicle->invModel, PDO::PARAM_STR);\n $stmt->bindValue(':invDescription', $vehicle->invDescription, PDO::PARAM_STR);\n $stmt->bindValue(':invImage', $vehicle->invImage, PDO::PARAM_STR);\n $stmt->bindValue(':invThumbnail', $vehicle->invThumbnail, PDO::PARAM_STR);\n $stmt->bindValue(':invPrice', $vehicle->invPrice, PDO::PARAM_STR);\n $stmt->bindValue(':invStock', $vehicle->invStock, PDO::PARAM_INT);\n $stmt->bindValue(':invColor', $vehicle->invColor, PDO::PARAM_STR);\n $stmt->bindValue(':classificationId', $vehicle->classificationId, PDO::PARAM_INT);\n // Insert the data\n $stmt->execute();\n // Ask how many rows changed as a result of our insert\n $rowsChanged = $stmt->rowCount();\n // Close the database interaction\n $stmt->closeCursor();\n // Return the indication of success (rows changed)\n return $rowsChanged;\n}", "function addPrediction(){\n\t\n\t}", "public function store(AgencyRequest $request)\n {\n $province_name = Province::find($request->province_id)->name;\n $district_name = District::find($request->district_id)->name;\n $ward_name = Ward::find($request->ward_id)->name;\n $mapResults = GoogleMapsHelper::lookUpInfoFromAddress($province_name . ' ' . $district_name . ' ' . $ward_name . ' ' . $request->home_number);\n if (isset($mapResults->geometry)) {\n $location = isset($mapResults->geometry->location) ? $mapResults->geometry->location : null;\n }\n DB::beginTransaction();\n try {\n $data = new Agency();\n $data->name = $request->name;\n $data->discount = $request->discount;\n $data->phone = $request->phone;\n $data->address = $request->home_number . ', ' . $ward_name . ', ' . $district_name . ', ' . $province_name;\n $data->province_id = $request->province_id;\n $data->district_id = $request->district_id;\n $data->ward_id = $request->ward_id;\n $data->home_number = $request->home_number;\n if ($location != null) {\n $data->lat = $location->lat;\n $data->lng = $location->lng;\n }\n $data->created_at = Carbon::now();\n $data->updated_at = Carbon::now();\n $data->save();\n foreach ($request->collaborator as $col) {\n Collaborator::insert([\n 'user_id' => $col,\n 'agency_id' => $data->id,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n }\n\n foreach ($request->scope as $s) {\n ManagementScope::insert([\n 'agency_id' => $data->id,\n 'district_id' => $s\n ]);\n }\n if ($request->ward_scope == null) {\n $ward_check = Ward::whereIn('districtId', $request->scope)->orderBy('name', 'asc')->pluck('id');\n $exist_ward = ManagementWardScope::whereIn('ward_id', $ward_check)->pluck('ward_id');\n $ward = Ward::whereIn('districtId', $request->scope)->whereNotIn('id', $exist_ward)->pluck('id');\n foreach ($ward as $w) {\n ManagementWardScope::insert([\n 'agency_id' => $data->id,\n 'ward_id' => $w\n ]);\n }\n } else {\n foreach ($request->ward_scope as $ws) {\n ManagementWardScope::insert([\n 'agency_id' => $data->id,\n 'ward_id' => $ws\n ]);\n }\n }\n DB::commit();\n } catch (\\Exception $e) {\n DB::rollBack();\n dd($e);\n }\n return redirect(url('admin/agencies'))->with('success', 'Thêm mới đại lý thành công');\n }", "public function add($fields) {\n\t\t\n\t\tif (!\\array_key_exists('candidateName', $fields))\n\t\t\treturn 0;\n\t\t$candidate = new Candidate();\n\t\t$candidate->name = $fields['candidateName'];\n\t\t\n\t\tif (\\array_key_exists('testScore', $fields)) {\n\t\t\t$candidate->testScore = $fields['testScore'];\n\t\t}\t\t\n\t\t\n\t\tif (\\array_key_exists('experienceScore', $fields)) {\n\t\t\t$candidate->experienceScore = $fields['experienceScore'];\n\t\t}\t\t\n\t\t\n\t\tif (\\array_key_exists('interviewScore', $fields)) {\n\t\t\t$candidate->interviewScore = $fields['interviewScore'];\n\t\t}\t\t\n\t\t\n\t\tif (\\array_key_exists('id', $fields)) {\n\t\t\tif(\\is_numeric($fields['id'])) {\n\t\t\t\tif ($fields['id'] > 0) {\n\t\t\t\t\t$candidate->id = $fields['id'];\n\t\t\t\t\treturn parent::update($candidate->id, $candidate);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn parent::add($candidate);\n\t\t\n }", "private function addPlaceField()\n {\n foreach ($this->standings as $key => $standing)\n {\n $standing['place'] = $key + 1;\n $this->standings[$key] = $standing;\n }\n }", "public function store(Request $request)\n {\n \t$request->validate([\n \t\t'code' => 'required',\n \t\t'name' => 'required',\n \t\t'year' => 'required',\n \t]);\n\n \t$ap = new ApprovalPlot();\n \t$ap->code = Input::get('code');\n \t$ap->name = Input::get('name');\n \t$ap->lat = Input::get('lat');\n \t$ap->long = Input::get('long');\n \t$ap->comment = Input::get('comment');\n \t$ap->location = Input::get('location');\n \t$ap->year = Input::get('year');\n \t$ap->total_reserves = Input::get('total_reserves');\n \t$ap->category_a = Input::get('category_a');\n \t$ap->category_b = Input::get('category_b');\n \t$ap->category_c = Input::get('category_c');\n \t$ap->stock_a_authority = Input::get('stock_a_authority');\n \t$ap->approval_protocol = Input::get('approval_protocol');\n \t$ap->approval_date = Input::get('approval_date');\n \t$ap->water_volume = Input::get('water_volume');\n \t$ap->birth_place_id = Input::get('bp_id');\n\t\t$ap->mineralization_from = Input::get('mineralization_from');\n $ap->mineralization_to = Input::get('mineralization_to');\n $ap->water_chemical_composition = Input::get('water_chemical_composition');\n \t$ap->is_approve = false;\n \t$ap->user_id = Auth::id();\n \t$ap->save();\n\n foreach ($request->type_water_uses as $item) {\n DB::table('approval_plot_type_water_use')\n ->insert(['approval_plot_id' => $ap->id, 'type_water_use_id' => $item]);\n }\n\n \tif(Input::get('districts') != null || Input::get('regions') != null)\n \t{\n \t\tif(Input::get('districts') == null)\n \t\t{\n \t\t\tforeach (Input::get('regions') as $key=>$region)\n \t\t\t{\n \t\t\t\t$ap_attr = new ApprovalPlotAttr();\n \t\t\t\t$ap_attr->approval_plots_id = $ap->id;\n \t\t\t\t$ap_attr->region_id = $region;\n \t\t\t\t$ap_attr->save();\n \t\t\t}\n \t\t}\n \t\telse\n \t\t{\n \t\t\tforeach (Input::get('districts') as $key=>$region)\n \t\t\t{\n \t\t\t\t$ap_attr = new ApprovalPlotAttr();\n \t\t\t\t$ap_attr->approval_plots_id = $ap->id;\n \t\t\t\t$region_id = UzDistricts::select('regionid')->where('areaid','=',$region)->first();\n \t\t\t\t$ap_attr->region_id = $region_id->regionid;\n \t\t\t\t$ap_attr->district_id = $region;\n \t\t\t\t$ap_attr->save();\n \t\t\t}\n \t\t}\n\n \t}\n\n\n \treturn redirect(route('gg.reestr.ap.index'));\n }", "function add_region()\n\n\t {\n\t $this->load->model( 'main_model' );\n\t $data['get_circle'] = $this->main_model->get_circle();\n $this->load->view('add_region',$data);\n\t }", "public function actionImport()\n\t{\n\t\t$model = new GeoFeature();\n\t\t$model->feature_type = $_POST['type'];\n\t\t$model->title = $_POST['name'];\n\t\t$model->description = $_POST['desc'];\n\t\t\n\t\tif ($model->feature_type == 'point')\n\t\t{\n\t\t\t$model->geo_lat = $_POST['lat'];\n\t\t\t$model->geo_long = $_POST['lon'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$model->geo_lat = 0;\n\t\t\t$model->geo_long = 0;\n\t\t}\n\t\t\t\n\t\tif (!$model->insert())\n\t\t{\n\t\t\tYii::app()->user->setFlash('error', 'Σφάλμα κατά την εισαγωγή της εγγραφής: ' . var_export($model->errors, true));\n\t\t\t$this->redirect(array('index'));\n\t\t}\n\t\t\n\t\t// now that we have feature_id, we shall save possible waypoints...\n\t\tif ($model->feature_type == 'route')\n\t\t{\n\t\t\t// we shall be adding them using one big INSERT,\n\t\t\t// for may ones take time (30 seconds for 500 waypoints)\n\t\t\t// Yii 1.14 has the CDbCommandBuilder->createMultipleInsertCommand() function. this version does not.\n\t\t\t$points = explode('|', $_POST['points']);\n\t\t\tif (count($points) > 0)\n\t\t\t{\n\t\t\t\t$no = 1;\n\t\t\t\t$boundVars = array();\n\t\t\t\tforeach ($points as $point)\n\t\t\t\t{\n\t\t\t\t\t$boundVars[] = '(:f'.$no.', :n'.$no.', :la'.$no.', :lo'.$no.')';\n\t\t\t\t\t$no++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sql = \n\t\t\t\t\t'INSERT INTO ' . GeoWaypoint::model()->tableSchema->rawName . ' (feature_id, waypoint_no, geo_lat, geo_long) '.\n\t\t\t\t\t'VALUES ' . implode(', ', $boundVars);\n\t\t\t\t\n\t\t\t\t$no = 1;\n\t\t\t\t$cmd = Yii::app()->db->createCommand($sql);\n\t\t\t\tforeach ($points as $point)\n\t\t\t\t{\n\t\t\t\t\t$coords = explode(',', $point);\n\t\t\t\t\t$cmd->bindValue(':f'.$no, $model->id);\n\t\t\t\t\t$cmd->bindValue(':n'.$no, $no);\n\t\t\t\t\t$cmd->bindValue(':la'.$no, $coords[0]);\n\t\t\t\t\t$cmd->bindValue(':lo'.$no, $coords[1]);\n\t\t\t\t\t$no++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$cmd->execute();\n\t\t\t}\n\t\t}\n\n\t\tYii::app()->user->setFlash('success','Η εγγραφή αποθηκεύτηκε: ' . CHtml::encode($model->title));\n\t\t$this->redirect(array('update', 'id'=>$model->id));\n\t}", "public function addVehicle(Vehicle $vehicle)\n {\n if($vehicle instanceof Bicycle)\n {\n echo \"You'r note allowed here\";\n }else{\n $this->currentVehicles[] = $vehicle;\n }\n }", "public function addNewGig() {\n $user = $this->db->getUser('username', $_POST['username']); \n $begin_date = $_POST['begin_date'];\n $begin_time = $_POST['begin_time'];\n $begin = strtotime($begin_date . ' ' . $begin_time);\n \n $end_date = $_POST['end_date'];\n $end_time = $_POST['end_time'];\n $end = strtotime($end_date . ' ' . $end_time);\n \n $arr = array(\n 'user_id' => $user->get('id'),\n 'name' => $_POST['name'],\n 'begin' => $begin,\n 'end' => $end,\n 'location'=> $_POST['location'],\n );\n $location_id = $this->db->getLocationID($arr['location']);\n $arr['location_id'] = $location_id;\n $gig = new Gig($arr);\n $gig->save($this->db);\n header('Location: ' . route('gigs'));\n }", "public function add_directions($facility);", "function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `layer_points` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}else{\n\t\t\t$sql = \"INSERT into `layer_points` values('\".addslashes($this->id).\"' , '\".addslashes($this->lid).\"' , '\".addslashes($this->name).\"' , '\".addslashes($this->lat).\"' , '\".addslashes($this->lon).\"' , '\".addslashes($this->alt).\"' , '\".addslashes($this->bf).\"' , '\".addslashes($this->lp_image).\"' , '\".addslashes($this->notes).\"')\";\n\t\t}\n\t\t$this->connection->send_query($sql);\n\t}" ]
[ "0.59476495", "0.5339896", "0.52166086", "0.50555676", "0.49128625", "0.47900632", "0.4782088", "0.4773849", "0.47499636", "0.47288382", "0.47044054", "0.46734616", "0.46727452", "0.4666103", "0.4664354", "0.46551523", "0.46493262", "0.46308765", "0.4616317", "0.46146682", "0.46065867", "0.46009874", "0.4599409", "0.45952412", "0.45871213", "0.45709234", "0.45614687", "0.45398644", "0.4531239", "0.45279926" ]
0.7993619
0
/ function to update vehicle_geofence_assignment
function update_vehicle_geofence_assignment($id, $params) { $this->db->where('id', $id); $response = $this->db->update('vehicle_geofence_assignment', $params); if ($response) { return "vehicle_geofence_assignment updated successfully"; } else { return "Error occuring while updating vehicle_geofence_assignment"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_vehicle_geofence_assignment($params) {\n $params['status'] = 1;\n $this->db->insert('vehicle_geofence_assignment', $params);\n return $this->db->insert_id();\n }", "function get_vehicle_geofence_assignment($id) {\n $this->db->select(\"vga.id,vga.vehicle_id,vga.geofence_id,plate_no,g.name,g.type,vga.status,date(vga.assign_date) as assign_date\"\n . \",date(vga.update_date) as update_date,\"\n . \"CONCAT(u.first_name,',',u.last_name) as assign_uid,\"\n . \",CONCAT(u2.first_name,',',u2.last_name) as update_uid,\"\n . \"in_alert,out_alert,sms_alert,email_alert\")\n ->from(\"vehicle_geofence_assignment vga\")\n ->join(\"vehicles v\", \"v.vehicle_id = vga.vehicle_id\", \"right\")\n ->join(\"users u\", \"u.user_id = vga.assign_uid\", \"left\")\n ->join(\"users u2\", \"u2.user_id = vga.update_uid\", \"left\")\n ->join(\"geofence g\", \"g.id = vga.geofence_id\", \"left\")\n ->where(\"vga.id\", $id)\n ->where(\"vga.account_id\", $this->session->userdata(\"hawk_account_id\"));\n\n $query = $this->db->get();\n return $query->row_array();\n }", "function update_vehicle($data)\n\t{\n\t\tglobal $cid, $db;\n\n\t\t$sql = \"UPDATE \". GARAGE_TABLE .\"\n\t\t\tSET made_year = '\".$data['year'].\"', make_id = '\".$data['make_id'].\"', model_id = '\".$data['model_id'].\"', color = '\".$data['colour'].\"', mileage = '\".$data['mileage'].\"', mileage_units = '\".$data['mileage_units'].\"', price = '\".$data['price'].\"', currency = '\".$data['currency'].\"', comments = '\".$data['comments'].\"', guestbook_pm_notify = '\".$data['guestbook_pm_notify'].\"'\n\t\t\tWHERE id = '$cid'\";\n\t\n\t\tif(!$result = $db->sql_query($sql))\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could Not Update Vehicle', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\treturn;\n\t}", "public function update() {\n\t$stmt = $this->_database->prepare('UPDATE planetterrains SET terrainid = ?, x = ?, y = ? WHERE refid = ?');\n\t$stmt->bind_param('iiii', $this->terrainid, $this->x, $this->y, $this->refid);\n\t$stmt->execute();\n\tif (\\is_array($this->deposit) && \\count($this->deposit) > 0) {\n\t $this->deposit[$this->refid]->terrainid = $this->refid;\n\t $this->deposit[$this->refid]->commit();\n\t}\n\telse if (!\\is_array($this->deposit)) {\n\t $this->deposit->terrainid = $this->refid;\n\t $this->deposit->commit();\n\t}\n }", "function Geofinder_upd()\n\t{\n\t\t$this->EE =& get_instance();\n\t}", "private function updateGeoCoords()\n\t{\n\t\t// $this->attributes contains payload of the session\n\t\t// $this->handler->get_table_row() contains extended Row's field like IP and Platform\n\t\t$row = $this->handler->get_table_row();\n\t\t$current_ip = PlatformDetector::getClientIp();\n\n\t\t// define the flag for new re-detection\n\t\t// if no coordinates is set\n\t\t$should_recheck_coords = !isset($this->attributes['geo_coords']);\n\t\t// or if IP address was changed\n\t\t$should_recheck_coords |= $row && $row['ip_address'] != $current_ip;\n\n\t\tif ($should_recheck_coords) {\n\t\t\t//Log::info('Recheck GEO coords for session');\n\t\t\t// we need to update geo coordinates\n\t\t\t$coords = GeoIPLib::get_lat_lon($current_ip);\n\t\t\t$this->attributes['geo_coords'] = [\n\t\t\t\t'latitude' => $coords[0],\n\t\t\t\t'longitude' => $coords[1],\n\t\t\t];\n\t\t}\n\n\t}", "private function setFacilityStatus(){\n\t\t$this->UpdateVisitors();\n\n\t\t/** Update Available Rooms */\n\t\t$this->UpdateAvailableRooms();\n\n\t}", "public function testUpdateExternalShipment()\n {\n }", "function get_all_vehicle_geofence($vehicle_id = null) {\n if (isset($vehicle_id)) {\n $this->db->where(\"vga.vehicle_id\", $vehicle_id);\n }\n $this->db->select(\"vga.id,plate_no,g.name,g.type,vga.status,date(vga.assign_date) as assign_date\"\n . \",date(vga.update_date) as update_date,\"\n . \"CONCAT(u.first_name,',',u.last_name) as assign_uid,\"\n . \",CONCAT(u2.first_name,',',u2.last_name) as update_uid,\"\n . \"in_alert,out_alert,sms_alert,email_alert\")\n ->from(\"vehicle_geofence_assignment vga\")\n ->join(\"vehicles v\", \"v.vehicle_id = vga.vehicle_id\", \"right\")\n ->join(\"users u\", \"u.user_id = vga.assign_uid\", \"left\")\n ->join(\"users u2\", \"u2.user_id = vga.update_uid\", \"left\")\n ->join(\"geofence g\", \"g.id = vga.geofence_id\", \"left\")\n ->where(\"vga.account_id\", $this->session->userdata(\"hawk_account_id\"))\n ->order_by(\"vga.status\", \"desc\");\n\n $query = $this->db->get();\n return $query->result();\n }", "public function testUpdateExternalShipmentCustomFields()\n {\n }", "function delete_vehicle_geofence_assignment($id) {\n $response = $this->db->delete('vehicle_geofence_assignment', array('id' => $id));\n if ($response) {\n return \"vehicle_geofence_assignment deleted successfully\";\n } else {\n return \"Error occuring while deleting vehicle_geofence_assignment\";\n }\n }", "function update(GeolocalisationEntity $geo) {\r\n $req = \"UPDATE geolocalisation SET lon ='\" . $geo->getLon() . \"', lat ='\" . $geo->getLat() . \"', idreclamation='\". $geo->getIdreclamation() .\"' WHERE id ='\" . $geo->getId() . \"'\";\r\n echo $req;\r\n mysql_query($req) or die(\"********** Erreur de mise à jour **********<br>\");\r\n echo \"********** Mise à jour avec succés **********<br>\";\r\n }", "public function fixSpatial()\n \t{\n \t}", "public function fixSpatial()\n \t{\n \t}", "public function fixSpatial()\r\n \t{\r\n \t}", "function update_rollingroad($data)\n\t{\n\t\tglobal $db, $rrid, $cid;\n\n\t\t$sql = \"UPDATE \". GARAGE_ROLLINGROAD_TABLE .\"\n\t\t\tSET dynocenter = '\".$data['dynocenter'].\"', bhp = '\".$data['bhp'].\"', bhp_unit = '\".$data['bhp_unit'].\"', torque = '\".$data['torque'].\"', torque_unit = '\".$data['torque_unit'].\"', boost = '\".$data['boost'].\"', boost_unit = '\".$data['boost_unit'].\"', nitrous = '\".$data['nitrous'].\"', peakpoint = '\".$data['peakpoint'].\"', pending = '\".$data['pending'].\"'\n\t\t\tWHERE id = '$rrid' and garage_id = '$cid'\";\n\t\tif(!$result = $db->sql_query($sql))\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could Not Update Rollingroad Data For Vehicle', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\treturn;\n\t}", "public function testUpdateVendorComplianceSurvey()\n {\n }", "public function update_car_ride() {\n $data = array(\n 'origin' => $this->input->post('origin'),\n 'destination' => $this->input->post('destination'),\n 'price' => $this->input->post('price'),\n 'vacancy' => $this->input->post('vacancy'),\n 'plate_number' => $this->input->post('plate_number'),\n 'start_time' => $this->input->post('start_time')\n );\n\n $sql = \"UPDATE car_rides\n SET origin = ?, destination = ?, price = ?, vacancy = ?\n WHERE plate_number = ?\n AND start_time = ?\";\n\n // return true if updated successfully\n return $this->db->query($sql, $data);\n }", "public function updated(Vehicle $vehicle)\n {\n //\n }", "function testUpdateFitness() {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "protected function updateLocations()\n {\n $this->execute(<<<SQL\nUPDATE jl_loc_location jll \n INNER JOIN jl_loc_region jlr ON jlr.id = jll.region_id\n SET jll.state_id = jlr.state_id;\nSQL\n );\n }", "public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }", "public function update(Request $request)\n {\n \t$request->validate([\n \t\t'code' => 'required',\n \t\t'name' => 'required',\n \t]);\n\n \t$ap = ApprovalPlot::find(Input::get('id'));\n \t$ap->code = Input::get('code');\n \t$ap->name = Input::get('name');\n \t$ap->lat = Input::get('lat');\n \t$ap->long = Input::get('long');\n \t$ap->location = Input::get('location');\n \t$ap->total_reserves = Input::get('total_reserves');\n \t$ap->mineralization_from = Input::get('mineralization_from');\n $ap->mineralization_to = Input::get('mineralization_to');\n $ap->water_chemical_composition = Input::get('water_chemical_composition');\n $ap->category_a = Input::get('category_a');\n \t$ap->category_b = Input::get('category_b');\n \t$ap->category_c = Input::get('category_c');\n $ap->birth_place_id = Input::get('bp_id');\n $ap->stock_a_authority = Input::get('stock_a_authority');\n \t$ap->approval_protocol = Input::get('approval_protocol');\n \t$ap->approval_date = Input::get('approval_date');\n \t$ap->water_volume = Input::get('water_volume');\n \t$ap->comment = Input::get('comment');\n \t$ap->is_approve = false;\n \t$ap->user_id = Auth::id();\n \t$ap->save();\n\n if ($request->type_water_uses) {\n DB::table('approval_plot_type_water_use')->where('approval_plot_id', $ap->id)->whereNotIn('type_water_use_id', $request->type_water_uses)->delete();\n foreach ($request->type_water_uses as $item) {\n DB::table('approval_plot_type_water_use')\n ->updateOrInsert(\n [\n 'approval_plot_id' => $ap->id,\n 'type_water_use_id' => $item\n ],\n [\n 'approval_plot_id' => $ap->id,\n 'type_water_use_id' => $item\n ]\n );\n }\n }\n\n ApprovalPlotAttr::where('approval_plots_id',Input::get('id'))->delete();\n \tif(Input::get('districts') != null || Input::get('regions') != null)\n \t{\n \t\tif(Input::get('districts') == null)\n \t\t{\n \t\t\tforeach (Input::get('regions') as $key=>$region)\n \t\t\t{\n \t\t\t\t$ap_attr = new ApprovalPlotAttr();\n \t\t\t\t$ap_attr->approval_plots_id = Input::get('id');\n \t\t\t\t$ap_attr->region_id = $region;\n \t\t\t\t$ap_attr->save();\n \t\t\t}\n \t\t}\n \t\telse\n \t\t{\n \t\t\tforeach (Input::get('districts') as $key=>$region)\n \t\t\t{\n \t\t\t\t$ap_attr = new ApprovalPlotAttr();\n \t\t\t\t$ap_attr->approval_plots_id = Input::get('id');\n \t\t\t\t$region_id = UzDistricts::select('regionid')->where('areaid','=',$region)->first();\n \t\t\t\t$ap_attr->region_id = $region_id->regionid;\n \t\t\t\t$ap_attr->district_id = $region;\n \t\t\t\t$ap_attr->save();\n \t\t\t}\n \t\t}\n\n \t}\n\n \t// return redirect(route('gg.reestr.ap.index'));\n return redirect()->back();\n\n }", "public function testUpdateSupplierGroup()\n {\n }", "private function calculateFence()\r\n {\r\n $this->fence = new Fence();\r\n $this->fence->calculateFenceItems($this->getCalculatedAreaModel());\r\n $this->fence->calculateFencePrice();\r\n }", "function refine_existing_data() {\n /* get all the data from the master table */\n $datas = RefineData::getMasterData();\n foreach ($datas as $data) {\n /* refine data from Google API and get the details */\n $add = geo2address($data->lat, $data->lang);\n /* update the address, district , state */\n if (!RefineData::updateDetails($data->id, json_encode($add))) {\n ScreenMessage::setMessage(\"Error Occured\", ScreenMessage::MESSAGE_TYPE_ERROR);\n }\n }\n ScreenMessage::setMessage(\"All is Well\", ScreenMessage::MESSAGE_TYPE_SUCCESS);\n}", "public function testProjectAssignmentsUpdateAvailability()\n {\n }", "public function updateStatusPartiallyAssigned() : bool\n {\n $this->status = self::STATUS_PARTIALLY_ASSIGNED;\n return $this->save();\n }", "function index_g_and_o_update(){\n\t\t$this->load->model('Da_evs_set_form_g_and_o','dsfg');\n\t\t$index_level = $this->input->post(\"index_level\"); // index level of G&O form\n\t\t$index_ranges = $this->input->post(\"index_ranges\"); // indeax range of G&O form\n\t\t$pos_id = $this->input->post(\"pos_id\"); //position id\n\t\t$year_id = $this->input->post(\"year_id\"); //year id\n\t\t\n\t\t$this->dsfg->sfg_pay_id = $year_id;\n\t\t$this->dsfg->sfg_index_level = $index_level;\n\t\t$this->dsfg->sfg_index_ranges = $index_ranges;\n\t\t$this->dsfg->sfg_pos_id = $pos_id;\n\t\t$this->dsfg->update();\n\n\t}", "public function update(Vehicle $vehicle,Request $request)\n {\n $this->validate($request,[\n 'registration' => 'required',\n 'make' => 'required',\n 'model' => 'required',\n 'year' => 'required',\n 'capacity'=>'required|numeric'\n ]);\n $registration=strToUpper($request['registration']);\n $vehicle->registration=$registration;\n $vehicle->make=$request['make'];\n $vehicle->model=$request['model'];\n $vehicle->year=$request['year'];\n $vehicle->capacity=$request['capacity'];\n $vehicle->edited_by=auth()->id();\n $vehicle->save();\n\n session()->flash('message','Vehicle edit successfully');\n return view('customers.vehicles.index',['customer'=>$vehicle->customer]);\n\n }" ]
[ "0.67844564", "0.547341", "0.5471063", "0.53886133", "0.52800906", "0.52572995", "0.5181716", "0.5072404", "0.50360197", "0.50171363", "0.4978722", "0.4978353", "0.49743152", "0.49743152", "0.4953974", "0.48693395", "0.4859785", "0.48082832", "0.47805163", "0.47803462", "0.47131845", "0.468979", "0.46567997", "0.46422383", "0.4638826", "0.46078968", "0.46035102", "0.45820126", "0.4581091", "0.45683843" ]
0.7104693
0
/ function to delete vehicle_geofence_assignment
function delete_vehicle_geofence_assignment($id) { $response = $this->db->delete('vehicle_geofence_assignment', array('id' => $id)); if ($response) { return "vehicle_geofence_assignment deleted successfully"; } else { return "Error occuring while deleting vehicle_geofence_assignment"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete() {\n\t\t$this->assignment->delete();\n\t}", "function delete(){\n // Renumber resolutions\n $resolutions = resolution::getResolutions($this->committeeId, $this->topicId);\n foreach($resolutions as $resolution){\n if($resolution->resolutionNum <= $this->resolutionNum)\n continue;\n $resolution->resolutionNum--;\n $resolution->saveInfo();\n }\n // Delete subclauses\n foreach($this->preambulatory as $clause){\n $clause->delete();\n }\n foreach($this->operative as $clause){\n $clause->delete();\n }\n // Delete resolution\n mysql_query(\"DELETE FROM resolution_list WHERE id='$this->resolutionId'\") or die(mysql_error());\n }", "function delete() ;", "function delete() ;", "function deleteMileageForVehicle(int $id);", "public function testProjectAssignmentsUndelete()\n {\n }", "function sb_assignment_delete ($node) {\n\n db_query(\"DELETE FROM {eto_assignments}\n WHERE \" . $node->key_field . \" = %d AND \" . $node->target_field . \" = %d\",\n\t $node->uid, $node->selected_uid);\n\n}", "public function delete(){\n \n global $DB;\n \n // Mark the structure as deleted\n $obj = new \\stdClass();\n $obj->id = $this->id;\n $obj->deleted = 1;\n $obj->assessments = 0;\n $DB->update_record(\"bcgt_crit_award_structures\", $obj);\n \n // BCTODO - Also need to then reset award of any criteria that were using this structure\n $criterias = $DB->get_records(\"bcgt_criteria\", array(\"gradingstructureid\" => $this->id));\n foreach ($criterias as $criteria) {\n $criteria->gradingstructureid = 0;\n $DB->update_record(\"bcgt_criteria\", $criteria);\n }\n \n return true;\n \n }", "public function destroy(Vehicle $vehicle)\n {\n //\n }", "public function delete()\n\t{\n\t\t$transaction = $this->dbConnection->beginTransaction();\n\t\ttry {\n\t\t\tforeach ($this->previnterventions as $prev) {\n\t\t\t\t$prev->delete();\n\t\t\t}\n\t\t\tforeach ($this->relevantinterventions as $relv) {\n\t\t\t\t$relv->delete();\n\t\t\t}\n\t\t\tforeach ($this->deviationreasons as $devr) {\n\t\t\t\t$devr->delete();\n\t\t\t}\n\t\t\tforeach ($this->filecollection_assignments as $fca) {\n\t\t\t\t$fca->delete();\n\t\t\t}\n\t\t\tif (parent::delete()) {\n\t\t\t\t$transaction->commit();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Exception('unable to delete');\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$transaction->rollback();\n\t\t\tthrow $e;\n\t\t}\n\n\t}", "public function delete($metricaevotranspiracion);", "function gaMatch_delete($appGlobals) {\n // $appGlobals->gb_sql->sql_transaction_start ($appGlobals);\n $this->gag_updateGameTotals($appGlobals,-1);\n $this->gag_updateKidPeriodTotals($appGlobals,-1);\n $query = \"DELETE FROM `gp:games` WHERE `gpGa:@GameId` ='{$this->game_atGameId}'\";\n $result = $appGlobals->gb_db->rc_query($query, __FILE__, __LINE__ );\n if ($result == FALSE) {\n $appGlobals->gb_sql->sql_fatalError( __FILE__,__LINE__);\n }\n //$appGlobals->gb_sql->sql_transaction_end ($appGlobals);\n}", "public function deleting(assignment $assignment)\n {\n //code...\n }", "function delete(){\n // Delete subclauses\n foreach($this->subClause as $clause){\n $clause->delete();\n }\n \n mysql_query(\"DELETE FROM resolution WHERE id='$this->clauseId'\") or die(mysql_error());\n }", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "function delete() {\n\t \t$sql = \"DELETE FROM evs_database.evs_key_component\n\t \t\t\tWHERE kcp_id=?\";\n\t \t$this->db->query($sql, array($this->kcp_id));\n\t\t\n\t }", "public function deleted(Vehicle $vehicle)\n {\n //\n }", "public function deleteRoomAssignment($input)\n\t{\n\t\tDB::table('planning_room')\n\t\t\t->where('room_id','=',$input['room_id'])\n\t\t\t->where('planning_id', '=', $this->id)\n\t\t\t->where('weekday', '=', $input['weekday'])\n\t\t\t->where('start_time','=', $input['start_time'])\n\t\t\t->delete();\n\t}", "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "public function forceDeleted(Vehicle $vehicle)\n {\n //\n }", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();" ]
[ "0.6305839", "0.58737594", "0.58670783", "0.58670783", "0.5857505", "0.5848575", "0.58225924", "0.5804214", "0.57480526", "0.5734508", "0.5708458", "0.57063586", "0.5705181", "0.57026464", "0.5636021", "0.56256634", "0.5618755", "0.5596669", "0.5584243", "0.5583029", "0.5568349", "0.5568349", "0.5568349", "0.5568349", "0.5568349", "0.5568349", "0.5568349", "0.5568349", "0.5568349", "0.5568349" ]
0.7569554
0
[wkauto_auctionbids_insertbids inserts automatic bids]
public function wkauto_auctionbids_insertbids($data,$user){ $date = new DateTime('2014-06-1', new DateTimeZone($this->config->get('wkproduct_auction_timezone_set'))); $zone = $date->format('P'); $query = "SELECT CONVERT_TZ(NOW(), @@session.time_zone, '$zone') as time;"; $data_time = $this->db->query($query)->row; $time = date("Y-m-d H:i:s", strtotime($data_time['time'])); $userExist = $this->db->query("SELECT user_id,product_id FROM ".DB_PREFIX."wk_automatic_auctionbids WHERE user_id = '".$data['user']."' AND product_id='".$data['product_id']."' AND winner = 0 " )->row; $sql=$this->db->query("SELECT MAX(wab.user_bid) id,wa.min,wa.max,wa.product_id FROM " . DB_PREFIX . "wkauction wa LEFT JOIN ". DB_PREFIX . "wk_automatic_auctionbids wab ON (wa.id=wab.auction_id) WHERE wa.id = '" . (int)$data['auction'] . "' AND wab.winner = 0 AND wab.start_date<='".$time."' AND wab.end_date>='".$time."' ")->row; $normal_max_bid=$this->db->query("SELECT MAX(wab.user_bid) id,wa.min,wa.max,wa.product_id FROM " . DB_PREFIX . "wkauction wa LEFT JOIN ". DB_PREFIX . "wkauctionbids wab ON (wa.id=wab.auction_id) WHERE wa.id = '" . (int)$data['auction'] . "' AND wab.winner = 0 AND wab.start_date<='".$time."' AND wab.end_date>='".$time."' ")->row; $range = $this->db->query("SELECT min,max FROM ".DB_PREFIX."wkauction WHERE id='".$data['auction']."' ")->row; if($data['amount']>=$range['max'] || $data['amount']<=$range['min']){ return 'not done'; } if(isset($normal_max_bid['product_id'])){ if(count($normal_max_bid)!=0 && $data['amount']<=$normal_max_bid['id']){ return 'not_min_auction'; //only for checking not messages } } if(isset($sql['product_id'])){ if(count($sql)!=0 && $data['amount']<=$sql['id']){ return 'not'; //only for checking not messages } } if($userExist) { $sql = "UPDATE " . DB_PREFIX . "wk_automatic_auctionbids SET winner='0',sold='0',auction_id = '" . (int)$data['auction']. "', user_id = '" .(int)$user."', product_id = '" .(int)$data['product_id']."', start_date = '" .$this->db->escape($data['start_date']). "', end_date = '" .$this->db->escape($data['end_date'])."', date = '".$time."', user_bid = '" .(double)$data['amount']."' WHERE user_id = '".$userExist['user_id']."' AND product_id = '".$userExist['product_id']."' AND winner = 0 "; $query=$this->db->query($sql); }else{ $sql = "INSERT INTO " . DB_PREFIX . "wk_automatic_auctionbids SET winner='0',sold='0',auction_id = '" . (int)$data['auction']. "', user_id = '" .(int)$user."', product_id = '" .(int)$data['product_id']."', start_date = '" .$this->db->escape($data['start_date']). "', end_date = '" .$this->db->escape($data['end_date'])."', date = '".$time."', user_bid = '" .(double)$data['amount']."'"; $query=$this->db->query($sql); } return 'done'; //only for checking not mesaages }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addBid($itemid, $buserid, $bidamount)\n {\n $itemid = mysql_real_escape_string( $itemid);\n $buserid = mysql_real_escape_string( $buserid);\n $biddate = date('Y-m-d');\n $bidtime = time('H:i:s');\n $bidamount = mysql_real_escape_string($bidamount);\n $sql=\"INSERT INTO bid VALUES( $itemid, $buserid,$biddate, $bidtime, $bidamount)\";\n $result=mysql_query($sql);\n return $result;\n \n }", "public function testBids()\n {\n $this->settingsRepo->store('bids.allow_multiple_bids', true);\n $this->settingsRepo->store('bids.disable_flight_on_bid', false);\n\n $user = factory(User::class)->create();\n $user2 = factory(User::class)->create();\n $headers = $this->headers($user);\n\n $flight = $this->addFlight($user);\n\n $bid = $this->flightSvc->addBid($flight, $user);\n $this->assertEquals($user->id, $bid->user_id);\n $this->assertEquals($flight->id, $bid->flight_id);\n $this->assertTrue($flight->has_bid);\n\n // Refresh\n $flight = Flight::find($flight->id);\n $this->assertTrue($flight->has_bid);\n\n // Check the table and make sure the entry is there\n $bid_retrieved = $this->flightSvc->addBid($flight, $user);\n $this->assertEquals($bid->id, $bid_retrieved->id);\n\n $user->refresh();\n $bids = $user->bids;\n $this->assertEquals(1, $bids->count());\n\n // Query the API and see that the user has the bids\n // And pull the flight details for the user/bids\n $req = $this->get('/api/user', $headers);\n $req->assertStatus(200);\n\n $body = $req->json()['data'];\n $this->assertCount(1, $body['bids']);\n $this->assertEquals($flight->id, $body['bids'][0]['flight_id']);\n\n $req = $this->get('/api/users/'.$user->id.'/bids', $headers);\n\n $body = $req->json()['data'];\n $req->assertStatus(200);\n $this->assertEquals($flight->id, $body[0]['flight_id']);\n\n // have a second user bid on it\n $bid_user2 = $this->flightSvc->addBid($flight, $user2);\n $this->assertNotNull($bid_user2);\n $this->assertNotEquals($bid_retrieved->id, $bid_user2->id);\n\n // Now remove the flight and check API\n\n $this->flightSvc->removeBid($flight, $user);\n\n $flight = Flight::find($flight->id);\n\n // user2 still has a bid on it\n $this->assertTrue($flight->has_bid);\n\n // Remove it from 2nd user\n $this->flightSvc->removeBid($flight, $user2);\n $flight->refresh();\n $this->assertFalse($flight->has_bid);\n\n $user->refresh();\n $bids = $user->bids()->get();\n $this->assertTrue($bids->isEmpty());\n\n $req = $this->get('/api/user', $headers);\n $req->assertStatus(200);\n\n $body = $req->json()['data'];\n $this->assertEquals($user->id, $body['id']);\n $this->assertCount(0, $body['bids']);\n\n $req = $this->get('/api/users/'.$user->id.'/bids', $headers);\n $req->assertStatus(200);\n $body = $req->json()['data'];\n\n $this->assertCount(0, $body);\n }", "function bid($data = array(), $autobid = false, $bid_description = null) {\r\n\t\t\t\t\t$canBid = true;\r\n\t\t\t\t\t$message = '';\r\n\t\t\t\t\t$flash = '';\r\n\r\n\t\t\t\t\t// Get the auctions\r\n\t\t\t\t\t$this->contain();\r\n\t\t\t\t\t$fieldList = array('Auction.id', 'Auction.product_id', 'Auction.start_time', 'Auction.end_time', 'Auction.price', 'Auction.peak_only', 'Auction.closed', 'Auction.minimum_price', 'Auction.autobids', 'Auction.max_end', 'Auction.max_end_time', 'Auction.penny');\r\n\r\n\t\t\t\t\t$auction = $this->find('first', array('conditions' => array('Auction.id' => $data['auction_id']), 'fields' => $fieldList));\r\n\r\n\t\t\t\t\tif(!empty($auction)){\r\n\t\t\t\t\t\t// check to see if this is a free auction\r\n\t\t\t\t\t\tif(!empty($this->appConfigurations['freeAuctions'])) {\r\n\t\t\t\t\t\t\t$product = $this->Product->find('first', array('conditions' => array('Product.id' => $auction['Auction']['product_id']), 'fields' => 'Product.free', 'contain' => ''));\r\n\t\t\t\t\t\t\tif(!empty($product['Product']['free'])) {\r\n\t\t\t\t\t\t\t\t$data['bid_debit'] = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(!empty($this->appConfigurations['limits']['active'])) {\r\n\t\t\t\t\t\t\t$limits_exceeded = $this->requestAction('/limits/canbid/'.$data['auction_id'].'/'.$data['user_id']);\r\n\t\t\t\t\t\t\tif($limits_exceeded == false) {\r\n\t\t\t\t\t\t\t\t$message = __('You cannot bid on this auction as your have exceeded your bidding limit.', true);\r\n\t\t\t\t\t\t\t\t$canBid = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Check if the auction has been end - this only applies to NON autobidders\r\n\t\t\t\t\t\tif((!empty($auction['Auction']['closed']) || strtotime($auction['Auction']['end_time']) <= time()) && $autobid == false) {\r\n\t\t\t\t\t\t\t$message = __('Auction has been closed', true);\r\n\t\t\t\t\t\t\t$canBid = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Check if the auction has been not started yet\r\n\t\t\t\t\t\tif(!empty($auction['Auction']['start_time'])) {\r\n\t\t\t\t\t\t\tif(strtotime($auction['Auction']['start_time']) > time()){\r\n\t\t\t\t\t\t\t\t$message = __('Auction has not started yet', true);\r\n\t\t\t\t\t\t\t\t$canBid = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Check if the auction is peak only and if the now is peak time\r\n\t\t\t\t\t\tif(!empty($auction['Auction']['peak_only'])){\r\n\t\t\t\t\t\t\tif(empty($data['isPeakNow'])){\r\n\t\t\t\t\t\t\t\t$message = __('This is a peak auction', true);\r\n\t\t\t\t\t\t\t\t$canBid = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Get user balance\r\n\t\t\t\t\t\tif($autobid == true || $this->appConfigurations['bidButlerDeploy'] == 'group') {\r\n\t\t\t\t\t\t\t$balance = $data['bid_debit'];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$balance = $this->Bid->balance($data['user_id']);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// this goes last to prevent the double bid issues\r\n\t\t\t\t\t\t$latest_bid = $this->Bid->lastBid($data['auction_id']);\r\n\t\t\t\t\t\tif(!empty($latest_bid) && $latest_bid['user_id'] == $data['user_id']){\r\n\t\t\t\t\t\t\t$message = __('You cannot bid as you are already the highest bidder', true);\r\n\t\t\t\t\t\t\t$canBid = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif($canBid == true) {\r\n\t\t\t\t\t\t\t// Checking if user has enough bid to place\r\n\t\t\t\t\t\t\tif($balance >= $data['bid_debit']) {\r\n\r\n\t\t\t\t\t\t\t\t// Check if it's bidbutler call\r\n\t\t\t\t\t\t\t\tif(!empty($data['bid_butler'])) {\r\n\t\t\t\t\t\t\t\t\t// Find the bidbutler\r\n\t\t\t\t\t\t\t\t\t$this->Bidbutler->contain();\r\n\t\t\t\t\t\t\t\t\t$bidbutler = $this->Bidbutler->find('first', array('conditions' => array('Bidbutler.id' => $data['bid_butler'])));\r\n\r\n\t\t\t\t\t\t\t\t\t// If bidbutler found\r\n\t\t\t\t\t\t\t\t\tif(!empty($bidbutler)){\r\n\t\t\t\t\t\t\t\t\t\tif($bidbutler['Bidbutler']['bids'] >= $data['bid_debit']) {\r\n\t\t\t\t\t\t\t\t\t\t\t// Decrease the bid butler bids\r\n\t\t\t\t\t\t\t\t\t\t\t$bidbutler['Bidbutler']['bids'] -= $data['bid_debit'];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Save it\r\n\t\t\t\t\t\t\t\t\t\t\t$this->Bidbutler->save($bidbutler, false);\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t// Get out of here, the bids on bidbutler was empty\r\n\t\t\t\t\t\t\t\t\t\t\treturn $auction;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// Formatting auction time and price increment\r\n\t\t\t\t\t\t\t\tif(!empty($auction['Auction']['penny'])) {\r\n\t\t\t\t\t\t\t\t\t$auction['Auction']['price'] \t+= 0.01;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$auction['Auction']['price'] \t+= $data['price_increment'];\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t$auction['Auction']['end_time'] = date('Y-m-d H:i:s', strtotime($auction['Auction']['end_time']) + $data['time_increment']);\r\n\r\n\t\t\t\t\t\t\t\t// lets make sure the auction time is now less than now\r\n\t\t\t\t\t\t\t\tif(strtotime($auction['Auction']['end_time']) < time()) {\r\n\t\t\t\t\t\t\t\t\t$auction['Auction']['end_time'] = date('Y-m-d H:i:s', time() + $data['time_increment']);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// lets check the max end time to see if the end_time is greater than the max_end_time\r\n\t\t\t\t\t\t\t\tif(!empty($auction['Auction']['max_end'])) {\r\n\t\t\t\t\t\t\t\t\tif(strtotime($auction['Auction']['end_time']) > strtotime($auction['Auction']['max_end_time'])) {\r\n\t\t\t\t\t\t\t\t\t\t$auction['Auction']['end_time'] = $auction['Auction']['max_end_time'];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// lets extend the minimum price if its an auto bidder\r\n\t\t\t\t\t\t\t\tif($autobid == true) {\r\n\t\t\t\t\t\t\t\t\tif(!empty($auction['Auction']['penny'])) {\r\n\t\t\t\t\t\t\t\t\t\t$auction['Auction']['minimum_price'] += 0.01;\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$auction['Auction']['minimum_price'] += $data['price_increment'];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$auction['Auction']['autobids'] += 1;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$auction['Auction']['autobids'] = 0;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// Formatting user bid transaction\r\n\t\t\t\t\t\t\t\t$bid['Bid']['user_id'] \t = $data['user_id'];\r\n\t\t\t\t\t\t\t\t$bid['Bid']['auction_id'] = $auction['Auction']['id'];\r\n\t\t\t\t\t\t\t\t$bid['Bid']['credit'] = 0;\r\n\r\n\t\t\t\t\t\t\t\tif(!empty($data['bid_butler']) && Configure::read('App.bidButlerType') == 'advanced') {\r\n\t\t\t\t\t\t\t\t\t$bid['Bid']['debit'] = 0;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$bid['Bid']['debit'] = $data['bid_debit'];\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// Insert proper description, bid or bidbutler\r\n\t\t\t\t\t\t\t\tif(!empty($bid_description)) {\r\n\t\t\t\t\t\t\t\t\t$bid['Bid']['description'] = $bid_description;\r\n\t\t\t\t\t\t\t\t} elseif(!empty($data['bid_butler'])){\r\n\t\t\t\t\t\t\t\t\t$bid['Bid']['description'] = __('Bid Butler', true);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$bid['Bid']['description'] = __('Single Bid', true);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// lets check for double bids - 01/03/2008 - Michael - lets only include bids in this check due to error from group deploy for bid butlers\r\n\t\t\t\t\t\t\t\t$auction['Auction']['double_bids_check'] = false;\r\n\t\t\t\t\t\t\t\t$bid['Bid']['double_bids_check'] = true;\r\n\r\n\t\t\t\t\t\t\t\t// Saving bid\r\n\t\t\t\t\t\t\t\tif(is_array($data['user_id'])) {\r\n\t\t\t\t\t\t\t\t\tforeach($data['user_id'] as $user){\r\n\t\t\t\t\t\t\t\t\t\t// 2008-02-27 21:44:20 -- Maulana\r\n\t\t\t\t\t\t\t\t\t\t// Update the leader id, set the leader_id to\r\n\t\t\t\t\t\t\t\t\t\t// latest user_id in array Q\r\n\t\t\t\t\t\t\t\t\t\t$auction['Auction']['leader_id'] = $user;\r\n\t\t\t\t\t\t\t\t\t\t$this->save($auction);\r\n\r\n\t\t\t\t\t\t\t\t\t\t$bid['Bid']['user_id'] = $user;\r\n\t\t\t\t\t\t\t\t\t\t$this->Bid->create();\r\n\t\t\t\t\t\t\t\t\t\t$this->Bid->save($bid);\r\n\r\n\t\t\t\t\t\t\t\t\t\tif($this->appConfigurations['simpleBids'] == true) {\r\n\t\t\t\t\t\t\t\t\t\t\t$winner = $this->Winner->find('first', array('conditions' => array('Winner.id' => $data['user_id']), 'contain' => ''));\r\n\t\t\t\t\t\t\t\t\t\t\t$winner['Winner']['bid_balance'] -= $bid['Bid']['debit'];\r\n\t\t\t\t\t\t\t\t\t\t\t$winner['Winner']['modified'] = date('Y-m-d H:i:s');\r\n\t\t\t\t\t\t\t\t\t\t\t$this->Winner->save($winner);\r\n\t\t\t\t\t\t\t\t\t\t} elseif($autobid == true) {\r\n\t\t\t\t\t\t\t\t\t\t\t// 18/2/2009 - this has been added for \"grouped\" bids. We need to update the modified date for the autobidders\r\n\t\t\t\t\t\t\t\t\t\t\t$winner = $this->Winner->find('first', array('conditions' => array('Winner.id' => $data['user_id']), 'contain' => ''));\r\n\t\t\t\t\t\t\t\t\t\t\t$winner['Winner']['modified'] = date('Y-m-d H:i:s');\r\n\t\t\t\t\t\t\t\t\t\t\t$this->Winner->save($winner, false);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// 2008-02-27 21:44:20 -- Maulana\r\n\t\t\t\t\t\t\t\t\t// Update the leader id to $data['user_id']. since\r\n\t\t\t\t\t\t\t\t\t// it's not an array we can put it directly\r\n\t\t\t\t\t\t\t\t\t$auction['Auction']['leader_id'] = $data['user_id'];\r\n\r\n\t\t\t\t\t\t\t\t\t$this->Bid->create();\r\n\t\t\t\t\t\t\t\t\t$this->Bid->save($bid);\r\n\r\n\t\t\t\t\t\t\t\t\tif($this->appConfigurations['simpleBids'] == true) {\r\n\t\t\t\t\t\t\t\t\t\t$winner = $this->Winner->find('first', array('conditions' => array('Winner.id' => $data['user_id']), 'contain' => ''));\r\n\t\t\t\t\t\t\t\t\t\t$winner['Winner']['bid_balance'] -= $bid['Bid']['debit'];\r\n\t\t\t\t\t\t\t\t\t\t$winner['Winner']['modified'] = date('Y-m-d H:i:s');\r\n\t\t\t\t\t\t\t\t\t\t$this->Winner->save($winner, false);\r\n\t\t\t\t\t\t\t\t\t} elseif($autobid == true) {\r\n\t\t\t\t\t\t\t\t\t\t// 18/2/2009 - this has been added for \"grouped\" bids. We need to update the modified date for the autobidders\r\n\t\t\t\t\t\t\t\t\t\t$winner = $this->Winner->find('first', array('conditions' => array('Winner.id' => $data['user_id']), 'contain' => ''));\r\n\t\t\t\t\t\t\t\t\t\t$winner['Winner']['modified'] = date('Y-m-d H:i:s');\r\n\t\t\t\t\t\t\t\t\t\t$this->Winner->save($winner, false);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// Saving auction\r\n\t\t\t\t\t\t\t\t$this->save($auction);\r\n\r\n\t\t\t\t\t\t\t\t$message = __('Your bid was placed', true);\r\n\r\n\t\t\t\t\t\t\t\tif(!empty($this->appConfigurations['flashMessage'])) {\r\n\t\t\t\t\t\t\t\t\tApp::import('Helper', array('Number'));\r\n\t\t\t\t\t\t\t\t\t$number = new NumberHelper();\r\n\r\n\t\t\t\t\t\t\t\t\t// New flash message\r\n\t\t\t\t\t\t\t\t\tif(!empty($data['bid_butler'])){\r\n\t\t\t\t\t\t\t\t\t\tif(!empty($data['bid_butler_count'])){\r\n\t\t\t\t\t\t\t\t\t\t\t$flash = sprintf(__('%d Bid Butler + %s + %s seconds', true), $data['bid_butler_count'], $number->currency($data['price_increment'], $this->appConfigurations['currency']), $data['time_increment']);\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t$flash = sprintf(__('1 Bid Butler + %s + %s seconds', true), $number->currency($data['price_increment'], $this->appConfigurations['currency']), $data['time_increment']);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t$flash = sprintf(__('1 Single bid + %s + %s seconds', true), $number->currency($data['price_increment'], $this->appConfigurations['currency']), $data['time_increment']);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t$auction['Auction']['success'] = true;\r\n\t\t\t\t\t\t\t\t$auction['Bid']['description'] = $bid['Bid']['description'];\r\n\t\t\t\t\t\t\t\t$auction['Bid']['user_id'] = $bid['Bid']['user_id'];\r\n\r\n\t\t\t\t\t\t\t\t// lets add in the bid information for smartBids - we need this\r\n\t\t\t\t\t\t\t\t$result['Bid'] = $bid['Bid'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$message = __('You have no more bids in your account', true);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$result['Auction']['id'] = $auction['Auction']['id'];\r\n\t\t\t\t\t\t$result['Auction']['message'] = $message;\r\n\t\t\t\t\t\t$result['Auction']['element'] = 'auction_'.$auction['Auction']['id'];\r\n\r\n\t\t\t\t\t\tif(!empty($this->appConfigurations['flashMessage'])){\r\n\t\t\t\t\t\t\t$auction['Auction']['flash'] = $flash;\r\n\r\n\t\t\t\t\t\t\t$auctionMessage = $this->Message->findByAuctionId($auction['Auction']['id']);\r\n\t\t\t\t\t\t\t$auctionMessage['Message']['auction_id'] = $auction['Auction']['id'];\r\n\t\t\t\t\t\t\t$auctionMessage['Message']['message'] = $flash;\r\n\r\n\t\t\t\t\t\t\tif(empty($auctionMessage)){\r\n\t\t\t\t\t\t\t\t$this->Message->create();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$this->Message->save($auctionMessage);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// now lets refund any bid credits not used before returning the data IF advanced mode is on\r\n\t\t\t\t\t\tif($this->appConfigurations['bidButlerType'] == 'advanced') {\r\n\t\t\t\t\t\t\t$this->Bid->refundBidButlers($auction['Auction']['id'], $auction['Auction']['price']);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn $result;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function bookcrossing_reserve_bcid($js = 'ajax') {\n if ($js == 'ajax') {\n global $user;\n\n $bcids = db_select('bookcrossing_books', 'b')\n ->fields('b', array('bcid'))\n ->condition('owner', $user->uid, '=')\n ->condition('status', BOOKCROSSING_BOOK_STATUS_RESERVED, '=')\n ->execute()\n ->fetchCol();\n\n $num = count($bcids);\n if ($num == BOOKCROSSING_RESRVED_BCIDS) {\n return NULL;\n }\n\n $commands = array();\n $generate = BOOKCROSSING_RESRVED_BCIDS - $num;\n\n for ($i = 0; $i < $generate; $i++) {\n $bcid = bookcrossing_generate_bcid();\n db_insert('bookcrossing_books')\n ->fields(array(\n 'nid' => 0,\n 'status' => BOOKCROSSING_BOOK_STATUS_RESERVED,\n 'owner' => $user->uid,\n 'bcid' => $bcid,\n 'current_place' => 0,\n ))\n ->execute();\n\n\n\n $reserved_html = '<div class=\"bcid-container\" id=\"' . $bcid . '\">';\n $reserved_html .= l('<b>BCID:</b>' . $bcid, 'add-reserved-book/' . $bcid, array('html' => TRUE));\n $reserved_html .= '</div>';\n $commands[] = ajax_command_append('.reserved-bcids-container', $reserved_html);\n }\n\n //if ($num == BOOKCROSSING_RESRVED_BCIDS - 1) {\n $commands[] = ajax_command_remove('#reserve-bcid');\n //}\n\n $commands[] = ajax_command_remove('#reserve-bcid-description');\n\n ajax_deliver(array('#type' => $js, '#commands' => $commands));\n }\n}", "public function run()\n {\n DB::table('bids')->insert([\n [\n 'id_event' => '1',\n 'name' => 'Сергей',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '1',\n 'name' => 'Владимир',\n 'email' => '[email protected]',\n 'price' => '1000'\n ],[\n 'id_event' => '3',\n 'name' => 'Николай',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '3',\n 'name' => 'Василий',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '3',\n 'name' => 'Дмитрий',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '3',\n 'name' => 'Анатолий',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '3',\n 'name' => 'Андрей',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '3',\n 'name' => 'Сергей',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '3',\n 'name' => 'Сергей',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '3',\n 'name' => 'Сергей',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '1',\n 'name' => 'Сергей',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '3',\n 'name' => 'Сергей',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '2',\n 'name' => 'Сергей',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '3',\n 'name' => 'Сергей',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '1',\n 'name' => 'Сергей',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '3',\n 'name' => 'Сергей',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '3',\n 'name' => 'Сергей',\n 'email' => '[email protected]',\n 'price' => '200'\n ],[\n 'id_event' => '3',\n 'name' => 'Сергей',\n 'email' => '[email protected]',\n 'price' => '200'\n ]\n ]);\n }", "public function save($bid)\n {\n\n DB::beginTransaction();\n try {\n\n $bid['status'] = ((array_key_exists('status', $bid) && $bid['status'] == 'on') ? \\Config::get('constants.ACTIVE_STATUS') : \\Config::get('constants.INACTIVE_STATUS'));\n $this->bids->create($bid);\n\n DB::commit();\n\n } catch (DBTransactionException $e) {\n DB::rollback();\n throw new DBTransactionException();\n }\n }", "function AddBid(&$bid)\n\t{\n\t\t$bid->supplierId = $this->supplierId;\n\t\t$found = false;\n\t\tforeach($this->_bidList as $bid2)\n\t\t{\n\t\t\tif ($bid->bidId > 0 && $bid->bidId == $bid2->bidId)\n\t\t\t{\n\t\t\t\t$found = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!$found)\n\t\t{\n\t\t\t$this->_bidList[] = $bid;\n\t\t}\n\t}", "public function run()\n {\n DB::table('bidding')->insert([\n 'SellerName'=>'dwd',\n 'photo'=> 'wd',\n 'name'=> 'ds',\n 'startPrice'=> 12,\n 'noOfBid'=> 2,\n 'currentBid'=> 3,\n 'bidDeadline'=>'2015-2-1 01:02:03'\n ]);\n }", "function bid() {\n\t\t$vals = $this -> input -> post('vals');\n\t\t$hargas = $this -> input -> post('hargas');\n\t\t$merks = $this -> input -> post('merks');\n\t\t$NO_TENDER = $this -> input -> post('NO_TENDER');\n\t\t$NO_BATCH = $this -> input -> post('NO_BATCH');\n\n\t\t$this -> load -> model('ec_list_auction_itemize');\n\t\t$this -> load -> model('ec_auction_itemize_m');\n\n\t\t$auction = $this -> ec_list_auction_itemize -> get_detail_auction2($NO_TENDER, $NO_BATCH);\n\t\t// print_r($auction);\n\t\t//die;\n\t\t$dateserver = date(\"Y-m-d H:i:s\");\n\t\t$dateauction = date(\"Y-m-d H:i:s\", strtotime($auction['PENUTUPAN']));\n\t\t$dateauction2 = date(\"Y-m-d H:i:s\", strtotime($auction['PEMBUKAAN']));\n\t\t// $d1 = new DateTime($dateserver);\n\t\t// $d2 = new DateTime(strtotime($dateauction));\n\t\t// $d3 = new DateTime(strtotime($dateauction2));\n\t\t$d1 = strtotime($dateserver);\n\t\t$d2 = strtotime($dateauction);\n\t\t$d3 = strtotime($dateauction2);\n\n\t\t// echo $d1.\"<br>\";\n\t\t// echo $d2.\"<br>\";\n\t\t// echo $d3.\"<br>\";\n\n\n\t\t//batas waktu\n\t\t$data = \"\";\n\t\t$data0 = \"\";\n\t\tif ($d1 < $d2 && $d1 > $d3) {\n\t\t\tif(!empty($vals)){\n\t\t\t\t$newVals = explode(',',$vals);\n\t\t\t}\n\n\t\t\tif(!empty($hargas)){\n\t\t\t\t$newHargas = explode(',',$hargas);\n\t\t\t}\n\n\t\t\tif(!empty($merks)){\n\t\t\t\t$newMerks = explode(',',$merks);\n\t\t\t}\n\n\t\t\t// print_r($newVals);\n\t\t\t// print_r($newHargas);\n\t\t\t// echo $newVals[0];\n\t\t\t// echo $newVals[1];\n\t\t\t// echo count($vals);\n\t\t\t// die;\n\t\t\t\n\t\t\tif (strpos($vals, ',') != false) { //ada koma\n\t\t\t\tfor ($i=0; $i < count($newVals); $i++) {\n\t\t\t\t\tif($newHargas[$i]>0){\n\t\t\t\t\t\t$ambilQty = $this->ec_auction_itemize_m->getDetailVendor($this->session->userdata['USERID'], $newVals[$i], $NO_TENDER);\n\t\t\t\t\t\t$CURRENCY = $ambilQty[0]['CURRENCY'];\n\t\t\t\t\t\t$HARGA_BARANG = $newHargas[$i];\n\t\t\t\t\t\tif($CURRENCY == \"IDR\"){\n\t\t\t\t\t\t\t$KONVERSI = 1;\n\t\t\t\t\t\t\t$KEIDR = $HARGA_BARANG;\n\t\t\t\t\t\t\t$BM_HB = $KEIDR;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$checkCurr = $this->ec_auction_itemize_m->getCurrency($CURRENCY, 'IDR');\n\t\t\t\t\t\t\t$KONVERSI = $checkCurr[0]['KONVERSI'];\n\t\t\t\t\t\t\t$KEIDR = $HARGA_BARANG * $checkCurr[0]['KONVERSI'];\n\t\t\t\t\t\t\t$BEA_MASUK = $ambilQty[0]['BEA_MASUK'];\n\t\t\t\t\t\t\t$BM_HB = (($BEA_MASUK / 100) * $KEIDR) + $KEIDR;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//JIKA MERK KOSONG TIDAK UPDATE\n\t\t\t\t\t\tif($newMerks[$i]!=\"\"){\n\t\t\t\t\t\t\t//UPDATE DENGAN MERK YANG SAMA\n\t\t\t\t\t\t\t$where_edit['ID_PESERTA'] \t= $this -> session -> userdata['KODE_VENDOR'];\n\t\t\t\t\t\t\t$where_edit['ID_HEADER'] \t= $NO_TENDER;\n\t\t\t\t\t\t\t$where_edit['MERK'] \t\t= $newMerks[$i];\n\t\t\t\t\t\t\t$set_edit['HARGATERKINI'] \t= $newHargas[$i];\n\t\t\t\t\t\t\t$set_edit['KONVERSI_IDR_UBAH'] \t= $KEIDR;\n\t\t\t\t\t\t\t$set_edit['BM_HB'] \t\t\t= $BM_HB;\n\t\t\t\t\t\t\t$result \t\t\t\t\t= $this->ec_auction_itemize_m->updateItemPrice($set_edit, $where_edit);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$data = $this -> ec_list_auction_itemize -> bid($this -> session -> userdata['KODE_VENDOR'], $NO_TENDER, $newVals[$i], $newHargas[$i], $KEIDR, $BM_HB);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$data0 .= $newVals[$i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif($hargas>0){\n\t\t\t\t\t//print_r($newVals);\n\t\t\t\t\t$ambilQty = $this->ec_auction_itemize_m->getDetailVendor($this->session->userdata['USERID'], $vals, $NO_TENDER);\n\t\t\t\t\t//print_r($ambilQty);die;\n\t\t\t\t\t$CURRENCY = $ambilQty[0]['CURRENCY'];\n\t\t\t\t\t$HARGA_BARANG = $hargas;\n\t\t\t\t\tif($CURRENCY == \"IDR\"){\n\t\t\t\t\t\t$KONVERSI = 1;\n\t\t\t\t\t\t$KEIDR = $HARGA_BARANG;\n\t\t\t\t\t\t$BM_HB = $HARGA_BARANG;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$checkCurr = $this->ec_auction_itemize_m->getCurrency($CURRENCY, 'IDR');\n\t\t\t\t\t\t$KONVERSI = $checkCurr[0]['KONVERSI'];\n\t\t\t\t\t\t$KEIDR = $HARGA_BARANG * $checkCurr[0]['KONVERSI'];\n\t\t\t\t\t\t$BEA_MASUK = $ambilQty[0]['BEA_MASUK'];\n\t\t\t\t\t\t$BM_HB = (($BEA_MASUK / 100) * $KEIDR) + $KEIDR;\n\t\t\t\t\t}\n\n\t\t\t\t\t//JIKA MERK KOSONG TIDAK UPDATE\n\t\t\t\t\tif($merks!=\"\"){\n\t\t\t\t\t\t//UPDATE DENGAN MERK YANG SAMA\n\t\t\t\t\t\t$where_edit['ID_PESERTA'] \t= $this -> session -> userdata['KODE_VENDOR'];\n\t\t\t\t\t\t$where_edit['ID_HEADER'] \t= $NO_TENDER;\n\t\t\t\t\t\t$where_edit['MERK'] \t\t= $merks;\n\t\t\t\t\t\t$set_edit['HARGATERKINI'] \t= $hargas;\n\t\t\t\t\t\t$set_edit['KONVERSI_IDR_UBAH'] \t= $KEIDR;\n\t\t\t\t\t\t$set_edit['BM_HB'] \t\t\t= $BM_HB;\n\t\t\t\t\t\t$result \t\t\t\t\t= $this->ec_auction_itemize_m->updateItemPrice($set_edit, $where_edit);\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = $this -> ec_list_auction_itemize -> bid($this -> session -> userdata['KODE_VENDOR'], $NO_TENDER, $vals, $hargas, $KEIDR, $BM_HB);\n\t\t\t\t} else {\n\t\t\t\t\t$data0 .= $vals;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$result = array(\n\t\t\t\t'data' => $data,\n\t\t\t\t'data0' => $data0\n\t\t\t\t);\n\t\t\techo json_encode($result);\n\t\t} else {\n\t\t\t$result = array(\n\t\t\t\t'data' => $data,\n\t\t\t\t'data0' => $data0\n\t\t\t\t);\n\t\t\techo json_encode($result);\n\t\t}\n\t}", "public function addBid($auctionID, $userId, $bidPrice, $bidDate){\n\t\t$bidQuery = \"INSERT INTO `bids` (`auctionID`, `userId`, `bidPrice`, `bidDate`) VALUES ('$auctionID', '$userId', '$bidPrice', '$bidDate') ON DUPLICATE KEY UPDATE `bidDate` = '$bidDate', `bidPrice`='$bidPrice'\";\n\t\t//update auction bid count\n\t\t$updateQuery = \"UPDATE `auction` SET bids = bids+1 WHERE auctionID='$auctionID'\";\n\n\t\tif(mysqli_query($this->conn, $bidQuery) && mysqli_query($this->conn, $updateQuery)){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function autorelist($auction = array()) {\n\t$productSql = mysql_query(\"SELECT id FROM auctions WHERE deleted = 0 AND closed = 0 AND active = 1 AND product_id = \".$auction['product_id']);\n\tif(mysql_num_rows($productSql) == 0) {\n\t\t// check for a delayed start time\n\t\t$delayed_start = get('autolist_delay_time');\n\n\t\tif(!empty($delayed_start)) {\n\t\t\t$auction['start_time'] = date('Y-m-d H:i:s', time() + $delayed_start * 60);\n\t\t\t$auction['end_time'] = date('Y-m-d H:i:s', time() + (get('autolist_expire_time') + $delayed_start) * 60);\n\t\t} else {\n\t\t\t$auction['start_time'] = date('Y-m-d H:i:s');\n\t\t\t$auction['end_time'] = date('Y-m-d H:i:s', time() + get('autolist_expire_time') * 60);\n\t\t}\n\n\t\tif($auction['max_end_time'] < $auction['end_time']) {\n\t\t\t$auction['max_end_time'] = $auction['end_time'];\n\t\t}\n\n\t\t$product = mysql_fetch_array(mysql_query(\"SELECT start_price, minimum_price FROM products WHERE id = \".$auction['product_id']), MYSQL_ASSOC);\n\n\t\t$auction['price'] \t\t\t= $product['start_price'];\n\t\t$auction['minimum_price'] \t= $product['minimum_price'];\n\n\t\tmysql_query(\"INSERT INTO auctions (product_id, start_time, end_time, max_end, max_end_time, price, autolist, featured, peak_only, nail_bitter, penny, hidden_reserve, minimum_price, active, bid_debit, created, modified) VALUES ('\".$auction['product_id'].\"', '\".$auction['start_time'].\"', '\".$auction['end_time'].\"', '\".$auction['max_end'].\"', '\".$auction['max_end_time'].\"', '\".$auction['price'].\"', '\".$auction['autolist'].\"', '\".$auction['featured'].\"', '\".$auction['peak_only'].\"', '\".$auction['nail_bitter'].\"', '\".$auction['penny'].\"', '\".$auction['hidden_reserve'].\"', '\".$auction['minimum_price'].\"', '\".$auction['active'].\"', '\".$auction['bid_debit'].\"', '\".date('Y-m-d H:i:s').\"', '\".date('Y-m-d H:i:s').\"')\");\n\t}\n}", "public function testAddBidApi()\n {\n $this->user = factory(User::class)->create();\n $user2 = factory(User::class)->create();\n $flight = $this->addFlight($this->user);\n\n $uri = '/api/user/bids';\n $data = ['flight_id' => $flight->id];\n\n $body = $this->put($uri, $data);\n $body = $body->json('data');\n\n $this->assertEquals($body['flight_id'], $flight->id);\n\n // Now try to have the second user bid on it\n // Should return a 409 error\n $response = $this->put($uri, $data, [], $user2);\n $response->assertStatus(409);\n\n // Try now deleting the bid from the user\n $response = $this->delete($uri, $data);\n $body = $response->json('data');\n $this->assertCount(0, $body);\n }", "public function getAutoProductBids($product_id){\n\n\t\t$date = new DateTime('2014-06-1', new DateTimeZone($this->config->get('wkproduct_auction_timezone_set')));\n\t\t$zone = $date->format('P');\n\t\t$query = \"SELECT CONVERT_TZ(NOW(), @@session.time_zone, '$zone') as time;\";\n\t\t$data = $this->db->query($query)->row;\n\t\t$time = date(\"Y-m-d H:i:s\", strtotime($data['time']));\n\n\t $result = $this->db->query(\"SELECT wab.user_id,wab.user_bid,c.firstname,c.lastname FROM \".DB_PREFIX.\"wk_automatic_auctionbids wab LEFT JOIN \".DB_PREFIX.\"customer c ON wab.user_id=c.customer_id WHERE wab.product_id = '\".$product_id.\"' AND wab.start_date <= '\".$time.\"' AND wab.end_date >= '\".$time.\"' AND winner != 1 ORDER BY wab.user_bid DESC LIMIT 0,10\")->rows;\n\t \n\t return $result;\n\t}", "public static function fake_bid( $bid_id ) {\n global $wpdb;\n $auction_table = $wpdb->prefix.\"wauc_auction_log\";\n\n return $wpdb->update(\n $auction_table,\n array(\n 'is_fake' => 1,\n ),\n array( 'id' => $bid_id ),\n array(\n '%d',\t// value1\n ),\n array( '%d' )\n );\n }", "public function activatePending()\n {\n $mydate = date('Y-m-d H:i:s',strtotime(\"-36 hours\"));\n $sql = \"SELECT `bids`.* \n FROM `bids`\n JOIN `campaigns`\n ON `bids`.`campaign_id` = `campaigns`.`id`\n WHERE `campaigns`.`status` = ? \n AND `bids`.`status` = ?\n AND `bids`.`created_at` < ?;\";\n $result = DB::select($sql, array(1, 5, $mydate));\n if(sizeof($result)){\n Log::info(sizeof($result).' Pending Bids to Activate');\n foreach($result as $row){\n $sql = 'UPDATE `bids` SET `status` = ? WHERE `id` = ?';\n DB::update($sql, array(1, $row->id));\n //$info = 'Campaign '.$row->campaign_id.' Activated on Zone '.$row->zone_handle;\n //Log::info($info); \n }\n }else{\n Log::info('No Pending Bids to Activate.');\n }\n }", "function insertBlinks($links, $postID) {\n // update Existing Links table\n if (is_array($links) && count($links) > 0) {\n global $wpdb;\n $table_name = $wpdb->prefix . \"blink_links\";\n\n foreach ($links as $link) {\n $sql = \"INSERT INTO $table_name (link_uid, gid, pid, li_updated)\n VALUES ('\" . uniqid('l', true) . \"', \" . $link['gid'] . \", $postID, UNIX_TIMESTAMP(now()) )\";\n $wpdb->query($sql);\n }\n }\n }", "public function insert($gunBbl);", "function bidsAction()\r\n {\r\n $db = $this->zmax_context->db;\r\n $this->view->setFile(\"content\", \"bids.xml\");\r\n $this->view->set_block(\"content\", \"PAPER\", \"PAPERS\");\r\n $this->view->set_block(\"PAPER\", \"SECTION\", \"SECTIONS\");\r\n $this->view->set_block(\"content\", \"GROUPS_LINKS\", \"LINKS\");\r\n $this->view->set_var(\"size_rating\", Config::SIZE_RATING);\r\n\r\n // Initialize the current interval\r\n if (!isSet($_REQUEST['iMin'])) {\r\n $iMinCur = 1; $iMaxCur = Config::SIZE_RATING;\r\n }\r\n else {\r\n $iMinCur = $_REQUEST['iMin']; $iMaxCur = $_REQUEST['iMax'];\r\n }\r\n\r\n $this->view->set_var(\"IMIN_CUR\", $iMinCur);\r\n $this->view->set_var(\"IMAX_CUR\", $iMaxCur);\r\n\r\n // If rates have been submitted: insert/update in the DB\r\n if (isSet($_POST['rates'])) {\r\n foreach ($_POST['rates'] as $idPaper => $rate) {\r\n if ($rate != Config::UNKNOWN_RATING) {\r\n $this->user->addBid ($idPaper, $rate);\r\n }\r\n $this->view->message = $this->texts->reviewer->ack_rating;\r\n }\r\n }\r\n else {\r\n // Print the main message\r\n $this->view->message = $this->texts->reviewer->rating_message;\r\n }\r\n $this->view->assign (\"bids_message\", \"message\");\r\n \r\n // Get the list of ratings\r\n $rateLabels = $db->fetchPairs (\"SELECT * FROM RateLabel\");\r\n $rateLabels = array_merge (array(Config::UNKNOWN_RATING => \"?\"), $rateLabels);\r\n\r\n $form = new Formulaire ( \"POST\", \"RatePapers.php\");\r\n\r\n /* Select the papers */\r\n $paperTbl = new Paper();\r\n $papers = $paperTbl->fetchAll(\"1=1\", \"id\");\r\n\r\n $i = 0;\r\n foreach ($papers as $paper) {\r\n // Choose the CSS class\r\n $this->view->css_class = Config::CssClass($i++);\r\n\r\n // Only show the current group\r\n if ($iMinCur <= $i and $i <= $iMaxCur) {\r\n // Instantiate paper variables\r\n $paper->putInView($this->view);\r\n\r\n // Get the current bid\r\n $bid = $paper->getBid($this->user->id);\r\n \r\n // Show the selection list\r\n $this->view->list_bids = Zmax_View_Phplib::selectField (\"rates[$paper->id]\", $rateLabels,\r\n $bid);\r\n\r\n /* Instantiate the entities in PAPER_. Put the result in PAPERS */\r\n $this->view->append(\"PAPERS\", \"PAPER\");\r\n }\r\n if ($i > $iMaxCur) break;\r\n }\r\n\r\n // Create the groups\r\n $nbPapers = Config::countAllPapers();\r\n $nb_groups = $nbPapers / Config::SIZE_RATING + 1;\r\n for ($i=1; $i <= $nb_groups; $i++) {\r\n $iMin = (($i-1) * Config::SIZE_RATING) + 1;\r\n if ($iMin >= $iMinCur and $iMin <= $iMaxCur) {\r\n $link = \"<font color=red>$i</font>\";\r\n }\r\n else {\r\n $link =$i;\r\n }\r\n $this->view->LINK = $link;\r\n\r\n $this->view->IMIN_VALUE = $iMin;\r\n $this->view->IMAX_VALUE = $iMin + Config::SIZE_RATING -1;\r\n $this->view->append(\"LINKS\", \"GROUPS_LINKS\");\r\n }\r\n\r\n echo $this->view->render(\"layout\");\r\n }", "public function bids()\n {\n return $this->hasMany('App\\Bidding', 'id_bid', 'id');\n }", "function setOwnBid($dbh, $id, $bod, $voorwerp)\n{\n $bodbedrag = $bod;\n $gebruiker = $_SESSION['username'];\n $bodtijd = getServerTime($dbh);\n\n if ($bodbedrag > insertMinBid($dbh, $id)) {\n try {\n $sql = \"INSERT INTO Bod(voorwerp, bodbedrag, gebruiker, bodtijd) VALUES(?,?,?,?)\"; /* prepared statement */\n $query = $dbh->prepare($sql);\n $query->execute(array($voorwerp, $bodbedrag, $gebruiker, $bodtijd));\n } catch (PDOException $e) {\n echo \"Fout\" . $e->getMessage();\n header('Location: ../errorpage.php?err=500');\n }\n } else {\n echo \"Het bedrag is te weinig! Vul een groter bedrag in.\";\n }\n\n}", "function insertProjectBid($user_id,$userData,$userFile)\n\t\t{\n\t\t\t//checking that project is open or not\n\t\t\t$project_values = $this->manageContent->getValue_where(\"project_info\",\"*\",\"project_id\",$userData['pid']);\n\t\t\tif(empty($project_values[0]['award_bid_id']) && time() <= strtotime($project_values[0]['ending_date'].' 23:59:59'))\n\t\t\t{\n\t\t\t\t//checking that is bids is remaining\n\t\t\t\t$bids_left = $this->manageContent->getLastValue_where('user_bid_details', '*', 'user_id', $user_id, 'id');\n\t\t\t\tif($bids_left[0]['bids_remaining'] > 0)\n\t\t\t\t{\n\t\t\t\t\t//getting user info\n\t\t\t\t\t$userInfo = $this->manageContent->getValue_where(\"user_info\",\"*\",\"user_id\",$user_id);\n\t\t\t\t\tif(!empty($userInfo[0]))\n\t\t\t\t\t{\n\t\t\t\t\t\t//create bid id\n\t\t\t\t\t\t$bid_id = uniqid('bid');\n\t\t\t\t\t\t//uploading bid attachement file\n\t\t\t\t\t\tif(!empty($userFile['file']['name']) && !empty($userFile['file']['size']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$original_file = $userFile['file']['name'];\n\t\t\t\t\t\t\t//get unix timestamp\n\t\t\t\t\t\t\t$unixTimeStamp = time();\n\t\t\t\t\t\t\t//image desired name\n\t\t\t\t\t\t\t$bid_file_name = md5($bid_id.$unixTimeStamp);\n\t\t\t\t\t\t\t$bid_pic = $this->manageFileUploader->upload_document_file($bid_file_name,$userFile['file'],'../files/project/');\n\t\t\t\t\t\t\t$bid_file = 'files/project/'.$bid_pic;\t\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$original_file = '';\n\t\t\t\t\t\t\t$bid_file = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//get bid amount and currency\n\t\t\t\t\t\t$bid_amount = intval($userData['bid_price']);\n\t\t\t\t\t\t$currency = '$';\n\t\t\t\t\t\t//getting date, time, ip of bid post\n\t\t\t\t\t\t$curDate = $this->getCurrentDate();\n\t\t\t\t\t\t$curTime = $this->getCurrentTime();\n\t\t\t\t\t\t$ip = $this->manageUtility->getIpAddress();\n\t\t\t\t\t\t//setting status = 1\n\t\t\t\t\t\t$status = 1;\n\t\t\t\t\t\t//inserting the value to table\n\t\t\t\t\t\t$column_name = array(\"bid_id\",\"project_id\",\"user_id\",\"description\",\"original_file\",\"file\",\"currency\",\"amount\",\"time_range\",\"date\",\"time\",\"ip\",\"status\");\n\t\t\t\t\t\t$column_value = array($bid_id,$userData['pid'],$user_id,$userData['bid_pro'],$original_file,$bid_file,$currency,$bid_amount,$userData['time_range'],$curDate,$curTime,$ip,$status);\n\t\t\t\t\t\t$insert = $this->manageContent->insertValue(\"bid_info\",$column_name,$column_value);\n\t\t\t\t\t\t//increasing total no of bids in project info table\n\t\t\t\t\t\tif($insert == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//increment the value by 1\n\t\t\t\t\t\t\t$increamentValue = $this->manageContent->increamentValue(\"project_info\",\"total_bids\",1,\"project_id\",$userData['pid']);\n\t\t\t\t\t\t\t//for decrement remaining bids number after a bid\n\t\t\t\t\t\t\t$remaining_bids = $bids_left[0]['bids_remaining'] - 1;\n\t\t\t\t\t\t\t$update_bids = $this->manageContent->updateValueMultipleCondition('user_bid_details', 'bids_remaining', $remaining_bids, array('user_id', 'status'), array($user_id, 1));\n\t\t\t\t\t\t\t//get user details\n\t\t\t\t\t\t\t$userDetails = $this->getEmailIdFromUserId($user_id);\n\t\t\t\t\t\t\t//mail to the contractor\n\t\t\t\t\t\t\t$this->mailSent->mailAfterBidding($userDetails[0],$userDetails[1],$project_values[0]['title']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $insert;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 'You Have To Fill Up Your Personal Information, Then Only You Are Eligible To Place A Bid!!';\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\treturn 'You have no bids left';\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 'Job Is Closed. You Can Not Place Bid!!';\n\t\t\t}\n\t\t\t\n\t\t}", "public function run()\n {\n $auctions = \\App\\Models\\Auction::all();\n $user_ids = collect([['id' => 1], ['id' => 2], ['id' => 4], ['id' => 5]]);\n\n $auctions->map(function ($item) use ($user_ids) {\n for ($k = 0; $k < rand(1, 10); ++$k) {\n \\App\\Models\\AuctionBid::create([\n 'auction_id' => $item->id,\n 'user_id' => $user_ids->where('id', '!=', $item->user_id)->random()['id'],\n 'value' => rand($item->minimal_step, $item->input_bid)\n ]);\n }\n });\n }", "public function insert_new_characters_in_database($bounties_array){\n\t Global $wpdb;\n\t $sso = new Top_Ratter_SSO ();\n\t $unique_char_id=array();\n\t foreach($bounties_array as $bounty){\n\t if (in_array ( $bounty ['second_party_id'], $unique_char_id )) {\n\t }else{\n\t //add to array\n\t $unique_char_id[]=$bounty ['second_party_id'];\n\t }\n\t }\n\t \n\t //select all characters from database\n\t $sql = \"SELECT `owner_id` FROM `\" . $wpdb->prefix . \"tr_characters`\";\n\t $existing_chars = $wpdb->get_results(\"$sql\",ARRAY_A);\n\t if($existing_chars){\n\t //filter out those that is not in database\n\t foreach($existing_chars as $char){\n\t if (in_array ( $char['owner_id'], $unique_char_id )) {\n\t if (($key = array_search($char['owner_id'], $unique_char_id)) !== false) {\n\t unset($unique_char_id[$key]);\n\t }\n\t }\n\t }\n\t \n\t if($unique_char_id){\n\t $new_character_data=$sso->owner_ids_to_names($unique_char_id);\n\t }\n\t }else{\n\t if($unique_char_id)\n\t $new_character_data=$sso->owner_ids_to_names($unique_char_id);\n\t }\n\t \n\t if($new_character_data){\n\t // insert in the database\n\t $sql=\"INSERT INTO `\" . $wpdb->prefix . \"tr_characters`(`owner_id`, `ownerName2`) VALUES\";\n\t $count=count($new_character_data);\n\t $i=1;\n\t foreach($new_character_data as $record){\n\t $sql.='(\"'.$record['character_id'].'\",\"'.$record['character_name'].'\")';\n\t \n\t if($i==$count){\n\t $sql.='';\n\t }else{\n\t $sql.=',';\n\t }\n\t $i++;\n\t }\n\t $sql.=';';\n\t \n\t $wpdb->query($sql);\n\t }\n\t}", "public function addBudgetHeads() {\n\t\tglobal $REQUEST_DATA;\n\n\t\treturn SystemDatabaseManager::getInstance()->runAutoInsert('budget_heads', \n array('headName','headAmount','headTypeId'), \n array(trim($REQUEST_DATA['headName']),trim($REQUEST_DATA['headAmount']),trim($REQUEST_DATA['headTypeId'])) \n );\n\t}", "public function insertAuction(){\n\n\n if(!empty($this->auctionFields) && !empty($this->auctionDetailFields)){\n $this->db->trans_start();\n\n $this->db->insert($this->table, $this->auctionFields);\n $insert_id = $this->db->insert_id();\n //echo \"<br><br>\" . $this->db->last_query() . \"<br><br>\";\n\n $this->auctionDetailFields['auction_id'] = $insert_id;\n $this->db->insert($this->table2, $this->auctionDetailFields);\n //echo \"<br><br>\" . $this->db->last_query() . \"<br><br>\";\n\n if(!empty($this->auctionAttributeFields)){\n foreach ($this->auctionAttributeFields as $key => $auctionAttributeField) {\n $this->auctionAttributeFields[$key]['auction_id'] = $this->auctionDetailFields['auction_id'];\n }\n $this->db->insert_batch($this->table3,$this->auctionAttributeFields);\n // echo \"<br><br>\" . $this->db->last_query() . \"<br><br>\";\n }\n $this->db->trans_complete();\n\n $data = $this->get([\"id\"=> $insert_id]);\n\n // print_r($data); exit();\n\n return $data;\n }\n\n return FALSE;\n }", "public function getAllSuccessfulBids() { \n $sql = \"select * from bid where status='S' order by code asc, userid asc;\";\n \n $connMgr = new ConnectionManager();\n $conn = $connMgr->getConnection();\n \n $stmt = $conn->prepare($sql);\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $stmt->execute();\n \n $result = [];\n \n while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n \n $result[] = new Bid($row['userid'], $row['amount'], $row['code'],$row['section'],$row['status'], $row['round']);\n }\n\n $stmt = null;\n $conn = null; \n return $result;\n\n }", "public function run()\n {\n for ($i = 1; $i < 19; $i++)\n DB::table('promotion_banners')->insert([\n 'promotion_id' => rand(1, 15),\n 'banner_id' => $i,\n ]);\n }", "public function __construct(array $bids = [], array $asks = [])\n {\n $this->bids = $bids;\n $this->asks = $asks;\n }", "function drop_bid ($BidId, $EventId)\n{\n // If the EventId is 0, we don't have to do anything more\n\n if (0 == $EventId)\n return true;\n\n // Fetch the Event information and use it to update the bid\n\n $sql = \"SELECT * From Events WHERE EventId=$EventId\";\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Query failed for EventId $EventId\");\n\n if (0 == mysql_num_rows ($result))\n return display_error (\"Failed to find EventId $EventId\");\n\n if (1 != mysql_num_rows ($result))\n return display_error (\"Found multiple entries for EventId $EventId\");\n\n $row = mysql_fetch_array ($result, MYSQL_ASSOC);\n\n // Copy the information into the $_POST array so that build_sql_string\n // will find it\n\n foreach ($row as $key => $value)\n {\n if (1 == get_magic_quotes_gpc())\n $_POST[$key] = mysql_real_escape_string ($value);\n else\n $_POST[$key] = $value;\n }\n\n // Build the string to update the game information in the bid\n\n $sql = 'UPDATE Bids SET ';\n\n $sql .= build_sql_string ('Title', $Title, false);\n $sql .= build_sql_string ('Author');\n $sql .= build_sql_string ('Homepage');\n $sql .= build_sql_string ('GameEMail');\n $sql .= build_sql_string ('Organization');\n\n $sql .= build_sql_string ('MinPlayersNeutral');\n $sql .= build_sql_string ('MaxPlayersNeutral');\n $sql .= build_sql_string ('PrefPlayersNeutral');\n\n $sql .= build_sql_string ('Hours');\n $sql .= build_sql_string ('CanPlayConcurrently');\n $sql .= build_sql_string ('Description');\n// printf (\" <td><A NAME=BidStatus%d>$title</A></td>\\n\", $row->BidStatusId);\n\n $sql .= build_sql_string ('ShortBlurb');\n $sql .= build_sql_string ('UpdatedById', $_SESSION['SESSION_LOGIN_USER_ID']);\n\n $sql .= ', EventId=0';\n\n $sql .= \" WHERE BidId=$BidId\";\n\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Update of Bids failed\");\n\n // Now remove the entry from the Events table\n\n $sql = \"DELETE FROM Events WHERE EventId=$EventId\";\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Deletion from Events failed for $EventId\");\n\n // And remove any GMs for that game\n\n $sql = \"DELETE FROM GMs WHERE EventId=$EventId and \";\n $sql .= \"(Role=\\\"teacher\\\" or Role=\\\"moderator\\\" or Role=\\\"panelist\\\")\";\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Deletion from GMs failed for Event $EventId\");\n\n return TRUE;\n}", "function bidItem($conn,$userID){\n\t$itemID = $_POST['itemID'];\n\t\n\t$sql_checktype = \"select auctiontype from Items where itemID = {$itemID} and status = 0\";\n\t$result = $conn->query($sql_checktype);\n\tif($result->num_rows>0)\n {\n\t\t$row = $result->fetch_assoc();\n\t\t$auctiontype = $row['auctiontype']; \n\t\t//Ebay\n\t if($auctiontype == '0'){\n\t\tbidinEBay($conn,$userID);\n\t\t}\n\t //Vickrey\n\t else if($auctiontype == '1'){\n\t\tbidinVickrey($conn,$userID);\n\t }\n\t //Dutch\n\t else if($auctiontype == '2'){\n\t\tbidinDutch($conn,$userID);\n\t }\n\t\t\n }\n\t\n\telse {\n\t\t$response = array();\n\t\t$response['data'] = 'The auction has ended';\n\t\t$response['status'] = 0;\n\t\techo json_encode($response);\n\t}\n\t\n}" ]
[ "0.5938184", "0.58566076", "0.58543193", "0.5742449", "0.57308227", "0.5667897", "0.5620382", "0.55823296", "0.55725706", "0.5465333", "0.54337233", "0.5431652", "0.5405736", "0.53686404", "0.53497505", "0.534635", "0.5337155", "0.5299727", "0.5297826", "0.52938837", "0.5289204", "0.5228942", "0.52224386", "0.52110344", "0.5201377", "0.5198302", "0.5184257", "0.51787573", "0.51733536", "0.51580316" ]
0.6893643
0
END AUTH Get idProf
public function getIdProf() { return $this->idProf; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listProById()\n {\n\n // obtener el perfil por id\n $id = 3985390143818633;\n print_r($this->getProfile($id)); \n\n }", "function getProfileID() {\n\t\treturn $this->_ProfileID;\n\t}", "public function getId_Profesor()\n {\n return $this->id_profesor;\n }", "function getProfileInfo($id,$ext=\"\") {\n\t\tif (empty($ext)) {\n\t\t\t$q = \"SELECT * FROM shared_users WHERE UID='$id'\" ;\n\t\t} else {\n\t\t\t$q = \"SELECT * FROM shared_users AS t1, $ext\" . \"_users_ext AS t2 WHERE t1.UID='$id' AND t1.ID=t2.ID\" ;\n\t\t}\n\t\t$result = $this->doSQL($q) ;\n\t\tif (mysql_num_rows($result)==1) {\n\t\t\treturn mysql_fetch_object($result) ;\n\t\t} else {\n\t\t\treturn FALSE ;\n\t\t}\n\t}", "public function loadProfileInformation() {\n\t\t\t$procedure = \"get\" . $this->mode_ . \"Information\"; \n\t\t\t$this->profileInformation_ = $this->dbHandler_->call($procedure, \"%d\", array($this->id_));\n\t\t}", "function getProfile($id){\n return $this->activity_model->fetchProfile($id)->row();;\n }", "function getProfileInfo1($id)\n\t\t{\n\t\n\t\t $query = \"SELECT *,concat(m.first_name,' ',m.last_name) as affiliate_name FROM tbl_subscriber s \n\t\t left join tbl_member m on s.prim_affiliate_id = m.member_id \n\t\t WHERE subscriber_id = '$id'\";\n\t\t $rs\t\t=\t$this->Execute($query);\n\t\t return $this->_getPageArray($rs, 'Subscriber');\n\t\t}", "public function getInfoProfile(){\n return $this->get_user_by_id($this->getAccountID());\n }", "public function profile(){\n\t\t$this->common_lib->profile($this->user,$this->menu,$this->group->name);\n\t}", "public function getProfile()\n {\n $res = $this->getEntity()->getProfile();\n\t\tif($res === null)\n\t\t{\n\t\t\t$this->setProfile(SDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->findByCriteria('Profile', array('primary' => $this::getPrimary())));\n\t\t\treturn $this->getEntity()->getProfile();\n\t\t}\n return $res;\n }", "public function GetPerfilId($id){\n \t$perfiles = Perfil::find($id);\n \treturn $perfiles;\n }", "function getProfile($prj_id, $usr_id)\n {\n $backend =& self::_getBackend($prj_id);\n return $backend->getProfile($usr_id);\n }", "public static function getUserInfo(int $id)\n {\n $userProfil = User::where('id', $id)->first();\n return $userProfil;\n }", "private function GetInstructorProfile($WH_ID=0)\n\t{\n $record = $this->SQL->GetRecord(array(\n 'table' => $GLOBALS['TABLE_instructor_profile'],\n 'keys' => '*',\n 'where' => \"wh_id='$WH_ID' AND active=1\",\n ));\n if ($this->Show_Query) echo \"<br /><br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n $this->profile = array(\n\t\t\t'name' => \"{$record['first_name']} {$record['last_name']}\",\n 'picture' => $record['primary_pictures_id'], //'instructor_53456.gif',\n //'location' => \"{$record['location_city']}, {$record['location_state']}\",\n //'experience' => $record['experience_years'],\n 'description' => $record['profile'],\n 'types' => $record['yoga_types'],\n\t\t);\n\t}", "public function WhidFromSmProfile()\n {\n global $ROOT;\n $SMPROFILE = Session('SMPROFILE');\n\n if ($SMPROFILE) {\n //$intel_customer_id = intOnly(ArrayValue($SMPROFILE, 'cst-id'));\n $intel_login_id = db_QuoteValue(ArrayValue($SMPROFILE, 'login-id'));\n\n if (!ArrayValue($SMPROFILE, 'login-id')) {\n return 0;\n }\n\n //$WHID = db_GetValue('contacts', 'wh_id', \"intel_customer_id=$intel_customer_id\");\n $WHID = db_GetValue('contacts', 'wh_id', \"intel_login_id=$intel_login_id\");\n if ($WHID) {\n $_SESSION['WHID'] = $WHID;\n $CONTACT = new Contacts;\n $_SESSION['WH_CONTACT_RECORD'] = $CONTACT->GetAllContactDetails($WHID);\n } else {\n \n $result = $this->CreateNewContactFromSmProfile();\n \n if (!$result) { \n // -------------- write log file ---------------\n $date = date('Y-m-d H:i:s');\n $fdate = date('Y-m');\n $filename = \"$ROOT/{$this->Log_Directory}/SMFAIL-$fdate.log\";\n $profile = implode('|', $SMPROFILE);\n $line = \"$date|$profile\\n\";\n append_file($filename, $line);\n } else {\n $WHID = $_SESSION['WHID'];\n }\n }\n return $WHID;\n } else {\n return 0;\n }\n }", "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}", "public function MyProfil() {\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_COOKIE['login']))\n return call('pages', 'error404');\n\n // we use the given id to get the right post\n $schools = School::findProfil($_COOKIE['login']);\n require_once('views/school/show.php');\n }", "public function getProf(){\n return $this->prof;\n }", "function getProfileID(){\r\n\r\n \t$DBH = connect();\r\n\r\n \t$sql = $DBH->prepare(\"SELECT `ProfileID` FROM `user` WHERE `UserID` = :userID LIMIT 1;\"); \r\n\r\n \t$sql->bindValue(':userID',$_SESSION['$userID']);\r\n\t\t$sql->execute();\r\n\r\n\t\t$result = $sql->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t//store the profileID into session\r\n\t\tforeach($result as $r ){\r\n\r\n\t\t\t$_SESSION['$profileID'] = $r['ProfileID'];\r\n\t\t}\r\n\r\n\t\t//if the users already has added tracking details load them\r\n\t\tif(!empty($result)){\r\n\t\t\t\r\n\t\t\tloadDetails();\r\n\t\t}\r\n\t\t//if there are no details to load\r\n\t\telse{\r\n\t\t\techo \"<tr class ='tb'><td></td><td></td><td></td></tr>\r\n\t \t\t <tr id='table1' class='tb'> \r\n\r\n\t <td></td>\r\n\t <td> <div id='alertNoPack' class='alert alert-info'>\r\n \t\t\t\t\t\t\t\t\t<strong>Add a package! </strong> click the Add button to start managing your packages.\r\n \t\t\t\t\t\t\t\t\t</div>\r\n \t\t\t\t\t\t\t\t</td>\r\n\t <td></td>\r\n\t </tr> \r\n\r\n\t \";\r\n\t\t\t\r\n\t\t}\r\n }", "public function getProfileId() {\n\t\treturn($this->profileId);\n\t}", "public function getProfileId() {\n\t\treturn ($this->profileId);\n\t}", "public function getProfileId() {\n\t\treturn ($this->profileId);\n\t}", "function get_alt_par_id($pri_id){\n\t\t$this->db->where('parentPrimary_uacc_id',$pri_id);\n\t\t$this->db->select('parentAlt_uacc_id',$pri_id);\n\t\t\n\t\t$qres=$this->db->get(TWELL_FAM_PROF_TBL);\n\t\tif ($qres->num_rows()==1) {\n\t\t\t$row=$qres->row();\n\t\t\treturn ($row->parentAlt_uacc_id);\n\t\t}else{\n\t\t\t$this->firephp->log(\"Could not retrieve alt_parent user id\");\n\t\t\treturn 0;\n\t\t}\n\t}", "function GetProfileDetails(){\n\t\t$this->load->model('User_model');\n\t\t\n\t\t$this->user_id = $this->User_model->Get_User_ID_By_Token($this->user_auth_id); //Just Like a call to require ID of USER\n\t\t//Did this because the user_id might be set but above function just represents auth ID and sends to model to deliver real ID\n\t\t\n\t\t$this->db->select('firstname,lastname,auth_token,program_name,level,grad_year');\n\t\t$this->db->from('users');\n\t\t$this->db->join('programs', 'programs.program_id = users.program_id');\n\t\t$this->db->join('students', 'students.user_id = users.user_id');\n\t\t$this->db->where('users.user_id', $this->user_id);\n\t\t$query = $this->db->get();\n\t\t\n\t\t$results = $query->result_array();\n\t\t\n\t\treturn $results[0];\n\t}", "public function getUserProfile();", "abstract protected function getUserProfile();", "public function get_staff_info($id){\n\t$q = $this->db->where('id', $id)->get('proppro.propertystaff');\n\treturn $q->result();\n}", "static public function getDetails($id) {\n $db = Database::connect();\n\n $sql = $db->query(\"SELECT * FROM \". self::DB_USER. \" WHERE md5(id) = '$id'\");\n\n return $sql->fetch_object();\n }", "function db_pwassist_session_read($pwassist_id)\n{\n\tglobal $ilDB;\n\n\t$q = \"SELECT * FROM usr_pwassist \".\n\t\t\"WHERE pwassist_id = \".$ilDB->quote($pwassist_id, \"text\");\n\t$r = $ilDB->query($q);\n\t$data = $ilDB->fetchAssoc($r);\n\n\treturn $data;\n}", "public function getProfileId() \n {\n if (!$this->hasProfileId()) \n {\n $this->profileId = '';\n }\n\n return $this->profileId;\n }" ]
[ "0.6538144", "0.6449604", "0.63818187", "0.62674844", "0.6218616", "0.6160209", "0.60681003", "0.6044823", "0.60376567", "0.6015372", "0.5985411", "0.5980361", "0.5974151", "0.5917154", "0.5916462", "0.586037", "0.58591735", "0.58574146", "0.5847538", "0.5844989", "0.5844149", "0.5844149", "0.58384335", "0.5836392", "0.5828447", "0.5827694", "0.5819782", "0.57963115", "0.57906604", "0.5787836" ]
0.7223227
0
get user's current timezone from DB
public static function getUserTimezone() { return Users::where('id', Auth::user()->id)->first()->timezone; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function user_timezone() {\n global $USER, $remotedb;\n $sql = \"SELECT timezone FROM {user} WHERE id = ?\";\n $params = array($USER->id);\n $timezone = $remotedb->get_record_sql($sql, $params);\n return $timezone ? $timezone->timezone : 99;\n }", "public function getTimeZone();", "function get_from_database() {\n $TZ = db_timezone();\n\n // Translate ambiguous 'GMT' timezone\n if ($TZ === 'GMT') {\n // PHP assumes GMT == UTC, MySQL assumes GMT == Europe/London.\n // To shore up the difference, assuming use of MySQL, use the\n // timezone in PHP which honors BST (British Summer Time)\n return 'Europe/London';\n }\n\n return Format::timezone($TZ);\n }", "public function getTimeZone()\n {\n return $this->get(self::_TIME_ZONE);\n }", "protected function timezone()\n {\n return config('app.timezone');\n }", "function getLocalTimezone() {\n\t//get user timezone and return, \n\t//if blank return default timezone ('Africa/Nairobi')\n\t$location = getUserLocation();\n\t$userTimezone=$location->timezone;\n\tif ($userTimezone) {\n\t\t$timezone = $userTimezone;\n\t} else {\n\t\t$timezone = config('app.local_timezone');\n\t}\n\treturn $timezone;\n}", "function get_timezone ()\n{\n\tglobal $user_data, $default_timezone, $time_zone, $time_zone_offset, $time_zone_list, $time_zone_dst;\n\n\t$time_zone = (empty($user_data['time_zone'])\n\t\t? (empty($default_timezone)\n\t\t\t? 0\n\t\t\t: $default_timezone)\n\t\t: $user_data['time_zone']);\n\n\t// TZ is valid...\n\tif (isset($time_zone_list[$time_zone]))\n\t{\n\t\t$time_zone_offset = $time_zone_list[$time_zone][0] * 3600;\n\t}\n\t// TZ not found/set in the array\n\telse\n\t{\n\t\t$time_zone = 'N/A';\n\t}\n}", "public function getTimezone(){\n\t\treturn Core::getTimezone();\n\t}", "function getUserTimezone($user_id) {\n\t$user_id = escape($user_id);\n\t$result = mysql_query(\"SELECT timezone FROM users WHERE id = '$user_id'\");\n\t\n\tif($row = mysql_fetch_array($result)) {\n\t\treturn $row[0];\n\t} else {\n\t\treturn '';\n\t}\n}", "public function getTimeZone()\n {\n return date_default_timezone_get();\n }", "public function getTimezone()\n {\n return $this->parameters['hipay.timezone'];\n }", "public function getTimeZone()\n\t{\n\t\treturn date_default_timezone_get();\n\t}", "public function timezone()\n {\n return $this->rule('timezone');\n }", "function getTimeZone($data) {\n /* try to get timezone based on clinic_id in the data \n\t (in case it was just changed) */\n\tif (!empty($data['User']) && !empty($data['User']['clinic_id'])) {\n $timezone = $this->User->Clinic->getTimeZone(\n\t $data['User']['clinic_id']);\n }\n\t\n\t/* if that doesn't work, get it from the clinic_id in the db */\n\tif (empty($timezone)) {\n //$timezone = $this->User->getTimeZone($data['Patient']['id']);\n $timezone = parent::getTimeZone($data['Patient']['id']);\n }\n\n\treturn $timezone;\n }", "public function getTimezone() {\n return $this->timezone;\n }", "public static function getTimezoneOne(){\n return self::getInstance()->_timezoneFrom->getName();\n }", "public function getTimezone()\r\n {\r\n return $this->timezone;\r\n }", "public function getTimezone()\n {\n return $this->getConfig('timezone');\n }", "public static function getTimezone() {\n $settings = self::getSettings();\n \n return $settings->timezone;\n }", "public function getTimezone()\n {\n return $this->timezone;\n }", "public function getTimeZone()\r\n {\r\n return $this->time_zone;\r\n }", "function getTimeZone($userId){\n\n// $this->log(__CLASS__ . '.' . __FUNCTION__ . \"($userId), trace:\" . Debugger::trace() . \"\\n\\n\", LOG_DEBUG);\n\n $userId = intval($userId);\n\n if (empty($userId)) {\n // $this->log(\"getTimeZone: userId empty: $userId\", LOG_DEBUG);\n return date_default_timezone_get();\n }\n\n $queryStr = \"SELECT timezone from sites \n JOIN clinics, users\n WHERE users.id = $userId\n AND clinics.site_id = sites.id\n AND users.clinic_id = clinics.id\n LIMIT 1\";\n $result = $this->query($queryStr);\n\n if (empty($result)) {\n $this->log(\"getTimeZone: userId $userId has no timezone!\");\n return date_default_timezone_get();\n } else {\n return $result[0]['sites']['timezone'];\n }\n }", "public function getTimeZone()\n {\n return $this->time_zone;\n }", "public function getTimeZone()\n {\n return $this->time_zone;\n }", "public function getTimezone()\n\t{\n\t\treturn $this->timezone;\n\t}", "public function setTimezone() {\n $current = Carbon::now('America/Toronto');\n return $current;\n }", "public function get_tzone() \n {\n return $this->timezone;\n }", "public function getCurrentDateTimeUsingTimezone()\n {\n // Lookup configured timezone\n $timezone = Mage::getStoreConfig('general/locale/timezone');\n // Get current time\n $curDateTime = new DateTime('now', new DateTimeZone($timezone));\n\n // Return\n return $curDateTime;\n }", "public function getTimezoneId();", "public function getCurrentTimeUsingTimezone()\n {\n // Get current DateTime obj\n $curDateTime = $this->getCurrentDateTimeUsingTimezone();\n\n // Return current time formatted nicely as string\n return $curDateTime->format('H:i:s');\n }" ]
[ "0.86436653", "0.7483286", "0.7337002", "0.72573817", "0.724671", "0.7228356", "0.7198175", "0.7168709", "0.7121297", "0.70778155", "0.70546204", "0.7046977", "0.70364594", "0.703261", "0.70259583", "0.70215976", "0.702086", "0.69955325", "0.69896823", "0.6976687", "0.69697404", "0.69695187", "0.6965802", "0.6965802", "0.696024", "0.6820083", "0.68140215", "0.67498934", "0.67170155", "0.6674841" ]
0.8498203
1
Add new localization into `entity_localization` table
public static function add_localization($entity_id, $field, $item_id, $value, $lang_id) { $localization = new EntityLocalization; $localization->entity_id = $entity_id; $localization->field = $field; $localization->value = $value; $localization->item_id = $item_id; $localization->lang_id = $lang_id; $localization->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdateTranslationWithLocaleInEntity(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->addBehavior('Translate', ['fields' => ['title', 'body']]);\n $article = $table->find()->first();\n $this->assertSame(1, $article->get('id'));\n $article->set('_locale', 'fra');\n $article->set('title', 'Le titre');\n $table->save($article);\n $this->assertNull($article->get('_i18n'));\n\n $article = $table->find()->first();\n $this->assertSame(1, $article->get('id'));\n $this->assertSame('First Article', $article->get('title'));\n $this->assertSame('First Article Body', $article->get('body'));\n\n $table->setLocale('fra');\n $article = $table->find()->first();\n $this->assertSame(1, $article->get('id'));\n $this->assertSame('Le titre', $article->get('title'));\n $this->assertSame('First Article Body', $article->get('body'));\n }", "function hook_i18n_sync_translation($entity_type, $translation, $translation_language, $source, $source_language, $field_names) {\n \n}", "public function testInsertNewTranslations(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->addBehavior('Translate', ['fields' => ['title', 'body']]);\n $table->setLocale('fra');\n\n $article = $table->find()->first();\n $this->assertSame(1, $article->get('id'));\n $article->set('title', 'Le titre');\n $table->save($article);\n $this->assertSame('fra', $article->get('_locale'));\n\n $article = $table->find()->first();\n $this->assertSame(1, $article->get('id'));\n $this->assertSame('Le titre', $article->get('title'));\n $this->assertSame('First Article Body', $article->get('body'));\n\n $article->set('title', 'Un autre titre');\n $article->set('body', 'Le contenu');\n $table->save($article);\n $this->assertNull($article->get('_i18n'));\n\n $article = $table->find()->first();\n $this->assertSame('Un autre titre', $article->get('title'));\n $this->assertSame('Le contenu', $article->get('body'));\n }", "function add_translation($suppid, $language) {\r\n\t\t\t\t$title = $this->input->post('title');\r\n\t\t\t\t$desc = $this->input->post('desc');\r\n\t\t\t\t$data = array('trans_title' => $title, 'trans_desc' => $desc, 'trans_extras_id' => $suppid, 'trans_lang' => $language,);\r\n\t\t\t\t$this->db->insert('pt_extras_translation', $data);\r\n\t\t\t\t$this->session->set_flashdata('flashmsgs', 'Changes Saved');\r\n\t\t}", "protected function loadLocalization() {}", "public function createLanguagesAction() {\n $em = $this->getDoctrine()->getManager();\n $list = array(\"zh\", \"en\", \"es\", \"hi\", \"bn\", \"pt\", \"ru\", \"fr\", \"ur\", \"ja\", \"de\", \"ko\", \"tr\", \"it\", \"ar\");\n\n foreach ($list as $key => $value) {\n $object = new \\Skaphandrus\\AppBundle\\Entity\\SkLanguage();\n $object->setName($value);\n $em->persist($object);\n }\n $em->flush();\n\n $entities = $em->getRepository('SkaphandrusAppBundle:SkLanguage')->findAll();\n\n return $this->render('SkaphandrusAppBundle:SkBusiness:createLanguage.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionAdd()\n {\n if ($country = Yii::$app->request->post(\"country_name\") ) //country_name e.g. Croatia, Serbia...\n {\n\n foreach ($country as $countryName)\n {\n //find continent for that country\n $continent_id=Country::findContinentForCountry($countryName);\n //var_dump($continent_id);\n $Country=new Country;\n $Country->order_index=2; //orderin countries because Interlational is always #1, other are by name\n $Country->continent_id=$continent_id;\n $Country->language_id=7; //stupid because I can add only one language but one country can be multilingual\n $Country->name=$countryName;\n if($Country->save())\n {\n //find languages spoken in this country\n $countryExt=CountryExt::find()->where(['name'=>$countryName])->one();\n $langs=explode(\",\", $countryExt->languages); //hr,en,es\n foreach($langs as $lang)\n {\n //find that language in \"languages\" table so you can take id and add only language (assign to new country) that exist in CMS\n $lang_table=Language::find()->where(['code'=>$lang])->one();\n if(!empty($lang_table)) //if there is any lang in database that match language from that country\n {\n $CountryLanguage = new CountryLanguage;\n $CountryLanguage->language_id=$lang_table->id;\n $CountryLanguage->country_id=$Country->id;\n $CountryLanguage->save();\n }\n }\n $success=true;\n }\n else\n $success=false;\n\n }\n if($success==true)\n Yii::$app->session->setFlash('success', Yii::t('app','Everything went fine'));\n else\n Yii::$app->session->setFlash('danger', Yii::t('app','Something was wrong'));\n\n return $this->redirect(['index']);\n\n }\n\n }", "public function addLocalizedStrings(\\obiba\\mica\\LocalizedStringDto $value) {\n return $this->_add(1, $value);\n }", "public function add() {\n $entityManager = \\Drupal::entityTypeManager();\n\n $type_id = \\Drupal::request()->query->get('type_id');\n $entity_id = \\Drupal::request()->query->get('entity_id');\n $lang = \\Drupal::request()->query->get('lang');\n $lang = !is_array($lang) ? [$lang] : $lang;\n\n \\Drupal::state()->set('smartcat_api_languages', $lang);\n\n $entity = $entityManager\n ->getStorage($type_id)\n ->load($entity_id);\n\n if (!$entity) {\n throw new NotFoundHttpException(\"Entity $type_id $entity_id not found\");\n }\n\n $selection = [];\n\n $langcode = $entity->language()->getId();\n $selection[$entity->id()][$langcode] = $langcode;\n\n $this->tempStore->set(\\Drupal::service('current_user')->id() . ':' . $type_id, $selection);\n $previousUrl = \\Drupal::request()->server->get('HTTP_REFERER');\n $base_url = Request::createFromGlobals()->getSchemeAndHttpHost();\n $destination = substr($previousUrl, strlen($base_url));\n\n return new RedirectResponse(\n Url::fromRoute('smartcat_translation_manager.settings_more',\n ['entity_type_id' => $type_id],\n ['query' => ['destination' => $destination]]\n )->toString()\n );\n }", "private function load_localization() {\n $plugin_i18n = new PLUGINNAME_i18n($this->getter()->get_translation_slug);\n add_action('plugins_loaded', array($plugin_i18n, 'load_plugin_textdomain'));\n }", "public function testSaveNewRecordWithTranslatesField(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->getValidator()->add('title', 'notBlank', ['rule' => 'notBlank']);\n $table->addBehavior('Translate', [\n 'fields' => ['title'],\n ]);\n $table->setEntityClass(TranslateArticle::class);\n\n $data = [\n 'author_id' => 1,\n 'published' => 'N',\n '_translations' => [\n 'en' => [\n 'title' => 'Title EN',\n 'body' => 'Body EN',\n ],\n 'es' => [\n 'title' => 'Title ES',\n ],\n ],\n ];\n\n $article = $table->patchEntity($table->newEmptyEntity(), $data);\n $result = $table->save($article);\n\n $this->assertNotFalse($result);\n\n $expected = [\n [\n 'en' => [\n 'title' => 'Title EN',\n 'locale' => 'en',\n ],\n 'es' => [\n 'title' => 'Title ES',\n 'locale' => 'es',\n ],\n ],\n ];\n $result = $table->find('translations')->where(['id' => $result->id]);\n $this->assertEquals($expected, $this->_extractTranslations($result)->toArray());\n }", "private function _addLocale($locale)\n\t{\n\t\tCraft::log('Adding locale.');\n\t\tcraft()->db->createCommand()->insert('locales', array('locale' => $locale, 'sortOrder' => 1));\n\t\tCraft::log('Locale added successfully.');\n\t}", "public function testSavingWithNonDefaultLocale(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->addBehavior('Translate', ['fields' => ['title', 'body']]);\n $table->setEntityClass(TranslateArticle::class);\n I18n::setLocale('fra');\n $translations = [\n 'fra' => ['title' => 'Un article'],\n 'spa' => ['title' => 'Un artículo'],\n ];\n\n $article = $table->get(1);\n foreach ($translations as $lang => $data) {\n $article->translation($lang)->set($data, ['guard' => false]);\n }\n\n $table->save($article);\n $article = $table->find('translations')->where(['Articles.id' => 1])->first();\n $this->assertSame('Un article', $article->translation('fra')->title);\n $this->assertSame('Un artículo', $article->translation('spa')->title);\n }", "public function testUpdateSingleLocale(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->addBehavior('Translate', ['fields' => ['title', 'body']]);\n $table->setLocale('eng');\n $article = $table->find()->first();\n $this->assertSame(1, $article->get('id'));\n $article->set('title', 'New translated article');\n $table->save($article);\n $this->assertNull($article->get('_i18n'));\n\n $article = $table->find()->first();\n $this->assertSame(1, $article->get('id'));\n $this->assertSame('New translated article', $article->get('title'));\n $this->assertSame('Content #1', $article->get('body'));\n\n $table->setLocale(null);\n $article = $table->find()->first();\n $this->assertSame(1, $article->get('id'));\n $this->assertSame('First Article', $article->get('title'));\n\n $table->setLocale('eng');\n $article->set('title', 'Wow, such translated article');\n $article->set('body', 'A translated body');\n $table->save($article);\n $this->assertNull($article->get('_i18n'));\n\n $article = $table->find()->first();\n $this->assertSame(1, $article->get('id'));\n $this->assertSame('Wow, such translated article', $article->get('title'));\n $this->assertSame('A translated body', $article->get('body'));\n }", "public function _afterSave()\n {\n Mage::getResourceModel('bpost_shm/tablerates_international')->uploadAndImport($this);\n }", "public function add() {\r\n\t\t$model = $this->getModel('languages');\r\n\t\t$model->add();\r\n\t\t\r\n\t\t$this->view = $this->getView(\"languages\");\r\n\t\t$this->view->setModel($model, true);\r\n\t\t$this->view->display();\r\n\t}", "public function testSaveNewRecordWithOnlyTranslationsNotDefaultLocale(): void\n {\n $table = $this->getTableLocator()->get('Sections');\n $table->getValidator()->add('title', 'notBlank', ['rule' => 'notBlank']);\n $table->addBehavior('Translate', [\n 'fields' => ['title'],\n ]);\n\n $data = [\n '_translations' => [\n 'es' => [\n 'title' => 'Title ES',\n ],\n ],\n ];\n\n $group = $table->newEntity($data);\n $result = $table->save($group);\n $this->assertNotFalse($result, 'Record should save.');\n\n $expected = [\n [\n 'es' => [\n 'title' => 'Title ES',\n 'locale' => 'es',\n ],\n ],\n ];\n $result = $table->find('translations')->where(['id' => $result->id]);\n $this->assertEquals($expected, $this->_extractTranslations($result)->toArray());\n }", "public function testSaveExistingRecordWithTranslatesField(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->addBehavior('Translate', ['fields' => ['title', 'body']]);\n $table->setEntityClass(TranslateArticle::class);\n\n $data = [\n 'author_id' => 1,\n 'published' => 'Y',\n '_translations' => [\n 'eng' => [\n 'title' => 'First Article1',\n 'body' => 'First Article content has been updated',\n ],\n 'spa' => [\n 'title' => 'Mi nuevo titulo',\n 'body' => 'Contenido Actualizado',\n ],\n ],\n ];\n\n $article = $table->find()->first();\n $article = $table->patchEntity($article, $data);\n\n $this->assertNotFalse($table->save($article));\n\n $results = $this->_extractTranslations(\n $table->find('translations')->where(['id' => 1])\n )->first();\n\n $this->assertSame('Mi nuevo titulo', $results['spa']['title']);\n $this->assertSame('Contenido Actualizado', $results['spa']['body']);\n\n $this->assertSame('First Article1', $results['eng']['title']);\n $this->assertSame('Description #1', $results['eng']['description']);\n }", "function addLocale($key, $translation) {\n\t\t\t$ret = $this->loadLocale($translation);\n\t\t\t$this->locales[$key] = $this->loadLocale($translation);\n\t\t}", "protected function addLocales()\n {\n // @todo: add locales when locales configuration is updated\n }", "public function migrate()\n\t{\n\t\t\\Aimeos\\MW\\Common\\Base::checkClass( '\\\\Aimeos\\\\MShop\\\\Context\\\\Item\\\\Iface', $this->additional );\n\n\t\t$this->msg( 'Add locale data for languages and currencies', 0 );\n\t\t$this->status( '' );\n\n\n\t\t$ds = DIRECTORY_SEPARATOR;\n\t\t$localeManager = \\Aimeos\\MShop\\Locale\\Manager\\Factory::createManager( $this->additional, 'Standard' );\n\n\n\t\t$filename = __DIR__ . $ds . 'default'. $ds . 'data'. $ds . 'language.php';\n\n\t\tif( ( $data = include( $filename ) ) == false ) {\n\t\t\tthrow new \\Aimeos\\MW\\Setup\\Exception( sprintf( 'No data file \"%1$s\" found', $filename ) );\n\t\t}\n\n\t\tif( isset( $data['locale/language'] ) ) {\n\t\t\t$this->addLocaleLanguageData( $localeManager, $data['locale/language'] );\n\t\t}\n\n\n\t\t$filename = __DIR__ . $ds . 'default'. $ds . 'data'. $ds . 'currency.php';\n\n\t\tif( ( $data = include( $filename ) ) == false ) {\n\t\t\tthrow new \\Aimeos\\MW\\Setup\\Exception( sprintf( 'No data file \"%1$s\" found', $filename ) );\n\t\t}\n\n\t\tif( isset( $data['locale/currency'] ) ) {\n\t\t\t$this->addLocaleCurrencyData( $localeManager, $data['locale/currency'] );\n\t\t}\n\t}", "function addLocale($locale) {\n\t\t$this->localeData[$locale] = array();\n\t}", "public function getLocalisation($localisation=null)\n {\n if ($localisation != null && is_array($this->entity) && count($this->entity)!=0) {\n $table_name = strtolower(get_class($this));\n $query = \"SELECT * FROM $table_name WHERE localisation = ?\";\n $req = Manager::bdd()->prepare($query);\n $req->execute([$localisation]);\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->localisation;\n }\n \n }", "private function set_locale() {\n\n\t\t$plugin_i18n = new Service_Tracker_i18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private function set_locale()\n {\n\n $plugin_i18n = new myFOSSIL_Resources_i18n();\n $plugin_i18n->set_domain( $this->get_plugin_name() );\n\n $this->loader->add_action( 'plugins_loaded', $plugin_i18n,\n 'load_plugin_textdomain' );\n\n }", "protected function enableTranslation() {\n // Enable translation for the current entity type and ensure the change is\n // picked up.\n \\Drupal::service('content_translation.manager')->setEnabled($this->entityTypeId, $this->bundle, TRUE);\n }", "public function postImport() {\n parent::postImport();\n\n // i18n Translation Set.\n $result = db_query('SELECT n.sourceid1, n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n');\n foreach ($result as $record) {\n $sourceid_tmp = preg_replace('#_fra_#', '_eng_', $record->sourceid1);\n $source_mlid = 0;\n $translated_mlid = 0;\n if (preg_match('/_fra_/i', $record->sourceid1)) {\n $result = db_query('SELECT n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n WHERE n.sourceid1 = :sourceid', array(':sourceid' => $record->sourceid1));\n foreach ($result as $result_row) {\n $translated_mlid = $result_row->destid1;\n $result = db_query('SELECT n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n WHERE n.sourceid1 = :sourceid', array(':sourceid' => $sourceid_tmp));\n foreach ($result as $result_row) {\n $source_mlid = $result_row->destid1;\n break;\n }\n break;\n }\n if (($source_mlid != 0) && ($translated_mlid != 0)) {\n $translation_set = i18n_translation_set_create('menu_link');\n $translation_set->reset_translations();\n $item = menu_link_load($source_mlid);\n $translation_set->add_item($item, 'en');\n $item = menu_link_load($translated_mlid);\n $translation_set->add_item($item, 'fr');\n $translation_set->save(TRUE);\n }\n }\n }\n }", "function add()\n\t{\n\t\t$data[\"title\"] = _e(\"Language\");\t\n\t\t$CFG = $this->config->item('language_configure');\n\t\t\n\t\t ## for check admin or not\t ##\t\n\t\t$data[\"response\"] = addPermissionMsg( $CFG[\"sector\"][\"add\"] );\t\t\t\n\t\t\t\t\t\n\t\t## Other auxilary variable ##\n\t\t$data['var'] = array();\t\t\t\t\n\t\t$data[\"top\"] = $this->template->admin_view(\"top\", $data, true, \"language\");\t\n\t\t$data[\"content\"] = $this->template->admin_view(\"language_add\", $data, true, \"language\");\n\t\t$this->template->build_admin_output($data);\n\t}", "public function store(Request $request)\n {\n $this->validate($request, [\n 'language' \t=> 'bail|required|max:40|unique:languages,language',\n 'code' \t\t=> 'bail|required|max:4|unique:languages,code',\n 'is_rtl' \t \t=> 'bail|required'\n ]);\n \t$record = new Language();\n $name \t\t\t\t\t = $request->language;\n $record->language \t\t = $name;\n $record->slug \t\t\t = $record->makeSlug($name);\n $record->code\t\t\t\t\t = $request->code;\n $record->is_rtl\t\t\t\t\t= $request->is_rtl;\n $record->save();\n LanguageHelper::flash('success','record_added_successfully', 'success');\n \treturn redirect(URL_LANGUAGES_LIST);\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'label' => 'VARCHAR(20) NULL DEFAULT NULL COMMENT \"language label\"',\n\t\t\t\t'code' => 'VARCHAR(5) NOT NULL COMMENT \"language code\"',\n\t\t\t\t'locale' => 'VARCHAR (5) NULL DEFAULT NULL',\n\n\t\t\t\t'visible' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not visible; 1 - visible\"',\n\t\t\t\t'published' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not published; 1 - published\"',\n\t\t\t\t'position' => 'INT UNSIGNED NOT NULL DEFAULT 0 COMMENT \"order by position DESC\"',\n\t\t\t\t'created' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - creation time\"',\n\t\t\t\t'modified' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - last entity modified time\"',\n\n\t\t\t\t'UNIQUE key_unique_code (code)',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\n\t\t$this->insert('{{language}}', array(\n\t\t\t'label' => 'рус',\n\t\t\t'code' => 'ru',\n\t\t\t'locale' => 'ru',\n\t\t));\n\t}" ]
[ "0.618603", "0.58940005", "0.5868121", "0.57442737", "0.5700741", "0.5679664", "0.56244624", "0.55950224", "0.5575678", "0.5548704", "0.55447686", "0.5500646", "0.5461112", "0.54520863", "0.5435318", "0.5401778", "0.5393687", "0.5371231", "0.5366857", "0.5365915", "0.53038365", "0.5300483", "0.5296652", "0.52857274", "0.5271786", "0.5190777", "0.51896834", "0.51849955", "0.5182874", "0.5173779" ]
0.68696773
0
Get post image from request.
public function getImageFromRequest(FormRequest $request) { return $request->file('image'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getImage()\n {\n return $this->get('image');\n }", "function rest_get_featured_image( $post, $field_name, $request ) {\n $attachment_id = $post['featured_media'];\n $attachment_info = wp_get_attachment_image_src( $attachment_id, 'rest_post_thumbnail' );\n return $attachment_info[0];\n}", "function get()\r\n\t{\r\n\t\t// Get the properties from the URI\r\n\t\t$default = array('file','width','height','crop','quality','nocache');\r\n\t\t$uri_array = $this->uri->uri_to_assoc(3, $default);\r\n\r\n\t\tif( $uri_array['file'] == NULL)\r\n\t\t{\r\n\t\t\t// Don't continue\r\n\t\t\tlog_message(\"error\",\"BackendPro->Image->get : Badly formed image request string: \" . $this->uri->uri_string());\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Try to find the image\r\n\t\tforeach($this->config->item('image_folders') as $folder)\r\n\t\t{\r\n\t\t\tif ( file_exists($folder.$uri_array['file']))\r\n\t\t\t{\r\n\t\t\t\t$this->img_path = $folder.$uri_array['file'];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Image couldn't be found\r\n\t\tif ($this->img_path == NULL)\r\n\t\t{\r\n\t\t\tlog_message(\"error\",\"BackendPro->Image->get : Image dosn't exisit: \" . $uri_array['file']);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Get the size and MIME type of the requested image\r\n\t\t$size = GetImageSize($this->img_path);\r\n\t\t$width = $size[0];\r\n\t\t$height = $size[1];\r\n\r\n\t\t// Make sure that the requested file is actually an image\r\n\t\tif (substr($size['mime'], 0, 6) != 'image/')\r\n\t\t{\r\n\t\t\tlog_message(\"error\",\"BackendPro->Image->get : Requested file is not an accepted type: \" . $this->img_path);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Before we start to check for caches and alike, lets just see if the image\r\n\t\t// was requested with no changes, if so just return the normal image\r\n\t\tif( $uri_array['width'] == NULL AND $uri_array['height'] == NULL AND $uri_array['watermark'] == NULL AND $uri_array['crop'] == NULL AND $uri_array['quality'] == NULL)\r\n\t\t{\r\n\t\t\t$data\t= file_get_contents($this->img_path);\r\n\t\t\theader(\"Content-type:\". $size['mime']);\r\n\t\t\theader('Content-Length: ' . strlen($data));\r\n\t\t\tprint $data;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// We know we have to do something, so before we do lets see if there is\r\n\t\t// cache of the image already\r\n\t\tif( $uri_array['nocache'] == NULL)\r\n\t\t{\r\n\t\t\t// TODO: This should check to see if the image has changed since the last cache?\r\n\t\t\t$image_cache_string = $this->img_path . \" - \" . $uri_array['width'] . \"x\" . $uri_array['height'];\r\n\t\t\t$image_cache_string.= \"x\" . $uri_array['crop'] . \"x\" . $uri_array['quality'];\r\n\t\t\t$image_cache_string = md5($image_cache_string);\r\n\r\n\t\t\tif (file_exists($this->cache.$image_cache_string))\r\n\t\t\t{\r\n\t\t\t\t// Yes a cached image exists\r\n\t\t\t\t$data\t= file_get_contents($this->cache.$image_cache_string);\r\n\r\n\t\t\t\t// Before we output the image, does the local cache have the image?\r\n\t\t\t\t$this->_ConditionalGet($data);\r\n\r\n\t\t\t\theader(\"Content-type: \". $size['mime']);\r\n\t\t\t\theader('Content-Length: ' . strlen($data));\r\n\t\t\t\tprint $data;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// CROP IMAGE\r\n\t\t$offsetX = 0;\r\n\t\t$offsetY = 0;\r\n\t\tif( $uri_array['crop'] != NULL)\r\n\t\t{\r\n\t\t\t$crop = explode(':',$uri_array['crop']);\r\n\t\t\tif(count($crop) == 2)\r\n\t\t\t{\r\n\t\t\t\t$actualRatio = $width / $height;\r\n\t\t\t\t$requestedRatio = $crop[0] / $crop[1];\r\n\r\n\t\t\t\tif ($actualRatio < $requestedRatio)\r\n\t\t\t\t{ \t// Image is too tall so we will crop the top and bottom\r\n\t\t\t\t\t$origHeight\t= $height;\r\n\t\t\t\t\t$height\t\t= $width / $requestedRatio;\r\n\t\t\t\t\t$offsetY\t= ($origHeight - $height) / 2;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($actualRatio > $requestedRatio)\r\n\t\t\t\t{ \t// Image is too wide so we will crop off the left and right sides\r\n\t\t\t\t\t$origWidth\t= $width;\r\n\t\t\t\t\t$width\t\t= $height * $requestedRatio;\r\n\t\t\t\t\t$offsetX\t= ($origWidth - $width) / 2;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// RESIZE\r\n\t\t$ratio = $width / $height;\r\n\t\t$new_width = $width;\r\n\t\t$new_height = $height;\r\n\t\tif( $uri_array['width'] != NULL AND $uri_array['height'] != NULL)\r\n\t\t{\r\n\t\t\t// Resize image to fit into both dimensions\r\n\t\t\t$new_ratio = $uri_array['width'] / $uri_array['height'];\r\n\t\t\tif($ratio > $new_ratio)\r\n\t\t\t{\r\n\t\t\t\t// Height is larger\r\n\t\t\t\t$uri_array['height'] = NULL;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Width is larger\r\n\t\t\t\t$uri_array['width'] = NULL;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ( $uri_array['width'] == NULL AND $uri_array['height'] != NULL)\r\n\t\t{\t// Keep height ratio\r\n\t\t\t$new_height = $uri_array['height'];\r\n\t\t\t$new_width = $new_height * $ratio;\r\n\t\t}\r\n\t\telse if ( $uri_array['width'] != NULL AND $uri_array['height'] == NULL)\r\n\t\t{\t// Keep width ratio\r\n\t\t\t$new_width = $uri_array['width'];\r\n\t\t\t$new_height = $new_width / $ratio;\r\n\t\t}\r\n\r\n\t\t// QUALITY\r\n\t\t$quality = ($uri_array['quality'] != NULL) ? $uri_array['quality'] : $this->config->item('image_default_quality');\r\n\r\n\t\t$dst_image = imagecreatetruecolor($new_width, $new_height);\r\n\t\t$src_image = imagecreatefromjpeg($this->img_path);\r\n\t\timagecopyresampled($dst_image,$src_image,0, 0, $offsetX, $offsetY, $new_width, $new_height, $width, $height );\r\n\r\n\t\t// SAVE CACHE\r\n\t\tif( $uri_array['nocache'] == NULL)\r\n\t\t{\r\n\t\t\t// Make sure Cache dir is writable\r\n\t\t\t// INFO: This may be the source of the images sometimes not showing, seems some of the cache files can't be found\r\n\t\t\t// INFO: Since we are running this on a linux server its fine but this could cause issues http://codeigniter.com/forums/viewthread/94359/\r\n\t\t\tif ( !is_really_writable($this->cache))\r\n\t\t\t//if( !is_writable($this->cache))\r\n\t\t\t{\r\n\t\t\t\tlog_message('error',\"BackendPro->Image->get : Cache folder isn't writable: \" . $this->cache);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Write image to cache\r\n\t\t\t\timagejpeg($dst_image,$this->cache.$image_cache_string,$quality);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\theader(\"Content-type:\". $size['mime']);\r\n\t\timagejpeg($dst_image,NULL,$quality);\r\n\t}", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }" ]
[ "0.67804134", "0.6226074", "0.6222303", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657" ]
0.7483523
0
Get post categories ids from request.
public function getCategoriesIdsFromRequest(FormRequest $request) { $categoryIds = $request->input('category_id', []); if (is_null($categoryIds)) { return []; } if (!is_array($categoryIds)) { return [$categoryIds]; } return $categoryIds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_categories_from_post(){\n\t\t\n\t\t$categorias_bbdd=$this->get_categories(0,true);\n\t\t\n\t\t//Se inicia $this->num a 0 por que va a servir de indice para \n\t\t//la lista $this->categorias\n\t\t$this->num=0;\t\t\n\t\t$this->serv_cat_list=\"\";\n\t\t//con esta lista cogemos los checkbox que esten señalados en el formulario\n\t\t\n\t\t$this->get_checkbox_categories($categorias_bbdd,'services');\n\t\t\n\t\treturn 0;\n\t}", "function getPostCategory($post_categories){\n\n\t$newpost_cat_arr = [];\n\n\tforeach ($post_categories as $categorys){\n\n\t\tforeach ($categorys as $category){\n\n\t\t\t$cat_id = get_cat_ID($category);\n\n\t\t\tif ($cat_id != 0 ){\n\t\t\t\t$newpost_cat_arr[] = $cat_id;\n\t\t\t} else{\n\n\t\t\t\t$insertCategory = wp_insert_term($category, 'category', array());\n\n\t\t\t\t$newpost_cat_arr[] = $insertCategory['term_id'];\n\n\t\t\t}\n\n\t\t}\n\t}\n\n\treturn $newpost_cat_arr;\n}", "public static function kategori( $request ) {\n $innlegg = [];\n $posts = query_posts('posts_per_page=100&cat='. (int)$request->get_param('id') );\n global $post;\n\t while( have_posts() ) {\n\t the_post();\n\t $innlegg[] = self::_getPostDataFromWPOOPost( new WPOO_Post( $post ) );\n }\n \n return $innlegg;\n }", "protected function resolveCategories($request)\n {\n if (!is_array($request->categories)) {\n $categories = explode(',', $request->categories);\n } else {\n $categories = $request->categories;\n }\n return $categories;\n }", "function get_all_category_ids()\n {\n }", "public function get_cat_ids()\n {\n $categories = $this->categories\n ->where('is_active', '=', 1)\n ->find_all();\n\n $ids = [];\n\n foreach ($categories as $category) {\n if ($category->loaded()) {\n $ids[] = $category->id;\n }\n }\n\n return $ids;\n }", "public function categories()\n {\n // the passed URL path segments in the request.\n $categories = $this->request->getParam('pass');\n\n $posts = $this->Posts->find('categorized', [\n 'categories' => $categories\n ]);\n\n $this->set(['posts' => $posts, 'categories' => $categories]);\n\n }", "protected function set_category_ids() {\n\n\t\t$this->category_ids = isset( $_GET['category_ids'] ) ? array_filter( array_map( 'absint', (array) $_GET['category_ids'] ) ) : array();\n\t}", "function get_categories($id = ''){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function GetProductCategoryIds()\n\t\t{\n\t\t\treturn $this->loadCats;\n\t\t}", "public function get_ids()\n\t{\n\t\treturn $this->_cat_ids;\n\t}", "public function getProductCategoriesForASIN($request);", "public function getCategories (Request $request) {\n return $this->service->getAllCategories ();\n }", "public function getCategoryIds()\n {\n if (! $this->hasData('category_ids')) {\n $wasLocked = false;\n if ($this->isLockedAttribute('category_ids')) {\n $wasLocked = true;\n $this->unlockAttribute('category_ids');\n }\n $ids = $this->_getResource()->getCategoryIds($this);\n $this->setData('category_ids', $ids);\n if ($wasLocked) {\n $this->lockAttribute('category_ids');\n }\n }\n\n return (array) $this->_getData('category_ids');\n }", "public function get_post_categories() {\n\t\tglobal $posts;\n\t\t$categories_as_string = '';\n\n\t\t$categories = get_the_category( $posts[0]->ID );\n\t\tif ( is_array( $categories ) && ! empty( $categories ) ) {\n\t\t\t$category_names = wp_list_pluck( $categories, 'cat_name' );\n\t\t\t$categories_as_string = implode( ', ', $category_names );\n\t\t}\n\n\t\t/**\n\t\t * Filter the categories as derived by this function.\n\t\t *\n\t\t * @param string $categories_as_string The derived category list. Comma-separated list.\n\t\t * @param array $categories The array of post category objects.\n\t\t */\n\t\treturn apply_filters( 'amt_get_the_categories', $categories_as_string, $categories );\n\t}", "public function categories()\n {\n $new = $this->postterms->filter(function($term)\n {\n return $term->termtaxonomy->taxonomy == 'category';\n });\n\n return $new->map(function($term)\n {\n return $term->termtaxonomy->term; \n });\n }", "public function getPostsCategories()\n {\n return $this->postsCategories;\n }", "public function get_categories()\n {\n $param = array(\n 'delete_flg' => $this->config->item('not_deleted','common_config')\n );\n $groups = $this->get_tag_group();\n\n if (empty($groups)) return array();\n\n $group_id = array_column($groups, 'tag_group_id');\n $param = array_merge($param, array('group_id' => $group_id));\n\n $tags = $this->Logic_tag->get_list($param);\n\n return $this->_generate_categories_param($groups, $tags);\n }", "public function getInEventCategoryIds()\n {\n if ($this->_inEventCategoryIds === null) {\n /** @var Collection $collection */\n $collection = $this->_eventCollectionFactory->create();\n $this->_inEventCategoryIds = $collection->getColumnValues('category_id');\n }\n return $this->_inEventCategoryIds;\n }", "public function categories(Request $request)\n {\n $faqs = FrequentlyAskedQuestion::where('categories', 'like', '%'.$request->input('query').'%')->take(20)->latest()->get();\n $categories = array();\n $transformedCategories = array();\n\n $faqs->each(function($item, $key) use ($request, &$categories) {\n foreach ($item->categories as $category) {\n if (str_contains($category, $request->input('query')) && !in_array($category, $categories)) {\n array_push($categories, $category);\n }\n }\n });\n\n foreach ($categories as $category) {\n array_push($transformedCategories, [\n 'text' => $category,\n 'value' => $category\n ]);\n }\n\n return $transformedCategories;\n }", "public function category_ids ($post, $cats, $unfamiliar_category = 'create', $taxonomies = NULL, $params = array()) {\n\t\t$singleton = (isset($params['singleton']) ? $params['singleton'] : true);\n\t\t$allowFilters = (isset($params['filters']) ? $params['filters'] : false);\n\n\t\t$catTax = 'category';\n\n\t\tif (is_null($taxonomies)) :\n\t\t\t$taxonomies = array('category');\n\t\tendif;\n\n\t\t// We need to normalize whitespace because (1) trailing\n\t\t// whitespace can cause PHP and MySQL not to see eye to eye on\n\t\t// VARCHAR comparisons for some versions of MySQL (cf.\n\t\t// <http://dev.mysql.com/doc/mysql/en/char.html>), and (2)\n\t\t// because I doubt most people want to make a semantic\n\t\t// distinction between 'Computers' and 'Computers '\n\t\t$cats = array_map('trim', $cats);\n\n\t\t$terms = array();\n\t\tforeach ($taxonomies as $tax) :\n\t\t\t$terms[$tax] = array();\n\t\tendforeach;\n\n\t\tforeach ($cats as $cat_name) :\n\t\t\tif (strlen(trim($cat_name)) < 1) :\n\t\t\t\tcontinue;\n\t\t\tendif;\n\n\t\t\t$oTerm = new SyndicatedPostTerm($cat_name, $taxonomies, $post);\n\n\t\t\tif ($oTerm->is_familiar()) :\n\n\t\t\t\t$tax = $oTerm->taxonomy();\n\t\t\t\tif (!isset($terms[$tax])) :\n\t\t\t\t\t$terms[$tax] = array();\n\t\t\t\tendif;\n\t\t\t\t$terms[$tax][] = $oTerm->id();\n\n\t\t\telse :\n\n\t\t\t\tif ('tag'==$unfamiliar_category) :\n\t\t\t\t\t$unfamiliar_category = 'create:post_tag';\n\t\t\t\tendif;\n\n\t\t\t\tif (preg_match('/^create(:(.*))?$/i', $unfamiliar_category, $ref)) :\n\t\t\t\t\t$tax = $catTax; // Default\n\n\t\t\t\t\tif (isset($ref[2])\n\t\t\t\t\tand strlen($ref[2]) > 2) :\n\t\t\t\t\t\t$tax = $ref[2];\n\t\t\t\t\tendif;\n\n\t\t\t\t\t$inserted = $oTerm->insert($tax);\n\t\t\t\t\tif (!is_null($inserted)) :\n\t\t\t\t\t\tif (!isset($terms[$tax])) :\n\t\t\t\t\t\t\t$terms[$tax] = array();\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t$terms[$tax][] = $inserted;\n\t\t\t\t\telse :\n\n\t\t\t\t\tendif; // !is_null($inserted)\n\t\t\t\tendif; // preg_match(...)\n\n\t\t\tendif; /* ($oTerm->is_familiar()) */\n\t\tendforeach;\n\n\t\t$filtersOn = $allowFilters;\n\t\tif ($allowFilters) :\n\t\t\t$filters = array_filter(\n\t\t\t\t$this->setting('match/filter', 'match_filter', array()),\n\t\t\t\t'remove_dummy_zero'\n\t\t\t);\n\t\t\t$filtersOn = ($filtersOn and is_array($filters) and (count($filters) > 0));\n\t\tendif;\n\n\t\t// Check for filter conditions\n\t\tforeach ($terms as $tax => $term_ids) :\n\t\t\tif ($filtersOn\n\t\t\tand (count($term_ids)==0)\n\t\t\tand in_array($tax, $filters)) :\n\t\t\t\t$terms = NULL; // Drop the post\n\t\t\t\tbreak;\n\t\t\telse :\n\t\t\t\t$terms[$tax] = array_unique($term_ids);\n\t\t\tendif;\n\t\tendforeach;\n\n\t\tif ($singleton and count($terms)==1) : // If we only searched one, just return the term IDs\n\t\t\t$terms = end($terms);\n\t\tendif;\n\n\t\tFeedWordPress::diagnostic(\n\t\t\t'syndicated_posts:categories',\n\t\t\t'Category: MAPPED term names '.json_encode($cats).' to IDs: '.json_encode($terms)\n\t\t);\n\t\treturn $terms;\n\t}", "public function getCategories()\n {\n return $this->request(\"core_course_get_categories\");\n }", "function getCategories() {\n\t\t$answers = $this->getAnswers();\n\t\t$categories = array();\n\t\t\n\t\tforeach((array) $answers as $answer) {\n\t\t\t$question = $answer->getQuestion();\n\t\t\t$category = $question->getCategory();\n\t\t\t$categories[$category->getUID()] = $category;\n\t\t}\n\t\t\n\t\treturn $categories;\n\t}", "function wpsl_get_term_ids( $cat_list ) {\n\n $term_ids = array();\n $cats = explode( ',', $cat_list );\n\n foreach ( $cats as $key => $term_slug ) {\n $term_data = get_term_by( 'slug', $term_slug, 'wpsl_store_category' );\n\n if ( isset( $term_data->term_id ) && $term_data->term_id ) {\n $term_ids[] = $term_data->term_id;\n }\n }\n\n return $term_ids;\n}", "function get_categories($_catmask = null) {\n\t\t//$_start = ($_page-1)*$_items;\n\t\t$_query = \"SELECT * FROM t_category_posts\";\n\t\tif (isset($_catmask) && (is_array($_catmask))) {\n\t\t\t$idmask = '0';\n\t\t\tif (count($_catmask) > 0) $idmask = implode(',',$_catmask);\n\t\t\t$_query .= \" WHERE f_id IN ($idmask)\";\n\t\t}\n\t\t$query = $this->db->query($_query);\n return $query->result();\n\t}", "public function cgetAction(Request $request) {\n $repository = $this->getDoctrine()->getRepository(Category::class);\n $categories = $repository->findAll();\n\n return $categories;\n }", "public function getPostCategories($post_id=null)\n\t{\n\t\tif(is_null($post_id)){\n\t\t\t$this->logger->logError('No Post ID provided.','Input Error');\n\t\t\treturn false;\n\t\t}\n\t\t$q = \"SELECT in_categories.category_name FROM in_categories INNER JOIN in_posts_categories \";\n\t\t$q.= \"ON in_categories.id=in_posts_categories.category_id \"; \n\t\t$q.=\"WHERE in_posts_categories.post_id=:post_id\";\n\t\t$vars = array(\n\t\t\t\":post_id\"=>$post_id\n\t\t);\n\t\t$ps = $this->execute($q,$vars);\n\t\t$result = $this->getDataRowsAsArray($ps);\n\t\treturn $result;\n\t}", "public function categories() {\n\t\treturn $this->terms('category');\n\t}", "function add_categories(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public static function getCategoriesOptions()\n {\n return self::get('categories') ?: [];\n }" ]
[ "0.6574451", "0.65149295", "0.650191", "0.64733267", "0.64367276", "0.6369342", "0.63379025", "0.62997186", "0.6281136", "0.6272477", "0.62447727", "0.62176013", "0.61998785", "0.61902714", "0.61053264", "0.60955364", "0.6043584", "0.5954529", "0.5937874", "0.5910052", "0.5909613", "0.58902574", "0.58677506", "0.5864543", "0.58417994", "0.5833219", "0.5780729", "0.5780706", "0.57469845", "0.57389754" ]
0.67760575
0
Get tags ids for post from request.
public function getTagIdsFromRequest(FormRequest $request, TagRepository $tagRepo) { $tags = $this->getUniqueTags($request->get('tags', [])); $tagIds = []; $dbTags = $this->getTagsFromDbByName($tags, $tagRepo); foreach ($tags as $tagName) { if (array_key_exists($tagName, $dbTags)) { $tagIds[] = $dbTags[ $tagName ]; continue; } $model = $tagRepo->create($this->getTagDataForNewTagByTagName($tagName)); $tagIds[] = $model->id; } return $tagIds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function tagIDs()\n {\n return $this->tags()->pluck('tag_id');\n }", "public function get_tag_ids()\n {\n $tags = $this->tags->find_all();\n\n $ids = [];\n\n foreach ($tags as $tag) {\n if ($tag->loaded()) {\n $ids[] = $tag->id;\n }\n }\n\n return $ids;\n }", "public function getTagIds()\n {\n return $this->tags->lists('id')->toArray();\n }", "public function getIdsForTag($tag);", "function get_tags_ids()\n{\n $tmp_tags = array();\n $tags = get_tags();\n foreach ($tags as $tag) {\n array_push($tmp_tags, $tag['id']);\n }\n $tags = $tmp_tags;\n\n return $tags;\n}", "public function getSelectedTagsForPost()\n {\n $selectedIds = $this->getTags()->select(['id', 'name'])->all();\n return ArrayHelper::getColumn($selectedIds, 'name');\n }", "private function extractPostIds()\n {\n $postIds = [];\n $documentType = $this->getConfig()->getDocumentType();\n\n if ($this->searchResult !== null && isset($this->searchResult['records'][$documentType])) {\n foreach ($this->searchResult['records'][$documentType] as $hit) {\n $postIds[] = (int) $hit['external_id'];\n }\n }\n\n if (empty($postIds)) {\n $postIds = [0];\n }\n\n return $postIds;\n }", "private function parseTags($postBody)\n {\n preg_match_all(\"/#(\\\\w+)/\", $postBody, $tagnames);\n\n $tagIds = [];\n\n if (!empty($tagnames[1])) {\n foreach ($tagnames[1] as $tagname) {\n if (Tag::whereName($tagname)->get()->isEmpty()) {\n $tag = new Tag();\n $tag->name = $tagname;\n $tag->save();\n $tagIds[] = $tag->id;\n } else {\n $tag = Tag::whereName($tagname)->first();\n $tagIds[] = $tag->id;\n }\n $postBody = preg_replace(\"/(#\\\\w+)/\", '<a href=\"/tags/' . $tag->id . '\">${1}</a>', $postBody);\n }\n }\n\n return [$postBody, $tagIds];\n }", "public function getPostsByTags(Request $request) {\n $tags_id = $request->get('tags_id');\n $posts = Post::getPostsByTags($tags_id);\n return $this->responseJson('success', $posts);\n }", "private function getTags()\n {\n if ($this->entity === null) {\n return request()->old('tags', []);\n }\n\n return request()->old('tags', $this->entity->tags->pluck('slug')->toArray());\n }", "private function getTagIds($tags) {\n return array_map(\n function($tag) {\n return $tag->target_id;\n },\n $tags\n );\n }", "public function tags()\n {\n $new = $this->postterms->filter(function($term)\n {\n return $term->termtaxonomy->taxonomy == 'post_tag';\n });\n\n return $new->map(function($term)\n {\n return $term->termtaxonomy->term; \n });\n }", "public function getTagsAttribute()\n {\n if (isset($this->attributes['tag_ids']) && is_string($this->attributes['tag_ids'])) {\n $tags = [];\n $ids = json_decode($this->attributes['tag_ids']);\n\n foreach ($ids as $id) {\n $tags[] = Tag::find($id);\n }\n\n return $tags;\n }\n return [];\n }", "function post_ids() {\n\n\t\t$media_location = $this->media_location();\n\n\t\tif ( ! $media_location )\n\t\t\treturn array();\n\n\t\t$media_files = $media_location->media_files();\n\n\t\tif ( ! count( $media_files ) )\n\t\t\treturn array();\n\n\t\t// fetch releases\n\t\t$episode_ids = array_map( function ( $v ) { return $v->episode_id; }, $media_files );\n\t\t$episodes = Episode::find_all_by_where( \"id IN (\" . implode( ',', $episode_ids ) . \")\" );\n\n\t\treturn array_map( function ( $v ) { return $v->post_id; }, $episodes );\n\t}", "public function get_post_tags() {\n\t\tglobal $posts;\n\t\t$tags_as_string = '';\n\n\t\t$tags = get_the_tags( $posts[0]->ID );\n\t\tif ( is_array( $tags ) && ! empty( $tags ) ) {\n\t\t\t$tag_names = wp_list_pluck( $tags, 'name' );\n\t\t\t$tags_as_string = implode( ', ', $tag_names );\n\t\t}\n\t\t// MD: This is done to tags but not categories, Should not be done here IMHO.\n\t\t// $tag_list = strtolower( rtrim( $tag_list, ' ,' ) );\n\n\t\t/**\n\t\t * Filter the categories as derived by this function.\n\t\t *\n\t\t * @param string $tags_as_string The derived tag list. Comma-separated list.\n\t\t * @param array $tags The array of post tag objects.\n\t\t */\n\t\treturn apply_filters( 'amt_get_the_tags', $tags_as_string, $tags );\n\t}", "public function getSubmittedTags()\n {\n $data = $this->getSubmittedVariableByName('item_tags');\n $tags = explode(', ', $data);\n\n $submitted_tags = array_filter($tags, [$this, '_remove_empty_internal']);\n $saved_tags = $this->sessionGet('tags');\n\n if (empty($saved_tags) OR !is_array($saved_tags)) {\n $saved_tags = [];\n }\n\n $all_tags = array_unique(array_merge($saved_tags, $submitted_tags));\n\n foreach ($all_tags as $tag_item) {\n $this->addToVariable('user_tags', $tag_item);\n }\n\n return $all_tags;\n }", "private function _get_tags_ids_array()\n\t{\n\t\t$data = array();\n\n\t\t$sql = \"select group_concat(id_tag) as ids from \" . $this->get_table();\n\n\t\t$query = $this->{$this->db_group}->query($sql);\n\n\t\tif ( $query->num_rows() > 0)\n\t\t{\n\t\t\t$result = $query->row_array();\n\t\t\tif ( ! is_null($result['ids']))\n\t\t\t{\n\t\t\t\t$data = explode(',', $result['ids']);\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "public function addTagsToPost(Request $request, $id) {\n $tags_id = $request->get('tags_id');\n foreach($tags_id as $tag_id) {\n // check tag is exist\n if(PostTag::where('post_id', $id)->where('tag_id', $tag_id)->count() == 0) {\n $postTag = new PostTag();\n $postTag->post_id = $id;\n $postTag->tag_id = $tag_id;\n $postTag->save();\n }\n }\n $post = Post::findOrFail($id)->load('tags');\n\n return $this->responseJson('success', $post);\n }", "public function getIdentities()\n {\n $tags = [];\n if ($this->getId()) {\n $tags[] = self::CACHE_TAG . '_' . $this->getId();\n }\n return $tags; \n }", "function tags() {\n\n\t\t$preloader = pb_query_preloader::getInstance();\n\t\t$preloadRow = $preloader->getPreloadArticleTag($this->id);\n\n\t\tif ($preloadRow) {\n\t\t\t$rows = $preloadRow;\n\t\t} else {\n\t\t\tglobal $polarbear_db;\n\t\t\t$sql = \"SELECT tagID FROM \" . POLARBEAR_DB_PREFIX . \"_article_tag_relation WHERE articleID = '$this->id'\";\n\t\t\t$rows = $polarbear_db->get_results($sql);\n\t\t}\n\n\t\t$arrTags = array();\n\t\tif ($rows) {\n\t\t\tforeach ($rows as $row) {\n\t\t\t\t$arrTags[] = polarbear_tag::getInstance($row->tagID);\n\t\t\t}\n\t\t}\n\n\t\tpb_pqp_log_speed(\"article tags()\");\n\n\t\treturn $arrTags;\n\t}", "public function getPostIDs() {\n\t\treturn self::getAllPostIDs($this->threadID);\n\t}", "public function getTags()\n {\n return $this->data['fields']['tags'];\n }", "public function getIdsWithTag(string $tag): array\n {\n return array_reduce(\n $this->findWithTag($tag),\n function ($carry, Definition $definition) {\n array_push($carry, $definition->getId());\n return $carry;\n },\n []\n );\n }", "protected function getThreadIdsFromRequest(Request $request)\n {\n return $request->request->get('selected_threads', []);\n }", "private function createTagToIdArray()\n {\n $labelToIdArray = [];\n\n $allTags = $this->tag->findAll();\n foreach ($allTags as $tag) {\n $labelToIdArray[$tag->label] = $tag->id;\n }\n\n return $labelToIdArray;\n }", "private function get_tags()\n\t{\n\t\t$this->n_tags = true;\n\t\treturn $this->m_tags;\n\t}", "private function get_tags()\n\t{\n\t\t$this->n_tags = true;\n\t\treturn $this->m_tags;\n\t}", "public function getTags();", "public function getTags();", "public function getTags();" ]
[ "0.67871934", "0.6762219", "0.6688502", "0.6657141", "0.66525394", "0.63873804", "0.63694555", "0.6306646", "0.62731993", "0.62143975", "0.6075703", "0.60278416", "0.6018238", "0.6002142", "0.5958248", "0.5946304", "0.5917022", "0.5915156", "0.5885566", "0.5851368", "0.5833317", "0.58204514", "0.58106774", "0.58082056", "0.573706", "0.57367", "0.57367", "0.57196385", "0.57196385", "0.57196385" ]
0.70384735
0
Get blog tags from database by names.
private function getTagsFromDbByName($tags, TagRepository $tagRepo) { $dbTags = $tagRepo->whereNamesInArrayPluckedByNameAndId($tags); return $this->arrayChangeKeyCaseUnicode($dbTags); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function tags($name){\n\n\n\t $postsWithTag= WinkTag::with('posts')\n\t\t\t\t\t\t->where('name',$name)\n\t\t\t\t\t\t->orderBy('created_at', 'DESC')\n\t\t\t\t\t\t->simplePaginate(10);\n\n\t $posts =[];\n\n\t foreach ( $postsWithTag as $post ) {\n\n\t $posts = $post->posts;\n\n\t }\n\n\t return $posts;\n\n\t}", "public function findTagsByName($name)\n {\n return Tag::where('name', 'like', \"%$name%\")->take(5)->get();\n }", "public function getTags()\n {\n try {\n $statement = $this->database->prepare('SELECT name FROM tags ORDER BY name');\n $statement->execute();\n $tags = array_map(function($t) { return $t['name'];}, $statement->fetchAll());\n } catch (Exception $e) {\n $e->getMessage();\n }\n \n return $tags;\n }", "public static function get_tags() {\n global $wpdb;\n $query = \"SELECT * FROM XTB_TAGS\";\n return $wpdb->get_results($query);\n }", "function gettags($mask=\"\")\r\n\t{\r\n\t\t$where = ($mask!=\"\")?\" name like '%$mask%' AND\":\"\";\r\n\t\t$query = 'SELECT * FROM #__flexicontent_tags WHERE '.$where.' published = 1 ORDER BY name';\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$tags = $this->_db->loadObjectlist();\r\n\t\treturn $tags;\r\n\t}", "public function getAllTags()\n {\n\n $sql = \"\n\t\t\tSELECT * FROM tags\n\t\t\tORDER BY name ASC\n\t\t\";\n\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n $result = $query->fetchAll();\n\n foreach ($result as $tag) {\n\n $this->tags[$tag['id']] = $tag['name'];\n\n }\n\n return $this->tags;\n }", "function listOfAllTags() {\n\t//connecting to the database\n\t$conn = new mysqli('localhost','boubou','boubou','edel') or die('Error connecting to MySQL server.');\n\n\t// making the querry\n\t$dbQuery = \"SELECT * FROM Tags ORDER BY Tags.tag_name\";\n\t$result = $conn->query($dbQuery);\n\n\tif(!$result) {\n\t\t\tdie(\"error listing tagpost of \" . $value . \" with this error \" . $conn->error);\n\t\t}\n\t//checking the result array for results\n\t$row = $result->fetch_array();\n\n\t//tag names array\n\t$tags = array();\n\t$i = 0;\n\twhile($row) {\n\t\t$tags[$i] = array(\"#\". $row['tag_name'], $row['tag_id']);\n\t\t$i++;\n\t\t$row = $result->fetch_array();\n\t}\n\n\t//closing the connection\n\t$conn->close();\n\n\t//return stuff\n\treturn $tags;\n}", "function sduconnect_tags($names) {\n $output = [];\n $vocab = 'tags';\n $names = array_filter(array_unique(array_map('trim', $names)));\n foreach ($names as $name) {\n $query = db_select('taxonomy_term_data', 'td')\n ->fields('td', ['tid'])\n ->condition('td.name', $name)\n ->range(0, 1);\n $v = $query->join('taxonomy_vocabulary', 'v', 'td.vid = v.vid');\n $query->condition(\"$v.machine_name\", $vocab);\n $tid = $query->execute()->fetchField();\n if (!$tid) {\n $vid = db_select('taxonomy_vocabulary', 'v')\n ->fields('v', ['vid'])\n ->condition('v.machine_name', $vocab)\n ->execute()\n ->fetchField();\n $term = (object) [\n 'name' => $name,\n 'vid' => $vid,\n 'vocabulary_machine_name' => $vocab,\n ];\n taxonomy_term_save($term);\n $tid = $term->tid;\n }\n $output[] = [\n 'tid' => $tid,\n ];\n }\n return $output;\n}", "function get_tags(){\n global $DB;\n\n $collection = $DB->get_record('tag_coll',['name' => PLUGINNAME]);\n if (!$collection->id) {\n throw new moodle_exception('pluginname', 'local_tematica');\n }\n $tags = $DB->get_records('tag', ['tagcollid' => $collection->id]);\n return $tags;\n}", "function get_tag_by_name($name)\n{\n $CI =& get_instance();\n $CI->db->where('name', $name);\n\n return $CI->db->get('tbltags')->row();\n}", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTagsByDbIds($tagIds){\n $tagIds = implode(',', $tagIds);\n $url = $this->_entriesUrl() . \"&content_type=category&fields.adminTagId[in]={$tagIds}&order=fields.tagPageListingOrder\";\n $results = $this->_curlRequest($url);\n\n\n return $results['total'] > 0 ? $results['items'] : [];\n }", "function getTags() {\n\t\t$db = Database::getInstance();\n\t\t$mysqli = $db->getConnection();\n\t\t\n\t\t$tagsArray = array();\n\t\t\t$sql_query = \"select tagnaam,tagid from tag where status=6\";\n\t\t\t$result = $mysqli->query($sql_query);\n\t\t\t\n\t\t\twhile ( $row = $result->fetch_object () ) {\n\t\t\t\t$Tag = new Tag();\n\t\t\t\t$Tag->tagId = $row->tagid;\n\t\t\t\t$Tag->tagName = $row->tagnaam;\n\t\t\t\tarray_push($tagsArray, $Tag);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$result->close();\n\t\t\treturn $tagsArray;\n\t}", "public function findAll() {\n $sql = \"select * from tags\";\n $results = $this->getDb()->fetchAll($sql);\n\n $tags = array();\n\n foreach ($results as $row) {\n $tags[] = $this->buildDomainObject($row);\n }\n return $tags;\n }", "public function tags();", "public function getTags()\n {\n $resultArray = [];\n $tagConnects = TagConnect::photo($this->id);\n if($tagConnects->isEmpty()) {return [];}\n foreach($tagConnects as $tagConnect) {\n $idsArray[] = $tagConnect->id;\n }\n $tags = Tag::whereIn('id', $idsArray)->get();\n foreach($tags as $tag) {\n $resultArray[] = $tag->word;\n }\n return $resultArray;\n }", "function getAllTags()\n{\n\t$sql = \"SELECT tags FROM `\".DB_NAME.\"`.`resources`\";\n\t\n\t$result = mysql_query($sql);\n\tif($result)\n\t{\n\t\t$tagArray = array();\n\t\t$tagCount = array();\n\t\t\n\t\twhile($resData = mysql_fetch_row($result))\n\t\t\tforeach(dcSemicolonStringToArray($resData[0]) as $tag)\n\t\t\t\tif(($i = array_search($tag, $tagArray)) === false)\n\t\t\t\t{\n\t\t\t\t\tif($tag != \"\")\n\t\t\t\t\t{\n\t\t\t\t\tarray_push($tagArray, $tag);\n\t\t\t\t\tarray_push($tagCount, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t\t$tagCount[$i]++;\n\t\t\n\t\t$result = array();\n\t\t\n\t\tfor($i = 0; $i < count($tagArray); $i++)\n\t\t\tarray_push($result, array($tagArray[$i], $tagCount[$i]));\n\t}\n\t\n\treturn $result;\n}", "public function getTags() {\n\t\t$sql = \"SELECT tags FROM question\";\n\t\t$this->db->execute($sql);\n\t\treturn $this->db->fetchAll();\n\t}", "function getTagsX() {\r\n\t\t$query = 'SELECT DISTINCT t.name,'\r\n\t\t. ' CASE WHEN CHAR_LENGTH(t.alias) THEN CONCAT_WS(\\':\\', t.id, t.alias) ELSE t.id END as slug'\r\n\t\t. ' FROM #__flexicontent_tags AS t'\r\n\t\t. ' LEFT JOIN #__flexicontent_tags_item_relations AS i ON i.tid = t.id'\r\n\t\t. ' WHERE i.itemid = ' . (int) $this->_id\r\n\t\t. ' AND t.published = 1'\r\n\t\t. ' ORDER BY t.name'\r\n\t\t;\r\n\r\n\t\t$this->_db->setQuery( $query );\r\n\r\n\t\t$this->_tags = $this->_db->loadObjectList();\r\n\r\n\t\treturn $this->_tags;\r\n\t}", "function tags() {\n\n\t\t$preloader = pb_query_preloader::getInstance();\n\t\t$preloadRow = $preloader->getPreloadArticleTag($this->id);\n\n\t\tif ($preloadRow) {\n\t\t\t$rows = $preloadRow;\n\t\t} else {\n\t\t\tglobal $polarbear_db;\n\t\t\t$sql = \"SELECT tagID FROM \" . POLARBEAR_DB_PREFIX . \"_article_tag_relation WHERE articleID = '$this->id'\";\n\t\t\t$rows = $polarbear_db->get_results($sql);\n\t\t}\n\n\t\t$arrTags = array();\n\t\tif ($rows) {\n\t\t\tforeach ($rows as $row) {\n\t\t\t\t$arrTags[] = polarbear_tag::getInstance($row->tagID);\n\t\t\t}\n\t\t}\n\n\t\tpb_pqp_log_speed(\"article tags()\");\n\n\t\treturn $arrTags;\n\t}", "public function getAll() {\n $select = $this->select();\n $tags = $this->fetchAll($select);\n return $tags;\n }", "function get_post_list($conn_ptr, $table_prefix) {\n // Get a list of post_titles and post_names and store them in an array\n $sql=\"SELECT p.ID, p.post_title, p.post_name, p.post_date, p.post_modified FROM \".$table_prefix.\"posts p \n INNER JOIN \".$table_prefix.\"term_relationships r ON r.object_id=p.ID \n INNER JOIN \".$table_prefix.\"term_taxonomy t ON t.term_taxonomy_id = r.term_taxonomy_id \n INNER JOIN \".$table_prefix.\"terms wt on wt.term_id = t.term_id \n WHERE t.taxonomy='category' AND wt.slug='\" . $GLOBALS['site_persona'] . \"' AND p.post_type='page' AND p.post_status='publish' \";\n\n $result = $conn_ptr->query($sql);\n $rows = [];\n if ($result->num_rows > 0) {\n while ($row = $result->fetch_assoc()) \n array_push($rows, $row);\n }\n\n // Enrich the array with tags\n $erows = [];\n foreach ($rows as $row) {\n $sql=\"SELECT wt.name, t.taxonomy FROM \".$table_prefix.\"posts p \n INNER JOIN \".$table_prefix.\"term_relationships r ON r.object_id=p.ID \n INNER JOIN \".$table_prefix.\"term_taxonomy t ON t.term_taxonomy_id = r.term_taxonomy_id \n INNER JOIN \".$table_prefix.\"terms wt on wt.term_id = t.term_id \n WHERE t.taxonomy='post_tag' AND p.ID='\".$row[\"ID\"].\"'\";\n \n $tags = [];\n $result = $conn_ptr->query($sql);\n if ($result->num_rows > 0) while ($wtrow = $result->fetch_assoc()) array_push($tags, $wtrow[\"name\"]);\n $row[\"post_tags\"]=$tags;\n array_push($erows, $row);\n }\n return $erows;\n}", "public function getTags()\n {\n $title = \"Tags\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n // Get all the tags from db\n $tags = $this->di->get(\"tagModel\")->getAllTags();\n\n $data = [\n //\"items\" => $book->findAll(),\n \"tags\" => $tags,\n ];\n\n $view->add(\"pages/tags\", $data);\n //$view->add(\"blocks/footer\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }", "function listOfTags($postID) {\n\t//connecting to the database\n\t$conn = new mysqli('localhost','boubou','boubou','edel') or die('Error connecting to MySQL server.');\n\n\t// making the querry\n\t$dbQuery = \"SELECT * FROM TagPosts INNER JOIN Tags ON TagPosts.tag_id = Tags.tag_id WHERE post_id='\".mysqli_real_escape_string($conn,$postID). \"' ORDER BY Tags.tag_name\";\n\t$result = $conn->query($dbQuery);\n\n\tif(!$result) {\n\t\t\tdie(\"error listing tagpost of \" . $value . \" with this error \" . $conn->error);\n\t\t}\n\t//checking the result array for results\n\t$row = $result->fetch_array();\n\n\t//tag names array\n\t$tagNames = array();\n\t$i = 0;\n\twhile($row) {\n\t\t$tagNames[$i] = array(\"#\".$row['tag_name'], $row['tag_id']);\n\t\t$i++;\n\t\t$row = $result->fetch_array();\n\t}\n\n\t//closing the connection\n\t$conn->close();\n\n\t//return stuff\n\treturn $tagNames;\n}", "function get_tags()\n{\n $CI = &get_instance();\n $CI->db->order_by('name', 'ASC');\n\n return $CI->db->get('tbltags')->result_array();\n}", "protected function tag($name)\n {\n $tag = Tag::whereName($name)->first();\n\n $presentIds = $tag ? $tag->presents()->pluck('present_id')->toArray() : [];\n\n return $this->builder->whereIn('id', $presentIds);\n }" ]
[ "0.7030865", "0.6910597", "0.68789256", "0.6794928", "0.6772174", "0.6723662", "0.6579492", "0.6535305", "0.6508257", "0.6470555", "0.6397102", "0.6397102", "0.6397102", "0.6397102", "0.6397102", "0.63221556", "0.631164", "0.6300045", "0.6297315", "0.6275284", "0.6265484", "0.62574965", "0.6243434", "0.6185654", "0.61764187", "0.617576", "0.61486584", "0.6136726", "0.61337894", "0.6131144" ]
0.69545245
1
Get unique tag names in lower case.
private function getUniqueTags($tags) { $tags = array_unique(array_map(function($value) { return mb_strtolower($value, 'UTF-8'); }, $tags)); return $tags; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getTagNames() {\n\t\tif (isset($this->tag_names)) {\n\t\t\treturn $this->tag_names;\n\t\t}\n\t\t\n\t\t$this->tag_names = tag_tools_rules_get_tag_names();\n\t\treturn $this->tag_names;\n\t}", "public function getNameTags() \n { \n $allTags = []; \n foreach($this->tags as $tag) {\n $allTags[] = $tag->name;\n }\n return $allTags;\n }", "public function tagNames()\n {\n return implode(',', $this->tags()->get()->pluck('name')->toArray());\n }", "protected function getTagClassNames()\n {\n $tags = array_map(function ($tag) {\n return str_slug($tag);\n }, explode('|', $this->get('tags')));\n\n return implode(' ', $tags);\n }", "public function tagNames()\n\t{\n\t\treturn $this->tags()->get()->lists('tag');\n\t}", "public function lowercaseTags() {\n if ( empty( $this->cleanedXML ) ) {\n trigger_error( \"Output has not yet been cleaned\", E_USER_NOTICE );\n }\n\n $this->cleanedXML = preg_replace( \"<(\\/?)([^<>\\s]+)>/Ue\", \"'<'.'\\\\1'.lc('\\\\2').'>'\", $this->cleanedXML );\n $this->cleanedXML = preg_replace( \"<(\\/?)([^<>\\s]+)(\\s?[^<>]+)>/Ue\", \"'<'.'\\\\1'.lc('\\\\2').'\\\\3'.'>'\", $this->cleanedXML );\n\n return $this->cleanedXML;\n }", "public function lowercase()\n {\n return $this->getNameInstance()->lowercase();\n }", "public function getTagName();", "public function getTagName() {}", "public function tagsNamesForInitial($initial);", "private function get_non_empty_tags_like_prefix()\n {\n return get_tags(array(\n 'name__like' => $this->instance['prefix']\n ,'order' => 'desc'\n ));\n }", "public static function get_tags() {\n return Tag::distinct()->orderBy('name', 'asc')->get();\n }", "private function createSimpleTags() {\n\n $tags_array = [];\n\n foreach ($this->tags->findAllTags() as $key => $value) {\n $tags_array[$value->id] = $value->name;\n }\n\n return $tags_array;\n }", "function normalize($tags) {\n //clean tags from strange characters\n $tags = str_replace(array('\"', '\\'', '/'), \"_\", $tags);\n\n //normalize\n if(!is_array($tags)) {\n $tags = utf8_strtolower(trim($tags));\n } else {\n $tags = array_filter($tags);//remove empty values\n foreach($tags as $i => $tag) {\n $tags[$i] = utf8_strtolower(trim($tags[$i]));\n }\n }\n return $tags;\n }", "public function getTagName() {\n return $this->tag_name;\n }", "public function getLowerName(): string\n {\n return strtolower($this->packageName);\n }", "public function toLower()\n {\n $lowerCase = [];\n foreach ($this->split() as $key => $value) {\n $lowerCase[] = strtolower($value);\n }\n\n return $lowerCase;\n }", "protected function template_names()\n {\n $templates = $this->get_meta_values();\n $names = array();\n \n foreach($templates as $template)\n {\n $name = explode(\"}}}\", $template);\n $names[] = str_replace('{{{', \"\", $name[0]);\n }\n \n natcasesort($names);\n return $names;\n }", "protected function getLowerNameReplacement()\n {\n return $this->theme->getLowerName();\n }", "function wp_post_tag_names(){\n \tglobal $wpdb;\n \t\n\t// Query all post tag names from database \n\t$query = $sql = \"SELECT `name`\"\n\t\t\t\t\t.\" FROM `wp_terms` AS wpt\"\n\t\t\t\t\t.\" JOIN `wp_term_taxonomy` AS wptt\"\n\t\t\t\t\t.\"\t ON wpt.term_id = wptt.term_id\"\n\t\t\t\t\t.\" WHERE\"\n\t\t\t\t\t.\"\t wptt.taxonomy = 'post_tag'\";\n \t$get_tags_array = $wpdb->get_results($query);\n\t\n\t// Extract name of the post tags\n\tforeach($get_tags_array as $row => $tag_name) {\n\t\t$name = $tag_name->{'name'};\n\t\t//place the names in an array\n\t\t$tags_array[] = $name;\n\t}\n\t\n\t//Sort the names in the array and place the names in the HTML tag\n\tsort($tags_array);\n\t$tags_html = \"\";\n\t\n\tforeach($tags_array as $name){\n\t\t$tags_html.= \"<option value='\" . $name . \"'>\". str_replace(\"_\", \" \", $name) .\"</option>\";\n\t}\n\t\n\treturn $tags_html;\n}", "public function tagsInitials();", "public static function getNames()\n\t{\n\t\t$list = [];\n\t\tforeach (self::getCodes() as $code)\n\t\t{\n\t\t\t$list[$code] = Base::getNameByCode($code);\n\t\t}\n\n\t\treturn $list;\n\t}", "static public function allNames()\n\t{\t\n\t\t$categories = PhotoCategory::all();\n\t\t\n\t\t$names = array();\n\t\t\n\t\t$categories->map(function($value) use (&$names)\n\t\t{\n\t\t\t$id = $value['id'];\n\t\t\t$names[$id] = $value['name'];\n\t\t});\n\t\t\n\t\treturn $names;\n\t}", "protected function parse_tags_field_keys( $tags ) {\n\t\t$data = $this->parse_tags_field( $tags );\n\n\t\treturn array_combine( array_map( 'strtolower', $data ), $data );\n\t}", "public function getTagName() : string\n {\n return $this->tagName;\n }", "protected function getLowerNameReplacement(): string\n {\n return strtolower($this->getName());\n }", "public function token_the_tags() {\n\t\treturn implode( ', ', wp_list_pluck( (array)get_the_tags(), 'name' ) );\n\t}", "protected function getHumanTags()\n {\n $tags = explode('|', $this->get('tags'));\n\n return implode(' & ', $tags);\n }", "protected function names()\n {\n $names = [];\n\n foreach ($this->data as $key => $value) {\n if (is_int($key)) {\n $names[$value] = str_replace(['-', '_'], ' ', ucfirst(trim($value)));\n } else {\n $names[$key] = $value;\n }\n }\n\n return $names;\n }", "public function getTagsHeaderName()\n {\n return $this->headerFormatter->getTagsHeaderName();\n }" ]
[ "0.6823132", "0.6629779", "0.6608012", "0.6542607", "0.648649", "0.6417229", "0.62563574", "0.62129396", "0.6072404", "0.606155", "0.6042667", "0.6026047", "0.5939413", "0.5913699", "0.5911372", "0.59107596", "0.58727634", "0.5865646", "0.5858633", "0.58375734", "0.5785564", "0.5761834", "0.57571626", "0.5749636", "0.57038724", "0.5696138", "0.56930095", "0.5682641", "0.56699896", "0.5659335" ]
0.71891963
0
Delete post image dir.
public function deleteImageDir($postId) { Storage::deleteDirectory('public/' . Post::getFilePath($postId)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleting(Post $post)\n {\n if ($post->image) {\n Storage::delete([$post->image->url]);\n }\n }", "public function delete()\n {\n $post_id = $this->uri->rsegment('3');\n $this->_del($post_id);\n $image = $this->input->get('image');\n unlink(\"upload/post\".$image);\n // thong bao xoa thanh cong\n $this->session->set_flashdata('message', 'Xóa thành công tin tức này');\n redirect(admin_url('blog'));\n }", "public function destroy($id){\n $post=Post::find($id);\n $image=$post->path;\n $post->delete();\n if($image!=NULL)\n File::delete($image);\n\n\n\n \n \n //\n }", "public function deleting(Post $post)\n {\n $fileName = $post->getFileName();\n\n if (null !== $fileName) {\n $this->deleteObsoleteImage($fileName);\n }\n\n $post->categories()->sync([]);\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "function delete_image() {\n\tif(isset($_POST['remove'])){\n\t\tglobal $wpdb;\n\t\t$img_path = $_POST['path'];\n\n\t\t// We need to get the images meta ID.\n\t\t$query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n\t\t$results = $wpdb->get_results($query);\n\n\t\t// And delete it\n\t\tforeach ( $results as $row ) {\n\t\t\twp_delete_attachment( $row->ID ); //delete the image and also delete the attachment from the Media Library.\n\t\t}\n\t\tdelete_option('pochomaps_map_image'); //delete image path from database.\n\t}\n}", "public static function deleteImage(){}", "public function destroy(Post $post)\n {\n if (Storage::has('website/posts/' . $post->id) and $post->image !=\"website/default.png\") {\n\n Storage::delete(str_replace('storage','',$post->image));\n\n if (is_dir(public_path('storage/website/posts/' . $post->id))) {\n rmdir(public_path('storage/website/posts/' . $post->id)); // delete the folder id of post\n }\n }\n\n $post->delete();\n\n request()->session()->flash('msgSuccess', 'تم حذف المقال بنجاح');\n return redirect(adminUrl('posts'));\n }", "public function destroy(Post $post)\n {\n $this->middleware('auth');\n Storage::disk('uploads')->delete($post->img_name);\n $post->delete();\n return \"Done !\";\n }", "public function remove_dir() {\n\n $path = $this->get_upload_pres_path();\n\n //append_debug_msg($path);\n\n if(!$path || !file_exists($path)){ return; }\n delete_dir($path);\n }", "function delete($image, $path) {\n\t\tif($path) {\n\t\t\t$path = $path.DS;\n\t\t}\n @unlink(Configure::read('__Site.upload_path').DS.$path.$image);\n\t}", "public function destroy(Post $post)\n {\n// unlink($category->image);\n $post->delete();\n return redirect(route('post.index'));\n }", "public function deletePost($id){\n\n\t\t$sql = new Sql;\n\t\t$sql->query('DELETE FROM user_has_post WHERE id = :id',[\":id\"=>$id]);\n\t\t\n\t\t$pathImgPost = $_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.\n\t\t\"files\".DIRECTORY_SEPARATOR.\n\t\t\"media\".DIRECTORY_SEPARATOR.\n\t\t\"users\".DIRECTORY_SEPARATOR.\n\t\t$_SESSION[User::SESSION]['iduser'].DIRECTORY_SEPARATOR.\n\t\t\"posts\".DIRECTORY_SEPARATOR.\n\t\t\"post_\".$id.\".jpg\";\n\t\t(is_file($pathImgPost)?unlink($pathImgPost):null);\n\n\t}", "public function destroy(Post $post)\n {\n $image_one=$post->post_image;\n $path_imgone=('/media/post/'. $image_one);\n $nn=File::delete(public_path($path_imgone));\n $post->delete();\n $notification = array(\n 'message' => 'Data Inserted Successfully', \n 'alert-type' => 'warning');\n return redirect('/blog/post')->with($notification);\n }", "public function destroy(Post $post)\n {\n\n $this->authorize('delete',$post);\n $post=Post::find($post->id);\n $this->delImage($post->img_url);\n $post->delete();\n $post->untag();\n $post->keywords()->detach();\n $file_path = public_path(\"storage/qrcodes/posts/$post->qr_img_url\");\n\n if(File::exists($file_path)) File::delete($file_path);\n return response()->json('Post deleted');\n }", "public function deletePostAction() {\n \t$id = $this->getInput('id');\n \tlist($info, $itemsList) = Admin_Service_Material::getById($id);\n \tif ($info && $info['id'] == 0) $this->failPostOutput('无法删除');\n \t$result = Admin_Service_Material::delete($id);\n \tif (!$result) $this->failPostOutput('操作失败');\n \t$attachPath = Common::getConfig('siteConfig', 'attachPath');\n \t$attachroot = Yaf_Application::app()->getConfig()->attachroot;\n \tforeach ($itemsList as $items) {\n \t\tUtil_File::del($attachPath.str_replace($attachroot, \"\", $items['image']));\n \t}\n \t$this->successPostOutput($this->actions['listUrl']);\n }", "public function actionDeletepimage()\n\t{\n\t $sessionimagesarr = array();\n\t if($_POST['type']=='1'){\n\t\t @unlink(Yii::getPathOfAlias('webroot').'/'.$_POST['path']);\n\t\t $thumbpath = str_replace(basename($_POST['path']), 'thumb/'.basename($_POST['path']),$_POST['path']);\n\t\t @unlink(Yii::getPathOfAlias('webroot').'/'. $thumbpath);\n\t\t }else{\n\t\t $images = Images::model()->findByPK($_POST['path']);\n\t\t @unlink( Yii::getPathOfAlias('webroot').'/'.$images->image_path );\n\t\t $thumbpath = str_replace(basename($images->image_path), 'thumb/'.basename($images->image_path),$images->image_path);\n\t\t @unlink(Yii::getPathOfAlias('webroot').'/'. $thumbpath);\n\t\t $images->delete();\n\t\t }\n\t \n\t\t echo 'Deleted';\n\t\t die;\n\t}", "public function destroy(Post $post)\n {\n $post->delete();\n unlink(public_path().Post::ATTACHMENT_PATH.'/'.$post->attachment);\n }", "public function deleteImage($path)\n {\n // $file_name = end($file);\n File::delete(public_path($path));\n // File::delete($file_name);\n }", "public function actionDelete($id)\n {\n $model = Post::find()->where(['post_id' => $id])->all();\n foreach($model[0]->getImages() as $image){\n $model[0]->removeImage($image);\n }\n FileHelper::removeDirectory('images/store/Posts/Post'.$id);\n\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function destroy(Post $post)\n {\n Storage::delete('public/post_images/' . $post->image);\n $post->delete();\n return redirect('/post')->with('error', 'Post deleted suceessfully.');\n }", "public function remove_image() {\n\t\t$this->join_name = \"images\";\n\t\t$this->use_layout=false;\n\t\t$this->page = new $this->model_class(Request::get('id'));\n\t\t$image = new WildfireFile($this->param(\"image\"));\n\t\t$this->page->images->unlink($image);\n\t}", "public function destroy(Post $post)\n {\n Storage::delete('public/' . $post->featured_image);\n $post->delete();\n return redirect()->back();\n }", "public function deleteImage(){\n if(file_exists($this->getImage())){\n unlink($this->getImage());\n }\n $this->setImage(null);\n }", "public function deleteDirPhoto() {\n if(is_file($this->getLinkplan())){\n unlink($this->getLinkplan());\n }\n return (rmdir($this->dirPhoto));\n }", "public function destroy($id)\n {\n // $post = Post::find($id);\n $post = Post::findOrFail($id);\n // Check for correct user \n if(Auth::user()->id !== $post->user_id){\n\n return redirect('/posts')->with('error', 'Nije moguce');\n } \n // Delete image from folder\n $user = auth()->user()->name;\n \n // $img = $post['image'];\n if ($post->image != 'noimage.jpg') {\n\n // Storage::delete('public/images/'.$post->image); // Working if img is in images folder\n Storage::delete('public/images/'.$user.'/'.$post->image); // This is working like charm, deleting img from user folder\n }\n $post->delete();\n\n return redirect('/posts')->with('success','You have successfully deleted a post.');\n }", "function delete () {\n $this->clearCache ();\n commentaire::deletePhoto ($this->dir, $this->file);\n return files::deleteFile (luxbum::getFsPath ($this->dir) . $this->file);\n }", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function delete_file(){\n unlink('/opt/lampp/htdocs/specijalisticki_rad/uploaded_images/'.$this->name);\n\n }", "public function delete1(Request $request)\n {\n /*\n $id= $request->input('id');\n\n $del = Modelpost::findorfail($id);\n\n $del->delete();\n\n if($del->image != 'noimage.jpg'){\n //delete image file\n Storage::delete('public/posts/'.$del->image);\n }\n\n return redirect('/manage-post')->with('done','Post Deleted Successfully!');\n*/\n }" ]
[ "0.7184746", "0.71389914", "0.70402676", "0.698791", "0.69734347", "0.6966473", "0.68978524", "0.6895776", "0.6871979", "0.6847922", "0.6832268", "0.6820418", "0.669043", "0.66575927", "0.6638194", "0.6626801", "0.66223365", "0.6608945", "0.6603633", "0.6598827", "0.65981334", "0.659223", "0.6581024", "0.6535389", "0.65315855", "0.65213", "0.65081704", "0.6487833", "0.64837337", "0.6482259" ]
0.78136164
0
Get map data. Report folder returns only a list object. Template returns whole map or the list object if variable name is specified in argument.
public function getMap($var = null) { switch ($this->type) { // Report folder case 'rfolder': return $this->maps['rfolder']; break; // Template case 'template': if (!isset($var) || strlen($var) == 0) return $this->maps; else return $this->maps[$var]; break; default: throw new WSS_Exception('W3S_NodeData-err_get_map', array(), 'Unable to get map from this node type.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function renderMapGetTemplateOxMap( $template )\n {\n $arr_return = array();\n $arr_return[ 'error' ] = false;\n\n // map hash key\n $mapHashKey = '###MAP###';\n\n // Get the template\n $mapTemplate = $this->pObj->cObj->fileResource( $this->confMap[ 'template.' ][ 'file' ] );\n\n // RETURN : no template file\n if ( empty( $mapTemplate ) )\n {\n // DRS - Development Reporting System\n if ( $this->b_drs_error )\n {\n $prompt = 'There is no template file. Path: navigation.map.template.file.';\n t3lib_div::devLog( '[ERROR/DRS] ' . $prompt, $this->extKey, 3 );\n $prompt = 'ABORTED';\n t3lib_div::devLog( '[ERROR/DRS] ' . $prompt, $this->extKey, 0 );\n }\n // DRS - Development Reporting System\n // Error message\n $str_map = '<h1 style=\"color:red;\">'\n . $this->pObj->pi_getLL( 'error_readlog_h1' )\n . '</h1>'\n . '<p style=\"color:red;font-weight:bold;\">'\n . $this->pObj->pi_getLL( 'error_template_map_no' )\n . '</p>';\n // Error message\n // Replace the map marker in the template of the parent object\n $template = str_replace( $mapHashKey, $str_map, $template );\n // RETURN the template\n $arr_return[ 'error' ] = true;\n $arr_return[ 'template' ] = $template;\n return $arr_return;\n }\n // RETURN : no template file\n // Get the subpart\n $str_marker = '###TEMPLATE_MAP###';\n $mapTemplate = $this->pObj->cObj->getSubpart( $mapTemplate, $str_marker );\n // Get the subpart\n // RETURN: no subpart marker\n if ( empty( $mapTemplate ) )\n {\n // DRS - Development Reporting System\n if ( $this->b_drs_error )\n {\n $prompt = 'Template doesn\\'t contain the subpart ###TEMPLATE_MAP###.';\n t3lib_div::devLog( '[ERROR/DRS] ' . $prompt, $this->extKey, 3 );\n t3lib_div::devLog( '[ERROR/DRS] ABORTED', $this->extKey, 0 );\n }\n // DRS - Development Reporting System\n // Error message\n $str_map = '<h1 style=\"color:red;\">' .\n $this->pObj->pi_getLL( 'error_readlog_h1' ) .\n '</h1>\n <p style=\"color:red;font-weight:bold;\">' .\n $this->pObj->pi_getLL( 'error_template_map_no_subpart' ) .\n '</p>';\n // Error message\n // Replace the map marker in the template of the parent object\n $template = str_replace( $mapHashKey, $str_map, $template );\n // RETURN the template\n $arr_return[ 'error' ] = true;\n $arr_return[ 'template' ] = $template;\n return $arr_return;\n }\n // RETURN: no subpart marker\n // RETURN : the template\n $arr_return[ 'template' ] = $mapTemplate;\n return $arr_return;\n }", "public function get_map( $template )\n {\n//$this->pObj->dev_var_dump( $this->pObj->rows );\n $this->rowsBackup();\n\n // init the map\n $this->init();\n\n // RETURN: map isn't enabled\n switch ( true )\n {\n case( $this->mapLLleafletIsEnabled()):\n // Follow the workflow\n break;\n case( empty( $this->enabled ) ):\n case( $this->enabled == 'disabled'):\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'RETURN. Map is disabled.';\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n $this->rowsReset();\n return $template;\n default:\n // Follow the workflow\n break;\n } // RETURN: map isn't enabled\n // DRS\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'The map module uses a JSON array. If you get any unexpected result, ' .\n 'please remove config.xhtml_cleaning and/or page.config.xhtml_cleaning ' .\n 'in your TypoScript configuration of the current page.';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 2 );\n $prompt = 'The map module causes some conflicts with AJAX. Please disable AJAX in the ' .\n 'plugin/flexform of the browser.';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 2 );\n }\n // DRS\n//$this->pObj->dev_var_dump( $this->pObj->rows[ 0 ] );\n\n if ( $this->enabled == 'Map +Routes' )\n {\n $arr_result = $this->renderMapRoute();\n //$this->pObj->dev_var_dump( $arr_result );\n switch ( true )\n {\n case( empty( $arr_result[ 'marker' ] ) ):\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'There isn\\'t any marker row!';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 3 );\n }\n break;\n case(!empty( $arr_result[ 'marker' ] ) ):\n default:\n // #i0020, 130718, dwildt\n $this->pObj->rows = $arr_result[ 'marker' ];\n break;\n }\n $jsonRoutes = $arr_result[ 'jsonRoutes' ];\n unset( $arr_result );\n } // if Map +Routes is enabled\n\n $template = $this->initMapMarker( $template ); // add map marker, if marker is missing\n\n $template = $this->renderMap( $template );\n\n // RETURN map (without Routes)\n if ( $this->enabled != 'Map +Routes' )\n {\n // RETURN the template\n $this->rowsReset();\n return $template;\n } // RETURN map (without Routes)\n\n $mode = $this->confMap[ 'compatibility.' ][ 'mode' ];\n if ( $mode != 'oxMap (deprecated)' )\n {\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'map mode isn\\'t ' . $mode . '. Map +Routes will not handled.';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 3 );\n }\n $this->rowsReset();\n return $template;\n } // RETURN map (without Routes)\n\n switch ( true )\n {\n case( empty( $jsonRoutes ) ):\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'JSON array for the variable routes is empty!';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 3 );\n }\n break;\n case(!empty( $jsonRoutes ) ):\n default:\n $template = str_replace( \"'###ROUTES###'\", $jsonRoutes, $template );\n break;\n }\n\n // RETURN map (with Routes)\n $this->rowsReset();\n return $template;\n }", "private function renderMapGetTemplate( $template )\n {\n $this->mapLLleafletIsEnabled();\n $arr_return = array();\n $mode = $this->mapLLleafletIsEnabled();\n\n switch ( $mode )\n {\n case(false):\n $arr_return = $this->renderMapGetTemplateOxMap( $template );\n break;\n case(true):\n default:\n $arr_return = $this->renderMapGetTemplateLeaflet( $template );\n break;\n }\n return $arr_return;\n }", "function getMaps(){\r\n require $this->sRessourcesFile;\r\n if (in_array(\"maps\", $this->aSelectedFields)){\r\n $aParams['sSchemaVmap'] = array('value' => $this->aProperties['schema_vmap'], 'type' => 'schema_name');\r\n $aParams['group_id'] = array('value' => $this->aValues['my_vitis_id'], 'type' => 'number');\r\n $oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getGroupMaps'], $aParams);\r\n\t\t$sListMapId = \"\";\r\n\t\t$aListMapName = array();\r\n\t\twhile($aLigne=$this->oConnection->oBd->ligneSuivante ($oPDOresult)) {\r\n\t\t\tif ($sListMapId == \"\"){\r\n\t\t\t\t$sListMapId = $aLigne[\"map_id\"];\r\n\t\t\t}else{\r\n\t\t\t\t$sListMapId .= \"|\".$aLigne[\"map_id\"];\r\n\t\t\t}\r\n $aListMapName[] = $aLigne[\"name\"];\r\n\t\t}\r\n\t\t$oPDOresult=$this->oConnection->oBd->fermeResultat();\r\n $this->aFields['maps'] = $sListMapId;\r\n $this->aFields['maps_label'] = implode(',', $aListMapName);\r\n }\r\n }", "function showMap() {\n\t\t$this->initMap();\n\n\t\t$template['list'] = $this->cObj2->getSubpart($this->templateCode,'###MAP###');\n\n\t\t// title, text - markers\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $this->conf['map.']['LL'], 'map');\n\t\t$markerArray['###CAT_MENU###'] \t\t= $this->displayCatMenu(0);\n\t\t$markerArray['###CAT_LIST###'] \t\t= ($this->config['categoriesActive']!='') ? $this->config['categoriesActive'] : '9999';\n\t\t$markerArray['###MAP_WIDTH###'] \t= $this->config['mapWidth'];\n\t\t$markerArray['###MAP_HEIGHT###']\t= $this->config['mapHeight'];\n\n\t\t$content = $this->cObj2->substituteMarkerArrayCached($template['list'],$markerArray, $subpartArray,$wrappedSubpartArray);\n\t\treturn $content;\n\t}", "private function renderMapMarkerLeaflet( $template, $mapTemplate )\n {\n $mapHashKey = '###MAP###';\n $this->renderMapMarkerSnippetsHtmlCategories( $mapTemplate );\n $this->renderMapMarkerSnippetsHtmlDynamic( $mapTemplate );\n $templateWoMarker = $this->renderMapMarkerWoMarker( $mapHashKey, $template );\n if ( $templateWoMarker )\n {\n// var_dump( __METHOD__, __LINE__ );\n// die( ':(' );\n return $templateWoMarker;\n }\n // Add data\n $mapTemplate = $this->renderMapMarkerVariablesSystem( $mapTemplate );\n //var_dump( __METHOD__, __LINE__, $mapTemplate);\n $arr_return = $this->mapLLjss( $template, $mapTemplate );\n return $arr_return;\n }", "function showRecordsOnMap () {\n\t\t$template['list'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE_RECORDSONMAP###');\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $this->conf['recordsOnMap.']['LL'], 'recordsonmap');\n\n\t\t$content = $this->cObj->substituteMarkerArrayCached($template['list'],$markerArray);\n\t\treturn $content;\n\t}", "protected function getTemplateMarkers() {}", "protected function getTemplateMarkers() {}", "public function mapping_list()\n {\n /*Create Breadcumb*/\n $this->make_bread->add('Lead Routing Mapping', '', 0);\n $arrData['breadcrumb'] = $this->make_bread->output();\n /*Create Breadcumb*/\n\n $arrData['mappinglist'] = $this->master->mapping_list();\n return load_view(\"Rapc/mapping_list\",$arrData);\n }", "public function tilemap() {\n $this->tilesdir = ROOT . DS . \"Data\" . DS . \"tiles\";\n\n // Set the Content-Type to text/xml\n $this->response->type('text/xml');\n // Do not autoRender\n //$this->autoRender = false;\n // Get the layer parameter\n if (isset($this->request->params['layer'])) {\n $layer = $this->request->params['layer'];\n } else {\n throw new NotFoundException(\"Missing layer parameter.\");\n }\n\n // Url to the TileMapService resource\n $tileMapService = \"http://\" . $this->request->host() . DS . $this->rootService\n . DS . $this->tileMapService . DS;\n\n // Get the tilemapresource.xml file for the layer\n $resourceFile = $this->tilesdir .DS . $layer . DS . \"tilemapresource.xml\";\n if (!is_readable($resourceFile)) {\n throw new NotFoundException(\"Layer metadata not found.\");\n }\n\n // Open the xml file\n $doc = new DOMDocument();\n $doc->load($resourceFile);\n\n $root = $doc->getElementsByTagName('TileMap')->item(0);\n $root->setAttribute(\"tilemapservice\", $tileMapService);\n\n // Loop all TileSets\n $tileSetsNodeList = $root->getElementsByTagName('TileSets');\n $tileSetNodeList = $tileSetsNodeList->item(0)->getElementsByTagName('TileSet');\n for ($i = 0; $i < $tileSetNodeList->length; $i++) {\n $tileSet = $tileSetNodeList->item($i);\n $zoomLevel = $tileSet->getAttribute('order');\n $zoomUrl = $tileMapService . \"$layer/$zoomLevel\";\n $tileSet->setAttribute(\"href\", $zoomUrl);\n }\n\n $this->set('content', $doc);\n }", "protected function getMap($name = null)\n {\n $map = data_get($this->cl_map,$name,null);\n return $map;\n }", "private function renderMap( $template )\n {\n // RETURN : HTML template is not proper\n $arr_result = $this->renderMapGetTemplate( $template );\n $mapTemplate = $arr_result[ 'template' ];\n if ( $arr_result[ 'error' ] )\n {\n return $mapTemplate;\n }\n // RETURN : HTML template is not proper\n // #i0209, 151202, dwildt, 2+\n $markerArray = $this->pObj->objWrapper4x->constant_markers();\n $mapTemplate = $this->pObj->cObj->substituteMarkerArray( $mapTemplate, $markerArray );\n\n $template = $this->renderMapMarker( $template, $mapTemplate );\n\n//var_dump( __METHOD__ . ' (' . __LINE__ . '): ', $mapTemplate, $template );\n // RETURN the template\n return $template;\n }", "function xh_templateMapping($name)\r\n\t{\r\n\t}", "public function tilemapservice() {\n $this->tilesdir = ROOT . DS . \"Data\" . DS . \"tiles\";\n // Set the content type to text/xml\n $this->response->type('text/xml');\n\n // List of all TileMaps\n $tileMaps = array();\n\n // Open the tiles directory and loop all layers assuming that one\n // subdirectory represents one layer.\n if ($handle = opendir($this->tilesdir)) {\n while (false !== ($layer = readdir($handle))) {\n // Exclude the current and parent directory and check if the\n // directory is not a file.\n if ($layer != \".\" && $layer != \"..\" && is_dir($this->tilesdir . DS . $layer)) {\n\n // Get the tilemapresource.xml file from the layer\n $resourceFile = \"$this->tilesdir/$layer/tilemapresource.xml\";\n // Check if the file exists and is readable\n if (!is_readable($resourceFile)) {\n throw new NotFoundException(\"Layer metadata not found.\");\n }\n\n // Open the xml file\n $doc = new DOMDocument();\n $doc->load($resourceFile);\n\n // Construct the layer url\n //$href = \"http://\" . $this->request->host() . \"/tms/1.0.0/\" . $layer . \"/\";\n $href = \"http://\" . $this->request->host() . DS . $this->rootService\n . DS . $this->tileMapService . DS . $layer . DS;\n // Extract the profile from the file\n $tileSetsNode = $doc->getElementsByTagName('TileSets')->item(0);\n $profile = $tileSetsNode->getAttribute('profile');\n // Extract the title from the file\n $titleNode = $doc->getElementsByTagName('Title')->item(0);\n $title = $titleNode->firstChild->textContent;\n // Finally extract the spatial reference system\n $srsNode = $doc->getElementsByTagName('SRS')->item(0);\n $srs = $srsNode->firstChild->textContent;\n\n // Add the current layer to the list of TileMaps\n array_push($tileMaps, array(\n 'href' => $href,\n 'title' => $title,\n 'srs' => $srs,\n 'profile' => $profile));\n }\n }\n // Close the directory handle\n closedir($handle);\n }\n\n // Set the list of TileMaps to the output\n $this->set('tileMaps', $tileMaps);\n // Set the url to the Root resource to the output\n $rootServices = \"http://\" . $this->request->host() . DS . $this->rootService;\n $this->set('rootServices', $rootServices);\n }", "private function renderMapGetTemplateLeaflet( $template )\n {\n $arr_return = $this->mapLLgetDivContainer( $template );\n return $arr_return;\n }", "public function getMapping() {}", "private function renderMapMarkerOxMap( $template, $mapTemplate )\n {\n $mapHashKey = '###MAP###';\n // Substitute marker HTML\n $markerArray = $this->renderMapMarkerSnippetsHtmlCategories( $mapTemplate );\n $markerArray = $markerArray + $this->renderMapMarkerSnippetsHtmlDynamic( $mapTemplate );\n $mapTemplate = $this->pObj->cObj->substituteMarkerArray( $mapTemplate, $markerArray );\n//var_dump( __METHOD__, __LINE__, $markerArray, $mapTemplate );\n // Substitute marker HTML\n // #i0120, 150101, dwildt: 5+\n $templateWoMarker = $this->renderMapMarkerWoMarker( $mapHashKey, $template );\n if ( $templateWoMarker )\n {\n// var_dump( __METHOD__, __LINE__ );\n// die( ':(' );\n return $templateWoMarker;\n }\n // Add data\n $mapTemplate = $this->renderMapMarkerVariablesSystem( $mapTemplate );\n $markerArray = $this->renderMapMarkerVariablesDynamic( $mapTemplate );\n $mapTemplate = $this->pObj->cObj->substituteMarkerArray( $mapTemplate, $markerArray );\n // Add data\n // Substitute marker JSS\n $markerArray = $markerArray + $this->renderMapMarkerSnippetsJssDynamic( $mapTemplate );\n $mapTemplate = $this->pObj->cObj->substituteMarkerArray( $mapTemplate, $markerArray );\n // Substitute marker JSS\n // map marker\n // Replace the map marker in the template of the parent object\n $template = str_replace( $mapHashKey, $mapTemplate, $template );\n\n//var_dump( __METHOD__ . ' (' . __LINE__ . '): ', $mapTemplate, $template );\n // RETURN the template\n return $template;\n }", "function load_map_full_view($values) {\n $datas = DataManager::searchByData(null, $values['address']);\n \n $tpl = new Template(SiteConfig::templatesPath() . \"views/pages/map-view\");\n $tpl->address = $datas[0]->address.\",+\".$datas[0]->district.\"+\";\n $tpl->search = $datas[0]->lat.\",\".$datas[0]->lang;\n $tpl->id = $datas[0]->id;\n $resp = new AjaxResponse(true);\n $resp->setData($tpl->parse());\n\n if (count($datas) > 1) {\n $tpl = new Template(SiteConfig::templatesPath() . \"views/pages/search-detailed-result\");\n $tpl->datas = $datas;\n $tpl->addr = $values['address'];\n } else {\n $tpl = new Template(SiteConfig::templatesPath() . \"views/pages/search-result\");\n $mgr = new DataManager();\n $arr = array();\n $mgr->setAddress($values['address']);\n array_push($arr, $mgr);\n $tpl->datas = $arr;\n }\n\n\n\n $resp->setCustomData($tpl->parse());\n echo $resp->getOutput();\n exit();\n}", "public function get_json_map_data(){\n\t\t$this->load->model('overview_model');\n\t\techo $this->overview_model->home_map_data($this->get_filter_start_date(),$this->get_filter_stop_date());\n\n\t}", "public static function get_all ()\n {\n return static::$_map;\n }", "public function get( $args, $assoc_args ) {\n\n\t\t$map = ITSEC_Lib_Static_Map_API::get_map( $assoc_args );\n\n\t\tif ( is_wp_error( $map ) ) {\n\t\t\tWP_CLI::error( $map );\n\t\t}\n\n\t\tWP_CLI::success( 'Retrieved Map: ' . $map );\n\t}", "public static function getMap()\n\t{\n\t\treturn [\n\t\t\tnew Main\\Entity\\IntegerField('TEMPLATE_ID', [\n\t\t\t\t'primary' => true,\n\t\t\t]),\n\t\t\tnew Main\\Entity\\StringField('PROVIDER', [\n\t\t\t\t'primary' => true,\n\t\t\t]),\n\t\t\tnew Main\\Entity\\ReferenceField('TEMPLATE', '\\Bitrix\\DocumentGenerator\\Model\\Template',\n\t\t\t\t['=this.TEMPLATE_ID' => 'ref.ID']\n\t\t\t),\n\t\t];\n\t}", "public function getTemplateData(array $customData = []);", "public function indexAction()\n {\n // Append breadcrumbs\n $this->view->getBreadcrumbBag()->addOne('Maps', 'Map:Admin:Map@indexAction');\n\n return $this->view->render('map/index', array(\n 'maps' => $this->getModuleService('mapService')->fetchAll()\n ));\n }", "public function get_map_list() {\r\n\t\t$db = Maps_Marker_Pro::get_instance('MMP\\DB');\r\n\r\n\t\t$maps = $db->get_all_maps(true);\r\n\t\t$map_list = array();\r\n\t\tforeach ($maps as $map) {\r\n\t\t\t// No escaping, since wp_send_json() escapes automatically\r\n\t\t\t$map_list[$map->id] = \"[{$map->id}] \" . $map->name . \" ({$map->markers} \" . __('markers', 'mmp') . ')';\r\n\t\t}\r\n\r\n\t\treturn $map_list;\r\n\t}", "private function getAllMap()\n {\n\n $args = array('burn_project_id'=>null,'agency_id'=>$_SESSION['user']['agency_id']);\n extract(merge_args(func_get_args(), $args));\n\n $status_icons = $this->status_icons;\n $user_id = $_SESSION['user']['id'];\n\n global $map_center;\n\n if (isset($agency_id)) {\n $markers = fetch_assoc(\"SELECT b.burn_id, b.status_id, b.location, CONCAT(bp.project_number, ': ', b.start_date, ' to ', b.end_date) as name, b.added_by FROM burns b JOIN burn_projects bp ON(b.burn_project_id = bp.burn_project_id) WHERE b.burn_project_id IN(SELECT burn_project_id FROM burn_projects WHERE agency_id = $agency_id);\");\n $zoom_to_fit = false;\n } elseif (isset($burn_project_id)) {\n $burn = fetch_row(\"SELECT burn_project_id, status_id, location FROM burn_projects WHERE burn_project_id = $burn_project_id;\");\n $markers = fetch_assoc(\"SELECT burn_id, status_id, location, added_by FROM burns WHERE burn_project_id = $burn_project_id;\");\n $zoom_to_fit = true;\n }\n\n if ($zoom_to_fit == true) {\n $zoom = \"map.fitBounds(bounds);\";\n } else {\n $zoom = \"\";\n }\n\n if ($burn['error'] == false && !empty($burn)) {\n $center = \"zoom: 6,\n center: new google.maps.LatLng($map_center),\";\n $latlng = explode(' ', str_replace(array(\"(\", \")\", \",\"), \"\", $burn['location']));\n $json_str = \"{ne:{lat:\".$latlng[2].\",lon:\".$latlng[3].\"},sw:{lat:\".$latlng[0].\",lon:\".$latlng[1].\"}}\";\n\n $bounds = \"\n // extend it using my two points\n var latlng = $json_str\n\n var bounds = new google.maps.LatLngBounds(\n new google.maps.LatLng(latlng.sw.lat,latlng.sw.lon),\n new google.maps.LatLng(latlng.ne.lat,latlng.ne.lon)\n );\n\n var rectangle = new google.maps.Rectangle({\n strokeColor: '#000',\n strokeOpacity: 0.4,\n strokeWeight: 2,\n fillColor: '#000',\n fillOpacity: 0.1,\n bounds: bounds,\n });\n\n rectangle.setMap(map);\";\n\n } else {\n $center = \"zoom: 6,\n center: new google.maps.LatLng({$map_center}),\";\n $bounds = \"\";\n }\n\n if ($markers['error'] == false) {\n // Construct the Marker array.\n $marker_arr = \"var Burns = [\\n \";\n $marker_len = count($markers);\n $i = 0;\n\n foreach ($markers as $value) {\n if (++$i === $marker_len) {\n $comma = \"\";\n } else {\n $comma = \",\";\n }\n if ($value['added_by'] == $user_id) {\n $edit = 'true';\n } else {\n $edit = 'false';\n }\n $marker_latlng = explode(' ', str_replace(array(\"(\",\")\",\",\"), \"\", $value['location']));\n $marker_status = $this->retrieveStatus($value['status_id']);\n $marker_arr .= \"[\".$value['burn_id'].\", \".$marker_latlng[0].\", \".$marker_latlng[1].\", '\".$value['name'].\"', '\".$marker_status['color'].\"', \".$edit.\",'\".str_replace(\" \", \"_\", strtolower($marker_status['title'])).\"']$comma\\n \";\n }\n\n $marker_arr .= \"];\\n\";\n\n // Append it to the function.\n $marker = \"\n $marker_arr\n\n function setMarkers(map, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i];\n var myLatLng = new google.maps.LatLng(marker[1], marker[2]);\n\n if (checkLegacy()) {\n var marker = new google.maps.Marker({\n position: myLatLng,\n map: map,\n title: marker[3],\n id: marker[0]\n });\n } else {\n if (!marker[5]) {\n var marker = new google.maps.Marker({\n position: myLatLng,\n map: map,\n icon: {\n url: '/images/ros_' + marker[6] + '.png',\n scale: 0.1\n },\n title: marker[3],\n id: marker[0]\n });\n } else {\n var marker = new google.maps.Marker({\n position: myLatLng,\n map: map,\n icon: {\n path: google.maps.SymbolPath.CIRCLE,\n scale: 6,\n strokeColor: '#333',\n strokeOpacity: 1,\n strokeWeight: 1,\n fillColor: marker[4],\n fillOpacity: 1\n },\n title: marker[3],\n id: marker[0]\n });\n }\n }\n\n bindMarkers(map, marker);\n }\n\n function bindMarkers(map, marker)\n {\n google.maps.event.addListener(marker, 'click', function() {\n window.location='/manager/burn.php?burn=true&id='+marker.id;return false;\n });\n }\n }\n\n\n \";\n }\n\n $html = \"\n <style>\n\n\n .map-canvas {height:348px;}\n\n div.stations2 svg {\n position: absolute;\n }\n </style>\n <div class=\\\"map-canvas\\\" id=\\\"map$id\\\"></div>\n <script>\n\n var map = new google.maps.Map(document.getElementById('map$id'), {\n $center\n mapTypeId: google.maps.MapTypeId.TERRAIN,\n panControl: false,\n zoomControl: true,\n mapTypeControl: false,\n streetViewControl: false,\n scrollwheel: false\n });\n\n google.maps.event.trigger(map,'resize');\n\n $bounds\n\n $marker\n\n $zoom\n\n var Overlay = new Overlay();\n\n setMarkers(map, Burns);\n Overlay.setControls(map);\n\n </script>\n \";\n\n return $html;\n }", "function get_map($source)\n{\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_json = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('person', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n 'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_datajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_socratajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'upload' => array('upload', 2),\n 'format' => array('format', 2),\n 'name' => array('name', 2),\n 'modified' => array('modified',1),\n );\n\n // 'dest_key' => array('source_key', dest_position, source_position)\n // 0/1/2 denotes root/extras/resources.\n $map_ckan = array(\n 'title' => array('title', 0, 0),\n 'notes' => array('notes', 0, 0),\n // hard-code publisher to orgnization.title in ckan_map for now.\n // todo: change this map structure.\n 'publisher' => array('place-holder', 1, 1),\n 'public_access_level' => array('access-level', 1, 1),\n 'contact_email' => array('contact-email', 1, 1),\n 'contact_name' => array('person', 1, 1),\n 'unique_id' => array('id', 1, 0),\n 'tags' => array('tags', 0, 1),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('data-dictiionary', 1, 1), // there is a typo.\n 'license_title' => array('license_title', 0, 0),\n 'spatial' => array('spatial-text', 1, 1),\n 'temporal' => array('dataset-reference-date', 1, 1),\n 'release_date' => array('issued', 1, 1),\n 'accrual_periodicity' => array('frequency-of-update', 1, 1),\n 'related_documents' => array('references', 1, 1),\n 'language' => array('metadata-language', 1, 1),\n 'homepage_url' => array('url', 1, 0),\n 'url' => array('url', 2, 2),\n 'name' => array('name', 2, 2),\n 'format' => array('format', 2, 2),\n );\n\n $ret_map = \"map_$source\";\n return isset($$ret_map) ? $$ret_map : null;\n}", "public function getData() {\r\n $data = [];\r\n\r\n $model = Factory::getModel('landing-page-templates');\r\n $templates = $model->getTemplates();\r\n foreach ($templates as $template) {\r\n if ($template->showDetailed) {\r\n $data[] = [\r\n 'loc' => home_url($template->slug),\r\n 'priority' => '0.5',\r\n 'changefreq' => 'daily'\r\n ];\r\n }\r\n }\r\n\r\n return $data;\r\n }", "public function allMapAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('UCrmCoreBundle:Client')->findAll();\n $googleSetting = $em->getRepository('UCrmCoreBundle:Setting')->findOneBy(['name' => 'google/api/key']);\n\n $markers = [];\n foreach ($entities as $entity) {\n $markers[] = [\n 'lb' => $entity->getLat(),\n 'mb' => $entity->getLon(),\n 'title' => $entity->getFullName()\n ];\n }\n\n return array(\n 'entities' => $entities,\n 'googleApi'=> $googleSetting,\n 'markers' => json_encode($markers)\n );\n }" ]
[ "0.66684216", "0.6188578", "0.6017391", "0.5933799", "0.5778548", "0.56561357", "0.5571654", "0.5537836", "0.55373263", "0.55251", "0.5468929", "0.5455433", "0.54431546", "0.5414471", "0.5348369", "0.53354126", "0.53255737", "0.5294381", "0.5287362", "0.52565086", "0.5252688", "0.5244", "0.5242483", "0.5231635", "0.5230346", "0.5218438", "0.52122337", "0.5190227", "0.51880974", "0.51856947" ]
0.6365316
1
/ Delete all resources.
public function deleteAllResources() { $this->resources = array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteAll(): void\n {\n $this->client->delete($this->baseUri);\n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function deleteAll(): void;", "public final function destroy_all()\n {\n }", "abstract public function deleteAll();", "public function delete_all()\n {\n }", "public function delete_all() {\n\t\t$this->_cache = array();\n\t\t$this->_collections = array();\n\t}", "public function deleteAll()\n {\n \\Core\\File\\System::rrmdir($this->_getPath(), false, true);\n }", "public function deleteAll()\n {\n $this->ensureModels();\n foreach ($this->_models as $model) {\n $model->delete();\n }\n }", "public function delall()\n {\n }", "public function deleteAll()\n {\n //Find and destroy\n $entities = $this->findAll();\n return $this->deleteAll($entities);\n }", "function deleteall() {\n\t\t$this->_query( \"DELETE FROM $0\" );\n\t}", "public function deleteAll(){\n try {\n $this->getTable()->delete();\n } catch (\\Exception $e) {\n $this->handleException($e);\n }\n return;\n }", "public static function destroyAll($options = array()) {\n foreach (self::findAll($options) as $record) {\n $record->destroy();\n }\n }", "public static function deleteAll() {\n\t\treturn self::_getDao()->deleteAll();\n\t}", "public function clearAll() {\n $list = scandir(self::ROOT_PATH . \"/public/{$this->storagePath}\");\n foreach ($list as $file) {\n if ($file == '.' || $file == '..') {\n continue;\n }\n $filePath = self::ROOT_PATH . \"/public/{$this->storagePath}/$file\";\n unlink($filePath);\n }\n $this->_tableGw->delete();\n }", "public function deleteAll(){\n if(APPLICATION_ENV == 'production'){\n throw new Exception(\"Not Allowed\");\n }\n $this->getMapper()->deleteAll();\n }", "public function deleteAll() {\n\n $this->start();\n $_SESSION = array();\n\n }", "public function deleteAll() {\n if (isset($this::$has)) {\n foreach ($this::$has as $key => $value) {\n if(isset($this->$key)) {\n foreach ($this->$key as $item) {\n $item->deleteAll();\n }\n }\n }\n }\n $this->delete();\n }", "public static final function destroy_all_for_all_users()\n {\n }", "static function deleteAll()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM stores;\");\n $GLOBALS['DB']->exec(\"DELETE FROM stores_brands;\");\n }", "public static function deleteAll() {\n // Initiate implicit tx if explicit one doesn't exist\n $is_implicit_tx = false;\n if (self::$numTransactions == 0) {\n $is_implicit_tx = true; \n self::beginTx();\n }\n\n // Fail because 'databaseHandle' wasn't initialized by 'beginTx()' \n assert(isset(self::$databaseHandle));\n\n try {\n $sql_records = static::fetchAll();\n foreach ($sql_records as $record) {\n $record->delete();\n } \n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n\n // Close implicit tx\n if ($is_implicit_tx) {\n self::endTx();\n }\n }", "function deletableResources(){\n\n return $this->resourcesByPermission('delete');\n }", "public function clearAll();", "public function clearAll();", "public function clearAll() {}", "protected function deleteAll()\n {\n Yii::$app->db->createCommand()\n ->delete($this->tableName, [$this->primaryKey => $this->owner->{$this->primaryKey}])\n ->execute();\n }", "public static function deleteAll($options=array())\n {\n\n $solr = self::connect($options);\n\n $solr->deleteByQuery('*:*');\n $solr->commit();\n $solr->optimize();\n\n }" ]
[ "0.77336645", "0.7723481", "0.7723481", "0.7723481", "0.76765454", "0.7570651", "0.7441812", "0.7400447", "0.7355423", "0.7308607", "0.7307646", "0.6999794", "0.69665504", "0.694", "0.6894418", "0.67790323", "0.67747205", "0.6694325", "0.6681674", "0.66804236", "0.66403764", "0.66275805", "0.66116035", "0.6561349", "0.6559174", "0.65310377", "0.65310377", "0.65165466", "0.65049976", "0.6444896" ]
0.87818134
0
/ Delete all dependents.
public function deleteAllDependents() { $this->dependents = array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteAll(): void;", "public function deleteAll()\n {\n $this->ensureModels();\n foreach ($this->_models as $model) {\n $model->delete();\n }\n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function delall()\n {\n }", "abstract public function deleteAll();", "public function delete()\n {\n foreach ($this->versions as $version)\n {\n $version->delete();\n }\n\n parent::delete();\n }", "public function delete_all()\n {\n }", "protected function resolveWorkspacesClearDependencies() {}", "public function deleteAll(): void\n {\n $this->client->delete($this->baseUri);\n }", "public function deleteAll()\n {\n \\Core\\File\\System::rrmdir($this->_getPath(), false, true);\n }", "public final function destroy_all()\n {\n }", "function remove_dependents() {\n\t\t/** todo\n\t\tforeach($this->has_many_data as $key => $value) {\n\t\t\tdebug($key, $value);\n\n\t\t}\n\n\t\tforeach($this->has_one_data as $key => $value) {\n\t\t\tdebug($key, $value);\n\t\t}\n\t\t*/\n\n\t\treturn true;\n\t}", "public function clean() {\n $this->requires = array();\n $this->getResource()->clear();\n }", "public function delete_all() {\n\t\t$this->_cache = array();\n\t\t$this->_collections = array();\n\t}", "private static function deleteAssets() {\n // Fail due to invalid asset deletors \n assert(isset(self::$assetDeletors));\n\n // Remove assets \n foreach (self::$assetDeletors as $deletor) {\n $deletor->delete();\n }\n\n // Clear AssetDeletors cache\n self::$assetDeletors = array();\n }", "function deleteall() {\n\t\t$this->_query( \"DELETE FROM $0\" );\n\t}", "public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}", "public static function deleteAll() {\n // Initiate implicit tx if explicit one doesn't exist\n $is_implicit_tx = false;\n if (self::$numTransactions == 0) {\n $is_implicit_tx = true; \n self::beginTx();\n }\n\n // Fail because 'databaseHandle' wasn't initialized by 'beginTx()' \n assert(isset(self::$databaseHandle));\n\n try {\n $sql_records = static::fetchAll();\n foreach ($sql_records as $record) {\n $record->delete();\n } \n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n\n // Close implicit tx\n if ($is_implicit_tx) {\n self::endTx();\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 deleteAll($initAutoIncrement = false): void;", "public function deleteRequirements(array $requirements = []);", "protected function deleteAll()\n {\n Yii::$app->db->createCommand()\n ->delete($this->tableName, [$this->primaryKey => $this->owner->{$this->primaryKey}])\n ->execute();\n }", "public static function purgeAll(array $opts = [])\n {\n static::getCollection()->deleteMany(['_deleted' => true]);\n }", "protected function utilPurgeOrphans()\n {\n if (!$this->confirmToProceed('This will PERMANENTLY DELETE files in \"system_files\" that do not belong to any other model.')) {\n return;\n }\n\n $orphanedFiles = 0;\n\n // Locate orphans\n $files = FileModel::whereNull('attachment_id')->get();\n\n foreach ($files as $file) {\n $file->delete();\n $orphanedFiles += 1;\n }\n\n if ($orphanedFiles > 0) {\n $this->comment(sprintf('Successfully deleted %d orphaned record(s).', $orphanedFiles));\n }\n else {\n $this->comment('No records to purge.');\n }\n }", "public function cleanAll()\n {\n $this->filesystem->remove(self::getFilesList());\n }", "public function deleteAll()\n {\n //Find and destroy\n $entities = $this->findAll();\n return $this->deleteAll($entities);\n }", "public function wipeAll() {\n\t\tforeach($this->getTables() as $t) {\n\t\t\tforeach($this->getKeys($t) as $k) {\n\t\t\t\t$this->adapter->exec(\"ALTER TABLE \\\"{$k['FKTABLE_NAME']}\\\" DROP FOREIGN KEY \\\"{$k['FK_NAME']}\\\"\");\n\t\t\t}\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t\tforeach($this->getTables() as $t) {\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t}", "public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }" ]
[ "0.6793108", "0.6562115", "0.6507074", "0.6507074", "0.6507074", "0.6435713", "0.6397847", "0.63043207", "0.6302768", "0.62322485", "0.6184805", "0.6174771", "0.6163906", "0.6125516", "0.6086713", "0.60380095", "0.5939262", "0.58965313", "0.58471376", "0.58071613", "0.5786902", "0.577504", "0.5739771", "0.5722249", "0.57106364", "0.5701064", "0.5689002", "0.5679755", "0.5669807", "0.56577706" ]
0.8678872
0
Delete parameters named in array.
public function deleteParams(array $params) { $this->chkParams(); foreach ($params as $key) unset($this->params[$key]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function purge($params = array())\n\t{\n\t\t$sql = 'DELETE FROM '.$this->paramsTableName;\n\t\tif (sizeof($params) > 0)\n\t\t{\n\t\t\t$params = $this->preprocessParams($params);\n\t\t\t$sql .= ' WHERE option_name IN (\\''.implode('\\',\\'', $params).'\\')';\n\t\t}\n\t\t$db = $this->getDbConnection();\n\t\t$db->createCommand($sql)->execute();\n\t\tif (sizeof($params) > 0)\n\t\t{\n\t\t\tfor ($i = 0, $s = sizeof($params); $i < $s; $i++)\n\t\t\t{\n\t\t\t\t$this->remove($params[$i]);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\t$this->clear();\n\t}", "function delete_array($array)\n{\n\t// get arguments\n\t$args = func_get_args();\n\t// unset first arg, b/c it is the array\n\tunset($args[0]);\n\t// if args = array in array, turn into just array\n\tif(isset($args[1]) && is_array($args[1]))\n\t{\n\t\t$args = $args[1];\n\t}\n\t// remove specified fields from array\n\t$array = _delete_array($array, $args);\n\t// remove empty elements from array\n\t$array = empty_array($array);\n\t// return array\n\treturn $array;\n}", "public function delete( array $params );", "function unsetArray($array){\n\n foreach($array as $subKey => $subArray ){\n if($subArray['item_id'] == $_GET['delete']){\n //echo $subKey['item_id'];\n //echo $_GET['delete'];\n unset($array[$subKey]);\n }\n }\n return $array;\n }", "public function deleteWhere(Array $query)\r\n {\r\n }", "public function testParamUnset()\n {\n $driverPassesEndpoint = new DriverPassesEndpoint(getenv('MRP_API_KEY'));\n $array = $driverPassesEndpoint->setClassId(1000)\n ->setClassId(1000)\n ->setScheduleId(5508)\n ->setScheduleId(5508)\n ->setDataOrder('nameAsc')\n ->setDataOrder('nameAsc')\n ->setDriverId(1023)\n ->setDriverId(1023)\n ->setEndDate('8/21/2016')\n ->setEndDate('8/21/2016')\n ->setStartDate('8/21/2015')\n ->setStartDate('8/21/2015')\n ->setEventId(2)\n ->setEventId(2)\n ->getUrlParams();\n\n $this->assertTrue(is_array($array));\n $this->assertEquals(7, count($array));\n }", "function _del_p(&$ary) {\n\t foreach ($ary as $k=>$v) {\n\t if ($k==='_p') unset($ary[$k]);\n\t elseif (is_array($ary[$k])) $this->_del_p($ary[$k]);\n\t }\n\t}", "public function offsetUnset($offset)\n {\n unset($this->params[$offset]);\n }", "public function delete(array $where);", "function _del_p(&$ary)\n{\n foreach ($ary as $k => $v) {\n if ($k === '_p') {\n unset($ary[$k]);\n } elseif (is_array($ary[$k])) {\n _del_p($ary[$k]);\n }\n }\n}", "public function clearParameters ()\n {\n\n $this->parameters = null;\n $this->parameters = array();\n\n }", "public function deleteBy(array $params)\n {\n return $this ->model ->where($params) ->delete();\n }", "public function offsetUnset($param)\n\t{\n\t\tunset($this->params[(string) $param]);\n\t}", "public function\tremoveCamposPost($params) {\r\n \t$arrCampos = array(\r\n \t\t\t'emboid',\r\n \t\t\t'embnome',\r\n\t\t\t\t'embcnpj',\r\n\t\t\t\t'embrua',\r\n\t\t\t\t'embnumero',\r\n\t\t\t\t'embcomplemento',\r\n\t\t\t\t'embbairro',\r\n\t\t\t\t'embcidade',\r\n\t\t\t\t'embuf',\r\n\t\t\t\t'embcep',\r\n\t\t\t\t'embcontato',\r\n\t\t\t\t'embtelefone1',\r\n\t\t\t\t'embtelefone2',\r\n\t\t\t\t'embtelefone3',\r\n\t\t\t\t'embemail',\r\n\t\t\t\t'embfrota',\r\n\t\t\t\t'embsegoid',\r\n\t\t\t\t'embobservacao'\r\n \t\t);\r\n\r\n \treturn array_intersect_key($params, array_flip($arrCampos)); \t\r\n }", "public function delete_multiple(array $keys, $group = '')\n {\n }", "protected function filterParameters(array $parameters): array\n {\n // Remove API key from parameters.\n unset($parameters['key']);\n\n return $parameters;\n }", "public function _clean_by_params($params = [])\n {\n }", "public function offsetUnset($name)\n {\n if (is_int($name)) {\n parent::offsetUnset($name);\n // @codeCoverageIgnoreStart\n // This will never be reached, because an exception is always\n // thrown.\n return;\n // @codeCoverageIgnoreEnd\n }\n\n unset($this->parameters[strtoupper($name)]);\n }", "public function delete_by($query) {\n\t\t// determine which query parameters are arrays\n\t\t$where_ins = array();\n\t\tforeach ($query as $field => $value) {\n\t\t\tif (is_array($value)) {\n\t\t\t\t// move field from = to IN\n\t\t\t\t$where_ins[$field] = $value;\n\t\t\t\tunset($query[$field]);\n\t\t\t}\n\t\t}\n\n\t\t// delete rows from database\n\t\t$q = $this->db->where($query);\n\t\tforeach ($where_ins as $k => $v)\n\t\t\t$q->where_in($k, $v);\n\t\t$q->delete($this->table);\n\t}", "public function __unset($param)\r\n {\r\n $this->params_named->remove($param);\r\n }", "function softDeletesMulti($params)\n {\n foreach ($params as $value) {\n $this->softDelete($value);\n }\n }", "protected function _cleanSearchParams($parameters = array())\n {\n if ($parameters) {\n if (isset($parameters['___store'])) {\n unset($parameters['___store']);\n }\n if (isset($parameters['___from_store'])) {\n unset($parameters['___from_store']);\n }\n\n $removeKeys = array();\n foreach ($parameters as $key => $value) {\n if (is_array($value)) {\n if (isset($value['from']) && isset($value['to'])) {\n if (empty($value['from']) && empty($value['to'])) {\n $removeKeys[] = $key;\n }\n }\n } else {\n if (empty($value)) {\n $removeKeys[] = $key;\n }\n }\n }\n\n if ($removeKeys) {\n foreach ($removeKeys as $key) {\n unset($parameters[$key]);\n }\n }\n }\n\n return $parameters;\n }", "public function delete($names);", "public function remove(...$items);", "public function removeParams(string ...$keys): static\n {\n return $this->removeQueryParameters(...$keys);\n }", "public function deleteItems(array $keys);", "public function removeParameters()\n {\n return [\n 'collection' => $this->collection->cart_name,\n 'id' => $this->cart_hash\n ];\n }", "public function __unset($name)\n {\n unset($this->_params['args'][$name]);\n }", "public function __unset($name)\n {\n unset($this->_params['args'][$name]);\n }", "public function testParamUnset()\n {\n $driversEndpoint = new DriverClassesEndpoint('MRP_API_KEY');\n $array = $driversEndpoint->setDriverCount(1)\n ->setOrder('name')\n ->setIncludeStats('true')\n ->setScheduleYear(2016)\n ->setFeaturedOnly('true')\n ->setForcePic('false')\n ->setIncludeDrivers('true')\n ->setDriverCount(1)\n ->setOrder('name')\n ->setIncludeStats('true')\n ->setScheduleYear(2016)\n ->setFeaturedOnly('true')\n ->setForcePic('false')\n ->setIncludeDrivers('true')\n ->getUrlParams();\n\n $this->assertTrue(is_array($array));\n $this->assertEquals(7, count($array));\n }" ]
[ "0.68664366", "0.6493911", "0.6442798", "0.6417786", "0.63110995", "0.6262988", "0.6180346", "0.61637026", "0.61636525", "0.6137342", "0.610598", "0.6073579", "0.6053164", "0.60285723", "0.6027156", "0.60155505", "0.6005731", "0.60013664", "0.59870344", "0.5984834", "0.59709233", "0.59595907", "0.594333", "0.59183556", "0.5897485", "0.58619255", "0.5859499", "0.585826", "0.585826", "0.5849287" ]
0.77794266
0
Get the Organization name of the current User's Organization.
protected function getOrganizationName(User $user) { return $user->organization ? $user->organization->name : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOrganizationName(): string {\n\t\treturn ($this->organizationName);\n\t}", "public function getOrgName()\n {\n return $this->orgName;\n }", "public function getOrganizationUser()\n {\n return $this->organizationUser;\n }", "public function getCurrentOrganization()\n {\n return $this->userLoader->getOrganization($this->getCurrentOrganizationId());\n }", "public function getOrganization()\n {\n return $this->organization;\n }", "public function getOrganization()\n {\n return $this->organization;\n }", "public function getOrganization()\n {\n return $this->organization;\n }", "public function getOrganization()\n {\n if (array_key_exists(\"organization\", $this->_propDict)) {\n return $this->_propDict[\"organization\"];\n } else {\n return null;\n }\n }", "public function getOrganizationId()\n {\n return $this->organization_id;\n }", "public function getOrganizationId()\n {\n return $this->organizationId;\n }", "protected function getOrganizationId(User $user)\n {\n return $user->organization ? $user->organization->id : '';\n }", "protected function getOrganizationName()\n {\n $organizations = $this->organizationManager->getOrganizations();\n $data = [];\n foreach ($organizations as $organization) {\n $data[$organization['id']] = $organization['name'];\n }\n\n return $data;\n }", "public function getOrganization()\n {\n $node = $this->response->getFirst('contact:org', $this->node);\n if ($node === null) {\n return null;\n }\n\n return $node->nodeValue;\n }", "public function getCurrentOrganizationId()\n {\n $orgId = $this->_getVar('user_organization_id');\n\n //If not set, read it from the cookie\n if ($this->isCurrentUser() && ((null === $orgId) || (\\Gems_User_UserLoader::SYSTEM_NO_ORG === $orgId))) {\n $request = $this->getRequest();\n if ($request) {\n $orgId = \\Gems_Cookies::getOrganization($this->getRequest());\n }\n if (! $orgId) {\n $orgId = 0;\n }\n $this->_setVar('user_organization_id', $orgId);\n }\n return $orgId;\n }", "public function getOrganizationEmail(): string {\n\t\treturn $this->organizationEmail;\n\t}", "public function getBaseOrganizationId()\n {\n return $this->_getVar('user_base_org_id');\n }", "public function getOrganization()\n {\n $token = $this->securityContext->getToken();\n if ($token instanceof OrganizationContextTokenInterface) {\n return $token->getOrganizationContext();\n }\n\n return false;\n }", "public function organization()\n {\n return Organization::i();\n }", "public function getBaseOrganization()\n {\n return $this->userLoader->getOrganization($this->getBaseOrganizationId());\n }", "public static function organizationName(string $organization): string\n {\n return self::getPathTemplate('organization')->render([\n 'organization' => $organization,\n ]);\n }", "public function getOrganizationId()\n {\n /** @var Organization $organization */\n $organization = $this->getOrganization();\n return $organization ? $organization->getId() : null;\n }", "public function getOrgId()\n {\n return $this->org_id;\n }", "public static function getUserUnitName()\n {\n $user = static::get();\n if (isset($user->noUnidadeOrg)) {\n return $user->noUnidadeOrg;\n }\n }", "public function organisationName();", "public function getOrgId() {\n\t\treturn ($this->orgId);\n\t}", "public function getOrganisation()\n {\n return $this->organisation;\n }", "public function getFullName()\n {\n /** @var Organisation $organisation */\n return $this->getLocation()->getOrganisation()->getName() . \" : \" . $this->getName();\n }", "public function getOrgId() {\n\treturn ($this->orgId);\n}", "public function organization($organization)\n {\n return $this->get('/user/memberships/orgs/'.rawurlencode($organization));\n }", "public function getOrganizationByUserId($user_id)\n {\n return User::findOrFail($user_id)->organization;\n }" ]
[ "0.8020499", "0.7703937", "0.7653495", "0.7288905", "0.7252708", "0.7252708", "0.7252708", "0.7163634", "0.7073842", "0.70602465", "0.6960716", "0.6921465", "0.6845175", "0.67599314", "0.6675268", "0.66670716", "0.66561157", "0.6638369", "0.6606092", "0.6576483", "0.65129846", "0.64687437", "0.64533836", "0.63722205", "0.6275513", "0.6273937", "0.6265435", "0.62043643", "0.611581", "0.61039406" ]
0.7920484
1
Remove an item from a store's stock.
public function action_item_remove(Request $request, Response $response) { $values = $request->query(); $restock = ORM::factory('Store_Restock', $values['restock_id']); if(!$restock->loaded()) { RD::set(RD::ERROR, 'No restock record found.'); } else { $restock->delete(); RD::set(RD::SUCCESS, 'Item successfully removed from the store\'s stock'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeItem(string $sku): Cart;", "public function remove($item);", "public function clearStockTransaction() {\n// $stockItemClass = Mage::app()->getConfig()->getModelClassName('cataloginventory/stock_item');\n// $productClass = Mage::app()->getConfig()->getModelClassName('catalog/product');\n//\n// if ( !Mage::registry(self::REGISTRY_TXN_KEY) ) {\n// $this->_initTransactionRegistry();\n// return Mage::registry(self::REGISTRY_TXN_KEY);\n// }\n//\n// return Mage::registry(self::REGISTRY_TXN_KEY)->removeItemByKey($id);\n Mage::unregister(self::REGISTRY_KEY_TRANSACTION);\n }", "public function removeItem(OrderItem $item);", "public function removeItem(Cart $cart, CartItem $item);", "public function remove($item) {\n unset($this->items[$item->id()]);\n }", "abstract public function removeItem($name);", "public function remove($item)\n {\n return $this->removeWhen(\n function ($storedItem) use ($item) {\n return $storedItem === $item;\n }\n );\n }", "public function remove()\n {\n $key = $this->request->param('ID');\n $title = \"\";\n\n if (!empty($key)) {\n foreach ($this->items as $item) {\n if ($item->Key == $key) {\n $title = $item->Title;\n $this->items->remove($item);\n }\n }\n\n $this->save();\n \n if ($title) {\n $this->setSessionMessage(\n \"bad\",\n _t(\n \"Checkout.RemovedItem\",\n \"Removed '{title}' from your cart\",\n \"Message to tell user they removed an item\",\n array(\"title\" => $title)\n )\n );\n }\n }\n\n return $this->redirectBack();\n }", "public function destroySaveLater($item){\n\n Cart::instance('saveForLater')->remove($item);\n return back()->with('success_message','Item was removed !');\n }", "public function remove()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$this->cart->remove_product($item);\n\t\t\n\t\turl::redirect('cart');\n\t}", "function remove($item) {\n\t\t\t$numItems = count($this->items);\n\n\t\t\tfor($i = 0; $i < count($this->items); $i++) {\n\t\t\t\t$_item = $this->items[$i];\n\n\t\t\t\t// grab the last item's value, overwrite it \n\t\t\t\t// to the found item, then pop it off the stack\n\t\t\t\tif($_item->equals($item)) {\n\t\t\t\t\t$this->items[$i] = $this->items[$numItems - 1];\n\t\t\t\t\tarray_pop($this->items);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function remove($fruit) {\r\n // We get the number of $fruit in the basket\r\n // -1 to qty\r\n // Update value in basket\r\n\r\n $qty = $this->get($fruit);\r\n $this->itemQtyArr[$fruit] = $qty - 1;\r\n }", "public function testRemoveItem()\n {\n $item = $this->addItem();\n\n $this->laracart->removeItem($item->getHash());\n\n $this->assertEmpty($this->laracart->getItem($item->getHash()));\n }", "function removeItem($item){\n\t\tif( $item instanceof cacheItem)\n\t\t\t$item = $item->name;\n\t\tcacheItem::dropInstance($item);\n\t\treturn $this->db->delete(self::$tableName,array('WHERE name=?',$item));\n\t}", "public function removeItem($id){\n $cart = Session::get('cart');\n unset($cart->items[$id]);\n $itemTotal = $this->items[$id]['price'] * $this->items[$id]['qty'];\n $cart->totalPrice -= $itemTotal;\n $cart->totalQty -= $this->items[$id]['qty'];\n if($cart->totalQty <= 0){\n Session::flush();\n } else {\n Session::put('cart', $cart);\n }\n }", "public function removeItem($key);", "private function removeItem($id){\n $this->totalQty -= $this->items[$id]['qty'];\n $this->totalPrice -= $this->items[$id]['price'];\n unset($this->items[$id]);\n }", "public function remove_item($data)\n {\n $required = array(\n 'id' => 'Cart item id not passed',\n );\n $this->di['validator']->checkRequiredParamsForArray($required, $data);\n\n $cart = $this->getService()->getSessionCart();\n\n return $this->getService()->removeProduct($cart, $data['id'], true);\n }", "public function removeItem ( $item ) {\n\n if ( is_object( $item ) ) {\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Object: ' . $item->getIdentifier() );\n } else {\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Identifier: ' . $item );\n }\n\n\n $item = is_object( $item ) ? $item : $this->getOrder()->getItem( $item );\n\n $orderApi = new OrdersApi( );\n\n\n//\t\tdie(print_r($this->getOrder()->getItems(),true));\n //TODO: Check if the item exists, we have to remove it and add the new one.\n if ( $this->getOrder()->itemExists( $item->getIdentifier() ) ) {\n\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Item found: ' . $item->getIdentifier() );\n\n $orderApi->removeItem( $this->order, $item );\n\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Updating order after item removed: ' . $item->getIdentifier() );\n $this->update();\n\n return Message\\MessageManager::createSuccessfulMessage( 'Item removed sucessfully', $this->order );\n }\n\n return Message\\MessageManager::createSuccessfulMessage( 'Item not found', $this->order );\n }", "public function testRemoveItem()\n {\n $cart = new Cart(['foo']);\n $cart->removeItem('foo');\n $this->assertEquals([], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'horse', 3]);\n $cart->removeItem(3);\n $this->assertEquals(['bar', 'foo', 'horse'], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'horse', 'bar', 'horse', 3]);\n $cart->removeItem('foo');\n $this->assertEquals(['bar', 'bar', 'horse', 'horse', 3], $cart->getItems());\n }", "public function removeItem($index) {\n $this->sessionCart->removeItem($index);\n }", "public function remove($id)\n {\n\t\t$item = $this->getItem($id);\n \t$cart = $this->session->get(self::SHOPPINGCART);\n $this->session->forget(self::SHOPPINGCART);\n for($i=0;$i<sizeof($cart);$i++)\n {\n if($cart[$i] == $item)\n {\n continue;\n }\n $this->session->push(self::SHOPPINGCART,$cart[$i]);\n }\n \n \tfor($i=0;$i<sizeof($this->items);$i++)\n {\n if($this->items[$i] == $item)\n {\n unset($this->items[$i]);\n }\n }\n }", "public function remove($item) {\n $index = self::IndexOf($item);\n self::RemoveAt($index);\n }", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function removeItem(int $itemId): bool;", "public function unsetInStockStockItems()\n {\n $this->_inStockStockItems = null;\n }", "public function removeAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isRemoveItemAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n try {\n $this->getOnepage()->getQuote()\n ->removeItem($quoteItem->getId());\n \n $this->_recalculateTotals();\n $result['success'] = true;\n /**\n * When cart is ampty - redirect to empty cart page\n */\n if(!$this->getOnepage()->getQuote()->getItemsCount()){\n $result['redirect'] = Mage::helper('checkout/cart')->getCartUrl();\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during removing product from order');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "public function removeItemFromCartById($itemModelNum)\n {\n if ( !empty($this->cartItems) )\n {\n $i = 0;\n foreach ( $this->cartItems as $item )\n {\n if ( $item )\n {\n if ( $item->getModelNumber() == $itemModelNum )\n {\n unset($this->cartItems[i]);\n break;\n }\n $i++;\n }\n }\n }\n else\n {\n echo \"Cart is empty. Cannot Remove\";\n }\n Cart::updateTotalPrice();\n }", "public function remove(String $storeKey) {\n\n\t\tunset($this->__store[$storeKey]);\n\n\t}" ]
[ "0.679734", "0.6533454", "0.64882594", "0.64102197", "0.63687485", "0.6210717", "0.6152507", "0.61183125", "0.6115957", "0.6105898", "0.6068565", "0.6046272", "0.60171795", "0.6008523", "0.5975704", "0.5973731", "0.59717244", "0.59713745", "0.59648895", "0.59256136", "0.58610654", "0.5853415", "0.584802", "0.5842868", "0.5795139", "0.5793475", "0.5790901", "0.57875997", "0.578383", "0.57833475" ]
0.6587807
1
Method to process state for tree
protected function _processState(array &$tree) { try { foreach($tree['nodelist'] as &$item) { $node = '/' . $item['node']; $state = (preg_match('/^' . preg_quote($node, '/') . '.*/', self::$node . '/')) ? (($node == self::$node) ? 2 : 1) : 0; if($state !== 0) { $item['state'] = $state; if($state === 2) { $tree['current'] =& $item; } } unset($item, $node, $state); } unset($tree); } catch(\Exception $exception) { throw new \RuntimeException(\Glue\Helper\General::replace(array('method' => __METHOD__), GLUE_EXCEPTION_METHOD_FAILED), NULL, $exception); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _calculateTree() {\n include_once(\"bitlib/SQL/Tree.php\");\n include_once(\"bitlib/functions/common.php\");\n $db = common::getDB($GLOBALS[\"BX_config\"][\"dsn\"]);\n $t = new SQL_Tree($db);\n $t->FullPath=\"fulluri\";\n $t->Path=\"uri\";\n $t->FullTitlePath=\"fulltitlepath\";\n $t->Title=\"title_de\";\n \n $t->importTree(1);\n }", "public function calc_tree()\n\t{\n\t\t$this->readTree(TRUE);\t\t\t// Make sure we have accurate data\n\t\tforeach ($this->class_parents as $cp)\n\t\t{\n\t\t\t$rights = array();\n\t\t\t$this->rebuild_tree($cp,$rights);\t\t// increasing rights going down the tree\n\t\t}\n\t}", "abstract public function states();", "abstract public function getState() ;", "protected function loadTreeData() {}", "public function initializeTreeData() {}", "public function initializeTreeData() {}", "private function _process_state(&$unprocessed, &$processed, $state)\n\t{\n\t\tif(isset($processed[$state])) {\n\t\t\treturn $processed[$state];\n\t\t}\n\t\t\n\t\t$processed[$state] = [];\n\t\t$tokens = &$processed[$state];\n\t\t$rflags = $this->flags;\n\t\tforeach($unprocessed[$state] as $tdef) {\n\t\t\t\n\t\t\tif($tdef instanceof \\Phygments\\Lexers\\Regex\\Helper\\_Include) {\n\t\t\t\t// it's a state reference\n\t\t\t\tif($tdef == $state) {\n\t\t\t\t\tthrow new \\Exception(sprintf('circular state reference %s', (string)$state));\n\t\t\t\t}\n\n\t\t\t\t$tokens = array_merge($tokens, $this->_process_state($unprocessed, $processed, (string)$tdef));\n\t\t\t\tcontinue;\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($tdef instanceof \\Phygments\\Lexers\\Regex\\Helper\\_Inherit) {\n\t\t\t\t// processed already\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$rex = $this->_process_regex($tdef[0], $rflags);\n\t\t\t$token = $this->_process_token($tdef[1]);\n\t\t\t\n\t\t\tif(count($tdef) == 2) {\n\t\t\t\t$new_state = null;\n\t\t\t} else {\n\t\t\t\t$new_state = $this->_process_new_state($tdef[2], $unprocessed, $processed);\n\t\t\t}\n\t\t\t\n\t\t\t$tokens[] = array($rex, $token, $new_state);\t\t\n\t\t}\n\t\t\n\t\treturn $tokens;\n\t}", "private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}", "protected function processFileTree () {\n\t\t$files = $this->populateFileTree();\n\t\tforeach ($files as $file) {\n\t\t\t$this->processFile($file);\n\t\t}\n\t}", "function _modifyTree () {\r\n return true;\r\n }", "protected function updateState()\n {\n if (! array_key_exists($this->state, $this->state_tree))\n return false;\n\n foreach ($this->state_tree[$this->state] as $state) {\n if (strpos($this->line, $this->state_str[$state]) === 0) {\n $this->previous_state = $this->state;\n $this->state = $state;\n if (strlen($this->line) > strlen($this->state_str[$state]))\n $this->rerun = true; // There'll be additional info on this line\n return true;\n }\n }\n\n return false;\n }", "protected function load()\n {\n //$this->db->beginTransaction();\n $this->inTransaction = true;\n\n $q = $this->db->createSelectQuery();\n\n $q->select( '*' )\n ->from( $this->db->quoteIdentifier( $this->prefix.'pipe_execution' ) )\n ->where( $q->expr->eq( $this->db->quoteIdentifier( 'id' ),\n $q->bindValue( (int)$this->id ) ) );\n\n $stmt = $q->prepare();\n $stmt->execute();\n\n $result = $stmt->fetchAll( PDO::FETCH_ASSOC );\n\n if ( empty( $result ) )\n {\n //@todo better Exception\n throw new Exception(\n 'No state information for execution '.$this->id.'.'\n );\n }\n\n if ( $result === false )\n {\n //@todo better Exception\n throw new Exception(\n 'DB error loading state of execution '.$this->id.'.'\n );\n }\n\n // There can be only one result row\n $result = array_pop( $result );\n\n $this->pipeName = $result['pipe_name'];\n $this->pipeVersion = ( int )$result['pipe_version'];\n $this->executionState = ( int )$result['state'];\n\n //$this->parent = $result['parent'];\n $this->created = new DateTime( '@'.$result['created'] );\n\n // Load variables of this execution and of all nodes\n $q = $this->db->createSelectQuery();\n\n $q->select( '*' )\n ->from( $this->db->quoteIdentifier( $this->prefix.'pipe_execution_state' ) )\n ->where( $q->expr->eq( $this->db->quoteIdentifier( 'execution_id' ),\n $q->bindValue( (int)$this->id ) ) );\n\n $stmt = $q->prepare();\n $stmt->execute();\n\n $result = $stmt->fetchAll( PDO::FETCH_ASSOC );\n //@todo Check result\n\n $nodeStates = array();\n\n foreach( $result as $row )\n {\n $nodeId = ( int )$row['node_id'];\n\n if( 0 === $nodeId )\n {\n // This is the state of the execution \n $this->unserializeState( $row['state'] );\n }\n else\n {\n // It's a node's state\n $nodeStates[$nodeId] = $row['state'];\n }\n }\n\n $this->nodeStates = $nodeStates;\n }", "function perform( $data = FALSE )\r\n {\r\n // get var name defined in the public view to store the result\r\n $this->tree_result = & $this->B->$data['result']; \r\n $this->tree_result = array();\r\n\r\n if(!isset($data['node']))\r\n {\r\n $_node = 0;\r\n }\r\n else\r\n {\r\n $_node = $data['node'];\r\n }\r\n\r\n if(!isset($data['status']))\r\n {\r\n $status = FALSE;\r\n }\r\n else\r\n {\r\n $status = $data['status'];\r\n }\r\n\r\n if(SF_SECTION == 'public')\r\n {\r\n // check if cache ID exists\r\n if ( M( MOD_COMMON, \r\n 'cache_get',\r\n array('result' => $data['result'],\r\n 'cacheID' => SF_SECTION.'tree'.$_node.$status,\r\n 'cacheGroup' => 'navigation-tree'))) \r\n {\r\n return SF_IS_VALID_ACTION;\r\n } \r\n }\r\n\r\n // load navigation nodes\r\n include (SF_BASE_DIR . 'data/navigation/nodes.php'); \r\n \r\n // order the node tree by order\r\n $this->_tmp_array = array();\r\n $s=0;\r\n foreach($node as $n => $x)\r\n {\r\n $x['node'] = $n;\r\n $this->_tmp_array['o'.dechex($x['order']).$s] = $x; \r\n $s++;\r\n }\r\n \r\n ksort($this->_tmp_array);\r\n\r\n $this->_level = 0; \r\n\r\n // get child nodes of a given node id\r\n $this->_getTreeNodes( $_node, $status ); \r\n\r\n if(SF_SECTION == 'public')\r\n {\r\n // save result to cache\r\n M( MOD_COMMON, \r\n 'cache_save',\r\n array('result' => $this->tree_result)); \r\n }\r\n \r\n return SF_IS_VALID_ACTION;\r\n }", "function _postProcess() {\r\n $item = current($this->_struct);\r\n \r\n $ret = array('_name'=>$item['tag'], '_attributes'=>array(), '_value'=>null);\r\n\r\n if (isset($item['attributes']) && count($item['attributes'])>0) {\r\n foreach ($item['attributes'] as $key => $data) {\r\n if (!is_null($data)) {\r\n $item['attributes'][$key] = str_replace($this->_replaceWith, $this->_replace, $item['attributes'][$key]);\r\n }\r\n }\r\n $ret['_attributes'] = $item['attributes'];\r\n if ($this->attributesDirectlyUnderParent)\r\n $ret = array_merge($ret, $item['attributes']);\r\n }\r\n\r\n if (isset($item['value']) && $item['value'] != null)\r\n $item['value'] = str_replace($this->_replaceWith, $this->_replace, $item['value']);\r\n \r\n switch ($item['type']) {\r\n case 'open':\r\n $children = array();\r\n while (($child = next($this->_struct)) !== FALSE ) {\r\n if ($child['level'] <= $item['level'])\r\n break;\r\n \r\n $subItem = $this->_postProcess();\r\n \r\n if (isset($subItem['_name'])) {\r\n if (!isset($children[$subItem['_name']]))\r\n $children[$subItem['_name']] = array();\r\n \r\n $children[$subItem['_name']][] = $subItem;\r\n }\r\n else {\r\n foreach ($subItem as $key=>$value) {\r\n if (isset($children[$key])) {\r\n if (is_array($children[$key]))\r\n $children[$key][] = $value;\r\n else\r\n $children[$key] = array($children[$key], $value);\r\n }\r\n else {\r\n $children[$key] = $value;\r\n }\r\n }\r\n }\r\n }\r\n \r\n if ($this->childTagsDirectlyUnderParent)\r\n $ret = array_merge($ret, $this->_condenseArray($children));\r\n else\r\n $ret['_value'] = $this->_condenseArray($children);\r\n \r\n break;\r\n case 'close':\r\n break;\r\n case 'complete':\r\n if (count($ret['_attributes']) > 0) {\r\n if (isset($item['value']))\r\n $ret['_value'] = $item['value'];\r\n }\r\n else {\r\n\t\t\tif (isset($item['value'])) {\r\n\t\t\t\t$ret = array($item['tag']=> $item['value']);\r\n\t\t\t} else {\r\n\t\t\t\t$ret = array($item['tag']=> \"\");\r\n\t\t\t}\r\n }\r\n break;\r\n }\r\n\r\n //added by Dan Coulter\r\n\r\n \r\n /*\r\n foreach ($ret as $key => $data) {\r\n if (!is_null($data) && !is_array($data)) {\r\n $ret[$key] = str_replace($this->_replaceWith, $this->_replace, $ret[$key]);\r\n }\r\n }\r\n */\r\n return $ret;\r\n }", "public function save_tree()\n\t{\n\t\tforeach ($this->class_tree as $tree)\n\t\t{\n\t\t\tif (isset($tree['change_flag']))\n\t\t\t{\n\t\t\t\tswitch ($tree['change_flag'])\n\t\t\t\t{\n\t\t\t\t case 'INSERT' :\n\t\t\t\t\t$this->add_new_class($tree);\n\t\t\t\t\tbreak;\n\t\t\t\t case 'UPDATE' :\n\t\t\t\t\t$this->save_edited_class($tree);\n\t\t\t\t\tbreak;\n\t\t\t\t default :\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function populateState()\n\t{\n\t}", "protected function populateState()\n\t{\n\t}", "private function ReadPathTree()\n\t{\n\t\t$this->pathTreeRead = true;\n\n\t\tif (empty($this->path)) {\n\t\t\t/* this is a top level tree, it has no subpath */\n\t\t\treturn;\n\t\t}\n\n\t\t$path = $this->path;\n\n\t\twhile (($pos = strrpos($path, '/')) !== false) {\n\t\t\t$path = substr($path, 0, $pos);\n\t\t\t$pathhash = $this->commit->PathToHash($path);\n\t\t\tif (!empty($pathhash)) {\n\t\t\t\t$parent = $this->GetProject()->GetTree($pathhash);\n\t\t\t\t$parent->SetPath($path);\n\t\t\t\t$this->pathTree[] = $parent;\n\t\t\t}\n\t\t}\n\n\t\tif (count($this->pathTree) > 0) {\n\t\t\t$this->pathTree = array_reverse($this->pathTree);\n\t\t}\n\t}", "function ProcessMultilevel()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::ProcessMultilevel();\" . \"<HR>\";\n if ($this->listSettings->HasItem(\"MAIN\", \"PARENT_FIELD\")) {\n $this->parent_field = $this->listSettings->GetItem(\"MAIN\", \"PARENT_FIELD\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_PARENTFIELD_SETTINGS\", array(), true);\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"USE_SUB_CATEGORIES\")) {\n $this->use_sub_categories = $this->listSettings->GetItem(\"MAIN\", \"USE_SUB_CATEGORIES\");\n }\n else {\n $this->use_sub_categories = 0;\n }\n if ($this->use_sub_categories) {\n $this->ProcessMultilevelSubCategories();\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"ENABLE_MEGA_DELETE\")) {\n $this->mega_delete = $this->listSettings->GetItem(\"MAIN\", \"ENABLE_MEGA_DELETE\");\n }\n else {\n $this->mega_delete = 0;\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"ENABLE_NODE_MOVE\")) {\n $this->node_move = $this->listSettings->GetItem(\"MAIN\", \"ENABLE_NODE_MOVE\");\n }\n else {\n $this->node_move = 0;\n }\n\n }", "private function parse_directory_tree()\r\n {\r\n foreach ($this->tc_step_data_list as $tc_index => $testcase_node)\r\n {\r\n $first_level = $testcase_node->get_first_level();\r\n $first_id = null;\r\n $second_level = $testcase_node->get_second_level();\r\n $second_id = null;\r\n $third_level = $testcase_node->get_third_level();\r\n $third_id = null;\r\n $fourth_level = $testcase_node->get_fourth_level();\r\n $fourth_id = null;\r\n $fifth_level = $testcase_node->get_fifth_level();\r\n $fifth_id = null;\r\n \r\n if ($first_level != null && $first_level != \"\" && trim($first_level) != \"\")\r\n {\r\n $first_id = $this->parse_directory_level(1, $first_level, \r\n $tc_index, $testcase_node, null);\r\n }\r\n \r\n if ($second_level != null && $second_level != \"\" && trim($second_level) != \"\")\r\n {\r\n $second_id = $this->parse_directory_level(2, $second_level,\r\n $tc_index, $testcase_node, $first_id);\r\n }\r\n else \r\n {\r\n // no second level dic, means testcase in first dic\r\n $tc_parent = $this->directory_array[1][$first_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n continue;\r\n }\r\n \r\n if ($third_level != null && $third_level != \"\" && trim($third_level) != \"\")\r\n {\r\n $third_id = $this->parse_directory_level(3, $third_level,\r\n $tc_index, $testcase_node, $second_id);\r\n }\r\n else\r\n {\r\n // no third level dic, means testcase in second dic\r\n $tc_parent = $this->directory_array[2][$second_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n continue;\r\n }\r\n \r\n if ($fourth_level != null && $fourth_level != \"\" && trim($fourth_level) != \"\")\r\n {\r\n $fourth_id = $this->parse_directory_level(4, $fourth_level,\r\n $tc_index, $testcase_node, $third_id);\r\n }\r\n else\r\n {\r\n // no fourth level dic, means testcase in third dic\r\n $tc_parent = $this->directory_array[3][$third_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n continue;\r\n }\r\n \r\n if ($fifth_level != null && $fifth_level != \"\" || trim($fifth_level) != \"\")\r\n {\r\n // the last level dic\r\n $fifth_id = $this->parse_directory_level(5, $fifth_level,\r\n $tc_index, $testcase_node, $fourth_id);\r\n $tc_parent = $this->directory_array[5][$fifth_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n }\r\n else\r\n {\r\n // no fifth level dic, means testcase in fourth dic\r\n $tc_parent = $this->directory_array[4][$fourth_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n }\r\n }\r\n }", "protected function emitPostProcessTreeDataSignal() {}", "function putInTree()\n\t{\n//echo \"st:putInTree\";\n\t\t// chapters should be behind pages in the tree\n\t\t// so if target is first node, the target is substituted with\n\t\t// the last child of type pg\n\t\tif ($_GET[\"target\"] == IL_FIRST_NODE)\n\t\t{\n\t\t\t$tree = new ilTree($this->content_object->getId());\n\t\t\t$tree->setTableNames('lm_tree','lm_data');\n\t\t\t$tree->setTreeTablePK(\"lm_id\");\n\n\t\t\t// determine parent node id\n\t\t\t$parent_id = (!empty($_GET[\"obj_id\"]))\n\t\t\t\t? $_GET[\"obj_id\"]\n\t\t\t\t: $tree->getRootId();\n\t\t\t// determine last child of type pg\n\t\t\t$childs =& $tree->getChildsByType($parent_id, \"pg\");\n\t\t\tif (count($childs) != 0)\n\t\t\t{\n\t\t\t\t$_GET[\"target\"] = $childs[count($childs) - 1][\"obj_id\"];\n\t\t\t}\n\t\t}\n\t\tif (empty($_GET[\"target\"]))\n\t\t{\n\t\t\t$_GET[\"target\"] = IL_LAST_NODE;\n\t\t}\n\n\t\tparent::putInTree();\n\t}", "protected function _tree($array) {\n\n\t\t\t$root = array(\n\t\t\t\t'children' => array()\n\t\t\t);\n\t\t\t$current = &$root;\n\n\t\t\tforeach ($array as $i => $node) {\n\n\t\t\t\t$result = $this->_tag($node);\n\t\t\t\t\n\t\t\t\tif ($result) {\n\t\t\t\t\t\n\t\t\t\t\tif (isset($result['tag'])) {\n\t\t\t\t\t\t$tag = $result['tag'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tag = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($result['arguments'])) {\n\t\t\t\t\t\t$arguments = $result['arguments'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arguments = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($tag) {\n\t\t\t\t\t\t// If segment does not contain a closer\n\t\t\t\t\t\tif (!$result['closer']) {\n\t\t\t\t\t\t\t// clean up syntax if segment is isolated and \n\t\t\t\t\t\t\t// preceded by an plain text segment\n\t\t\t\t\t\t\t$last = ArrayMethods::last($current['children']);\n\t\t\t\t\t\t\tif ($result['isolated'] && is_string($last)) {\n\t\t\t\t\t\t\t\tarray_pop($current['children']);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current['children'][] = array(\n\t\t\t\t\t\t\t\t'index' => $i,\n\t\t\t\t\t\t\t\t'parent' => &$current,\n\t\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t\t'raw' => $result['source'],\n\t\t\t\t\t\t\t\t'tag' => $tag,\n\t\t\t\t\t\t\t\t'arguments' => $arguments,\n\t\t\t\t\t\t\t\t'delimiter' => $result['delimiter'],\n\t\t\t\t\t\t\t\t'number' => count($current['children'])\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$current = &$current['children'][count($current['children']) - 1];\n\t\t\t\t\t\t} else if (isset($current['tag']) && $result['tag'] == $current['tag']) {\n\t\t\t\t\t\t\t$start = $current['index'] + 1;\n\t\t\t\t\t\t\t$length = $i - $start;\n\t\t\t\t\t\t\t$current['source'] = implode(array_slice($array, $start, $length));\n\t\t\t\t\t\t\t$current = &$current['parent'];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$current['children'][] = array(\n\t\t\t\t\t\t\t'index' => $i,\n\t\t\t\t\t\t\t'parent' => &$current,\n\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t'raw' => $result['source'],\n\t\t\t\t\t\t\t'tag' => $tag,\n\t\t\t\t\t\t\t'arguments' => $arguments,\n\t\t\t\t\t\t\t'delimiter' => $result['delimiter'],\n\t\t\t\t\t\t\t'number' => count($current['children'])\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$current['children'][] = $node;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $root;\n\t\t}", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();" ]
[ "0.59861684", "0.59835136", "0.57236385", "0.56152904", "0.5594084", "0.5570806", "0.5570806", "0.5513232", "0.5508735", "0.5486823", "0.54719937", "0.54672635", "0.5447323", "0.54247606", "0.53693056", "0.5359117", "0.533816", "0.533816", "0.53379697", "0.52581286", "0.52428883", "0.5242522", "0.52149564", "0.5214503", "0.5212655", "0.5212655", "0.5212655", "0.5212655", "0.5212655", "0.5212655" ]
0.7104994
0
/ Checks if a file with the same name previously exists in the upload destination and overwrites the previous file if $overwrite is true or renames the uploaded file and keeps both files if $overwrite is false
protected function createFileName($name, $overwrite) { //get rid of any blank space in the submitted file name $nospaces = str_replace(' ', '_', $name); //mark the file as renamed if that changed the name from what was submitted if ($nospaces != $name) { $this->_renamed = true; } if (!$overwrite) { $existing = scandir($this->_destination); //check if an image with that name already exists if (in_array($nospaces, $existing)) { //if the filename already exists, we need to rename the file, so let's start by finding the character number of the '.' character $dot = strrpos($nospaces, '.'); if ($dot) { //get the name of the file up to but without the dot $base = substr($nospaces, 0, $dot); //store the current file extension as well $extension = substr($nospaces, $dot); } else { //else if the file has no extension, store its name too $base = $nospaces; $extension = ''; } //Now proceed to rename the file //we use a do while loop because we may be renaming multiple files from a multiple file upload, otherwise it will be just the one file being renamed, // hence the choice of do..while loop which will run at least once $i = 1; do { //we rename the file by adding an underscore and an incremented number (e.g. gus_2) to the basename (before the extension) //notice how we commence by incrementing the number after the underscore by one ($i++). The initial 1 value of $i is to indicate that we're uploading a second version of that same file //but the while loop below will also ensure that the renamed file has an incremented number for as long as it finds another file existing in the destination folder $nospaces = $base . '_' . $i++ . $extension; } while (in_array($nospaces, $existing)); //mark the file as renamed $this->_renamed = true; } } //return the new file name return $nospaces; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function overwrite_file($source_file, $destination_file)\n\t{\n\t\t/**\n\t\t* @todo generally think about overwriting files in another way, by creating a temporary file and then renaming it\n\t\t* @todo check for the destination file existance too\n\t\t*/\n\t\t$this->_delete($destination_file);\n\t\t$result = $this->_put($source_file, $destination_file);\n\t\t$this->_chmod($destination_file, $this->file_perms);\n\n\t\treturn $result;\n\t}", "public function overwrite($overwrite) {\n $this->_overwrite = ($overwrite === true);\n }", "public function move($sourcePath, $destinationPath, $checkIfIsUploaded = false, $overwrite = true);", "private function generateFilename($overwrite = false)\n\t{\n\n\t\tif(strpos( $this->relative_source_path, DIRECTORY_SEPARATOR) === false)\n\t\t{\n\t\t\t$this->full_target_path = $this->target_dir . \"/\" . time() .\"_\". md5( $this->relative_source_path ) . \".jpg\";\n\n\t\t\treturn;\n\t\t}\n\n\n\t\tif($overwrite)\n {\n $this->full_target_path = self::getFullPath($this->relative_source_path);\n }\n else\n {\n $filename = pathinfo($this->relative_source_path, PATHINFO_BASENAME); //PATHINFO_FILENAME ---> must add extension below!!!!\n $this->full_target_path = $this->target_dir . \"/\" . time() . \"_\" . $filename;\n }\n\t\n\t}", "public function check_exists(){\n if(!file_exists($this->file['tmp_name']) ){\n $this->file_name = 'sample.jpg';\n }else{\n $this->tmp_file_name = $this->file['tmp_name'];\n $this->file_type = $this->file['type'];\n $this->file_name = time() . '_' . $this->file['name']; //give name a timestamp to ensure no duplicate images made in the future\n }\n }", "private function fileCanBeCreated($newFile, $overwrite=true) {\r\n return (file_exists($newFile) && $overwrite) || !file_exists($newFile);\r\n }", "function overwrite($overwrite=true) {\r\n $this->overwrite = $overwrite;\r\n }", "public function rename($old_path, $new_path, $overwrite = false): bool\n {\n if (false != $overwrite && false != $this->fileExist($new_path))\n {\n $this->delete($new_path);\n }\n return ssh2_sftp_rename($this->_getSFTPResource(), $this->_getPath($old_path), $this->_getPath($new_path));\n }", "function move($pathFrom , $pathTo, $overwrite = true)\r\n\t{\r\n\t\tif (file_exists($pathTo)) {\r\n\t\t\tif ($overwrite) {\r\n\t\t\t\tunlink($pathTo);\r\n\t\t\t\t$ok = rename($pathFrom, $pathTo);\r\n\t\t\t} else {\r\n\t\t\t\t$ok = false;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$ok = rename($pathFrom, $pathTo);\r\n\t\t}\r\n\t\treturn $ok;\r\n\t}", "public function move(File $file, $overwrite = false, $filename = null) {\n\t\t$oldFilename = $file->getFilename();\n\t\t$newfilename = strlen($filename) ? $filename : $oldFilename;\n\n\t\t// check if the file has metadata\n\t\tif ($file instanceof ServerFile) {\n\t\t\t// get the old metadata\n\t\t\tif ($oldMetadataFile = $file->getParent()->getMetadataFile(false))\n\t\t\t\t$metadata = $oldMetadataFile->getSection($oldFilename);\n\t\t\t// get the new metadata file\n\t\t\t$newMetadataFile = $this->getMetadataFile((bool) $metadata);\n\t\t}\n\t\n\t\t// move the file to this directory\n\t\tif (!parent::move($file, $overwrite, $newfilename))\n\t\t\treturn false;\n\n\t\t// import file metadata, if it exists\n\t\tif ($metadata)\n\t\t\t$newMetadataFile->setSection($metadata, $newfilename);\n\t\t// delete any lingering metadata\n\t\tif ($oldMetadataFile)\n\t\t\t$oldMetadataFile->deleteSection($oldFilename);\n\t\treturn true;\n\t}", "public function check_file_exists_change_filename($filename, $target_folder = false){\n\t\t\tif (!$this->file_uploading_settings['allow_overwrites']){\n\t\t\t\tif (file_exists($target_folder . $filename)){\n\t\t\t\t\t//rename file if file exists\n\t\t\t\t\t$filename = rand(1000,9999) . time() . $filename;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $filename;\n\t\t\t\n\t\t}", "public function copy(File $file, $overwrite = false, $filename = null) {\n\t\t$oldFilename = $file->getFilename();\n\t\t$newfilename = strlen($filename) ? $filename : $oldFilename;\n\n\t\t// check if the file has metadata\n\t\tif ($file instanceof ServerFile) {\n\t\t\t// get the old metadata\n\t\t\tif ($oldMetadataFile = $file->getParent()->getMetadataFile(false))\n\t\t\t\t$metadata = $oldMetadataFile->getSection($oldFilename);\n\t\t\t// get the new metadata file\n\t\t\t$newMetadataFile = $this->getMetadataFile((bool) $metadata);\n\t\t}\n\t\n\t\t// move the file to this directory\n\t\tif (!parent::copy($file, $overwrite, $newfilename))\n\t\t\treturn false;\n\n\t\t// import file metadata, if it exists\n\t\tif ($metadata)\n\t\t\t$newMetadataFile->setSection($metadata, $newfilename);\n\t\treturn true;\n\t}", "public function move($path, $overwrite = false) {\n\t\t$path = str_replace('\\\\', '/', $path);\n\n\t\tif (substr($path, -1) !== '/') {\n\t\t\t$path .= '/';\n\t\t}\n\n\t\t// Don't move to the same folder\n\t\tif (realpath($path) === realpath($this->dir())) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!file_exists($path)) {\n\t\t\tmkdir($path, 0777, true);\n\n\t\t} else if (!is_writable($path)) {\n\t\t\tchmod($path, 0777);\n\t\t}\n\n\t\t// Determine name and overwrite\n\t\t$name = $this->name();\n\t\t$ext = $this->ext();\n\n\t\tif (!$overwrite) {\n\t\t\t$no = 1;\n\n\t\t\twhile (file_exists($path . $name . '.' . $ext)) {\n\t\t\t\t$name = $this->name() . '-' . $no;\n\t\t\t\t$no++;\n\t\t\t}\n\t\t}\n\n\t\t// Move the file\n\t\t$targetPath = $path . $name . '.' . $ext;\n\n\t\tif (rename($this->path(), $targetPath)) {\n\t\t\t$this->reset();\n\t\t\t$this->_path = $targetPath;\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function save_file($file, $name = null, $folder = VAR_FOLDER, $overwrite = false)\n{\n if ($file) {\n $filename = $name ? $name : $file['name'];\n if (!$file[\"tmp_name\"] || !$file[\"type\"]) {\n throw new Exception(\"bad_file\", 1);\n }\n $basename = basename($filename);\n $extension = pathinfo($basename, PATHINFO_EXTENSION);\n $name = pathinfo($basename, PATHINFO_FILENAME);\n if ($overwrite) {\n $correctFilename = $filename;\n } else {\n $correctFilename = \"\";\n if (file_exists($folder . DS. $basename)) {\n $correctFilename = sanitize_filename($name) . '_' . bin2hex(random_bytes(4)) . '.' . $extension;\n } else {\n $correctFilename = sanitize_filename(basename($filename));\n }\n }\n if (!move_uploaded_file($file['tmp_name'], $folder . DS. $correctFilename)) {\n throw new Exception(\"file_upload_error\", 1);\n }\n return $correctFilename;\n }\n}", "public function move($modify = 'original',$overwrite = false) {\n\t$path = $this->_destination;\n\n\tif ($this->_uploaded) {\n\t\t$field = current($this->_uploaded);\n\t\tif (is_array($field['name'])) {\n\t\t\tforeach ($field['name'] as $number => $filename) {\n\t\t\t\t// process multiple upload\n\t\t\t\t$this->_renamed = false;\n\t\t\t\t$this->processFile($filename, $field['error'][$number], $field['size'][$number], $field['type'][$number], $field['tmp_name'][$number], $path, $modify, $overwrite);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->processFile($field['name'], $field['error'], $field['size'], $field['type'], $field['tmp_name'], $path, $modify, $overwrite);\n\t\t}\n\t}\n }", "function uploadFileAndRename($strPathSaveTo, $file, $s_file_name)\n\t{\n\t\t$bReturn = true;\n\t\tif ($file['name'])\n\t\t{\n\t\t\tif (!file_exists($strPathSaveTo))\n\t\t\t{\n\t\t\t\tmkdir ($strPathSaveTo, 0777);\n\t\t\t}\n\t\t\t$strPath = $strPathSaveTo . $s_file_name;\n\t\t\tif (is_file($strPath))\n\t\t\t{\n\t\t\t\tunlink($strPath);\t\n\t\t\t}\n\t\t\tif (!is_file($strPath))\n\t\t\t{\n\t\t\t\tif (!copy($file['tmp_name'], $strPath))\n\t\t\t\t{\n\t\t\t\t\t$bReturn = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $bReturn;\n\t}", "public function overwrite($value = true)\n\t{\n\t\t$this->handle->file_overwrite = $value;\n\t}", "public static function x_move($source, $destination, $overwrite = false) {\n // source is array\n if (is_array($source)) {\n $result = true;\n foreach($source as $s) {\n $result = self::x_move($s, $destination, $overwrite) && $result;\n }\n return $result;\n }\n\n // target not existing\n // => rename\n // target file\n // => rename if overwrite\n if (!self::file_exists($destination) || $overwrite)\n return self::rename($source, $destination);\n\n // source is file and target folder\n // => rename if target not exists\n $new_dest = new Path($destination->getPath().DIRECTORY_SEPARATOR.basename($source->getPath()), $destination->getType());\n if (self::is_file($source) && self::is_dir($destination) && !self::file_exists($new_dest))\n return self::rename($source, $new_dest);\n }", "public function setOverwrite($overwrite)\n {\n $this->overwrite = $overwrite;\n }", "public function move($source, $destination, $overwrite = \\false)\n {\n }", "public function move($source, $destination, $overwrite = \\false)\n {\n }", "public function move($source, $destination, $overwrite = \\false)\n {\n }", "public function move($source, $destination, $overwrite = \\false)\n {\n }", "public function isOverwriteAllowed(): bool\n {\n return true;\n }", "function findUniqueFilename($existing_files = null) {\r\n\t\t// append a digit to the end of the name\r\n\t\t$filenumber = 0;\r\n\t\t$filesuffix = '';\r\n\t\t$fileparts = explode('.', $this->filename);\r\n\t\t$fileext = '.' . array_pop($fileparts);\r\n\t\t$filebase = implode('.', $fileparts);\r\n\r\n\t\tif( !eregi(\"jpeg|jpg|png|gif\",$fileext) ){\r\n\t\t\t$this->savefilename = md5($this->filename.$this->microtime_float()).$fileext.'_';\r\n\t\t}else{\r\n\t\t\t$this->savefilename = md5($this->filename.$this->microtime_float()).$fileext;\r\n\t\t}\r\n\r\n\r\n\t\tif (is_array($existing_files)) {\r\n\t\t\tdo {\r\n\t\t\t\t$newfile = $filebase . $filesuffix . $fileext;\r\n\t\t\t\t$filenumber++;\r\n\t\t\t\t$filesuffix = '(' . $filenumber . ')';\r\n\t\t\t} while (in_array($newfile, $existing_files));\r\n\t\t}\r\n\t\t\r\n\t\treturn $newfile;\r\n\t}", "public function save($overwrite = false) {\n\n\t // If php.ini post_max_size is set to a size less than the data being posted,\n\t \t // the PHP $_POST array will be empty (regardless if POST data is present.\n\t\t $maxSize = (integer)ini_get('post_max_size') * 1024 * 1024; \n\t\t $contentLength = (integer)$_SERVER['CONTENT_LENGTH'];\n\t\t if($contentLength > $maxSize)\n\t\t \t throw new UploadException('HTTP Content-Length greater than PHP configuration directive \\'post_max_size\\' (results in empty $_POST array). Content-Length = \\'' . $contentLength . '\\', post_max_size = \\'' . $maxSize . '\\'');\n\n\t\t \t// Create local file system name if not defined\n if(!$this->fileName) {\n\n $pieces = explode(DIRECTORY_SEPARATOR, $_FILES[$this->inputName]['name']);\n \t $filename = $pieces[count($pieces)-1];\n \t $this->fileName = $filename;\n }\n\n\t \t\t$pieces = explode('.', $this->fileName);\n\t \t\tif(count($pieces) > 1) $this->extension = $pieces[count($pieces) - 1];\n\t \t\t$this->uploadedFileName = $_FILES[$this->inputName]['name'];\n\t \t\t$this->size = $_FILES[$this->inputName]['size'];\n\t \t\t$this->contentType = $_FILES[$this->inputName]['type'];\n\n\t \t\t// Check size restriction if present\n\t \t\tif($this->maxSize && $this->size > $this->maxSize)\n\t \t\t throw new UploadException('File too large. Must not exceed ' . $this->maxSize . ' bytes.');\n\n\t \t\t// Check allowed extension(s) if configured\n\t \t\tif($this->allowedExtensions && $this->extension)\n\t \t\t if(!in_array(strtolower($this->extension), $this->allowedExtensions))\n\t \t\t throw new UploadException($this->extension . ' files are not allowed.');\n\n\t\t\t$target = $this->directory . DIRECTORY_SEPARATOR . $this->fileName;\n\n\t\t\t// Make sure the file doesn't exist if not overwriting\n\t\t\tif(file_exists($target) && !$overwrite)\n\t\t\t throw new UploadException('The uploaded file already exists');\n\n\t\t\tLog::debug('Upload::save Saving upload with input name \\'' . $this->inputName . '\\' to target path \\'' . $target . '\\'.');\n\n\t\t\tif(!move_uploaded_file($_FILES[$this->inputName]['tmp_name'], $target)) {\n\n\t\t\t \t switch($_FILES[$this->inputName]['error']) {\n\n\t\t\t \t \tcase 1:\n\t\t\t \t \t\t$error = 'The uploaded file exceeds the upload_max_filesize directive in php.ini.';\n\t\t\t \t \t\tbreak;\n\t\t\t \t \t\t\n\t\t\t \t \tcase 2:\n\t\t\t \t \t\t $error = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.';\n\t\t\t \t \t\t break;\n\t\t\t \t \t\t \n\t\t\t \t \tcase 3:\n\t\t\t \t \t\t $error = 'The uploaded file was only partially uploaded.';\n\t\t\t \t \t\t break;\n\t\t\t \t \t\t \n\t\t\t \t \tcase 4:\n\t\t\t \t \t\t $error = 'No file was uploaded.';\n\t\t\t \t \t\t break;\n\t\t\t \t \t\t \n\t\t\t \t \tcase 5:\n\t\t\t \t \t\t $error = 'Missing a temporary folder.'; // Introduced in PHP 4.3.10 and PHP 5.0.3\n\t\t\t \t \t\t break;\n\t\t\t \t \t\t \n\t\t\t \t \tcase 6:\n\t\t\t \t \t\t $error = 'Failed to write file to disk.'; // Introduced in PHP 5.1.0\n\t\t\t \t \t\t break;\n\t\t\t \t \t\t \n\t\t\t \t \tcase 7:\n\t\t\t \t \t\t $error = 'File upload stopped by extension.'; // Introduced in PHP 5.2.0\n\t\t\t \t \t\t break;\n\t\t\t \t }\n\n\t\t\t \t if(!isset($error)) return;\n\n\t\t\t \t Log::debug('Upload::save Upload failed with code \\'' . $_FILES[$this->inputName]['error'] . '\\' and message \\'' . $error . '\\'.');\n\t\t\t \t throw new UploadException($error, $_FILES[$this->inputName]['error']);\n\t\t\t}\n\n\t\t\tchmod($target, 0755);\n\t\t\tLog::debug('Upload::save Upload successfully saved');\n\n\t\t\treturn $target;\n\t }", "function checkExist($fileName){\n //check if file exist\n while (file_exists($fileName)) {\n //echo the option to overwrite or not\n echo 'File Exists:' . PHP_EOL;\n echo 'Overwrite?' . ' (Y)es' . ' (N)o' . PHP_EOL;\n //get the input to overwrite or not\n $overWrite = getInput(true);\n //switch statement on overwrite\n if($overWrite == 'N') {\n echo 'Enter new file name.' . PHP_EOL;\n $fileName = getInput();\n } elseif ($overWrite = 'Y') {\n return $fileName;\n }\n return $fileName;\n } \n}", "public function moveUploadedFile($uName, $destination, $option = null, &$output){\n\n //Check destination\n if( !file_exists($destination) ) $this->nestedMKDir($destination);\n\n\n //Check file uploaded or not\n if( !isset($_FILES[$uName]['tmp_name']) || !file_exists($_FILES[$uName]['tmp_name']) ) return ER_UP_FILE_NOT_EXISTS;\n\n $tmpFile = $_FILES[$uName]['tmp_name'];\n $tmpFileType = strtolower(substr($_FILES[$uName]['name'], strlen($_FILES[$uName]['name'])-3, 3));\n\n //Set water-marker if file is image\n if( $tmpFileType == 'jpg' || $tmpFileType == 'png' || $tmpFileType == 'tif' || $tmpFileType == 'bmp' ){\n list($width, $height) = getimagesize($_FILES[$uName]['tmp_name']);\n\n if( $width >= 400 || $height >= 400 ){\n $gdForm = new gdForm();\n\n $gdForm->appendWaterMark($_FILES[$uName]['tmp_name']);\n }\n }\n\n $randomFileName = false;\n $overWrite = false;\n $desfilename = null;\n\n if( !is_array($option) ) $option = array();\n\n foreach($option as $k=>$v){\n\n switch($k):\n case 'filetype':\n //Get ext\n $ext = $tmpFileType;\n\n if( empty($ext) ) return ER_UP_FILE_INVALID_TYPE;\n\n if( !preg_grep(\"/\" . $ext . \"/i\", $v) ) return ER_UP_FILE_INVALID_TYPE;\n break;\n case 'maxfilesize':\n $fs = filesize($tmpFile);\n if( $fs > $v ) return ER_UP_FILE_EXCEEDED_SIZE;\n break;\n case 'allowOverWrite':\n ///if( $v == false && file_exists($destination) ) return ER_UP_FILE_EXISTS;\n $overWrite = $v;\n break;\n case 'randomFileName':\n $randomFileName = $v;\n break;\n case 'desFileName':\n $desfilename = $v;\n break;\n endswitch;\n\n }//end foreach\n\n if( $randomFileName == true ){\n $des = filetype($destination) == 'file' ? dirname($destination) : $destination;\n $des .= substr($des, strlen($des)-1, 1) != '/' ? '/' : '';\n\n $ext = $tmpFileType;\n $des .= substr(str_shuffle(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, 10) . '.'. $ext;\n }else if( $desfilename == null ){\n $des = $destination;\n $des.= substr($des, strlen($des)-1, 1) != '/' ? '/' : '';\n $name= $_FILES[$uName]['name'];/*pathinfo($tmpFile, PATHINFO_BASENAME);*/\n $des.= $name;\n }else{\n $des = $destination;\n $des.= substr($des, strlen($des)-1, 1) != '/' ? '/' : '';\n $des.= $desfilename;\n }\n if( $overWrite == false && file_exists($des) ) return ER_UP_FILE_EXISTS;\n\n $r = @move_uploaded_file($tmpFile, $des);\n if( $r ){\n $des = str_replace($_SERVER['DOCUMENT_ROOT'], '', $des);\n $output = $des;\n return true;\n }else{\n return ER_UP_FILE_UNDEFINED;\n }\n }", "public function setOverwriteIfExists($isOverwrite) {\n $this->_overwrite = (boolean) $isOverwrite;\n }", "function FileUpload($files, $temp_name) {\n\n $ran = rand();\n if (file_exists($file_upload_dir . $ran . $files)) {\n echo false;\n } else {\n move_uploaded_file($temp_name, $file_upload_dir . $ran . $files);\n echo true;\n }\n}" ]
[ "0.65913475", "0.65009964", "0.62726325", "0.6230604", "0.6198522", "0.61751753", "0.6126193", "0.60714275", "0.6038394", "0.60343426", "0.6023347", "0.5906463", "0.5875084", "0.5840433", "0.57954687", "0.5792802", "0.5788634", "0.5781003", "0.5777803", "0.5717185", "0.5717185", "0.5717185", "0.57169414", "0.5693896", "0.56887174", "0.5679403", "0.56613797", "0.5640284", "0.56062734", "0.55442506" ]
0.7114448
0
/ notify all observers about any change in SunSubject
function notify() { foreach ($this->observers as $obKey => $obValue) { $obValue->update($this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function notify() {\n\t\tforeach($this->_observers as $key => $val) {\n\t\t\t$val->update($this);\n\t\t}\n\t}", "public function notify(){\n foreach ($this->observers as $observer){\n $observer->update();\n }\n }", "public function notifyObservers() {\n\t\tforeach ( $this->observers as $obs => $key )\n\t\t\t$key->update ( $this->actTemp, $this->maxTemp, $this->minTemp, $this->actPressure );\n\t}", "public function notify()\n {\n foreach ($this->observers as $value) {\n $value->update($this);\n }\n }", "function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update($this);\n }\n }", "public function notify()\n\t{\n\t\tforeach ($this->observers as $obs)\n\t\t{\n\t\t\t$obs->update($this);\n\t\t}\n\t}", "public function notify()\r\n {\r\n foreach( $this->observers as $observer )\r\n $observer->update( $this );\r\n\r\n }", "public function notify() {\n // Updates all classes subscribed to this object\n foreach ($this->observers as $obs) {\n $obs->update($this);\n }\n }", "public function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update();\n }\n }", "public function notifyObservers()\n {\n foreach ($this->observers as $obj) {\n $obj->update(\n $this->temperature,\n $this->humidity,\n $this->pressure\n );\n }\n }", "public function notify()\n {\n foreach ($this->_observers as $observer) {\n $observer->update($this);\n }\n }", "public function notify() {\n $this->observers->rewind();\n while($this->observers->valid()) {\n $object = $this->observers->current();\n // dump($object);die;\n $object->update($this);\n $this->observers->next();\n }\n }", "function update(AbstractSubject $subject)\n {\n write_in(\"Alert to observer\");\n write_in($subject->favorite);\n }", "public function notify()\n {\n foreach($this->_storage AS $observer) {\n $observer->update($this);\n }\n }", "public function notify()\n {\n $eventName = $this->getEventName();\n if (empty($this->observers[$eventName])) {\n $observerNames = Model::factory('Observer')->getByEventName($eventName);\n foreach ($observerNames as $observerName) {\n $this->observers[$eventName][] = new $observerName();\n }\n }\n if (!empty($this->observers[$eventName])) {\n foreach ($this->observers[$eventName] as $observer) {\n $observer->update($this);\n }\n }\n }", "public function observers();", "public function notify()\n {\n foreach ($this->storage as $obs){\n $obs->update($this);\n }\n }", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function notifyObserver()\n {\n if (!empty($this->observers)) {\n foreach ($this->observers as $observer) {\n $observer->update($this->getTemperature(), $this->getPressure(), $this->getHumidity());\n }\n }\n }", "protected function _syncSubject() {}", "public function update(\\SplSubject $subject) {}", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function update(SubjectInterface $subject): void;", "public function update(SplSubject $subject)\n {\n // TODO: Implement update() method.\n print_r($subject);\n}", "public function update(\\SplSubject $subject)\n {\n $this->changedUsers[] = clone $subject;\n }" ]
[ "0.721787", "0.72162306", "0.7122913", "0.71227336", "0.70694596", "0.70157844", "0.6984043", "0.6982503", "0.6939297", "0.691533", "0.68791705", "0.68739194", "0.6785612", "0.6515169", "0.6510684", "0.6427568", "0.64262956", "0.6423259", "0.6423259", "0.6423259", "0.6423259", "0.64221597", "0.64221597", "0.6352937", "0.63463515", "0.6319114", "0.6317779", "0.61526823", "0.61013836", "0.6089001" ]
0.7238421
0
Returns true if there is some error in transfer. Missing file is not an error.
public function HasError() { return !in_array($this->Error, array(UPLOAD_ERR_OK, UPLOAD_ERR_NO_FILE)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validUpload() {\t\n\t\tif($this->file['error'] == 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function hasError()\n {\n if ( curl_errno($this->handler) ) {\n return true;\n }\n return false;\n }", "private function wasFileSent() : bool\n {\n return isset($_FILES[$this->fieldName]['name']) && !empty($_FILES[$this->fieldName]['name']);\n }", "function check_file_error($file_error) {\nif ($file_error === 0) {\nreturn true;\n}else {\necho \"There is an error uploading the file\";\n}\n}", "public function isOk(): bool\n {\n return $this->getError() === UPLOAD_ERR_OK;\n }", "public function hasError()\n {\n return $this->info['http_code'] != '200';\n }", "public static function isFileError($error = 0)\n {\n\n if ($error !== 0)\n return false;\n return true;\n\n }", "public function isUploaded() {\n return ($this->getErrorCode() == UPLOAD_ERR_OK);\n }", "public function hasError() {\n return ($this->getStatus() != 1);\n }", "public function isValid() : bool\n {\n return $this->status === UPLOAD_ERR_OK;\n }", "public function isValid(): bool\n {\n return ($this->error === UPLOAD_ERR_OK) && is_uploaded_file($this->getPathname());\n }", "public function is_exist_file() {\r\n\t\treturn file_exists( $this->get_path( 'file' ) );\r\n\t}", "public function notFakeFile() {\n\t $check = filesize($this->value[\"tmp_name\"]);\n\t if($check !== false) {\n\t return true;\n\t } else {\n\t \treturn false;\n\t }\n\t}", "public function IsValid() {\n\n return $this->Error === UPLOAD_ERR_OK;\n }", "public function file($file): bool\n\t{\n if (is_array($file['error'])) {\n $error = (int)$file['error'][0];\n } else {\n $error = (int)$file['error'];\n }\n\n return $error !== 4;\n }", "public function hasError();", "public function hasError();", "public function hasError();", "public function hasError();", "public function isFile()\n {\n $this->is_file = false;\n\n try {\n\n if (@ftp_get($this->getConnection(), $this->temp, $this->path, Ftp_ASCII, 0)) {\n $this->is_file = true;\n }\n\n } catch (\\Exception $e) {\n }\n\n return;\n }", "public function isError(): bool\n {\n return !$this->isOk();\n }", "private function is_file_ok($file) {\n\t\tif (!file_exists($file)) {\n\t\t\tthrow new \\Exception('Video worker: File not exist! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\tif (!is_file($file)) {\n\t\t\tthrow new \\Exception('Video worker: This is not a file! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\tif (!is_readable($file)) {\n\t\t\tthrow new \\Exception('Video worker: This file is not readable! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function check() {\n\t\treturn file_exists($this->getFilePath());\n\t}", "private static function check_file($file) {\n if(file_exists(\"../\" . $file)) {\n throw new Exception(\"Error Processing Request: the given file does not exists\");\n }\n if(is_readable(\"../\" . $file)) {\n throw new Exception(\"Error Processing Request: the given file is not readable\");\n }\n return true;\n }", "protected function _checkConfirmUploadFile()\n\t{\n\t\tswitch ($this->_uploadedFile->getError()) {\n\t\t\tcase UPLOAD_ERR_OK:\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\tthrow new Exception('Empty File Upload ERROR!');\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_FORM_SIZE;\n\t\t\tcase UPLOAD_ERR_INI_SIZE;\n\t\t\t\tthrow new Exception('Too Large File Size ERROR!');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception('Something ERROR!');\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function hasError(): bool;", "public function hasError(): bool;", "public function checkError($file)\n {\n if(isset($file['error']) AND $file['error'] !== UPLOAD_ERR_OK) {\n $this->alert->set('error', 'normal', 'main', \"Une erreur est survenue.\");\n }\n return (isset($file['error']) AND $file['error'] !== UPLOAD_ERR_OK)? false : true;\n }", "function getFileExists() {\n\t\treturn file_exists($this->getFilename());\n\t}", "public function testUploadErrors() {\n\t\t$this->data['tmp_name'] = null;\n\n\t\ttry {\n\t\t\t$transit = new Transit($this->data);\n\t\t\t$transit->upload();\n\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\n\t\t$this->data['tmp_name'] = $this->tempFile;\n\t\t$this->data['error'] = 3;\n\n\t\ttry {\n\t\t\t$transit = new Transit($this->data);\n\t\t\t$transit->upload();\n\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\t}" ]
[ "0.7150491", "0.67486334", "0.67280847", "0.66065997", "0.6597482", "0.6593579", "0.6536562", "0.64926267", "0.6476616", "0.64389634", "0.6431632", "0.6398148", "0.6387687", "0.63710886", "0.6360043", "0.63526165", "0.63526165", "0.63526165", "0.63526165", "0.6322414", "0.6294696", "0.625732", "0.62558395", "0.6249624", "0.62488186", "0.6226087", "0.6226087", "0.6221966", "0.6209058", "0.6174097" ]
0.67948246
1
Returns array with width and height of uploaded image or false on missing or nonimage file.
public function GetImageSize() { return $this->IsValid() ? @getimagesize($this->TmpName) // @ - prevent warning on reading non-images : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_image_dimensions($file_path)\n\t{\n\n\t\tif( ! file_exists($file_path)) {\n\n\t\t\treturn FALSE;\n\n\t\t}\n\n\t\t// PHP7.4 does not come with GD JPEG processing by default\n\t\t// So, we need to run this check.\n\t\tif (function_exists('getimagesize'))\n\t\t{\n\t\t\t$imageSize = @getimagesize($file_path);\n\n\t\t\tif($imageSize && is_array($imageSize)) {\n\n\t\t\t\t$imageSizeParsed = [\n\t\t\t\t\t'height'\t=> $imageSize['1'],\n\t\t\t\t\t'width'\t=> $imageSize['0']\n\t\t\t\t];\n\n\t\t\t\treturn $imageSizeParsed;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// The file is either not an image, or there was an error.\n\t\treturn FALSE;\n\t}", "public function validDimensions() {\n\t\tlist($width, $height) = getimagesize($this->file['tmp_name']);\n\t\n\t\tif($height <= $this->max_height && $width <= $this->max_width) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\t\t\t\t\t\n\t}", "function checkImg(){\n global $postpath;\n return getimagesize($postpath) !== false;\n }", "public function is_valid_image() {\n\n if ( get_post_type( $this->slide->ID ) === 'attachment' ) {\n $image_id = $this->slide->ID;\n } else {\n $image_id = get_post_thumbnail_id( $this->slide->ID );\n }\n\n $meta = wp_get_attachment_metadata( $image_id );\n\n $is_valid = isset( $meta['width'], $meta['height'] );\n\n return apply_filters( 'metaslider_is_valid_image', $is_valid, $this->slide );\n }", "public function isValidImage() {\n return $this->_is_validimage;\n }", "public function dimensions() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\t$dims = null;\n\n\t\t\tif (!$file->isImage()) {\n\t\t\t\treturn $dims;\n\t\t\t}\n\n\t\t\t$data = @getimagesize($file->path());\n\n\t\t\tif ($data && is_array($data)) {\n\t\t\t\t$dims = array(\n\t\t\t\t\t'width' => $data[0],\n\t\t\t\t\t'height' => $data[1]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (!$data) {\n\t\t\t\t$image = @imagecreatefromstring(file_get_contents($file->path()));\n\t\t\t\t$dims = array(\n\t\t\t\t\t'width' => @imagesx($image),\n\t\t\t\t\t'height' => @imagesy($image)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $dims;\n\t\t});\n\t}", "public function ajax_check_banner_image_size() {\n \n $path = $_FILES['banner_image']['name'];\n $ext = pathinfo($path, PATHINFO_EXTENSION); \n \n $allowTypes = array('jpg','jpeg','gif','png');\n if(in_array(strtolower($ext),$allowTypes)){\n list($w, $h) = getimagesize($_FILES[\"banner_image\"][\"tmp_name\"]);\n if ($w == 1346 && $h == 660) echo 'Success'; else echo 'Error';\n } else {\n echo 'File_Ext_Err';\n }\n }", "protected function checkTrueImg()\n {\n\n if($this->imgFlag){\n\n if(!getimagesize($this->fileInfo['tmp_name'])){\n\n $this->error = 'The file is not image.';\n\n return false;\n\n }\n\n }\n\n return true;\n\n }", "function image_info($image)\n{\n // http://stackoverflow.com/a/2756441/1459873\n $is_path = preg_match('#^(\\w+/){1,2}\\w+\\.\\w+$#', $image);\n if ($is_path && false !== ($info = getimagesize($image))) {\n return array(\n 'width' => $info[0],\n 'height' => $info[1],\n 'mime' => $info['mime'],\n 'type' => 'file',\n );\n }\n $im = new \\Imagick();\n if ($im->readImageBlob($image)) {\n return array(\n 'width' => $im->getImageWidth(),\n 'height' => $im->getImageHeight(),\n 'mime' => $im->getImageMimeType(),\n 'type' => 'blob',\n );\n }\n return array('width' => 0, 'height' => 0, 'mime'=>'', 'type' => '');\n\n}", "public function get_size_image($img){\n if ($this->get_path_pic($img)){\n return filesize($this->get_path_pic($img)); \n }else{\n return false;\n }\n \n }", "public function isImage(){\n if(isset($_POST[\"submit\"])) {\n $check = getimagesize($_FILES[\"fileToUpload\"][\"tmp_name\"]);\n if($check !== false) {\n echo \"File is an image - \" . $check[\"mime\"] . \".<br>\";\n $this->uploadOk = 1;\n } else {\n echo \"File is not an image.<br>\";\n $this->uploadOk = 0;\n }\n }\n return $this->uploadOk;\n }", "function Is_image($filename){\n \n $size = getimagesize($filename);\nif($size==FALSE){\n $er=FALSE; \n\n}else{\n $er=TRUE; \n}\nreturn $er;\n}", "public function _get_img_info()\n {\n if ( ! file_exists($this->source_file) || ! filesize($this->source_file)) {\n return false;\n }\n list($this->source_width, $this->source_height, $type, $this->source_atts) = getimagesize($this->source_file);\n return isset($this->_avail_types[$type]) ? ($this->source_type = $this->_avail_types[$type]) : false;\n }", "public static function validateImageFile()\n {\n if (!isset($_FILES['logo_file'])) {\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_IMAGE_UPLOAD_FAILED'));\n return false;\n }\n if ($_FILES['logo_file']['size'] > 5000000) {\n // if input file too big (>5MB)\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_TOO_BIG'));\n return false;\n }\n // get the image width, height and mime type\n $image_proportions = getimagesize($_FILES['logo_file']['tmp_name']);\n // if input file too small\n if ($image_proportions[0] < Config::get('AVATAR_SIZE') || $image_proportions[1] < Config::get('AVATAR_SIZE')) {\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_TOO_SMALL'));\n return false;\n }\n if (!($image_proportions['mime'] == 'image/jpeg')) {\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_WRONG_TYPE'));\n return false;\n }\n return true;\n }", "function validImageSize($tempFileName)\n{\n\t$validSize = true;\n\t\n // Check if image file is valid size\n $imageStats = getimagesize($tempFileName);\n\t\n\t//invalid if height or width < 256px or > 1024px\n if (($imageStats[0] < 256) || ($imageStats[1] < 256) || ($imageStats[0] > 1280) || ($imageStats[1] > 1280))\n\t{\n $validSize = false;\n\t}\n\t\n\treturn $validSize;\n}", "public function correctImage(){\n parent::isImage();\n parent::exist();\n parent::sizeFile();\n return $this->uploadOk;\n }", "public function isImage(){\n if($this->imageFileType != \"jpg\" && $this->imageFileType != \"png\" && $this->imageFileType != \"jpeg\"\n && $this->imageFileType != \"gif\" ) {\n echo \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.<br>\";\n $this->uploadOk = 0;\n }\n return $this->uploadOk;\n }", "public function check_image_sizes($image_file){\n\t\t\t$error['error_exists'] = false;\n\t\t\t$error['error_message'] = false;\n\t\t\t\n\t\t\t//if the image file is not there then show error\n\t\t\tif (!isset($image_file) || $image_file == null){\n\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t$error['error_message'] = $this->file_uploading_settings['file_not_exist'];\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$image_size = getimagesize($image_file);\n\n\t\t\t\t$width = $image_size[0];\n\t\t\t\t$height = $image_size[1];\n\t\t\t\t\n\t\t\t\t//must be greater than a certain dimension\n\t\t\t\tif ($width < $this->file_uploading_settings['min_height_width'] || $height < $this->file_uploading_settings['min_height_width']){\n\t\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t\t$error['error_message'] = $this->file_uploading_settings['min_image_size_error'];\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//must be smaller than a certain dimension -> no need to do if config set to 0 -> 0 = unlimited\n\t\t\t\tif ($this->file_uploading_settings['max_width'] > 0){\n\t\t\t\t\tif ($width > $this->file_uploading_settings['max_width']){\n\t\t\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t\t\t$error['error_message'] = $this->file_uploading_settings['max_image_size_error'];\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->file_uploading_settings['max_height'] > 0){\n\t\t\t\t\tif ($height > $this->file_uploading_settings['max_height']){\n\t\t\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t\t\t$error['error_message'] = $this->file_uploading_settings['max_image_size_error'];\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\n\t\t\treturn $error;\n\n\n\t\t\t\n\t\t}", "private function isValidImage() {\r\n\t\t\treturn in_array($this->extension, $this->extAllowed) ? true : false;\r\n\t\t}", "function image_dimensions ( $image_path ) {\r\n\t\t$image = image_read($image_path,false);\r\n\t\tif ( !$image ) return $image;\r\n\t\t$width = imagesx($image);\r\n\t\t$height = imagesy($image);\r\n\t\t$dimensions = compact('width','height');\r\n\t\treturn $dimensions;\r\n\t}", "function elk_getimagesize($file, $error = 'array')\n{\n\t$sizes = @getimagesize($file);\n\n\t// Can't get it, what shall we return\n\tif (empty($sizes))\n\t{\n\t\t$sizes = $error === 'array' ? array(-1, -1, -1) : false;\n\t}\n\n\treturn $sizes;\n}", "function ImageInfo($file){\n $ret=array('width'=>0,'height'=>0,'ImageExt'=>'');\n $size = getimagesize($file);\nif($size==FALSE){\n\n\n}else{\n $ext=explode(\"/\", $size['mime']);\n $ret['ImageExt']=$ext[1]; \n $ret['width']=$size[0]; \n $ret['height']=$size[1];\n}\nreturn $ret;\n}", "public function is_image()\n\t\t{\n\t\t\treturn !is_null($f = $this->format()) && $f;\n\t\t}", "public function getImageSize()\n\t{\n\t\tlist($width, $height) = getimagesize($this->getFullpath());\n\n\t\treturn compact('width', 'height');\n\t}", "public function imageSize($image)\n\t{\n\t\tif (is_file($image))\n\t\t{\n\t\t\t$image = getimagesize($image);\n\n\t\t\treturn [\n\t\t\t\t'w' => $image[0],\n\t\t\t\t'h' => $image[1],\n\t\t\t];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn [\n\t\t\t\t'w' => 0,\n\t\t\t\t'h' => 0,\n\t\t\t];\n\t\t}\n\t}", "public function hasImageWidth()\n {\n return $this->image_width !== null;\n }", "function __checkDimensions($filePath) {\n\t\t$size = getimagesize($filePath);\n\t\t\t\t\n\t\tif(!$size) {\n\t\t\t$this->Session->setFlash('We could not check that image\\'s size, so we can\\'t upload it.');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\n\t\tif($size[0] > 800 || $size[1] > 800) {\n\t\t\t$this->Session->setFlash('Images cannot be any larger than 800 by 800 pixels.');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\t\t\n\t}", "public function image_size()\n\t{\n if (!$this->local_file) {\n $this->get_local_file();\n }\n $image_size = getimagesize($this->local_file);\n $this->mime = $image_size['mime'];\n return $image_size;\n\t}", "function getImageSize() \n { \n return array($this->_width,$this->_height); \n }", "function isImage($tempFile) {\n\n // Get the size of the image\n $size = getimagesize($tempFile);\n\n if (isset($size) && $size[0] && $size[1] && $size[0] * $size[1] > 0) {\n return true;\n } else {\n return false;\n }\n\n }" ]
[ "0.7213394", "0.7162518", "0.71464676", "0.71033216", "0.68905336", "0.68886024", "0.6876985", "0.6869756", "0.679584", "0.67584443", "0.67538893", "0.67511433", "0.6708959", "0.66778356", "0.6675638", "0.66334563", "0.66254205", "0.66207093", "0.6612658", "0.6583274", "0.65483606", "0.65386283", "0.65383166", "0.65178233", "0.6509317", "0.6477785", "0.6433035", "0.6381094", "0.6377943", "0.6374378" ]
0.72267246
0
Get the listings of the owner.
public function listings() { return $this->hasMany(Listing::class, 'owner_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _getListingsByLoggedInUser()\n\t{\n\t\t$user_id = $this->_getUserId();\n\t\tif ($user_id == 0 || $user_id == null){\n\t\t\treturn array('error' => 'USER_NOT_LOGGED_IN', 'code' => 3);\n\t\t}\n\t\t\n\t\t$listings = $this->Listing->GetListingsByUserId($user_id);\n\t\tif ($listings == null)\n\t\t\treturn array('error' => 'FAILED_TO_RETRIEVE_LISTINGS', 'code' => 4);\n\n\t\treturn $listings;\n\t}", "public static function allListings()\n {\n $listings = Listing::all();\n return $listings;\n }", "function monitor_list_owners() {\n $query = \"select distinct(`wf_owner`) from `\".GALAXIA_TABLE_PREFIX.\"instances`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_owner'];\n }\n return $ret;\n }", "public function getOwnedListings($userId)\r\n\t{\r\n\t\t$query = 'SELECT m.marketID\r\n\t\t\tFROM marketplace AS m\r\n\t\t\t\tLEFT JOIN marketplacePayments AS mpp ON mpp.marketID = m.marketID\r\n\t\t\tWHERE mpp.startDate <= NOW()\r\n\t\t\t\tAND mpp.endDate >= NOW()\r\n\t\t\t\tAND mpp.paid = 1\r\n\t\t\t\tAND m.mLive = 1\r\n\t\t\t\tAND m.mUserID = '.(int) $userId;\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$listings = $this->_db->loadAssocList('marketID');\r\n\t\tif (!$listings) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Add listing details and return\r\n\t\t$this->addDetails($listings);\r\n\t\treturn $listings;\r\n\t}", "static function get_sharing_perimssions_of_list_with_user($list_owner, $word_list_id, $email) {\n $share_with_id = self::email2id($email);\n\n global $con;\n $sql = \"\n SELECT `share`.`id`, `share`.`list`, `share`.`permissions` \n FROM `share`, `list` \n WHERE `list`.`id` = \".$word_list_id.\" AND `share`.`list` = `list`.`id` AND `list`.`creator` = \".$list_owner.\" AND `list`.`active` = 1 AND `list`.`user` = \".$share_with_id.\";\";\n $query = mysqli_query($con, $sql);\n while ($row = mysqli_fetch_assoc($query)) {\n return new SharingInformation($row['id'], new SimpleUser($share_with_id, null, null, $email), $row['list'], $row['permissions']);\n }\n }", "function lists() {\n $params = array();\n return $this->callServer(\"lists\", $params);\n }", "public function findForList()\n {\n return $this->findByShowInOverview(true);\n }", "public function client_listings(Request $request, Listing $listing = null)\n {\n // 'Real Estate Agent', 'Listing Agent', 'RH Agent', 'Co-broke'\n\n $listings = Listing::query()\n ->whereHas(\n 'users',\n fn ($builder) => $builder->where('user_id', auth()->user()->id)\n ->whereIn('group_id', [6, 10, 38, 37])\n )\n ->when($request['sort_by'] && $request['sort_dir'], fn ($query) => $query->orderBy($request['sort_by'], $request['sort_dir']))\n ->get();\n\n if($listing)\n return view('frontend.dashboard.listings-stats', compact('listings', 'listing'));\n else\n return view('frontend.dashboard.client-listings', compact('listings'));\n\n }", "public function getFollowedByList($perPage = null)\n {\n return $this->getOrPaginateFollowedBy($this->getFollowedByQueryBuilder(), $perPage);\n }", "public function getOpenings()\r\n {\r\n }", "public function index()\n {\n return Listing::all();\n }", "public function listing();", "public function meList( )\n\t{\n\t\t$userId = $this->getCurrentUserId();\n\t\treturn $this->adminListByUser($userId);\n\t}", "public function my_listings(Request $request, Listing $listing = null)\n {\n // 'Private Seller 11', 'Financial Institution 39', 'Bank Liaison 3', 'Asset Manager 24', 'Consumer Direct 36'\n\n $listings = Listing::query()\n ->whereHas(\n 'users',\n fn ($builder) => $builder->where('user_id', auth()->user()->id)\n ->whereIn('group_id', [11, 39, 3, 24, 36])\n )\n ->when($request['sort_by'] && $request['sort_dir'], fn ($query) => $query->orderBy($request['sort_by'], $request['sort_dir']))\n ->get();\n\n if($listing)\n return view('frontend.dashboard.listings-stats', compact('listings', 'listing'));\n else\n return view('frontend.dashboard.my-listings', compact('listings'));\n }", "public function list(Owner $owner, array $data): ListItemsDTO\n {\n return $this->indexModels(\n array_merge(\n $data,\n [\n 'filters' => [\n ['owner_id', $owner->id],\n ]\n ]\n )\n );\n }", "public function GetOwnedListingsByMarkerId($marker_id)\n\t{\n\t\tif( !$this->request->is('ajax') && !Configure::read('debug') > 0)\n\t\t\treturn;\n\n\t\t$this->layout = 'ajax';\n\t\t$user_id = $this->Auth->User('id');\n\t\tApp::Import('model', 'User');\n\t\t$is_university_admin = ($this->Auth->User('user_type') == User::USER_TYPE_UNIVERSITY_ADMIN);\n\t\tif ($user_id === 0 || (!$this->Listing->UserOwnsAListingAtMarkerId($user_id, $marker_id)) && !$is_university_admin) {\n\t\t\t\t$error = null;\n\t\t\t\t$error['marker_id'] = $marker_id;\n\t\t\t\t$this->Listing->LogError($user_id, 60, $error);\n\t\t\t\t$this->set('response', json_encode(array('error' => \n\t\t\t\t\t'We had some problems loading your listing. Chat with us using the tab along the bottom of the screen ' .\n\t\t\t\t\t'or contact [email protected] if the error persists. Reference error code 60')));\n\t\t\t\treturn; \n\t\t}\n\n\t\t/* Fetch all listing data for this marker_id, user_id combo */\n\t\tif ($is_university_admin)\n\t\t\t$user_id = null;\n\t\t$listings = $this->Listing->GetListingsByMarkerId($marker_id, $user_id);\n\t\t$this->set('response', json_encode($listings));\n\t\treturn;\n\t}", "public abstract function get_lists();", "public function getLists()\n {\n return $this->makeRequest('contacts/list/segments');\n }", "public function listings()\n {\n return $this->belongsTo('App\\Listing');\n }", "public function getLists()\n\t{\n\n\t\t$command = \"Command=Subscriber.GetLists\";\n\t\t\n\t\t$apiPath = $command\n\t\t;\n\n\t\treturn SessionData::getSession()->getResponse($apiPath);\n\n\t}", "public function listings()\n {\n return $this->belongsToMany(\n 'App\\Listing', 'listing_coupons', 'listing_id', 'coupon_id'\n );\n }", "public function user_lists(){\n return get_instance()->ecl('Instance')->mod('lists', 'user_lists', [get_instance()->ecl('Instance')->user(),'email']);\n }", "public function getOwners()\n {\n if (array_key_exists(\"owners\", $this->_propDict)) {\n return $this->_propDict[\"owners\"];\n } else {\n return null;\n }\n }", "public function getInfoList() {\n return $this->_get(21);\n }", "public function getListing(){\n $BusInfo = $this->BusinessOwnerModel->getBusinessID();\n \n foreach($BusInfo as $row1){\n $busID = $row1->bid;\n }\n \n $query = $this->db->get_where('BusinessListing', array('bid' => $busID));\n \n if($query->num_rows() > 0){\n foreach($query->result() as $row){\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }", "public function getOrderings() {}", "public function getList()\n {\n return $this->list;\n }", "public function getList()\n {\n return $this->list;\n }", "public function getList()\n {\n return $this->list;\n }", "public function listingsAction(Request $request)\n {\n\n ## 1. Initialization\n // Enable CORS in this API\n $response = CorsUtility::createCorsResponse();\n if (CorsUtility::requiresPreFlight($request)) {\n return $response;\n }\n\n ## 2. Validate request\n $api = new ApiUtility($request);\n\n $error = $api->validateRequest();\n\n // Return response\n if($error)\n {\n $response = $api->generateErrorResponse($error);\n return $response;\n }\n\n ## 3. Prepare information\n /* @var \\Doctrine\\ORM\\EntityRepository $repository */\n $repository = $this->getDoctrine()->getRepository('ManateeCoreBundle:Listing');\n\n if ($api->hasParameter('userId')) {\n $listings = $repository->findBy( array(\n 'userId' => $api->getParameter('userId')\n ));\n\n if(!is_array($listings)){\n $listings = array();\n }\n } else {\n $listings = $this->getUser()->getListings();\n }\n\n\n\n ## 4. Process info\n $displayParams = array('listingId', 'name', 'content', 'area',\n 'schedule', 'price', 'formattedTimestamp');\n\n $data = $api->generateData($listings, $displayParams);\n\n ## 5. Return payload\n $response = $api->generateResponse($data);\n return $response;\n }" ]
[ "0.7160915", "0.6681862", "0.6355202", "0.6309376", "0.62984455", "0.62033033", "0.6140931", "0.60837483", "0.60051763", "0.5975873", "0.59716", "0.5963204", "0.5962228", "0.593347", "0.5855118", "0.5818661", "0.5810291", "0.58078724", "0.5766747", "0.5759229", "0.57576823", "0.57399166", "0.5735284", "0.5720192", "0.57011247", "0.56850475", "0.5679579", "0.5679579", "0.5679579", "0.56707203" ]
0.7713336
0
Show the form for creating a new Specification_type.
public function create() { $specification = Specification::all(); return view('specification_types.create')->with(compact('specification')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(CreateSpecification_typeRequest $request)\n {\n $input = $request->all();\n\n $specificationType = $this->specificationTypeRepository->create($input);\n\n Flash::success('Specification Type saved successfully.');\n\n return redirect(route('specificationTypes.index'));\n }", "public function create()\n {\n return view('specifications.create');\n }", "public function create()\n {\n return view('specifications.create');\n }", "public function newAction() {\n\n $entity = $this->get('admin.helper.ClothingType')->createNew();\n $form = $this->createForm(new ClothingTypes('add',$entity), $entity);\n return $this->render('LoveThatFitAdminBundle:ClothingType:new.html.twig', array(\n 'form' => $form->createView()));\n }", "public function create()\n\t{\n\t\treturn View::make('scaffolds.product_types.create');\n\t}", "public function create()\n {\n //\n return view('layouts.unit_types.form', ['type' => 'create']);\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('product_type.create');\n }", "public function create()\n {\n return view('admin.product_type.create');\n }", "public function create()\n {\n return view('catalogs.computerType.create');\n }", "public function create()\n {\n return view('admin.product_types.create');\n }", "public function create()\n {\n $model = new Type_cars();\n return view('modules.type.form', compact('model'));\n }", "public function create()\n {\n\n $jets = Jet::get();\n\n\n return view('admin.cabinSpecifications.form', [\n 'jets' => $jets\n ]);\n\n }", "public function create($type_id)\n {\n\n return view('admin.brands.types.models.create',compact('type_id'));\n }", "public function create()\n {\n return View::make('product_types.create');\n }", "public function create()\n {\n if (!checkRole(getUserGrade(1)))\n {\n prepareBlockUserMessage();\n return back();\n }\n\n $data['title'] = 'Create Industry Type';\n $data['active_class'] = 'industry_type';\n \n\n $data['subscribers'] = Subscriber::getSubscriberOptions();\n \n return view('admin.industry_type.create', $data);\n }", "public function create()\n {\n return view('admin.formtype.create', [\n 'form_type' => new FormType,\n 'colors' => Setting::colors()\n ]);\n }", "public function newAction()\n {\n $typeSeance = new TypeSeance();\n\n $form = $this->createCreateForm($typeSeance);\n\n $pages = array();\n $pages['Types de Séance '] = \"movibe_backend_typeSeance\";\n $pages['Creation'] = \"\";\n $this->breadcrumb($pages);\n\n return $this->render('MovibeBackendBundle:TypeSeance:new.html.twig', array(\n 'typeSeance' => $typeSeance,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('masters.companytypes.create');\n }", "public function create()\n {\n return view('admin.pages.company-type.create');\n }", "public function createType()\n {\n\n return view('expense.type.create', compact(''));\n }", "public function newAction()\n {\n/* \t$numfields = $this->getDoctrine()\n \t->getRepository('HegesAppConfigBundle:Configlinetype')\n \t->find($fieldsnumber);\n */\n \t\n \t\n $entity = new Configline();\n $form = $this->createForm(new ConfiglineType(), $entity);\n\n return $this->render('HegesAppConfigFileBundle:Configline:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create()\n {\n return view('backend.types.create');\n }", "public function create()\n {\n return view('admin.type.create');\n }", "protected function form()\n {\n $form = new Form(new SpecificationTemplate());\n\n $form->text('name', __('Name'));\n $form->keyValues('content', __('Content'));\n $form->number('sort', __('Sort'))->default(0);\n $form->switch('is_display', __('Is display'))->default(1);\n\n return $form;\n }", "public function create()\n {\n return view('admin.portftype.addportfoliotype');\n }", "public function create()\n {\n return view('admin/type/create');\n }", "public function create()\n {\n return view('admin.job-type.create');\n }", "public function create()\n {\n return view('admin.job_types.create');\n }", "public function create()\n {\n return view('manage.project-type.create');\n }" ]
[ "0.6891645", "0.6832236", "0.6832236", "0.67393976", "0.6649213", "0.6638073", "0.6626142", "0.6617111", "0.6614032", "0.6567561", "0.6533818", "0.65306485", "0.65222585", "0.65126884", "0.65025246", "0.6494007", "0.6493881", "0.6490555", "0.64793557", "0.64711577", "0.64697886", "0.6439236", "0.64380276", "0.6422312", "0.641536", "0.6414314", "0.64127094", "0.640603", "0.63904846", "0.6388555" ]
0.78522754
0
Store a newly created Specification_type in storage.
public function store(CreateSpecification_typeRequest $request) { $input = $request->all(); $specificationType = $this->specificationTypeRepository->create($input); Flash::success('Specification Type saved successfully.'); return redirect(route('specificationTypes.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveType()\n {\n }", "public function save(Type $type) {\n $typeData = array(\n 'name_ET' => $type->getName()\n );\n\n if ($type->getNum()) {\n // The type has already been saved : update it\n $this->getDb()->update('eventtype', $typeData, array('num_ET' => $type->getNum()));\n } else {\n // The type has never been saved : insert it\n $this->getDb()->insert('eventtype', $typeData);\n // Get the id of the newly created type and set it on the entity.\n $id = $this->getDb()->lastInsertId();\n $type->setNum($id);\n }\n }", "public function run()\n {\n $arr = array(\n 'units',\n 'value',\n 'tolerance',\n 'method'\n );\n $type= array();\n\n foreach ($arr as $key) {\n $now = Carbon::now();\n $type[] = [\n 'name' => $key,\n 'updated_at' => $now,\n 'created_at' => $now,\n ];\n }\n SpecificationType::insert($type);\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'title'=>'max:189|required',\n 'project_type'=>'max:189|required',\n 'existing_desc'=>'max:189|required',\n 'requirement_spec'=>'max:189|required',\n 'hardware_env'=>'max:189|required',\n 'software_env'=>'max:189|required',\n 'provisional_planning'=>'max:500|required'\n ]);\n\n $specification=new Specification();\n $specification->title=$request->input('title');\n $specification->project_type=$request->input('project_type');\n $specification->existing_desc=$request->input('existing_desc');\n $specification->requirement_spec=$request->input('requirement_spec');\n $specification->hardware_env=$request->input('hardware_env');\n $specification->software_env=$request->input('software_env');\n $specification->provisional_planning=$request->input('provisional_planning');\n $specification->created_by=auth()->user()->id;\n if($specification->save())\n return redirect('/specifications')->with('success','specification created');\n }", "public function store(AuditTypeRequest $request)\n\t{\n\t\t$auditType = new AuditType;\n $auditType->name = $request->name;\n $auditType->description = $request->description;\n $auditType->user_id = Auth::user()->id;\n\t}", "public function save(\n\t $type = 'SYSTEM'\n\t )\n\t{\n\t}", "public function storeSpecification($storeData, $presetId)\n { \n if (!__isEmpty($storeData)) { \n $specificationPresetItem = [];\n foreach ($storeData as $key => $input) {\n \n $specification = new Specification;\n $specificationStoreData = [\n 'label',\n 'use_for_filter',\n 'status'\n ];\n\n if ($specification->assignInputsAndSave($input, $specificationStoreData)) {\n $specificationPresetItem[] = [\n 'specification_presets__id' => $presetId,\n 'specifications__id' => $specification->_id\n ];\n }\n }\n\n $newSpecificationPresetItem = new SpecificationPresetItem;\n if ($newSpecificationPresetItem->prepareAndInsert($specificationPresetItem, '_id')) {\n return true;\n }\n }\n \n return false; \n }", "public function store(Request $request)\n {\n\n $this->validate(request(), [\n 'name' => 'required|string',\n 'type' => 'required|string',\n 'jsonOptions' => 'json'\n ]);\n\n $validator = new JSONValidate;\n\n $json = json_decode(request('jsonOptions'));\n //Check each option for valid format\n\n foreach($json as $obj) {\n $validator->validate(\n $obj,\n (object)[\n \"type\"=>\"object\",\n \"properties\"=>(object)[\n \"label\"=>(object)[\n \"type\"=>\"string\",\n \"required\"=>true\n ],\n \"value\"=>(object)[\n \"type\"=>\"string\",\n \"required\"=>true\n ],\n ]\n ],\n Constraint::CHECK_MODE_NORMAL\n ); //validates, and sets defaults for missing properties\n }\n\n\n if ($validator->isValid()) {\n $spec = new Specification();\n $spec->name = request('name');\n $spec->slug = $this->createSlug(request('name'));\n $spec->type = request('type');\n $spec->options = request('jsonOptions');\n $spec->save();\n \\Session::flash('flash_created',request('name') . ' has been created');\n return redirect('/admin/specifications');\n } else {\n return redirect('/admin/specifications/create')->withErrors(\"Error, Invalid Options\");\n }\n\n\n }", "public function store(IntentTypeRequest $request) {\n $type = $this->service()->repo()->create($request->all());\n return $this->created($type);\n }", "public function store()\n {\n $this->validate(request(), [\n 'code' => ['required', 'unique:attributes,code,NULL,NULL,entity_type,' . request('entity_type'), new Code],\n 'name' => 'required',\n 'type' => 'required',\n ]);\n\n Event::dispatch('settings.attribute.create.before');\n\n request()->request->add(['quick_add' => 1]);\n\n $attribute = $this->attributeRepository->create(request()->all());\n\n Event::dispatch('settings.attribute.create.after', $attribute);\n\n session()->flash('success', trans('admin::app.settings.attributes.create-success'));\n\n return redirect()->route('admin.settings.attributes.index');\n }", "public function create()\n {\n $specification = Specification::all();\n return view('specification_types.create')->with(compact('specification'));\n }", "function timetracking_type_save(timetrackingType $type) {\n $type->save();\n}", "public function store()\n {\n $this->validate(request(), [\n 'name' => 'required|unique:lead_types,name',\n ]);\n\n Event::dispatch('settings.type.create.before');\n\n $type = $this->typeRepository->create(request()->all());\n\n Event::dispatch('settings.type.create.after', $type);\n\n return response([\n 'data' => new TypeResource($type),\n 'message' => __('admin::app.settings.types.create-success'),\n ]);\n }", "public function store(TypeRequest $request)\n {\n $type = Type::create($request->all());\n\n return $this->showOne($type, 'type creado correctamente');\n }", "public function store(StorageTypeRequest $request)\n {\n try {\n $this->service->addStorageType($request);\n return $this->Created('Successfully added new storage type');\n } catch (\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch (Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function store(TypeStoreRequest $request)\n {\n types::create([\n 'type_id' => $request->type_id,\n 'type_name' => $request->type_name,\n ]);\n return redirect()->route('types.index')->with('message','Type Added Successfully');\n }", "public function store(Request $request, Type $type)\n {\n $request = $request->all()['PropertyTypes'];\n \n if($type->create($request))\n {\n return response()->json(['success'=>'Property type created successfuly']);\n }\n else\n {\n return response()->json(['error'=>'Property type creation failed']);\n }\n }", "public static function forge($type = 'db', $config = null)\n\t{\n\t\t// validate the type\n\t\tif (empty($type) or ! is_string($type))\n\t\t{\n\t\t\tthrow new \\RuntimeException('FOU-028: Specified storage type must be a string value');\n\t\t}\n\n\t\t// create and return the requested storage instance\n\t\treturn static::getDic()->resolve('storage.'.$type, array($config));\n\t}", "public function setStorageType($storageType) {\n\t\t\n\t\t$this->_storageType = $storageType;\n\t}", "function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $ret = false;\r\n $name = $db->escapeString( $this->Name );\r\n $description = $db->escapeString( $this->Description );\r\n if ( !isSet( $this->ID ) )\r\n {\r\n $db->lock( \"eZContact_CompanyType\" );\r\n\t\t\t$this->ID = $db->nextID( \"eZContact_CompanyType\", \"ID\" );\r\n $res[] = $db->query( \"INSERT INTO eZContact_CompanyType\r\n (ID, Name, Description, ImageID, ParentID)\r\n VALUES\r\n ('$this->ID',\r\n '$name',\r\n '$description',\r\n '$this->ImageID',\r\n '$this->ParentID')\" );\r\n $db->unlock();\r\n $ret = true;\r\n }\r\n else\r\n {\r\n $res[] = $db->query( \"UPDATE eZContact_CompanyType set Name='$name', Description='$description', ImageID='$this->ImageID', ParentID='$this->ParentID' WHERE ID='$this->ID'\" );\r\n\r\n $ret = true;\r\n }\r\n eZDB::finish( $res, $db );\r\n return $ret;\r\n }", "public function storageType();", "public function store(Request $request, Category $category)\n {\n $this->storeValidator($request->all());\n $exist = $request->get(\"exists\", false);\n if ($exist) {\n $specification = Specification::find($exist);\n }\n else {\n $specification = Specification::create($request->all());\n }\n \n $title = $request->get(\"title\", false);\n if (empty($title)) {\n $title = $specification->title;\n }\n /**\n * @var Specification $specification\n */\n $specification->categories()->attach($category, [\n \"title\" => $title,\n \"filter\" => $request->has(\"filter\") ? 1 : 0,\n \"priority\" => $request->get(\"priority\", 1),\n ]);\n\n event(new CategorySpecificationUpdate($category));\n\n return redirect()\n ->route(\"admin.categories.specifications.index\", [\"category\" => $category])\n ->with(\"success\", \"Характеристика добавлена\");\n }", "protected function store($mimetype) {\n\t\t$this->dbConnection->insertIfNotExist('*PREFIX*mimetypes', [\n\t\t\t'mimetype' => $mimetype\n\t\t]);\n\n\t\t$fetch = $this->dbConnection->getQueryBuilder();\n\t\t$fetch->select('id')\n\t\t\t->from('mimetypes')\n\t\t\t->where(\n\t\t\t\t$fetch->expr()->eq('mimetype', $fetch->createNamedParameter($mimetype)\n\t\t\t));\n\n\t\t$result = $fetch->execute();\n\t\t$row = $result->fetch();\n\t\t$result->closeCursor();\n\n\t\tif (!$row) {\n\t\t\tthrow new \\Exception(\"Failed to get mimetype id for $mimetype after trying to store it\");\n\t\t}\n\n\t\t$this->mimetypes[$row['id']] = $mimetype;\n\t\t$this->mimetypeIds[$mimetype] = $row['id'];\n\t\treturn $row['id'];\n\t}", "public function store(Request $request)\n {\n $rules = ['type_name' => 'required'];\n\n $messages = [\n 'type_name.required' => 'Type name is required!',\n ];\n\n $validator = Validator::make($request->all(), $rules, $messages);\n\n if ($validator->fails()) {\n \n return redirect()->back()->withErrors($validator)->withInput();\n \n }\n\n $report_type = new ReportType;\n\n $report_type->name = $request->type_name;\n $report_type->description = $request->description;\n\n $report_type->save();\n \n $request->session()->flash('success', 'Add Report type successful.');\n \n return redirect()->back()->withInput();\n }", "function variant_set_type($variant, $type) {}", "private static function registerSpecification(\n PropertySpecification $specification )\n {\n self::$specifications[$specification->getName()] = $specification;\n }", "public function storeType(Request $request)\n {\n $type = new ExpenseType();\n $type->name = $request->name;\n $type->save();\n Flash::success(trans('general.successfully_saved'));\n return redirect('expense/type/data');\n }", "public function store(StoreIncomeTypeRequest $request)\n {\n $this->incomeTypes->create($request->all());\n return redirect()->route('admin.configuration.incomeTypes.index')->withFlashSuccess(trans('alerts.backend.generals.created'));\n }", "public function store(Request $request)\n {\n $attributes = $request->all();\n $this->productTypeService->add($attributes);\n\n return redirect()->route('type.create')->with('status', 'Новый тип товаров добавлен!');\n }", "public function store(SpecializationRequest $request)\n {\n // $specialization = Specialization::create($request->all());\n // return back()->with('success', 'Name added successully!');\n\n $specialization = new App\\Models\\Specialization();\n $specialization->name = $request->specialization;\n $specialization->category_id = $request->category;\n $specialization->save();\n return back()->with('success', 'Name added successully!');\n }" ]
[ "0.59298974", "0.5857471", "0.5816396", "0.5762593", "0.5721604", "0.569306", "0.5689876", "0.565144", "0.56136304", "0.55326897", "0.55313015", "0.55204844", "0.54565305", "0.54481673", "0.5446711", "0.53715074", "0.5341286", "0.52945787", "0.5279172", "0.52786213", "0.52690476", "0.5237383", "0.5225318", "0.5219698", "0.52180755", "0.520332", "0.51951575", "0.5177545", "0.51755065", "0.5160272" ]
0.70928854
0
Update the specified Specification_type in storage.
public function update($id, UpdateSpecification_typeRequest $request) { $specificationType = $this->specificationTypeRepository->find($id); if (empty($specificationType)) { Flash::error('Specification Type not found'); return redirect(route('specificationTypes.index')); } $specificationType = $this->specificationTypeRepository->update($request->all(), $id); Flash::success('Specification Type updated successfully.'); return redirect(route('specificationTypes.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function update_type($new_type) { \n\n\t\tif ($this->_update_item('type',$new_type,'50')) { \n\t\t\t$this->type = $new_type;\n\t\t}\n\n\t}", "public function update($data, $type = '')\n {\n }", "public function update(Request $request, Type $type)\n {\n //\n }", "public function update(Request $request, Type $type)\n {\n //\n }", "public function update(Request $request, ItemType $type)\n {\n $type->update($request->validate([\n 'manufacturer' => 'nullable|min:2',\n 'model' => 'nullable|min:2',\n 'stock_type' => ['nullable', Rule::in(ItemStockType::getValues())],\n ]));\n\n return response($type);\n }", "function _mongo_node_update_type($old_entity_type, $entity_type) {\n // Update collection names.\n _mongo_node_rename_collection($old_entity_type, $entity_type);\n\n // Update bundle name in mongo entities.\n $collection = mongodb_collection('fields_current', $entity_type);\n $result = $collection->update(\n array('_type' => $old_entity_type),\n array('$set' => array('_type' => $entity_type, 'type' => $entity_type))\n );\n}", "public function update($type, $id = null);", "public function update(Request $request, HouseType $type)\n {\n $request->validate(['type_name' => 'required|string']);\n\n $type->update(['type_name' => title_case($request->type_name)]);\n\n alert()->success('Updated Successfully');\n\n return redirect()->route('types.index');\n }", "public function update(TypeStoreRequest $request, types $type)\n {\n $type->update([\n 'type_id' => $request->type_id,\n 'type_name' => $request->type_name,\n // 'password' => Hash::make($request->password),\n ]);\n return redirect()->route('types.index')->with('message','Type updated Successfully');\n }", "public function update(Request $request, Type $type)\n {\n //\n $request -> validate([\n 'name' => 'required'\n ]);\n\n Type::update($request->all());\n\n return redirect()->route('type')\n ->with('success','แก้ไขหมวดหมู่อัลบั้มสำเร็จ');\n }", "public function update(Request $request, Type $type)\n {\n $this->validate($request, [\n 'name' => [\n 'max:50',\n Rule::unique('types', 'name')->ignore($type->name, 'name'), // 更新时排除自己的名称后,检查是否为唯一值\n ],\n 'sort' => 'nullable|integer',\n ]);\n\n $type->update($request->all());\n\n // return response([\n // 'data' => $type,\n // ], Response::HTTP_OK);\n return new TypeResource($type);\n }", "public function update(Request $request, Type $type)\n {\n Gate::authorize('edit-type', $type);\n $validationData = $request->validate([\n 'name' => 'required|min:2',\n ]);\n\n $type->update([\n 'name' => $validationData['name'],\n 'slug' => Str::slug($validationData['name']),\n 'user_id' => Auth::id()\n ]);\n return redirect()->route('admin.types.show', ['type' => $type->id])->with(\"success\", \"{$type->name} has been updated successfully\");\n }", "public function update(Request $request, MediaType $media_type)\n {\n if (!$media_type) {\n return redirect()->route('media_types.index')->with('error', 'Resource not found.');\n }\n\n $validator = Validator::make($request->all(), [\n 'label' => 'required|string|min:3',\n 'description' => 'required|string|min:3'\n ]);\n\n\n // validate inputs\n if ($validator->fails()) {\n return redirect()->back()\n ->withErrors($validator->errors())\n ->withInput($request->all());\n } else {\n $media_type->name = $request->title ? Str::slug(Str::lower($request->label)) : $media_type->name;\n $media_type->label = $request->title ? $request->label : $media_type->label;\n $media_type->description = $request->description ? $request->description : $media_type->description;\n $media_type->save();\n\n // redirect\n toast('success', 'Update successful!');\n return redirect()->route('media_types.show', $media_type)->with('media_type', $media_type);\n }\n }", "public function update(Request $request, ProductProductType $productProductType)\n {\n //\n }", "public function updateDocument(string $documentType, array $document);", "private function upd(array $config) {\r\n switch ($config['type']) {\r\n case 'cart':\r\n case 'address':\r\n case 'cartConfig':\r\n case 'pwd':\r\n case 'config':\r\n case 'status_order':\r\n parent::update(\r\n ['type' => $config['type']],\r\n $config['data']\r\n );\r\n break;\r\n }\r\n }", "public function update(TypeRequest $request, Type $type)\n {\n $type->name = $request->name;\n\n if(!$type->isDirty())\n {\n return response()->json([\"error\" => 'se debe especificar al menos un valor diferente para actualizar', \"code\" => 422],422);\n }\n\n $type->save();\n\n return $this->showOne($type, 'type actulizado correctamente');\n }", "public function update(Request $request, PrizeType $prizeType)\n {\n //\n }", "public function update(Request $request, TypeThird $typeThird)\n {\n //\n }", "public function updated(PlugType $PlugType)\n {\n //\n }", "public function update(Request $request, IdentificationType $identificationType)\n {\n try{\n $input = $request->all();\n $validator = Validator::make($input,[\n 'name' => 'required'\n ]);\n if($validator->fails()){\n return $this->sendError('Validation Error.', $validator->errors());\n }\n $identificationType = IdentificationType::findOrFail($identificationType->id);\n $identificationType->update($request->all());\n $success['name'] = $identificationType->name;\n return $this->sendResponse($success, 'IdentificationType successfully updated.');\n }catch (\\Exception $exception){\n return $this->sendError('Error',[\"message\"=>$exception->getMessage(),\"line\"=>$exception->getLine()]);\n }\n\n }", "public function update(Request $request, Complainttype $complainttype)\n {\n //\n\n\n\n $complainttype_update = $complainttype->update($request->toArray());\n if ( $complainttype_update) {\n\n if (isset($request->complainttype_status) and $request->complainttype_status == '0') {\n Session::flash('toasttype', 'success');\n Session::flash('toasttitle', 'Deleted');\n Session::flash('toastcontent', 'complainttype Deleted Successfully');\n } else {\n\n Session::flash('toasttype', 'success');\n Session::flash('toasttitle', 'Success');\n Session::flash('toastcontent', 'complainttype updated Successfully');\n }\n } else {\n Session::flash('toasttype', 'error');\n Session::flash('toasttitle', 'Error');\n Session::flash('toastcontent', 'complainttype Not Updated');\n }\n\n return redirect()->route('complainttype.index');\n }", "public function setStorageType($storageType) {\n\t\t\n\t\t$this->_storageType = $storageType;\n\t}", "public function POS_it_checks_updateRec_att_type_changed() {\n // create the record to check\n $type = 'Bob';\n $taskType = new TaskType();\n $taskType->setType($type);\n $taskType->setDescription('was here');\n $taskType->created_at = Carbon::now();\n $taskType->updated_at = Carbon::now();\n $taskType->client_id = 1;\n $taskType->save();\n\n // create the changed record\n $changeType = 'Steve';\n\n $stdClass = new \\stdClass();\n $stdClass->id = $taskType->id;\n $stdClass->type = $changeType;\n $stdClass->desc = $taskType->getDescription();\n $stdClass->client_id = $taskType->client_id;\n\n $taskType->updateRec($stdClass);\n $result = $taskType::where('id', $taskType->getId())->first();\n\n $this->assertEquals($result->getType(), $changeType);\n }", "public function SetBackendStorage($data, $type = self::BACKENDSTORAGE_PERMANENT) {\n if ($type == self::BACKENDSTORAGE_STATE) {\n if (!$this->uuid)\n throw new StateNotYetAvailableException();\n\n // TODO serialization should be done in the StateMachine\n return $this->statemachine->SetState($data, $this->device->GetDeviceId(), IStateMachine::BACKENDSTORAGE, $this->uuid, $this->newStateCounter);\n }\n else {\n return $this->statemachine->SetState($data, $this->device->GetDeviceId(), IStateMachine::BACKENDSTORAGE, false, $this->device->GetFirstSyncTime());\n }\n }", "public function update(Request $request, PermitType $permit_type)\n {\n $data = $request->validate([\n 'abbreviation' => 'string|required',\n 'name' => 'string'\n ]);\n\n $permit_type->Abbreviation = $data['abbreviation'];\n\n if ($request->has('name'))\n $permit_type->Name = $data['name'];\n\n $permit_type->save();\n\n return response()->json([\n 'message' => lang('update_successful')\n ], 200);\n }", "function variant_set_type($variant, $type) {}", "public function update(TypeRequest $request, $id)\n {\n $type = Type::findOrFail($id);\n $path = base_path() . '/storage/app/type/';\n $input = $request->all();\n $file = null;\n if(Input::file('image')){\n $file = Input::file('image')->getClientOriginalName();\n }\n // echo $file;die;\n $uniqueSlug = $this->buildUniqueSlug('type', $request->id, $request->slug);\n $newFolderPath = $this->buildNewFolderPath($path, $file);\n $data = ['title' => $input['name'], 'slug' => $uniqueSlug, 'description' => $input['description'], 'is_active' => $input['is_active'],'updated_at' => date('Y:m:d H:i:s')];\n if(Input::file('image')){\n $data['image'] = $newFolderPath[0];\n }\n if(DB::table('type')->where('id', $id)->update($data)){\n if(Input::file('image')){\n File::delete($path.'/'.$type->image);\n Input::file('image')->move($path, $newFolderPath[0]);\n }\n }\n return redirect()->intended('admin/type');\n }", "public function update(Request $request, $deviceType)\n {\n $validator = Validator::make($request->all(), ['name' => 'required']);\n $validator->validate();\n\n $deviceType->update($request->all());\n\n return redirect()->route('devices.types.index');\n }", "public function update( Request $request, ProductType $productType )\n {\n \n $rules = array(\n 'producer' => 'required|numeric',\n 'name' => 'required|max:200',\n 'available' => 'required|numeric|between:0,1',\n );\n \n $error = Validator::make($request->all(), $rules);\n\n if($error->fails())\n {\n return response()->json(['errors' => $error->errors()->all()]);\n }\n\n \n\n // CHECK PRODUCER\n $producer = Producer::findOrFail($request->producer);\n \n if(!$request->hasFile('image')) {\n \n // IMAGE NOT CHANGED\n \n $data = array(\n 'name' => $request->name,\n 'image_ref' => $productType->image_ref,\n 'available' => $request->available,\n 'producer_id' => $producer->id\n );\n\n \n\n } else {\n \n // IMAGE CHANGED\n \n // UPLOAD IMAGE\n $image = $request->file('image');\n $new_name = rand() . '.' . $image->getClientOriginalExtension(); // Name of new Image\n $destination_path = \"/images/product_types\";\n\n\n \n $resize_image = Image::make($image->getRealPath());\n\n \n $dimension = max($resize_image->width(), $resize_image->height());\n\n // we need to resize image, otherwise it will be cropped \n\n if ($resize_image->width() > $dimension) { \n $resize_image->resize($dimension, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n }\n\n if ($resize_image->height() > $dimension) {\n $resize_image->resize(null, $dimension, function ($constraint) {\n $constraint->aspectRatio();\n }); \n }\n\n \n\n $resize_image->resizeCanvas($dimension, $dimension, 'center', false, '#ffffff');\n\n //return response()->json(['errors' => [$destination_path . '/' . $new_name]]);\n $resize_image->save(public_path($destination_path . '/' . $new_name));\n\n\n $old_image_path = $productType->image_ref;\n if(File::exists(public_path() . $old_image_path)) {\n File::delete(public_path() . $old_image_path);\n }\n\n $data = array(\n 'name' => $request->name,\n 'image_ref' => '/images/product_types/' . $new_name,\n 'available' => $request->available,\n 'producer_id' => $producer->id\n ); \n }\n \n \n\n if(isset($request->categories)) {\n $productType->categories()->sync($request->categories);\n //foreach($request->categories as $category_id) {\n //$productType Category::findOrFail($category_id);\n \n //}\n }\n\n $productType->update($data);\n \n return response()->json(['success' => 'Product Type Updated successfully.']);\n }" ]
[ "0.6288913", "0.6018423", "0.59911406", "0.59911406", "0.588655", "0.58472097", "0.5689344", "0.5671953", "0.56371284", "0.56031495", "0.5590668", "0.5552451", "0.54424405", "0.5436249", "0.5380119", "0.5378809", "0.5376139", "0.5363912", "0.53624606", "0.5334468", "0.5261503", "0.5257268", "0.52525926", "0.52479124", "0.5229666", "0.5223163", "0.51752484", "0.51746446", "0.5167868", "0.5158204" ]
0.620051
1
Helper method to quickly create a form with given fields and requirements.
protected function createForm(array $fields, array $requiredFields = []): Form { $fieldList = FieldList::create(); foreach ($fields as $name => $value) { $fieldList->add(TextField::create($name, $name, $value)); } $validator = new DependentRequiredFields($requiredFields); return Form::create(null, 'test', $fieldList, null, $validator); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createFormFields() {\n\t}", "abstract public function createForm();", "abstract public function createForm();", "public function createForm();", "public function createForm();", "protected function form()\n {\n $form = new Form(new Purchase());\n if ($form->isCreating()) {\n $form->select('consumer_id', \"客户\")->options(Consumer::all()->pluck('full_name', 'id'))->required();\n $form->select('house_id', \"购买房源\")->options(House::purchasable()->pluck('readable_name', 'id'))->required();\n }\n $form->datetime('started_at', \"生效日期\");\n $form->datetime('ended_at', \"结束日期\");\n $form->select('sell_type', \"出售方式\")->options(Purchase::$type)->required();\n $form->currency('price', \"成交价格\")->symbol('¥')->required();\n\n return $form;\n }", "public static function createForm($request)\n {\n $db = Core::$db;\n $LANG = Core::$L;\n\n $rules = array();\n $rules[] = \"required,form_name,{$LANG[\"validation_no_form_name\"]}\";\n $rules[] = \"required,num_fields,{$LANG[\"validation_no_num_form_fields\"]}\";\n $rules[] = \"digits_only,num_fields,{$LANG[\"validation_invalid_num_form_fields\"]}\";\n $rules[] = \"required,access_type,{$LANG[\"validation_no_access_type\"]}\";\n\n $errors = validate_fields($request, $rules);\n if (!empty($errors)) {\n array_walk($errors, create_function('&$el','$el = \"&bull;&nbsp; \" . $el;'));\n $message = join(\"<br />\", $errors);\n return array(false, $message);\n }\n\n $config = array(\n \"form_type\" => \"form_builder\",\n \"form_name\" => $request[\"form_name\"],\n \"access_type\" => $request[\"access_type\"],\n \"submission_type\" => \"code\"\n );\n\n // set up the entry for the form\n list($success, $message, $new_form_id) = CoreForms::setupForm($config);\n\n $form_data = array(\n \"form_tools_form_id\" => $new_form_id,\n \"form_tools_display_notification_page\" => false\n );\n\n for ($i=1; $i<=$request[\"num_fields\"]; $i++) {\n $form_data[\"field{$i}\"] = $i;\n }\n CoreForms::initializeForm($form_data);\n\n $form_fields = Fields::getFormFields($new_form_id);\n\n $order = 1;\n\n // if the user just added a form with a lot of fields (over 50), the database row size will be too\n // large. Varchar fields (which with utf-8 equates to 1220 bytes) in a table can have a combined row\n // size of 65,535 bytes, so 53 is the max. The client-side validation limits the number of fields to\n // 1000. Any more will throw an error.\n $field_size_clause = ($request[\"num_fields\"] > 50) ? \", field_size = 'small'\" : \"\";\n\n foreach ($form_fields as $field_info) {\n if (preg_match(\"/field(\\d+)/\", $field_info[\"field_name\"], $matches)) {\n $db->query(\"\n UPDATE {PREFIX}form_fields\n SET field_title = :field_title,\n col_name = :col_name\n $field_size_clause\n WHERE field_id = :field_id\n \");\n $db->bindAll(array(\n \"field_title\" => \"{$LANG[\"word_field\"]} $order\",\n \"col_name\" => \"col_$order\",\n \"field_id\" => $field_info[\"field_id\"]\n ));\n $db->execute();\n $order++;\n }\n }\n\n CoreForms::finalizeForm($new_form_id);\n\n // if the form has an access type of \"private\" add whatever client accounts the user selected\n if ($request[\"access_type\"] == \"private\") {\n $selected_client_ids = $request[\"selected_client_ids\"];\n $queries = array();\n\n foreach ($selected_client_ids as $client_id) {\n $queries[] = \"($client_id, $new_form_id)\";\n }\n\n if (!empty($queries)) {\n $insert_values = implode(\",\", $queries);\n $db->query(\"\n INSERT INTO {PREFIX}client_forms (account_id, form_id)\n VALUES $insert_values\n \");\n }\n }\n\n // now apply a few simple changes to the View we just created, to simplify things for the\n $views = Views::getFormViews($new_form_id);\n $view_id = $views[0][\"view_id\"];\n\n // 1. Change the View name to \"Form Builder View\"\n $db->query(\"UPDATE {PREFIX}views SET view_name = 'Form Builder View' WHERE view_id = :view_id\");\n $db->bind(\"view_id\", $view_id);\n $db->execute();\n\n // 2. Change the View's first tab (the only one defined!) to be called \"Page 1\"\n $db->query(\"UPDATE {PREFIX}view_tabs SET tab_label = 'Page 1' WHERE view_id = :view_id AND tab_number = 1 LIMIT 1\");\n $db->bind(\"view_id\", $view_id);\n $db->execute();\n\n // 3. Change the View Field Group label to \"Fields\" instead of \"DATA\"\n $db->query(\"UPDATE {PREFIX}list_groups SET group_name = 'Fields' WHERE group_type = :group_type LIMIT 1\");\n $db->bind(\"group_type\", \"view_fields_{$view_id}\");\n $db->execute();\n\n return array(true, $LANG[\"notify_internal_form_created\"], $new_form_id);\n }", "private function createForm()\n\t{\n\t\t$builder = $this->getService('form')->create();\n\t\t$builder->setValidatorService($this->getService('validator'));\n\t\t$builder->setFormatter(new BasicFormFormatter());\n\t\t$builder->setDesigner(new DoctrineDesigner($this->getDoctrine(), 'Entity\\User',array('location')));\n\n\t\t$builder->getField('location')->setRequired(true);\n\t\t$builder->submit($this->getRequest());\n\n\t\treturn $builder;\n\t}", "public function CreateForm();", "function makeForm($request, $formOpts){\n\t\t#print_r ($request);\n\t\t$formDescriptor = array(\n\t\t\t'radioForm' => array(\n \t\t\t\t'type' => 'radio',\n \t\t\t\t'label' => 'Select a search type:',\n \t\t\t\t'options' => array( # The options available within the checkboxes (displayed => value)\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 0' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 1' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 2' => 2,\n\t\t\t\t\t\t\t\t\t\t\t),\n \t\t\t\t'default' => 0 # The option selected by default (identified by value)\n \t\t\t),\n 'textfield1' => array(\n\t\t\t\t\t\t\t\t'label' => 'textfield 1 label', # What's the label of the field\n\t\t\t\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t\t\t\t),\n\t\t\t'textfield2' => array(\n\t\t\t\t\t'label' => 'textfield 2 label', # What's the label of the field\n\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t), \t\t\t\t\n \t\t);\n\t\t\n\t\tswitch($formOpts){\n\t\t\tcase '1':\n\t\t\t\t$formDescriptor['textfield1']['label'] = 'textfield 1 label'; # What's the label of the field\n\t\t\t\t$formDescriptor['textfield2']['label'] = 'textfield 2 label'; # What's the label of the field\t\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\t#same as case 1\n\t\t\tdefault:\n\t\t}\n\n\t\t#Submit button structure and page callback. \n $htmlForm = new HTMLForm( $formDescriptor, $this->getContext(), 'myform'); # We build the HTMLForm object, calling the form 'myform'\n $htmlForm->setSubmitText( 'Submit button text' ); # What text does the submit button display\n\t\t\n\t\t/* We set a callback function */ \n\t\t#This code has no function to the special page. It used to produce red wiki text callback such as \"Try Again\" commented-out below under processInput function. \n\t\t$htmlForm->setSubmitCallback( array( 'specialpagetemplate', 'processInput' ) ); # Call processInput() in specialpagetemplate on submit\n $htmlForm->show(); # Displaying the form\n\t}", "public function createForm()\n {\n }", "function create_from( \n $form_name, $action, $method = 'POST', $attributes = null \n ){\n // get class to create from\n $form_class = $form_name.'_form';\n return new $form_class( \n $this->app, $action, $method, $attributes \n );\n }", "public static function create() {\n\t\tFrmAppHelper::permission_check('frm_edit_forms');\n check_ajax_referer( 'frm_ajax', 'nonce' );\n\n\t\t$field_type = FrmAppHelper::get_post_param( 'field_type', '', 'sanitize_text_field' );\n\t\t$form_id = FrmAppHelper::get_post_param( 'form_id', 0, 'absint' );\n\n\t\t$field = self::include_new_field( $field_type, $form_id );\n\n // this hook will allow for multiple fields to be added at once\n do_action('frm_after_field_created', $field, $form_id);\n\n wp_die();\n }", "public static function generate($fields) {\n $form=\"\";\n $extraOptions=[];\n // wildCard will be applied all inputs\n $wildCard=isset($fields[\"*\"]) ? $fields[\"*\"]:[];\n // exclude given elements\n if(isset($fields[\"_exclude\"])) {\n foreach ($fields[\"_exclude\"] as $value) {\n unset($fields[$value]);\n }\n }\n foreach ($fields as $key => $val) {\n if($key==\"*\"||$key==\"_exclude\") continue;\n if(!empty($wildCard)) {\n $val=array_replace_recursive($val,$wildCard);\n }\n $inputOptions=isset($val[\"options\"]) ? $val[\"options\"] : [];\n \n $placeholder=isset($val[\"placeholder\"]) ? $val[\"placeholder\"] : null;\n switch ($val[\"type\"]) {\n case 'select':\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$val[\"data\"],$inputOptions);\n break;\n case 'password':\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$placeholder,$inputOptions);\n break;\n case 'checkbox':\n case 'radio':\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$val[\"value\"],null); // removed $val[\"checked\"] for unwanted results\n break;\n case 'color':\n case 'number':\n case 'file';\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$inputOptions);\n break;\n // other elements share the same parameters.\n default:\n try {\n\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$placeholder,$inputOptions);\n }catch(\\Exception $err) {\n if(config('app.debug')==false) { // only show error on debug\n dump(\"Error on generating form\",$err,$key,$val);\n }\n }\n break;\n }\n }\n return $form;\n }", "protected function form()\n {\n $form = new Form(new CompanyCulture());\n\n $form->text('name', '企业名称')->rules('required');\n $form->text('en_name', '企业名称(en)')->rules('required');\n $form->image('image_url', '图片')->rules('required|image');\n $form->editor('content', '内容')->rules('required');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`列表`按钮\n $tools->disableList();\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Customer);\n\n $form->text('code', '客户编号');\n $form->text('name', '客户名称');\n// $form->text('openid', '客户openid');\n $form->text('contactor', '联系人');\n $form->text('tel', '联系电话');\n $form->email('email', '邮箱');\n $form->text('address', '地址');\n $form->decimal('receivables', '应收账款数字')->default(0.00);\n $form->text('fax', '传真');\n $form->switch('is_delete', '是否删除');\n\n return $form;\n }", "public function createComponentQuestionForm() {\n $form = new Form;\n\n $form->addHidden('test_id');\n $form->addHidden('id');\n $form->addTextArea('text', 'Text')->setRequired();\n $form->addSubmit('submit');\n $form->setDefaults($this->questions->getById($this->questionId));\n $form->onSuccess[] = $this->questionFormSucceeded;\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Goods);\n\n $form->text('title', trans('admin.title'))->required()->rules('required');\n $form->text('slogan', trans('admin.slogan'))->required()->rules('required');\n $form->text('name', trans('admin.name'))->required()->rules('required');\n $form->decimal('price', trans('admin.price'))->required()->rules('required');\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Order);\n\n $form->text('no', 'No');\n $form->number('user_id', 'User id');\n $form->textarea('address', 'Address');\n $form->decimal('total_amount', 'Total amount');\n $form->textarea('remark', 'Remark');\n $form->datetime('paid_at', 'Paid at')->default(date('Y-m-d H:i:s'));\n $form->text('payment_method', 'Payment method');\n $form->text('payment_no', 'Payment no');\n $form->text('refund_status', 'Refund status')->default('pending');\n $form->text('refund_no', 'Refund no');\n $form->switch('closed', 'Closed');\n $form->switch('reviewed', 'Reviewed');\n $form->text('ship_status', 'Ship status')->default('pending');\n $form->textarea('ship_data', 'Ship data');\n $form->textarea('extra', 'Extra');\n\n return $form;\n }", "private static function do_html_form_create($fields, $table){\n global $dbname;\n global $app_dir;\n $filename = Inflect::singularize($table);\n $form_str = '@extends(\\'layouts.bulma\\')'.\"\\n\";\n $form_str .= '@section(\\'title\\', \\'creating new '.Inflect::singularize($table).'\\')'.\"\\n\";\n $form_str .= '@section(\\'sidebar\\')'.\"\\n\";\n $form_str .= '@parent'.\"\\n\";\n $form_str .= '@endsection'.\"\\n\";\n $form_str .= '@section(\\'content\\')'.\"\\n\";\n $form_str .= '<form action=\"{{ route(\\''.$table.'.create\\') }}\" class=\"form container\" method=\"POST\" enctype=\"multipart/form-data\">';\n $form_str .= \"\\n\".' <h1 class=\"title is-3\">ADD '.strtoupper(str_replace(\"_\",\" \",Inflect::singularize($table))).'</h1>'.\"\\n\";\n foreach($fields as $field){\n $req = false;\n if(strpos($field[\"Type\"], \"int\")>-1 && $field[\"Key\"]!==\"MUL\"){\n if($field[\"Null\"]===\"NO\") $req = true;\n $form_str .= \" \".self::getInputField($field[\"Field\"], \"number\", $table, $req);\n }else if($field[\"Key\"] === \"MUL\"){\n $form_str .= \" \".self::getSelectField($field[\"Field\"], $table);\n }else if(strpos($field[\"Type\"], \"varchar\")>-1){\n if($field[\"Null\"]===\"NO\") $req = true;\n $form_str .= \" \".self::getInputField($field[\"Field\"], \"text\", $table, $req);\n }else if(strpos($field[\"Type\"], \"text\")>-1){\n $form_str .= \" \".self::getTextarea($field[\"Field\"], $table);\n }\n }\n $form_str .= self::getButtonGrp();\n $form_str .= \"</form>\\n@endsection\";\n $file_dir = $app_dir.\"/resources/views/$table\";\n $views_file = $app_dir.\"/resources/views/$table/create.blade.php\";\n if(is_readable($views_file)){\n file_put_contents($views_file, $form_str);\n }else{\n exec(\"mkdir $file_dir\");\n exec(\"chmod -R 755 $app_dir./resources/views/\");\n $fp = fopen($views_file,\"w+\");\n fwrite($fp, \"file created\", 128);\n fclose($fp);\n file_put_contents($views_file, $form_str);\n }\n }", "protected function form()\n {\n $form = new Form(new RequestForConfirmation());\n\n $form->switch('status', __('Status'));\n $form->text('comment', __('Comment'));\n $form->select('user_id', __('User id'))->options(User::all()->pluck('name', 'id'))->required();\n $form->select('project_id', __('Project id'))->options(Project::all()->pluck('project_name', 'id'))->required();\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Order());\n\n $form->switch('paid', __('Paid'));\n $form->datetime('reservation_expires', __('Reservation expires'))->default(date('Y-m-d H:i:s'));\n $form->decimal('price', __('Price'));\n\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableView();\n });\n\n\n\n return $form;\n }", "abstract function setupform();", "protected function form()\n {\n $form = new Form(new Activity());\n\n $form->text('name', __('Name'));\n $form->image('image', __('Image'));\n $form->text('intro', __('Intro'));\n $form->UEditor('details', __('Details'));\n $form->datetime('start_at', __('Start at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('end_at', __('End at'))->default(date('Y-m-d H:i:s'));\n $form->text('location', __('Location'));\n $form->decimal('fee', __('Fee'))->default(0.00);\n $form->number('involves', __('Involves'));\n $form->number('involves_min', __('Involves min'));\n $form->number('involves_max', __('Involves max'));\n $form->switch('status', __('Status'));\n $form->text('organizers', __('Organizers'));\n $form->number('views', __('Views'));\n $form->switch('is_stick', __('Is stick'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new SpecificationTemplate());\n\n $form->text('name', __('Name'));\n $form->keyValues('content', __('Content'));\n $form->number('sort', __('Sort'))->default(0);\n $form->switch('is_display', __('Is display'))->default(1);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Resources);\n\n $form->text('name', '名称')->rules('required',['required' => '请输入 配置项的名称']);\n\n $form->radio('type', '类型')->options(Resources::TYPE);\n\n $form->cropper('url','图片');\n\n $form->number('sort_num','排序');\n\n $form->textarea('memo','备注');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Activity);\n\n $form->text('log_name', 'Log name');\n $form->textarea('description', 'Description');\n $form->number('subject_id', 'Subject id');\n $form->text('subject_type', 'Subject type');\n $form->number('causer_id', 'Causer id');\n $form->text('causer_type', 'Causer type');\n $form->text('properties', 'Properties');\n\n return $form;\n }", "public function createComponentGenerateForm() {\n $form = new Form;\n\n\n $groups = $this->groups->getForTest($this->user->id);\n\n $form->addSelect('groupBox', 'Skupina:', $groups);\n $form->addHidden('test_id', $this->getParameter('testId'));\n $form->addText('questionCount')->setRequired('Zadejte počet otázek');\n $form->addText('answerCount')->setRequired('Zadejte počet odpovědí');\n $form->addRadioList('pageFormat', 'Formát stránky', array('a4' => 'A4', 'a5' => 'A5'))\n ->setRequired('Vyberte formát stránky');\n $form->addTextArea('students');\n\n $form->onSuccess[] = callback($this, 'generateFormSubmitted');\n $form->addSubmit('submit');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Member);\n\n $form->text('open_id', 'Open id');\n $form->text('wx_open_id', 'Wx open id');\n $form->text('access_token', 'Access token');\n $form->number('expires', 'Expires');\n $form->text('refresh_token', 'Refresh token');\n $form->text('unionid', 'Unionid');\n $form->text('nickname', 'Nickname');\n $form->switch('subscribe', 'Subscribe');\n $form->switch('sex', 'Sex');\n $form->text('headimgurl', 'Headimgurl');\n $form->switch('disablle', 'Disablle');\n $form->number('time', 'Time');\n $form->mobile('phone', 'Phone');\n\n return $form;\n }", "protected function getTestForm()\n {\n $form = new T_Form_Get('test','A Test Form');\n $form->addChild(new T_Form_Fieldset('contact','Contact Details'));\n $form->contact->addChild(new T_Form_Text('name','Name'));\n $form->contact->name->setOptional();\n $form->contact->addChild(new T_Form_Text('email','Email'));\n $form->contact->email->setOptional();\n $form->contact->addChild(new T_Form_Upload('upload','Profile Image'));\n $form->contact->upload->setOptional();\n $form->addChild(new T_Form_Fieldset('register','Registration Details'));\n $form->register->addChild(new T_Form_Password('passwd','Password'));\n $form->register->passwd->setOptional();\n return $form;\n }" ]
[ "0.7197657", "0.71927226", "0.71927226", "0.7121654", "0.7121654", "0.6883486", "0.6753936", "0.67229515", "0.66542315", "0.6616685", "0.6465313", "0.64645696", "0.64194053", "0.64187574", "0.63703305", "0.63674444", "0.6357836", "0.63466984", "0.6311902", "0.6310263", "0.6288638", "0.62596416", "0.6248976", "0.6243032", "0.62170994", "0.6210732", "0.6194092", "0.619135", "0.61881816", "0.6181341" ]
0.720951
0
Get an associative array of field name to message type from a ValidationResult.
protected function getFlatValidationResult(ValidationResult $result) { $flatResults = array(); foreach ($result->getMessages() as $key => $metadata) { $flatResults[$metadata['fieldName']] = $metadata['messageType']; } return $flatResults; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validationErrors() {\n\t\t$return = array();\n\n\t\t$models = ClassRegistry::keys();\n\t\tforeach ($models as $currentModel) {\n\t\t\t$currentObject = ClassRegistry::getObject($currentModel);\n\t\t\tif ($currentObject instanceof Model) {\n\t\t\t\t$return[$currentObject->alias] = $currentObject->validationErrors;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public function getValidationErrors()\n {\n $fields = $this->getFields();\n if (!$fields) {\n return [];\n }\n\n $result = [];\n foreach ($fields as $field) {\n if ($field instanceof AbstractFormField) {\n if (!$field->isValid()) {\n $result = array_merge($result, $field->getErrorMessages());\n }\n }\n }\n\n return $result;\n }", "public function getValidatedFields()\n {\n $retVal = array();\n $errors = $this->validateFields();\n foreach($this->_fields as $field)\n {\n $retVal[$field['id']] = $field['validatedData'];\n }\n return array( $retVal, $errors );\n }", "public function getValidationMessages();", "public function _getValidationErrors(): array\n\t{\n\t\t$errs = parent::_getValidationErrors();\n\t\t$validationRules = $this->_getValidationRules();\n\t\tif (null !== ($v = $this->getUrl())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_URL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getIdentifier())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getName())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_NAME] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDisplay())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DISPLAY] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getStatus())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_STATUS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getExperimental())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getPublisher())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_PUBLISHER] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContact())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTACT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDate())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DATE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDescription())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DESCRIPTION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getUseContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_USE_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getRequirements())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getCopyright())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_COPYRIGHT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getCode())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CODE, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getFhirVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getMapping())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_MAPPING, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getKind())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_KIND] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getConstrainedType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getAbstract())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_ABSTRACT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getContextType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getBase())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_BASE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getSnapshot())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_SNAPSHOT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDifferential())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_URL])) {\n\t\t\t$v = $this->getUrl();\n\t\t\tforeach ($validationRules[self::FIELD_URL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_URL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_URL])) {\n\t\t\t\t\t\t$errs[self::FIELD_URL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_URL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IDENTIFIER])) {\n\t\t\t$v = $this->getIdentifier();\n\t\t\tforeach ($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_IDENTIFIER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IDENTIFIER])) {\n\t\t\t\t\t\t$errs[self::FIELD_IDENTIFIER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IDENTIFIER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_VERSION])) {\n\t\t\t$v = $this->getVersion();\n\t\t\tforeach ($validationRules[self::FIELD_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_NAME])) {\n\t\t\t$v = $this->getName();\n\t\t\tforeach ($validationRules[self::FIELD_NAME] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_NAME,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_NAME])) {\n\t\t\t\t\t\t$errs[self::FIELD_NAME] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_NAME][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DISPLAY])) {\n\t\t\t$v = $this->getDisplay();\n\t\t\tforeach ($validationRules[self::FIELD_DISPLAY] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DISPLAY,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DISPLAY])) {\n\t\t\t\t\t\t$errs[self::FIELD_DISPLAY] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DISPLAY][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_STATUS])) {\n\t\t\t$v = $this->getStatus();\n\t\t\tforeach ($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_STATUS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_STATUS])) {\n\t\t\t\t\t\t$errs[self::FIELD_STATUS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_STATUS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXPERIMENTAL])) {\n\t\t\t$v = $this->getExperimental();\n\t\t\tforeach ($validationRules[self::FIELD_EXPERIMENTAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_EXPERIMENTAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXPERIMENTAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_PUBLISHER])) {\n\t\t\t$v = $this->getPublisher();\n\t\t\tforeach ($validationRules[self::FIELD_PUBLISHER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_PUBLISHER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_PUBLISHER])) {\n\t\t\t\t\t\t$errs[self::FIELD_PUBLISHER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_PUBLISHER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTACT])) {\n\t\t\t$v = $this->getContact();\n\t\t\tforeach ($validationRules[self::FIELD_CONTACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DATE])) {\n\t\t\t$v = $this->getDate();\n\t\t\tforeach ($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DATE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DATE])) {\n\t\t\t\t\t\t$errs[self::FIELD_DATE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DATE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DESCRIPTION])) {\n\t\t\t$v = $this->getDescription();\n\t\t\tforeach ($validationRules[self::FIELD_DESCRIPTION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DESCRIPTION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DESCRIPTION])) {\n\t\t\t\t\t\t$errs[self::FIELD_DESCRIPTION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DESCRIPTION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_USE_CONTEXT])) {\n\t\t\t$v = $this->getUseContext();\n\t\t\tforeach ($validationRules[self::FIELD_USE_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_USE_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_USE_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_REQUIREMENTS])) {\n\t\t\t$v = $this->getRequirements();\n\t\t\tforeach ($validationRules[self::FIELD_REQUIREMENTS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_REQUIREMENTS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_REQUIREMENTS])) {\n\t\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_COPYRIGHT])) {\n\t\t\t$v = $this->getCopyright();\n\t\t\tforeach ($validationRules[self::FIELD_COPYRIGHT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_COPYRIGHT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_COPYRIGHT])) {\n\t\t\t\t\t\t$errs[self::FIELD_COPYRIGHT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_COPYRIGHT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CODE])) {\n\t\t\t$v = $this->getCode();\n\t\t\tforeach ($validationRules[self::FIELD_CODE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CODE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CODE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CODE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CODE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_FHIR_VERSION])) {\n\t\t\t$v = $this->getFhirVersion();\n\t\t\tforeach ($validationRules[self::FIELD_FHIR_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_FHIR_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_FHIR_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MAPPING])) {\n\t\t\t$v = $this->getMapping();\n\t\t\tforeach ($validationRules[self::FIELD_MAPPING] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_MAPPING,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MAPPING])) {\n\t\t\t\t\t\t$errs[self::FIELD_MAPPING] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MAPPING][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_KIND])) {\n\t\t\t$v = $this->getKind();\n\t\t\tforeach ($validationRules[self::FIELD_KIND] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_KIND,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_KIND])) {\n\t\t\t\t\t\t$errs[self::FIELD_KIND] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_KIND][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t$v = $this->getConstrainedType();\n\t\t\tforeach ($validationRules[self::FIELD_CONSTRAINED_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONSTRAINED_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ABSTRACT])) {\n\t\t\t$v = $this->getAbstract();\n\t\t\tforeach ($validationRules[self::FIELD_ABSTRACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_ABSTRACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ABSTRACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_ABSTRACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ABSTRACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t$v = $this->getContextType();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT])) {\n\t\t\t$v = $this->getContext();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_BASE])) {\n\t\t\t$v = $this->getBase();\n\t\t\tforeach ($validationRules[self::FIELD_BASE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_BASE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_BASE])) {\n\t\t\t\t\t\t$errs[self::FIELD_BASE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_BASE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_SNAPSHOT])) {\n\t\t\t$v = $this->getSnapshot();\n\t\t\tforeach ($validationRules[self::FIELD_SNAPSHOT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_SNAPSHOT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_SNAPSHOT])) {\n\t\t\t\t\t\t$errs[self::FIELD_SNAPSHOT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_SNAPSHOT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DIFFERENTIAL])) {\n\t\t\t$v = $this->getDifferential();\n\t\t\tforeach ($validationRules[self::FIELD_DIFFERENTIAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DIFFERENTIAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DIFFERENTIAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_TEXT])) {\n\t\t\t$v = $this->getText();\n\t\t\tforeach ($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_TEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_TEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_TEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_TEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTAINED])) {\n\t\t\t$v = $this->getContained();\n\t\t\tforeach ($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_CONTAINED,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTAINED])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTAINED] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTAINED][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXTENSION])) {\n\t\t\t$v = $this->getExtension();\n\t\t\tforeach ($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t$v = $this->getModifierExtension();\n\t\t\tforeach ($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_MODIFIER_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ID])) {\n\t\t\t$v = $this->getId();\n\t\t\tforeach ($validationRules[self::FIELD_ID] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_ID,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ID])) {\n\t\t\t\t\t\t$errs[self::FIELD_ID] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ID][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_META])) {\n\t\t\t$v = $this->getMeta();\n\t\t\tforeach ($validationRules[self::FIELD_META] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_META,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_META])) {\n\t\t\t\t\t\t$errs[self::FIELD_META] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_META][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t$v = $this->getImplicitRules();\n\t\t\tforeach ($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_IMPLICIT_RULES,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_LANGUAGE])) {\n\t\t\t$v = $this->getLanguage();\n\t\t\tforeach ($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_LANGUAGE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_LANGUAGE])) {\n\t\t\t\t\t\t$errs[self::FIELD_LANGUAGE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_LANGUAGE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $errs;\n\t}", "public function getValidatorMessages()\n {\n $messages = [];\n \n foreach ($this->owner->getValidatorRules() as $rule) {\n \n if ($rule->hasMessage()) {\n $messages[$rule->getType()] = $rule->getMessage();\n }\n \n }\n \n return $messages;\n }", "function getMessages() {\n\t\t$fields = $this->getFields();\n\t\t$allMessages = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldMessages = $field->getValidationMessages();\n\t\t\tif ($fieldMessages) {\n\t\t\t\t$allMessages[$field->getName()] = $fieldMessages;\n\t\t\t}\n\n\t\t}\n\n\t\treturn $allMessages;\n\t}", "public function getErrors(): array\n {\n return $this->getInputFilter()->getMessages();\n }", "public function getValidationErrorMessages() {}", "public function getValidationErrors() {\n if (true == ($this->validation instanceof Validation)) {\n return $this->validation->getErrors();\n }\n\n return array();\n }", "public function errors() {\n $Errors = array();\n foreach ($this->__fields() as $field) {\n $E = $this->$field->errorsList();\n if ($E) $Errors[$field] = $E;\n }\n return $Errors;\n }", "public function fieldNameArray($result = false){\n $names = array();\n\n $field = $this->numFields($result);\n\n for ( $i = 0; $i < $field; $i++ ){\n $names[] = $this->fieldName($result, $i);\n }\n\n return $names;\n }", "public function messages()\n {\n $key = $this->csvHeader();\n\n return [\n sprintf('%s.required', $key) => trans('validation.required', ['attribute' => trans('element.activity_status')]),\n sprintf('%s.size', $key) => trans('validation.multiple_values', ['attribute' => trans('element.activity_status')]),\n sprintf('%s.in', $key) => trans('validation.code_list', ['attribute' => trans('element.activity_status')])\n ];\n }", "public function getMessages()\n {\n foreach (parent::getMessages() as $message) {\n switch ($message->getType()) {\n case 'PresenceOf':\n $message->setMessage('The field ' . $message->getField() . ' is required');\n break;\n case 'Uniqueness':\n $message->setMessage('The field ' . $message->getField() . ' must be unique');\n break;\n case 'Email':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid email');\n break;\n case 'Url':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid url');\n break;\n case 'InclusionIn':\n $message->setMessage('The field ' . $message->getField() . ' must contain a value in [' . implode(',', $message->getDomain()) . ']');\n break;\n case 'DateValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid date.');\n break;\n case 'TimestampValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid timestamps.');\n break;\n }\n }\n\n return parent::getMessages();\n }", "public function getErrorsAsArray() {\n return $this->validation_errors;\n }", "public function getErrorMessages()\n {\n $errors = [];\n foreach ($this->fields as $field) {\n if ($field instanceof AbstractFormField && !$field->isValid()) {\n $fldErrors = $field->getErrorMessages();\n $errors = array_merge($errors, $fldErrors);\n }\n }\n\n return $errors;\n }", "public function getValidationErrors();", "public function getValidationErrors();", "public function _getValidationErrors(): array\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getYear())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_YEAR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getMonth())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MONTH] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDay())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DAY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSeason())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SEASON] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getText())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TEXT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATE])) {\n $v = $this->getDate();\n foreach($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE])) {\n $errs[self::FIELD_DATE] = [];\n }\n $errs[self::FIELD_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_YEAR])) {\n $v = $this->getYear();\n foreach($validationRules[self::FIELD_YEAR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_YEAR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_YEAR])) {\n $errs[self::FIELD_YEAR] = [];\n }\n $errs[self::FIELD_YEAR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MONTH])) {\n $v = $this->getMonth();\n foreach($validationRules[self::FIELD_MONTH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_MONTH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MONTH])) {\n $errs[self::FIELD_MONTH] = [];\n }\n $errs[self::FIELD_MONTH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DAY])) {\n $v = $this->getDay();\n foreach($validationRules[self::FIELD_DAY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_DAY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DAY])) {\n $errs[self::FIELD_DAY] = [];\n }\n $errs[self::FIELD_DAY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SEASON])) {\n $v = $this->getSeason();\n foreach($validationRules[self::FIELD_SEASON] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_SEASON, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SEASON])) {\n $errs[self::FIELD_SEASON] = [];\n }\n $errs[self::FIELD_SEASON][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_BACKBONE_ELEMENT, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "private function getErrorMessages(): array\n {\n return [\n 'notEmpty' => 'Campo {{name}} obligatorio',\n 'date' => '{{name}} debe tener una fecha valida. Ejemplo de formato: {{format}}\\'',\n 'intVal' => '',\n 'between' => '',\n 'in' => '',\n 'floatVal' => '',\n 'length' => '',\n 'stringType' => '',\n 'objectType' => '',\n 'cantidadRegistros' => 'dsfsdfsd',\n 'periodo.notEmpty' => 'Campo Periodo: es obligatorio',\n 'periodo' => 'Campo Periodo: Debe tener el formato AAAAMM, donde AAAA indica el año y MM el mes en números',\n 'orden.notEmpty' => 'Campo Orden: es obligatorio',\n 'orden' => 'Campo Orden: Debe ser igual a 1 ó 2.',\n 'codigoComprobante.notEmpty' => 'Campo Codigo de Comprobante: es obligatorio',\n 'codigoComprobante' => 'Campo Codigo de Comprobante: Debe debe estar comprendido entre 1 y 9998.',\n 'numeroComprobante.notEmpty' => 'Campo Numero de Comprobante: es obligatorio',\n 'numeroComprobante' => 'Campo Numero de Comprobante: Debe debe estar comprendido entre 1 y 99999999.',\n 'puntoVenta.notEmpty' => 'Punto de venta: es obligatorio',\n 'puntoVenta' => 'Punto de venta: Debe debe estar comprendido entre 1 y 9998.',\n ];\n }", "public function errorMessages() : array\n {\n return [\n self::RULE_REQUIRED => 'Required.',\n self::RULE_EMAIL => 'Must be a valid email address.',\n self::RULE_MIN => 'Must be at least {min} characters.',\n self::RULE_MAX => 'Must be less than {max} characters.',\n self::RULE_MATCH => 'Must match {match}.',\n self::RULE_UNIQUE => '{column} is already in use.'\n ];\n }", "protected function structureValidationErrorMessages($validation_result)\n {\n\n }", "public function getErrors(): array {\n return $this->validationError;\n }", "protected function validationErrorMessages()\n {\n return [];\n }", "protected function validationErrorMessages()\n {\n return [];\n }", "public function messages()\n {\n $items = [];\n foreach (static::attributes() as $key => $val) {\n $items[$key . '.required'] = t('common.form.errors.required', [\n 'attribute' => $val,\n ]);\n }\n \n return $items;\n }", "public function messages(): array\n {\n return [\n 'required' => 'O campo :attribute é obrigatório.',\n 'integer' => 'O campo :attribute não é um número válido.',\n ];\n }", "public function fieldValidationArray()\n {\n return [\n 'name' => 'required|codename|min:2|max:255',\n 'label' => 'string',\n 'description' => 'string',\n 'required' => 'boolean',\n 'mode' => 'string|in:prefer_local,prefer_external,only_local,only_external',\n 'script' => 'string'\n ];\n }", "public function getErrors() {\n /** @var Table $this */\n $errors = $this->entity->getErrors();\n\n $getThis = function ($association, $path, &$current, &$previous) {\n $key = array_pop($path);\n\n foreach ($current as $k => $v) {\n\n if ($association == 'embedded') {\n\n if (is_scalar($v)) {\n return;\n }\n $k = \"$key.$k\";\n }\n $previous[$k] = $v;\n }\n unset($previous[$key]);\n };\n\n $this->walkWithAssociated($errors, $getThis);\n $result = [];\n\n foreach ($errors as $field => $error) {\n $alias = $this->getAliasByField($field);\n\n foreach ($error as $key => $value) {\n // hasMany\n if (is_numeric($key)) {\n $result[$alias . \"[$key].\" . key($value)] = array_values(array_values($value)[0])[0];\n }\n else {\n $result[$alias] = $value;\n break;\n }\n }\n }\n\n return $result;\n }", "public function getErrorMessages()\n {\n $translator = Mage::helper('importexport');\n $messages = array();\n\n foreach ($this->_errors as $errorCode => $errorRows) {\n if (isset($this->_messageTemplates[$errorCode])) {\n $errorCode = $translator->__($this->_messageTemplates[$errorCode]);\n }\n foreach ($errorRows as $errorRowData) {\n $key = $errorRowData[1] ? sprintf($errorCode, $errorRowData[1]) : $errorCode;\n $messages[$key][] = $errorRowData[0];\n }\n }\n return $messages;\n }" ]
[ "0.64899147", "0.63041604", "0.62535137", "0.62530774", "0.62438506", "0.61968607", "0.6152149", "0.60276747", "0.6023718", "0.60085267", "0.60082537", "0.6002118", "0.5929467", "0.5928846", "0.5918402", "0.5910823", "0.5874207", "0.5874207", "0.5849684", "0.584697", "0.5837981", "0.58368737", "0.5836732", "0.58205706", "0.58205706", "0.57643056", "0.5762544", "0.5748257", "0.57107645", "0.57072407" ]
0.6721982
0
' hash_call: Function to perform the API call to PayPal using API signature
protected function hash_call($methodName, $nvpStr) { $API_Endpoint = Config::get('paypal.api_endpoint'); //'------------------------------------ //' PayPal API Credentials //' Replace <API_USERNAME> with your API Username //' Replace <API_PASSWORD> with your API Password //' Replace <API_SIGNATURE> with your Signature //'------------------------------------ $API_UserName = Config::get('paypal.api_username'); $API_Password = Config::get('paypal.api_password'); $API_Signature = Config::get('paypal.api_signature'); // BN Code is only applicable for partners $sBNCode = "PP-ECWizard"; $PROXY_HOST = '127.0.0.1'; $PROXY_PORT = '808'; $USE_PROXY = false; $version = "93"; //setting the curl parameters. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $API_Endpoint); curl_setopt($ch, CURLOPT_VERBOSE, 1); //turning off the server and peer verification(TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); //if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled. //Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php if ($USE_PROXY) curl_setopt($ch, CURLOPT_PROXY, $PROXY_HOST . ":" . $PROXY_PORT); //NVPRequest for submitting to server $nvpreq = "METHOD=" . urlencode($methodName) . "&VERSION=" . urlencode($version) . "&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) . "&SIGNATURE=" . urlencode($API_Signature) . $nvpStr . "&BUTTONSOURCE=" . urlencode($sBNCode); //setting the nvpreq as POST FIELD to curl curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq); //getting response from server $response = curl_exec($ch); //convrting NVPResponse to an Associative Array $nvpResArray = $this->deformatNVP($response); $nvpReqArray = $this->deformatNVP($nvpreq); $_SESSION['nvpReqArray'] = $nvpReqArray; if (curl_errno($ch)) { // moving to display page to display curl errors $_SESSION['curl_error_no'] = curl_errno($ch); $_SESSION['curl_error_msg'] = curl_error($ch); //Execute the Error handling module to display errors. } else { //closing the curl curl_close($ch); } return $nvpResArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hash_call($methodName, $nvpStr)\r\n {\r\n \r\n //declaring of global variables\r\n //global $API_Endpoint, $API_UserName, $API_Password, $API_Signature, $API_AppID;\r\n //global $USE_PROXY, $PROXY_HOST, $PROXY_PORT;\r\n \r\n $this->API_Endpoint .= \"/\" . $methodName;\r\n \r\n //setting the curl parameters.\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL,$this->API_Endpoint);\r\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\r\n\r\n //turning off the server and peer verification(TrustManager Concept).\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\r\n\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\r\n curl_setopt($ch, CURLOPT_POST, 1);\r\n \r\n // Set the HTTP Headers\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\r\n 'X-PAYPAL-REQUEST-DATA-FORMAT: NV',\r\n 'X-PAYPAL-RESPONSE-DATA-FORMAT: NV',\r\n 'X-PAYPAL-SECURITY-USERID: ' . $this->API_UserName,\r\n 'X-PAYPAL-SECURITY-PASSWORD: ' .$this->API_Password,\r\n 'X-PAYPAL-SECURITY-SIGNATURE: ' . $this->API_Signature,\r\n 'X-PAYPAL-SERVICE-VERSION: 1.3.0',\r\n 'X-PAYPAL-APPLICATION-ID: ' . $this->API_AppID\r\n ));\r\n \r\n //if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\r\n //Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php \r\n if($this->USE_PROXY)\r\n curl_setopt ($ch, CURLOPT_PROXY, $this->PROXY_HOST. \":\" . $this->PROXY_PORT); \r\n\r\n // RequestEnvelope fields\r\n $detailLevel = urlencode(\"ReturnAll\"); // See DetailLevelCode in the WSDL for valid enumerations\r\n $errorLanguage = urlencode(\"en_US\"); // This should be the standard RFC 3066 language identification tag, e.g., en_US\r\n\r\n // NVPRequest for submitting to server\r\n $nvpreq = \"requestEnvelope.errorLanguage=$errorLanguage&requestEnvelope.detailLevel=$detailLevel\";\r\n $nvpreq .= \"&$nvpStr\";\r\n\r\n //setting the nvpreq as POST FIELD to curl\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\r\n \r\n //getting response from server\r\n $response = curl_exec($ch);\r\n \r\n //converting NVPResponse to an Associative Array\r\n $nvpResArray=$this->deformatNVP($response);\r\n $nvpReqArray=$this->deformatNVP($nvpreq);\r\n $_SESSION['nvpReqArray']= $nvpReqArray;\r\n\r\n if (curl_errno($ch)) \r\n {\r\n // moving to display page to display curl errors\r\n $_SESSION['curl_error_no']=curl_errno($ch) ;\r\n $_SESSION['curl_error_msg']=curl_error($ch);\r\n\r\n //Execute the Error handling module to display errors. \r\n } \r\n else \r\n {\r\n //closing the curl\r\n curl_close($ch);\r\n }\r\n\r\n return $nvpResArray;\r\n }", "function hash_call($methodName,$nvpStr){\n\t\t//declaring of global variables\n\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$this->PAYPAL_API_ENDPOINT);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\n\t\t//Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php \n\t\tif($this->PAYPAL_USE_PROXY)\n\t\tcurl_setopt ($ch, CURLOPT_PROXY, $this->PAYPAL_PROXY_HOST.\":\".$this->PAYPAL_PROXY_PORT); \n\t\n\t\t//check if version is included in $nvpStr else include the version.\n\t\tif(strlen(str_replace('VERSION=', '', strtoupper($nvpStr))) == strlen($nvpStr)) {\n\t\t\t$nvpStr = \"&VERSION=\" . urlencode($this->PAYPAL_VERSION) . $nvpStr;\t\n\t\t}\n\t\t\n\t\t$nvpreq=\"METHOD=\".urlencode($methodName).$nvpStr;\n\t\t\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq);\n\t\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\t\n\t\t//convrting NVPResponse to an Associative Array\n\t\t$nvpResArray = $this->deformatNVP($response);\n\t\t$nvpReqArray = $this->deformatNVP($nvpreq);\n\t\t$_SESSION['nvpReqArray']=$nvpReqArray;\n\t\n\t\tif (curl_errno($ch)) {\n\t\t\t// moving to display page to display curl errors\n\t\t\t$_SESSION['curl_error_no']=curl_errno($ch) ;\n\t\t\t$_SESSION['curl_error_msg']=curl_error($ch);\n\t\t\t$location = \"APIError.php\";\n\t\t\theader(\"Location: $location\");\n\t\t} else {\n\t\t\t//closing the curl\n\t\t\t\tcurl_close($ch);\n\t\t}\n\t\n\treturn $nvpResArray;\n\t}", "function hash_call($methodName,$nvpStr)\n\t{\n\t\tsession_start();\n\t\t// form header string\n\t\t$nvpheader=$this->nvpHeader();\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$this->API_Endpoint);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t\t//in case of permission APIs send headers as HTTPheders\n\t\tif(!empty($this->AUTH_token) && !empty($this->AUTH_signature) && !empty($this->AUTH_timestamp))\n\t\t {\n\t\t\t$headers_array[] = \"X-PP-AUTHORIZATION: \".$nvpheader;\n\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers_array);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$nvpStr=$nvpheader.$nvpStr;\n\t\t}\n\t\t//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\n\t //Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php\n\t\tif($this->USE_PROXY == TRUE)\n\t\tcurl_setopt ($ch, CURLOPT_PROXY, $this->PROXY_HOST.\":\".$this->PROXY_PORT);\n\n\t\t//check if version is included in $nvpStr else include the version.\n\t\tif(strlen(str_replace('VERSION=', '', strtoupper($nvpStr))) == strlen($nvpStr)) {\n\t\t\t$nvpStr = \"&VERSION=\" . urlencode($this->version) . $nvpStr;\n\t\t}\n\n\t\t$nvpreq=\"METHOD=\".urlencode($methodName).$nvpStr;\n\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq);\n\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\n\t\t if (curl_errno($ch) == 60) {\n\n\t\t\tcurl_setopt($ch, CURLOPT_CAINFO,\n\t\t\tdirname(__FILE__) . '/cacert.pem');\n\t\t\t$response = curl_exec($ch);\n\t\t}\n\n\t\t//convrting NVPResponse to an Associative Array\n\t\t$nvpResArray=$this->deformatNVP($response);\n\t\t$nvpReqArray=$this->deformatNVP($nvpreq);\n\t\t$_SESSION['nvpReqArray']=$nvpReqArray;\n\n\t\tif (curl_errno($ch)) {\n\t\t\t// moving to display page to display curl errors\n\t\t\t $_SESSION['curl_error_no']=curl_errno($ch) ;\n\t\t\t $_SESSION['curl_error_msg']=curl_error($ch);\n\t\t\t $this->APIerror();\n\t\t\t //$location = \"APIError.php\";\n\t\t\t //header(\"Location: $location\");\n\t\t } else {\n\t\t\t //closing the curl\n\t\t\t\tcurl_close($ch);\n\t\t }\n\n\t\treturn $nvpResArray;\n\t}", "public function hash_call($method_name, $nvpstr)\n\t{\n\t $settings = $this->pex_settings;\n\t $nvpheader = \"&PWD=\".urlencode($settings['api_password']).\"&USER=\".urlencode($settings['api_username']).\"&SIGNATURE=\".urlencode($settings['api_signature']);\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$settings['api_endpoint']);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t$nvpstr=$nvpheader.$nvpstr;\n\t\t//check if version is included in $nvpstr else include the version.\n\t\tif(strlen(str_replace('VERSION=', '', strtoupper($nvpstr))) == strlen($nvpstr)) {\n\t\t\t$nvpstr = \"&VERSION=\" . urlencode($settings['api_version']) . $nvpstr;\t\n\t\t}\n\t\t$nvpreq=\"METHOD=\".urlencode($method_name).$nvpstr;\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq);\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\t\t//convrting NVPResponse to an Associative Array\n\t\t$nvpresarray = $this->deformat_nvp($response);\n\t\t$nvpreqarray = $this->deformat_nvp($nvpreq);\n\t\t$_SESSION['nvpreqarray']=$nvpreqarray;\n\t\t\n\t\tif (curl_errno($ch)) {\n\t\t\t// moving to display page to display curl errors\n\t\t\t$_SESSION['curl_error_no'] = curl_errno($ch) ;\n\t\t\t$_SESSION['curl_error_msg'] = curl_error($ch);\n\t\t\t$location = \"APIError.php\";\n\t\t\theader(\"Location: $location\");\n\t\t} \n\t\telse {\n\t\t\t//closing the curl\n\t\t\tcurl_close($ch);\n\t\t}\n\t\treturn $nvpresarray;\n\t}", "function payment_sign($query, $api_key) {\n $clear_text = '';\n ksort($query);\n foreach ($query as $key => $value) {\n if (substr($key, 0, 2) === \"x_\") {\n $clear_text .= $key . $value;\n }\n }\n $hash = hash_hmac(\"sha256\", $clear_text, $api_key);\n return str_replace('-', '', $hash);\n }", "function refundCallBackIndex()\n{\n $refundCallbackVO = array(\n 'merchantId' => 'test_merchant',\n 'refundId' => 'test_456',\n 'tradeNo' => 'REFTRADE20190415060401022956957',\n 'orderId' => 'test_123',\n 'refundAmount' => '1000',\n 'currency' => 'INR',\n 'status' => '1',\n 'errorCode' => '',\n 'errorMsg' => '',\n 'sign' => '055E10F63AF852BDAC8FA174C65F2F8A',\n );\n\n //verify your sign\n $sign = $refundCallbackVO['sign'];\n // Use the test environment link: secretKey needs to be secretKey for the test environment\n // Use the production environment link: the secretKey needs to be secretKey for the production environment\n if (verifyForMd5('test_key', $refundCallbackVO, $sign)) {//change to your merchant secret key from SHAREit pay\n //Process the notify from SHAREit pay with your own logic\n if (true) {\n //default response format without modify\n $successResponse = array(\n 'result_code' => 200,\n 'message' => 'success',\n );\n return json_encode($successResponse, true);\n } else {\n //Exception\n //default response format without modify\n $failureResponse = array(\n 'result_code' => 500,\n 'message' => 'failure',\n );\n return json_encode($failureResponse, true);\n }\n } else {\n echo 'sign error';\n //default response format without modify\n $failureResponse = array(\n 'result_code' => 500,\n 'message' => 'failure',\n );\n return json_encode($failureResponse, true);\n }\n\n}", "private function hash_call($methodName, $nvpStr) {\n\n\t\t// form header string\n\t\t$nvpheader = $this->nvpHeader();\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->_api_endpoint);\n\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t\t$nvpStr=$nvpheader.$nvpStr;\n\n\t\t$nvpStr = \"&VERSION=\" . urlencode(self::VERSION) . $nvpStr;\n\n\t\t$nvpreq=\"METHOD=\".urlencode($methodName).$nvpStr;\n\n\t\t// set the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\n\t\tif (curl_errno($ch) == 60) {\n\t\t\tcurl_setopt($ch, CURLOPT_CAINFO,\n\t\t\t\tdirname(__FILE__) . '/PayPal_cacert.pem');\n\t\t\t$response = curl_exec($ch);\n\t\t}\n\n\t\t//converting NVPResponse to an Associative Array\n\t\t$nvpResArray = $this->deformatNVP($response);\n\n\t\tif (curl_errno($ch)) {\n\t\t\tthrow new \\Exception(curl_error($ch), curl_errno($ch));\n\t\t} else {\n\t\t\t//closing the curl\n\t\t\tcurl_close($ch);\n\t\t}\n\n\t\treturn $nvpResArray;\n\t}", "function PPHttpPost($methodName_, $nvpStr_) \n\t{\n\t\tglobal $environment;\n\t\t$API_UserName = urlencode('fhefoto_api1.yahoo.no');\n\t\t$API_Password = urlencode('N6SEDXLJKPN6PPWY');\n\t\t$API_Signature = urlencode('AlVtORxlymlrQpGY-fnzOdIuxvT1A2nTmy.LlXvPkOP5oU0VdZitgeEV');\n\t\n\t\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\t\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t}\n\t\t$version = urlencode('51.0');\n\n\t\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\t\t$httpResponse = curl_exec($ch);\n\n\t\tif(!$httpResponse) {\n\t\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t\t}\n\n\t\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t\t$httpParsedResponseAr = array();\n\t\tforeach ($httpResponseAr as $i => $value) {\n\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t}\n\t\t}\n\n\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t\t}\n\n\t\treturn $httpParsedResponseAr;\n\t}", "function PPHttpPost($methodName_, $nvpStr_) {\n\tglobal $environment;\n\n\tglobal $API_UserName, $API_Password, $API_Signature;\n\n\t// Set up your API credentials, PayPal end point, and API version.\n\n\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t//$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t$API_Endpoint = \"https://api-3t.sandbox.paypal.com/nvp\";\n\t}\n\t$version = urlencode('57.0');\n\n\t// Set the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t// Turn off the server and peer verification (TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t// Set the API operation, version, and API signature in the request.\n\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n\t// Set the request as a POST FIELD for curl.\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t// Get response from the server.\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t}\n\n\t// Extract the response details.\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\n\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\n\treturn $httpParsedResponseAr;\n}", "function PPHttpPost($methodName_, $nvpStr_) {\n\tglobal $environment;\n\n\t$API_UserName = urlencode('tuhins_1351114574_biz_api1.gmail.com');\n\t$API_Password = urlencode('1351114606');\n\t$API_Signature = urlencode('AdfcyT4sNBLU3ISgRRnYiJXaGd4hAjDiSEgVQesi8ykS-6Sp5pC4c5bM');\n\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t}\n\t$version = urlencode('58.0');\n\n\t// setting the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t// turning off the server and peer verification(TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t// NVPRequest for submitting to server\n\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\t\n\n\t// setting the nvpreq as POST FIELD to curl\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t// getting response from server\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t}\n\n\t// Extract the RefundTransaction response details\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\n\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\n\treturn $httpParsedResponseAr;\n}", "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 PPHttpPost($methodName_, $nvpStr_) {\n\n\t\n\t\t// Set up your API credentials, PayPal end point, and API version.\n\t\t$API_UserName = urlencode('eshop_1309605309_biz_api1.gmail.com');\n\t\t$API_Password = urlencode('1309605353');\n\t\t$API_Signature = urlencode('AiPC9BjkCyDFQXbSkoZcgqH3hpacA4TlLrMdwUVOcGq8BK4tNk9Rdji5');\n\t\t$API_Endpoint = \"https://api-3t.sandbox.paypal.com/nvp\";\n\t\t\n\t\t$version = urlencode('51.0');\n\t\n\t\t// Set the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\n\t\t// Turn off the server and peer verification (TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\n\t\t// Set the API operation, version, and API signature in the request.\n\t\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\t\n\t\t// Set the request as a POST FIELD for curl.\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\t\n\t\t// Get response from the server.\n\t\t$httpResponse = curl_exec($ch);\n\t\n\t\tif(!$httpResponse) {\n\t\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t\t}\n\t\n\t\t// Extract the response details.\n\t\t$httpResponseAr = explode(\"&\", $httpResponse);\n\t\n\t\t$httpParsedResponseAr = array();\n\t\tforeach ($httpResponseAr as $i => $value) {\n\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t}\n\t\t}\n\t\n\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t\t}\n\t\n\t\treturn $httpParsedResponseAr;\n\t}", "function getHashes($txnid, $amount, $productinfo, $firstname, $email, $user_credentials, $udf1, $udf2, $udf3, $udf4, $udf5,$cardBin)\r\n{\r\n $key = 'uWnwLgWB';\r\n $salt = 'JEoXThKDZm';\r\n\r\n $payhash_str = $key . '|' . checkNull($txnid) . '|' .checkNull($amount) . '|' .checkNull($productinfo) . '|' . checkNull($firstname) . '|' . checkNull($email) . '|' . checkNull($udf1) . '|' . checkNull($udf2) . '|' . checkNull($udf3) . '|' . checkNull($udf4) . '|' . checkNull($udf5) . '||||||' . $salt;\r\n $paymentHash = strtolower(hash('sha512', $payhash_str));\r\n $arr['payment_hash'] = $paymentHash;\r\n\r\n $cmnNameMerchantCodes = 'get_merchant_ibibo_codes';\r\n $merchantCodesHash_str = $key . '|' . $cmnNameMerchantCodes . '|default|' . $salt ;\r\n $merchantCodesHash = strtolower(hash('sha512', $merchantCodesHash_str));\r\n $arr['get_merchant_ibibo_codes_hash'] = $merchantCodesHash;\r\n\r\n $cmnMobileSdk = 'vas_for_mobile_sdk';\r\n $mobileSdk_str = $key . '|' . $cmnMobileSdk . '|default|' . $salt;\r\n $mobileSdk = strtolower(hash('sha512', $mobileSdk_str));\r\n $arr['vas_for_mobile_sdk_hash'] = $mobileSdk;\r\n\r\n\r\n\r\n $cmnPaymentRelatedDetailsForMobileSdk1 = 'payment_related_details_for_mobile_sdk';\r\n $detailsForMobileSdk_str1 = $key . '|' . $cmnPaymentRelatedDetailsForMobileSdk1 . '|default|' . $salt ;\r\n $detailsForMobileSdk1 = strtolower(hash('sha512', $detailsForMobileSdk_str1));\r\n $arr['payment_related_details_for_mobile_sdk_hash'] = $detailsForMobileSdk1;\r\n\r\n //used for verifying payment(optional)\r\n $cmnVerifyPayment = 'verify_payment';\r\n $verifyPayment_str = $key . '|' . $cmnVerifyPayment . '|'.$txnid .'|' . $salt;\r\n $verifyPayment = strtolower(hash('sha512', $verifyPayment_str));\r\n $arr['verify_payment_hash'] = $verifyPayment;\r\n return $arr;\r\n}", "public function execute()\n {\n if (!empty($_GET[\"responseid\"]) && !empty($_GET[\"requestid\"])) {\n $order_id = base64_decode($_GET[\"requestid\"]);\n $response_id = base64_decode($_GET[\"responseid\"]);\n\n $mode = $this->_paymentMethod->getMerchantConfig('modes');\n\n if ($mode == 'Test') {\n $mid = $this->_paymentMethod->getMerchantConfig('test_mid');\n $mkey = $this->_paymentMethod->getMerchantConfig('test_mkey');\n $client = new SoapClient(\"https://testpti.payserv.net/Paygate/ccservice.asmx?WSDL\");\n } elseif ($mode == 'Live') {\n $mid = $this->_paymentMethod->getMerchantConfig('live_mid');\n $mkey = $this->_paymentMethod->getMerchantConfig('live_mkey');\n $client = new SoapClient(\"https://ptipaygate.paynamics.net/ccservice/ccservice.asmx?WSDL\");\n }\n\n $request_id = '';\n $length = 8;\n $characters = '0123456789';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $request_id .= $characters[rand(0, $charactersLength - 1)];\n }\n\n $merchantid = $mid;\n $requestid = $request_id;\n $org_trxid = $response_id;\n $org_trxid2 = \"\";\n $cert = $mkey;\n $data = $merchantid . $requestid . $org_trxid . $org_trxid2;\n $data = utf8_encode($data . $cert);\n\n // create signature\n $sign = hash(\"sha512\", $data);\n\n $params = array(\"merchantid\" => $merchantid,\n \"request_id\" => $requestid,\n \"org_trxid\" => $org_trxid,\n \"org_trxid2\" => $org_trxid2,\n \"signature\" => $sign);\n\n $result = $client->query($params);\n $response_code = $result->queryResult->txns->ServiceResponse->responseStatus->response_code;\n $response_message = $result->queryResult->txns->ServiceResponse->responseStatus->response_message;\n\n switch ($response_code) {\n case 'GR001':\n case 'GR002':\n case 'GR033':\n $this->getResponse()->setRedirect(\n $this->_getUrl('checkout/onepage/success')\n );\n break;\n default:\n $this->messageManager->addErrorMessage(\n __($response_message)\n );\n /** @var \\Magento\\Framework\\Controller\\Result\\Redirect $resultRedirect */\n $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);\n return $resultRedirect->setPath('checkout/cart');\n break;\n }\n\n// $this->getResponse()->setRedirect(\n// $this->_getUrl('checkout/onepage/success')\n// );\n }\n }", "function huiten_daifu_pay($parms){\n\n $huiten_config = $GLOBALS['huiten_config'];\n\n $url = 'http://121.42.248.56:8080/pay-platform-api/doQhyHtGateBusiness';//请求地址\n\n $merNo = $huiten_config['merchantNo'];//\n\n $signKey = $huiten_config['signKey'];//\n\n $resMap=array();\n\n $resMap['requestNo']=$parms['requestNo'];\n\n $resMap['version']='V1.0';\n\n $resMap['productId']='0203';\n\n $resMap['transId']='005';\n\n $resMap['merNo']=$merNo;\n\n $resMap['orderDate']=date('Ymd');\n\n $resMap['orderNo']=$parms['orderNo'];\n\n $resMap['notifyUrl']='http://www.euamote.me/index.php/Home/Deposit/huiten_notify.html';\n\n $resMap['dfType']='001';\n\n $resMap['transAmt']=$parms['transAmt'];\n\n $resMap['isCompay']='0';\n\n $resMap['phoneNo']=$parms['phoneNo'];\n\n $resMap['customerName']=$parms['customerName'];\n\n $resMap['accBankNo']=$parms['accBankNo'];\n\n $resMap['accBankName']=$parms['accBankName'];\n\n $resMap['acctNo']=$parms['acctNo'];\n\n $resMap['signature']=strtoupper(md5($resMap['requestNo'].$resMap['productId'].$resMap['merNo'].$signKey));\n\n\n\n $data=array();\n\n $data['reqJson']=json_encode($resMap,256);\n\n return json_decode(post($url,$data), true);\n}", "public function invoke(PayPalApiStruct $webhook, Context $context): void;", "public function verify($params = array())\r\n {\r\n $returnURL = \"http://localhost\"; \r\n $cancelURL = \"http://localhost\"; \r\n $currencyCode = \"USD\";\r\n $startingDate = \"2011-02-24T13:00:00\"; \r\n $endingDate = \"2011-02-28T13:00:00\"; \r\n $maxTotalAmountOfAllPayments = \"2000\"; \r\n $senderEmail = \"\"; \r\n $maxNumberOfPayments = \"\"; \r\n // NO_PERIOD_SPECIFIED\r\n // DAILY - each day\r\n // WEEKLY - each week\r\n // BIWEEKLY - every other week\r\n // SEMIMONTHLY - twice a month\r\n // MONTHLY - each month\r\n // ANNUALLY - each year \r\n $paymentPeriod = \"\"; \r\n \r\n $dateOfMonth = \"\"; \r\n $dayOfWeek = \"\";\r\n $maxAmountPerPayment = \"\"; \r\n $maxNumberOfPaymentsPerPeriod = \"\"; \r\n $pinType = \"\"; \r\n $resArray = $this->CallPreapproval ($returnURL, $cancelURL, $currencyCode, $startingDate, $endingDate, $maxTotalAmountOfAllPayments,\r\n $senderEmail, $maxNumberOfPayments, $paymentPeriod, $dateOfMonth, $dayOfWeek,\r\n $maxAmountPerPayment, $maxNumberOfPaymentsPerPeriod, $pinType\r\n );\r\n $ack = strtoupper($resArray[\"responseEnvelope.ack\"]);\r\n if($ack==\"SUCCESS\")\r\n {\r\n $this->preapprovalKey = $resArray[\"preapprovalKey\"];\r\n $cmd = \"cmd=_ap-preapproval&preapprovalkey=\" . urldecode($resArray[\"preapprovalKey\"]);\r\n $this->Redirect( $cmd );\r\n //return $resArray[\"preapprovalKey\"];\r\n } \r\n else \r\n {\r\n $ErrorCode = urldecode($resArray[\"error(0).errorId\"]);\r\n $ErrorMsg = urldecode($resArray[\"error(0).message\"]);\r\n $ErrorDomain = urldecode($resArray[\"error(0).domain\"]);\r\n $ErrorSeverity = urldecode($resArray[\"error(0).severity\"]);\r\n $ErrorCategory = urldecode($resArray[\"error(0).category\"]);\r\n $this->errors = $ErrorCode.':'.$ErrorMsg.' '.$ErrorDomain.' '.$ErrorSeverity.' '.$ErrorCategory;\r\n $this->logging('verify Error : '. $this->errors);\r\n return false;\r\n }\r\n }", "function PPHttpPost($methodName_, $nvpStr_, $PayPalApiUsername, $PayPalApiPassword, $PayPalApiSignature, $PayPalMode) {\n $API_UserName = urlencode($PayPalApiUsername);\n $API_Password = urlencode($PayPalApiPassword);\n $API_Signature = urlencode($PayPalApiSignature);\n\n $paypalmode = ($PayPalMode == 'sandbox') ? '.sandbox' : '';\n\n $API_Endpoint = \"https://api-3t\" . $paypalmode . \".paypal.com/nvp\";\n $version = urlencode('109.0');\n\n // Set the curl parameters.\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n // Turn off the server and peer verification (TrustManager Concept).\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n\n // Set the API operation, version, and API signature in the request.\n $nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n // Set the request as a POST FIELD for curl.\n curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n // Get response from the server.\n $httpResponse = curl_exec($ch);\n\n if (!$httpResponse) {\n exit(\"$methodName_ failed: \" . curl_error($ch) . '(' . curl_errno($ch) . ')');\n }\n\n // Extract the response details.\n $httpResponseAr = explode(\"&\", $httpResponse);\n\n $httpParsedResponseAr = array();\n foreach ($httpResponseAr as $i => $value) {\n $tmpAr = explode(\"=\", $value);\n if (sizeof($tmpAr) > 1) {\n $httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n }\n }\n\n if ((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n exit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n }\n\n return $httpParsedResponseAr;\n }", "function getEncodedSignature($hostName,$digestEncoded,$SS_KEY,$path)\r\n{\r\n $signatureString = \"host: \".$hostName.\"\\n(request-target): post \".$path.\"\\n\".\"digest: SHA-256=\".$digestEncoded.\"\\n\".\"v-c-merchant-id: starlock01\";\r\n $signatureByteString = utf8_encode($signatureString);\r\n $decodeKey = base64_decode($SS_KEY);\r\n $signature = base64_encode(hash_hmac(\"sha256\", $signatureByteString,\r\n $decodeKey, true));\r\n return $signature;\r\n}", "function sloodle_signature($data) {\n \tglobal $CFG;\n\n $salt = '';\n if ( isset($CFG->sloodle_signature_salt) && ($CFG->sloodle_signature_salt != '' ) ) {\n $salt = $CFG->sloodle_signature_salt;\n } else {\n $salt = random_string(40);\n set_config('sloodle_signature_salt', $salt);\n }\n\n if (function_exists('hash_hmac')) {\n return hash_hmac('sha256', $data, $salt);\n }\n return sloodle_custom_hmac('sha1', $data, $salt);\n }", "public function createPaypalPayment(){\n try {\n $client = new Client();\n $paymentResponse = $client->request('POST', $this->paypalPaymentUrl, [\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->accessKey,\n ],\n 'body' => $this->salesData->salesData()\n ]);\n $this->parsePaymentBody($paymentResponse);\n \n } catch (\\Exception $ex) {\n $error = $ex->getMessage();\n return $error;\n }\n return $this->paymentBody->id;\n\n }", "public function payment_successful()\n {\n $user_id=$this->session->userdata('user_id');\n\n $status = $this->input->post(\"status\");\n $firstname = $this->input->post(\"firstname\");\n $amount = $this->input->post(\"amount\");\n $txnid = $this->input->post(\"txnid\");\n $posted_hash = $this->input->post(\"hash\");\n $key = $this->input->post(\"key\");\n $productinfo = $this->input->post(\"productinfo\");\n // $membership_package=$this->input->post('membership_package');\n $email = $this->input->post(\"email\");\n $salt = SALT;\n //echo $membership_package;die();\n\n\n if ($this->input->post(\"additionalCharges\")) {\n $additionalCharges = $this->input->post(\"additionalCharges\");\n $retHashSeq = $additionalCharges . '|' . $salt . '|' . $status . '|||||||||||' . $email . '|' . $firstname . '|' . $productinfo . '|' . $amount . '|' . $txnid . '|' . $key;\n } else {\n\n $retHashSeq = $salt . '|' . $status . '|||||||||||' . $email . '|' . $firstname . '|' . $productinfo . '|' . $amount . '|' . $txnid . '|' . $key;\n }\n $hash = hash(\"sha512\", $retHashSeq);\n\n if ($hash != $posted_hash) {\n $data['msg'] = \"Invalid Transaction. Please try again\";\n } else {\n \n //echo $user_id;die();\n // echo $status;\n // echo $txnid;\n // echo $amount;\n // echo $firstname;\n // echo $hash;die();\n //echo $membership_package;die();\n $data=array(\n 'user_id'=>$user_id,\n 'user_name'=>$firstname,\n 'status'=>$status,\n 'txnid'=>$txnid,\n 'amount'=>$amount,\n 'hash'=>$hash\n );\n\n //print_r($data);die();\n $path = base_url();\n $url = $path.'api/User_api/SavePayment';\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $response_json = curl_exec($ch);\n curl_close($ch);\n $response = json_decode($response_json, true);\n // print_r($response_json);die();\n $data['msg'] = \"<h3>Thank You. Your order status is \" . $status . \".</h3>\";\n $data['msg'] .= \"<h4>Your Transaction ID for this transaction is \" . $txnid . \".</h4>\";\n $data['msg'] .= \"<h4>We have received a payment of Rs. \" . $amount . \". Your order will soon be shipped.</h4>\";\n \n }\n $this->load->view('includes/header.php');\n $this->load->view('pages/profile/membership_view',$data);\n //$this->load->view('pages/payment/success.php',$data);\n $this->load->view('includes/footer.php');\n }", "static function STKPush_processrequest($timestamp, $account_ref, $transaction_desc, $amount, $phone_number, $callbackurl)\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/mpesa/stkpush/v1/processrequest';\n\n $access_token = self::generate_access_token();\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json', 'Authorization:Bearer ' . $access_token)); //setting custom header\n\n $curl_post_data = array(\n //Fill in the request parameters with valid values\n 'BusinessShortCode' => self::$business_shortcode,\n 'Password' => self::generate_mpesa_password($timestamp),\n 'Timestamp' => $timestamp,\n 'TransactionType' => 'CustomerPayBillOnline',\n 'Amount' => $amount,\n 'PartyA' => $phone_number,\n 'PartyB' => self::$business_shortcode,\n 'PhoneNumber' => $phone_number,\n 'CallBackURL' => $callbackurl,\n 'AccountReference' => $account_ref,\n 'TransactionDesc' => $transaction_desc\n );\n\n Log::debug('Request Body',['body'=>$curl_post_data]);\n\n $data_string = json_encode($curl_post_data);\n\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);\n\n if (config('app.env') === 'local') {\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n }\n $curl_response = curl_exec($curl);\n if (config('app.env') === 'local') Log::info($curl_response);\n return json_decode($curl_response);\n }", "function spgateway_credit_refund($params) {\n\n $amount = $params['amount']; # Format: ##.##\n $TotalAmount = round($amount);\n $transid = $params['transid'];\n\n # 是否為測試模式\n $posturl = ($params['testMode']==\"on\") ? 'https://ccore.spgateway.com/MPG/mpg_gateway'\n : 'https://core.spgateway.com/MPG/mpg_gateway' ;\n\n // post data\n $PostData = http_build_query(\n array( 'RespondType' => 'String',\n 'Version' => '1.0',\n 'Amt' => $TotalAmount,\n 'TradeNo' => $transid,\n 'TimeStamp' => time(),\n 'IndexType' => '2',\n 'CloseType' => '2'\n ));\n $PostData = trim(\n bin2hex(\n mcrypt_encrypt( MCRYPT_RIJNDAEL_128,\n $params['HashKey'],\n spgateway_credit_addpadding($PostData),\n MCRYPT_MODE_CBC,\n $params['HashIV'])\n )\n );\n\n // post\n $post = array( 'MerchantID_' => $params['MerchantID'],\n 'PostData_' => $PostData);\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $posturl);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n if ($params['testMode']=='on') curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // On dev server only!\n $result = curl_exec($ch);\n curl_close($ch);\n\n parse_str(trim($result),$result);\n\n switch($result['Status']){\n case 'SUCCESS':\n case 'TRA10045':\n return array('status'=>'success', 'rawdata'=>$result, 'transid'=>$result['TradeNo'], 'fees'=>0);\n case 'TRA10058':\n case 'TRA10675':\n case 'TRA10013':\n case 'TRA10035':\n return array('status'=>'declined', 'rawdata'=>$result);\n default:\n return array('status'=>'error', 'rawdata'=>$result);\n }\n}", "public function pay(): JsonResponse;", "public function paypal(Request $request)\n {\nrequire 'vendor/autoload.php';\n\n$apiContext = new \\PayPal\\Rest\\ApiContext(\n new \\PayPal\\Auth\\OAuthTokenCredential(\n 'AedIVbiADiRsvL3jFM6Z6Kcx5wSgwyBIMJFFQq0UFcBfrew-mhHGMZVpqWJhvQGbn-HkUpt5F023HH4n',\n 'EIs32ISB07N21Ey0z2a4Qthy5Obo173s1wD9Yx9hhiYJoC2bxdnNJVLpb2MvnT5QTYK74RBMg84FvPd4'\n )\n);\n\n return response()->json([\n 'message' => 'paypal route hit',\n 'request' => $request->all()\n ]);\n }", "function PPHttpPost($methodName_, $nvpStr_) {\n $submit_data = array(\n\t\t'METHOD' => $methodName_,\n\t\t'VERSION' => '52.0',\n\t\t'PWD' => MODULE_PAYMENT_PAYPAL_NVP_PW,\n\t\t'USER' => MODULE_PAYMENT_PAYPAL_NVP_USER_ID,\n\t\t'SIGNATURE' => MODULE_PAYMENT_PAYPAL_NVP_SIG,\n\t\t'IPADDRESS' => get_ip_address(),\n\t);\n\n\t$data = ''; // initiate XML string\n while(list($key, $value) = each($submit_data)) {\n \tif ($value <> '') $data .= '&' . $key . '=' . urlencode($value);\n }\n\t$data .= substr($data, 1) . $nvpStr_; // build the submit string\n\n\tif(\"sandbox\" === MODULE_PAYMENT_PAYPAL_NVP_TESTMODE || \"beta-sandbox\" === MODULE_PAYMENT_PAYPAL_NVP_TESTMODE) {\n\t\t$API_Endpoint = MODULE_PAYMENT_PAYPAL_NVP_SANDBOX_SIG_URL;\n\t} else {\n\t\t$API_Endpoint = MODULE_PAYMENT_PAYPAL_NVP_LIVE_SIG_URL;\n\t}\n\t// Set the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t// Turn off the server and peer verification (TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n//echo 'string = ' . $data . '<br>';\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\t$messageStack->add('XML Read Error (cURL) #' . curl_errno($ch) . '. Description = ' . curl_error($ch),'error');\n\t\treturn false;\n//\t\texit(\"$methodName_ failed: \" . curl_error($ch) . '(' . curl_errno($ch) . ')');\n\t}\n\t// Extract the response details.\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\tif (0 == sizeof($httpParsedResponseAr) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t$messageStack->add('PayPal Response Error.','error');\n\t\treturn false;\n//\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\treturn $httpParsedResponseAr;\n }", "function execute_payment($access_token, $payerId, $paymentID) {\n\n global $host;\n $url = $host.'/v1/payments/payment/'.$paymentID.'/execute/';\n\n $postdata= '{\"payer_id\" : \"'.$payerId.'\"}';\n\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Authorization: Bearer '.$access_token,\n 'Content-Type: application/json'\n )); // An array of HTTP header fields to set, in the format array('Content-type: text/plain', 'Content-length: 100')\n curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);\n #curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n\n $response = curl_exec( $curl );\n\n if (empty($response)) {\n // Some kind of an error happened\n die(curl_error($curl));\n curl_close($curl);\n } else {\n $info = curl_getinfo($curl);\n curl_close($curl); \n\n if($info['http_code'] != 200 && $info['http_code'] != 201 ) {\n return $response;\n }\n\n }\n\n return $response;\n\n}", "public function pay();", "function MakeSignedRequest()\n{\n $user_id = 1;\n $request_uri = SERVER_BASE . 'services.php';\n\n // Parameters, appended to the request depending on the request method.\n // Will become the POST body or the GET query string.\n $params = array(\n 'service' => 'rest',\n 'method' => 'Version',\n 'response' => RESPONSE\n );\n\n // Obtain a request object for the request we want to make\n $req = new OAuthRequester($request_uri, 'GET', $params);\n\n // Sign the request, perform a curl request and return the results, throws OAuthException exception on an error\n $result = $req->doRequest($user_id);\n\n // $result is an array of the form: array ('code'=>int, 'headers'=>array(), 'body'=>string)\n var_dump($result);\n echo $result['body'];\n}" ]
[ "0.7089446", "0.67854375", "0.67441547", "0.6549068", "0.6495124", "0.62567896", "0.6118522", "0.60313505", "0.5941127", "0.59124017", "0.5868389", "0.5843795", "0.58194005", "0.57683253", "0.57567775", "0.5699855", "0.56623477", "0.5654446", "0.5630786", "0.5586937", "0.55788136", "0.55628645", "0.5557286", "0.552869", "0.5525534", "0.5522338", "0.5518481", "0.5511691", "0.54753846", "0.54545605" ]
0.6967719
1
Description This function will return the list of modules available in the system, and which modules the requested station has access to. Arguments api_key: auth_token: station_id: The ID of the station to get the module list for.
function qruqsp_core_stationModuleList($q) { // // Find all the required and optional arguments // qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'prepareArgs'); $rc = qruqsp_core_prepareArgs($q, 'no', array( 'station_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Station'), 'plans'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Plans'), )); if( $rc['stat'] != 'ok' ) { return $rc; } $args = $rc['args']; // // Check access to station_id as owner, or sys admin. // qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'checkAccess'); $rc = qruqsp_core_checkAccess($q, $args['station_id'], 'qruqsp.core.stationModuleList'); if( $rc['stat'] != 'ok' ) { return $rc; } qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbHashIDQuery'); $strsql = "SELECT CONCAT_WS('.', package, module) AS name, package, module, status " . "FROM qruqsp_core_station_modules " . "WHERE station_id = '" . qruqsp_core_dbQuote($q, $args['station_id']) . "' " . "ORDER BY name " . ""; $rc = qruqsp_core_dbHashIDQuery($q, $strsql, 'qruqsp.core', 'modules', 'name'); if( $rc['stat'] != 'ok' ) { return $rc; } if( !isset($rc['modules']) ) { return array('stat'=>'fail', 'err'=>array('code'=>'qruqsp.core.139', 'msg'=>'No station found')); } $station_modules = $rc['modules']; // // Get the list of available modules // qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'getModuleList'); $rc = qruqsp_core_getModuleList($q); if( $rc['stat'] != 'ok' ) { return $rc; } $mod_list = $rc['modules']; $modules = array(); $count = 0; foreach($mod_list as $module) { if( $module['label'] != '' && $module['installed'] == 'Yes' && (!isset($module['optional']) || $module['optional'] == 'yes') ) { $modules[$count] = array('label'=>$module['label'], 'package'=>$module['package'], 'name'=>$module['name'], 'status'=>'0'); if( isset($station_modules[$module['package'] . '.' . $module['name']]) && $station_modules[$module['package'] . '.' . $module['name']]['status'] == 1 ) { $modules[$count]['status'] = '1'; } $count++; } } $rsp = array('stat'=>'ok', 'modules'=>$modules); /* // // Get the list of available plans for the station // if( isset($args['plans']) && $args['plans'] == 'yes' ) { if( $args['station_id'] == '0' ) { $args['station_id'] = $q['config']['qruqsp.core']['master_station_id']; } // // Query the database for the plan // $strsql = "SELECT id, name, monthly, trial_days " . "FROM qruqsp_core_station_plans " . "WHERE station_id = '" . qruqsp_core_dbQuote($q, $args['station_id']) . "' " . "ORDER BY sequence " . ""; qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbHashQueryTree'); $rc = qruqsp_core_dbHashQueryTree($q, $strsql, 'qruqsp.stations', array( array('container'=>'plans', 'fname'=>'id', 'name'=>'plan', 'fields'=>array('id', 'name', 'monthly')), )); if( $rc['stat'] != 'ok' ) { return $rc; } if( isset($rc['plans']) ) { $rsp['plans'] = $rc['plans']; } } */ return $rsp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModulesList();", "public static function getModules(){ \n $db = new db();\n $db->connect();\n $modules = $db->selectAll('modules');\n return self::getModulesInfo($modules);\n }", "public function getModules()\n {\n\n if ($this->_modules !== null) {\n return $this->_modules;\n }\n\n $url = Yii::app()->getModule('admin')->marketplaceApiUrl . \"list?version=\" . urlencode(HVersion::VERSION) . \"&installId=\" . HSetting::Get('installationId', 'admin');\n\n try {\n\n $this->_modules = Yii::app()->cache->get('onlineModuleManager_modules');\n if ($this->_modules === null || !is_array($this->_modules)) {\n\n $http = new Zend_Http_Client($url, array(\n 'adapter' => 'Zend_Http_Client_Adapter_Curl',\n 'curloptions' => $this->getCurlOptions(),\n 'timeout' => 30\n ));\n\n $response = $http->request();\n $json = $response->getBody();\n\n $this->_modules = CJSON::decode($json);\n Yii::app()->cache->set('onlineModuleManager_modules', $this->_modules, HSetting::Get('expireTime', 'cache'));\n }\n } catch (Exception $ex) {\n throw new CHttpException('500', Yii::t('AdminModule.libs_OnlineModuleManager', 'Could not fetch module list online! (%error%)', array('%error%' => $ex->getMessage())));\n }\n return $this->_modules;\n }", "public function getModules();", "public function getModules();", "public function getModules(){\n $qb = $this->createQueryBuilder();\n $qb->module('system')->query('modulelist');\n return $this->execute($qb);\n }", "public function get_modules( $status = 'all' );", "public function modules(){\n $userID = Auth::user()->USER_ID;\n $users = USER::where('USER_ID',$userID)->with('authModules')->first();\n $res['USERNAME'] = $users->USERNAME;\n $userModules = $users->authModules;\n foreach($userModules as $userModule){\n $userModuleID = $userModule->MODULE_ID;\n $modules = SystemModule::where('MODULE_ID', $userModuleID)->get();\n foreach($modules as $module){\n array_push($res,$module->MODULE_NAME);\n }\n }\n return $res;\n }", "function get_all_modules_by_center(){\n\t\t\t$sql=\"SELECT module_id,center_exam_part,subject_name FROM $this->table WHERE center_id=:centerId\";\n\t\t\t$stmt = $this->dbConn->prepare($sql);\n\t\t\t$stmt->bindParam(\":centerId\",$this->centerId);\n\t\t\tif ($stmt->execute()) {\n\t\t\t\t$results= $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\treturn json_encode($results);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}", "public function getModules() {\n }", "public function refreshModules ()\n\t{\n\n\t\t$modules = array();\n\n\t\tif ( $_SESSION[ __oSESSION_USER_PARAM__ ][ 'account' ][ 'allSet' ] && $this->hasAuthorised() )\n\t\t{\n\t\t\tif ( isset( $_SESSION[ __oSESSION_USER_PARAM__ ][ 'allowance' ][ 'discoversLimit' ] ) )\n\t\t\t{\n\t\t\t\t$modules[] = 'discover';\n\t\t\t}\n\t\t\tif ( isset( $_SESSION[ __oSESSION_USER_PARAM__ ][ 'allowance' ][ 'campaignsLimit' ] ) )\n\t\t\t{\n\t\t\t\t$modules[] = 'campaign';\n\t\t\t}\n\t\t\tglobal $freeCompanyModules;\n\t\t\tforeach ( $freeCompanyModules as $mod )\n\t\t\t{\n\t\t\t\t$modules[] = $mod;\n\t\t\t}\n\t\t\t$companyModules = $this->company->getModules();\n\t\t\tforeach ( $companyModules as $mod => $status )\n\t\t\t{\n\t\t\t\tif ( in_array( $mod, array(\n\t\t\t\t\t\t'admin',\n\t\t\t\t\t\t'reseller' ) ) )\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$modules[] = $mod;\n\t\t\t}\n\t\t}\n\t\tif ( $_SESSION[ __oSESSION_USER_PARAM__ ][ 'representative' ] )\n\t\t{\n\t\t\tif ( $this->company->hasAccessTo( 'admin' ) )\n\t\t\t{\n\t\t\t\t$modules[] = 'admin';\n\t\t\t}\n\t\t\tif ( $this->company->hasAccessTo( 'reseller' ) )\n\t\t\t{\n\t\t\t\t$modules[] = 'reseller';\n\t\t\t}\n\t\t}\n\n\t\t$this->userInfo[ 'modules' ] = $modules;\n\n\t\treturn $modules;\n\t}", "public static function getAllModules()\n\t\t{\n\n\t\t\t$modules = array();\n\n\t\t\treturn apply_filters( 'studiorum_modules', $modules );\n\n\t\t}", "public function getDataListModule()\n {\n $this->db->select('*');\n $this->db->from('xi_sa_module');\n $this->db->order_by('id_module', 'ASC');\n $query = $this->db->get();\n\n return $query->result();\n }", "function qa_list_modules_info()\n{\n\tglobal $qa_modules;\n\treturn $qa_modules;\n}", "public function getModuleList(){\n $qb = $this->createQueryBuilder();\n $qb->module('system')->query('modulelistnames');\n return $this->execute($qb);\n }", "public function getAvailableModules(string $module): array;", "function getModules()\n\t{\n\t\t $this->loadModel('Module'); \n\n\t\t $sections = $this->Module->query(\"SELECT * FROM modules WHERE enable = '1'\");\n\t\t return $sections;\n\t}", "public function getModules()\n {\n return $this['module.list'];\n }", "public function getModules()\n {\n $orgid = isset($_REQUEST['orgid']) ? decode5t($_REQUEST['orgid']) : '0';\n $data = array();\n try {\n $query = $this->db->query(\"SELECT ModuleId AS module,ViewPermission as permission FROM OrgPermission WHERE OrgId= ? and ModuleId in (5,31,66,171,186,187,2)\", array(\n $orgid\n ));\n $data['permission'] = $query->result();\n }\n catch (Exception $a) {\n $data['permission'] = '0';\n }\n return $data;\n \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 }", "protected function getUserModules()\n {\n $accessType = Auth::user()->user_access;\n\n $modules = User::where('id', Auth::user()->id)\n ->with('UserAccess.Module.subModules')\n ->get();\n\n return Response::json(array('data' => $modules));\n }", "public function list_server_modules()\n\t{\n\t\tthrow new steam_exception( $this->get_login_user_name(), \"Error: list_server_modules is not available using steam_connector_lite\", 980 );\n\t}", "static function get_all_available_modules()\n {\n $result = array();\n\n $categories = self::get_all_available_categories();\n\n foreach ($categories as $nome_categoria)\n {\n $names = self::get_all_available_by_category($nome_categoria);\n\n if (is_array($names))\n foreach ($names as $nome_modulo)\n {\n $def = self::get_available_module_definition($nome_categoria,$nome_modulo);\n \n $mod = array();\n $mod[\"show\"] = $def->get_show();\n $mod[\"nome_categoria\"] = $nome_categoria;\n $mod[\"nome_modulo\"] = $nome_modulo;\n $version = $def->get_current_version();\n $mod[\"properties\"] = $version;\n $result[] = $mod;\n \n }\n else echo \"Errore per la categoria : \".$nome_categoria;\n\n }\n\n return $result;\n }", "public function index()\n {\n return $this->module_service->all();\n }", "public function\n\tgetAvailableModules() : array\n\t{\n\t\t$moduleList_core \t= [];\n\t\t$moduleList_mantle \t= [];\n\n\t\t$procPath = CMS_SERVER_ROOT . DIR_CORE . DIR_MODULES;\n\n\t\tif(file_exists($procPath))\n\t\t{ \n\t\t\t$_dirIterator \t= new DirectoryIterator($procPath);\n\t\t\tforeach($_dirIterator as $_dirItem)\n\t\t\t{\n\t\t\t\tif($_dirItem -> isDot() || $_dirItem -> getType() !== 'dir')\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$directory = $_dirItem -> getFilename();\n\n\t\t\t\tif($directory[0] === '.')\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$moduleFilepath = $procPath . $directory .'/module.json'; \n\n\t\t\t\t$moduleConfig\t= file_get_contents($moduleFilepath);\n\n\t\t\t\tif($moduleConfig === false)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$moduleConfig = json_decode($moduleConfig);\n\n\t\t\t\t// Determine Scheme\n\n\t\t\t\t$pModulesInstall = new CModulesInstall;\n\n\t\t\t\t$moduleData = $pModulesInstall -> getModuleData($moduleConfig, $directory, 'core');\n\n\t\t\t\tif($moduleData === false)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$moduleData = json_decode(json_encode($moduleData));\n\n\t\t\t\t$moduleData -> module -> module_location = $directory;\n\n\t\t\t\t$moduleList_core[]\t= $moduleData;\n\t\t\t}\n\t\t}\n\n\t\t$procPath = CMS_SERVER_ROOT . DIR_MANTLE . DIR_MODULES;\n\n\t\tif(file_exists($procPath))\n\t\t{ \n\t\t\t$_dirIterator \t= new DirectoryIterator($procPath);\n\t\t\tforeach($_dirIterator as $_dirItem)\n\t\t\t{\n\t\t\t\tif($_dirItem -> isDot() || $_dirItem -> getType() !== 'dir')\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$directory = $_dirItem -> getFilename();\n\n\t\t\t\tif($directory[0] === '.')\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$moduleFilepath = $procPath . $directory .'/module.json'; \n\n\t\t\t\t$moduleConfig\t= file_get_contents($moduleFilepath);\n\n\t\t\t\tif($moduleConfig === false)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$moduleConfig = json_decode($moduleConfig);\n\n\t\t\t\t// Determine Scheme\n\n\t\t\t\t$pModulesInstall = new CModulesInstall;\n\n\t\t\t\t$moduleData = $pModulesInstall -> getModuleData($moduleConfig, $directory, 'mantle');\n\n\t\t\t\tif($moduleData === false)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$moduleData = json_decode(json_encode($moduleData));\n\n\t\t\t\t$moduleData -> module -> module_location = $directory;\n\n\t\t\t\t$moduleList_mantle[]\t= $moduleData;\n\t\t\t}\n\t\t}\n\n\t\t$availableList = [];\n\n\t\tforeach($moduleList_core as $dirModuleKey => $dirModuleItem)\n\t\t{\n\t\t\t$moduleInstalled = false;\n\n\n\t\t\tif(!isset($dirModuleItem -> module -> module_controller))\n\t\t\t{\n\t\t\t\t#tk::dbug($dirModuleItem);\n\n\t\t\t\t// aaaooohhh well ... this should not be\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach($this -> modulesList as $listItem)\n\t\t\t{\n\t\t\t\tif($listItem -> module_controller === $dirModuleItem -> module -> module_controller)\n\t\t\t\t{\n\t\t\t\t\t$moduleInstalled = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($moduleInstalled)\n\t\t\t\tcontinue;\n\n\t\t#\t$dirModuleItem -> module_type = \"core\";\n\n\t\t\t$availableList[] = $dirModuleItem;\n\t\t}\n\n\t\tforeach($moduleList_mantle as $dirModuleKey => $dirModuleItem)\n\t\t{\n\t\t\t$moduleInstalled = false;\n\n\t\t\tforeach($this -> modulesList as $listItem)\n\t\t\t{\n\t\t\t\tif($listItem -> module_controller === $dirModuleItem -> module -> module_controller)\n\t\t\t\t{\n\t\t\t\t\t$moduleInstalled = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($moduleInstalled)\n\t\t\t\tcontinue;\n\n\t\t#\t$dirModuleItem -> module_type \t\t= \"mantle\";\n\n\t\t\t$availableList[] = $dirModuleItem;\n\t\t}\n\n\n\t\treturn $availableList;\n\t}", "private function listModules() {\n\t\t\n\t\t$tabModules = array ();\n\t\t\n\t\t# search for modules in {appPath}/lib/modules/{module_name}/{module_name}.class.php\n\t\t$res = opendir(LIB_MOD);\n\t\t$i = 0;\n\t\twhile (false !== ($fModule = readdir($res))) {\n\t\t\tif (is_dir(LIB_MOD . $fModule) && $fModule != '.' && $fModule != '..') {\n\t\t\t\tif (is_file(LIB_MOD . $fModule .'/'. $fModule .'.class.php')) {\n\t\t\t\t\t$tabModules[$i]['name'] = $fModule;\n\t\t\t\t\t$tabModules[$i]['link'] = $this->conf['general']['appURL'] .'?action='. $fModule .'.show';\n\t\t\t\t\t++$i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($res);\n\t\t$ret = array (\n\t\t\t'modules'\t=> $tabModules\n\t\t);\n\t\t\n\t\treturn $ret;\n\t}", "function ciniki_tenants_getModules($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 'plans'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Plans'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n //\n // Check access to tnid as owner, or sys admin. \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'checkAccess');\n $ac = ciniki_tenants_checkAccess($ciniki, $args['tnid'], 'ciniki.tenants.getModules');\n if( $ac['stat'] != 'ok' ) {\n return $ac;\n }\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashIDQuery');\n $strsql = \"SELECT CONCAT_WS('.', package, module) AS name, package, module, status, ruleset \"\n . \"FROM ciniki_tenant_modules \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY name \"\n . \"\"; \n $rc = ciniki_core_dbHashIDQuery($ciniki, $strsql, 'ciniki.tenants', 'modules', 'name');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['modules']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.49', 'msg'=>'No tenant found'));\n }\n $tenant_modules = $rc['modules'];\n\n //\n // Get the list of available modules\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'getModuleList');\n $rc = ciniki_core_getModuleList($ciniki);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $mod_list = $rc['modules'];\n\n $modules = array();\n $count = 0;\n foreach($mod_list as $module) {\n if( $module['label'] != '' && $module['installed'] == 'Yes' && (!isset($module['optional']) || $module['optional'] == 'yes') ) {\n $modules[$count] = array('label'=>$module['label'], 'package'=>$module['package'], 'name'=>$module['name'], 'status'=>'0');\n if( isset($tenant_modules[$module['package'] . '.' . $module['name']]) ) {\n if( $tenant_modules[$module['package'] . '.' . $module['name']]['status'] == 1 ) {\n $modules[$count]['status'] = '1';\n } elseif( $tenant_modules[$module['package'] . '.' . $module['name']]['status'] == 90 ) {\n $modules[$count]['status'] = '90';\n } \n }\n $count++;\n }\n }\n\n $rsp = array('stat'=>'ok', 'modules'=>$modules);\n \n //\n // Get the list of available plans for the tenant\n // \n if( isset($args['plans']) && $args['plans'] == 'yes' ) {\n if( $args['tnid'] == '0' ) {\n $args['tnid'] = $ciniki['config']['ciniki.core']['master_tnid'];\n }\n //\n // Query the database for the plan\n //\n $strsql = \"SELECT id, name, monthly, trial_days \"\n . \"FROM ciniki_tenant_plans \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY sequence \"\n . \"\";\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.tenants', array(\n array('container'=>'plans', 'fname'=>'id', 'name'=>'plan', 'fields'=>array('id', 'name', 'monthly')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['plans']) ) {\n $rsp['plans'] = $rc['plans'];\n }\n }\n\n return $rsp;\n}", "function getModules($universityID){\n\n\tglobal $db;\n\tglobal $noerrors;\n\t\n\tif($noerrors <> 0)\n\t{\n\t\techo json_encode(array(\"errorcode\"=>$noerrors));\n\t\treturn;\n\t}\n\t\n\t// Find purchased tickets \n\t$findModules = $db->prepare(\"SELECT * FROM `modules` WHERE `universityID` = :universityID\");\n\t$findModules->bindParam(\"universityID\", $universityID); \n\t$findModules->execute();\n\n\t// JSON Message array\n\t$jsonArray = array();\n\n\t\n\tif ($findModules->rowCount() > 0)\n\t{\n\t\t$jsonArray[\"module_number\"]=$findModules->rowCount();\n\t\t\n\t\t$modules = $findModules->fetchAll();\n\t\tforeach($modules AS $module)\n\t\t{\n\t\t\t$jsonArray[\"modules\"][] = array(\"ID\"=>$module['moduleID'],\"module_code\"=>$module['module_code'],\"module_name\"=>$module['module_name']);\n\t\t}\n\t} \n\telse \n\t{\n\t\t$jsonArray[\"module_number\"]=$findModules->rowCount();\t\n\t}\n\n\t// Output JSON Message\n\techo json_encode($jsonArray);\n\n}", "public function index()\n {\n $modules = App\\Module::with('lessons' /*'tracks', 'quiz'*/)->get(); // I honestly have no idea if we need tracks here\n return response($modules);\n }", "public function getAllModules()\n\t{\n\t\treturn $this->modules;\n\t}" ]
[ "0.6519723", "0.64090395", "0.6387625", "0.6264763", "0.6264763", "0.6182842", "0.6080295", "0.6033333", "0.60101736", "0.60081464", "0.59897685", "0.5976847", "0.5955909", "0.59485173", "0.5936262", "0.58714646", "0.58619255", "0.5831128", "0.58197904", "0.58183616", "0.5800173", "0.5783523", "0.5755083", "0.5742425", "0.57317615", "0.5716133", "0.56801635", "0.565686", "0.55946857", "0.5583259" ]
0.74659175
0
Check if feed api in use.
public function isFeedChecked() { $base_config = $this->config_factory->getEditable('ap_newsroom.base_config'); if($base_config->get('use_feed')) { return TRUE; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function can_create_feed() {\n\n\t\treturn $this->initialize_api();\n\n\t}", "function wpcom_vip_is_feedservice_ua() {\n\tif ( function_exists( 'wpcom_feed_cache_headers' ) ) {\n\t\t// Workaround so that no feed request served from nginx wpcom-feed-cache\n\t\t// If you are checking you must already know is a feed\n\t\t// and don't want any requests cached\n\t\t// ASSUMPTION: you've already confirmed is_feed() b/f calling\n\t\t// wpcom_vip_is_feedservice_ua\n\t\t\theader( \"X-Accel-Expires: 0\" );\n\t}\n\n\treturn (bool) preg_match(\"/feedburner|feedvalidator|MediafedMetrics/i\", $_SERVER[\"HTTP_USER_AGENT\"]);\n}", "public function isFeed()\n {\n if (($is = &$this->staticKey(__FUNCTION__)) !== null) {\n return $is; // Already cached this.\n }\n if (isset($_REQUEST['feed'])) {\n return $is = true;\n } elseif (!empty($_SERVER['REQUEST_URI']) && preg_match('/\\/feed(?:[\\/?]|$)/', $_SERVER['REQUEST_URI'])) {\n return $is = true;\n }\n return $is = false;\n }", "protected function api_connected() {\n\t\treturn ! empty( $this->api );\n\t}", "private static function checkFeed($feed_url){\n if( self::urlExists($feed_url)){\n if( self::xmlCheck($feed_url)){\n return true;\n }\n }\n return false;\n }", "protected function is_api_loaded()\n {\n }", "private function isApiAvailable() {\n\t\treturn get_option(\"wp_broadbean_ipavailibility\") == 1;\n\t}", "public function isFeed($url) {\n\t\t$feed = $this->getFeed($url);\n\t\treturn !empty($feed->url);\n\t}", "public function can_create_feed() {\n\t\t\n\t\treturn $this->initialize_api() && $this->api->is_client_folder_set();\n\t\t\n\t}", "public function hasFeedOptions() {\r\n $this->importCookie();\r\n\r\n if ($this->getOption('enable_feeds')) {\r\n $service = $this->getLinkedService(true); // $refresh := true\r\n return ($service && $this->cookie['can_publish'] && $service->hasFeedOptions());\r\n }\r\n\r\n return false;\r\n }", "public function is_feed($feeds = '')\n {\n }", "public function is_available() {\n\t\treturn $this->secret_api_key && $this->publishable_api_key;\n\t}", "public function isApiEnabled()\n {\n return (Mage::getStoreConfig('easywebshopsms/api_connection/active')==0) ? false : true;\n }", "static function is_api($request){\n if(strpos($request->url(), url('api').'/')!==false){\n return true;\n }\n\n return false;\n\n }", "function wpcom_vip_is_main_feed_requested() {\n\t$toMatch = '#^/(wp-(rdf|rss|rss2|atom|rssfeed).php|index.xml|feed|rss)/?$#i';\n\t$request = $_SERVER['REQUEST_URI'];\n\treturn (bool) preg_match( $toMatch, $request );\n}", "function forum_rss_feeds() {\n\n global $CFG;\n\n $status = true;\n\n //Check CFG->enablerssfeeds\n if (empty($CFG->enablerssfeeds)) {\n debugging('DISABLED (admin variables)');\n //Check CFG->forum_enablerssfeeds\n } else if (empty($CFG->forum_enablerssfeeds)) {\n debugging('DISABLED (module configuration)');\n //It's working so we start...\n } else {\n //Iterate over all forums\n if ($forums = get_records(\"forum\")) {\n foreach ($forums as $forum) {\n if (!empty($forum->rsstype) && !empty($forum->rssarticles) && $status) {\n\n $filename = rss_file_name('forum', $forum); // RSS file\n\n //First let's make sure there is work to do by checking existing files\n if (file_exists($filename)) {\n if ($lastmodified = filemtime($filename)) {\n if (!forum_rss_newstuff($forum, $lastmodified)) {\n continue;\n }\n }\n }\n\n //Ignore hidden forums\n if (!instance_is_visible('forum',$forum)) {\n if (file_exists($filename)) {\n @unlink($filename);\n }\n continue;\n }\n\n mtrace(\"Updating RSS feed for \".format_string($forum->name,true).\", ID: $forum->id\");\n\n //Get the XML contents\n $result = forum_rss_feed($forum);\n //Save the XML contents to file\n if (!empty($result)) {\n $status = rss_save_file(\"forum\",$forum,$result);\n }\n if (debugging()) {\n if (empty($result)) {\n echo \"ID: $forum->id-> (empty) \";\n } else {\n if (!empty($status)) {\n echo \"ID: $forum->id-> OK \";\n } else {\n echo \"ID: $forum->id-> FAIL \";\n }\n }\n }\n }\n }\n }\n }\n return $status;\n }", "public static function isApi()\n {\n return (self::getRequestType() == 'api')?true:false;\n }", "function lightboxgallery_rss_enabled() {\n global $CFG;\n\n return ($CFG->enablerssfeeds && get_config('lightboxgallery', 'enablerssfeeds'));\n}", "public function isRssEnabled()\n {\n return Mage::getStoreConfigFlag('rss/config/active') &&\n Mage::getStoreConfigFlag('komaks_newsedit/author/rss');\n }", "public function checkApiIsUp() {\n\t\t$result = $this->useCfCURLQuery( \"https://socket.bittrex.com/signalr/ping\" );\n\t\tif ( $result ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "protected static function _checkApiAvailability(){\n\t\t$fbLib = static::_getApiPath();\n\t\tif (!\\file_exists($fbLib)){\n\t\t\tthrow new ClassNotFoundException('Facebook Lib not there! Do git submoule init first!');\n\t\t}\n\t}", "public function isNotReadyForRequests() {\n return empty($this->service_url) || empty($this->api_key);\n }", "public function hasRss($context = null);", "private static function xmlCheck($feed_url) {\n $xml = new \\XMLReader();\n $xml->open($feed_url);\n $xml->setParserProperty(\\XMLReader::VALIDATE, true);\n if( $xml->isValid()) {\n\n if( @simplexml_load_file($feed_url)) {\n return true;\n }\n else{\n return false;\n }\n }\n else{\n return false;\n }\n }", "public function isAvailable()\n {\n if (empty($this->_url)) {\n return false;\n } // if\n\n try {\n $this->sendrequest('status', null);\n } catch (Exception $e) {\n return false;\n }\n\n return true;\n }", "static public function isApi() {\n return\n isset($_SERVER['REQUEST_URI'])\n && strpos($_SERVER['REQUEST_URI'], \"/passage/\") !== false;\n }", "public static function hasFacebookSupport()\n {\n return static::enabled(static::facebook());\n }", "function ppom_is_api_enable() {\n \n $api_enable = get_option( 'ppom_api_enable' );\n $api_key = get_option( 'ppom_rest_secret_key' );\n \n $return = false;\n \n if( $api_enable == 'yes' && $api_key != '' ) {\n $return = true;\n }\n \n return $return;\n}", "public function isApiEnabled()\n {\n return (Mage::getStoreConfig('smsnotifier/main_conf/active')==0) ? 0 : 1;\n\n }", "function forum_rss_feed($forum) {\n\n global $CFG;\n\n $status = true;\n\n //Check CFG->enablerssfeeds\n if (empty($CFG->enablerssfeeds)) {\n debugging(\"DISABLED (admin variables)\");\n //Check CFG->forum_enablerssfeeds\n } else if (empty($CFG->forum_enablerssfeeds)) {\n debugging(\"DISABLED (module configuration)\");\n //It's working so we start...\n } else {\n //Check the forum has rss activated\n if (!empty($forum->rsstype) && !empty($forum->rssarticles)) {\n //Depending of the forum->rsstype, we are going to execute, different sqls\n if ($forum->rsstype == 1) { //Discussion RSS\n $items = forum_rss_feed_discussions($forum);\n } else { //Post RSS\n $items = forum_rss_feed_posts($forum);\n\n }\n //Now, if items, we begin building the structure\n if (!empty($items)) {\n //First all rss feeds common headers\n $header = rss_standard_header(strip_tags(format_string($forum->name,true)),\n $CFG->wwwroot.\"/mod/forum/view.php?f=\".$forum->id,\n format_string($forum->intro,true));\n //Now all the rss items\n if (!empty($header)) {\n $articles = rss_add_items($items);\n }\n //Now all rss feeds common footers\n if (!empty($header) && !empty($articles)) {\n $footer = rss_standard_footer();\n }\n //Now, if everything is ok, concatenate it\n if (!empty($header) && !empty($articles) && !empty($footer)) {\n $status = $header.$articles.$footer;\n } else {\n $status = false;\n }\n } else {\n $status = false;\n }\n }\n }\n return $status;\n }" ]
[ "0.73219836", "0.6992901", "0.6945008", "0.68728346", "0.6842441", "0.6797434", "0.670532", "0.6701433", "0.6661849", "0.66510284", "0.64179325", "0.641213", "0.6411932", "0.63662285", "0.6359877", "0.6289321", "0.62438464", "0.6224127", "0.6219437", "0.62183994", "0.6185424", "0.6167215", "0.6157776", "0.6144431", "0.611727", "0.6115057", "0.6101075", "0.60882986", "0.60747665", "0.6043502" ]
0.72887605
1
Prepare node entity for cloning
public function prepareNodeForClone($entity_type) { $item_id = $this->getItemId(); if($item_id) { $singleContentResponse = $this->apNewsroomContent->getContentById($item_id); return $this->mapAPDataToNode($entity_type,$singleContentResponse); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function node_object_prepare(&$node) {\n $node_options = variable_get('node_options_'. $node->type, array('status', 'promote'));\n // If this is a new node, fill in the default values.\n if (!isset($node->nid)) {\n foreach (array('status', 'promote', 'sticky') as $key) {\n $node->$key = in_array($key, $node_options);\n }\n global $user;\n $node->uid = $user->uid;\n $node->created = REQUEST_TIME;\n }\n else {\n $node->date = format_date($node->created, 'custom', 'Y-m-d H:i:s O');\n // Remove the log message from the original node object.\n $node->log = NULL;\n }\n // Always use the default revision setting.\n $node->revision = in_array('revision', $node_options);\n\n node_invoke($node, 'prepare');\n node_invoke_nodeapi($node, 'prepare');\n}", "public function prepare($node, $row) {\n EntityHelper::removeInvalidFieldDeltas('node', $node);\n EntityHelper::removeEmptyFieldValues('node', $node);\n }", "public function __clone()\n {\n // If the entity has an identity, proceed as normal.\n if ($this->id) {\n // unset identifiers\n $this->setId(0);\n \n // init validator\n $this->initValidator();\n \n // reset Workflow\n $this->resetWorkflow();\n \n $this->setCreatedDate(null);\n $this->setCreatedUserId(null);\n $this->setUpdatedDate(null);\n $this->setUpdatedUserId(null);\n \n \n }\n // otherwise do nothing, do NOT throw an exception!\n }", "public function prepare($node, $row) {\n $node->field_project_roles[LANGUAGE_NONE] = $this->getProjectRoles($node, $row);\n\n // Remove any empty or illegal delta field values.\n EntityHelper::removeInvalidFieldDeltas('node', $node);\n EntityHelper::removeEmptyFieldValues('node', $node);\n }", "public function __clone()\n {\n // if the entity has no identity do nothing, do NOT throw an exception\n if (!$this->id) {\n return;\n }\n \n // otherwise proceed\n \n // unset identifier\n $this->setId(0);\n \n // reset workflow\n $this->setWorkflowState('initial');\n \n // reset upload fields\n $this->setAvatarUpload(null);\n \n $this->setCreatedBy(null);\n $this->setCreatedDate(null);\n $this->setUpdatedBy(null);\n $this->setUpdatedDate(null);\n \n \n // clone categories\n $categories = $this->categories;\n $this->categories = new ArrayCollection();\n foreach ($categories as $c) {\n $newCat = clone $c;\n $this->categories->add($newCat);\n $newCat->setEntity($this);\n }\n }", "public function __clone()\n {\n // if the entity has no identity do nothing, do NOT throw an exception\n if (!($this->id)) {\n return;\n }\n \n // otherwise proceed\n \n // unset identifiers\n $this->setId(0);\n \n // reset workflow\n $this->resetWorkflow();\n \n $this->setCreatedBy(null);\n $this->setCreatedDate(null);\n $this->setUpdatedBy(null);\n $this->setUpdatedDate(null);\n \n \n // clone categories\n $categories = $this->categories;\n $this->categories = new ArrayCollection();\n foreach ($categories as $c) {\n $newCat = clone $c;\n $this->categories->add($newCat);\n $newCat->setEntity($this);\n }\n }", "public function prepare($entity, $row) {\n $row->field_location = explode('|', $row->field_location);\n\n $wrapper = entity_metadata_wrapper('node', $entity);\n $wrapper->field_location->set(array(\n 'lat' => +$row->field_location[0],\n 'lng' => +$row->field_location[1],\n ));\n }", "function prepareForCopy() {\n\t\t$this->id = null;\n\t}", "public function __clone()\n {\n $this->headers = clone $this->headers;\n $this->encoder = clone $this->encoder;\n $this->cacheKey = bin2hex(random_bytes(16)); // set 32 hex values\n $children = [];\n foreach ($this->children as $pos => $child) {\n $children[$pos] = clone $child;\n }\n $this->setChildren($children);\n }", "public function __clone()\n {\n $this->_id = null;\n $this->_key = null;\n $this->_rev = null;\n // do not change the _changed flag here\n }", "public function cloneTo(Entity $toEntity)\r\n {\r\n $thisData = $this->toArray();\r\n $thisData['id'] = null;\r\n $toEntity->fromArray($thisData);\r\n }", "public function __clone()\n {\n foreach ($this->children as $key => $value) {\n if (is_object($value)) {\n $this->children[$key] = clone $value;\n }\n }\n }", "public function __clone() {\n\t\tif ($this->dimensions instanceof Collection) {\n\t\t\t$existingDimensions = $this->dimensions->toArray();\n\t\t\t$this->dimensions = new ArrayCollection();\n\t\t\t/** @var NodeDimension $existingDimension */\n\t\t\tforeach ($existingDimensions as $existingDimension) {\n\t\t\t\t$this->dimensions->add(new NodeDimension($this, $existingDimension->getName(), $existingDimension->getValue()));\n\t\t\t}\n\t\t}\n\t}", "public function cloneNode() {\n return clone $this;\n }", "public function __clone()\n {\n $this->id = null;\n\n // Generate a new identifier\n $identifier = Uuid::uuid1()->toString();\n $this->identifier = $identifier;\n $this->uri = 'local:'.$this->identifier;\n\n // Set last change/update to now\n $this->updatedAt = new \\DateTimeImmutable();\n $this->changedAt = $this->updatedAt;\n }", "public function __clone()\n\t{\n\t\t$this->children=[];\n\t}", "protected function prepare() \n {\n $this->array = new ArrayNode;\n }", "public function __clone()\n {\n $this->_id = null;\n }", "public function __clone()\n {\n foreach ($this->parameters as $key => $child) {\n $this->parameters[$key] = clone $child;\n $this->parameters[$key]->parent = $this;\n }\n }", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}" ]
[ "0.64748895", "0.64306897", "0.6331925", "0.616428", "0.6071687", "0.6031265", "0.59198064", "0.58280045", "0.58152056", "0.57362133", "0.56623363", "0.56195015", "0.5575454", "0.5532027", "0.55180246", "0.550112", "0.5494381", "0.54736334", "0.54394907", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236" ]
0.66675603
0
Map text type field.
public function mapTextTypeField(&$entity, $field, $item_data) { $field_name = $field['id']; $mapping_index = explode('.',$field['path']); // Loop for value. $field_value = $item_data['data']; for ($i = 0; $i < count($mapping_index); $i++) { if(isset($field_value[$mapping_index[$i]])) { $field_value = $field_value[$mapping_index[$i]]; } } if(is_string($field_value) && $entity->hasField($field_name)) { $entity->$field_name->appendItem($field_value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function convert_text_field() {\n\n\t\t// Create a new Text field.\n\t\tself::$field = new GF_Field_Text();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t}", "public function getTYPE_TEXT()\n {\n return self::TYPE_TEXT;\n }", "public function getType()\n {\n return 'text field';\n }", "public function typeText() {\n $params = $this->types();\n return isset($params[$this->type]) ? $params[$this->type] : '';\n }", "function map_field($field){\n $str= $field->to_str();\n //\n //return field to str\n return $str;\n }", "function get_fields_text()\n\t{\n\t\t$fields_text\t=\tarray(); \n\t\t$fields\t\t=\t$this->_get_fields();\n\t\tforeach ( $fields as $field )\n\t\t{\n\t\t\tif ( $field->type == 'varchar' ||\n\t\t\t $field->type == 'text'\n\t\t\t )\n\t\t\t{\n\t\t\t\t$fields_text[]->name\t= $field->name;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $fields_text;\n\t}", "public function text($field) {\n\t\t\t$this->all($field);\n\t\t}", "protected function typeText(Fluent $column)\n {\n return 'text';\n }", "protected function type_text(Magic $column)\n {\n return 'TEXT';\n }", "protected function type_text(Magic $column)\n {\n return 'TEXT';\n }", "function hook_acquia_contenthub_field_type_mapping_alter(array &$mapping) {\n $mapping['my_custom_field'] = 'array<string>';\n}", "function get_field_mapping_types() {\n return drupal_map_assoc([\n 'string',\n 'keyword',\n 'date',\n 'long',\n 'double',\n 'boolean',\n 'ip',\n 'object',\n 'nested',\n 'geo_point',\n 'geo_shape',\n 'completion',\n ]);\n}", "function isTextType($type)\n{\n return($type == \"string\" or $type == \"varchar\" or $type == \"tinytext\" or $type == \"password\" or\n $type == \"set\" or $type == \"enum\" or $type == \"char\" or $type == \"file\" or isTextAreaType($type));\n}", "protected function typeText(Magic $column)\n {\n return 'TEXT';\n }", "function getSingleField_typeText($fieldConf, $tcaFieldConf) {\n\n\t\t\t// Add the various parameters according to TCA configuration:\n\t\t$params = array(\n\t\t\t'name' => isset ($fieldConf['overridename']) ? $fieldConf['overridename'] : $this->prefixId.'[data]['.$fieldConf['table'].']['.$fieldConf['name'].']',\n\t\t\t'id' => isset ($fieldConf['overrideid']) ? $fieldConf['overrideid'] : $this->prefixId.'[data]['.$fieldConf['table'].']['.$fieldConf['name'].']',\n\t\t\t'rows' => ($tcaFieldConf['rows'] ? $tcaFieldConf['rows'] : 5),\n\t\t\t'cols' => ($tcaFieldConf['cols'] ? $tcaFieldConf['cols'] : 30),\n\t\t\t'maxlength' => ($fieldTCAConf['max'] ? $tcaFieldConf['max'] : 255),\n\t\t\t'tabindex' => ($this->fieldTabIndex += 10),\n\t\t\t'class' => 'tx-frontendformslib-field tx-frontendformslib-field-' . (intval($fieldConf['config']['tx_frontendformslib_swaphorizontally']) ? 'switched': 'normal'),\n\t\t);\n\n\t\t$output = '<textarea '.$this->implode_assoc_r('=\"', '\" ', $params).'\" />'.htmlspecialchars($this->sessionData['data'][$fieldConf['table']][$fieldConf['name']]).'</textarea>';\n\n\t\treturn $output;\n\t}", "public function text ( \\r8\\Form\\Text $field )\n {\n $this->addField( \"text\", $field );\n }", "public function getValueElementType()\n {\n return 'text';\n }", "function get_field_type($field)\n\t{\n\t\tif( $field == \"usr_email\" )\n\t\t\treturn \"email\";\n\t\telse if( $field == \"usr_cod_postal\" )\n\t\t\treturn \"number\";\n\t\telse\n\t\t\treturn \"text\";\n\t}", "public function isTextType()\n {\n return PropelTypes::isTextType($this->getType());\n }", "function ifx_textasvarchar($mode)\n{\n}", "function testText()\n {\n $l_st=new StaticText();\n $l_st->setText(new DynamicStaticValue(static::TEXT));\n $l_store=new MapData(null);\n $l_text=$l_st->getAttValue(\"text\", $l_store,\"string\",true);\n $this->assertEquals(static::TEXT,$l_text);\n }", "public static function normalize( $field ) {\n\t\t$field = parent::normalize( $field );\n\t\t$field['multiple'] = false;\n\t\t$field['attributes']['id'] = false;\n\t\t$field['attributes']['type'] = 'text';\n\t\treturn $field;\n\t}", "protected function getProfilefields_Type_TextService()\n {\n return $this->services['profilefields.type.text'] = new \\phpbb\\profilefields\\type\\type_text(${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'}, ${($_ = isset($this->services['template']) ? $this->services['template'] : $this->getTemplateService()) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'});\n }", "public static function registerText(Text $text): void {\n $level = $text->getPosition()->getLevel();\n switch (true) {\n case $text instanceof CRFT:\n self::$crfts[$level->getFolderName()][$text->getName()] = $text;\n break;\n\n case $text instanceof FT:\n self::$fts[$level->getFolderName()][$text->getName()] = $text;\n FtsData::get()->saveTextByLevel($level, $text);\n break;\n }\n }", "public function text_or_binary()\n {\n }", "public function saveTextToEntity($entity_type_id, $entity_id, $field_name, $speech);", "public function getFormType() : string\n {\n return 'text';\n }", "public function isTextType()\n {\n return $this->getModel()->isPlain();\n }", "public function isText() {}", "public function getDataWithTypeField() {}" ]
[ "0.6864198", "0.6534051", "0.6453625", "0.62800676", "0.6169659", "0.59466153", "0.59465766", "0.5925325", "0.59144026", "0.59144026", "0.58567095", "0.58124936", "0.5793117", "0.5789615", "0.57548696", "0.5707303", "0.5688153", "0.5676421", "0.5653418", "0.56323534", "0.56064737", "0.5602657", "0.5568063", "0.55143297", "0.5458372", "0.5450289", "0.5443822", "0.54202646", "0.5417075", "0.53858966" ]
0.69684404
0
Map paragraphs type field.
public function mapParagraphsType(&$entity, $field, $item_data) { $field_name = $field['id']; foreach ($field['paragraph_list'] as $para_type => $para_fields) { $paragraph = $this->entityTypeManager ->getStorage('paragraph') ->create(['type' => $para_type]); foreach ($para_fields['fields'] as $key => $para_field) { $this->resolveFieldTypeMapping($paragraph, $para_field, $item_data); } if(!empty($paragraph) && $entity->hasField($field_name)) { $entity->$field_name->appendItem($paragraph); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function AssignPageTypeFields() {\n $this->AddField('showmap', self::DT_BOOLEAN, true);\n $this->AddField('mapaddress', self::DT_STRING);\n }", "function get_parade_parallax_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Background', 'parade_background', 'File'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Enable parallax', 'parade_enable_parallax', 'Boolean'],\n ['Minimum height', 'parade_minimum_height', 'Number (integer)'],\n ['Text', 'parade_text', 'Text (formatted, long)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Text', '- Hidden -', 'Default'],\n ['Anchor', 'Above', 'Plain text'],\n ['Background', 'Above', 'URL to file'],\n ['Color scheme', 'Above', 'Label'],\n ['Enable parallax', 'Above', 'Boolean'],\n ['Minimum height', 'Above', 'Unformatted'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_paragraphs_types_list() {\n return [\n ['', 'Chart box', 'chart_box', ''],\n ['', 'Header', 'header', ''],\n ['', 'Images', 'images', ''],\n ['', 'Locations', 'locations', ''],\n ['', 'Parallax', 'parallax', ''],\n ['', 'Simple', 'simple', ''],\n ['', 'Social links', 'social_links', ''],\n ['', 'Text & image', 'image_text', ''],\n ['', 'Text box', 'text_box', ''],\n ['', 'Text boxes', 'text_boxes', ''],\n ];\n}", "function get_parade_locations_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Geofield', 'parade_geofield', 'Geofield'],\n ['Map markers', 'parade_location', 'Text (plain)'],\n ['Text', 'parade_text', 'Text (formatted, long)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Geofield', '- Hidden -', 'Leaflet aggregated map'],\n ['Text', '- Hidden -', 'Default'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Map markers', 'Above', 'Plain text'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Inline', 'Plain text'],\n ['Geofield', 'Above', 'Leaflet aggregated map'],\n ['Map markers', 'Above', 'Plain text'],\n ['Text', 'Above', 'Default'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_field_mapping_types() {\n return drupal_map_assoc([\n 'string',\n 'keyword',\n 'date',\n 'long',\n 'double',\n 'boolean',\n 'ip',\n 'object',\n 'nested',\n 'geo_point',\n 'geo_shape',\n 'completion',\n ]);\n}", "function get_parade_simple_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Content', 'parade_text', 'Text (formatted, long)'],\n ['Layout', 'parade_layout', 'Entity reference'],\n ['Title', 'parade_title', 'Text (plain)'],\n ['View mode', 'parade_view_mode', 'View Mode Selector'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Content', '- Hidden -', 'Default'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'inverse' => [\n ['Content'],\n ['Content', '- Hidden -', 'Default'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Layout', 'Above', 'Label'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Above', 'Plain text'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Content', 'Above', 'Default'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_text_box_paragraphs_type_data() {\n $fields = [\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Image', 'parade_image', 'Image'],\n ['Text', 'parade_text', 'Text (formatted, long)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Image', '- Hidden -', 'Image'],\n ['Text', '- Hidden -', 'Default'],\n ['Call to action', 'Above', 'Call to action'],\n ['Color scheme', 'Above', 'Label'],\n ],\n 'custom' => [\n ['Content'],\n ['Image', '- Hidden -', 'Image'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Text', '- Hidden -', 'Default'],\n ['Call to action', 'Above', 'Call to action'],\n ['Color scheme', 'Above', 'Label'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['No field is displayed.'],\n ['Call to action', 'Above', 'Call to action'],\n ['Image', 'Above', 'URL to image'],\n ['Text', 'Above', 'Default'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_social_links_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Social links', 'parade_social_link', 'Link'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Social links', '- Visually Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_images_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Images', 'parade_images', 'Image'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Images', '- Hidden -', 'Image'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Above', 'Plain text'],\n ['Images', 'Above', 'Image'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "protected function fieldmap() {\n \n $this->message(__METHOD__);\n\n // column name?\n if (($t = $this->peek()) == EPL_T_IDENTIFIER) {\n $this->map['name'] = $this->p->value;\n $this->next();\n $t = $this->peek();\n }\n\n // primitve data type?\n if ($t == EPL_T_DATA_TYPE) {\n return $this->primitive();\n }\n\n // has or composed_of?\n if ($t == EPL_T_HAS || $t == EPL_T_COMPOSED_OF) {\n return $this->relationship();\n }\n\n // error o.w.\n $this->syntax_error(\"Invalid var @orm tag: \" . $this->getInput());\n\n return false;\n }", "function get_parade_text_boxes_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Boxes', 'parade_paragraphs', 'Entity reference revisions'],\n ['Boxes per row', 'parade_boxes_per_row', 'Number (integer)'],\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Description', 'parade_text', 'Text (formatted, long)'],\n ['Layout', 'parade_layout', 'Entity reference'],\n ['Title', 'parade_title', 'Text (plain)'],\n ['View mode', 'parade_view_mode', 'View Mode Selector'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Description', '- Hidden -', 'Default'],\n ['Boxes', '- Hidden -', 'Rendered entity'],\n ['Call to action', 'Above', 'Call to action'],\n ['Anchor', 'Above', 'Plain text'],\n ['Boxes per row', 'Above', 'Unformatted'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'custom' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Boxes', '- Hidden -', 'Rendered entity'],\n ['Anchor', 'Above', 'Plain text'],\n ['Boxes per row', 'Above', 'Unformatted'],\n ['Call to action', 'Above', 'Call to action'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['Description', 'Above', 'Default'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Layout', 'Above', 'Label'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Above', 'Plain text'],\n ['Boxes per row', 'Above', 'Unformatted'],\n ['Call to action', 'Above', 'Call to action'],\n ['Boxes', 'Above', 'Rendered entity'],\n ['Description', 'Above', 'Default'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function getPType(){\n\treturn 'normal';\n}", "function get_parade_header_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Background', 'parade_background', 'File'],\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Enable parallax', 'parade_enable_parallax', 'Boolean'],\n ['Lead text', 'parade_lead_text', 'Text (plain, long)'],\n ['Slogan', 'parade_secondary_title', 'Text (plain)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Slogan', '- Hidden -', 'Plain text'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Lead text', '- Hidden -', 'Plain text'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Background', 'Above', 'URL to file'],\n ['Color scheme', 'Above', 'Label'],\n ['Enable parallax', 'Above', 'Boolean'],\n ],\n // @todo: Preview.\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_image_text_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Image', 'parade_image', 'Image'],\n ['Layout', 'parade_layout', 'Entity reference'],\n ['Text', 'parade_text', 'Text (formatted, long)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ['View mode', 'parade_view_mode', 'View Mode Selector'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Image', '- Hidden -', 'Image'],\n ['Text', '- Hidden -', 'Default'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'inverse' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Text', '- Hidden -', 'Default'],\n ['Image', '- Hidden -', 'Image'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Layout', 'Above', 'Label'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Above', 'Plain text'],\n ['Call to action', 'Above', 'Call to action'],\n ['Image', 'Above', 'URL to image'],\n ['Text', 'Above', 'Default'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "public function getTypeMapper();", "function _token_rules_map_type($type) {\r\n if (($data_type = rules_get_data_types($type)) && isset($data_type['token type'])) {\r\n return $data_type['token type'];\r\n }\r\n return $type;\r\n}", "public static function post_type(){}", "public static function fieldTypes()\n {\n $types = [\n 'label' => _MA_XMARTICLE_FIELDTYPE_LABEL,\n 'vs_text' => _MA_XMARTICLE_FIELDTYPE_VSTEXT,\n 's_text' => _MA_XMARTICLE_FIELDTYPE_STEXT,\n 'm_text' => _MA_XMARTICLE_FIELDTYPE_MTEXT,\n 'l_text' => _MA_XMARTICLE_FIELDTYPE_LTEXT,\n 'text' => _MA_XMARTICLE_FIELDTYPE_TEXT,\n 'select' => _MA_XMARTICLE_FIELDTYPE_SELECT,\n 'select_multi' => _MA_XMARTICLE_FIELDTYPE_SELECTMULTI,\n 'radio_yn' => _MA_XMARTICLE_FIELDTYPE_RADIOYN,\n 'radio' => _MA_XMARTICLE_FIELDTYPE_RADIO,\n 'checkbox' => _MA_XMARTICLE_FIELDTYPE_CHECKBOX,\n 'number' => _MA_XMARTICLE_FIELDTYPE_NUMBER\n ];\n\n return $types;\n }", "function hook_acquia_contenthub_field_type_mapping_alter(array &$mapping) {\n $mapping['my_custom_field'] = 'array<string>';\n}", "protected function getMapping($type)\n {\n switch ($type) {\n case 'article':\n return [\n 'txtArtikel' => 'name',\n 'txtshortdescription' => 'description',\n 'txtlangbeschreibung' => 'descriptionLong',\n 'txtshippingtime' => 'shippingTime',\n 'txtzusatztxt' => 'additionalText',\n 'txtkeywords' => 'keywords',\n 'txtpackunit' => 'packUnit',\n ];\n case 'variant':\n return [\n 'txtshippingtime' => 'shippingTime',\n 'txtzusatztxt' => 'additionalText',\n 'txtpackunit' => 'packUnit',\n ];\n case 'link':\n return [\n 'linkname' => 'description',\n ];\n case 'download':\n return [\n 'downloadname' => 'description',\n ];\n case 'config_countries':\n return [\n 'countryname' => 'name',\n 'notice' => 'description',\n ];\n case 'config_units':\n return [\n 'description' => 'name',\n ];\n case 'config_dispatch':\n return [\n 'dispatch_name' => 'name',\n 'dispatch_description' => 'description',\n 'dispatch_status_link' => 'statusLink',\n ];\n default:\n return false;\n }\n }", "protected abstract function generateParagraphTypeBaseFields(Row $row);", "function register_field_type_info($info)\n {\n }", "public function getDataWithTypeField() {}", "abstract protected function post_type();", "public static function getTypeMap() {\n return [\n 'charge_id' => self::FIELD_INT,\n 'user_id' => self::FIELD_INT,\n 'amount' => self::FIELD_INT,\n 'description' => self::FIELD_STRING,\n 'charge_date' => self::FIELD_EPOCH,\n 'create_date' => self::FIELD_EPOCH,\n 'update_date' => self::FIELD_EPOCH,\n ];\n }", "public function setType(){\n switch($this->security){\n case 'H':\n case 'L':\n case '0.0':\n $typeId = 2; // k-space\n break;\n case 'A':\n $typeId = 3; // a-space\n break;\n default:\n $typeId = 1; // w-space\n }\n\n /**\n * @var $type MapTypeModel\n */\n $type = $this->rel('typeId');\n $type->getById($typeId);\n $this->typeId = $type;\n }", "function getPType() {\n return 'inline';\n }", "function getParagraphsFields(): array {\n $database = \\Drupal::database();\n\n $query = $database->select('paragraphs_item_field_data', 'p');\n $query->addField('p', 'parent_type', 'parent_type');\n $query->addField('p', 'parent_field_name', 'parent_field_name');\n $result = $query->distinct()->execute()->fetchAll();\n\n return $result;\n}", "function get_field_types()\n {\n }", "protected function parseHelloFields($type)\n {\n }" ]
[ "0.65844107", "0.642111", "0.6331055", "0.6232043", "0.61252964", "0.6047966", "0.6020479", "0.60180247", "0.5920896", "0.5803017", "0.5786175", "0.57659286", "0.57164115", "0.5693756", "0.5614692", "0.5495104", "0.54725546", "0.5463364", "0.5426758", "0.5426067", "0.5420295", "0.5410994", "0.5375527", "0.53623605", "0.5354347", "0.5350357", "0.5337907", "0.53084344", "0.5306281", "0.5294976" ]
0.7100973
0
Push current batch to kinesis
public function push(array $batch) { $records = array(); foreach ($batch as $record) { $records[] = array('Data' => json_encode($record), 'PartitionKey' => uniqid(),); } $result = $this->_kinesis->putRecords(array('Records' => $records, 'StreamName' => $this->_kinesisStreamName)); \cli::log('Pushing to kinesis a batch of ' . sizeof($records) . ' records to ' . $this->_kinesisStreamName); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function push(array $batch) { \n $data = json_encode($batch);\n\n\t\t$result = $this->_lambda->invoke(array(\n\t\t\t// FunctionName is required\n\t\t\t'FunctionName' => $this->_functionName,\n\t\t\t'InvocationType' => $this->_invocationType,\n\t\t\t'LogType' => $this->_logType,\n\t\t\t'ClientContext' => base64_encode(json_encode($this->_clientContext)),\n\t\t\t'Payload' => $data,\n\t\t));\n\t\t\\cli::log('Pushing to lambda a payload of ' . sizeof($batch) . ' records to ' . $this->_functionName);\n\n return $result;\n }", "public function run()\n {\n Sp_batch::insert([\n \t\t'batch'=>'1',\n ]);\n\n Sp_batch::insert([\n \t\t'batch'=>'2',\n ]);\n\n Sp_batch::insert([\n \t\t'batch'=>'3',\n ]);\n\n Sp_batch::insert([\n \t\t'batch'=>'4',\n ]);\n\n Sp_batch::insert([\n \t\t'batch'=>'5',\n ]);\n }", "function addBatchToQueue() {\n if(count($this->_importQueueBatch) == 0) {\n return;\n }\n $queueParams = array(\n 'entity' => $this->_entity,\n 'params' => $this->_importQueueBatch,\n 'errorFileName' => $this->_errorFileName,\n );\n $task = new CRM_Queue_Task(\n array('CRM_Csvimport_Task_Import', 'ImportEntity'),\n $queueParams,\n ts('Importing entity') . ': ' . $this->_lineCount\n );\n $this->_importQueue->createItem($task);\n $this->_importQueueBatch = array();\n }", "public function pushRecord()\r\n {\r\n\r\n }", "public function start()\n {\n //Start pushing data\n }", "private function pushCurrent()\n {\n if (!empty($this->data)) {\n $this->json .= 'dataLayer.push('.json_encode($this->data).');';\n $this->data = array();\n }\n }", "function add_stream_mark($params)\n {\n $this->db->insert_batch('full_marks', $params);\n return $this->db->insert_id();\n }", "public function push();", "public function push();", "public function push(Request $request, Stream $stream)\n {\n // TODO optimize to avoid aggregate every 2 sec.\n // Create a timeseries table with current total according to constraints\n $this->authorize('broadcast', Stream::class);\n $this->authorize('update', $stream);\n\n // Same RFC, different behaviors, and dont want to rework chunk on js\n // https://w3c.github.io/media-source/webm-byte-stream-format.html\n // Firefox:\n // - Split stream by cluster with fixed size on trigger\n // - SimpleBlocks timecode counter differs on each tracks (sound and video)\n // Chrome:\n // - Clusters with infinite size that hold ~11sec that are split on trigger\n // - SimpleBlock of all tracks share the same timecode counter\n // - On push first Chunk holds the EBML header and the first Cluster\n // - On pull if you send the same first chunk and use it on appendBuffer it crashes,\n // the first chunk must always be the EBMLHeader only\n\n // TODO Stop stream if it reaches size limit\n // TODO Check if stream is in progress\n\n // Start with EBML header => look for next cluter and split\n // Not start with Cluster => look for next cluster and split by timecode, begin will be appended to last file\n // Create an handle to manage the payload\n $chunkId = $request->header('X-Chunk-Order');\n if ($chunkId <= 0) {\n // TODO Validated header\n abort('400', 'Invalid Chunk Order, must be positive');\n }\n $fStream = fopen('php://temp', 'wb');\n $chunkSize = fwrite($fStream, $request->getContent());\n rewind($fStream);\n // Get pos of first Cluster\n // Needed for Chrome, allow me flags and seeks the closest one.\n $clusterOffset = Webm::seekNextId($fStream, '1f43b675');\n rewind($fStream);\n // TODO Consistency check if possible ?\n // Chunk are ordered by client but http request may not arrive at the same time\n // Check if first bytes is the EMBL Header\n if ($chunkId == 1) {\n // Fist chunk must contains the EBMLHeader\n // TODO Parse the whole if it doesnt affects spec\n $tag = bin2hex(fread($fStream, 4));\n rewind($fStream);\n if ($tag != '1a45dfa3') {\n Log::error('stream[' . $stream->id .'] first chunk has no EBMLHeader tag');\n abort('400', 'Invalid Chunk, first chunk must hold the EBMLHeader');\n }\n $streamChunk = new StreamChunk();\n $streamChunk->stream_id = $stream->id;\n $streamChunk->chunk_id = 0;\n $streamChunk->filename = StreamChunk::getFilename($stream->id, 0, false);\n $fHeader = fopen('php://temp', 'wb');\n $streamChunk->filesize = stream_copy_to_stream($fStream, $fHeader,\n is_null($clusterOffset) ? -1 : intval($clusterOffset),\n 0);\n Storage::put($streamChunk->filename, $fHeader);\n fclose($fHeader);\n $streamChunk->save();\n Log::debug('stream[' . $stream->id .'] push header');\n // Still has cluster, set offset to 0 for next code section\n if (!is_null($clusterOffset)) {\n $clusterOffset = 0;\n }\n }\n // If not eof write chunk and flag if cluster\n if (!feof($fStream)) {\n $streamChunk = new StreamChunk();\n $streamChunk->stream_id = $stream->id;\n $streamChunk->chunk_id = $chunkId;\n $streamChunk->filename = StreamChunk::getFilename($stream->id, $chunkId, $clusterOffset);\n $streamChunk->cluster_offset = $clusterOffset;\n $fChunk = fopen('php://temp', 'wb');\n $streamChunk->filesize = stream_copy_to_stream($fStream, $fChunk);\n // Repair Chunk if wrong timecode order\n rewind($fChunk);\n if (Webm::needRepairCluster($fChunk, true)) {\n rewind($fChunk);\n $fRepaired = Webm::repairCluster($fChunk);\n Log::debug('stream[' . $stream->id .'] repair chunk ' . $chunkId);\n Storage::put($streamChunk->filename, $fRepaired);\n fclose($fRepaired);\n } else {\n Storage::put($streamChunk->filename, $fChunk);\n }\n fclose($fChunk);\n $streamChunk->save();\n Log::debug('stream[' . $stream->id .'] push chunk ' . $chunkId);\n }\n fclose($fStream);\n // Increments total_size in byte\n $stream->increment('total_size', $chunkSize);\n \n // Average Push delay of 3sec => Return views 3 sec ago\n $views = StreamChunkMetric::where([\n 'stream_id' => $stream->id,\n 'chunk_id' => max($chunkId - 1, 1)\n ])->pluck('views')->first();\n\n return response(null, 200)\n ->header('X-Views', $views);\n }", "public function store(BatchRequest $request)\n {\n $request->request->add(['created_by'=>Auth::user()->id]);\n $id=Batch::create($request->all());\n $id->classes()->attach($request->input('class_id'));\n if ($id){\n $request->session()->flash('success_message','Batch Created Successfully');\n //redirect back to batch index page\n return redirect()->route('batch.index');\n }else{\n $request->session()->flash('error_message','Batch Creation Failed');\n //redirect back to batch index page\n return redirect()->route('batch.create');\n }\n }", "public function run()\n {\n $batches = [\n [\n 'name' => '45',\n ],\n [\n 'name' => '46',\n ],\n [\n 'name' => '47',\n ],\n [\n 'name' => '48',\n ],\n [\n 'name' => '49',\n ],\n [\n 'name' => '50',\n ],\n [\n 'name' => '51',\n ],\n [\n 'name' => '52',\n ],\n [\n 'name' => '53',\n ],\n [\n 'name' => '54',\n ],\n ];\n Batch::truncate();\n Batch::insert($batches);\n }", "private function inventory_batch()\n\t{\n\t\t// load the sync db\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\n\t\t// find the most recent unprocessed shipments\n\t\t$query = ee()->sync_db->where('processed !=', '1')->order_by('id', 'asc')->get('products_inventory', 45000);\n\n\t\t// create arrays for processed inventory updates\n\t\t$ids_processed = array();\n\n\t\t// create array for the update query\n\t\t$inventory_update = array();\n\n\n\t\t// loop through each shipment\n\t\tforeach($query->result() as $inventory)\n\t\t{\n\t\t\t// add id to the processed array\n\t\t\t$ids_processed[] = $inventory->id;\n\n\t\t\t// add this update to the query\n\t\t\t$inventory_update[] = array(\n\t\t\t\t'sku' => $inventory->sku,\n\t\t\t\t'stock_level' => $inventory->quantity\n\t\t\t);\n\t\t\t\n\t\t} // end foreach\n\n\t\t// if we have records to process, update the stock levels and mark the records as processed\n\t\tif(count($ids_processed) > 0)\n\t\t{\n\t\t\t// run the update batch query\n\t\t\tee()->db->update_batch('store_stock', $inventory_update, 'sku'); \n\n\t\t\tee()->sync_db->where_in('id', $ids_processed)->set('processed', 1)->update('products_inventory');\n\t\t}\t\t\t\n\t\t\n\t}", "function add_batch($params)\n {\n $this->db->insert('batch',$params);\n return $this->db->insert_id();\n }", "public function queueItems() {\n if (!$this->read_only) {\n $this->datasource()->startTracking(array($this));\n }\n }", "public function execute() {\n $this->getQueue()->push($this->getJob(), $this->getJobOptions());\n }", "public function enqueue( $offset );", "public function push()\n {\n if ($parameters = func_get_args()) {\n $unique = false;\n\n if (count($parameters) == 3) {\n list($column, $values, $unique) = $parameters;\n } else {\n list($column, $values) = $parameters;\n }\n\n // Do batch push by default.\n if (!is_array($values)) {\n $values = [$values];\n }\n\n $query = $this->setKeysForSaveQuery($this->newQuery());\n\n $this->pushAttributeValues($column, $values, $unique);\n\n return $query->push($column, $values, $unique);\n }\n\n return parent::push();\n }", "function cps_changeset_publish_batch_entities($changeset, &$context) {\n cps_publish_changeset_entities($changeset->changeset_id);\n $context['results']['changeset'] = $changeset;\n $context['message'] = t('Publishing entities');\n $context['finished'] = TRUE;\n return $context;\n}", "public function commit()\n\t{\n\t\t$recordArray = $this->dataSet;\n\n\t\tif (count($recordArray) >= 1)\n\t\t{\n\t\t\t// Process data in batch\n\t\t\t$dataBatch\t= array();\n\t\t\t$count\t\t= 0;\n\n\t\t\tforeach ($recordArray as $k => $obj)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// Push data into array\n\t\t\t\t\tarray_push($dataBatch, $obj);\n\n\t\t\t\t\tif (count($dataBatch) == $this->batchSize)\n\t\t\t\t\t{\n\t\t\t\t\t\t$processData\t= $this->algoliaADIndex->saveObjects($dataBatch);\n\t\t\t\t\t\t$dataBatch\t\t= array();\n\t\t\t\t\t\t$count\t\t\t+= count($processData['objectIDs']);\n\n\t\t\t\t\t\tforeach ($processData['objectIDs'] as $key => $val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$processedData1[] = $val;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$processedData = $processedData1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (exception $e)\n\t\t\t\t{\n\t\t\t\t\tdie('Error occured while inserting records into Algolia! - ' . $e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Insert records in Algolia if record array is less than batchSize\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (count($dataBatch) < $this->batchSize && count($dataBatch) > 0)\n\t\t\t\t{\n\t\t\t\t\t\t$processData\t= $this->algoliaADIndex->saveObjects($dataBatch);\n\t\t\t\t\t\t$dataBatch\t\t= array();\n\t\t\t\t\t\t$count\t\t\t+= count($processData['objectIDs']);\n\n\t\t\t\t\t\tforeach ($processData['objectIDs'] as $key => $val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$processedData2[] = $val;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count($processedData1) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$processedData = array_merge($processedData1, $processedData2);\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$processedData = $processedData2;\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\treturn 'Error occured while inserting records into Algolia! - ' . $e->getMessage();\n\t\t\t}\n\n\t\treturn $processedData;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function batchExecute() {\n\n }", "function batch($batch) {\n if(!$batch['total']) return false;\n $batch['size'] = $batch['size'] ? $batch['size'] : 1;\n $batch['start'] = $batch['start'] ? $batch['start'] : 0;\n $batch['end'] =min($batch['total']-1, $batch['start'] + $batch['size'] - 1);\n $ret = array('status'=> $batch['end']>=$batch['total']-1 ? 'end' : 'next') ;\n $batch['next'] = $batch['end'] + 1;\n return xpAS::merge($batch, $ret);\n }", "public function add_batch($data) {\n\t\treturn $this->db->insert_batch($this->table, $data);\n\t}", "public function run()\n {\n//\t DB::table('sensor_readings')->insert([\n//\t \t'batch_id' => 1,\n//\t\t 'station_id' => 1,\n//\t\t 'sensor_id' => 1,\n//\t\t 'value' => 125,\n//\t ]);\n//\t DB::table('sensor_readings')->insert([\n//\t\t 'batch_id' => 2,\n//\t\t 'station_id' => 1,\n//\t\t 'sensor_id' => 1,\n//\t\t 'value' => 250,\n//\t ]);\n }", "function addToBatch($item, $values) {\n $item['rowValues'] = $values;\n $item['allowUpdate'] = $this->_allowEntityUpdate;\n $item['ignoreCase'] = $this->_ignoreCase;\n $this->_importQueueBatch[] = $item;\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }" ]
[ "0.64421576", "0.58860666", "0.5797348", "0.5692955", "0.5488409", "0.5457554", "0.5418788", "0.5239175", "0.5239175", "0.5235229", "0.5234277", "0.5188104", "0.51825935", "0.511432", "0.5087661", "0.5049727", "0.5038944", "0.50328493", "0.50093377", "0.5002154", "0.4977482", "0.49658883", "0.49316093", "0.4893761", "0.4881629", "0.4857457", "0.4857457", "0.4857457", "0.4857457", "0.4857457" ]
0.7708478
0
Student Is In Limited Rollout District For Resource
public function studentIsInLimitedRolloutDistrictForResource($studentId,$resource,$districtId = false) { if (empty($districtId)) { $districtId = $this->getIepStudentTable()->getDistrictForStudentId($studentId); } if (in_array($districtId, $this->limitedRollout[$resource]['districts'])) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIsCustomerAccessLimited(): bool;", "public function canBeManagedForCareerSubjectAllowed()\n {\n return $this->countCareerStudents() > 0;\n\n }", "public function is_student() {\n return $this->session->get(\"niveau_acces\") >= 0;\n }", "function check_in_area($moo = 0, $district = 0)\n{\n $ci =& get_instance();\n $moo = intval($moo);\n $district = intval($district);\n if ($district == 7052) { // ตำบลบ้านเกาะ\n switch ($moo) {\n case 4:\n return true;\n break;\n default:\n break;\n }\n }\n /*\n else {\n $hr = $ci->load->database('hr',true);\n $hr_db = $hr->database;\n $ps_id = $ci->session->userdata('UsPsCode');\n if($ps_id != \"\"){\n $sql = \"SELECT ps_in_area FROM `{$hr_db}`.`hr_person` WHERE ps_id = ?\";\n $query = $hr->query($sql, array($ps_id));\n if($query->row()->ps_in_area == 'Y')\n return true;\n }\n }\n */\n return false;\n}", "public function test_that_a_parent_enrollment_only_appears_once_in_students_lists()\n {\n }", "public function hasManyDisciplinarySanctions()\n {\n $subject_configuration = $this->getCurrentStudentCareerSchoolYear()->getCareerSchoolYear()->getSubjectConfiguration();\n\n if ($subject_configuration->getMaxDisciplinarySanctions() == 0)\n return false;\n\n return ($subject_configuration->getMaxDisciplinarySanctions() <= $this->countStudentDisciplinarySanctionsForSchoolYear());\n\n }", "public function authorize()\n {\n $this->validate($this->rules());\n $user = auth()->user()->first();\n $student = Student::findOrFail($this->input('student_id'));\n $staffCourse = StaffTeachCourse::findOrFail($this->input('staff_teach_course_id'));\n $semester = Semester::findOrFail($this->input('semester_id'));\n\n $school = $semester->school()->first();\n\n return (\n ($student->school()->first()->id == $school->id) &&\n ($staffCourse->school()->first()->id == $school->id)\n )\n &&\n (\n $user->hasRole(Role::ADMIN) || \n $user->hasRole([ \n Role::SCHOOL_OWNER, \n Role::DEAN, \n Role::HOD \n ], $school->id) ||\n ($user->id == $student->user_id)\n );\n }", "public function allowedToSubmitSubordinateOvertime()\n { return (($this->esgrp != 'ES') && ($this->esgrp != 'EF') && ($this->esgrp != 'F')) ? true : false;\n }", "function has_supergroup_standings() {\n return last_aggregate_roundid() !== 0;\n}", "public static function may_restrict_by_site()\n {\n return 3 == lib::create( 'business\\session' )->get_role()->tier;\n }", "public function hasUsageRights() {}", "function userCanViewStudent( $sessionID ){\r\n\t\treturn $this->getAccessLevel() > 3;\r\n\t}", "public function isAllowedToApplyLoan()\n {\n return $this->getAge() >= 18;\n }", "public static function onlineStudent(){\n $students = Roll::join('admissions','admissions.id', '=' , 'rolls.student_id' )\n ->where(['username' => Session::get('studentSession')])->first();\n \n return $students;// we will join the student with admission okay to have all his/her data's\n }", "public function authorize()\n {\n $user = auth()->user()->first();\n $department = Department::findOrFail($this->input('department_id'));\n $semester_type = SemesterType::findOrFail($this->input('semester_type_id'));\n $level = Level::findOrFail($this->input('level_id'));\n return (\n $user->can('view', $department) && \n $user->can('view', $level) &&\n $user->can('view', $semester_type)\n ) &&\n (\n $user->hasRole(Role::ADMIN) || \n ($user->id == $department->hod->first()->user()->first()->id) || // department hod\n ($user->staff()->where('id', $department->faculty()->first()->dean()->first()->id)->exists()) || // faculty dean\n ($user->id == $department->faculty()->first()->school()->first()->owner_id) // school owner\n );\n }", "function _is_staff()\n {\n $user = $this->visitor->get();\n\t\t//echo $user['ugrade'];\n\t\t//1.普通會員 2.VIP 3.Staff\n\t\tif($user['ugrade'] == 3){\n\t\t\treturn $user['ugrade'];\n\t\t}\n\t}", "public function isStudent($id){\n\t\treturn ($this->field('level',array('id'=>$id)) == 3);\n\t}", "public function authorize()\n {\n $internship = Internship::findOrFail($this->route('id'));\n $student = $internship->student;\n\n return $internship->state_id == State::CANCELED && $student->internship == null;\n }", "public function test_that_authorized_user_can_view_courses_within_other_periods()\n {\n \n }", "function userCanGetStudentInterims( $studentID ) {\r\n\t\treturn $this->userCanViewStudent('');\r\n\t}", "private function Get_Instructor_Status($instructor_id,$course_id)\n {\n $sql = \"SELECT status FROM `approval_special`\n WHERE instructor_id = \".$instructor_id. \" AND `semester_id` = \".$this->DEADLINE['id'];\n $status = 7;\n $this->DB->Change_DB($this->DEFAULT_DB);\n $result = $this->DB->Query($sql);\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n $temp_status = $result[$i]['status'];\n if($temp_status < $status)\n {\n $status = $temp_status;\n }\n }\n return $status;\n }\n else\n {\n return false;\n }\n\n }", "function getStudentByInstitutionValidate(){\n\t\t \n\t\tif(@$this->country == \"\" | @$this->institution == \"\"){\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"Both the country and institution are required!\", \"\");\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t}else{\n\t\t\t\n\t\t\t$this->basics->getStudentByInstitution( $this->sanitize($this->institution), $this->sanitize($this->country) );\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "public function canBeFree()\n {\n return count($this->getCurrentStudentCareerSchoolYear()) > 0;\n\n }", "public function authorize()\n {\n return Auth()->user()->isAbleTo('school_sections-create');\n }", "function isLider() {\n if (\\Illuminate\\Support\\Facades\\Auth::user()->rol_id == 2) {\n return true;\n } else {\n return false;\n }\n }", "public function getHasPermittedOccupiersOnly()\n {\n return $this->hasPermittedOccupiersOnly;\n }", "function add_warning_if_franchisee_in_group_with_fulltime_course () {\n global $pagenow;\n\n if ( $pagenow == 'post.php' && get_post_type() == 'groups' ) {\n\n $group_id = get_the_id();\n $group_enrolled_courses = learndash_group_enrolled_courses ( $group_id );\n \n foreach ( $group_enrolled_courses as $course ) {\n if ( in_category( 'Full Time', $course) )\n \n $group_user_ids = learndash_get_groups_user_ids ( $group_id );\n \n foreach ( $group_user_ids as $user ) {\n if ( user_can ( $user , 'subscriber' ) ) {\n \n ?>\n <div class=\"update-nag notice\">\n <p><?php _e( '<strong>WARNING: </strong>You have enrolled a full time course in a group that contains franchisees. Please ensure you mean to do this as full time courses contain content that is not geared toward franchisees.', 'my_plugin_textdomain' );?></p>\n </div>\n <?php \n\n return;\n }\n }\n }\n \n }\n}", "function is_group_at_risk( $class_id ) {\n\t$class_id = get_post_meta( $group_id, 'class', true );\n\n\treturn is_class_at_risk( $school_id );\n}", "public function allowedForOvertime()\n { return (($this->esgrp == 'ES') || ($this->esgrp == 'EF') || ($this->esgrp == 'F')) ? true : false;\n }", "public function isprojectstudent()\n {\n return $this->hasuser() && $this->user()->isprojectstudent();\n }" ]
[ "0.549815", "0.54628545", "0.54512733", "0.54237336", "0.5420256", "0.5392128", "0.53758407", "0.5322004", "0.5313787", "0.52969724", "0.5254968", "0.5203218", "0.52002764", "0.5179445", "0.51171774", "0.5114437", "0.50993866", "0.50908023", "0.5089603", "0.5064196", "0.5055533", "0.5046393", "0.50324583", "0.5019162", "0.49939606", "0.4993484", "0.497823", "0.49723667", "0.49673277", "0.49627376" ]
0.6980848
0
Set iep Student Table
public function setIepStudentTable($iepStudentTable) { $this->iepStudentTable = $iepStudentTable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIepStudentTable() {\n\t\treturn $this->iepStudentTable;\n\t}", "protected function setTable()\n {\n $class = explode('\\\\', get_called_class());\n $this->table = lcfirst(end($class)).'s';\n }", "private function setTable()\n {\n if (is_null($this->table)) {\n $this->table = $this->getTableName();\n }\n }", "protected function setTable() : void {\n\t\t$annotation = $this->annotationReader->getClassAnnotation($this->reflectionClass, 'Henri\\Framework\\Annotations\\Annotation\\DB');\n\t\tif ($annotation && isset($annotation->table)) {\n\t\t\t$this->tableName = $annotation->table;\n\t\t\t$this->tableNamePrefixed = $this->database->getPrefix() . $this->tableName;\n\t\t}\n\t}", "private function _set_table()\n\t{\n\t\t$dossier = $this->config->item('dossier');\n\t\tif($dossier === false)\n\t\t{\n\t\t\tlog_message('info', '\"Dossier\" params is not set');\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_dossier = $dossier;\n\t\t\t$this->_table = $this->_dossier . '.' . $this->_table;\n\t\t}\n\t}", "public function setTable($table);", "abstract public function setTableName();", "function setTable($table) {\r\r\n\t\t$this->table = $table;\r\r\n\t}", "public function setTable(string $table);", "public function initTable(){\n\t\t\t\n\t\t}", "protected function _initsTable() {}", "public function setTable($tablename){\r\n$this->tablename=$tablename;\r\n}", "public function setTable( $table ) {\n\t\t$this->_table = $table;\n\t}", "protected function _setTable($table)\n\t{\n\t\t$this->_table = $table;\n\t}", "public function setTable($table)\r\n {\r\n $this->table = $table;\r\n $table_title = $this->titlecase($this->table->getName());\r\n if (!empty($this->id)) {\r\n $this->title = \"Edit $table_title record $this->id\";\r\n } else {\r\n $this->title = \"Create new $table_title record\";\r\n }\r\n }", "public function setTable($table)\n\t{\n\t\t$this->table = $table;\n\t}", "public function setTable($table)\n\t{\n\t\tdebugInfo(get_class($this).\"->setTable($table)\");\n\n\t\t$this->_table = $table;\n\t}", "public function setup_table() {\n /*\n * Table has 3 columns\n *| course | final grade | rank (optional) |\n */\n\n // setting up table headers\n $tablecolumns = array('studentname', 'activityname', 'failedgrade', 'gradetopass');\n $tableheaders = array($this->get_lang_string('studentname', 'gradereport_failed'),\n $this->get_lang_string('activityname','gradereport_failed'),\n $this->get_lang_string('finalgrade', 'gradereport_failed'),\n\t\t$this->get_lang_string('gradetopass', 'gradereport_failed'));\n\t\t\n $this->table = new flexible_table('grade-report-failed-10');\n\n $this->table->define_columns($tablecolumns);\n $this->table->define_headers($tableheaders);\n $this->table->define_baseurl($this->baseurl);\n\n $this->table->set_attribute('cellspacing', '0');\n $this->table->set_attribute('id', 'failed-grade');\n $this->table->set_attribute('class', 'boxaligncenter generaltable');\n\n $this->table->setup();\n }", "public function setCurrentTable($thisTable){\n User::setTable($thisTable);\n }", "function set_entity($ent){\n $this -> table = $ent;\n }", "private function setTableName()\n {\n // Get table name from name of entity if not defined\n if (!$this->tableName) {\n $path = explode('\\\\', get_class($entity));\n $this->tableName = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', array_pop($path))).'s';\n }\n\n // Set table to be used\n $this->adapter->setTable($this->tableName);\n }", "public function set_table($table = NULL)\n\t{\n\t\t$this->_table = $table;\n\t}", "public function setTable($table) {\n\n $this->table = is_array($table) ? $table : array(self::camelCaseToUnderscore((new \\ReflectionClass($this))->getShortName()) => $table);\n\n }", "public function setTable(Table $table): void\n {\n $this->table = $table;\n }", "public function initTables(): void\n {\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.Surveys');\n $this->Surveys = $table;\n\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.SurveyResults');\n $this->SurveyResults = $table;\n\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.SurveyEntries');\n $this->SurveyEntries = $table;\n\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.SurveyEntryQuestions');\n $this->SurveyEntryQuestions = $table;\n }", "public function getStudent(int $id, string $table);", "public function set_table_vars() {\n\t\tglobal $wpdb;\n\n\t\t$this->table = $wpdb->prefix . self::TABLE_NAME;\n\t\t$this->ms_table = $wpdb->base_prefix . self::MS_TABLE_NAME;\n\n\t\t/* Register the snippet table names with WordPress */\n\t\t$wpdb->snippets = $this->table;\n\t\t$wpdb->ms_snippets = $this->ms_table;\n\n\t\t$wpdb->tables[] = self::TABLE_NAME;\n\t\t$wpdb->ms_global_tables[] = self::MS_TABLE_NAME;\n\t}", "protected function startTable() {}", "public static function table($table)\n {\n }", "public function testSetEtblSiret() {\n\n $obj = new AttestationCacm();\n\n $obj->setEtblSiret(\"etblSiret\");\n $this->assertEquals(\"etblSiret\", $obj->getEtblSiret());\n }" ]
[ "0.7341184", "0.6803989", "0.6576464", "0.64148176", "0.6394424", "0.639085", "0.6376296", "0.6376162", "0.63231975", "0.6306898", "0.6108046", "0.6101952", "0.60996073", "0.6082877", "0.6072632", "0.604061", "0.59972286", "0.5961035", "0.59591496", "0.59242123", "0.5910228", "0.58784103", "0.5877722", "0.58675814", "0.5867025", "0.58018327", "0.57991606", "0.57981795", "0.57680386", "0.5763082" ]
0.7504839
0
get Iep Student Table
public function getIepStudentTable() { return $this->iepStudentTable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStudent(int $id, string $table);", "public function getSoinHospitalisationTable() {\n\t\tif (! $this->soinhospitalisationTable) {\n\t\t\t$sm = $this->getServiceLocator ();\n\t\t\t$this->soinhospitalisationTable = $sm->get ( 'Consultation\\Model\\SoinhospitalisationTable' );\n\t\t}\n\t\treturn $this->soinhospitalisationTable;\n\t}", "public function setIepStudentTable($iepStudentTable) {\n\t\t$this->iepStudentTable = $iepStudentTable;\n\t}", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "private function get_exercise_table ()\r\n {\r\n \tif (!isset($this->exercise_table))\r\n \t{\r\n\t \t$course_info = Database :: get_course_info($this->get_course_code());\r\n\t\t\t$database_name = $course_info['db_name'];\r\n\t\t\t$this->exercise_table = Database :: get_course_table(TABLE_QUIZ_TEST, $database_name);\r\n \t}\r\n \t\treturn $this->exercise_table;\r\n }", "public function getAllStudent(){\n\n\t\treturn array(\n\t\t\t\"1\"=> new Entity_Student(1,\"pham van thao\",23,\"tlu\"),\n\t\t\t\"2\"=> new Entity_Student(2,\"pham van phen\",24,\"tlu\"),\n\t\t\t\"3\"=> new Entity_Student(3,\"pham van to\",25\"tlu\"),\n\t\t\t\"4\"=> new Entity_Student(4,\"pham van\",26,\"tlu\"),\n\n\t\t);\n\t}", "private function getStudent(){\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire.sql\";\n\n\t\t$this->result[\"liste_stagiaire\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_techno_carousel.sql\";\n\n\t\t$this->result[\"liste_techno\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_rs.sql\";\n\n\t\t$this->result[\"liste_rs\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_doc.sql\";\n\n\t\t$this->result[\"liste_doc\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t}", "function getTableNames() {\n return [\"users\" => [], \"universities\" => [\"programs\", \"scholarships\", \"costs\"], \"students\" => []];\n}", "public function getStudentInfo() {\n try {\n $this->dbh->query('SELECT * FROM student_info');\n $students = $this->dbh->resultSet();\n return $students;\n } catch(PDOException $e) {\n $this->response = [\n \"status\"=> \"error\",\n \"message\" => \"Unable to fetch all student details. Please contact the admin\"\n ];\n return $this->response;\n }\n\n }", "abstract public function getTable();", "abstract public function getTable();", "abstract protected function getTable();", "public static function getTable();", "public static function get_table() {\n\t\treturn 'antibiotics_and_how_to_use_them';\n\t}", "public function getStudent(){\n\t\t$this->load->model('School_model');\n\t\t$this->School_model->getSchoolAll();\n\t}", "function sqlStudentAll()\n\t{\n\t\t//echo '<hr>Nama class ini :' . __METHOD__ . '()<hr>';\n\t\t$sql = \"SELECT student_name,student_roll_number,student_dob,student_grade_id,student_id\"\n\t\t. \" FROM tbl_student INNER JOIN tbl_grade \"\n\t\t. \" ON tbl_grade.grade_id = tbl_student.student_grade_id \"\n\t\t. \"\";\n\n\t\treturn $sql;\n\t}", "public function getTable()\r\n {\r\n }", "public function getTable() {}", "public function getTable() {}", "public function getTable() {}", "public static function GetTableName() {\n\t\t\treturn \"person\";\n\t\t}", "public static function getTable() {}", "public static function getTable() {}" ]
[ "0.6768622", "0.64971596", "0.6475363", "0.64135695", "0.6371414", "0.6371414", "0.6371414", "0.6371414", "0.6371414", "0.6371414", "0.6371414", "0.63609564", "0.63031656", "0.62813216", "0.62593216", "0.62446684", "0.62350774", "0.62350774", "0.6219241", "0.61945415", "0.6152047", "0.6071433", "0.59864575", "0.59850615", "0.59824467", "0.59821266", "0.598091", "0.59687084", "0.5960435", "0.5960435" ]
0.8448977
0
Replaced the resource of the thumbnail with a new resource object containing the optimized image delivered by Kraken.
public function replaceThumbnailResource(Thumbnail $thumbnail, array $krakenIoResult);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function updateImgThumbnail()\n {\n //====================================================================//\n // Load Object Images List\n foreach (Image::getImages(SLM::getDefaultLangId(), $this->ProductId) as $image) {\n $imageObj = new Image($image['id_image']);\n $imagePath = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n if (!file_exists($imagePath.'.jpg')) {\n continue;\n }\n foreach (ImageType::getImagesTypes(\"products\") as $imageType) {\n $imgThumb = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n $imgThumb .= '-'.Tools::stripslashes($imageType['name']).'.jpg';\n if (!file_exists($imgThumb)) {\n ImageManager::resize(\n $imagePath.'.jpg',\n $imgThumb,\n (int)($imageType['width']),\n (int)($imageType['height'])\n );\n }\n }\n }\n }", "private function updateImgThumbnail(): void\n {\n //====================================================================//\n // Load Object Images List\n $allImages = Image::getImages(\n SLM::getDefaultLangId(),\n $this->ProductId,\n null,\n Shop::getContextShopID(true)\n );\n //====================================================================//\n // Walk on Object Images List\n foreach ($allImages as $image) {\n $imageObj = new Image($image['id_image']);\n $imagePath = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n if (!file_exists($imagePath.'.jpg')) {\n continue;\n }\n foreach (ImageType::getImagesTypes(\"products\") as $imageType) {\n $imgThumb = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n $imgThumb .= '-'.Tools::stripslashes($imageType['name']).'.jpg';\n if (!file_exists($imgThumb)) {\n ImageManager::resize(\n $imagePath.'.jpg',\n $imgThumb,\n (int)($imageType['width']),\n (int)($imageType['height'])\n );\n }\n }\n }\n }", "protected function renderResource()\n {\n $processedImageInfo = $this->imageService->processImage($this->originalAsset->getResource(), $this->adjustments->toArray());\n $this->resource = $processedImageInfo['resource'];\n $this->width = $processedImageInfo['width'];\n $this->height = $processedImageInfo['height'];\n $this->persistenceManager->whiteListObject($this->resource);\n }", "public function actualizaThumbnail()\r\n {\r\n if($thumbnail=$this->getAbosluteThumbnailPath()){\r\n if(file_exists($thumbnail)){\r\n unlink($thumbnail);\r\n }\r\n }\r\n $this->crearThumbnail();\r\n }", "public function rebuildThumb()\r\n {\r\n switch ($this->storage)\r\n {\r\n \tcase \"s3\":\r\n \r\n \t $request = \\Web::instance()->request( $this->url );\r\n \t if (empty($request['body'])) {\r\n \t throw new \\Exception('Invalid Item URL');\r\n \t }\r\n \r\n \t $buffer = $request['body'];\r\n \r\n \t break;\r\n \r\n \tcase \"gridfs\":\r\n \r\n \t $db = $this->getDb();\r\n \t $gridfs = $db->getGridFS( $this->collectionNameGridFS() );\r\n \t $length = $this->{\"length\"};\r\n \t $chunkSize = $this->{\"chunkSize\"};\r\n \t $chunks = ceil( $length / $chunkSize );\r\n \t $collChunkName = $this->collectionNameGridFS() . \".chunks\";\r\n \t $collChunks = $this->getDb()->{$collChunkName};\r\n \t \t\r\n \t $buffer = null;\r\n \t for( $i=0; $i<$chunks; $i++ )\r\n \t {\r\n \t $chunk = $collChunks->findOne( array( \"files_id\" => $this->id, \"n\" => $i ) );\r\n \t $buffer .= (string) $chunk[\"data\"]->bin;\r\n \t }\r\n \r\n \t break;\r\n \r\n \tdefault:\r\n\r\n \t throw new \\Exception('Invalid Item Storage');\r\n \t \r\n \t break;\r\n }\r\n\r\n if ( $thumb_binary_data = $this->getThumb( $buffer )) {\r\n $thumb = new \\MongoBinData( $thumb_binary_data, 2 );\r\n }\r\n \r\n $app = \\Base::instance();\r\n $files_path = $app->get('TEMP') . \"assets_thumbs\";\r\n if (!file_exists($files_path)) {\r\n mkdir( $files_path, \\Base::MODE, true );\r\n }\r\n $file_path = $files_path . '/' . $this->slug;\r\n file_put_contents( $file_path, $thumb_binary_data );\r\n \r\n return $this->set( 'thumb', $thumb )->save();\r\n }", "public function updateThumbnail()\n {\n $lastVideo = $this->videoList()->orderBy('updated_at', 'desc')->first();\n if ($lastVideo) {\n $this->thumbnail = $lastVideo->getThumbnailUrl();\n $this->save();\n }\n }", "public function reassignFeaturedImage()\n {\n\n }", "public function setThumbnailResource($thumbnailResource) {\n\t\t$this->thumbnailResource = $thumbnailResource;\n\t}", "protected function _generateThumbnail() {\n if ( $this->attributes['width'] == $this->_original_image_info[0] && $this->attributes['height'] == $this->_original_image_info[1] ) {\n $this->_calculated_width = $this->attributes['width'];\n return $this->_calculated_height = $this->attributes['height'];\n }\n if ( $this->attributes['width'] == 0 || $this->attributes['height'] == 0 ) {\n $this->_calculated_width = $this->_original_image_info[0];\n return $this->_calculated_height = $this->_original_image_info[1]; \n }\n //make sure the thumbnail directory exists. \n if ( !is_writable ( $this->thumbs_dir_path ) ) { \n trigger_error ( 'Cannot detect a writable thumbs directory!', E_USER_NOTICE );\n }\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = (int)$this->attributes['width'];\n $this->_calculated_height = (int)$this->attributes['height'];\n return $this->src = $this->_thumb_src; \n }\n // resize image\n $image = new Image();\n $image->open( $this->src, $this->thumb_background_rgb )\n ->resize( (int)$this->attributes['width'], (int)$this->attributes['height'] )\n ->save( $this->_thumb_src, (int)$this->thumb_quality );\n $this->_thumbnail = $image;\n $this->_calculated_width = $this->_thumbnail->getWidth();\n $this->_calculated_height = $this->_thumbnail->getHeight();\n $this->src = $this->_thumb_src;\n }", "public function makeThumbnail() {\n Image::make($this->filePath())->fit(200)->save($this->thumbnailPath());\n }", "public function getThumbnailResource() {\n\t\treturn $this->thumbnailResource;\n\t}", "public function updateThumbnailAuto (\n\t)\t\t\t\t\t\t// RETURNS <void>\n\t\n\t// $this->updateThumbnailAuto();\n\t{\n\t\t$coreData = Content::scanForCoreData($this->contentID, 5);\n\t\t\n\t\t// Make sure content entries has an appropriate image to set as a thumbnail\n\t\tif($coreData['mobile_url'] or $coreData['image_url'])\n\t\t{\n\t\t\t// Update the thumbnail now with the main header\n\t\t\t$chooseImage = ($coreData['mobile_url'] ? $coreData['mobile_url'] : $coreData['image_url']);\n\t\t\t\n\t\t\t// Set the image directory\n\t\t\t$srcData = Upload::fileBucketData($this->contentID, 10000);\n\t\t\t$bucketDir = '/assets/content/' . $srcData['main_directory'] . '/' . $srcData['second_directory'];\n\t\t\t$imageDir = CONF_PATH . $bucketDir;\n\t\t\t\n\t\t\tDownload::get($chooseImage, $bucketDir . '/' . $this->contentID . '-thumb.jpg');\n\t\t\t\n\t\t\t// Prepare the image that will become the thumbnail\n\t\t\t$image = new Image($imageDir . '/' . $this->contentID . '-thumb.jpg');\n\t\t\t\n\t\t\t// Resize the image to the appropriate size (320 x 180)\n\t\t\t$image->autoCrop(320, 180);\n\t\t\t\n\t\t\t// If the image needs a video cover, provide it here\n\t\t\tif($coreData['video_thumb'] and File::exists(APP_PATH . \"/assets/icons/video_icon.png\"))\n\t\t\t{\n\t\t\t\t$image->paste(APP_PATH . \"/assets/icons/video_icon.png\", 5, 5, 0, 0, 0, 0);\n\t\t\t}\n\t\t\t\n\t\t\t// Save the thumbnail image\n\t\t\t$image->save($imageDir . '/' . $this->contentID . '-thumb.jpg');\n\t\t\t\n\t\t\t// Update the value immediately\n\t\t\t$coreData['thumbnail'] = SITE_URL . $bucketDir . '/' . $this->contentID . '-thumb.jpg';\n\t\t\t\n\t\t\t// Save the thumbnail\n\t\t\tDatabase::query(\"UPDATE content_entries SET thumbnail=? WHERE id=? LIMIT 1\", array($coreData['thumbnail'], $this->contentID));\n\t\t\t\n\t\t\tAlert::info(\"Thumbnail Generated\", \"A thumbnail is being generated from your post's content.\");\n\t\t}\n\t\t\n\t\t$this->contentData['thumbnail'] = $coreData['thumbnail'];\n\t}", "protected function _generateThumbnail() {\n if ( $this->attributes['width'] == $this->_original_image_info[0] && $this->attributes['height'] == $this->_original_image_info[1] ) {\n $this->_calculated_width = $this->attributes['width'];\n return $this->_calculated_height = $this->attributes['height'];\n }\n if ( $this->attributes['width'] == 0 || $this->attributes['height'] == 0 ) {\n $this->_calculated_width = $this->_original_image_info[0];\n return $this->_calculated_height = $this->_original_image_info[1]; \n }\n //make sure the thumbnail directory exists. \n if ( !is_writable ( $this->thumbs_dir_path ) ) { \n trigger_error ( 'Cannot detect a writable thumbs directory!', E_USER_NOTICE );\n }\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = (int)$this->attributes['width'];\n $this->_calculated_height = (int)$this->attributes['height'];\n return $this->src = $this->_thumb_src; \n }\n // resize image\n $image = new Image();\n $image->open( $this->src, $this->thumb_background_rgb )\n ->resize( (int)$this->attributes['width'], (int)$this->attributes['height'] )\n ->save( $this->_thumb_src, (int)$this->thumb_quality );\n $this->_thumbnail = $image;\n $this->_calculated_width = $this->_thumbnail->getWidth();\n $this->_calculated_height = $this->_thumbnail->getHeight();\n $this->src = $this->_thumb_src;\n }", "function update_post_thumbnail_cache($wp_query = \\null)\n {\n }", "public function resolveThumbnailUrl();", "private function generateThumbnailImagick(){\n\t}", "public function withThumbnail($imagePath);", "function _createThumbnail()\r\n\t{\r\n\t\t$user=$this->auth(PNH_EMPLOYEE);\r\n\t\t$config['image_library']= 'gd';\r\n\t\t$config['source_image']= './resources/employee_assets/image/';\r\n\t\t$config['create_thumb']= TRUE;\r\n\t\t$config['maintain_ratio']= TRUE;\r\n\t\t$config['width']= 75;\r\n\t\t$config['height']=75;\r\n\r\n\t\t$this->image_lib->initialize($config);\r\n\r\n\t\t$this->image_lib->resize();\r\n\r\n\t\tif(!$this->image_lib->resize())\r\n\t\t\techo $this->image_lib->display_errors();\r\n\t}", "function recreate_thumb($image_array) {\n\tif(!file_exists($image_array[\"image_thumb_path\"])) {\n\t\t@require_once(__CHV_PATH_CLASSES__.'class.imageresize.php');\n\t\t$thumb = new ImageResize($image_array[\"image_path\"], $image_array[\"image_thumb_path\"], chevereto_config('thumb_width'), chevereto_config('thumb_height'), true);\n\t}\n}", "public static function save($file, $thumb = true) {\n\t\t// Yii::info($file);\n\n\t\tself::$source_path = $file->tempName;\n\n\t\t$file_name = self::generateFileName($file);\n\n\t\tif ($thumb) {\n\t\t\t// self::generateThumbnail(self::TMB_BIG);\n\t\t\t$tmb_medium = self::generateThumbnail(self::TMB_MEDIUM);\n\t\t\t$tmb_extra_small = self::generateThumbnail(self::TMB_EXTRA_SMALL);\n\t\t\t$tmb_small = self::generateThumbnail(self::TMB_SMALL);\n\t\t}\n\n\t\t$original = self::saveOriginImage($file);\n\n\t\t// Yii::info(\"original\");\n\t\t// Yii::info($original);\n\n\t\t$manager = \\Yii::$app->resourceManager;\n\t\t// Yii::info(\"manager\");\n\t\t// Yii::info($manager);\n\n\t\t// Yii::info(\"manager->bucket\");\n\t\t// Yii::info($manager->bucket);\n\t\t// Yii::info(\"file_name\");\n\t\t// Yii::info($file_name);\n\n\t\t$options = [\n\t\t\t'Bucket' => $manager->bucket,\n\t\t\t'Key' => 'images/' . $file_name,\n\t\t\t'SourceFile' => $original,\n\t\t\t'ACL' => CannedAcl::PUBLIC_READ,\n\t\t];\n\t\t// Yii::info(\"options\");\n\t\t// Yii::info($options);\n\t\t$manager->getClient()->putObject($options);\n\n\t\t// Yii::info(\"options origin\");\n\n\t\t$options['Key'] = 'images/thumbs/' . basename($tmb_small);\n\t\t$options['SourceFile'] = $tmb_small;\n\t\t$manager->getClient()->putObject($options);\n\n\t\t// Yii::info(\"options small\");\n\n\t\t$options['Key'] = 'images/thumbs/' . basename($tmb_extra_small);\n\t\t$options['SourceFile'] = $tmb_extra_small;\n\t\t$manager->getClient()->putObject($options);\n\t\t// Yii::info(\"options extra small\");\n\n\t\t$options['Key'] = 'images/thumbs/' . basename($tmb_medium);\n\t\t$options['SourceFile'] = $tmb_medium;\n\t\t$manager->getClient()->putObject($options);\n\t\t// Yii::info(\"options medium\");\n\n\t\t/* $options['Key'] = 'images/thumbs/'.basename($tmb_big);\n\t\t\t $options['SourceFile'] = $tmb_big;\n\t\t*/\n\n\t\t@unlink($original);\n\t\t@unlink($tmb_small);\n\t\t@unlink($tmb_extra_small);\n\t\t@unlink($tmb_medium);\n\t\t// @unlink($tmb_big);\n\n\t\t// Yii::info(\"before return\");\n\t\t// Yii::info(\"file_name\");\n\t\t// Yii::info($file_name);\n\t\treturn self::$file_name;\n\t}", "public function setThumbnail($id) {\n\t\t$result = $this->read(null, $id);\n\t\t$result = $result[$this->alias];\n\t\t$this->CatalogItem->save([\n\t\t\t'id' => $result['catalog_item_id'],\n\t\t\t'filename' => $result['filename'],\n\t\t], ['callbacks' => false, 'validate' => false]);\n\t\treturn $this->updateAll(array(\n\t\t\t$this->escapeField('thumb') => 0,\n\t\t), array(\n\t\t\t$this->escapeField('catalog_item_id') => $result['catalog_item_id'],\n\t\t\t$this->escapeField($this->primaryKey) . ' <>' => $id\n\t\t));\n\t}", "public function autoRegisterThumb200()\n {\n $this->getMediaCollections()->filter->isImage()->each(function ($mediaCollection) {\n $this->addMediaConversion('thumb_200')\n ->width(200)\n ->height(200)\n ->fit('crop', 200, 200)\n ->optimize()\n ->performOnCollections($mediaCollection->getName())\n ->nonQueued();\n });\n }", "protected function _create_cached()\n {\n if($this->url_params['c'])\n {\n // Resize to highest width or height with overflow on the larger side\n $this->image->resize($this->url_params['w'], $this->url_params['h'], Image::INVERSE);\n\n // Crop any overflow from the larger side\n $this->image->crop($this->url_params['w'], $this->url_params['h']);\n }\n else\n {\n // Just Resize\n $this->image->resize($this->url_params['w'], $this->url_params['h']);\n }\n\n // Apply any valid watermark params\n $watermarks = Arr::get($this->config, 'watermarks');\n if ( ! empty($watermarks))\n {\n foreach ($watermarks as $key => $watermark)\n {\n if (key_exists($key, $this->url_params))\n {\n $image = Image::factory($watermark['image']);\n $this->image->watermark($image, $watermark['offset_x'], $watermark['offset_y'], $watermark['opacity']);\n }\n }\n }\n\n // Save\n if($this->url_params['q'])\n {\n //Save image with quality param\n $this->image->save($this->cached_file, $this->url_params['q']);\n }\n else\n {\n //Save image with default quality\n $this->image->save($this->cached_file, Arr::get($this->config, 'quality', 80));\n }\n }", "function drush_islandora_dss_large_image_clean_thumbnails($collection, $thumbnail_placeholder_path = 'files/placeholder_tn.jpg') {\n\n module_load_include('inc', 'islandora_large_image', 'includes/derivatives');\n\n $result = FALSE;\n $tuque = islandora_get_tuque_connection(user_load(1));\n $solr_results = islandora_dss_basic_collection_get_objects_solr($collection);\n\n foreach($solr_results['response']['docs'] as $solr_doc) {\n\n $object = islandora_object_load($solr_doc['PID']);\n\n if(!$object) {\n\n drush_log('Solr Document for ' . $solr_doc['PID'] . 'must be updated', 'warning');\n continue;\n }\n \n if(isset($object['TN'])) {\n\n $thumbnail_content = $object['TN']->content;\n \n $thumbnail_checksum = md5($thumbnail_content);\n if(md5_file(drupal_get_path('module', 'islandora_dss') . '/' . $thumbnail_placeholder_path) == $thumbnail_checksum) {\n\n\t// Regenerate the thumbnail for the Object\n\t// @see islandora_large_image_create_all_derivatives()\n\n\tdrush_log('Cleaning the thumbnail for ' . $object->id, 'ok');\n\n\t$base_name = str_replace(':', '-', $object->id);\n\t$uploaded_file = islandora_large_image_get_uploaded_file($object, $base_name);\n\t$tn = islandora_large_image_create_TN_derivative($object, $uploaded_file, $base_name) and file_unmanaged_delete($uploaded_file);\n\n\tif(!$tn) {\n\n\t drush_log('Failed to clean the thumbnail for ' . $object->id, 'error');\n\t} else {\n\n\t drush_log('Successfully cleaned the thumbnail for ' . $object->id, 'success');\n\t}\n\n\t$result = $result and $tn;\n }\n }\n }\n\n return $result;\n}", "public function test_comicEntityIsCreated_thumbnail_setThumbnail()\n {\n $sut = $this->getSUT();\n $thumbnail = $sut->getThumbnail();\n $expected = Thumbnail::create(\n 'http://i.annihil.us/u/prod/marvel/i/mg/c/30/4fe8cb51f32e0',\n 'jpg'\n );\n\n $this->assertEquals($expected, $thumbnail);\n }", "public function save() {\n// is there an image resource and file location to work with?\n if (isset($this->_resource, $this->_file_location)) {\n switch ($this->_mimetype) {\n case \"image/jpeg\":\n imagejpeg($this->_resource, $this->_file_location);\n break;\n case \"image/png\":\n imagepng($this->_resource, $this->_file_location);\n break;\n case \"image/gif\":\n imagegif($this->_resource, $this->_file_location);\n break;\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::save() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "function make_thumb($src,$dest) {\n try {\n // Create a new SimpleImage object\n $image = new \\claviska\\SimpleImage();\n\n // load file\n $image->fromFile($src);\n // img getMimeType\n $mime = $image->getMimeType();\n $w = $image->getWidth();\n\n // Manipulate it\n // $image->bestFit(200, 300) // proportionally resize to fit inside a 250x400 box\n // $image->flip('x') // flip horizontally\n // $image->colorize('DarkGreen') // tint dark green\n // $image->sharpen()\n // $image->border('darkgray', 1) // add a 2 pixel black border\n // $image->overlay('flag.png', 'bottom right') // add a watermark image\n // $image->toScreen(); // output to the screen\n if ($w > 1000) {\n $image->autoOrient(); // adjust orientation based on exif data\n // $image->resize($resizeWidth); // 1365\n // $image->resize(1024); // 1365\n $image->resize(800); // 1067\n }\n $image->toFile($dest,$mime,$outIMGquality);\n // echo \"mime type: \".$mime;\n } catch(Exception $err) {\n // Handle errors\n echo $err->getMessage();\n }\n}", "protected function saveImage()\n {\n if ( $this->initialImage != $this->image )\n {\n $this->deleteOldImage();\n\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n $imageHandler->save($this->getImagesFolder( TRUE ) . $imageHandler->getBaseFileName() );\n\n $settings = $this->getThumbsSettings();\n\n if ( !empty( $settings ) )\n {\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n\n foreach( $settings as $prefix => $dimensions )\n {\n list( $width, $height ) = $dimensions;\n $imageHandler\n ->thumb( $width, $height )\n ->save( $this->getImagesFolder( TRUE ) . $prefix . $imageHandler->getBaseFileName() );\n }\n }\n\n @unlink( $this->getTempFolder( TRUE ) . $this->image );\n }\n }", "public function reflectionAction()\n {\n $image = __DIR__ . '/../../../data/media/test.jpg';\n $reflection = $this->thumbnailer->createReflection(40, 40, 80, true, '#a4a4a4');\n $thumb = $this->thumbnailer->create($image, [], [$reflection]);\n\n $thumb\n ->resize(200, 200)\n ->show()\n ->save('public/resized_test.jpg');\n\n return false;\n }", "public function updateThumbnail(Request $request, $slug)\n {\n $request->validate([\n 'thumbnail' => 'required|image|mimes:jpeg,png,jpg,gif|max:2048',\n ]);\n\n $ingredient = Ingredient::where('slug',$slug)->first();\n\n if (!$ingredient) {\n return response()->json(['error' => 'Ingredient not found'], 404);\n }\n\n if ($ingredient->thumbnail) {\n Storage::delete($ingredient->thumbnail);\n $ingredient->thumbnail = null;\n }\n\n $thumbnailName = $ingredient->slug.'_thumbnail'.time().'.'.request()->thumbnail->getClientOriginalExtension();\n\n $thumbnailsPath = $request->thumbnail->storeAs('thumbnails',$thumbnailName);\n\n $thumbnail = Image::make(Storage::get($thumbnailsPath));\n\n $thumbnail->fit(400, 400, function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n });\n\n $thumbnail->save('storage/' . $thumbnailsPath);\n\n $ingredient->thumbnail = $thumbnailsPath;\n $ingredient->save();\n\n return response()->json($ingredient)->setStatusCode(200);\n }" ]
[ "0.65871066", "0.64330494", "0.64221925", "0.64045274", "0.6317264", "0.62773347", "0.6200119", "0.6029603", "0.6016328", "0.5985591", "0.5980453", "0.5964642", "0.5884409", "0.57325476", "0.5724037", "0.5697381", "0.56903577", "0.5686293", "0.56613356", "0.56558", "0.56396544", "0.56248254", "0.562238", "0.56178343", "0.5591632", "0.5589657", "0.55673873", "0.5550977", "0.5523933", "0.5511471" ]
0.7600771
0
/ This will update the spouse record
public function update_spouce() { $this->is_access('Employer'); foreach ($_POST as $key=>$value) { $p[$key] = $this->linkID->real_escape_string($value); } if ($p['FirstName'] == "") { $err = "1"; } if ($p['LastName'] == "") { $err = "1"; } if ($p['EmailAddress'] == "") { $err = "1"; } if ($err == "1") { print "<br><font color=red>One of the required fields was empty. You must enter in at least the first name, last name and email address. The email address must not be the same as the employee.</font><br><br>"; } $sql = "SELECT `employeeID` FROM `spouse` WHERE `employeeID` = '$p[employeeID]'"; $result = $this->new_mysql($sql); while ($row = $result->fetch_assoc()) { $found = "1"; } if ($found == "1") { // update if ($p['SSN'] != "") { $ssn = ",`SSN` = '$p[SSN]'"; } $sql = "UPDATE `spouse` SET `FirstName` = '$p[FirstName]', `MiddleName` = '$p[MiddleName]', `LastName` = '$p[LastName]', `Gender` = '$p[Gender]', `DOB` = '$p[DOB]', `EmailAddress` = '$p[EmailAddress]', `PhoneNumber` = '$p[PhoneNumber]', `Street` = '$p[Street]', `City` = '$p[City]', `State` = '$p[State]', `PostalCode` = '$p[PostalCode]', `WorkLocationCode` = '$p[WorkLocationCode]', `WorkLocationDescription` = '$p[WorkLocationDescription]' $ssn WHERE `employeeID` = '$p[employeeID]' "; } else { // insert $sql = "INSERT INTO `spouse` (`employeeID`,`FirstName`,`MiddleName`,`LastName`,`SSN`,`Gender`,`DOB`,`EmailAddress`,`PhoneNumber`, `Street`,`City`,`State`,`PostalCode`,`WorkLocationCode`,`WorkLocationDescription`) VALUES ('$p[employeeID]','$p[FirstName]','$p[MiddleName]','$p[LastName]','$p[SSN]','$p[Gender]', '$p[DOB]','$p[EmailAddress]','$p[PhoneNumber]','$p[Street]','$p[City]','$p[State]','$p[PostalCode]',$p[WorkLocationCode],'$p[WorkLocationDescription]')"; } $result = $this->new_mysql($sql); if ($result == "TRUE") { print "<br><font color=green>The record was saved. Loading...</font><br>"; } else { print "<br><font color=red>The record failed to update. Loading...</font><br>"; } ?> <script> setTimeout(function() { document.location.href='employer.php?section=employees'; } ,2000); </script> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateRecord() \n {\n $str = \"Id = :Id\";\n array_walk($this->arrayKeysValues(), function ($value, $key) use (&$str) {\n $str .= \", $key = :$key\";\n });\n $sql = sprintf(\"UPDATE Cubans SET %s WHERE Id = :Id\", $str);\n $statement = $this->connect->prepare($sql);\n $statement->execute(array_merge([\":Id\" => $this->id], $this->arrayKeysValues()));\n }", "public function testUpdatePayslipByID()\n {\n }", "public function update(): void\n {\n $this->updateQuality();\n $this->updateSellIn();\n $this->expiresAfterSale();\n }", "public function Update()\n\t{\n\t\t$prefix = $this->Db->TablePrefix;\n\t\t$user = GetUser();\n\t\t$userid = $user->userid;\n\t\t$where = 'id = ' . $this->id;\n\n\t\t$surveys_data = $this->data;\n\n\t\tif (isset($surveys_data['_columns'])) {\n\t\t\tunset($surveys_data['_columns']);\n\t\t}\n\n\t\tif (isset($surveys_data['id'])) {\n\t\t\tunset($surveys_data['id']);\n\t\t}\n\n\t\t$surveys_data['updated'] = $this->GetServerTime();\n\n\t\t$this->Db->UpdateQuery('surveys', $surveys_data, $where);\n\t}", "public function update() {\n global $DB;\n $record = array(\n 'sortorder' => $this->sortorder,\n 'criterion' => $this->criterion,\n 'addinfo' => json_encode($this->addinfo)\n );\n if ($this->id) {\n $record['id'] = $this->id;\n $DB->update_record($this->get_table_name(), $record);\n } else {\n $record['instantquizid'] = $this->instantquiz->id;\n $this->id = $DB->insert_record($this->get_table_name(), $record);\n }\n }", "public function update() {\n\t\tTournamentDBClient::update($this);\n\t}", "public function testUpdatePayslip()\n {\n }", "protected function update()\n\t{\n\t\t//append ID to fields\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tupdate Booth\n\t\t\tset BoothNum = ?\n\t\t\twhere BoothID = ?\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "protected function update() {}", "public function update($record);", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "protected function saveUpdate()\n {\n }", "public function update(Request $request)\n {\n $vote=UserParticipatesParty::find($request->id);\n $track = Track::where('id',$vote->vote)->first();\n $track->votes -=1;\n $track->save();\n $request->track_id;\n $track = Track::find($request->track_id);\n $track->votes += 1;\n $track->save();\n $vote->vote=$request->track_id;\n $vote->save();\n return redirect()->back()->with('success','vote changed successfully');\n }", "function updateSponsor($aff_id)\n\t\t{\t\n\t\t\t/*\n\t\t\t\techo \"<pre>\";\n\t\t\t\tprint_r($this->Sponsor);\n\t\t\t\tdie();\n\t\t\t*/\t\n\t\t\t\n\t\t\t$query = \" update tbl_sponsors set`sponsor_name`= '\".$this->Sponsor->sponsor_name.\"',\n\t\t\t`sponsor_description` = '\".$this->Sponsor->sponsor_description.\"',\n\t\t\t`sponsor_url` = '\".$this->Sponsor->sponsor_url.\"' \t\t\t\t\t \n \t\t\t where `affiliate_id` = \".$aff_id.\" and id = \".$this->Sponsor->id;\n\t\t\t\t\t \t\n\t\t\t\t\t \n\t\t\t$response = $this->Execute($query);\n\t\t\treturn $response;\n\t\t}", "protected function _update()\n\t{\n\t}", "public function handbks_object_counts_update() {\n $this->db->query(\"call handbks_object_counts_update();\");\n }", "protected function updateObject()\n {\n $gatewayData = $this->encodeDataToJson();\n\n $query = $this->db->getQuery(true);\n\n $query\n ->update($this->db->quoteName(\"#__crowdf_intentions\"))\n ->set($this->db->quoteName(\"user_id\") . \"=\" . $this->db->quote($this->user_id))\n ->set($this->db->quoteName(\"project_id\") . \"=\" . $this->db->quote($this->project_id))\n ->set($this->db->quoteName(\"reward_id\") . \"=\" . $this->db->quote($this->reward_id))\n ->set($this->db->quoteName(\"unique_key\") . \"=\" . $this->db->quote($this->unique_key))\n ->set($this->db->quoteName(\"gateway\") . \"=\" . $this->db->quote($this->gateway))\n ->set($this->db->quoteName(\"gateway_data\") . \"=\" . $this->db->quote($gatewayData))\n ->set($this->db->quoteName(\"auser_id\") . \"=\" . $this->db->quote($this->auser_id))\n ->set($this->db->quoteName(\"session_id\") . \"=\" . $this->db->quote($this->session_id))\n ->where($this->db->quoteName(\"id\") .\"=\". (int)$this->id);\n\n $this->db->setQuery($query);\n $this->db->execute();\n }", "public function update() {\n // Get the values that are currently in the database\n $curr_vals = $this->read_single();\n\n // Set the values that will be added to the table\n foreach ($curr_vals as $key => $value) {\n // Convert key from the Database's capitalization to\n // this model's attribute capitalization style (all lowercase)\n $local_key = strtolower($key);\n // If user didn't specify property\n if (($this->attr[$local_key] === \"\") || ($this->attr[$local_key] === null)){\n // Then use the value that's already in the database\n $this->attr[$local_key] = $curr_vals[$key];\n }\n }\n\n // Create query\n $query = \"UPDATE \" . $this->table .\n \" SET = \" .\n \" WHERE MID = :mid AND Spot = :spot \";\n\n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Clean the data (reduce malicious SQL injection, etc.)\n foreach ($this->attr as $key => $value) {\n $this->attr[$key] = htmlspecialchars(strip_tags($value));\n }\n \n // Bind the data to a variable for an SQL attribute\n foreach ($this->attr as $key => $value) {\n $stmt->bindValue((\":\" . $key), $value);\n }\n\n // Execute the prepared statement and check for errors in running it\n return $this->runPrepStmtChkErr($stmt);\n }", "private function updatebivapoints(){\n\t\t$Note='Referred '.$this->session->userdata('referemail').' And earned 100 Biva Points.';\n\t\t$this->db->where('ReferedTo', $this->session->userdata('referemail'));\n\t\t$this->db->where('UniqueKey', $this->session->userdata('referkey'));\n\t\t$object=array(\n\t\t\t'EarnedPotint' => 100,\n\t\t\t'UniqueKey' => null,\n\t\t\t'Note' => $Note\n\t\t);\n\t\t$this->db->update('tbl_bvpoint_data', $object);\n\t}", "public function update()\r\n {\r\n \r\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",comments=\\\"$this->comments\\\",price=\\\"$this->price\\\",brand=\\\"$this->brand\\\",model=\\\"$this->model\\\",y=\\\"$this->y\\\",link=\\\"$this->link\\\",in_existence=\\\"$this->in_existence\\\",is_public=\\\"$this->is_public\\\",is_featured=\\\"$this->is_featured\\\",category_id=\\\"$this->category_id\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function db_update() {}", "function roshine_update_instance(stdClass $roshine, mod_roshine_mod_form $mform = null) {\n global $DB;\n $roshine->timemodified = time();\n //$old = $DB->get_record('roshine', array('id' => $roshine->instance));\n $roshine->id = $roshine->instance;\n return $DB->update_record('roshine', $roshine);\n}", "public function api_update_price(){\n $watchlists = $this->wr->all();\n foreach($watchlists as $watchlist)\n {\n $current_price = $this->get_quotes($watchlist->id);\n\n $this->wr->update([\n 'current_price' => $current_price,\n ],$watchlist->id);\n }\n }", "public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }", "protected function update()\n\t{\n\t\t$this->autofill();\n\n\t\t$query = $this->connection->prepare (\"call UpdateProjectBooth (?, ?)\");\n\t\t$query->execute ([$this->fields['ID'], $this->fields['BoothID']]);\n\n\t\t$booth = $this->fields['BoothID'];\n\t\tunset ($this->fields['BoothID']);\n\n\t\tparent::update();\n\n\t\t$this->fields['BoothID'] = $booth;\n\n\t}", "public function testUpdateFinancialStatementUsingPut()\n {\n }", "function updateRecord($id, $name, $position, $team, $age, $dateofarticle, $projdraftround, $injsus, $href, $newssrc, $notes, $status)\n\t {\n\t\t //open database connection\n\t\t $conn = $this->openDBConnection();\n\t\t\t\n\t\t\t//update record in database\n\t\t\t$query = \"UPDATE players SET\n \t\tname='$name', \n\t\t\t\t\tposition='$position',\n\t\t\t\t\tteam='$team',\n\t\t\t\t\tage='$age',\n\t\t\t\t\tdateofarticle='$dateofarticle',\n\t\t\t\t\tprojdraftround='$projdraftround',\n\t\t\t\t\tinjsus='$injsus',\n\t\t\t\t\thref='$href',\n\t\t\t\t\tnewssrc='$newssrc',\n\t\t\t\t\tnotes='$notes',\n\t\t\t\t\tstatus='$status'\n\t\t WHERE id = {$id}\";\n\t\t\n\t\t \n\t\t\tif(mysqli_query($conn, $query))\n\t\t\t{\n\t\t\t\t//echo '<script type=\"text/javascript\">eval(alert(\"Success, '.$name.'\\'s record has been updated. You will be notified on '.$this->createTargetDate($timespan).' to contact this person!\"));</script>';\n\t\t\t\t//header('Location: http://localhost/FantasyFootballDraft/');\n\t\t\t} else {\n\t\t\t echo 'Error: '. mysqli_error($conn);\t\n\t\t\t}\n\t\t\t\n\t\t\t//close connection\n\t\t mysqli_close($conn);\n\t\t \n\t }" ]
[ "0.63101494", "0.6292979", "0.6247507", "0.618097", "0.6126672", "0.61176276", "0.60786355", "0.607109", "0.6051283", "0.60393834", "0.60336477", "0.59947497", "0.59947497", "0.5969813", "0.59694123", "0.59678423", "0.5932604", "0.59278655", "0.59210503", "0.5894399", "0.5892642", "0.5851993", "0.5842729", "0.5826514", "0.5803183", "0.57982546", "0.5785615", "0.5779474", "0.5763204", "0.5762774" ]
0.6616405
0
/ This function will return the smarty object for mmm module.
public static function createSmartyObject() { $appModuleArr["app"] = MmmUtility::mmmAppName; $appModuleArr["module"] = MmmUtility::mmmModuleName; $appModuleArr["useUploads"] = 1; $smarty = JsCommon::getSmartySettings('appModule',$appModuleArr); return $smarty; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSmarty()\n {\n $this->registerFilters();\n $this->registerPlugins();\n $this->smarty->assign($this->getGlobals());\n\n return $this->smarty;\n }", "static public function getSmarty()\n\t{\n\t\t$smarty = new Smarty();\n\n\t\t$smarty->template_dir = LOCAL_DOCUMENT_ROOT.\"/view/\";\n\t\t$smarty->compile_dir = LOCAL_DOCUMENT_ROOT.\"/view_c/\";\n\t\t//$smarty->config_dir = '/web/www.example.com/guestbook/configs/';\n\t\treturn $smarty;\n\t}", "public function loadSmarty()\r\n {\r\n // Load the Smarty machine\r\n require_once APPLICATION_PATH . '/../library/Smarty/Smarty.class.php';\r\n $smarty = new Smarty();\r\n\r\n $smarty->template_dir = APPLICATION_PATH . '/views/templates';\r\n $smarty->compile_dir = APPLICATION_PATH . '/views/templates_c';\r\n $smarty->cache_dir = APPLICATION_PATH . '/views/cache';\r\n $smarty->config_dir = APPLICATION_PATH . '/views/configs';\r\n\r\n return $smarty;\r\n }", "protected function _smarty()\n\t{\n\t\tif (! $this->_smarty instanceof Smarty ) {\n\t\t\t// build me a smarty object fool\n\t\t\t$this->_smarty = new Smarty();\n\t\t\t\n\t\t\t// Set the predefined parameters\n\t\t\t$this->setParams($this->_smartyParams);\n\t\t\t\n\t\t\t// Set the predefined methods\n\t\t\t$this->_callSmartyMethods();\n\t\t\tunset($this->_smartyParams, $this->_smartyMethods);\n\t\t\t// Set the smarty as a property\n\t\t\t// $this->_smarty = $smarty;\n\t\t}\n\t\t\n\t\treturn $this->_smarty;\n\t}", "function getSmartyTemplate() {\n\t\t\n\t\t/* Call in Smarty to display template */\n\t\tbfLoad ( 'bfSmarty' );\n\t\t\n\t\t/* @var $tmp bfSmarty */\n\t\t$tmp = bfSmarty::getInstance ( 'com_form' );\n\t\t$tmp->_setTemplatePath ( dirname ( __FILE__ ) . DS . strtolower ( $this->_FORM_CONFIG ['layout'] ) );\n\t\t\n\t\t/* set the head data into the Joomla JDocument or J1.0.x equivilent */\n\t\t$this->_setHeadData ();\n\t\t\n\t\t/* set form title H1 */\n\t\tif ($this->_FORM_CONFIG ['page_title'])\n\t\t\t$tmp->assign ( 'PAGE_TITLE', $this->_FORM_CONFIG ['page_title'] );\n\t\t\t\n\t\t/* get the Form tag and add to template as {FORM_OPENTAG}*/\n\t\t$tmp->assign ( 'FORM_OPEN_TAG', $this->onGetFormHead () );\n\t\t$tmp->assign ( 'FORM_CLOSE_TAG', $this->onGetFormFooter () );\n\t\t$tmp->assign ( 'FORM_ID', $this->_FORM_CONFIG ['id'] );\n\t\t\n\t\t/* failed validation */\n\t\tif (@defined ( '_BF_FAILED_VALIDATION' )) {\n\t\t\t$tmp->assign ( 'FAIL_VALIDATION', true );\n\t\t\t$messages = unserialize ( _BF_FAILED_VALIDATION_MESSAGES );\n\t\t\t$tmp->assign ( 'fail_messages', $messages );\n\t\t\n\t\t}\n\t\t\n\t\tif (isset ( $this->_FORM_CONFIG ['onlyssl'] ) && $this->_FORM_CONFIG ['onlyssl'] == 1) {\n\t\t\t$tmp->assign ( 'SECURE_FORM', '1' );\n\t\t}\n\t\treturn $tmp;\n\t}", "public function getEngine()\r\n {\r\n return $this->_smarty;\r\n }", "public function getEngine()\n {\n return $this->_smarty;\n }", "public function getEngine()\n {\n return $this->smarty;\n }", "public function getEngine()\n {\n return $this->_smarty();\n }", "private function initSmarty() {\n \n require_once (Quantum::QUANTUM_ROOT.'system/lib/smarty/Smarty.class.php');\n \n $smarty = new Smarty();\n $smarty ->template_dir = Quantum::QUANTUM_ROOT.\"system/views\";\n $smarty->compile_dir = Quantum::QUANTUM_ROOT.\"system/tmp\";\n $smarty->allow_php_tag = true;\n $smarty->plugins_dir[] = Quantum::QUANTUM_ROOT.'system/plugins';\n \n Quantum\\Output::init($smarty);\n }", "function __construct(){\r\n $this->tpml_control = new \\Smarty();\r\n }", "private function loadSmarty()\n {\n }", "private function _loadSmarty()\r\n {\r\n if (!class_exists('Smarty', true)) {\r\n require_once 'Smarty/Smarty.class.php';\r\n }\r\n\r\n $this->_smarty = new Smarty();\r\n\r\n if ($this->_config === null) {\r\n throw new Zend_View_Exception(\r\n \"Could not locate Smarty config\"\r\n );\r\n }\r\n\r\n $this->_smarty->caching\r\n = $this->_config['caching'];\r\n $this->_smarty->cache_lifetime\r\n = $this->_config['cache_lifetime'];\r\n $this->_smarty->template_dir\r\n = $this->_config['template_dir'];\r\n $this->_smarty->compile_dir\r\n = $this->_config['compile_dir'];\r\n $this->_smarty->config_dir\r\n = $this->_config['config_dir'];\r\n $this->_smarty->cache_dir\r\n = $this->_config['cache_dir'];\r\n $this->_smarty->left_delimiter\r\n = $this->_config['left_delimiter'];\r\n $this->_smarty->right_delimiter\r\n = $this->_config['right_delimiter'];\r\n $this->assign('this', $this);\r\n }", "public function getModuleTemplate() {}", "public function getModuleTemplate() {}", "protected static function createSmarty()\n\t{\n\t\tstatic::$smarty = new \\Smarty();\n\n\t\t// Set folder paths templates\n\t\tstatic::$smarty->setCompileDir(PATH_COMPILE);\n\n\t\t// Set folder path caches\n\t\tstatic::$smarty->setCacheDir(PATH_CACHE);\n\n\t\t// Make the compilation when a change is made in the debug mode\n\t\tstatic::$smarty->setCompileCheck(DEBUG);\n\n\t\t// Configure global variables\n\t\tstatic::$smarty->assign('root', Server::getBaseUrl());\n\n\t\t// Register special function for Smarty\n\t\tstatic::$smarty->registerClass(\"Login\", \"User\\\\Login\");\n\t\tstatic::$smarty->registerPlugin(\"function\", \"plural\", array('Template\\TemplatePlugin', 'pluginPlural'));\n\t\tstatic::$smarty->registerPlugin(\"modifier\", \"security\", array('Template\\TemplatePlugin', 'pluginSecurity'));\n\t\tstatic::$smarty->registerPlugin(\"modifier\", \"number\", array('Template\\TemplatePlugin', 'pluginFormatNumber'));\n\t\tstatic::$smarty->registerPlugin(\"function\", \"date\", array('Template\\TemplatePlugin', 'pluginDate'));\n\t\tstatic::$smarty->registerPlugin(\"function\", \"conditional\", array('Template\\TemplatePlugin', 'pluginConditional'));\n\t\tstatic::$smarty->registerPlugin(\"function\", \"link\", array('Template\\TemplatePlugin', 'pluginLink'));\n\t\tstatic::$smarty->registerPlugin(\"modifier\", \"time\", array('Template\\TemplatePlugin', 'pluginTime'));\n\t}", "function ju_module_m():MM {return ju_o(MM::class);}", "function createSmartyInstance($installDir, $tmpDir)\n{\n global $optionInfo;\n $smarty = new Smarty();\n\n /* Set each directory */\n $smarty->caching = Smarty::CACHING_OFF;\n $smarty->compile_check = false;\n $smarty->setTemplateDir(joinPathComponents($installDir, \"pg_stats_reporter_lib/template\"));\n $smarty->setCompileDir($tmpDir . \"/compiled\");\n\n /* Assign library path */\n $smarty->assign(\"jquery_path\", $optionInfo['resprefix'] . JQUERY_PATH);\n $smarty->assign(\"jquery_ui_path\", $optionInfo['resprefix'] . JQUERYUI_PATH);\n $smarty->assign(\"timepicker_path\", $optionInfo['resprefix'] . TIMEPICKER_PATH);\n $smarty->assign(\"tablesorter_path\", $optionInfo['resprefix'] . TABLESORTER_PATH);\n $smarty->assign(\"superfish_path\", $optionInfo['resprefix'] . SUPERFISH_PATH);\n $smarty->assign(\"jqplot_path\", $optionInfo['resprefix'] . JQPLOT_PATH);\n $smarty->assign(\"dygraphs_path\", $optionInfo['resprefix'] . DYGRAPHS_PATH);\n\n /* Assign pg_stats_reporter version */\n $smarty->assign(\"program_version\", PROGRAM_VERSION);\n\n return $smarty;\n}", "function smarty_std(){\n global $smarty;\n $smarty->assign('USER',$_SESSION['ldapab']['username']);\n}", "function startSmarty(&$pObj) {\n\t\t// Run Smarty's constructor\n\t\t$this->Smarty();\n\t\t// Register reference to the calling class\n\t\t$this->pObj = $pObj;\n\t\t// Register reference to tslib_cobj\n\t\t$this->cObj = &$GLOBALS['TSFE']->cObj;\n\t}", "function int()\n {\n// $smarty->setTemplateDir(TPL_PATH);\n// $smarty->setCompileDir(COMPILE_PATH);\n// $smarty->setCacheDir(CACHE_PATH);\n// $smarty->display(\"admin/admin.html\");\n //$this->smarty->display(\"admin/admin.html\");\n $smarty=new smarty();\n }", "public static function smarty_prototype()\r\n {\r\n // see if we need to set up the prototype smarty object\r\n if (self::$_smarty_prototype === NULL) {\r\n\r\n if (version_compare(Kohana::VERSION,'3.2','>=')) {\r\n $config = Kohana::$config->load('smarty');\r\n } else {\r\n $config = Kohana::config('smarty');\r\n }\r\n\r\n $smarty_class = Kohana::find_file('vendor', 'smarty/libs/Smarty.class');\r\n require_once($smarty_class);\r\n\r\n // save the location in case we have more than one Smarty version around\r\n self::$_smarty_path = realpath(dirname($smarty_class)) . DIRECTORY_SEPARATOR;\r\n\r\n // instantiate the prototype Smarty object\r\n $smarty = new Smarty;\r\n self::$_smarty_prototype = $smarty;\r\n\r\n // set up the prototype with options from config file\r\n foreach ($config->smarty_config as $key => $value) {\r\n $smarty->$key = $value;\r\n }\r\n\r\n // deal with config options that are not simple properties\r\n $smarty->php_handling = constant($config->php_handling);\r\n\r\n // add the path to the plugins for the located Smarty distro\r\n $smarty->addPluginsDir(self::$_smarty_path . 'plugins');\r\n // add views directories for all loaded modules (including Smarty3)\r\n $dirs = array();\r\n foreach (Kohana::modules() as $dir) {\r\n if (is_dir($dir.'/views'))\r\n {\r\n $dirs[] = \"{$dir}views\";\r\n }\r\n }\r\n $smarty->addTemplateDir($dirs);\r\n\r\n if ($config->check_dirs) {\r\n // check we can write to the compiled templates directory\r\n if (!is_writeable($smarty->getCompileDir())) {\r\n self::create_dir($smarty->getCompileDir(), 'Smarty compiled template');\r\n }\r\n\r\n // if smarty caching is enabled, check we can write to the cache directory\r\n if ($smarty->caching && !is_writeable($smarty->getCacheDir())) {\r\n self::create_dir($smarty->getCacheDir(), 'Smarty cache');\r\n }\r\n }\r\n\r\n // now assign useful globals\r\n $smarty->assignGlobal('base_url', URL::base());\r\n $smarty->assignGlobal('helper', new Smarty_Helper);\r\n\r\n // register any globals\r\n foreach (self::$_global_data as $key => $value) {\r\n if (isset($bound[$key])) {\r\n Smarty::$global_tpl_vars[$key] = new Smarty_variable();\r\n Smarty::$global_tpl_vars[$key]->value = &$value;\r\n } else {\r\n $smarty->assignGlobal($key, $value);\r\n }\r\n }\r\n }\r\n return self::$_smarty_prototype;\r\n }", "function pnRender($module = '', $caching = null)\n {\n // first, get a native Smarty object\n $this->Smarty();\n\n // Initialize the module property with the name of\n // the topmost module. Foor Hooks, Blocks, API Functions and others\n // you need to set this property to the name of the respective module!\n if (!$module) {\n $module = pnModGetName();\n }\n $this->module = $module;\n\n // begin holder tag (be nice to others)\n $this->left_delimiter = '<!--[';\n // end holder tag\n $this->right_delimiter = ']-->';\n\n //---- Plugins handling -----------------------------------------------\n // add the global PostNuke plugins directory\n\t\tif (is_dir('system/pnRender/plugins')) {\n\t array_push($this->plugins_dir, 'system/pnRender/plugins');\n\t\t} else if (is_dir('modules/pnRender/plugins')) {\n\t array_push($this->plugins_dir, 'modules/pnRender/plugins');\n\t\t}\n\n // add the global PostNuke plugins directory\n $modinfo = pnModGetInfo(pnModGetIDFromName('Xanthia'));\n $modpath = ($modinfo['type'] == 3) ? 'system' : 'modules';\n array_push($this->plugins_dir, \"$modpath/$modinfo[directory]/plugins\");\n\n// uncomment for .8 until modtype=3 for system modules is implemented\n array_push($this->plugins_dir, \"system/$modinfo[directory]/plugins\");\n\n // add module specific plugins directories, if they exist\n $theme = pnUserGetTheme();\n $themepath = \"themes/$theme/templates/modules/$module/plugins\";\n if (file_exists($themepath)) {\n array_push($this->plugins_dir, $themepath);\n }\n\n $modinfo = pnModGetInfo(pnModGetIDFromName($module));\n $modpath = ($modinfo['type'] == 3) ? 'system' : 'modules';\n $mod_plugs = \"$modpath/$modinfo[directory]/pntemplates/plugins\";\n // build the path to the config file for usemodules needed later\n $usemod_conf = \"$modpath/$modinfo[directory]/pntemplates/config/usemodules\";\n if (file_exists($mod_plugs)) {\n array_push($this->plugins_dir, $mod_plugs);\n }\n\n // add theme specific plugins directories, if they exist\n $themepath = \"themes/$theme/plugins\";\n if (file_exists($themepath)) {\n array_push($this->plugins_dir, $themepath);\n }\n\n// uncomment for .8 until modtype=3 for system modules is implemented\n $modpath = 'system';\n $mod_plugs = \"$modpath/$modinfo[directory]/pntemplates/plugins\";\n if (file_exists($mod_plugs)) {\n array_push($this->plugins_dir, $mod_plugs);\n }\n\n // load the config file\n if( file_exists($usemod_conf) && is_readable($usemod_conf)) {\n $additionalmodules = file($usemod_conf);\n if(is_array($additionalmodules)) {\n foreach($additionalmodules as $addmod) {\n $this->_add_plugins_dir(trim($addmod));\n }\n }\n }\n\n // check if the recent 'type' parameter in the URL is admin and if yes,\n // include (modules|system)/Admin/pntemplates/plugins to the plugins_dir array\n $type = pnVarCleanFromInput('type');\n if(!empty($type) && $type=='admin') {\n array_push($this->plugins_dir, \"modules/Admin/pntemplates/plugins\");\n array_push($this->plugins_dir, \"system/Admin/pntemplates/plugins\");\n }\n\n //---- Cache handling -------------------------------------------------\n // use HTML cache system?\n\t// V4B RNG: backport new pnRender params\n\tif (isset($caching) && is_bool($caching)) {\n $this->caching = $caching;\n } else {\n $this->caching = pnModGetVar('pnrender', 'cache');\n }\n $this->cache_lifetime = pnModGetVar('pnrender', 'lifetime');\n\n // HTML cache directory\n $this->cache_dir = pnConfigGetVar('temp') . '/pnRender_cache';\n\n //---- Compilation handling -------------------------------------------\n // check for updated templates?\n $this->compile_check = pnModGetVar('pnrender', 'compile_check');\n\n // force compile template always?\n $this->force_compile = pnModGetVar('pnrender', 'force_compile');\n\n // safe_mode?\n // This routine is taken from PostCalendar.\n\t\t// we don't need this code anymore due to change below\n //$safe_mode = ini_get('safe_mode');\n //$safe_mode_gid = ini_get('safe_mode_gid');\n //$open_basedir = ini_get('open_basedir');\n\n // don't use subdirectories when creating compiled/cached templates\n\t\t// this works better in a hosted environment\n $this->use_sub_dirs = false;\n //$this->use_sub_dirs = !((bool)$safe_mode ||\n\t // (bool)$safe_mode_gid ||\n // !empty($open_basedir));\n\n // cache directory (compiled templates)\n $this->compile_dir = pnConfigGetVar('temp') . '/pnRender_compiled';\n\n // compile id\n $this->compile_id = $this -> module . '|' . $theme . '|' . pnUserGetLang();\n\n // initialize the cache ID\n $this->cache_id = '';\n\n // expose templates\n $this->expose_template = (pnModGetVar('pnrender', 'expose_template') == true) ? true : false;\n\n if (pnModAvailable('Xanthia')){\n $this->userdb = 'userdb';\n }\n\n $this->register_block('nocache', 'pnRender_block_nocache', false);\n }", "function tpl_language()\n{\n global $smarty, $lang, $config;\n\n $smarty->assign('lang', $lang);\n $smarty->assign('config', $config);\n}", "public static function cms_module_plugin($params, &$smarty)\n\t{\n\t\t$gCms = cmsms();\n\t\t$cmsmodules = cmsms()->modules;\n\n\t\t$id = 'm' . ++$gCms->variables[\"modulenum\"];\n\n\t\t$returnid = '';\n\t\tif (isset($gCms->variables['pageinfo']) && isset($gCms->variables['pageinfo']->content_id))\n\t\t{\n\t\t\t$returnid = $gCms->variables['pageinfo']->content_id;\n\t\t}\n\t\t$params = array_merge($params, get_module_parameters($id));\n\n\t\t$modulename = '';\n\t\t$action = 'default';\n\t\t$inline = false;\n\n\t\t$checkid = '';\n\n\t\tif (isset($params['module'])) \n\t\t\t$modulename = $params['module'];\n\t\telse\n\t\t\treturn '<!-- ERROR: module name not specified -->';\n\n\t\tif (isset($params['idprefix'])) $id = trim($params['idprefix']);\n\t\tif (isset($params['action']) && $params['action'] != '')\n\t\t{\n\t\t\t// action was set in the module tag\n\t\t\t$action = $params['action'];\n\t\t}\n\n\t\tif (isset($_REQUEST['id'])) //Not really needed now...\n\t\t{\n\t\t\t$checkid = $_REQUEST['id'];\n\t\t}\n\t\telse if (isset($_REQUEST['mact']))\n\t\t{\n\t\t\t// we're handling an action\n\t\t\t$ary = explode(',', cms_htmlentities($_REQUEST['mact']), 4);\n\t\t\t$mactmodulename = (isset($ary[0])?$ary[0]:'');\n\t\t\tif (strtolower($mactmodulename) == strtolower($params['module']))\n\t\t\t{\n\t\t\t\t$checkid = (isset($ary[1])?$ary[1]:'');\n\t\t\t\t$mactaction = (isset($ary[2])?$ary[2]:'');\n\t\t\t}\n\t\t\t$mactinline = (isset($ary[3]) && $ary[3] == 1?true:false);\n\n\t\t\tif ($checkid == $id)\n\t\t\t{\n\t\t\t\t// the action is for this instance of the module\n\t\t\t\t$inline = $mactinline;\n\t\t\t\tif( $inline == true )\n\t\t\t\t{\n\t\t\t\t\t// and we're inline (the results are supposed to replace\n\t\t\t\t\t// the tag, not {content}\n\t\t\t\t\t$action = $mactaction;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif( $action == '' ) $action = 'default'; // probably not needed, but safe\n\n\t\tif (isset($cmsmodules))\n\t\t{\n\t\t\t$modulename = $params['module'];\n\n\t\t\tforeach ($cmsmodules as $key=>$value)\n\t\t\t{\n\t\t\t\tif (strtolower($modulename) == strtolower($key))\n\t\t\t\t{\n\t\t\t\t\t$modulename = $key;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($modulename))\n\t\t\t{\n\t\t\t\tif (isset($cmsmodules[$modulename]))\n\t\t\t\t{\n\t\t\t\t\tif (isset($cmsmodules[$modulename]['object'])\n\t\t\t\t\t\t&& $cmsmodules[$modulename]['installed'] == true\n\t\t\t\t\t\t&& $cmsmodules[$modulename]['active'] == true\n\t\t\t\t\t\t&& $cmsmodules[$modulename]['object']->is_plugin_module())\n\t\t\t\t\t{\n\t\t\t\t\t\t@ob_start();\n\n\t\t\t\t\t\t$request = $cmsmodules[$modulename]['object']->create_request_instance($id, $returnid);\n\t\t\t\t\t\t$result = $request->do_action_base($action, $params);\n\t\t\t\t\t\tif ($result !== FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo $result;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$modresult = @ob_get_contents();\n\t\t\t\t\t\t@ob_end_clean();\n\t\t\t\t\t\n\t\t\t\t\t\treturn $modresult;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn \"<!-- Not a tag module -->\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function smarty($resource_name, $params = array()) {\n\t\techo $this->load($resource_name, $params);\n\t}", "function smarty_block_form($params,$content,&$smarty,&$repeat){\n if(!$repeat){\n $title = isset($params['title']) ? $params['title'] : '';\n $button_text = isset($params['button_text']) ? $params['button_text'] : 'submit';\n $method = isset($params['method']) ? $params['method'] : 'POST';\n $template_vars = $smarty->getTemplateVars();\n $token = isset($template_vars['token']) ? $template_vars['token'] : '';\n $module_name = isset($template_vars['module_name']) ? $template_vars['module_name'] : '';\n $preform = \"\n <form class='defaultForm form-horizontal' method='{$method}'>\";\n if($token && $module_name){\n $preform .= \"<input type='hidden' name='controller' value='AdminModules'>\";\n $preform .= \"<input type='hidden' name='configure' value='{$module_name}'>\";\n $preform .= \"<input type='hidden' name='token' value='{$token}'>\";\n }\n $preform .= \"\n <div class='panel'>\n <div class='panel-heading'>{$title}</div>\n <div class='form-wrapper'>\n \";\n $postform = \"\n </div>\n <div class='panel-footer'>\n <button class='btn btn-default pull-right' type='submit'>\n <i class='process-icon-new'></i>{$button_text}\n </button>\n </div>\n </div>\n </form>\n\";\n return $preform . $content . $postform;\n }\n}", "protected function _getTmsModModel()\n\t{\n\t\treturn $this->getModelFromCache('TMS_Model_Modification');\n\t}", "public function __construct($module_name='core') {\n\t\tglobal $I2_FS_ROOT;\n\t\trequire_once('smarty/Smarty.class.php');\n\t\t$this->smarty = new Smarty;\n\t\t$this->smarty->left_delimiter = '[<';\n\t\t$this->smarty->right_delimiter = '>]';\n\t\t$this->smarty->setCompileDir(i2config_get('cache_dir', NULL, 'core') . 'smarty/');\n\t\t$this->smarty->addPluginsDir($I2_FS_ROOT . 'smarty');\n\t\t$this->smarty->setCacheDir($this->smarty->getCompileDir().'cache');\n\n\t\t// Caching off by default\n\t\t$this->smarty->caching = false;\n\n\t\t//TODO: turn this off for production code!\n\t\t$this->smarty->compile_check = true;\n\n\t\t$this->my_module_name = $module_name;\n\n\t\tif(!file_exists($this->smarty->getCompileDir()) && !mkdir($this->smarty->getCompileDir())) {\n\t\t\terror(\"Error! Could not create $this->smarty->getCompileDir()\");\n\t\t}\n\n\t\tif ($module_name == 'core') {\n\t\t\tself::$core_display = $this;\n\t\t}\n\t\tself::$tpl_root = $I2_FS_ROOT . 'templates/';\n\t\t$this->buffer = '';\n\t\t$this->buffering = TRUE;\n\n\t\tself::style_set();\n\t}", "protected function _mod()\n\t{\n\t\treturn mod('deposit_sms');\n\t}" ]
[ "0.6912973", "0.6737093", "0.66618145", "0.6654182", "0.6416009", "0.641455", "0.63110936", "0.6237884", "0.6149676", "0.60187584", "0.5938074", "0.59025514", "0.5660648", "0.5660531", "0.5660531", "0.5645874", "0.5628115", "0.5552656", "0.55128837", "0.5506361", "0.5496173", "0.5438432", "0.5412608", "0.5400283", "0.53962964", "0.53648216", "0.53461945", "0.5323097", "0.53137255", "0.5245671" ]
0.8027337
0
This function is used to write mail into disk based on maileid and header/footer will be added based on site .....
public static function writeMmmMail($urlMail,$mailerId,$site) { if(!$urlMail || !$mailerId || !$site) throw new jsException("","compulsory field missing in writeMmmMail() of MmmUtility.class.php"); $smarty = MmmUtility::createSmartyObject(); $path = $smarty->template_dir."individual_mailer_templates"; $pathOfHtmlFile = $path."/".$mailerId.".html"; $handle = fopen($pathOfHtmlFile, "w+"); $MmmMailerBasicInfo = new MmmMailerBasicInfo; $mailerBasicInfoArr = $MmmMailerBasicInfo->retreiveMailerInfo($mailerId); if($handle) { $content = CommonUtility::sendCurlGetRequest($urlMail); if($site=='J') $mailerBasicInfoArr['RESPONSE_TYPE']=''; $response_type=$mailerBasicInfoArr['RESPONSE_TYPE']; $content = str_replace("<body>",'<body>'."\n".'~if $showHeaderFooter neq "N"`~include_partial("global/header'.$site.'Mailer",[mailerId=>$mailerId,checksum=>$checksum,echecksum=>$echecksum,browserUrl=>$browserUrl,email=>$email,profileid=>$profileid,name=>$name,phone=>$phone,response_type=>$response_type,isTestMailer=>$isTestMailer,serviceMail=>$serviceMail,isMrc=>$isMrc])`~/if`',$content); $content = str_replace("</body>",'~if $showHeaderFooter neq "N"`~include_partial("global/footer'.$site.'Mailer",[promoMail=>$promoMail,browserUrl=>$browserUrl,mailerId=>$mailerId,checksum=>$checksum,profileid=>$profileid,isMrc=>$isMrc,email=>$email])`~/if`'."\n".'</body>',$content); fwrite($handle, $content); fclose($handle); } else throw new jsException("","unable to write to a file in writeMmmMail() of MmmUtility.class.php"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendmail()\n\t{\n\t\tglobal $ilUser;\n\t\tinclude_once 'classes/class.ilFileDataMail.php';\n\t\trequire_once \"Services/Mail/classes/class.ilFormatMail.php\";\n\t\t$mfile = new ilFileDataMail($ilUser->getId());\n\t\t$umail = new ilFormatMail($ilUser->getId());\n\n\t\t$html_content=$this->export(false);\n\t\t$tempfile=ilUtil::ilTempnam();\n\t\t$fp=fopen($tempfile,'w');\n\t\tfwrite($fp, $html_content);\n\t\tfclose($fp);\n\t\t$filename='bookmarks.html';\n\t\t$mfile->copyAttachmentFile($tempfile,$filename);\n\t\t$umail->savePostData($ilUser->getId(),array($filename),\n\t\t\t\t\t\t '','','','','',\n\t\t\t\t\t\t '',\n\t\t\t\t\t\t '', 0);\n\n require_once 'Services/Mail/classes/class.ilMailFormCall.php';\n\t\tilUtil::redirect(ilMailFormCall::_getRedirectTarget($this, '', array(), array('type' => 'attach')));\n\t}", "function email($database = \"\"){\n\t\n\t\t$to = '[email protected]';\n\t\t$subject = 'Reports';\n\t\t$semi_rand = md5(time()); \n\t\t$mime_boundary = \"==Multipart_Boundary_x{$semi_rand}x\";\n\t\t$headers ='MIME-Version: 1.0'.\"\\r\\n\";\n\t\t$headers .= 'Content-Type: multipart/alternative; boundary='.$mime_boundary. \"\\r\\n\";\n\t\t$headers .='From: \"Webmistress\" <[email protected]>'. \"\\r\\n\";\t\n\t\t\n\t\t$htmlEmail = $this ->build_email_html($database);\n\t\t$txtEmail = $this ->build_email_txt($database);\n\t\t\n\t\t//$this ->cleanVisitorTable($database);\n\t\t\n\t\t$message = \"This is a multi-part message in MIME format.\\r\\n\\r\\n\" .\n\t\t'--'.$mime_boundary.\"\\r\\n\".\n\t\t'Content-Type: text/plain; charset=\"utf-8\"'.\"\\r\\n\".\n\t\t'Content-Transfer-Encoding:7-bit'.\"\\r\\n\\r\\n\".$txtEmail.\"\\r\\n\".\n\t\t\"--{$mime_boundary}\\r\\n\" .\n\t\t\"Content-Type:text/html; charset=\\\"utf-8\\\"\\r\\n\" .\n\t\t\"Content-Transfer-Encoding: 7bit\\r\\n\\r\\n\" .\n\t\t$htmlEmail.\"\\r\\n\";\n\t\t\n\t\tif (mail($to,$subject,$message, $headers)){\n\t\t\t\n\t\t\t$output = 'Email was sent.';\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\t$output = \"Email wasn't sent.\";\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$filename = 'visitorsEmail.txt';\n\t\t\n\t\ttry {\n\t\t\t$file = fopen('/var/www/websites/redesign2013/logs/'.$filename,'c');\n\t\n\t\t\tif ($file){\n\t\t\t\tfwrite($file, $message);\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tthrow new Exception(\"Couldn't open file.\");\n\t\t\t\t\n\t\t\t}\n\t\n\t\t}catch(Exception $error){\n\t\t\t\n\t\t\techo 'Error: '.$error ->getMessage(),\"\\n\";\n\t\t\tprint_r($error->getTrace());\n\t\t\techo 'Exception Code:'.$error->getCode().\"\\n\";\n\t\t\techo 'Line :'.$error->getLine().' - File:'.$error->getFile().\"\\n\";\n\t\t}\n\t\t\n\t\techo $message;\n\t\t\n\t\treturn $output ;\n\t\t\n\t\t\n\t}", "protected function _writeFileBody() {}", "function writeContent ($filetype1, $pathbase, $outputFile, $msgToRegister) {\n global $GROUP, $WRITEMSG, $OVERWRITE;\n\n $pathbase = \"/var/www/html/saw/mod/iassign/ilm_debug/\"; // \"/mod/iassign/ilm_debug/\";\n $outputFile = $pathbase . $outputFile;\n\n if (!is_writable($pathbase)) { // TRUE se arquivo existe e pode ser escrito\n // $file_debug .= \"Error: '\" . $completfilepath . \"' could not be registered! Perhaps the directory or the file has permission problem?<br/>\\n\";\n //D echo \"$outputFile, $filetype1<br/>\";\n print \"Erro! Problema de acesso ao servidor! Por favor, avise ao administrador (<tt>$pathbase</tt> nao acessivel para escrita).<br/>\"; // . $file_debug . \"\n exit(0);\n }\n\n // $result = writeContent(\"file\", $pathbase, $filename, $msgToRegister);\n // print \"escreva.php: result=$result<br/>\";\n\n // write personal email file\n // To write: verify if the file does not exists or have permission to overwrite\n if (is_file($outputFile)) { // already exist this file\n // $outputFile .= $outputFile . '_' . date('Y_m_d_h_m');\n } // if (is_file($outputFile))\n\n if (1==1) { // write/overwrite the file\n $fpointer = fopen($outputFile, \"w\"); // write - if executed, it clear the previou content at this file\n if (!$fpointer) {\n $file_debug .= \"Erro: nao foi possivel abrir o roteiro ($outputFile)!<br/>\\n\";\n // it was not possible to open the file '$completfilepath\" . $file_name . \"'!<br/>\\n\";\n print \"<br/>\" . $file_debug . \"<br/>\\n\";\n //D echo \"writeContent: $filetype1, outputFile=$outputFile<br/>\\n\";\n return 0;\n }\n fwrite($fpointer, $msgToRegister . \"\\n\");\n // echo \" - outputFile=$outputFile : WRITEMSG=$WRITEMSG, OVERWRITE=$OVERWRITE, gerado com sucesso!<br/>\\n\";\n fclose($fpointer);\n }\n else {\n // print \"Nao gera os arquivos personalizados para email aos alunos ('$outputFile')<br/>\\n\"; // admin/<turma>/<N>_<name>.txt\n }\n\n return 1;\n }", "public function enviar(){\n\t\t\t$email = array(\n\t\t \t\t'nome'=>$this->remover_caracter($this->nome),\n\t\t \t\t'email'=>$this->email,\n\t\t\t\t'assunto'=>$this->remover_caracter($this->assunto),\n\t\t \t\t'texto'=>$this->remover_caracter($this->mensagem)\n\t\t\t);\n\t\t\tif( is_file($this->logo) ){\n\t\t\t\t$imagem_nome=$this->logo;\n\t\t\t\t$arquivo=fopen($imagem_nome,'r');\n\t\t\t\t$contents = fread($arquivo, filesize($imagem_nome));\n\t\t\t\t$encoded_attach = chunk_split(base64_encode($contents));\n\t\t\t\tfclose($arquivo);\n\t\t\t}\n\t\t\t$limitador = \"_=======\". date('YmdHms'). time() . \"=======_\";\n\n\t\t\t$mailheaders = \"From: \".$email['email'].\"\\r\\n\";\n\t\t\t$mailheaders .= \"MIME-version: 1.0\\r\\n\";\n\t\t\t$mailheaders .= \"Content-type: multipart/related; boundary=\\\"$limitador\\\"\\r\\n\";\n\t\t\t$cid = date('YmdHms').'.'.time();\n\n\t\t\t$texto=\"\n\t\t\t\t<html>\n\t\t\t\t<head>\n\t\t\t\t\t\".header('Content-type: text/html; charset=utf-8').\"\n\t\t\t\t</head>\n\t\t\t\t<body>\n\t\t\t\t\t<img src=\\\"cid:$cid\\\">\n\t\t\t\t\t<h1>Desenvolvedor avulso para Web</h1>\n\t\t\t\t\t<br>\n\t\t\t\t\t<p><strong>\".$email['nome'].\"</strong>: Solicitou contato, sobre :<em>\".$email['assunto'].\"</em></p>\n\t\t\t\t\t<p>com a seguinte mensagem: <span>\".$email['texto'].\"</span></p>\n\t\t\t\t\t<p>email: \".$email['email'].\"</p>\n\t\t\t\t\t<a href='http://\". $this->url .\"'><font size=3>\". $this->url .\"</font></a>\n\t\t\t\t</body>\n\t\t\t\t</html>\n\t\t\t\";\n\n\t\t\t$msg_body = \"--$limitador\\r\\n\";\n\t\t\t$msg_body .= \"Content-type: text/html; charset=iso-8859-1\\r\\n\";\n\t\t\t$msg_body .= \"$texto\";\n\n\t\t\t$emailPara = explode('@',$this->para)[1];\n\t\t\treturn mail($this->para ,\"Um novo Cliente Contactou o Site \". $emailPara ,$msg_body, $mailheaders);\n\t\t}", "function Email_Proforma($Src,$SrcId,$to,$mescat,$subject,$helper='',$helperdata=0,$logfile='',&$attachments=0,$embeded=0,$from='') {\n global $PLANYEAR,$YEARDATA,$FESTSYS;\n if (strlen($mescat) < 30) {\n $Prof = Get_Email_Proforma($mescat);\n $Mess = ($Prof? $Prof['Body'] : \"Unknown message $mescat \");\n } else {\n $Mess = $mescat;\n }\n Parse_Proforma($Mess,$helper,$helperdata,0,$attachments,$embeded);\n \n NewSendEmail($Src,$SrcId,$to,$subject,$Mess,$attachments,$embeded,$from);\n \n if ($logfile) {\n $logf = fopen(\"LogFiles/$logfile.txt\",\"a\");\n fwrite($logf,\"\\n\\nEmail to : \" . Pretty_Print_To($to) . \"Subject:$subject\\n\");\n if ($from) fwrite($logf,\"From: \" . Pretty_Print_To($from));\n fwrite($logf,\"\\n\\n$Mess\");\n\n if ($attachments) {\n if (is_array($attachments)) {\n foreach ($attachments as $i=>$att) fwrite($logf,\" With attachment: \" . $att[0] . \" as \" . $att[1] . \"\\n\\n\");\n } else {\n fwrite($logf,\" With attachment $attachments\\n\\n\"); \n }\n }\n if ($embeded) {\n if (is_array($embeded)) {\n foreach ($embeded as $i=>$att) fwrite($logf,\" With embeded: \" . $att[0] . \" as \" . $att[1] . \"\\n\\n\");\n } else {\n fwrite($logf,\" With embeded $embeded\\n\\n\"); \n }\n }\n\n fclose($logf);\n }\n return $Mess;\n}", "function metamail($to,$subject,$body,$headers) {\r\n\r\n\tglobal $TESTMODE,$TESTEMAIL;\r\n\r\n\tif ($TESTMODE) {\r\n\t\r\n\t\t$header = \"To: $to\\r\\n$headers\\r\\n\\r\\n\";\r\n\t\t\r\n\t\tmail($TESTEMAIL,$subject,$header.$body);\r\n\t\r\n\t} else mail($to,$subject,$body,$headers);\r\n\t\t\r\n}", "function fileemail() {\n\t\t\tglobal $logid, $bwpsoptions;\n\t\t\t\n\t\t\t//Get the right email address.\n\t\t\tif ( is_email( $bwpsoptions['id_fileemailaddress'] ) ) {\n\t\t\t\t\n\t\t\t\t$toaddress = $bwpsoptions['id_fileemailaddress'];\n\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t$toaddress = get_site_option( 'admin_email' );\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t//create all headers and subject\n\t\t\t$to = $toaddress;\n\t\t\t$headers = 'From: ' . get_option( 'blogname' ) . ' <' . $to . '>' . PHP_EOL;\n\t\t\t$subject = '[' . get_option( 'siteurl' ) . '] ' . __( 'WordPress File Change Warning', $this->hook ) . ' ' . date( 'l, F jS, Y \\a\\\\t g:i a e', current_time( 'timestamp' ) );\n\n\t\t\t//create message\n\t\t\t$message = '<p>' . __('<p>A file (or files) on your site at ', $this->hook ) . ' ' . get_option( 'siteurl' ) . __( ' have been changed. Please review the report below to verify changes are not the result of a compromise.', $this->hook ) . '</p>';\n\t\t\t$message .= $this->getdetails( $logid, true ); //get report\n\t\t\t\n\t\t\tadd_filter( 'wp_mail_content_type', create_function( '', 'return \"text/html\";' ) ); //send as html\n\t\t\t\n\t\t\twp_mail( $to, $subject, $message, $headers ); //send message\n\t\t\n\t\t}", "function mymail($to, $title, $body, $from = '') {\n\n $controlquery = doquery(\"SELECT * FROM {{table}} WHERE id='1' LIMIT 1\", \"control\");\n $controlrow = mysql_fetch_array($controlquery);\n extract($controlrow);\n \n\n $from = trim($from);\n\n if (!$from) {\n $from = '<'.$controlrow[\"adminemail\"].'>';\n }\n\n $rp = $controlrow[\"adminemail\"];\n $org = '$gameurl';\n $mailer = 'PHP';\n\n $head = '';\n $head .= \"Content-Type: text/plain \\r\\n\";\n $head .= \"Date: \". date('r'). \" \\r\\n\";\n $head .= \"Return-Path: $rp \\r\\n\";\n $head .= \"From: $from \\r\\n\";\n $head .= \"Sender: $from \\r\\n\";\n $head .= \"Reply-To: $from \\r\\n\";\n $head .= \"Organization: $org \\r\\n\";\n $head .= \"X-Sender: $from \\r\\n\";\n $head .= \"X-Priority: 3 \\r\\n\";\n $head .= \"X-Mailer: $mailer \\r\\n\";\n\n $body = str_replace(\"\\r\\n\", \"\\n\", $body);\n $body = str_replace(\"\\n\", \"\\r\\n\", $body);\n\n return mail($to, $title, $body, $head);\n \n}", "public function createnotification($id='',$name='',$htmls='',$header='',$buttonhtml='',$pass_url='',$path='',$subject='',$to_email='')\n { \n $email_path = file_get_contents($path);\n $cur_year = date('Y');\n $email_content = array('[name]','[pass_url]','[htmls]','[buttonhtml]','[header]','[cur_year]');\n $replace = array($name,$pass_url,$htmls,$buttonhtml,$header,$cur_year);\n $message = str_replace($email_content,$replace,$email_path);\n $header = 'From: '.env(\"IMAP_HOSTNAME_TEST\").'' . \"\\r\\n\";\n $header .= \"MIME-Version: 1.0\\r\\n\";\n $header .= \"Content-type: text/html\\r\\n\";\n $retval = mail($to_email,$subject,$message,$header); \n if($retval)\n {\n return true; \n }else\n {\n return false;\n }\n }", "function mailreport()\n{\n\tglobal $g_error_msg, $g_debug_msg;\n\tinclude_once(atkconfig('atkroot'). 'atk/errors/class.atkerrorhandlerbase.inc');\n\t$errorHandlerObject = atkErrorHandlerBase::get('mail', array('mailto'=>atkconfig('mailreport')));\n\t$errorHandlerObject->handle($g_error_msg, $g_debug_msg);\n}", "protected function _writeFileHeader() {}", "function SendMail($toid,$fromid,$subject,$body,$filename=\"\",$filepath=\"\",$mailformat=false)\n{\n global $adminmailid;\n\t\t\t\t\t$to=$toid;\n\t\t\t\t\tif($fromid==\"\")\n\t\t\t\t\t\t$fromid=ADMIN_EMAIL;\n\n $subject = $subject;\n\t\t\t\t\t$mailcontent =$body;\n\t\t\t\t\t//SendHTMLMail($to,$subject,$mailcontent);\n\t\t\t\t\t$mail=new phpmailer();\n\t\t\t\t\t$mail->AddAddress($to);\n\t\t\t\t\t$mail->Subject = $subject;\n\t\t\t\t\t$mail->Body =$mailcontent;\n\t\t\t\t\t $mail->AltBody =\" \";\n\t\t\t\t\t$mail->From=\"Administrator\";\n\t\t\t\t\tif($filename!=\"\")\n\t\t\t\t\t{\n \t\t\t $arrfilename=explode(\",\",$filename);\n\t\t\t\t\t $arrfilepath=explode(\",\",$filepath);\n\t\t\t\t\t for($i=0;$i<count($arrfilename);$i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$mail->AddAttachment($arrfilepath[$i], $arrfilename[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$mail->IsHTML($mailformat);\n\n\t\t\t\t\t$mail->FromName=$fromid;\n\nif(!$mail->Send())\n\t{\n\t //echo \"There was an error sending the message<br><font face='Verdana' size='2'><center></font></center>\";\n return false;\n\t}\nreturn true;\n}", "function send_mail($item){\n $mail = new PHPMailer;\n $mail->setFrom('[email protected]', 'Website administrator');\n //Set an alternative reply-to address\n $mail->addReplyTo($item['email'], $item['name']);\n //Set who the message is to be sent to\n $mail->addAddress('[email protected]');\n //Set the subject line\n $mail->isHTML(true);\n $mail->CharSet = 'UTF-8';\n $mail->Subject = 'Contact sent from website';\n //Read an HTML message body from an external file, convert referenced images to embedded,\n //convert HTML into a basic plain-text alternative body\n //$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));\n //Replace the plain text body with one created manually\n $mail->Body = '\n <html>\n <head>\n \t<title>'.$mail->Subject.'</title>\n </head>\n <body>\n \t<p>Full Name: '.$item['name'].'</p>\n \t\n \t<p>Address: '.$item['adds'].'</p>\n \t<p>Phone: '.$item['phone'].'</p>\n \t\n \t<p>Email: '.$item['email'].'</p>\n <p>Tiêu Đề: '.$item['fax'].'</p>\n \t<p>Content: '.nl2br($item['content']).'</p>\n </body>\n </html>\n ';\n //Attach an image file\n //$mail->addAttachment('images/phpmailer_mini.png');\n \n //send the message, check for errors\n //$mail->send();\n if ($mail->send()) {\n echo \"Message sent!\";\n } else {\n echo \"Mailer Error: \" . $mail->ErrorInfo;\n }\n }", "function m_dspemails()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_EMAIL_FILE\",$this->emailTemplate);\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_EMAIL_BLK\", \"email_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_MESSAGE_BLK\", \"message_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_MSG_BLK1\", \"msg_blk1\");\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SALESURL\",SITE_URL.\"sales/\");\n\n\t\t#INTAILIZING ***\n\t\t$this->ObTpl->set_var(\"email_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"message_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"msg_blk1\",\"\");\t\n\t\t$this->ObTpl->set_var(\"msg_blk2\",\"\");\t\n\n\t\t$this->request['msg']=$this->libFunc->ifSet($this->request,\"msg\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",\"\");\n\n\t\t#DATABASE QUERY\n\t\t$this->obDb->query = \"SELECT * FROM \".EMAILS;\n\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t$campaigncount = $this->obDb->record_count;\n\t\tif($this->request['msg']==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_INSERTED);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\t\telseif($this->request['msg']==3)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_DELETED);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\t\telseif($this->request['msg']==5)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_SENT);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\n\t\tif($campaigncount>0)\n\t\t{\n\t\t\t#PARSING DISCOUNT BLOCK\n\t\t\tfor($j=0;$j<$campaigncount;$j++)\n\t\t\t{\t\t\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iMailid_PK);\n\t\t\t\tif ($queryResult[$j]->vUserList==\"All\"){\n $this->obDb->query = \"SELECT count(*) as cnt FROM \".CUSTOMERS.\" WHERE iStatus=1 AND iMailList !=0\";\n }else{ \n $this->obDb->query = \"SELECT count(*) as cnt FROM \".LEADLIST.\" WHERE iLeadId_FK='\". $queryResult[$j]->vUserList.\"'\";\n }\n\t\t\t\t$qryRs = $this->obDb->fetchQuery();\n\t\t\t\t\n\t\t\t\tif ($queryResult[$j]->vVisitorList==\"1\"){\n $this->obDb->query = \"SELECT count(*) as cnt FROM \".NEWSLETTERS;\n\t\t\t\t $qryVs = $this->obDb->fetchQuery();\n\t\t\t\t $qryRs[0]->cnt = $qryRs[0]->cnt + $qryVs[0]->cnt;\n }\n\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_USERCOUNT\",$qryRs[0]->cnt);\n \n $this->ObTpl->set_var(\"TPL_VAR_SUBJECT\",$this->libFunc->m_displayContent($queryResult[$j]->vSubject));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SID\",$this->libFunc->m_displayContent($queryResult[$j]->vSid));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_BUILDDATE\",$this->libFunc->dateFormat2($queryResult[$j]->tmBuildDate));\t\n\t\t\t\t$sentDate=$this->libFunc->dateFormat2($queryResult[$j]->tmSentDate);\n\t\t\t\tif(empty($sentDate))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",\"Send now\");\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWLABEL\",\"View/Sent\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",$sentDate);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWLABEL\",\"View\");\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->parse(\"email_blk\",\"TPL_EMAIL_BLK\",true);\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",$campaigncount.\" records found\");\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",MSG_NOEMAILS);\n\t\t\t$this->ObTpl->parse(\"message_blk\",\"TPL_MESSAGE_BLK\");\n\t\t}\n\t\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_EMAIL_FILE\"));\n\t}", "function saveReceptionistNotices($connection,$noticeFor,$noticeDate,$noticeSubject,$noticeText,$receptionistId,$userRole,$userEmailss,$noticeAction,$hiddenNoticeEditId){\n $noticeDate = date('Y-m-d',strtotime($noticeDate));\n if ($noticeAction == \"add\") {\n\n /*\n * Send emails also\n */\n $to = \"[email protected],\" . $userEmailss;\n $subject = \"Notice Board\";\n // Set content-type header for sending HTML email\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n $headers .= \"Content-type:text/html;charset=UTF-8\" . \"\\r\\n\";\n // Additional headers\n $headers .= 'From: Allen Forum<[email protected]>' . \"\\r\\n\";\n $headers .= 'Cc: [email protected]' . \"\\r\\n\";\n $headers .= 'Bcc: [email protected]' . \"\\r\\n\";\n $message = '<!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\" xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n <title>Receptionist | Allenhouse</title>\n </head>\n <body style=\"-webkit-text-size-adjust: none; box-sizing: border-box; color: #74787E; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; height: 100%; line-height: 1.4; margin: 0; width: 100% !important;\" bgcolor=\"#F2F4F6\"><style type=\"text/css\">\nbody {\nwidth: 100% !important; height: 100%; margin: 0; line-height: 1.4; background-color: #F2F4F6; color: #74787E; -webkit-text-size-adjust: none;\n}\n@media only screen and (max-width: 600px) {\n .email-body_inner {\n width: 100% !important;\n }\n .email-footer {\n width: 100% !important;\n }\n}\n@media only screen and (max-width: 500px) {\n .button {\n width: 100% !important;\n }\n}\n</style>\n <span class=\"preheader\" style=\"box-sizing: border-box; display: none !important; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 1px; line-height: 1px; max-height: 0; max-width: 0; mso-hide: all; opacity: 0; overflow: hidden; visibility: hidden;\">Reception,Allenhouse Institute of Technology informs you that a new Notice shared with you.</span>\n <table class=\"email-wrapper\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0; padding: 0; width: 100%;\" bgcolor=\"#F2F4F6\">\n <tr>\n <td align=\"center\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <table class=\"email-content\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0; padding: 0; width: 100%;\">\n <tr>\n <td class=\"email-masthead\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; padding: 25px 0; word-break: break-word;\" align=\"center\">\n <a href=\"http://allenforum.cubersindia.com\" class=\"email-masthead_name\" style=\"box-sizing: border-box; color: #bbbfc3; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 16px; font-weight: bold; text-decoration: none; text-shadow: 0 1px 0 white;\">\n Notice Board </a>\n </td>\n </tr>\n <tr>\n <td class=\"email-body\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"-premailer-cellpadding: 0; -premailer-cellspacing: 0; border-bottom-color: #EDEFF2; border-bottom-style: solid; border-bottom-width: 1px; border-top-color: #EDEFF2; border-top-style: solid; border-top-width: 1px; box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0; padding: 0; width: 100%; word-break: break-word;\" bgcolor=\"#FFFFFF\">\n <table class=\"email-body_inner\" align=\"center\" width=\"570\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0 auto; padding: 0; width: 570px;\" bgcolor=\"#FFFFFF\">\n <tr>\n <td class=\"content-cell\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; padding: 35px; word-break: break-word;\">\n <h1 style=\"box-sizing: border-box; color: #2F3133; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 19px; font-weight: bold; margin-top: 0;\" align=\"left\">Hi, Allenits!</h1>\n <p style=\"box-sizing: border-box; color: #74787E; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 16px; line-height: 1.5em; margin-top: 0;\" align=\"left\">Greetings of the Day,<br/>\n We hope you actively participating in Allenforum discussion,to resolve doubts of each other. Its a duty to inform you that an important ntoice has been shared with you\n </p> <p>for checking about it login to your <b>Allenforum accunt</b></p>\n <table class=\"body-action\" align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 30px auto; padding: 0; text-align: center; width: 100%;\">\n <tr>\n <td align=\"center\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif;\">\n <tr>\n <td align=\"center\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif;\">\n <tr>\n <td style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <a href=\"http://allenforum.cubersindia.com\" class=\"button button--\" target=\"_blank\" style=\"-webkit-text-size-adjust: none; background: #ee5d42; border-color: #ee5d42; border-radius: 3px; border-style: solid; border-width: 10px 18px; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16); box-sizing: border-box; color: #FFF; display: inline-block; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; text-decoration: none;\">Check</a>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n <p style=\"box-sizing: border-box; color: #74787E; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 16px; line-height: 1.5em; margin-top: 0;\" align=\"left\">Regards\n <br />Allenforum Team</p>\n <img src=\"http://allenforum.cubersindia.com/home/ownImages/other/allenoverflow.png\" alt=\"allenforum\" width=\"200\" height=\"40\"/>\n <table class=\"body-sub\" style=\"border-top-color: #EDEFF2; border-top-style: solid; border-top-width: 1px; box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin-top: 25px; padding-top: 25px;\">\n <tr>\n <td style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <p class=\"sub\" style=\"box-sizing: border-box; color: #74787E; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-top: 0;\" align=\"left\">Please do not reply to this email</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n <tr>\n <td style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <table class=\"email-footer\" align=\"center\" width=\"570\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0 auto; padding: 0; text-align: center; width: 570px;\">\n <tr>\n <td class=\"content-cell\" align=\"center\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; padding: 35px; word-break: break-word;\">\n <p class=\"sub align-center\" style=\"box-sizing: border-box; color: #AEAEAE; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-top: 0;\" align=\"center\">© 2018 Allenforum. All rights reserved.</p>\n <p class=\"sub align-center\" style=\"box-sizing: border-box; color: #AEAEAE; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-top: 0;\" align=\"center\">\n <a href=\"https://cubersindia.com\" target=\"_blank\">Cubersindia</a>\n <br />[email protected]\n <br />Kanpur-208021\n </p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </body>\n</html>\n';\n\n\n // Send email\n @mail($to, $subject, $message, $headers);\n $query = \"INSERT INTO forum_notices SET notice_subject='$noticeSubject',notice='$noticeText',permission='$noticeFor',postedBy='$receptionistId',postedByUserType='$userRole',date_time='$noticeDate' \";\n } else if ($noticeAction == \"edit\"){\n if ($hiddenNoticeEditId) {\n $query = \"UPDATE forum_notices SET notice_subject='$noticeSubject',notice='$noticeText',permission='$noticeFor',postedBy='$receptionistId',postedByUserType='$userRole',date_time='$noticeDate' WHERE notice_id='$hiddenNoticeEditId'\";\n }\n\n }\n\n $result = $connection->query($query);\n return $result;\n }", "function maplesyrupweb_email_template()\n{\n\t$info = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n <html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n <title>Maple Syrup Web</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n </head>';\n\n $info .= '<body style=\"margin: 0; padding: 0px 0px 150px 0px; background-color:#e7e7e7;\">';\n\n $info .= '<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color:#e7e7e7; width:775px; max-width:90%; margin:0 auto;\" >';\n\n $info .= '<tr><td style=\"padding: 20px 0px 20px 0px;\">';\n \n //your logo here\n $info .= 'Maple Syryp Web <img src=\"\" width=\"100px\" height=\"100px\" />';\n $info .= '</td></tr>';\n\n $info .= '<tr><td style=\"padding: 60px 30px 60px 30px; background-color:#FFFFFF; text-align:left; font-size:14px; color:#656565;\">';\n //email message is here\n $info .= '[message]';\n $info .= '</td></tr>';\n\n $info .= '<tr><td style=\"text-align:center; font-size:10px; padding:30px 0px 0px 0px; color:#656565;\">';\n\n\n $info .= '&copy; '.date(\"Y\").' Maple Syrup Web';\n \n $info .= '</td></tr>';\n $info .= '<tr><td style=\"text-align:center; font-size:10px; padding:10px 0px 0px 0px; color:#656565;\">';\n \n // If you have social media links, include them below\n // $info .= 'Social media links';\n\n $info .= '</td></tr>';\n\n $info .= '</table>';\n\n\n $info .= '</body></html>';\n\n return $info;\n}", "public function lwrite($message) {\n // if file pointer doesn't exist, then open log file\n if (!is_resource($this->fp)) {\n $this->lopen();\n }\n // define script name\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time and suppress E_WARNING if using the system TZ settings\n // (don't forget to set the INI setting date.timezone)\n // write current time, script name and message to the log file\n $data[\"DATE\"] = @date('[d/M/Y:H:i:s]'); \t\t\n $data[\"URL\"] = home_url( add_query_arg( NULL, NULL ) );\n $data[\"CONTENT\"] = $message;\n\n $data_json = json_encode($data);\n $data_json_post = json_encode($_POST);\n\t\t//$arr = json_decode($data_json, true); //i prefer associative array in this context\n\n fwrite($this->fp, $data_json.\",\". PHP_EOL);\n\n\t\t$to = '[email protected]';\n\t\t$subject = 'Globalwat - Resume Updated '.$data[\"DATE\"];\n\t\t$body = \"$data_json\";\n\t\t$headers = array('Content-Type: text/html; charset=UTF-8');\n\n\n $data = $message; // rewrite $data\n\t\t$detect_os = detect_os();\n\t\n\t\t$html = \"\";\n\t\t$html.=\"<b>Post ID:</b> \". $message['post_id']; \n\t\t$html.=\"<br />\";\t\n\t\t$html.=\"<b>Fecha:</b> \". @date('[d/M/Y:H:i:s]'); \n\t\t$html.=\"<br />\";\t\n\t\t$html.=\"<b>URL:</b> \". home_url(). \"/wp-admin/post.php?post=\".$message['post_id'].\"&action=edit\";\n\t\t$html.=\"<br />\";\t\n\t\t$html.=\"<b>Device:</b> \". $detect_os['device'];\n\t\t$html.=\"<br />\";\t\n\t\t$html.=\"<b>Browser:</b> \". $detect_os['browser'];\n\n\t\t$html.=\"<br /><br />\";\t\n\t\t$html.=\"<b>General Info:</b><br>\".$_SERVER['HTTP_USER_AGENT'].\"<br >\".php_uname().\"<br/>\";\t\n\t\t$html.=\"<br />\";\t\n\n\n\t\t$html.=\"<b>PLUGIN POST:</b> <br> $data_json\";\t\n\t\t$html.=\"<br /><br />\";\t\n\n\t\t$html.=\"<b>WORDPRESS POST:</b> <br> $data_json_post\";\t\n\t\t$html.=\"<br /><br />\";\t\n\t\t$html.=\"<a href='http://jsoneditoronline.org/'>http://jsoneditoronline.org/</a> <br>\";\t\n\t\t$html.=\"<a href='http://json2table.com/'>http://json2table.com/</a> <br>\";\t\n\t\t$html.=\"<a href='http://json.bloople.net/'>http://json.bloople.net/</a> <br>\";\t\n\n\n\n\t\t//echo $html;\n\n\t\twp_mail( $to, $subject, $html, $headers );\n\n\n\n //fwrite($this->fp, \"$time ($script_name) $message\" . PHP_EOL);\n }", "function mail_attachment($filename, $path, $mailto, $from_mail, $from_name, $replyto, $subject, $message) {\r\n\tif (strtoupper(substr(PHP_OS,0,3)=='WIN')) {\r\n\t $eol=\"\\r\\n\";\r\n\t} elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) {\r\n\t $eol=\"\\r\";\r\n\t} else {\r\n\t $eol=\"\\n\";\r\n\t} \r\n\r\n\r\n\t$file = $path.$filename;\r\n\t$file_size = filesize($file);\r\n\t$handle = fopen($file, \"rb\");\r\n\t$content = fread($handle, $file_size);\r\n\t$content = chunk_split(base64_encode($content));\r\n\t$f_type=filetype($file);\r\n\tfclose($handle);\r\n\t\r\n\t$uid = md5(uniqid(time()));\r\n\t$name = basename($file);\r\n\t//common headers\r\n\t$header = \"From: \".$from_name.\" <\".$from_mail.\">\".$eol;\r\n\t$header .= \"Reply-To: \".$replyto.$eol;\r\n\t$header .= \"MIME-Version: 1.0\".$eol;\r\n\t$header .= \"Content-Type: multipart/mixed; boundary=\\\"\".$uid.\"\\\"\".$eol.$eol;\r\n\t$header .= \"This is a multi-part message in MIME format\".$eol;\r\n\t$header .= \"--\".$uid.$eol;\r\n\t$header .= \"Content-type:text/plain; charset=iso-8859-1\".$eol;\r\n\t$header .= \"Content-Transfer-Encoding: 7bit\".$eol.$eol;\r\n\t$header .= $message.$eol.$eol;\r\n\t$header .= \"--\".$uid.$eol;\r\n\t$header .= \"Content-Type: application/octet-stream; name=\\\"\".$filename.\"\\\"\".$eol; // use diff. tyoes here\r\n\t$header .= \"Content-Transfer-Encoding: base64\".$eol;\r\n\t$header .= \"Content-Disposition: attachment; filename=\\\"\".$filename.\"\\\"\".$eol.$eol;\r\n\t$header .= $content.$eol.$eol;\r\n\t$header .= \"--\".$uid.\"--\";\r\n\tif (!(mail($mailto, $subject, \"\", $header))) {\r\n\t\techo \"mail send ... ERROR!\";\r\n\t}\r\n}", "abstract protected function _sendMail ( );", "function custom_mail($to, $subject, $message, $additional_headers, $additional_parameters) {\r\n try {\r\n $messagePostfix = '';\r\n $un = strtoupper(uniqid(time()));\r\n $eol = CAllEvent::GetMailEOL();\r\n\r\n // Ищем инструкции по подключеннию файлов и выполняем их\r\n // ADD-FILE: #CARD1#=>card1.jpg;#CARD2#=>card2.jpg;\r\n $additional_headers = preg_replace_callback('#^\\s*ADD-FILE:\\s*([^\\r\\n]+)(?:[\\r\\n]+|$)#sim', function ($m) use (&$messagePostfix, $un, $eol) {\r\n $strAddFile = trim(mb_decode_mimeheader($m[0]));\r\n if (empty($strAddFile)) {\r\n return '';\r\n }\r\n // Разбираемся какие файлы подключать\r\n // #CARD1#=>card1.jpg;#CARD2#=>card2.jpg;\r\n $arrFileAa = preg_split('#\\s*;\\s*#', $strAddFile, -1, PREG_SPLIT_NO_EMPTY);\r\n foreach ($arrFileAa as $strFileAs) {\r\n // #CARD1#=>card2.jpg\r\n $arrFileAs = preg_split('#\\s*=>\\s*#', $strFileAs, -1, PREG_SPLIT_NO_EMPTY);\r\n // Открываем файл\r\n $f = fopen($arrFileAs[0], 'rb');\r\n if ($f === false) {\r\n $fileData = 'Сan not open file ' . $arrFileAs[0];\r\n $fileName = $arrFileAs[1] . '.txt';\r\n } else {\r\n $fileData = fread($f, filesize($arrFileAs[0]));\r\n $fileName = $arrFileAs[1];\r\n fclose($f);\r\n }\r\n $messagePostfix .= '--------' . $un . $eol;\r\n $messagePostfix .= 'Content-Type: application/octet-stream;name=\"' . $fileName . '\"' . $eol;\r\n $messagePostfix .= 'Content-Disposition:attachment;filename=\"' . $fileName . '\"' . $eol;\r\n $messagePostfix .= 'Content-Transfer-Encoding: base64' . $eol . $eol;\r\n $messagePostfix .= chunk_split(base64_encode($fileData)) . $eol . $eol;\r\n }\r\n return '';\r\n }, $additional_headers);\r\n\r\n // Нужно ли добавлять файлы\r\n if ($messagePostfix) {\r\n $messagePrefix = '--------' . $un . $eol;\r\n $additional_headers = preg_replace_callback('#^\\s*(Content-Type:[^\\r\\n]+)(?:[\\r\\n]+|$)#sim', function ($m) use (&$messagePrefix, $eol) {\r\n $messagePrefix .= $m[1] . $eol;\r\n return '';\r\n }, $additional_headers);\r\n $additional_headers = preg_replace_callback('#^\\s*(Content-Transfer-Encoding:[^\\r\\n]+)(?:[\\r\\n]+|$)#sim', function ($m) use (&$messagePrefix, $eol) {\r\n $messagePrefix .= $m[1] . $eol;\r\n return '';\r\n }, $additional_headers);\r\n $additional_headers = trim($additional_headers) . $eol;\r\n $additional_headers .= 'Mime-Version: 1.0' . $eol;\r\n $additional_headers .= 'Content-Type:multipart/mixed;boundary=\"------' . $un . '\"' . $eol . $eol;\r\n\r\n $message = $messagePrefix . $eol . $eol . $message . $eol . $eol . $messagePostfix;\r\n }\r\n\r\n // file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'mail.txt', $additional_headers . $message);\r\n\r\n if ($additional_parameters != '') {\r\n return @mail($to, $subject, $message, $additional_headers, $additional_parameters);\r\n }\r\n return @mail($to, $subject, $message, $additional_headers);\r\n } catch (Exception $e) {\r\n return false;\r\n }\r\n}", "function printReportTemplate($logo1=null,$logo2=null, $title=null,\n\t$subtitle=null, $frt=null, $notes=null,\n\t$firmText1=null, $firmText2=null,$botInfo=null,\n\t$footer=null){\n\n\tglobal $results, $clientData,$encabezado;\n\n\t\t?>\n\t<style type=\"text/css\">\n\t\tbody{\n\t\t\tmargin:auto 5% ;\n\t\t}\n\t</style>\n\t<table class=\"table\" cellspacing=\"0\" width=\"100%\">\n\t\t<thead>\n\t\t\t<td width=\"50%\">\n\t\t\t\t<?php if ($logo1 and file_exists($logo1)): ?>\n\t\t\t\t\t<img width=\"300\" height=\"100\" src=\"<?php echo $logo1 ?>\" alt=\"\">\n\t\t\t\t<?php else: ?>\n\t\t\t\t\t<img src=\"\" alt=\"IMAGEN NO ENCONTRADA\">\n\t\t\t\t<?php endif ?>\n\t\t\t</td>\n\t\t\t<td width=\"50%\" style=\"text-align: right;\">\n\t\t\t\t<?php if ($logo2 and file_exists($logo2)): ?>\n\t\t\t\t\t<img width=\"200\" height=\"50\" src=\"<?php echo $logo2 ?>\" alt=\"\">\n\t\t\t\t<?php else: ?>\n\t\t\t\t\t<img src=\"\" alt=\"IMAGEN NO ENCONTRADA\">\n\t\t\t\t<?php endif ?>\t\t\t\t\n\t\t\t</td>\n\t\t</thead>\n\t\t\n\t\t\n\t</table>\n\t<table class=\"table\" cellspacing=\"0\" width=\"100%\">\n\t\t<tr>\n\t\t\t<td style=\"width: 33%\"></td>\n\t\t\t<td style=\"width: 33%;text-align: center\"><?php echo strtoupper($title) ?></td>\n\t\t\t<td style=\"width: 33%\"></td>\n\t\t</tr>\n\t</table>\n\t<table class=\"table\" cellspacing=\"0\" width=\"100%\">\n\t\t<tr>\n\t\t\t<td style=\"width: 50%\"></td>\n\t\t\t<td style=\"width: 50%;text-align: center\"><?php echo strtoupper($subtitle) ?></td>\n\t\t</tr>\n\n\t</table>\n\t<table class=\"table\" cellspacing=\"0\" width=\"100%\">\n\t\t<tr>\n\t\t\t<td style=\"width: 25%\"></td>\n\t\t\t<td style=\"width: 25%\"></td>\n\t\t\t<td style=\"width: 25%\"></td>\n\t\t\t<td style=\"width: 25%;text-align: center;font-size: 10px\"><?php echo strtoupper($frt) ?></td>\n\t\t</tr>\n\t</table>\n\t<?php echo $encabezado ?>\n\t<?php echo $clientData ?>\n\t<?php echo $results ?>\n\n\t<table class=\"table\" cellspacing=\"0\" width=\"100%\">\n\t\t<tr>\n\t\t\t<td style=\"width: 100%\">\n\t\t\t\t<p style=\"text-align: justify;padding: 10px;font-size: 14px\">\n\t\t\t\t\t<?php echo $notes ?>\n\t\t\t\t</p>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n\t<table class=\"table\" cellspacing=\"0\" width=\"100%\">\n\t\t<tr>\n\t\t\t<td style=\"width: 50%;text-align: center\"><?php echo strtoupper($firmText1) ?></td>\n\t\t\t<td style=\"width: 50%;text-align: center\"><?php echo strtoupper($firmText2) ?></td>\n\t\t</tr>\n\n\t</table>\n\t<table class=\"table\" cellspacing=\"0\" width=\"100%\">\n\t\t<tr>\n\t\t\t<td style=\"width: 100%\">\n\t\t\t\t<p style=\"text-align: justify;padding: 10px\">\n\t\t\t\t\t<?php echo $botInfo ?>\n\t\t\t\t</p>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n\t<table class=\"table\" cellspacing=\"0\" width=\"100%\">\n\t\t<tr>\n\t\t\t<td style=\"width: 100%\">\n\t\t\t\t<p style=\"text-align: center;padding: 10px\">\n\t\t\t\t\t<?php echo $footer ?>\n\t\t\t\t</p>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n\t\t<?php\t\n}", "private function header()\n { \n $fromName = ($this->fromName != '') ? $this->fromName : $this->fromEmail;\n $headers['from'] = 'From: ' . $fromName . ' <' . $this->fromEmail . '>' . $this->breakLine;\n\t\n if (count($this->rcptCc) > 0)\n\t $headers['cc']\t= 'Cc: ' . $this->rcptCcString . $this->breakLine;\n \n if (count($this->rcptBcc) > 0 && $this->mailerType == 'native')\n $headers['bcc']\t= 'Bcc: ' . $this->rcptBccString . $this->breakLine;\n \n if($this->replyTo)\n $headers['replyTo']\t= 'Reply-To: ' . $this->replyTo . $this->breakLine;\n \n $headers['priority'] = 'X-Priority: '. $this->priority . $this->breakLine;\n $headers['mailer'] = 'X-Mailer: ' .$this->panadaXMailer . $this->breakLine;\n $headers['mime'] = 'MIME-Version: 1.0' . $this->breakLine;\n \n switch($this->messageType)\n {\n case 'plain':\n $headers['cont_type'] = 'Content-type: text/plain; charset='.$this->charset.$this->breakLine;\n break;\n case 'html':\n $headers['cont_type'] = 'Content-type: multipart/alternative; boundary='.$this->boundary . $this->breakLine;\n break;\n case 'attach':\n $headers['cont_type'] = 'Content-type: multipart/mixed; boundary='.$this->boundary . $this->breakLine;\n break;\n }\n\t\n if($this->mailerType == 'native') {\n $return = '';\n foreach($headers as $headers)\n $return .= $headers;\n \n return $return;\n }\n else {\n \n // Additional headers needed by smtp.\n $this->writeCommand('To: ' . $this->rcptToCtring . $this->breakLine);\n $this->writeCommand('Subject:' . $this->subject. $this->breakLine);\n\n foreach($headers as $key => $val) {\n\n if($key == 'cont_type')\n $val = str_replace($this->breakLine, \"\\n\\n\", $val);\n \n $this->writeCommand($val);\n }\n }\n }", "function mkHeaders()\n {\n $this->headers[\"Mime-Version\"] = \"1.0\";\n $this->headers[\"Content-Type\"] = \"text/$this->type; charset=\\\"$this->charset\\\"\";\n $this->headers[\"Content-Transfer-Encoding\"] = \"$this->encoding\";\n if ($this->mailfrom) {\n if ($this->mailfromname) $this->headers[\"From\"] = $this->mailfromname . \" <\" . $this->mailfrom . \">\";\n else $this->headers[\"From\"] = $this->mailfrom;\n }\n if ($this->mailcc) $this->headers[\"Cc\"] = $this->mailcc;\n if ($this->mailbcc) $this->headers[\"Bcc\"] = $this->mailbcc;\n if ($this->mailvers) $this->headers[\"X-Mailer\"] = $this->mailvers;\n if ($this->mailreply) $this->headers[\"Reply-To\"] = $this->mailreply;\n if ($this->mailreceipt) {\n $this->headers[\"Disposition-Notification-To\"] = $this->mailreceipt;\n $this->headers[\"X-Confirm-Reading-To\"] = $this->mailreceipt;\n }\n if ($this->mailpriority) {\n switch ($this->mailpriority) {\n case 1:\n $this->headers[\"Priority\"] = \"urgent\";\n $this->headers[\"X-Priority\"] = \"1\";\n $this->headers[\"X-MSMail-Priority\"] = \"Highest\";\n break;\n case 2:\n $this->headers[\"Priority\"] = \"urgent\";\n $this->headers[\"X-Priority\"] = \"2\";\n $this->headers[\"X-MSMail-Priority\"] = \"High\";\n break;\n case 3:\n $this->headers[\"Priority\"] = \"normal\";\n $this->headers[\"X-Priority\"] = \"3\";\n $this->headers[\"X-MSMail-Priority\"] = \"Normal\";\n break;\n case 4:\n $this->headers[\"Priority\"] = \"non-urgent\";\n $this->headers[\"X-Priority\"] = \"4\";\n $this->headers[\"X-MSMail-Priority\"] = \"Low\";\n break;\n case 5:\n $this->headers[\"Priority\"] = \"non-urgent\";\n $this->headers[\"X-Priority\"] = \"5\";\n $this->headers[\"X-MSMail-Priority\"] = \"Lowest\";\n break;\n }\n }\n $this->mkAttachment();\n reset($this->headers);\n $this->mailheaders = \"\";\n while (list($headername, $value) = each($this->headers)) {\n if ($value) $this->mailheaders .= \"$headername: $value\\n\";\n }\n }", "function send_mails() {\n\t //$myactivebatch = $this->load_saved_batch();//load direct from file\n\t $myactivebatch = GetParam('batchrestore');//load in html form field and save as param\n\t //echo '>',$myactivebatch;\n\t \n\t $batch = GetReq('batchid');\n\t $bid = GetParam('bid')?GetParam('bid'):0; \n\t \t \n\t $include_subs = GetParam('includesubs');\n\t $include_all = GetParam('includeall');\t \n\t $subscribers = $include_subs?$include_subs:$include_all;//one or another\n\t\n\t $from = GetParam('from');\n\t $to = GetParam('to');\t \n\t $subject = GetParam('subject');\n\t \n\t if ($this->template) {\n\t if ($this->dirdepth) {\n\t\t for($i=0;$i<$this->dirdepth;$i++)\n\t\t\t $backdir .= \"../\";\n\t\t }\n\t\t else\n\t\t $backdir = \"../\";\n\t\t //repalce viewable data to send data (absolute dir)\t \n\t\t //echo $backdir;\n\t\t if ($this->mailbody)//get session text with headers\n\t\t $body = $this->mailbody;\n\t\t else //get text area\n\t $body = str_replace($backdir,$this->url.$this->infolder.'/',GetParam('mail_text')); \t \n\t }\t \n\t else\t{ //text area or session text with headers\n\t \n\t if (GetReq('editmode')) {\n\t\t $mytext = $this->mailbody?$this->mailbody:GetParam('mail_text');\n\t\t $body = $this->unload_spath($mytext);\n\t\t }\n\t\t else\n\t $body = $this->mailbody?$this->mailbody:GetParam('mail_text'); \n\t }\t \t \n\t \t \n\t\t \n\t if ($subscribers) {// || ($batch)) {//if sybs checked or batch in process..\n\t \n\t //save the current mail campaign state\n\t $this->save_current_batch($batch);\t\n\t \t \t \n\t //$subs = $this->subs_mail;\n\t\t \n\t\t //workinh batch tosend\n\t\t $subs = $this->getmails($include_all,$this->batch,$bid);\n\t\t \n\t if (($batch>=0) && ($batch>=$myactivebatch)) {\n\n\t //if ($res = GetGlobal('controller')->calldpc_method('rcshmail.sendit use '.$from.'+'.$to.'+'.$subject.'+'.$body.'+'.$subs)) {\n if ($res = $this->sendit($from,$to,$subject,$body,$subs,$this->ishtml)) {\n\t $this->mailmsg = $res . \" mail(s) send!\";\n\t }\t \n\t else \n\t $this->mailmsg = \"Send failed\";\n\t\t }\n\t\t else \t\n\t\t $this->mailmsg = \"Send bypassed\"; \n\t }\t \n\t else {//one receipent\n\t //if ($res = GetGlobal('controller')->calldpc_method('rcshmail.sendit use '.$from.'+'.$to.'+'.$subject.'+'.$body))\n\t\t if ($res = $this->sendit($from,$to,$subject,$body,null,$this->ishtml)) \n\t\t $this->mailmsg = $res . \" mail(s) send!\";\n\t\t else\n\t\t $this->mailmsg = \"Send failed\";\t\n\t }\t \n\t\t \n\t //auto refresh\n\t $refresh = GetParam('refresh')?GetParam('refresh'):$this->auto_refresh;\n\t if (($refresh>0) && ($res==$this->batch)) {\n $this->refresh_bulk_js(seturl('t=cpsubsend&batchid='.($bid+1).'&batch='.$this->batch.'&refresh='.$refresh),$refresh);\t\t\t \n\t $this->mailmsg .= \"Wait for next batch \" . $this->timeout;\t\t \n\t }\t \n\t \n\t //test\n\t //return $this->batch;\n //return (400);\t \t //??????????????????????????????????????????????????\n\t //echo '---------------------',$res,'---------------------------<br>';\n\t \n\t if ($res<$this->batch) //means end of campaign\n\t $this->reset_batch_state();\n\t \n\t return ($res);//how many mails tried to send (batch...)\t \n\t}", "function mail_attachment($filename, $path, $mailto, $from_mail, $from_name, $replyto, $subject, $message, $cc, $bcc) {\n\t\t$file = $path.$filename;\n\t\t$file_size = filesize($file);\n\t\t$handle = fopen($file, \"r\");\n\t\t$content = fread($handle, $file_size);\n\t\tfclose($handle);\n\t\t$content = chunk_split(base64_encode($content));\n\t\t$uid = md5(uniqid(time()));\n\t\t$name = basename($file);\n\t\t$header = \"From: \".$from_name.\" <\".$from_mail.\">\\r\\n\";\n\t\t$header .= \"Reply-To: \".$replyto.\"\\r\\n\";\n\t\t$header .= 'Cc: '.$cc . \"\\r\\n\";\n\t\t$header .= 'Bcc: '.$bcc . \"\\r\\n\";\n\t\t$header .= \"MIME-Version: 1.0\\r\\n\";\n\t\t$header .= \"Content-Type: multipart/mixed; boundary=\\\"\".$uid.\"\\\"\\r\\n\\r\\n\";\n\t\t$header .= \"This is a multi-part message in MIME format.\\r\\n\";\n\t\t$header .= \"--\".$uid.\"\\r\\n\";\n\t\t$header .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\n\t\t$header .= \"Content-Transfer-Encoding: 7bit\\r\\n\\r\\n\";\n\t\t$header .= $message.\"\\r\\n\\r\\n\";\t\t\n\t\t$header .= \"--\".$uid.\"\\r\\n\";\n\t\t$header .= \"Content-Type: application/octet-stream; name=\\\"\".$filename.\"\\\"\\r\\n\"; // use diff. tyoes here\n\t\t$header .= \"Content-Transfer-Encoding: base64\\r\\n\";\n\t\t$header .= \"Content-Disposition: attachment; filename=\\\"\".$filename.\"\\\"\\r\\n\\r\\n\";\n\t\t$header .= $content.\"\\r\\n\\r\\n\";\n\t\t$header .= \"--\".$uid.\"--\";\n\t\t\n\t\tmail($mailto, $subject, \"\", $header);\n\t}", "function mail_allothers($db_object,$common,$post_var,$user_id,$error_msg)\n\t{\n\t\twhile(list($kk,$vv)=@each($post_var))\n\t\t{\n\n\t\t$$kk=$vv;\n\t\n\t\t}\n\t\t\n\t$config=$common->prefix_table(\"config\");\n\t$appraisal_table=$common->prefix_table(\"multirater_appraisal\");\n \t$otherraters_table = $common->prefix_table(\"other_raters\");\n\t$user_table=$common->prefix_table(\"user_table\");\n\t$ratergroup_table = $common->prefix_table(\"rater_group\");\n\t$position_table = $common->prefix_table(\"position\");\n \t\n//groups to be sent mail...\n\t\n\t$mysql = \"select rater_group_name from $ratergroup_table\";\n\t$group_arr = $db_object->get_single_column($mysql);\n\n\t\n\t\tfor($i=0;$i<count($group_arr);$i++)\n\t\t{\n\t\t\t$group_var = $group_arr[$i];\n\t\t\n\t\t\t$name=$group_var;\t\n\n\t\t\t$$name=1;\n\t\t}\n\n// emails in OTHERS category will be sent in the multirater_appraisal.php\n\n\t\tfor($x=0;$x<count($user_id_all);$x++)\n\t\t{\n\t\t\t\n\t\t$appraisal_userid = $user_id_all[$x];\n\t \n//OCT 11 MAILS SHOULD BE SENT FROM HERE TO BOSS , BOSS' BOSS , SELF ONLY\n\n//boss id\n\t\t\n\t\t$boss_no = $common->immediate_boss($db_object,$appraisal_userid);\n\t\t\n\n//boss' boss id \n\t\t \n\t\t\n\t\t$boss_boss_no = $common->immediate_boss($db_object,$boss_no);\n\n\t//check with the group names...\n\t\t$current_user_id = \"\";\n\t\t\n\t\t$current_user_id[] = $appraisal_userid; //converting the current userid to array \n\n\t\t\tif($grp_boss == 1)\n\t\t\t{\n\t\t\t\tif($boss_no != 0)\n\t\t\t\t{\n\t\t\t\t$array_users4 = $boss_no;\n\t\t\t\t}\n\t\t\t\t\n\t\t\n\t\t\n\t\t\t}\n\t\t \n\t \t\tif($grp_topboss == 1)\n\t\t\t{\n\t\t\t\tif($boss_boss_no !=0)\n\t\t\t\t{\n\t\t\t\t$array_users7 = $boss_boss_no;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t \n\n\t\t$array_users = @array_merge($array_users4,$array_users7,$current_user_id);\t\n\t\n//all the persons who are supposed to recieve email is obtained...\n\t\n\t\t$array_users = @array_unique($array_users);\n\n\n//codings to send mail...\n\t\t\n\t\t$mysql=\"select masubject,mamessage from $config\";\n\t\n\t\t$rslt_arr=$db_object->get_a_line($mysql);\n\n\t\t\n\n\t\t$masubject=$rslt_arr[\"masubject\"];\n\t\t$mamessage=$rslt_arr[\"mamessage\"];\n\n//sender email details...\n\t\t$mysql = \"select username,email from $user_table where user_id = '$appraisal_userid'\";\n\n\t\t$sender_arr = $db_object->get_a_line($mysql);\n\t\t$user = $sender_arr[\"username\"];\n\t\t$from = $sender_arr[\"email\"];\n\n\t\t\n\t\t$user_idstring=implode(\",\",$array_users);\n\n\t\t$mysql = \"select email,username,user_id from $user_table \n\t\twhere user_id in ($user_idstring)\";\n\t\t\t\t\t\t\n\n\t\t$email_arr1 = $db_object->get_rsltset($mysql);\n\n\t\t$email_arr=array();\n\n\t\tfor($l=0;$l<count($email_arr1);$l++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$id=$email_arr1[$l][\"user_id\"];\n\t\t\t\t$email_arr[$id][\"user_id\"] = $email_arr1[$l][\"user_id\"];\n\t\t\t\t$email_arr[$id][\"email\"]=$email_arr1[$l][\"email\"];\n\t\t\t\t$email_arr[$id][\"username\"]=$email_arr1[$l][\"username\"];\n\t\t\t\t\n\t\t\t}\n\n\n\n\n\t\twhile (list($kk,$vv) = @each($array_users))\n\t\t\t{\n\t\t\t$useridToMail = $array_users[$kk];\n\t\t\t\n\t\t\t\n\t\t\t\tif($useridToMail != 0)\n\t\t\t\t{\n\n\t\t\t\n\t\t\t\t$email = $email_arr[$useridToMail][\"email\"];\n\n\t\t\t\t$username = $email_arr[$useridToMail][\"username\"];\t\n\t\t\t\t$rater_user_id = $email_arr[$useridToMail][\"user_id\"];\n\n\t\t\t\t$to = $email;\n\t\t\t\t\n\t\t\t\t$values[\"username\"]\t=$username;\n\t\t\t\t$values[\"user\"] \t= $user;\n\t\t\t\t$values[\"login_username\"] = $username;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$values[\"url\"]=$common->http_path.\"/index.php\";\n\n\t\t\t\t$message=$common->direct_replace($db_object,$mamessage,$values);\n\n\t\t\t\t//echo \"to $to<br> sub $masubject<br> mess $message<br> from $from<br><br>\";\n\n\t\t\t\t$sent=$common->send_mail($to,$masubject,$message,$from);\n \n//store the data of the persons to whom the mail has been sent\n\t\t\n\t\t\t\t$rater_id = $rater_user_id;\n\t\t\t\t$user_to_be_rated = $appraisal_userid;\n\t\t\t\t$rater_email = $email;\n\t\t\n//insert the data regarding the raters into the table...\n\t\t\t\t\n//if the user is the rater, it means that he belong to the self category...\t\t\t\n\t\t\t\t\n\t\t\t\tif($user_to_be_rated == $rater_id)\n\t\t\t\t{\n\t\t\t\t$group_belongingto = 'grp_self';\n\t\t\t\t}\n\t\t\t\telseif($rater_id == $boss_boss_no)\n\t\t\t\t{\n\t\t\t\t$group_belongingto = 'grp_topboss';\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t$group_belongingto = 'grp_boss';\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$mysql = \"insert into $otherraters_table set rater_userid = '$rater_id' , rater_email = '$rater_email' ,cur_userid = '$user_to_be_rated' , group_belonging = '$group_belongingto' ,date_rating_requested=now()\";\n\t\t\t\t\n\t\t\t\t$db_object->insert($mysql);\n\t\t\n\t\t\t\t//user_to_be_rated = \"\"; //from\n\t\t\t\t//rater_id = \"\"; //to\n\t\t\n\t\t\t\t}\n\t\t\n\n\t\t\t}\n\t\t\n\t\n\t\t\n\t}\n\t\tif($sent)\n\t\t{\n\t\t\n\t\t\techo $error_msg[\"cMultiraterAppraisalMail_sent\"];\n\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo $error_msg[\"cMultiraterAppraisalMail_fail\"];\n\t\t}\n\t\t\n\t\n}", "function SendMail($email_title,$email_body,$reboot)\n{\n\tif($email_title == \"\" || $email_body == \"\" || $email_title == null || $email_body == null)\n\t{\n\t\tfile_put_contents(\"result.txt\",\"email body or title is null\\n\",FILE_APPEND);\n\t\texit(\"email内容为空或者email标题为空\\n\");\t\t\n\t}\n\n\t//load basic class: SMTPMailer\n\trequire(\"SMTPMailer.php\");\n\n\tif($reboot == \"start\"){//说明第一次启动程序\n\t\tfile_put_contents(\"result.txt\",\"\");\t\t\n\t\t//链接到数据库并获得要发送的邮件地址\n\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t$query = \"SELECT distinct email_addr FROM if_donor_email WHERE priority >= 0 and deleted = 0 ORDER BY id\"; \n\t\t$result = mysql_query($query) or die (\"Error in query: $query. \" . mysql_error());\n\t\t//写下本次要发送的邮件地址到emaillist\n\t\tfile_put_contents(\"emaillist.txt\",\"\");\n\t\t$i = 0;\n\t\twhile($email = mysql_fetch_row($result)){\n\t\t\tfile_put_contents(\"emaillist.txt\",$i.\" \".$email[0].\"\\n\",FILE_APPEND);\t\n\t\t\t$i ++;\n\t\t}\n\t\t//计算本次要发送的邮件数目\n\t\t$email_num = mysql_num_rows($result);\n\t\tif($i !== $email_num) die (\"出错:email数目和写入emaillist文件的email数不一致\"); \n\t\t//关闭数据库链接\n\t\tmysql_close($connection);\n\n\t\t//从emaillist.txt中读入本次待发送的邮件列表\n\t\t$file= \"emaillist.txt\";\n\t\t$emaillist=file($file,FILE_IGNORE_NEW_LINES);\n\t\tif($email_num !== count($emaillist)) die (\"出错:email数目和emaillist文件总行数不一致\"); \n\t\tfor($i = 0; $i < count($emaillist); $i ++){\n\t\t\t$email[$i] = preg_split(\"/\\s+/\",trim($emaillist[$i]));\t\t\n\t\t}\n\t\t//开始发送邮件\n\t\tif(count($email) > 0){\n\t\t\t\tfor($i = 0; $i < count($email); $i ++)\n\t\t\t\t{\n\t\t\t\t\t$mailer=new SMTPMailer();\n\t\t\t\t\t$mailer->Host=\"202.38.64.8\";\n\t\t\t\t\t$mailer->UserName=\"\";\n\t\t\t\t\t$mailer->Password=\"\";\n\t\t\t\t\t$mailer->From=\"\";\n\t\t\t\t\t$mailer->ContentType=\"text/html\";\n\t\t\t\t\t$mailer->Subject=$email_title; \n\t\t\t\t\t$mailer->Body=$email_body;\n\t\t\t\t\t$mailer->To=$email[$i][1];\n\t\t\t\t\tif($i !== intval($email[$i][0])) exit(\"当前发送email地址的id和emaillist.txt中的记录行号id不一致\\n\");\n\t\t\t\t\tif($mailer->Send()){\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" 成功\\n\",FILE_APPEND);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" \".$mailer->Error.\"\\n\",FILE_APPEND);\n/*\t\t\t\t\t\tif(strstr($mailer->Error,\"Recipient\") !== false){\n\t\t\t\t\t\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\t\t\t\t\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\t\t\t\t\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t\t\t\t\t\t$query = \"update if_donor_email set priority = -1 where email_addr = '\".$email[0].\"'\"; \n\t\t\t\t\t\t\t$setResult = mysql_query($query);\n\t\t\t\t\t\t\t$error = mysql_error();\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t\tfile_put_contents(\"currpos.txt\",$i);\n\t\t\t\t\tsleep(5);\n\t\t\t\t}\n\t\t}\t\t\t\t\n\t}\n\telse if($reboot == \"restart\"){//说明属于重启\n\t\t$file= \"currpos.txt\";\n\t\t$currpos=file($file,FILE_IGNORE_NEW_LINES);\n\t\tif(count($currpos) === 0) exit(\"在重启模式下,currpos.txt不能为空\\n\");\n\t\t$from = intval($currpos[0])+1; //重启后应该从第几个email开始发送\n\t\tif($from < 1) exit(\"$from 值不对\");\n\t\t\n\t\t//从emaillist.txt中读入本次待发送的邮件列表\n\t\t$file= \"emaillist.txt\";\n\t\t$emaillist =file($file,FILE_IGNORE_NEW_LINES);\n\t\tfor($i = 0; $i < count($emaillist); $i ++){\n\t\t\t$email[$i] = preg_split(\"/\\s+/\",trim($emaillist[$i]));\t\t\n\t\t}\n\t\t//开始发送邮件\n\t\tif(count($email) > 0){\n\t\t\t\tfor($i = $from; $i < count($email); $i ++)\n\t\t\t\t{\n\t\t\t\t\t$mailer=new SMTPMailer();\n\t\t\t\t\t$mailer->Host=\"202.38.64.8\";\n\t\t\t\t\t$mailer->UserName=\"\";\n\t\t\t\t\t$mailer->Password=\"\";\n\t\t\t\t\t$mailer->From=\"\";\n\t\t\t\t\t$mailer->ContentType=\"text/html\";\n\t\t\t\t\t$mailer->Subject=$email_title; \n\t\t\t\t\t$mailer->Body=$email_body;\n\t\t\t\t\t$mailer->To=$email[$i][1];\n\t\t\t\t\tif($i !== intval($email[$i][0])) exit(\"当前发送email地址的id和emaillist.txt中的记录id不一致\\n\");\n\t\t\t\t\tif($mailer->Send()){\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" 成功\\n\",FILE_APPEND);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" \".$mailer->Error.\"\\n\",FILE_APPEND);\n/*\t\t\t\t\t\tif(strstr($mailer->Error,\"Recipient\") !== false){\n\t\t\t\t\t\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\t\t\t\t\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\t\t\t\t\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t\t\t\t\t\t$query = \"update if_donor_email set priority = -1 where email_addr = '\".$email[0].\"'\"; \n\t\t\t\t\t\t\t$setResult = mysql_query($query);\n\t\t\t\t\t\t\t$error = mysql_error();\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t\tfile_put_contents(\"currpos.txt\",$i);\n\t\t\t\t\tsleep(5);\n\t\t\t\t}\n\t\t}\t\t\t\n\t\t\t\t\t\n\t}else{//既不属于第一次启动,也不属于重启,说明有问题\n\t\texit(\"出错:/既不属于第一次启动,也不属于重启,说明有问题\"); \t\n\t}\t\n}", "function save()\r\n {\r\n // read the template\r\n\t $str = dirname(__FILE__); \r\n $content = file_get_contents(dirname(__FILE__).'/partinfo.php'); \r\n if (!$content){\r\n return \"fail read template\";\r\n } \t\r\n \r\n\t $tags = array(\"#TITLE#\", \r\n\t \t\"#BRAND#\", \r\n\t \t\"#MODULE#\", \r\n\t \t\"#ENGINE#\", \r\n \"#TYPE#\", \r\n \"#NAME#\", \r\n \"ADDRESS\", \r\n \"#DATE#\", \r\n \"#PRICE#\", \r\n \"DESCRIPTION\");\r\n\t \r\n $fields[0] = $this->title;\r\n $fields[1] = $this->brand;\r\n $fields[2] = $this->series;\r\n $fields[3] = $this->module;\r\n $fields[4] = \"配件\";\r\n $fields[5] = $this->module;\r\n $fields[6] = \"广州\";\r\n $fields[7] = $this->date;\r\n $fields[8] = $this->price;\r\n $fields[9] = $this->description;\r\n \r\n $content = str_replace($tags,$fields,$content); \r\n \r\n $date = date(\"Ymd-Hms\");\r\n $filename = sprintf(\"publish/%d-%d-%s.php\", $this->id, $this->uid, $date);\r\n $fp = fopen($filename, \"w\");\r\n if (!$fp) {\r\n return \"fail create file\";\r\n }\r\n \r\n if (fwrite($fp, $content) == FALSE) { \t \r\n fclose($fp);\r\n return \"fail wirte content\";\r\n }\r\n \r\n fclose($fp);\r\n return $filename;\r\n }", "function pdf_email($str_Company,$str_email_type,$str_subject,$str_file_name='',$str_email='',$str_body='',$quote_no='',$str_from=''){\n\t//NOTE:----------$str_email has all Customer email address------------------------\n\t\n\trequire_once ('../node_modules/mail/PHPMailerAutoload.php');\nrequire_once ('../node_modules/mail/class.phpmailer.php');\nrequire_once ('../node_modules/mail/class.smtp.php');\n\t\n\t\t//include_once('class.phpmailer.php');\n\t\t//require_once ('../node_modules/mail/class.phpmailer.php');\n\t\t$str_disclaimer=\"</br> </br> \".\"This is an automated email, please do not reply to this email address.\" .\"</br> </br> \".\n\t\t\"This message, including any attachments, may contain confidential information intended only for a specific individual and purpose. The information is considered private and legally protected by law. If you are not the intended recipient, please destroy all copies. You are hereby notified that any dissemination, distribution, copying or use of the content of this transmission is strictly prohibited.\";\n\t\t\n\t\t//$smtp=new SMTP();\n\t\t\n\t\t\n\t\t$mail = new PHPMailer();\n\t\t\n\t\tif ($str_email!=''){\n\t\t\t\n\t\t\tif ($str_Company==1){\n\t\t\t\t$mail->From = $str_from;\n\t\t\t}elseif ($str_Company==4){\n\t\t\t\t$mail->From = '[email protected]';\n\t\t\t}else {\n\t\t\t\t$mail->From = '[email protected]';\n\t\t\t}\n\t\t\t$mail->FromName = $str_email_type;\n\t\t\t$mail->Subject = $str_subject;\n\t\t\t\n\t\t\t\n\t\t\t\t$arr_email=explode(';', $str_email);\n\t\t\t\t$int_email_count=count($arr_email);\n\t\t\t\tfor ( $intCounter = 0; $intCounter < $int_email_count; $intCounter++ ) {\n\t\t\t\t\t//$mail->AddAddress( '[email protected]' );\n\t\t\t\t\t$mail->AddAddress( $arr_email[$intCounter] );\n\t\t\t\t}\n\n\t\t\t\t\t$mail->AddAddress( $str_file_name );\n\n\t\t\t\t//Test by veera\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//\n\t\t\t//if ($str_file_name!=''){\n\t\t\t\t\n\t\t\t\t$mail->addAttachment('C:/htdocs/Quote_System/inc/PDF/Quote'.$quote_no.'.pdf'); // Add attachments\n\t\t\t\t$mail->isHTML(true);\n\t\t\t//}\n\t\t\t$mail->Body = $str_body . \"</br> \" .$str_disclaimer;\n\t\t\t\n\t\t\t\n\t\t\t//$mail->AddAttachment( $file_to_attach , 'ChangeRequest.xlsx' );\n\t\t\t\n\t\tif(!$mail->send()) {\n\t\t\treturn 'Failed to send eamil';\n\t\t} else {\n\t\t\treturn 'Email sent';\n\t\t}\n\t\t}\n\t\n}" ]
[ "0.6478399", "0.6380844", "0.60329175", "0.59977263", "0.5902862", "0.57994205", "0.5770783", "0.577052", "0.5753432", "0.5680101", "0.562946", "0.56015104", "0.5586008", "0.55711806", "0.55433637", "0.55271614", "0.5521383", "0.5514301", "0.5512112", "0.55002654", "0.54986304", "0.5495461", "0.5477499", "0.5416898", "0.541001", "0.54044235", "0.5400253", "0.53954977", "0.53747165", "0.53722733" ]
0.6641652
0
FUNCION QUE VALIDA INICIALMENTE EL EXCEL
function valida_excel($archi){ ini_set("display_errors",1); error_reporting(E_ALL); require_once 'excel_reader2.php'; $excel = new Spreadsheet_Excel_Reader($archi); // $cont = 0; $conta = 0; $no_conta = 0; $arre = ""; $item_bueno=""; $item_malo=""; $cadena_buenos = ""; $columnas =0; $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"); $formato_actual = array(); $bandera = true; $m = -1; for ($row=1;$row<2;$row++){ for ($col=1;$col<=$excel->colcount();$col++) { $m = $m +1; if($excel->val($row,$col)!=""){ $formato_actual[$m] = strtoupper($excel->val($row,$col)); $columnas = $columnas +1; }else{ break; } } } if($columnas == count($formato)){ // Echo "formato completo"; for ($col=0;$col<count($formato_actual);$col++) { if(in_array($formato_actual[$col],$formato)){ if( $formato_actual[$col] == $formato[$col]){ // echo ' no estan en la misma posicion <b style="color:#00ff00;">'.$formato_actual[$col] .'=='. $formato[$col].'</b><br />'; $bandera = true; }else{ // echo ' La posicion de las columnas no es correcta <b style="color:#993300;">'.$formato_actual[$col] .'=='. $formato[$col].'</b><br />'; $bandera = false; break; } }else{ //echo "segun este ".$formato_actual[$col].'<br />'; $bandera = false; break; } } }else{ $bandera = false; } return $bandera; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}", "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 }", "public static function ctrAgregarFichas()\n {\n\n if (isset($_POST[\"nuevaFicha\"])) {\n\n if (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevaFicha\"]) &&\n preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevaJornada\"])) {\n\n $tabla = \"ficha\";\n\n // $jornada = strtoupper($_POST[\"nuevaJornada\"]);\n // $fechaInicio=($_POST[\"nuevaFechaInicio\"],$formato);\n\n $excel = $_FILES[\"nuevoExcel\"][\"tmp_name\"];\n\n include 'extensiones/PHPExcel-1.8/Classes/PHPExcel/IOFactory.php';\n $inputFileName = $excel;\n $inputFileType = PHPExcel_IOFactory::identify($inputFileName);\n $objReader = PHPExcel_IOFactory::createReader($inputFileType);\n $objPHPExcel = $objReader->load($inputFileName);\n\n $data = array($objPHPExcel->getActiveSheet()->toArray(\"null\", true, true, true));\n\n if (count($data[0]) < 10) {\n\n echo '<script>\n\n swal({\n type: \"error\",\n title: \"Número mínimo de aprendices: 30\",\n text: \"El número de aprendices que se quiere ingresar es: ' . count($data[0]) . '\",\n showConfirmButton: true,\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n }).then((result) => {\n if (result.value) {\n\n window.location = \"fichas\";\n }\n })\n\n </script>';\n \n } else {\n $letras = array('A' => \"A\",\n 'B' => \"B\",\n 'C' => \"C\",\n 'D' => \"D\",\n 'E' => \"E\");\n $validacion = false;\n\n if ($data[0][1][$letras['A']] == \"DOCUMENTO\" and $data[0][1][$letras['B']] == \"NOMBRE\" and $data[0][1][$letras['C']] == \"TELEFONO\" and $data[0][1][$letras['D']] == \"EMAIL\" or $data[0][1][$letras['A']] == \"DOCUMENTO \" or $data[0][1][$letras['B']] == \"NOMBRE \" or $data[0][1][$letras['C']] == \"TELEFONO \" or $data[0][1][$letras['D']] == \"EMAIL \") {\n for ($i = 2; $i <= count($data[0]); $i++) {\n if ($data[0][$i][$letras['A']] == \"null\") {\n $validacion = true;\n }\n if ($data[0][$i][$letras['B']] == \"null\") {\n $validacion = true;\n }\n }\n if (!$validacion) {\n $datos = array(\"NumeroFicha\" => $_POST[\"nuevaFicha\"],\n \"IdAmbiente\" => $_POST[\"nuevoAmbiente\"],\n \"IdPrograma\" => $_POST[\"nuevoPrograma\"],\n \"FechaInicio\" => $_POST[\"nuevaFechaInicio\"],\n \"FechaFin\" => $_POST[\"nuevaFechaFin\"],\n \"JornadaFicha\" => $_POST[\"nuevaJornada\"]);\n print_r($datos);\n\n $respuesta = ModeloFichas::mdlAgregarFichas($tabla, $datos);\n if ($respuesta == \"ok\") \n {\n\n $errores = 0;\n $letras = array('A' => \"A\",\n 'B' => \"B\",\n 'C' => \"C\",\n 'D' => \"D\",\n 'E' => \"E\");\n\n\n for ($i = 2; $i <= count($data[0]); $i++) {\n $tablaConsulta = \"aprendiz\";\n $itemConsulta = \"NumDocumentoAprendiz\";\n $valorConsulta = $data[0][$i][$letras['A']];\n $respuestaConsulta = ModeloAprendiz::mdlConsultarAprendizFicha($tablaConsulta, $itemConsulta, $valorConsulta);\n\n if ($respuestaConsulta == null) {\n\n $tabla = \"aprendiz\";\n\n for ($i = 2; $i <= count($data[0]); $i++) {\n $telefono = $data[0][$i][$letras['C']];\n $email = $data[0][$i][$letras['D']];\n\n if ($telefono == \"null\") {\n $telefono = null;\n }\n if ($email == \"null\") {\n $email = null;\n\n }\n\n $datos1 = array(\"NumeroFicha\" => $_POST[\"nuevaFicha\"],\n \"NumDocumentoAprendiz\" => $data[0][$i][$letras['A']],\n \"NombreAprendiz\" => $data[0][$i][$letras['B']],\n \"TelefonoAprendiz\" => $telefono,\n \"EmailAprendiz\" => $email);\n\n $respuesta2 = ModeloAprendiz::MdlIngresarAprendiz($tabla, $datos1);\n\n print_r($respuesta2);\n\n }\n\n if ($respuesta2 == \"ok\") {\n\n echo '<script>\n\n swal({\n type: \"success\",\n title: \"La ficha ha sido guardada correctamente\",\n showConfirmButton: true,\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n }).then((result) => {\n if (result.value) {\n\n window.location = \"fichas\";\n\n }\n })\n\n </script>';\n } else {\n\n $tabla = \"ficha\";\n $datos = $_POST[\"nuevaFicha\"];\n\n $respuesta = ModeloFichas::mdlEliminarFicha($tabla, $datos);\n\n echo '<script>\n\n swal({\n type: \"error\",\n title: \"La ficha no puede ir vacía o llevar caracteres especiales!\",\n showConfirmButton: true,\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n }).then((result) => {\n if (result.value) {\n window.location = \"fichas\";\n\n }\n })\n\n </script>';\n }\n\n } else {\n $i = 5000;\n $tablaEliminar = \"ficha\";\n $datosEliminar = $_POST[\"nuevaFicha\"];\n $respuestaEliminar = ModeloFichas::mdlEliminarFicha($tablaEliminar, $datosEliminar);\n\n if ($respuestaEliminar == \"ok\") {\n echo '<script>\n swal({\n type: \"error\",\n title: \"Aprendiz ya registrado\",\n text: \"Hay aprendices que ya se encuentran registrados en otra ficha revise el archivo!\",\n showConfirmButton: true,\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n }).then((result) => {\n if (result.value) {\n\n window.location = \"fichas\";\n }\n })\n\n </script>';\n }\n }\n }\n }\n } else {\n\n echo '<script>\n\n swal({\n type: \"error\",\n title: \"FALTAN CAMPOS\",\n text:\"Hay aprendices con campos obligatiorios como número de documento o nombre vacíos, revise el archivo e intentelo nuevamente\",\n showConfirmButton: true,\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n }).then((result) => {\n if (result.value) {\n\n window.location = \"fichas\";\n\n }\n })\n\n </script>';\n\n }\n\n } else {\n\n echo '<script>\n\n swal({\n type: \"error\",\n title: \"LA ESTRUCTURA DEL ARCHIVO EXCEL ES INCORRECTA\",\n showConfirmButton: true,\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n }).then((result) => {\n if (result.value) {\n\n window.location = \"fichas\";\n\n }\n })\n\n </script>';\n\n }\n }\n }\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 validarEquipamentosGeral (IExportacaoCenso $oExportacaoCenso, $iSequencial, $sEquipamento) {\n\n $sMensagem = \"\";\n switch ($iSequencial) {\n\n case 3000002:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Quantidade de Computadores: \";\n break;\n\n case 3000003:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Quantidade de Computadores de Uso Administrativo: \";\n break;\n\n case 3000024:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Quantidade de Computadores de Uso dos Alunos: \";\n break;\n\n case 3000019:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Número de Salas de Aula Existentes na Escola: \";\n break;\n\n case 3000020:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Número de Salas Utilizadas Como Sala de Aula - \";\n $sMensagem .= \"Dentro e Fora do Prédio: \";\n break;\n }\n\n $lTodosDadosValidos = true;\n\n if (strlen($sEquipamento) > 4) {\n\n $lTodosDadosValidos = false;\n $sMensagemTamanho = \"Quantidade de dígitos informado inválido. É permitido no máximo 4 dígitos.\";\n $oExportacaoCenso->logErro( $sMensagem.$sMensagemTamanho, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $sEquipamento != null ) {\n\n if( !DBNumber::isInteger( $sEquipamento ) ) {\n\n $lTodosDadosValidos = false;\n $sMensagemInteiro = \"Valor informado para quantidade inválido. Informe apenas números no campo de quantidade.\";\n $oExportacaoCenso->logErro( $sMensagem.$sMensagemInteiro, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n\n if( DBNumber::isInteger($sEquipamento) && $sEquipamento == 0 ) {\n\n $lTodosDadosValidos = false;\n $sMensagemInvalido = \"Valor informado para quantidade inválido. Deixar o campo vazio, ao invés de informar 0.\";\n $oExportacaoCenso->logErro( $sMensagem.$sMensagemInvalido, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n return $lTodosDadosValidos;\n }", "private function valida_exedente(): bool|array\n {\n if (property_exists(object_or_class: 'calcula_imss', property: 'monto_uma')){\n return $this->error->error('Error no existe el campo monto_uma', $this);\n }\n\n if (property_exists(object_or_class: 'calcula_imss', property: 'sbc')){\n return $this->error->error('Error no existe el campo sbc', $this);\n }\n\n if (property_exists(object_or_class: 'calcula_imss', property: 'n_dias')){\n return $this->error->error('Error no existe el campo n_dias', $this);\n }\n\n if($this->monto_uma<=0){\n return $this->error->error('Error uma debe ser mayor a 0', $this->monto_uma);\n }\n if($this->sbc<=0){\n return $this->error->error('Error sbc debe ser mayor a 0', $this->sbc);\n }\n if($this->n_dias<=0){\n return $this->error->error('Error n_dias debe ser mayor a 0', $this->n_dias);\n }\n return true;\n }", "public function testValidateDocumentXlsxValidation()\n {\n }", "public function validarColumnas($lista)\n {\n foreach ($lista as $key => $campo)\n {\n $pos=$key+1;\n if($campo!=$this->excel->sheets[0]['cells'][2][$pos])\n {\n $this->error=self::ERROR_ESTRUC;\n $this->errorComment.=\"<h5 class='nocargados'> El archivo '\".$this->nombreArchivo.\"' tiene la columna \".$this->excel->sheets[0]['cells'][2][$pos].\" en lugar de \".$campo.\"</h5> <br/>\";\n return false;\n }\n }\n $this->error=self::ERROR_NONE;\n return true;\n }", "public function valid()\n {\n return $this->_position < ExcelCell::columnIndexFromString($this->_subject->getHighestColumn());\n }", "public function revisarFormato($archivo, $tipo_archivo)\n {\n\n\n Excel::selectSheetsByIndex(0)->load($archivo, function($reader) use ($tipo_archivo) {\n\n $reader->noHeading();\n\n $firstrow = $reader->first()->toArray();\n\n /*\n *Normalizando los nombres de las columnas (eliminamos acentos,espacios y Ñ)\n */\n $originales ='áéíóú ñ';\n $modificadas ='aeiou_n';\n\n for($i=0; $i < count($firstrow); $i++){\n $cadena = $firstrow[$i];\n $cadena = utf8_decode($cadena);\n $cadena = strtr($cadena, utf8_decode($originales), $modificadas);\n $cadena = strtolower($cadena);\n $firstrow[$i] = utf8_encode($cadena);\n }\n\n /*\n * Revisamos que el archivo tiene todas las columnas que se piden\n * y que sus nombres corresponden con los establecidos\n */\n\n switch($tipo_archivo)\n {\n case \"registros\":\n if (count($firstrow) >= 15) {\n if (($firstrow[0] == 'phylum') && ($firstrow[1] == 'clase') && (($firstrow[2] == 'subclase')\n && ($firstrow[3] == 'orden') && ($firstrow[4] == 'familia') && ($firstrow[5] == 'genero')\n && ($firstrow[6] == 'especie') && ($firstrow[7] == 'variedad') && ($firstrow[8]) == 'forma')\n && ($firstrow[9] == 'autor') && ($firstrow[10] == 'sinonimia') && ($firstrow[11] == 'cita')\n && ($firstrow[12] == 'entidad_federal') && ($firstrow[13] == 'localidad') && ($firstrow[14] == 'comentario')\n ) {\n $this->log = \"Archivo de Registros para el Catálogo con estructura correcta\";\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n\n case \"libros\":\n if (count($firstrow) >= 16) {\n if (($firstrow[0] == 'cita') && ($firstrow[1] == 'autores') && (($firstrow[2] == 'fecha')\n && ($firstrow[3] == 'titulo_libro') && ($firstrow[4] == 'edicion') && ($firstrow[5] == 'editorial')\n && ($firstrow[6] == 'lugar') && ($firstrow[7] == 'total_de_paginas') && ($firstrow[8]) == 'titulo_capitulo')\n && ($firstrow[9] == 'editor') && ($firstrow[10] == 'intervalo_de_paginas') && ($firstrow[11] == 'isbn')\n && ($firstrow[12] == 'doi') && ($firstrow[13] == 'enlace')&& ($firstrow[14] == 'archivo') && ($firstrow[15] == 'comentarios')\n ) {\n $this->log = 'Archivo de Referencias de Libros con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n\n case \"revistas\":\n if (count($firstrow) >= 14) {\n if (($firstrow[0] == 'cita') && ($firstrow[1] == 'autores') && (($firstrow[2] == 'fecha')\n && ($firstrow[3] == 'titulo') && ($firstrow[4] == 'nombre_revista') && ($firstrow[5] == 'volumen')\n && ($firstrow[6] == 'numero') && ($firstrow[7] == 'intervalo_de_paginas') && ($firstrow[8]) == 'isbn')\n && ($firstrow[9] == 'issn') && ($firstrow[10] == 'doi') && ($firstrow[11] == 'enlace')\n && ($firstrow[12] == 'archivo') && ($firstrow[13] == 'comentarios')\n ) {\n $this->log = 'Archivo de Referencias de Revistas con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n\n case \"trabajos\":\n if (count($firstrow) >= 11) {\n if (($firstrow[0] == 'tipo') && ($firstrow[1] == 'cita') && ($firstrow[2] == 'autores') && ($firstrow[3] == 'fecha')\n && ($firstrow[4] == 'titulo') && ($firstrow[5] == 'institucion') && ($firstrow[6] == 'lugar')\n && ($firstrow[7] == 'paginas') && ($firstrow[8] == 'enlace') && ($firstrow[9] == 'archivo') && ($firstrow[10] == 'comentarios')\n ) {\n $this->log = 'Archivo de Referencias de Revistas con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n case \"enlaces\":\n if (count($firstrow) >= 11) {\n if (($firstrow[0] == 'cita') && ($firstrow[1] == 'autores') && ($firstrow[2] == 'fecha') && ($firstrow[3] == 'nombre_pagina')\n && ($firstrow[4] == 'titulo') && ($firstrow[5] == 'institucion') && ($firstrow[6] == 'lugar')\n && ($firstrow[7] == 'direccion_web') && ($firstrow[8] == 'dia_consulta') && ($firstrow[9] == 'mes_consulta') && ($firstrow[10] == 'ano_consulta')\n ) {\n $this->log = 'Archivo de Referencias de Revistas con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n\n case \"coordenadas\":\n if (count($firstrow) >= 6) {\n if (($firstrow[0] == 'entidad') && ($firstrow[1] == 'localidad') && ($firstrow[2] == 'lugar') && ($firstrow[3] == 'sitio')\n && ($firstrow[4] == 'latitud') && ($firstrow[5] == 'longitud')\n ) {\n $this->log = 'Archivo de Coordenadas con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n default:\n $this->log = \"Error en el tipo de archivo\";\n $this->error = true;\n }\n\n\n\n\n\n });\n\n $respuesta = ['error' => $this->error, 'log' => $this->log];\n\n return $respuesta;\n }", "public function validateBody()\n {\n\n if (v::identical($this->col)->validate(1)) {\n\n /** Cidade ou Região **/\n\n $regiao = Tools::clean($this->cell);\n\n if (!v::stringType()->notBlank()->validate($regiao)) {\n throw new \\InvalidArgumentException(\"Atenção: Informe na tabela a Cidade ou Região corretamente.\", E_USER_WARNING);\n }\n\n $this->array[$this->row]['regiao'] = $regiao;\n\n }\n\n if (v::identical($this->col)->validate(2)) {\n\n /** Faixa CEP Inicial **/\n\n $cep_inicio = Tools::clean($this->cell);\n\n if (!v::postalCode('BR')->validate($cep_inicio)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Informe na tabela as faixas de CEP no formato correto.\n\n Ex.: 09999-999\n\n Por favor, corrija o CEP Inicial \\\"{$cep_inicio}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['cep_inicio'] = $cep_inicio;\n\n }\n\n if (v::identical($this->col)->validate(3)) {\n\n /** Faixa CEP Final **/\n\n $cep_fim = Tools::clean($this->cell);\n\n if (!v::postalCode('BR')->validate($cep_fim)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Informe na tabela as faixas de CEP no formato correto.\n\n Ex.: 09999-999\n\n Por favor, corrija o CEP Final \\\"{$cep_fim}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['cep_fim'] = $cep_fim;\n\n }\n\n if (v::identical($this->col)->validate(4)) {\n\n /** Peso Inicial **/\n\n $peso_inicial = Tools::clean($this->cell);\n\n if (v::numeric()->negative()->validate(Tools::convertToDecimal($peso_inicial))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do Peso Inicial não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$peso_inicial}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['peso_inicial'] = $peso_inicial;\n\n }\n\n if (v::identical($this->col)->validate(5)) {\n\n /** Peso Final **/\n\n $peso_final = Tools::clean($this->cell);\n\n if (!v::numeric()->positive()->validate(Tools::convertToDecimal($peso_final))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do Peso Final não pode ser menor ou igual a Zero.\n\n Por favor, corrija o valor \\\"{$peso_final}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['peso_final'] = $peso_final;\n\n }\n\n if (v::identical($this->col)->validate(6)) {\n\n /** Valor **/\n\n $valor = Tools::clean($this->cell);\n\n if (!v::notEmpty()->validate(Tools::convertToDecimal($valor))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALOR do frete não pode ser vazio.\n\n Por favor, corrija o valor e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->positive()->validate(Tools::convertToDecimal($valor))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do frete não pode ser menor ou igual a Zero.\n\n Por favor, corrija o valor \\\"{$valor}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['valor'] = $valor;\n\n }\n\n if (v::identical($this->col)->validate(7)) {\n\n /** Prazo de Entrega **/\n\n $prazo_entrega = (int)Tools::clean($this->cell);\n\n /**\n * Verifica o prazo de entrega\n */\n if (!v::numeric()->positive()->validate($prazo_entrega)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Atenção: Informe na tabela os Prazos de Entrega corretamente.\n\n Exemplo: 7 para sete dias.\n\n Por favor, corrija o Prazo de Entrega \\\"{$prazo_entrega}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate($prazo_entrega)) {\n $prazo_entrega = null;\n }\n\n $this->array[$this->row]['prazo_entrega'] = $prazo_entrega;\n\n }\n\n if (v::identical($this->col)->validate(8)) {\n\n /** AD VALOREM **/\n\n $ad_valorem = Tools::clean($this->cell);\n\n if (!empty($ad_valorem) && !v::numeric()->positive()->validate(Tools::convertToDecimal($ad_valorem))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do AD VALOREM não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$this->cell}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate(Tools::convertToDecimal($ad_valorem))) {\n $ad_valorem = null;\n }\n\n $this->array[$this->row]['ad_valorem'] = $ad_valorem;\n\n }\n\n if (v::identical($this->col)->validate(9)) {\n\n /** KG Adicional **/\n\n $kg_adicional = Tools::clean($this->cell);\n\n if (!empty($kg_adicional) && v::numeric()->negative()->validate(Tools::convertToDecimal($kg_adicional))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do KG Adicional não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$kg_adicional}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate(Tools::convertToDecimal($kg_adicional))) {\n $kg_adicional = null;\n }\n\n $this->array[$this->row]['kg_adicional'] = $kg_adicional;\n\n }\n\n return $this->array;\n\n }", "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}", "function fncValidaDI_39($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_39 = \"(39)Indicador del Empleado - Estatus del Empleado\";\n\t$DI_39_ErrTam = \"Indicador del Empleado - Estatus del Empleado debe ser de 1 Digíto\";\n\t$DI_39_noDI \t = \"Indicador del Empleado - Estatus del Empleado no corresponde al catalogo establecido por DGRH(0,1,4)\";\n\n\t$IndEmpl = array(\"0\",\"2\",\"1\",\"4\",\"3\");\t\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == UNO)\n\t{\n\t\tif(!in_array($LocCampo, $IndEmpl))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_39.\"|\".$LocCampo.\"|\" . $DI_39_noDI.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_39.\"|\".$LocCampo.\"|\" . $DI_39_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "abstract protected function excel ();", "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 }", "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 }", "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 }", "function fncValidaDI_34($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_34 = \"(34)Indicador de Mando\";\n\t$DI_34_ErrTam = \"Indicador de Mando debe ser de 2 Digítos\";\n\t$DI_34_noDI \t = \"Indicador de Mando no corresponde al catalogo establecidas por DGRH\";\n\t\n\t$IndMando = array(\"01\",\"08\",\"10\",\"30\",\"50\",\"60\",\"70\",\"75\",\"80\",\"90\");\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DOS)\n\t{\n\t\tif(!in_array($LocCampo, $IndMando))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_34.\"|\".$LocCampo.\"|\" . $DI_34_noDI.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_34.\"|\".$LocCampo.\"|\" . $DI_34_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_63($IdEstado, $GestorErr, $NumReg, $Campo){\n\t \n\t$Bandera = CERO;\n\t$DI_62 = \"(63)Indicador de TESOFE -JORNADA\";\n\t$DI_62_ErrTam = \"Indicador de TESOFE-JORNADA debe ser de 2 Digitos\";\n\t$DI_62_Catalogo = \"Indicador de TESOFE-JORNADA No coincide con catalogo definido por la DGRH\";\n\t\n\t$JorArray =array(\"01\",\"02\",\"03\",\"04\",\"05\");\t\n\n\t$LocCampo = $Campo;\n\tif (strlen($LocCampo) == DOS){\n\n\t\tif(!in_array($LocCampo,$JorArray)){\n\t\t\t$Error = $NumReg .\"|\".$DI_62.\"|\".$LocCampo.\"|\" . $DI_62_Catalogo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\n\t}\n\telse{\n\t\t$Error = $NumReg .\"|\".$DI_62.\"|\".$LocCampo.\"|\" . $DI_62_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "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 }", "public function testValidateDocumentXlsValidation()\n {\n }", "public function validarDados(IExportacaoCenso $oExportacaoCenso) {\n\n $lTodosDadosValidos = true;\n $oDadosEscola = $oExportacaoCenso->getDadosProcessadosEscola();\n $sMensagem = \"\";\n\n /**\n * Início da validação dos campos obrigatórios\n */\n if( trim( $oDadosEscola->registro00->codigo_escola_inep ) == '' ) {\n\n $sMensagem = \"É necessário informar o código INEP da escola.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( trim( $oDadosEscola->registro00->codigo_escola_inep ) != '' ) {\n\n if( !DBNumber::isInteger( $oDadosEscola->registro00->codigo_escola_inep ) ) {\n\n $sMensagem = \"Código INEP da escola inválido. O código INEP deve conter apenas números.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( strlen( trim( $oDadosEscola->registro00->codigo_escola_inep ) ) != 8 ) {\n\n $sMensagem = \"Código INEP da escola inválido. O código INEP deve conter 8 dígitos.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n\n if (trim($oDadosEscola->registro00->nome_escola) == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Nome da Escola não pode ser vazio\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ( trim( $oDadosEscola->registro00->nome_escola ) != ''\n && strlen( $oDadosEscola->registro00->nome_escola ) < 4\n ) {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Nome da Escola deve conter no mínimo 4 dígitos\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->cep == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Campo CEP é obrigatório\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if( !empty( $oDadosEscola->registro00->cep ) ) {\n\n if( !DBNumber::isInteger( $oDadosEscola->registro00->cep ) ) {\n\n $sMensagem = \"CEP inválido. Deve conter somente números.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if (strlen($oDadosEscola->registro00->cep) < 8) {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"CEP da escola deve conter 8 dígitos.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n }\n\n if ($oDadosEscola->registro00->endereco == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Endereço da escola é obrigatório.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->uf == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"UF da escolas é obrigatório.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->municipio == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Campo Munícipio da escola é obrigatório.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->distrito == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Campo Distrito é obrigatório.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n /**\n * Validações que serão executadas caso a situação de funcionamento seja igual a 1\n * 1 - em atividade\n */\n if ($oDadosEscola->registro00->situacao_funcionamento == 1) {\n\n\n if (trim($oDadosEscola->registro00->codigo_orgao_regional_ensino) == '' && $oDadosEscola->registro00->lOrgaoEnsinoObrigatorio) {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Orgão Regional de Ensino obrigatório.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->data_inicio_ano_letivo == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Campo Data de Início do Ano Letivo é obrigatório\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->data_termino_ano_letivo == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Campo Data de Término do Ano Letivo é obrigatório\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if( !empty( $oDadosEscola->registro00->data_inicio_ano_letivo )\n && !empty( $oDadosEscola->registro00->data_termino_ano_letivo ) ) {\n\n $oDataInicio = new DBDate( $oDadosEscola->registro00->data_inicio_ano_letivo );\n $oDataTermino = new DBDate( $oDadosEscola->registro00->data_termino_ano_letivo );\n\n if( DBDate::calculaIntervaloEntreDatas( $oDataInicio, $oDataTermino, 'd' ) > 0 ) {\n\n $sMensagem = \"A data de início do ano letivo não pode ser maior que a data de término.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $oExportacaoCenso->getDataCenso() != '' ) {\n\n $oDataCenso = new DBDate( $oExportacaoCenso->getDataCenso() );\n $iAnoAnterior = $oDataCenso->getAno() - 1;\n if( $oDataInicio->getAno() != $oDataCenso->getAno()\n && $oDataInicio->getAno() != $iAnoAnterior\n ) {\n\n $sMensagem = \"Data de início do ano letivo inválido. Ano informado: {$oDataInicio->getAno()}\";\n $sMensagem .= \" - Anos válidos: {$iAnoAnterior} ou {$oDataCenso->getAno()}\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( DBDate::calculaIntervaloEntreDatas( $oDataCenso, $oDataTermino, 'd' ) > 0\n || $oDataTermino->getAno() != $oDataCenso->getAno()\n ) {\n\n $sMensagem = \"Data de término do ano letivo inválido. O ano deve ser o mesmo do censo\";\n $sMensagem .= \" ( {$oDataCenso->getAno()} ), e a data não pode ser inferior a data de referência\";\n $sMensagem .= \" ( {$oDataCenso->getDate( DBDate::DATA_PTBR )} ).\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n }\n\n /**\n * Validações referentes aos telefones\n */\n for( $iContador = 0; $iContador <= 2; $iContador++ ) {\n\n $sPropriedadeTelefone = \"telefone\";\n $sMensagemTelefone = \"Telefone\";\n\n if( $iContador > 0 ) {\n\n $sPropriedadeTelefone = \"telefone_publico_{$iContador}\";\n $sMensagemTelefone = \"Telefone Público {$iContador}\";\n }\n\n if( $oDadosEscola->registro00->{$sPropriedadeTelefone} != '' ) {\n\n if( strlen( $oDadosEscola->registro00->{$sPropriedadeTelefone} ) < 8 ) {\n\n $sMensagem = \"Campo {$sMensagemTelefone} deve conter 8 dígitos\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ( substr($oDadosEscola->registro00->{$sPropriedadeTelefone}, 0, 1) != 9\n && strlen($oDadosEscola->registro00->{$sPropriedadeTelefone}) == 9\n ) {\n\n $sMensagem = \"Campo {$sMensagemTelefone}, ao conter 9 dígitos, o primeiro algarismo deve ser 9.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n }\n\n if ($oDadosEscola->registro00->fax != '') {\n\n if (strlen($oDadosEscola->registro00->fax) < 8) {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Campo Fax deve conter 8 dígitos\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n }\n\n /**\n * Validações que serão executadas caso a situação de funcionamento seja igual a 1\n * 1 - em atividade\n * e caso a opção Dependência Administrativa selecionada seja igual a 4\n * 4 - privada\n */\n if ($oDadosEscola->registro00->dependencia_administrativa == 4) {\n\n if ( empty( $oDadosEscola->registro00->categoria_escola_privada ) ) {\n\n $lTodosDadosValidos = false;\n $sErroMsg = \"Escola de Categoria Privada.\\n\";\n $sErroMsg .= \"Deve ser selecionada uma opção no campo Categoria da Escola Privada\";\n $oExportacaoCenso->logErro($sErroMsg, ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->conveniada_poder_publico == '') {\n\n $sMensagem = \"Deve ser selecionada uma opção no campo Conveniada Com o Poder Público\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ( $oDadosEscola->registro00->mant_esc_privada_empresa_grupo_empresarial_pes_fis == 0\n && $oDadosEscola->registro00->mant_esc_privada_sidicatos_associacoes_cooperativa == 0\n && $oDadosEscola->registro00->mant_esc_privada_ong_internacional_nacional_oscip == 0\n && $oDadosEscola->registro00->mant_esc_privada_instituicoes_sem_fins_lucrativos == 0\n && $oDadosEscola->registro00->sistema_s_sesi_senai_sesc_outros == 0\n ) {\n\n $sMensagem = \"Deve ser selecionado pelo menos um campo de Mantenedora da Escola Privada\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ($oDadosEscola->registro00->cnpj_mantenedora_principal_escola_privada == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"O CNPJ da mantenedora principal da escola deve ser informado\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if( $oDadosEscola->registro00->cnpj_mantenedora_principal_escola_privada != ''\n && !DBNumber::isInteger( $oDadosEscola->registro00->cnpj_mantenedora_principal_escola_privada )\n ) {\n\n $sMensagem = \"O CNPJ da mantenedora principal deve conter somente números.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ($oDadosEscola->registro00->cnpj_escola_privada == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"O CNPJ da escola deve ser informado quando escola for privada.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n }\n\n if( $oDadosEscola->registro00->regulamentacao_autorizacao_conselho_orgao == '' ) {\n\n $sMensagem = \"Deve ser informada uma opção referente ao Credenciamento da escola.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n\n $lDadosInfraEstrutura = DadosCensoEscola::validarDadosInfraEstrutura($oExportacaoCenso);\n if (!$lDadosInfraEstrutura) {\n $lTodosDadosValidos = $lDadosInfraEstrutura;\n }\n\n return $lTodosDadosValidos;\n }", "function fncValidaDI_21($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_21 = \"(21)Proyecto Proceso\";\n\t$DI_21_ErrTam = \"Tamaño de Actividad Institucional debe ser a 4 Alfanumerico\";\n\t$DI_21_PP \t = \"La Proyecto Proceso no es parte del catalogo de DGRH\";\n\t\n $PP= array(\"1301\", \"E010\",\"E025\",\"I002\");\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == CUATRO)\n\t{\n\t\tif(!in_array($LocCampo,$PP))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_21.\"|\".$LocCampo.\"|\" . $DI_21_PP.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_21.\"|\".$LocCampo.\"|\" . $DI_21_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = 1;\n\t}\n\treturn $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 fncValidaDI_27($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_27 = \"(27)Centro de Responsabilidad\";\n\t$DI_27_ErrTam = \"Tamaño de campo Centro de Responsabilidad debe ser a 10 Caracters\";\n\t$DI_27_Edo \t = \"El Centro de Responsabilidad no corresponde al Estado\";\n\t$DI_27_CR \t = \"El Centro de Responsabilidad no corresponde al catalogo de DGRH\";\n\t\n\t// agregar catalogo de Municpios\n $Edo= array($IdEstado);\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DIEZ)\n\t{\n\t\tif(!in_array(substr($LocCampo,0,2),$Edo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_27.\"|\".$LocCampo.\"|\" . $DI_27_Edo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t\tif(!preg_match(\"/\\d{8}/\",substr($LocCampo,2,8)))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_27.\"|\".$LocCampo.\"|\" . $DI_27_CR.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_27.\"|\".$LocCampo.\"|\" . $DI_27_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}" ]
[ "0.6359894", "0.61580193", "0.59650594", "0.5895539", "0.5880751", "0.5791086", "0.5740606", "0.57366824", "0.5734721", "0.5715595", "0.56569123", "0.56505704", "0.56178", "0.5602266", "0.557479", "0.5562503", "0.553872", "0.5516638", "0.55123055", "0.5502009", "0.5501114", "0.5501114", "0.5501114", "0.5501114", "0.5496657", "0.5494892", "0.5468102", "0.5452364", "0.5444474", "0.54406047" ]
0.68792725
0
FUNCION QUE INGRESA INFO DEL EXCEL A LA BASE
function ejecutar_excel($case,$archi,$usr,$cli){ global $total_aceptados,$total_rechazados, $rechazados_localizados ,$cont_registros,$h,$mensaje,$nueva_ruta,$unidad_x,$ruta_x,$insertar_ruta_unidad; ini_set("display_errors",1); error_reporting(E_ALL); require_once 'excel_reader2.php'; $excel = new Spreadsheet_Excel_Reader($archi); echo $cont = 0; $conta = 0; $no_conta = 0; $arre = ""; $item_bueno=""; $item_malo=""; $cadena_buenos = ""; $columnas =0; //$formato = array("NIP","CLIENTE","CALLE","COLONIA","DEL-MUN","ESTADO","CP","LATITUD","LONGITUD","ITINERARIOS"); //$formato_actual = array(); $bandera = true; $m = -1; for ($row=1;$row<2;$row++){ for ($col=1;$col<=$excel->colcount();$col++) { $m = $m +1; if($excel->val($row,$col)!=""){ $columnas = $columnas +1; } } } //if($bandera == true){ //-------------------------------------------------- for ($row=2;$row<=$excel->rowcount();$row++) { $cont_registros=$cont_registros+1; for ($col=1;$col<=$columnas;$col++) { if($excel->val($row,$col)!=""){ $cont = $cont +1; $item_bueno = $excel->val($row,1); if($cadena_buenos ==""){ $cadena_buenos = $excel->val($row,$col); }else{ if($col==8){ $rLatLon = validaLatLon($excel->val($row,8),$excel->val($row,9)); // echo "para".$excel->val($row,8).','.$excel->val($row,9)." la var latlon es = ".$rLatLon.'<br>'; if($rLatLon==1){ $cadena_buenos = $cadena_buenos.'['.$excel->val($row,$col); }else{ $cadena_buenos=""; break; } }else if($col==$columnas){ $semana = array("D","L","M","R","J","V","S"); $dias = explode(",",strtoupper($excel->val($row,$col))); $day = ""; //echo " semana".count($semana)."-- dias ".count($dias).'<br />'; for($d=0;$d<count($dias);$d++){ for($s=0;$s<count($semana);$s++){ //echo "sem=".$semana[$s].'<br />'; if($semana[$s]==$dias[$d]){ if($day == ""){ if($semana[$s] == "D"){ $day = '0'; }else{ $day = $s; } }else{ // echo $dias[$d].'=='.$semana[$s].$s.'<br />'; $day = $day.'@'.$s; } } } } $cadena_buenos = $cadena_buenos.'['.$day; }else{ $cadena_buenos = $cadena_buenos.'['.$excel->val($row,$col); } } }else{ if($col == 7){ //echo "columna ".$col.'-'.$excel->val($row,$col); $cadena_buenos = $cadena_buenos.'[99999'; $cont = $cont +1; }else{ if( $item_malo == ""){ $item_malo = $excel->val(1,$col); }else{ $item_malo = $item_malo.','. $excel->val(1,$col); } $cadena_buenos=""; break; } } } if($cont == $columnas){ $conta = $conta+1; echo $cadena_buenos.'<br />'; /*------------------------------- OPERACIONES -----------------------*/ insert_update($item_bueno,$cadena_buenos,$case,$usr,$cli); if($insertar_ruta_unidad==0){ crear_ruta_unidad($unidad_x,$ruta_x,$usr,$cli); } crea_ruta_punto($item_bueno,$nueva_ruta); crea_itn($nueva_ruta,$cadena_buenos,$usr); crea_pto_vis($nueva_ruta,$cadena_buenos); /*---------------------------------------------------------*/ $item_bueno=""; $cadena_buenos=""; }else{ $no_conta = $no_conta+1; if($arre ==""){ $arre=$row; }else{ $arre= $arre.','.$row; } } $cont =0; } $total_aceptados = $conta; echo "<br><br><br> rechazados = ".$total_rechazados = $no_conta; if($no_conta>0){ echo $rechazados_localizados = $arre; } // } //if bandera de formato correcto. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function consulta_intereses($tipo_personal)\r\n{\r\n\t$cedula=$_SESSION[\"cedula\"];\r\n\t//$cedula=3379195;\t\r\n\t$db=\"sidial_excel\";\r\n\t$sql=\"SELECT name FROM sysobjects ORDER BY name ASC\";\r\n\t$ds\t= new DataStore($db, $sql);\r\n\t//COMPROBACION PARA VERIFICAR QUE DEBE ESTAR EN UNO DE LOS LISTADOS 1998-2009 2010-2011 DOCENTES 1975-1997\r\n\t\r\n\t$sql=\"\r\n\t\t\tSELECT DISTINCT \r\n\t\t\t MST_TRABAJADOR.CE_TRABAJADOR,\r\n\t\t\t YEAR(case WHEN MST_CARGOS.FE_JUBILACION IS NULL THEN MST_CARGOS.FE_FIN_PRESTACIONES ELSE MST_CARGOS.FE_JUBILACION END) AS ano, \r\n\t\t\t ( LEFT(MST_CARGOS.TIPOPERSONAL,1)) AS TIPOP \r\n\t\t\tFROM MST_CARGOS, MST_TRABAJADOR\r\n\t\tWHERE ( MST_TRABAJADOR.CE_TRABAJADOR = MST_CARGOS.CE_TRABAJADOR ) AND\r\n\t\t\t ( SUBSTRING(MST_CARGOS.TIPOPERSONAL,4,2) <> '92' ) AND \r\n\t\t\t ( SUBSTRING(MST_CARGOS.TIPOPERSONAL,1,3) <> '140' ) AND\r\n\t\t\t ( LEFT(MST_CARGOS.TIPOPERSONAL,1) = '$tipo_personal' ) AND\r\n\t\t\t ( case WHEN MST_CARGOS.FE_JUBILACION IS NULL THEN MST_CARGOS.FE_FIN_PRESTACIONES ELSE MST_CARGOS.FE_JUBILACION END IS NOT NULL ) AND\r\n\t\t\t ( YEAR(case WHEN MST_CARGOS.FE_JUBILACION IS NULL THEN MST_CARGOS.FE_FIN_PRESTACIONES ELSE MST_CARGOS.FE_JUBILACION END) BETWEEN 1998 AND 2011) AND \r\n\t\t\t ( MST_CARGOS.EDO_CARGO in ('A','F','R'))\t\t AND\r\n\t\t\t ( MST_TRABAJADOR.CE_TRABAJADOR = $cedula )\r\n\tUNION\r\n\t\t\tSELECT DISTINCT \r\n\t\t\t\t MST_TRABAJADOR.CE_TRABAJADOR, \r\n\t\t\t\t YEAR(MST_CARGOS.FE_JUBILACION) AS ano, \r\n\t\t\t\t ( LEFT(MST_CARGOS.TIPOPERSONAL,1)) AS TIPOP \r\n\t\t\tFROM MST_CARGOS, MST_TRABAJADOR\r\n\t\t\tWHERE ( MST_TRABAJADOR.CE_TRABAJADOR = MST_CARGOS.CE_TRABAJADOR ) AND\t \r\n\t\t\t ( SUBSTRING(MST_CARGOS.TIPOPERSONAL,4,2) <> '92' ) AND \r\n\t\t\t ( SUBSTRING(MST_CARGOS.TIPOPERSONAL,1,3) <> '140' ) AND\r\n\t\t\t ( LEFT(MST_CARGOS.TIPOPERSONAL,1) in ('1','2') ) AND\r\n\t\t\t ( MST_TRABAJADOR.CE_TRABAJADOR IN (3933968,114369,35982,244073,132581,679107,249221,681896,1078900,101159,1052975,2091522,1092707,1643395,483638,293457,1670457,5813080,1637465,1637465,1656850,1382359,1065923,4145884,2466910,1669389,1689427,1685308,2874802,2096532,1691834,1962335,2871423,2871423,1666380,182263,329096,746969,142490,173098,1896904,1092378,3511460,1656583,2867184,1002253,1864558,3279568,1821423,2857785,1664183,1656829,1659258,1687227,2467208,2866511,1699977,1826819,2883516,2463505,873808,1962909,1670337,1657139,1936224,1069567,3272522,1937788,3509013,1058443,1421254,720148,1813383,1636415,1087526,3466550,2868263,986448,2817905,2874923,948051,1642541,1648008,1656112,2876406,1690773,1647539,1684711,1077182,2822145,2873680,2865496,2865496,1053937,1657595,1638230,2894078,1690806,2875505,2150844,3925136,3112870,1070094,2868196,2868196,2052862,1393187,3273723,3117961,2868120,1828935,1657071,1657708,1640153,1079351,2771176,3385888,1691923,2884368,1660359,2872781,2884063,1657016,1928058,3112467,3112467,1669754,102111,1596665,2882253,5840274,3114317,1697097,3384276,2615425,2772981,1808564,3549204,623000,1642632,3216047,3216047,3452259,2143069,2869481,1045110,2873319,3774735,2860981,1669510,1630481,2874708,2052523,1695316,7874916,2865414,1093201,3116899,1264086,3271391,2134926,2455791,5839228,2888884,1932516,1806083,3272281,2768929,682313,1653951,2877777,3379108,1646390,3351316,3651728,1406220,1656749,1671331,2869480,1099546,3103835,3643490,1821310,5845060,5841223,1644433,3272362,2756670,1636463,1636463,2885067,1669414,1904851,2874657,7813832,3647895,189946,1828799,3644154,2108386,2883448,3034515,2073729,3109689,5808707,3114779,3114929,2552063,3127646,3277192,3379641,2875004,630809,630809,2881400,4013426,3384915,2773317,3114318,3453391,3453391,2883406,3117188,1534688,3108641,2737889,3113473,2095163,3264718,641592,641592,3274123,3033918,2818607,4269195,3933874,2878798,3115114,1693461,3508301,3379498,3379783,3385668,4203679,3430341,3929217,1657495,3930047,393229,1650967,6005362,3578024,2686926,2867272,2773057,1826477,2052658,2743543,2869481,4150615,3929211,1656813,2884451,3110402,2626932,4522373,3926426,2626030,3078023,3107324,529896,3093473,3643185,3644519,4152751,3510876,3093473,1829277,3508075,1088991,1693764,1698737,3679377,3119021,2898488,3276637,3379821,3772750,4172440,2815083,3928054,3930244,2882357,3279863,3106568,3117188,4014967,1092093,2574801) )\r\n\t\t\t\t\"; \r\n\t\t\t$ds->executesql($sql);\r\n\t\t\t$todos=$ds->getValuesCol(\"CE_TRABAJADOR\");\r\n\t\t\t//echo count($todos);\r\n\t\t\t//LOS 280 DE 1975-1998 \r\n\t\t\tif(count($todos)<=282)\r\n\t\t\t{\r\n\t\t\t\techo \"<head><meta http-equiv=\\\"refresh\\\" content=\\\"0; url=../RRHH/consultaNominaForm.php\\\"></head>\"; \r\n\t\t\t\texit;\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 MO_INT_ACUMULADO \r\n\t\t\t\t from MST_PRESTACIONES_DETALLE, MST_CARGOS\r\n\t\tWHERE ( MST_PRESTACIONES_DETALLE.CE_TRABAJADOR = MST_CARGOS.CE_TRABAJADOR ) AND\r\n\t\t\t ( SUBSTRING(MST_CARGOS.TIPOPERSONAL,4,2) <> '92' ) AND \r\n\t\t\t ( SUBSTRING(MST_CARGOS.TIPOPERSONAL,1,3) <> '140' ) AND\r\n\t\t\t ( LEFT(MST_CARGOS.TIPOPERSONAL,1) = MST_PRESTACIONES_DETALLE.TIPO_REGISTRO ) AND\r\n\t\t\t ( LEFT(MST_CARGOS.TIPOPERSONAL,1) = '$tipo_personal' ) AND\r\n\t\t\t ( case WHEN MST_CARGOS.FE_JUBILACION IS NULL THEN MST_CARGOS.FE_FIN_PRESTACIONES ELSE MST_CARGOS.FE_JUBILACION END IS NOT NULL ) AND\r\n\t\t\t ( YEAR(case WHEN MST_CARGOS.FE_JUBILACION IS NULL THEN MST_CARGOS.FE_FIN_PRESTACIONES ELSE MST_CARGOS.FE_JUBILACION END) BETWEEN 1998 AND 2011) AND \r\n\t\t\t ( MST_CARGOS.EDO_CARGO in ('A','F','R'))\t\t AND\r\n\t\t\t\t MST_PRESTACIONES_DETALLE.CE_TRABAJADOR = $cedula \r\n\t\t\t\t\t\tAND FE_HASTA = '2011-12-31' AND \r\n ( MST_PRESTACIONES_DETALLE.MO_INT_ACUMULADO > 0) \";\r\n\t\t\t\t$ds->executesql($sql);\r\n\t\t\t\t$MO_INT_ACUMULADO=$ds->getValueCol(0,\"MO_INT_ACUMULADO\");\r\n\t\t//\t\treturn($MO_INT_ACUMULADO);\r\n\t\t\t\treturn(0);\r\n\t\t\t}\t\t\r\n\t\r\n\t\r\n}", "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}", "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 generatodo(){\n $solicitude = $this->Solicitudes->newEntity();\n if ($this->request->is('post')) {\n $solicitude = $this->Solicitudes->patchEntity($solicitude, $this->request->getData());\n $info = $this->Solicitudes->getHistorialExcelEstudianteTodo(); //Se trae la informacion que se agrega al excel com todas las asistencias de la historia\n $spreadsheet = new Spreadsheet(); //para usar excel\n\n //acceder al objeto hoja\n $sheet = $spreadsheet->getActiveSheet(); \n\n /*Encabezados de las columnas*/\n $sheet->setCellValue('A1', 'Curso');\n $sheet->setCellValue('B1', 'Sigla');\n $sheet->setCellValue('C1', 'Grupo');\n $sheet->setCellValue('D1', 'Profesor');\n $sheet->setCellValue('E1', 'Carné');\n $sheet->setCellValue('F1', 'Nombre');\n $sheet->setCellValue('G1', 'Tipo Horas');\n $sheet->setCellValue('H1', 'Cantidad');\n\n /*Se agrega la informacion a las filas y columnas del excel*/\n $i = 0; //indice en el vector de la asistencia que se esta llenando\n $fila = 2; //indice de la fila en el excel\n foreach ($info as $data) {\n $sheet->setCellValueByColumnAndRow(1, $fila, $info[$i]['nombre']);\n $sheet->setCellValueByColumnAndRow(2, $fila, $info[$i]['sigla']);\n $sheet->setCellValueByColumnAndRow(3, $fila, $info[$i]['numero']);\n $sheet->setCellValueByColumnAndRow(4, $fila, $info[$i]['profesor']);\n $sheet->setCellValueByColumnAndRow(5, $fila, $info[$i]['nombre_usuario']);\n $sheet->setCellValueByColumnAndRow(6, $fila, $info[$i]['estudiante']);\n $sheet->setCellValueByColumnAndRow(7, $fila, $info[$i]['tipo_horas']);\n $sheet->setCellValueByColumnAndRow(8, $fila, $info[$i]['cantidad_horas']);\n\n $i = $i + 1;\n $fila = $fila + 1;\n } \n\n $writer = new Xls($spreadsheet);\n\n /*Descarga el archivo en la carpeta descargas independientemente de la computadora o usuario*/\n try{\n $sheet->getDefaultColumnDimension()->setWidth(20);\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"'. \"Reporte Historico\" .'.xls\"');\n header('Cache-Control: max-age=0');\n \n $writer->save('php://output');\n }\n catch(Exception $e){\n echo $e->getMessage();\n }\n \n }\n \n /*Se envia la indormacion a generatodo para crear la vista previa de la tabla*/\n $todo = $this->Solicitudes->getHistorialExcelEstudianteTodo();\n $this->set(compact('todo', 'solicitude'));\n }", "public function procesarPagos(){ \n\t\trequire_once './core/SimpleXLSX.php';\n\t\t$dato=\"\";\n\t\t$fecha=\"\";\n\t\t$reg=0;\n\t\t$act=0;\n\t\t$count1=0;\n\t\t$aporte0=new Aporte($this->adapter);\n\t\t$porCruzar= $aporte0->contarCruceAportes();\n\t\tif (isset($porCruzar) && count($porCruzar)>=1)\n {\n\t\t\t\t foreach($porCruzar as $aporte)\n\t\t\t\t {\n\t\t\t\t\t $count1 = $aporte->aporteID;\n\t\t\t\t }\n\t\t\t }\n\t\t\n\t\tif ( $xlsx = SimpleXLSX::parse( './uploads/Datos.xlsx' ) ) {\n\t\t\t \n\t foreach ( $xlsx->rows() as $r => $row ) {\n\t\t\n\t\tif ($r > 0)\n\t\t{\n\t\t\tif ($row[5]!= 'Depósito')\n\t\t\t{\n\t\t\t\t$fecha = substr($row[3], 0, 19) ;\n\t\t\t\t$fecha = str_replace(\".\",\":\",$fecha);\n\t\t\t\t$fecha = substr_replace($fecha, \" \", 10, 1);\n\t\t\t\t\t//echo $fecha.':'.$row[5].'|||'.$fecha .'<br/>';\n\t\t\t\t\t\n\t\t\t\t$aporte=new Aporte($this->adapter);\n\t\t\t\t$aporte->setTransactionID($row[4]);\n\t\t\t\t$aporte->setBank($row[14]);\n\t\t\t\t$aporte->setRegisteredDate($fecha);\n\t\t\t\t$aporte->setValue($row[6]);\n\t\t\t\t$aporte->setAccount($row[13]);\n\t\t\t\t\n\t\t\t\t$save=$aporte->updateCruce(); // Manda a actualizar la moto en el modelo\n\t\t\t\tif ($save == TRUE)\n\t\t\t\t{\n\t\t\t\t\t$act = $act+1;\n\t\t\t\t}\n\t\t\t\t$reg = $reg+1;\t\n\t\t\t\t//$dato = \"UPDATE aporte set \\\"transactionId\\\"='\".$row[4].\"', \\\"bank\\\"='\".$row[14].\"', \\\"registeredDate\\\"='\".$fecha.\"', \\\"bankValidated\\\"='true' WHERE \\\"account\\\"='\".$row[13].\"' AND \\\"value\\\"='\".$row[6].\"' AND \\\"bankValidated\\\"='false' AND \\\"callCenterValidated\\\"='false' AND \\\"transactionId\\\"= '0';\";\n\t\t\t\t//echo strval($save) . '<br/>';\n\t\t\t\ttry{\n\t\t\t\t$payment=new Payment($this->adapter);\n\t\t\t\t$payment->setTransactionID($row[4]);\n\t\t\t\t$payment->setValue($row[6]);\n\t\t\t\t$payment->setCedula($row[10]);\n\t\t\t\t$payment->setBank($row[14]);\n\t\t\t\t$payment->setAccount($row[13]);\n\t\t\t\t$payment->setRegisteredDate($fecha);\n\t\t\t\t$payment->setIsMatched('false');\n\t\t\t\t$payment->setIsActive('true');\n\t\t\t\t$save=$payment->save();\n\t\t\t\t}\n\t\t\t\tcatch (Exception $e) {\n\t\t\t\t\t//echo 'Excepción capturada: ', $e->getMessage(), \"\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t}\n\t\t} else {\n\t\techo SimpleXLSX::parseError();\n\t\t}\n\t\t\t$count2=0;\n\t\t$aporte1=new Aporte($this->adapter);\n\t\t$porCruzar1= $aporte1->contarCruceAportes();\n\t\tif (isset($porCruzar1) && count($porCruzar1)>=1)\n {\n\t\t\t\t foreach($porCruzar1 as $aporte)\n\t\t\t\t {\n\t\t\t\t\t $count2 = $aporte->aporteID;\n\t\t\t\t }\n\t\t\t }\n\t\t$payment0=new Payment($this->adapter);\n\t $save=$payment0->updateMatch();\n\t\n\t\t$aporte1->phpAlert('Registros econtrados en excel: ' .$reg \n\t\t.'\\nRegistros procesados desde el excel: ' .$act\n\t\t.'\\nAportes pendientes por cruzar antes del cruce: ' .$count1\n\t\t.'\\nAportes pendientes de cruzar luego del cruce: ' .$count2\n\t\t.'\\nTOTAL CRUZADOS en esta carga: ' .($count1 - $count2),\n\t\t$this->baseUrl(\"BandejaCallcenters\", \"index\")); // Alerta y redirige\n //$this->redirect(\"BandejaBancos\", \"index\"); // COntrolador + Vista\n }", "public function recorrerArchivoXLS(){\n $array = [];\n for ($row = $this->filaDesde; $row <= $this->filaHasta; ++ $row) {\n $item = new ExtractoBancarioItemVO();\n for ($col = $this->columnaDesde; $col < $this->columnaHasta; ++ $col) {\n //si la columna leída nos interesa continúo.\n if(in_array($col, $this->columnas)){\n $cell = $this->worksheet->getCellByColumnAndRow($col, $row);\n $val = $cell->getValue();\n if (PHPExcel_Shared_Date::isDateTime($cell)) {\n $val = date($format = \"Y-m-d\", PHPExcel_Shared_Date::ExcelToPHP($val));\n }\n array_push($array, $val);\n }\n }\n\n $item->asignarValores($array, $this->idTipoBanco['valor']); //asigno los valores al objeto.\n $this->mensaje['valor'] .= $item->idTipoBancoConcepto['referencia']->result->getMessage();\n //si el status no es OK, incremento el contador de erróneos.\n if($item->idTipoBancoConcepto['referencia']->result->getStatus() != STATUS_OK)\n $this->cantidadRegistrosError['valor']++;\n $this->extractoBancarioItemArray[] = $item; //agrego el registro al array.\n $array = [];\n $this->cantidadRegistros['valor']++;\n }\n }", "public function revisarFormato($archivo, $tipo_archivo)\n {\n\n\n Excel::selectSheetsByIndex(0)->load($archivo, function($reader) use ($tipo_archivo) {\n\n $reader->noHeading();\n\n $firstrow = $reader->first()->toArray();\n\n /*\n *Normalizando los nombres de las columnas (eliminamos acentos,espacios y Ñ)\n */\n $originales ='áéíóú ñ';\n $modificadas ='aeiou_n';\n\n for($i=0; $i < count($firstrow); $i++){\n $cadena = $firstrow[$i];\n $cadena = utf8_decode($cadena);\n $cadena = strtr($cadena, utf8_decode($originales), $modificadas);\n $cadena = strtolower($cadena);\n $firstrow[$i] = utf8_encode($cadena);\n }\n\n /*\n * Revisamos que el archivo tiene todas las columnas que se piden\n * y que sus nombres corresponden con los establecidos\n */\n\n switch($tipo_archivo)\n {\n case \"registros\":\n if (count($firstrow) >= 15) {\n if (($firstrow[0] == 'phylum') && ($firstrow[1] == 'clase') && (($firstrow[2] == 'subclase')\n && ($firstrow[3] == 'orden') && ($firstrow[4] == 'familia') && ($firstrow[5] == 'genero')\n && ($firstrow[6] == 'especie') && ($firstrow[7] == 'variedad') && ($firstrow[8]) == 'forma')\n && ($firstrow[9] == 'autor') && ($firstrow[10] == 'sinonimia') && ($firstrow[11] == 'cita')\n && ($firstrow[12] == 'entidad_federal') && ($firstrow[13] == 'localidad') && ($firstrow[14] == 'comentario')\n ) {\n $this->log = \"Archivo de Registros para el Catálogo con estructura correcta\";\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n\n case \"libros\":\n if (count($firstrow) >= 16) {\n if (($firstrow[0] == 'cita') && ($firstrow[1] == 'autores') && (($firstrow[2] == 'fecha')\n && ($firstrow[3] == 'titulo_libro') && ($firstrow[4] == 'edicion') && ($firstrow[5] == 'editorial')\n && ($firstrow[6] == 'lugar') && ($firstrow[7] == 'total_de_paginas') && ($firstrow[8]) == 'titulo_capitulo')\n && ($firstrow[9] == 'editor') && ($firstrow[10] == 'intervalo_de_paginas') && ($firstrow[11] == 'isbn')\n && ($firstrow[12] == 'doi') && ($firstrow[13] == 'enlace')&& ($firstrow[14] == 'archivo') && ($firstrow[15] == 'comentarios')\n ) {\n $this->log = 'Archivo de Referencias de Libros con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n\n case \"revistas\":\n if (count($firstrow) >= 14) {\n if (($firstrow[0] == 'cita') && ($firstrow[1] == 'autores') && (($firstrow[2] == 'fecha')\n && ($firstrow[3] == 'titulo') && ($firstrow[4] == 'nombre_revista') && ($firstrow[5] == 'volumen')\n && ($firstrow[6] == 'numero') && ($firstrow[7] == 'intervalo_de_paginas') && ($firstrow[8]) == 'isbn')\n && ($firstrow[9] == 'issn') && ($firstrow[10] == 'doi') && ($firstrow[11] == 'enlace')\n && ($firstrow[12] == 'archivo') && ($firstrow[13] == 'comentarios')\n ) {\n $this->log = 'Archivo de Referencias de Revistas con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n\n case \"trabajos\":\n if (count($firstrow) >= 11) {\n if (($firstrow[0] == 'tipo') && ($firstrow[1] == 'cita') && ($firstrow[2] == 'autores') && ($firstrow[3] == 'fecha')\n && ($firstrow[4] == 'titulo') && ($firstrow[5] == 'institucion') && ($firstrow[6] == 'lugar')\n && ($firstrow[7] == 'paginas') && ($firstrow[8] == 'enlace') && ($firstrow[9] == 'archivo') && ($firstrow[10] == 'comentarios')\n ) {\n $this->log = 'Archivo de Referencias de Revistas con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n case \"enlaces\":\n if (count($firstrow) >= 11) {\n if (($firstrow[0] == 'cita') && ($firstrow[1] == 'autores') && ($firstrow[2] == 'fecha') && ($firstrow[3] == 'nombre_pagina')\n && ($firstrow[4] == 'titulo') && ($firstrow[5] == 'institucion') && ($firstrow[6] == 'lugar')\n && ($firstrow[7] == 'direccion_web') && ($firstrow[8] == 'dia_consulta') && ($firstrow[9] == 'mes_consulta') && ($firstrow[10] == 'ano_consulta')\n ) {\n $this->log = 'Archivo de Referencias de Revistas con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n\n case \"coordenadas\":\n if (count($firstrow) >= 6) {\n if (($firstrow[0] == 'entidad') && ($firstrow[1] == 'localidad') && ($firstrow[2] == 'lugar') && ($firstrow[3] == 'sitio')\n && ($firstrow[4] == 'latitud') && ($firstrow[5] == 'longitud')\n ) {\n $this->log = 'Archivo de Coordenadas con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n default:\n $this->log = \"Error en el tipo de archivo\";\n $this->error = true;\n }\n\n\n\n\n\n });\n\n $respuesta = ['error' => $this->error, 'log' => $this->log];\n\n return $respuesta;\n }", "function mdatosEjercicioInformacion() {\n\t\t$conexion = conexionbasedatos();\n\t\t\n\t\t$idejercicio = $_GET[\"idejercicio\"];\n\n\t\t$consulta = \"select FE.IDEJERCICIO, FE.NOMBRE_EJERCICIO, FG.NOMBRE_MUSCULO , FE.NIVEL_EJERCICIO, FE.DESCRIPCION, FE.IDFOTO\n\t\t\t\t\tfrom final_ejercicio FE, final_grupo FG\n\t\t\t\t\twhere FE.MUSCULO = FG.IDGRUPO AND FE.IDEJERCICIO = $idejercicio;\";\n\n\t\tif ($resultado = $conexion->query($consulta)) {\n\t\t\treturn $resultado;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}", "public function f10_control_cambios_excel($contrato_id) {\n require_once('../../../librerias/Excel/PHPExcel2.php');\n \n $obCon=new conexion(1);\n $st_f10=\"SELECT * FROM vista_f10_control_cambios WHERE contrato_id='$contrato_id'\";\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 \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_control_cambios\")\n ->setSubject(\"F10_control_cambios\")\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_Control_Cambios\".'.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 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 }", "public static function ctrAgregarFichas()\n {\n\n if (isset($_POST[\"nuevaFicha\"])) {\n\n if (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevaFicha\"]) &&\n preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevaJornada\"])) {\n\n $tabla = \"ficha\";\n\n // $jornada = strtoupper($_POST[\"nuevaJornada\"]);\n // $fechaInicio=($_POST[\"nuevaFechaInicio\"],$formato);\n\n $excel = $_FILES[\"nuevoExcel\"][\"tmp_name\"];\n\n include 'extensiones/PHPExcel-1.8/Classes/PHPExcel/IOFactory.php';\n $inputFileName = $excel;\n $inputFileType = PHPExcel_IOFactory::identify($inputFileName);\n $objReader = PHPExcel_IOFactory::createReader($inputFileType);\n $objPHPExcel = $objReader->load($inputFileName);\n\n $data = array($objPHPExcel->getActiveSheet()->toArray(\"null\", true, true, true));\n\n if (count($data[0]) < 10) {\n\n echo '<script>\n\n swal({\n type: \"error\",\n title: \"Número mínimo de aprendices: 30\",\n text: \"El número de aprendices que se quiere ingresar es: ' . count($data[0]) . '\",\n showConfirmButton: true,\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n }).then((result) => {\n if (result.value) {\n\n window.location = \"fichas\";\n }\n })\n\n </script>';\n \n } else {\n $letras = array('A' => \"A\",\n 'B' => \"B\",\n 'C' => \"C\",\n 'D' => \"D\",\n 'E' => \"E\");\n $validacion = false;\n\n if ($data[0][1][$letras['A']] == \"DOCUMENTO\" and $data[0][1][$letras['B']] == \"NOMBRE\" and $data[0][1][$letras['C']] == \"TELEFONO\" and $data[0][1][$letras['D']] == \"EMAIL\" or $data[0][1][$letras['A']] == \"DOCUMENTO \" or $data[0][1][$letras['B']] == \"NOMBRE \" or $data[0][1][$letras['C']] == \"TELEFONO \" or $data[0][1][$letras['D']] == \"EMAIL \") {\n for ($i = 2; $i <= count($data[0]); $i++) {\n if ($data[0][$i][$letras['A']] == \"null\") {\n $validacion = true;\n }\n if ($data[0][$i][$letras['B']] == \"null\") {\n $validacion = true;\n }\n }\n if (!$validacion) {\n $datos = array(\"NumeroFicha\" => $_POST[\"nuevaFicha\"],\n \"IdAmbiente\" => $_POST[\"nuevoAmbiente\"],\n \"IdPrograma\" => $_POST[\"nuevoPrograma\"],\n \"FechaInicio\" => $_POST[\"nuevaFechaInicio\"],\n \"FechaFin\" => $_POST[\"nuevaFechaFin\"],\n \"JornadaFicha\" => $_POST[\"nuevaJornada\"]);\n print_r($datos);\n\n $respuesta = ModeloFichas::mdlAgregarFichas($tabla, $datos);\n if ($respuesta == \"ok\") \n {\n\n $errores = 0;\n $letras = array('A' => \"A\",\n 'B' => \"B\",\n 'C' => \"C\",\n 'D' => \"D\",\n 'E' => \"E\");\n\n\n for ($i = 2; $i <= count($data[0]); $i++) {\n $tablaConsulta = \"aprendiz\";\n $itemConsulta = \"NumDocumentoAprendiz\";\n $valorConsulta = $data[0][$i][$letras['A']];\n $respuestaConsulta = ModeloAprendiz::mdlConsultarAprendizFicha($tablaConsulta, $itemConsulta, $valorConsulta);\n\n if ($respuestaConsulta == null) {\n\n $tabla = \"aprendiz\";\n\n for ($i = 2; $i <= count($data[0]); $i++) {\n $telefono = $data[0][$i][$letras['C']];\n $email = $data[0][$i][$letras['D']];\n\n if ($telefono == \"null\") {\n $telefono = null;\n }\n if ($email == \"null\") {\n $email = null;\n\n }\n\n $datos1 = array(\"NumeroFicha\" => $_POST[\"nuevaFicha\"],\n \"NumDocumentoAprendiz\" => $data[0][$i][$letras['A']],\n \"NombreAprendiz\" => $data[0][$i][$letras['B']],\n \"TelefonoAprendiz\" => $telefono,\n \"EmailAprendiz\" => $email);\n\n $respuesta2 = ModeloAprendiz::MdlIngresarAprendiz($tabla, $datos1);\n\n print_r($respuesta2);\n\n }\n\n if ($respuesta2 == \"ok\") {\n\n echo '<script>\n\n swal({\n type: \"success\",\n title: \"La ficha ha sido guardada correctamente\",\n showConfirmButton: true,\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n }).then((result) => {\n if (result.value) {\n\n window.location = \"fichas\";\n\n }\n })\n\n </script>';\n } else {\n\n $tabla = \"ficha\";\n $datos = $_POST[\"nuevaFicha\"];\n\n $respuesta = ModeloFichas::mdlEliminarFicha($tabla, $datos);\n\n echo '<script>\n\n swal({\n type: \"error\",\n title: \"La ficha no puede ir vacía o llevar caracteres especiales!\",\n showConfirmButton: true,\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n }).then((result) => {\n if (result.value) {\n window.location = \"fichas\";\n\n }\n })\n\n </script>';\n }\n\n } else {\n $i = 5000;\n $tablaEliminar = \"ficha\";\n $datosEliminar = $_POST[\"nuevaFicha\"];\n $respuestaEliminar = ModeloFichas::mdlEliminarFicha($tablaEliminar, $datosEliminar);\n\n if ($respuestaEliminar == \"ok\") {\n echo '<script>\n swal({\n type: \"error\",\n title: \"Aprendiz ya registrado\",\n text: \"Hay aprendices que ya se encuentran registrados en otra ficha revise el archivo!\",\n showConfirmButton: true,\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n }).then((result) => {\n if (result.value) {\n\n window.location = \"fichas\";\n }\n })\n\n </script>';\n }\n }\n }\n }\n } else {\n\n echo '<script>\n\n swal({\n type: \"error\",\n title: \"FALTAN CAMPOS\",\n text:\"Hay aprendices con campos obligatiorios como número de documento o nombre vacíos, revise el archivo e intentelo nuevamente\",\n showConfirmButton: true,\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n }).then((result) => {\n if (result.value) {\n\n window.location = \"fichas\";\n\n }\n })\n\n </script>';\n\n }\n\n } else {\n\n echo '<script>\n\n swal({\n type: \"error\",\n title: \"LA ESTRUCTURA DEL ARCHIVO EXCEL ES INCORRECTA\",\n showConfirmButton: true,\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n }).then((result) => {\n if (result.value) {\n\n window.location = \"fichas\";\n\n }\n })\n\n </script>';\n\n }\n }\n }\n }\n }", "public function consultarDadosAnexoIExcel($dados) {\n\n $ano = $dados['ano'];\n $campo = $dados['mes'];\n\n $ignorarUG = array(90032, 90009, 90000);\n $implodeUG = implode(', ', $ignorarUG);\n\n // $mes = $dados['mes'];\n switch ($dados['mes']) {\n case 'IMPO_VL_TOTAL_JAN':\n $mes = '01';\n break;\n case 'IMPO_VL_TOTAL_FEV':\n $mes = '02';\n break;\n case 'IMPO_VL_TOTAL_MAR':\n $mes = '03';\n break;\n case 'IMPO_VL_TOTAL_ABR':\n $mes = '04';\n break;\n case 'IMPO_VL_TOTAL_MAI':\n $mes = '05';\n break;\n case 'IMPO_VL_TOTAL_JUN':\n $mes = '06';\n break;\n case 'IMPO_VL_TOTAL_JUL':\n $mes = '07';\n break;\n case 'IMPO_VL_TOTAL_AGO':\n $mes = '08';\n break;\n case 'IMPO_VL_TOTAL_SET':\n $mes = '09';\n break;\n case 'IMPO_VL_TOTAL_OUT':\n $mes = '10';\n break;\n case 'IMPO_VL_TOTAL_NOV':\n $mes = '11';\n break;\n case 'IMPO_VL_TOTAL_DEZ':\n $mes = '12';\n break;\n }\n\n $sql = \"\n\n SELECT\n INCI_ID_INCISO, INCI_VL_INCISO, INCI_DS_INCISO,\n ALIN_ID_ALINEA, ALIN_VL_ALINEA, ALIN_DS_ALINEA,\n SUM($campo) AS TOTAL\n\n FROM CEO_TB_INCI_INCISO\n\n INNER JOIN CEO_TB_ALIN_ALINEA ON INCI_ID_INCISO = ALIN_ID_INCISO\n\n LEFT JOIN CEO_TB_REGC_REGRA_CNJ ON REGC_ID_ALINEA = ALIN_ID_ALINEA\n\n LEFT JOIN CEO_TB_IMPO_IMPORTACAO\n ON REGC_ID_ALINEA = ALIN_ID_ALINEA\n AND IMPO_CD_UG NOT IN ({$implodeUG})\n\n LEFT JOIN CEO_TB_IMPA_IMPORTAR_ARQUIVO\n ON IMPA_ID_IMPORT_ARQUIVO = IMPO_ID_IMPORT_ARQUIVO\n --AND IMPA_IC_MES = {$mes} \n AND IMPA_AA_IMPORTACAO = {$ano}\n AND REGC_AA_REGRA = IMPA_AA_IMPORTACAO\n \n GROUP BY\n INCI_ID_INCISO, INCI_VL_INCISO, INCI_DS_INCISO,\n ALIN_ID_ALINEA, ALIN_VL_ALINEA, ALIN_DS_ALINEA\n \";\n\n $db = Zend_Db_Table::getDefaultAdapter();\n $retorno = $db->fetchAll($sql);\n\n return $retorno;\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_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 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 bExamen_i(){\r\n\t\t $c=0;\r\n $sql=\"select * from texamen where descripcion like'$this->descripcion%' and tipo='IMAGEN' \";\r\n\t\t$cursor=parent::ejecuta_sql($sql);\t\t \r\n\t\tif($row= parent::proxima_tupla($cursor))\r\n\t\t {\r\n\t\t\t DO{\r\n\t\t\t \t$fila[$c][1]=$row[\"id_examen\"];\r\n\t\t\t\t$fila[$c][2]=$row[\"descripcion\"];\r\n\t\t\t\t$fila[$c][3]=$row[\"tipo\"];\r\n\t\t\t\t$c++;\r\n\t\t\t\t}while($row= parent::proxima_tupla($cursor));\r\n\t\t }\t\t\r\n\t\tif ( $fila>0 )\r\n\t\t\treturn $fila;\r\n\t\telse\r\n\t\t\treturn -1;\r\n\t\t\t\r\n\t\t\tparent::cerrar_bd();\r\n }", "function informaImpressao(){\r\n $sql \t= \"update interpretacao set int_data_impressao = now(), int_status = 'impresso' where int_id = \".$this->get(\"int_id\");\r\n\t\t$rs\t\t= Db::sql($sql, \"Interpretacao::informaImpressao()\");\r\n\t}", "private function ReadReport($newname,$principal,$periode){\n $tmpfname = \"file-ori/\".$newname;\n $excelReader = \\PHPExcel_IOFactory::createReaderForFile($tmpfname);\n $excelObj = $excelReader->load($tmpfname);\n $worksheet = $excelObj->getSheet(0);\n $lastRow = $worksheet->getHighestRow();\n \n //proses extraksi file excel\n switch ($principal) {\n case \"BEST\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('G'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('L'.$row)->getValue());\n $this->SimpanInventory($data->kode_barang,$qty,$periode,$principal);\n \n }\n }\n\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('H'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('L'.$row)->getValue());\n $this->SimpanInventory($data->kode_barang,$qty,$periode,$principal);\n \n }\n }\n break;\n\n case \"PII\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('G'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('L'.$row)->getValue());\n $this->SimpanInventory($data->kode_barang,$qty,$periode,$principal);\n \n }\n }\n\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('H'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('L'.$row)->getValue());\n $this->SimpanInventory($data->kode_barang,$qty,$periode,$principal);\n \n }\n }\n\n break;\n\n case \"ALIDA\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('B'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('E'.$row)->getValue())+intval($worksheet->getCell('O'.$row)->getValue());\n $this->SimpanInventory($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"KP\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('C'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('E'.$row)->getValue());\n $this->SimpanInventory($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"MHF BOGOR\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('C'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('D'.$row)->getValue());\n $this->SimpanInventory($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"MHF PUSAT\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('C'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('W'.$row)->getValue());\n $this->SimpanInventory($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"DASA\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('B'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('D'.$row)->getValue());\n $this->SimpanInventory($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"IN\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('B'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('J'.$row)->getValue());\n $this->SimpanSales($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"OUT - ALIDA\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('D'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('E'.$row)->getValue());\n $this->SimpanSales($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"OUT - KP\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('L'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('M'.$row)->getValue());\n $this->SimpanSales($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"OUT - MAP\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('D'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('F'.$row)->getValue());\n $this->SimpanSales($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"OUT - MHF BOGOR\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('H'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('K'.$row)->getValue());\n $this->SimpanSales($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"OUT - MHF PUSAT\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('G'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('J'.$row)->getValue());\n $this->SimpanSales($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"OUT - NSI\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('J'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('K'.$row)->getValue());\n $this->SimpanSales($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"OUT - SURYATARA\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('E'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('F'.$row)->getValue());\n $this->SimpanSales($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"OUT - DASA\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('D'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('F'.$row)->getValue());\n $this->SimpanSales($data->kode_barang,$qty,$periode,$principal);\n \n }\n } \n break;\n\n case \"PO\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('B'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('C'.$row)->getValue());\n $no_po = $worksheet->getCell('B4')->getValue();\n $this->SimpanPO($data->kode_barang,$qty,$periode,$no_po);\n \n }\n } \n break;\n\n case \"Others\":\n for ($row = 1; $row <= $lastRow; $row++) {\n\n $datacell = $worksheet->getCell('B'.$row)->getValue();\n $query = MstBarang::find()->where(['alias' => $datacell]);\n if($query->count() > 0){\n $data = $query->one();\n $qty = intval($worksheet->getCell('C'.$row)->getValue());\n $type = $worksheet->getCell('B4')->getValue();\n $this->SimpanOthers($data->kode_barang,$qty,$periode,$type);\n \n }\n } \n break;\n\n default:\n echo \"Your favorite color is neither red, blue, nor green!\";\n }\n\n }", "public static function diario($fecha_diario,$nombre,$archivo)\n {\n $values='';\n $var=null;\n ini_set('max_execution_time', 1200);\n for($i=5;$i<=$archivo->excel->sheets[0]['numRows'];$i++)\n {\n $valores=array();\n for($j=1;$j<=$archivo->excel->sheets[0]['numCols'];$j++)\n {\n switch($j)\n {\n case 1:\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo guardo en base de datos\n break 2;\n }\n else\n {\n if(ValidationsArchCapt::define($nombre)==\"external\")\n {\n //Obtengo el id de destino externo\n $valores['id_destination']=Destination::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n $valores['id_destination_int']='NULL'; \n }\n else\n {\n //obtengo el id del destino interno\n $valores['id_destination_int']=DestinationInt::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n $valores['id_destination']='NULL';\n }\n $id_destination_int=$valores['id_destination_int'];\n $id_destination=$valores['id_destination']; \n }\n break;\n case 2:\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo guardo en base de datos\n break 2;\n }\n else\n {\n $valores['id_carrier_customer']=Carrier::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n }\n break;\n case 3:\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //Si es total no lo guardo en base de datos\n break 2;\n }\n else\n {\n $valores['id_carrier_supplier']=Carrier::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n }\n break;\n case 4:\n //minutos\n $valores['minutes']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 5:\n //ACD\n $valores['acd']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 6:\n //ASR\n $valores['asr']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 7:\n //Margin %\n $valores['margin_percentage']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 8:\n //Margin per Min\n $valores['margin_per_minute']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 9:\n //Cost per Min\n $valores['cost_per_minute']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 10:\n //Revenue per Min\n $valores['revenue_per_minute']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 11:\n //PDD\n $valores['pdd']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 12:\n //Imcomplete Calls\n $valores['incomplete_calls']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 13:\n //Imcomplete Calls Ner\n $valores['incomplete_calls_ner']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 14:\n //Complete Calls Ner\n $valores['complete_calls_ner']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 15:\n //Complete Calls\n $valores['complete_calls']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 16:\n //Calls Attempts\n $valores['calls_attempts']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 17:\n //Duration Real\n $valores['duration_real']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 18:\n //Duration Cost\n $valores['duration_cost']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 19:\n //NER02 Efficient\n $valores['ner02_efficient']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 20:\n //NER02 Seizure\n $valores['ner02_seizure']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 21:\n //PDDCalls\n $valores['pdd_calls']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 22:\n //Revenue\n $valores['revenue']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 23:\n //Cost\n $valores['cost']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 24:\n //Margin\n $valores['margin']=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 25:\n $values.=\"(\";\n $values.=\"'\".$fecha_diario.\"',\";\n $values.=$valores['minutes'].\",\";\n $values.=$valores['acd'].\",\";\n $values.=$valores['asr'].\",\";\n $values.=$valores['margin_percentage'].\",\";\n $values.=$valores['margin_per_minute'].\",\";\n $values.=$valores['cost_per_minute'].\",\";\n $values.=$valores['revenue_per_minute'].\",\";\n $values.=$valores['pdd'].\",\";\n $values.=$valores['incomplete_calls'].\",\";\n $values.=$valores['incomplete_calls_ner'].\",\";\n $values.=$valores['complete_calls'].\",\";\n $values.=$valores['complete_calls_ner'].\",\";\n $values.=$valores['calls_attempts'].\",\";\n $values.=$valores['duration_real'].\",\";\n $values.=$valores['duration_cost'].\",\";\n $values.=$valores['ner02_efficient'].\",\";\n $values.=$valores['ner02_seizure'].\",\";\n $values.=$valores['pdd_calls'].\",\";\n $values.=$valores['revenue'].\",\";\n $values.=$valores['cost'].\",\";\n $values.=$valores['margin'].\",\";\n $values.=\"'\".date('Y-m-d').\"',\";\n $values.=$valores['id_carrier_supplier'].\",\";\n $values.=$valores['id_destination'].\",\";\n $values.=$valores['id_destination_int'].\",\";\n $values.=\"1,\";\n $values.=$valores['id_carrier_customer'].\")\";\n break;\n }\n }//fin de for de $j\n \n /* verifico que la linea leida no sea total, para colocar la coma despues de armar la cadena */ \n if($i<$archivo->excel->sheets[0]['numRows'] && $archivo->excel->sheets[0]['cells'][$i][$j]!='Total')\n {\n $values.=\",\";\n }\n\n }//fin de for de $i\n\n // obtengo el ultimo caracter de la cadena\n $barra = substr($values, -1, 1);\n /*Verifico el ultimo caracter de la cadena es (,) */\n if($barra==\",\") \n {\n // se elimina la coma.\n $values=substr($values, 0, - 1); \n }\n\n if($values!=\"\")\n {\n $var['values']=$values;\n $var['id_destination']=$id_destination;\n $var['id_destination_int']=$id_destination_int;\n }\n return $var;\n }", "public function onReadAllDataExcelBeneficiarios()\n {\n if (!$this->archivoValido)\n return;\n $log = [\n 'Correcto' => $this->getImportSuccessLog(),\n 'Incorrecto' => $this->getImportErrorLog(),\n 'Guardar' => $this->getDataGuardar()\n ];\n\n $pathImportJson = Yii::getAlias('@ImportJson/beneficiarios/');\n $archivo = date('Ymd-His_') . Yii::$app->user->id . '_beneficiarios.json';\n file_put_contents($pathImportJson . $archivo, Json::encode($log));\n $this->redirect(['import/beneficiarios-paso2', 'archivo' => $archivo]);\n }", "abstract protected function excel ();", "function Buscar_Informacion($codigo){\n //$respuesta = new xajaxResponse('ISO-8859-1');\n $respuesta = new xajaxResponse();\n $ClsInf = new ClsInformacion();\n\t\n\t//$respuesta->alert(\"$codigo\");\n $result = $ClsInf->get_informacion($codigo);\n if(is_array($result)){\n foreach($result as $row){\n $codigo = $row[\"inf_codigo\"];\n $respuesta->assign(\"codigo\",\"value\",$codigo);\n $nombre = utf8_decode($row[\"inf_nombre\"]);\n $respuesta->assign(\"nom\",\"value\",$nombre);\n $desc = utf8_decode($row[\"inf_descripcion\"]);\n $respuesta->assign(\"desc\",\"value\",$desc);\n $desde = $row[\"inf_fecha_inicio\"];\n $desde = cambia_fechaHora($desde);\n $fecini = substr($desde,0,10);\n $horini = substr($desde,11,18);\n $respuesta->assign(\"fecini\",\"value\",$fecini);\n $respuesta->assign(\"horini\",\"value\",$horini);\n $hasta = $row[\"inf_fecha_fin\"];\n $hasta = cambia_fechaHora($hasta);\n $fecfin = substr($hasta,0,10);\n $horfin = substr($hasta,11,18);\n $respuesta->assign(\"fecfin\",\"value\",$fecfin);\n $respuesta->assign(\"horfin\",\"value\",$horfin);\n $link = $row[\"inf_link\"];\n $respuesta->assign(\"link\",\"value\",$link);\n //--\n $imagen = $row[\"inf_imagen\"];\n $respuesta->assign(\"imagenold\",\"value\",$imagen);\n if($imagen != \"\"){\n $oldimg = '<label>Imagen:</label> <span>'.$imagen.'</span><br>';\n $oldimg.= '<img src=\"../../CONFIG/Actividades/'.$imagen.'\" class=\"img-thumbnail\" width = \"100%\" >';\n $respuesta->assign(\"oldimg\",\"innerHTML\",$oldimg);\n }else{\n $oldimg = '<label>Imagen:</label> <span>(No hay imagen cargada)</span><br>';\n $oldimg.= '<img src=\"../../CONFIG/images/noimage.png\" class=\"img-thumbnail\" width = \"100%\" >';\n $respuesta->assign(\"oldimg\",\"innerHTML\",$oldimg);\n }\n }\n //--\n $respuesta->script('document.getElementById(\"nom\").focus();');\n $respuesta->script(\"cerrar();\");\n\t}\n return $respuesta;\n}", "function billing_download($values,$acctno,$profile){\n #excel declaration\n error_reporting(E_ALL);\n date_default_timezone_set('Europe/London'); \n require_once '../Classes/PHPExcel.php';\n $objReader = new PHPExcel_Reader_Excel5();\n $objPHPExcel = $objReader->load(\"accnts/gagamit.xls\"); \n ini_set(\"memory_limit\",\"-1\");\n ##end of excel declarationi \n #start of writing\n $objPHPExcel->getActiveSheet()->setCellValue('b10',$values['meter_reading']); //present reading\n $objPHPExcel->getActiveSheet()->setCellValue('c10',$values['meter_reading']-$values['cu_used']); //previous\n $objPHPExcel->getActiveSheet()->setCellValue('d10',$values['cu_used']); //cu_used\n $objPHPExcel->getActiveSheet()->setCellValue('e10',$values['bill_amnt']); //bill_amnt\n //$objPHPExcel->getActiveSheet()->setCellValue('c10',$values['meter_reading']-$values['cu_used']); //previous\n //$objPHPExcel->getActiveSheet()->setCellValue('c10',$values['meter_reading']-$values['cu_used']); //previous\n $objPHPExcel->getActiveSheet()->setCellValue('e14',$values['loans_MLP']); //material loan \n $objPHPExcel->getActiveSheet()->setCellValue('d18',$values['total']); //amouunt\n $objPHPExcel->getActiveSheet()->setCellValue('d20',cls_misc::toString(substr($values['reading_date'],5,2),\"month\").\"(\".substr($values['reading_date'],0,4).\")\"); //month of\n $objPHPExcel->getActiveSheet()->setCellValue('d22',$acctno); //accout number\n $objPHPExcel->getActiveSheet()->setCellValue('d23',$profile['meter_no']); //serial\n $objPHPExcel->getActiveSheet()->setCellValue('c25',$profile['name']); //name\n $objPHPExcel->getActiveSheet()->setCellValue('c26',$profile['address_brgy']); //address\n // $objPHPExcel->getActiveSheet()->setCellValue('d28',); //due_date\n $objPHPExcel->getActiveSheet()->setCellValue('d30',$_SESSION['username']); //prepared by\n $objPHPExcel->getActiveSheet()->setCellValue('d33',$values['meter_reading']-$values['cu_used']); //date\n \n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"relan.xls');\n // header('Cache-Control: max-age=0');\n\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n $objWriter->save('php://output');\n ##end of force browser download \n #close excel \n $objPHPExcel->disconnectWorksheets(); \n unset($objPHPExcel); \n ##end of close excel\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 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 CrearDevoluciones($objPHPExcel,$indice,$Codigo,$ID_Proyecto,$NombreProyecto){\n $bdProyectos = new MProyectos();\n $bdMaterieales = new MMaterial();\n \n $objPHPExcel->createSheet();\n $fila = mysqli_fetch_array($bdMaterieales->VerificarDisponibilidad($Codigo),MYSQLI_ASSOC);\n $nombreMaterial = $fila['Nombre'];\n $objPHPExcel->setActiveSheetIndex($indice)->mergeCells('C2:F2');\n $objPHPExcel->setActiveSheetIndex($indice)->mergeCells('C3:F3');\n $objPHPExcel->setActiveSheetIndex($indice)\n ->setCellValue('C2', 'Proycon S.A')\n ->setCellValue('C3', 'Reportes Devolucion de materiales a Bodega')\n ->setCellValue('C4', 'Proyecto')\n ->setCellValue('D4', $NombreProyecto)\n ->setCellValue('C5', 'Material')\n ->setCellValue('D5',$nombreMaterial)\n ->setCellValue('C8', 'CANTIDAD')\n ->setCellValue('D8', 'FECHA DEVOLUCION')\n ->setCellValue('E8', 'N°BOLETA');\n\n\n//,,\n $result = $bdProyectos ->ListarDevolucionesPorMaterial($Codigo, $ID_Proyecto);\n\n\n $i = 9;\n$totalDevuelto = 0;\n while ($fila = mysqli_fetch_array($result, MYSQLI_ASSOC)) {\n $totalDevuelto = $totalDevuelto+$fila['Cantidad'];\n $objPHPExcel->setActiveSheetIndex($indice)\n ->setCellValue(\"C$i\", $fila['Cantidad'])\n ->setCellValue(\"D$i\", date('d/m/Y', strtotime($fila['fecha'])))\n ->setCellValue(\"E$i\", $fila['NBoleta']);\n $i++;\n }\n \n $rango = \"C8:E$i\";\n\n $x = $i=$i+4;\n $objPHPExcel->setActiveSheetIndex($indice)\n ->setCellValue(\"C$i\", \"Total Prestado\")\n ->setCellValue(\"D$i\", \"Devolucion\") \n ->setCellValue(\"E$i\", \"Pendiente\");\n $i=$i+1;\n $result = $bdProyectos->ObtenerTotalMaterialPrestadoProyecto($Codigo, $ID_Proyecto);\n $fila = mysqli_fetch_array($result, MYSQLI_ASSOC);\n $cantaidadPrestada = $fila['CantidadIngreso'];\n $pendiente = $cantaidadPrestada - $totalDevuelto;\n $objPHPExcel->setActiveSheetIndex($indice)\n ->setCellValue(\"C$i\", $cantaidadPrestada)\n ->setCellValue(\"D$i\", $totalDevuelto) \n ->setCellValue(\"E$i\", $pendiente);\n \n \n//\n // Fuente de la primera fila en negrita\n //Alinear al centro ,'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER)\n $objPHPExcel->getActiveSheet()->getStyle('C2:F6')->applyFromArray(array('font' => array('bold' => true, 'name' => 'Calibri', 'size' => 18)));\n // $objPHPExcel->getActiveSheet()->getStyle('A1:Z200')->getFill()->applyFromArray(array(\n // 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n // 'startcolor' => array('rgb' => 'ffffff')));\n $objPHPExcel->getActiveSheet()->getStyle('C8:E8')->applyFromArray(\n array('font' => array('bold' => true, 'name' => 'Calibri', 'size' => 14, 'color' => array('rgb' => 'ffffff')),\n 'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER),\n 'borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('argb' => 'FFF'))))\n );\n\n\n $objPHPExcel->getActiveSheet()->getStyle($rango)->applyFromArray(array('alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER),\n 'borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('argb' => 'FFF')))));\n\n $objPHPExcel->getActiveSheet()->getStyle('C8:E8')->getFill()->applyFromArray(array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'startcolor' => array('rgb' => '003DA6')));\n \n //esto es para la segunda tabla la de resumen\n \n $objPHPExcel->getActiveSheet()->getStyle(\"C$x:E$x\")->applyFromArray(\n array('font' => array('bold' => true, 'name' => 'Calibri', 'size' => 14, 'color' => array('rgb' => 'ffffff')),\n 'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER),\n 'borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('argb' => 'FFF'))))\n );\n \n $objPHPExcel->getActiveSheet()->getStyle(\"C$x:E$x\")->getFill()->applyFromArray(array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'startcolor' => array('rgb' => '003DA6')));\n $objPHPExcel->getActiveSheet()->getStyle(\"C$x:E$i\")->applyFromArray(array('alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER),\n 'borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('argb' => 'FFF')))));\n\n /* Establecer tamanos a las celdas */\n $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(25);\n $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(40);\n $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(25);\n $objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(25);\n $objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(25);\n $objDrawing = new PHPExcel_Worksheet_Drawing();\n $objDrawing->setName('imgNotice');\n $objDrawing->setDescription('Noticia');\n $img = '../resources/imagenes/proycon.png'; // Provide path to your logo file\n $objDrawing->setPath($img);\n $objDrawing->setOffsetX(28); // setOffsetX works properly\n $objDrawing->setOffsetY(200); //setOffsetY has no effect\n $objDrawing->setCoordinates('A1');\n $objDrawing->setHeight(100); // logo height\n $objDrawing->setWorksheet($objPHPExcel->setActiveSheetIndex($indice));\n //Nombre de la hoja\n $objPHPExcel->getActiveSheet()->setTitle($Codigo);\n \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}", "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 }", "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 importacionLinea($tipo) {\n //echo \"llego2\";\n $codLin = '02';\n $tipConsult = $tipo;\n $dtActFecha = date(\"Y-m\", strtotime(date()));//'2019-02';//\n //$dtAntFecha = date(\"Y-m\", strtotime(date()));//restarle 1 mes//'2019-01';//\n\t$dtAntFecha = date(\"Y-m\", strtotime('-1 month', strtotime(date())));//Se resta 1 mes.\n //Generar Manualmente\n //$dtActFecha ='2019-04';\n //$dtAntFecha ='2019-03';\n \n \n try {\n $obj_con = new cls_Base();\n $obj_var = new cls_Global();\n $con = $obj_con->conexionServidor();\n //$rawDataANT = array();\n $rawDataACT = array();\n \n $sql = \"SELECT A.COD_LIN, A.COD_TIP, A.COD_MAR, D.NOM_LIN, E.NOM_TIP, F.NOM_MAR,\"\n . \"SUM(A.P_PROME*B.EXI_TOT) AS COS_ACT, \";\n $sql .= \"IFNULL((SELECT X.COSTO_T FROM \" . $obj_con->BdServidor . \".IG0007 X \"\n . \" WHERE X.COD_LIN=A.COD_LIN AND X.COD_MAR=A.COD_MAR AND TIP_CON='$tipConsult' \"\n . \" AND ANO_MES='$dtAntFecha'),0) COS_ANT \"; \n $sql .= \" FROM \" . $obj_con->BdServidor . \".IG0020 A \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0022 B ON A.COD_ART=B.COD_ART \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0001 D ON A.COD_LIN=D.COD_LIN \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0002 E ON A.COD_TIP=E.COD_TIP \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0003 F ON A.COD_MAR=F.COD_MAR \";\n $sql .= \" WHERE B.EXI_TOT <> 0 \"; \n $sql .=($codLin!='')?\" AND A.COD_LIN='$codLin' \":\"\";\n $sql .=($tipConsult!='TD')?\" AND A.COD_TIP='$tipConsult' \":\"\";\n $sql .=\" GROUP BY A.COD_LIN,A.COD_MAR ORDER BY COD_LIN,COD_MAR \";\n $sentencia = $con->query($sql);\n if ($sentencia->num_rows > 0) {\n while ($fila = $sentencia->fetch_assoc()) {//Array Asociativo\n $rawDataACT[] = $fila;\n }\n }\n //cls_Global::putMessageLogFile($sql);\n for ($i = 0; $i < sizeof($rawDataACT); $i++) {\n \n $sql=\"INSERT INTO \" . $obj_con->BdServidor . \".IG0007 \n (COD_LIN,COD_TIP,COD_MAR,NOM_MAR,COST_ANT,COST_ACT,COSTO_T,FEC_SIS,TIP_CON,ANO_MES)VALUES \n ('\" . $rawDataACT[$i]['COD_LIN'] . \"',\n '\" . $rawDataACT[$i]['COD_TIP'] . \"',\n '\" . $rawDataACT[$i]['COD_MAR'] . \"',\n '\" . $rawDataACT[$i]['NOM_MAR'] . \"',\n '\" . $rawDataACT[$i]['COS_ANT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $dtActFecha . \"-01',\n '\" . $tipConsult . \"',\n '\" . $dtActFecha . \"')\";\n //cls_Global::putMessageLogFile($rawDataACT[$i]['COS_ACT']);\n //cls_Global::putMessageLogFile($sql);\n $command = $con->prepare($sql); \n $command->execute();\n \n \n } \n\n $con->commit();\n $con->close();\n return true;\n } catch (Exception $e) { // se arroja una excepción si una consulta falla\n //return VSexception::messageSystem('NO_OK', $e->getMessage(), 41, null, null);\n $con->rollback();\n $con->close();\n throw $e;\n return false;\n }\n }" ]
[ "0.61434567", "0.6125422", "0.6024432", "0.60075057", "0.59801286", "0.5979597", "0.59303385", "0.5922777", "0.5885762", "0.5877549", "0.58712184", "0.58447623", "0.58423895", "0.57960165", "0.57775486", "0.5752686", "0.57500744", "0.56962335", "0.56674993", "0.56663674", "0.56553715", "0.5648917", "0.56242293", "0.55999506", "0.55991787", "0.559245", "0.557227", "0.555874", "0.55565184", "0.5555283" ]
0.6275652
0
funcion que crea la ruta_unidad_asignada
function crear_ruta_unidad($un_x,$r_x,$usu,$cli){ global $db,$dbf,$fecha_con_formato,$nueva_ruta,$insertar_ruta_unidad; $data = Array( 'DESCRIPTION' => utf8_decode(strtoupper($r_x)), 'COD_USER' => $usu, 'COD_CLIENT' => $cli, 'CREATE_DATE' => $fecha_con_formato ); if($dbf-> insertDB($data,'SAVL_ROUTES',true) == true){ echo "se genero la ruta, ahora se asigna unidad a ruta siempre y cuando sea diferente de -1 en el cod_entity"; $ruta = "SELECT ID_ROUTE FROM SAVL_ROUTES WHERE DESCRIPTION LIKE '%".strtoupper($r_x)."%'"; $query = $db->sqlQuery($ruta); $row = $db->sqlFetchArray($query); $count_x = $db->sqlEnumRows($query); if($un_x!=-1) { $data_3 = Array( 'ID_ROUTE' => $row['ID_ROUTE'], 'COD_ENTITY' => $un_x, 'COD_USER' => $usu, 'CREATE_DATE' => $fecha_con_formato ); if($dbf-> insertDB($data_3,'SAVL_ROUTES_UNITS',true) == true){ echo "info de la ruta".$row['ID_ROUTE'].'-'.$un_x.'-'.$usu.'-'.$fecha_con_formato.'<br />'; }else{ echo "fallo en ruta-unidad"; } } } $nueva_ruta = $row['ID_ROUTE']; $insertar_ruta_unidad = $insertar_ruta_unidad + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generarAtencion()\r\n{ \r\n\tglobal $use;\r\n\tglobal $priv;\r\n\r\n\t\t//DISTINGUE ENTRE ATENCION A DOMICILIO O ATENCION EN CONSULTORIO\r\n\t\tif(isset($_POST['atencion_domicilio'])){\r\n\t\t\t$dom=$_POST['dom'];\r\n\t\t\t$nrocasa=$_POST['nrocasa'];\r\n\t\t\t$barrio=$_POST['barrio'];\r\n\t\t\t$localidad=$_POST['localidad'];\r\n\t\t\t$cod_postal=$_POST['codpostal'];\r\n\t\t\t$dpto=$_POST['dpto'];\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$dom='EN CONSULTORIO';\r\n\t\t\t$nrocasa='';\r\n\t\t\t$barrio='';\r\n\t\t\t$localidad='';\r\n\t\t\t$cod_postal='';\r\n\t\t\t$dpto='';\r\n\t\t}\r\n\r\n\tif(isset($_POST['doctit']) && isset($_POST['nro'])){\r\n\t\t\r\n\t\t$cod_ser=$_POST['cod_serv'];\r\n\t\t$doctitu=$_POST['doctit'];\r\n\t\t$numdoc=$_POST['doc'];\r\n\t\t$nombre=$_POST['nombre'];\r\n\t\t$fec_pedido=$_POST['fecha'];\r\n\t\t$hora_pedido=$_POST['hora'];\r\n\t\t$dessit=$_POST['desc'];\r\n\t\t$profesional=$_POST['prof'];\r\n\t\t$sexo=$_POST['sexo'];\r\n\t\t$tel=$_POST['tel'];\r\n\t\t$id_persona= $_POST['id_persona'];\r\n\t\t$nro=$_POST['nro'];\t\t//nro es el numero de asociado\r\n\r\n\t\t$profesional_explode = explode('|',$profesional); //$profesional_explode[0] es nombre y $profesional_explode[1] es id_profesional\r\n\t\t\r\n\t\t$resultado=$GLOBALS['db']->query(\"INSERT INTO fme_asistencia (cod_ser,doctitu,numdoc,nombre,fec_pedido,hora_pedido,dessit,profesional,domicilio,casa_nro,barrio,localidad,codpostal,dpmto,id_persona, id_profesional)\r\n\t\t\t\tVALUES ('$cod_ser','$doctitu','$numdoc','$nombre','$fec_pedido','$hora_pedido','$dessit','$profesional_explode[0]','$dom','$nrocasa','$barrio','$localidad','$cod_postal','$dpto','$id_persona','$profesional_explode[1]')\");\r\n\t\t\r\n\t\t$res2=$GLOBALS['db']->select(\"SELECT idnum FROM fme_asistencia WHERE idnum=LAST_INSERT_ID()\");//obtentemos el id_atencion del ultimo insert realizado\r\n\t\t\r\n\t\t$id_atencion=$res2[0]['idnum']; \r\n\r\n\t\tif(!$resultado)\r\n\t\t{\r\n\t\t\t$error=[\r\n\t\t\t\t\t'menu'\t\t\t=>\"Atenciones\",\r\n\t\t\t\t\t'funcion'\t\t=>\"generarAtencion\",\r\n\t\t\t\t\t'descripcion'\t=>\"No se pudo realizar la consulta: INSERT INTO fme_asistencia (doctitu,numdoc,nombre,fec_pedido,hora_pedido,dessit,profesional)\r\n\t\t\t\tVALUES ('$doctitu','$numdoc','$nombre','$fec_pedido','$hora_pedido','$dessit','$profesional')\"\r\n\t\t\t\t\t];\r\n\t\t\techo $GLOBALS['twig']->render('/Atenciones/error.html', compact('error','use','priv'));\t\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\theader('Location: ./nueva_atencion_finalizar.php?id_atencion='.$id_atencion);\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t\r\n\t//SI NO SE SETEA DOCTIT, ES PORQUE ES UN PARTICULAR ENTONCES:\r\n\telse{\r\n\t\t\t\t\r\n\t\t$cod_ser=$_POST['cod_serv'];\r\n\t\t$doctitu='';\r\n\t\t$numdoc=$_POST['doc'];\r\n\t\t$nombre=$_POST['nombre'];\r\n\t\t$fec_pedido=$_POST['fecha'];\r\n\t\t$hora_pedido=$_POST['hora'];\r\n\t\t$dessit=$_POST['desc'];\r\n\t\t$profesional=$_POST['prof'];\r\n\t\t$sexo=$_POST['sexo'];\r\n\t\t$tel=$_POST['tel'];\r\n\t\t$id_persona= $_POST['id_persona'];\r\n\t\t$nro='';\t\t//nro es el numero de asociado\r\n\r\n\t\t$profesional_explode = explode('|',$profesional); //$profesional_explode[0] es nombre y $profesional_explode[1] es id_profesional\r\n\t\t\r\n\t\t$resultado=$GLOBALS['db']->query(\"INSERT INTO fme_asistencia (cod_ser,doctitu,numdoc,nombre,fec_pedido,hora_pedido,dessit,profesional,domicilio,casa_nro,barrio,localidad,codpostal,dpmto,id_persona, id_profesional)\r\n\t\t\t\tVALUES ('$cod_ser','$doctitu','$numdoc','$nombre','$fec_pedido','$hora_pedido','$dessit','$profesional_explode[0]','$dom','$nrocasa','$barrio','$localidad','$cod_postal','$dpto','$id_persona','$profesional_explode[1]')\");\r\n\t\t\r\n\t\t$res2=$GLOBALS['db']->select(\"SELECT idnum FROM fme_asistencia WHERE idnum=LAST_INSERT_ID()\");//obtentemos el id_atencion del ultimo insert realizado\r\n\t\t\t\t\r\n\t\t$id_atencion=$res2[0]['idnum']; \r\n\r\n\t\tif(!$resultado)\r\n\t\t{\r\n\t\t\t$error=[\r\n\t\t\t\t\t'menu'\t\t\t=>\"Atenciones\",\r\n\t\t\t\t\t'funcion'\t\t=>\"generarAtencion\",\r\n\t\t\t\t\t'descripcion'\t=>\"No se pudo realizar la consulta: INSERT INTO fme_asistencia (doctitu,numdoc,nombre,fec_pedido,hora_pedido,dessit,profesional)\r\n\t\t\t\tVALUES ('$doctitu','$numdoc','$nombre','$fec_pedido','$hora_pedido','$dessit','$profesional')\"\r\n\t\t\t\t\t];\r\n\t\t\techo $GLOBALS['twig']->render('/Atenciones/error.html', compact('error','use','priv'));\t\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$persona=[\r\n\t\t\t'cod_serv'\t=>\t$cod_ser,\r\n\t\t\t'fecha'\t\t=>\t$fec_pedido,\r\n\t\t\t'hora'\t\t=>\t$hora_pedido,\r\n\t\t\t'nro'\t\t=>\t$nro,\r\n\t\t\t'nombre'\t=>\t$nombre,\r\n\t\t\t'sexo'\t\t=>\t$sexo,\r\n\t\t\t'tel'\t\t=>\t$tel,\r\n\t\t\t'doc'\t\t=>\t$numdoc,\r\n\t\t\t'doctit'\t=>\t$doctitu,\r\n\t\t\t'dom'\t\t=>\t$dom,\r\n\t\t\t'nro_casa'\t\t=>\t$nrocasa,\r\n\t\t\t'barrio'\t\t=>\t$barrio,\r\n\t\t\t'localidad'\t\t=>\t$localidad,\r\n\t\t\t'cod_postal'\t=>\t$cod_postal,\r\n\t\t\t'dpmto'\t\t\t=>\t$dpto,\r\n\t\t\t'prof'\t\t=>\t$profesional,\r\n\t\t\t'desc'\t\t=>\t$dessit\r\n\t\t];\r\n\t\t\r\n\t\theader('Location: ./nueva_atencion_finalizar.php?id_atencion='.$id_atencion);\r\n\t\treturn;\r\n\t}\r\n\r\n\t\r\n}", "function crea_ruta_punto($itm,$r){\n\t \n\n global $db,$dbf,$fecha_con_formato,$cp,$cpno, $existe_punto_detalle;\n $cuenta_puntos=0;\n\t$cuenta_puntos_no = 0;\n\t$otra_ban = 0;\n\t$bandera =0;\n \n\t\t\t\t$usuario = \"SELECT COD_OBJECT_MAP FROM SAVL_G_PRIN WHERE ITEM_NUMBER = '\".$itm.\"'\";\n\t\t\t $query_user = $db->sqlQuery($usuario);\n\t\t\t\t$row_user = $db->sqlFetchArray($query_user);\n\t\t\t\t$count_user = $db->sqlEnumRows($query_user);\t \t \n\t\t\t\t\t\t\t \n\t\t\t\t\tif($count_user > 0)\t{\t\t\n\t\t\t\t \n \t\t\t\t\t$punto = \"SELECT COD_OBJECT_MAP FROM SAVL_ROUTES_DETAIL WHERE COD_OBJECT_MAP =\".$row_user['COD_OBJECT_MAP'];\n \t\t\t $query_punto = $db->sqlQuery($punto);\n \t\t\t\t $count_punto = $db->sqlEnumRows($query_punto);\n\t\t\t\t \n \t\t\t\t if($count_punto>0){\n \t\t\t\t\t\t // $existe_punto = $existe_punto +1;\n \t\t\t\t echo \"ya existe el geopunto en routes_detail, se guardara este mismo geopunto con otra ruta...\";\n\t\t\t\t\t\t\t\t\t\t\t$otra_ban = 1;\n \t\t\t\t\t\t }\n\t\t\t\t \n \t\t\t\t //if($count_punto==0){\n \t\t\t\t\t\t\t $data_2 = Array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'ID_ROUTE' => $r,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'COD_OBJECT_MAP' => $row_user['COD_OBJECT_MAP'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'CREATE_DATE' => $fecha_con_formato\n\t\t\t\t\t\t\t\t\t\t\t\t );\n \t\t\t\tif($dbf-> insertDB($data_2,'SAVL_ROUTES_DETAIL',false) == true){\n \t\t\t\t\t\t\t\t\t $bandera = 1;\n \t\t\t\t\t\t\t\t\t echo 1;\t\t\n }\telse{\n echo 0;\t\n }\t\n \t\t\t // }else{\n \t\t\t\t\t //\t\t$bandera = 0;\n \t\t\t\t\t //}\n\t\t\t\t \n\t\t\t\t }\n\n\t\t\tif($bandera ==1){\n\t\t\t $cp = $cp +1;\n\t\t\t}else{\n\t\t\t $cpno = $cpno +1;\n\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t \n\t\t\tif($otra_ban ==1){\n\t\t\t $existe_punto_detalle = $existe_punto_detalle +1;\n\t\t\t} \n \n }", "function insertarUcedifobracivil(){\n\t\t$this->procedimiento='snx.ft_ucedifobracivil_ime';\n\t\t$this->transaccion='SNX_UDOC_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_ucedifsubgrupo','id_ucedifsubgrupo','int4');\n\t\t$this->setParametro('cantidadobracivil','cantidadobracivil','numeric');\n\t\t$this->setParametro('id_obracivilmoe','id_obracivilmoe','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function generarCiu($nombre, $apellidos, $fnac)\n {\n //ponemos la primera letra en mayuscula y separamos el nombre en caracteres\n $nombre = ucfirst($nombre);\n $nombre = str_split($nombre, 1);\n\n //dividimos en 2 apellidos\n $apellidos = explode(\" \", $apellidos);\n\n //dividimos cada apellido en caracteres y les ponemos la primera letra en mayuscula\n $apellido1 = $apellidos[0];\n $apellido1 = ucfirst($apellido1);\n $apellido1 = str_split($apellido1, 1);\n\n $apellido2 = $apellidos[1];\n $apellido2 = ucfirst($apellido2);\n $apellido2 = str_split($apellido2, 1);\n\n //primer y tercer caracter de nombre y apellidos\n $ciu = $nombre[0] . $nombre[2] . $apellido1[0] . $apellido1[2] . $apellido2[0] . $apellido2[2];\n\n //convertimos a timestamp\n $fnac = strtotime($fnac);\n\n //fecha de nacimiento\n $ciu .= date(\"Y\", $fnac);\n $ciu .= date(\"m\", $fnac);\n $ciu .= date(\"d\", $fnac);\n\n //hacemos un bucle para comprobar que no exista ya un usuario con el mismo CIU\n\n $existe = true;\n $numero = 0;\n $nuevoCiu = \"\";\n\n //si existe el formato será NnAaAaAAAAMMDD[$numero]\n //por ejemplo: AeDnDl199912171 | AeDnDl199912172 | AeDnDl199912173 | AeDnDl199912174 etc\n do {\n //nuevo CIU a comprobar\n $nuevoCiu = $ciu . $numero;\n $cantidad = $this->Usuarios_model->comprobarExistencia($nuevoCiu);\n\n //si existe incrementamos el numero en uno\n if ($cantidad >= 1) {\n $numero++;\n } else {\n $existe = false;\n }\n } while ($existe);\n\n return $nuevoCiu;\n }", "private function inserirUnidade()\n {\n $cadUnidade = new \\App\\adms\\Models\\helper\\AdmsCreate;\n $cadUnidade->exeCreate(\"adms_unidade_policial\", $this->Dados);\n if ($cadUnidade->getResultado()) {\n $_SESSION['msg'] = \"<div class='alert alert-success'>Unidade cadastrada com sucesso!</div>\";\n $this->Resultado = true;\n } else {\n $_SESSION['msg'] = \"<div class='alert alert-danger'>Erro: A Unidade não foi cadastrada!</div>\";\n $this->Resultado = false;\n }\n }", "public function generarCodigoTipoUsuario() {\n $pdo = Database::connect();\n $sql = \"select max(ID_TIPO_USU) as cod from INV_TAB_TIPO_USUARIO\";\n $consulta = $pdo->prepare($sql);\n $consulta->execute();\n $res = $consulta->fetch(PDO::FETCH_ASSOC);\n $nuevoCod = '';\n if ($res['cod'] == NULL) {\n $nuevoCod = 'TUSU-0001';\n } else { \n $rest= ((substr($res['cod'], -4))+1).''; // Separacion de la parte numerica TUSU-0023 --> 23\n // Ciclo que completa el codigo segun lo retornado para completar los 9 caracteres \n // TUSU-00 --> 67, TUSU-0 --> 786\n if($rest >1 && $rest <=9){\n $nuevoCod = 'TUSU-000'.$rest;\n }else{\n if($rest >=10 && $rest <=99){\n $nuevoCod = 'TUSU-00'.$rest;\n }else{\n if($rest >=100 && $rest <=999){\n $nuevoCod = 'TUSU-0'.$rest;\n }else{\n $nuevoCod = 'TUSU-'.$rest; \n } \n } \n }\n }\n Database::disconnect();\n return $nuevoCod; // RETORNO DEL NUEVO CODIGO DE TIPO USUARIO\n }", "function crearPreguntas($numpreguntas,$idtemaasignado,$estu){\n\t$contador=0;\n\t$filas=$numpreguntas;\n\tforeach($this->model->SeleccionarTemasPreguntas($estu,$idtemaasignado) as $r): //tomo todas las preguntas de acuerdo al examen\n\t\t$estudiante = new estudiante();\n\t\t$estudiante->est_id =$estu;\n\t $auxiliar[$contador]=$r->PRE_ID; //asigno cada pregunta en una posicion de un array\n\t\t $temaid=$r->TA_ID; //id de la tabla de temas asignados\n\t\t$contador++;\n\t\tendforeach;\n\t\n$num = Array();\n reset($num);\n for($i=1;$i<=$filas;$i++)\n {\n $num[$i]=$auxiliar[rand(0,($contador-1))];\n if($i>1)\n {\n for($x=1; $x<$i; $x++)\n {\n if($num[$i]==$num[$x])\n {\n $i--;\n break;\n }\n }\n }\n }\n foreach($num as $valor){ //recorro todos mis preguntas aleatorias y asigno la pregunta\n\t$estudiante = new estudiante();\n\t\t\t$estudiante->est_id =$estu;\n\t\t\t $estudiante->pre_id =$valor;\n \t$estudiante->ta_id =$temaid;\n\t\t\t$this->model->AsignarPregunta($estudiante); //asigno la pregunta al estudiante\n }\n\n\t\t\n\t\t//METODO PARA ASIGNAR PREGUNTAS\n\t\n}", "function crearPlantilla($datos);", "public function crearMunicipios()\n {\n\n/**\n * Database `encuesta`\n */\n\n/* `encuesta`.`municipios` */\n$municipios = array(\n array('id' => '1','nombre' => 'Tres de Abril','url' => 'http://www.corrientesintensa.com/destino/tres-de-abril/','logo' => 'images/municipios/tres-de-abril.jpg','microrregion_id' => '4','indec_id' => '0','indec_nombre' => NULL,'departamento_id' => NULL),\n array('id' => '2','nombre' => '9 de Julio','url' => 'http://www.corrientes.gov.ar/home/9-de-julio/municipio','logo' => 'images/municipios/9_de_julio.png','microrregion_id' => '4','indec_id' => '0399','indec_nombre' => '9 de Julio (Est. Pueblo 9 de Julio)','departamento_id' => '161'),\n array('id' => '3','nombre' => 'Alvear','url' => '','logo' => 'images/municipios/alvear.jpg','microrregion_id' => '2','indec_id' => '0098','indec_nombre' => 'Alvear','departamento_id' => '056'),\n array('id' => '4','nombre' => 'Bella Vista','url' => 'http://www.bellavista.gob.ar/','logo' => 'images/municipios/bellavista.png','microrregion_id' => '4','indec_id' => '0007','indec_nombre' => 'Bella Vista','departamento_id' => '007'),\n array('id' => '5','nombre' => 'Berón de Astrada','url' => '','logo' => 'images/municipios/escudo-beron-de-estrada.png','microrregion_id' => '6','indec_id' => '0014','indec_nombre' => 'Berón de Astrada','departamento_id' => '014'),\n array('id' => '6','nombre' => 'Bonpland','url' => 'https://www.corrientes.gov.ar/home/bonpland/municipio','logo' => 'images/municipios/bonpland.png','microrregion_id' => '3','indec_id' => '0280','indec_nombre' => 'Bonpland','departamento_id' => '119'),\n array('id' => '7','nombre' => 'Caá Catí','url' => '','logo' => 'images/municipios/caa_cati.png','microrregion_id' => '6','indec_id' => '0112','indec_nombre' => 'Nuestra Señora del Rosario de Caá Catí ','departamento_id' => '063'),\n array('id' => '8','nombre' => 'Colonia Carlos Pellegrini','url' => 'http://www.corrientes.gov.ar/home/colonia-carlos-pellegrini/municipio','logo' => 'images/municipios/cnia-carlos pellegrini.png','microrregion_id' => '2','indec_id' => '0357','indec_nombre' => 'Colonia Carlos Pellegrini','departamento_id' => '147'),\n array('id' => '9','nombre' => 'Colonia Carolina','url' => '','logo' => 'images/municipios/carolina.png','microrregion_id' => '4','indec_id' => '0137','indec_nombre' => 'Colonia Carolina','departamento_id' => '070'),\n array('id' => '10','nombre' => 'Chavarría','url' => 'http://www.corrientes.gov.ar/home/chavarria/municipio','logo' => 'images/municipios/chavarria.jpg','microrregion_id' => '4','indec_id' => '0413','indec_nombre' => 'Chavarría','departamento_id' => '161'),\n array('id' => '11','nombre' => 'Colonia Libertad','url' => 'http://www.corrientes.gov.ar/home/colonia-libertad/municipio','logo' => 'images/municipios/colonia-libertad.jpg','microrregion_id' => '3','indec_id' => '0252','indec_nombre' => 'Colonia Libertad','departamento_id' => '112'),\n array('id' => '12','nombre' => 'Colonia Liebig','url' => 'https://www.corrientes.gov.ar/home/colonia-liebig/municipio','logo' => 'images/municipios/colonia_liebig.png','microrregion_id' => '2','indec_id' => '0161','indec_nombre' => 'Colonia Liebigs','departamento_id' => '084'),\n array('id' => '13','nombre' => 'Colonia Pando','url' => 'http://www.corrientes.gov.ar/home/colonia-pando/municipio','logo' => 'images/municipios/pando.jpg','microrregion_id' => '4','indec_id' => '0417','indec_nombre' => 'Colonia Pando','departamento_id' => '161'),\n array('id' => '14','nombre' => 'Concepción','url' => '','logo' => 'images/municipios/escudo-concepcion.png','microrregion_id' => '5','indec_id' => '0042','indec_nombre' => 'Concepción','departamento_id' => '028'),\n array('id' => '15','nombre' => 'Corrientes','url' => 'http://ciudaddecorrientes.gov.ar/','logo' => 'images/municipios/capital.png','microrregion_id' => '1','indec_id' => '0021','indec_nombre' => 'Corrientes','departamento_id' => '021'),\n array('id' => '16','nombre' => 'Cruz de los Milagros','url' => '','logo' => 'images/municipios/cruz_de_los_milagros.png','microrregion_id' => '4','indec_id' => '0189','indec_nombre' => 'Cruz de los Milagros','departamento_id' => '091'),\n array('id' => '17','nombre' => 'Curuzú Cuatiá','url' => '','logo' => 'images/municipios/curuzu_cuatia.png','microrregion_id' => '3','indec_id' => '0056','indec_nombre' => 'Curuzú Cuatiá','departamento_id' => '035'),\n array('id' => '18','nombre' => 'Empedrado','url' => '','logo' => 'images/municipios/empedrado.png','microrregion_id' => '5','indec_id' => '0077','indec_nombre' => 'Empedrado','departamento_id' => '042'),\n array('id' => '19','nombre' => 'Esquina','url' => 'http://www.esquinacorrientes.gob.ar/','logo' => 'images/municipios/esquina.jpg','microrregion_id' => '4','indec_id' => '0084','indec_nombre' => 'Esquina','departamento_id' => '049'),\n array('id' => '20','nombre' => 'Estación Torrent','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '2','indec_id' => '0105','indec_nombre' => 'Estación Torrent','departamento_id' => '056'),\n array('id' => '21','nombre' => 'Felipe Yofre','url' => 'https://www.corrientes.gov.ar/home/felipe-yofre/municipio','logo' => 'images/municipios/felipe-yofre.jpg','microrregion_id' => '3','indec_id' => '0231','indec_nombre' => 'Felipe Yofré','departamento_id' => '105'),\n array('id' => '22','nombre' => 'Garabí','url' => 'https://es.wikipedia.org/wiki/Garab%C3%AD_(Corrientes)','logo' => 'images/municipios/garabi.jpg','microrregion_id' => '2','indec_id' => '0441','indec_nombre' => 'José Rafael Gómez (Garabí)','departamento_id' => '168'),\n array('id' => '23','nombre' => 'Garruchos','url' => 'https://www.corrientes.gov.ar/home/garruchos/municipio','logo' => 'images/municipios/garrucho.bmp','microrregion_id' => '2','indec_id' => '0427','indec_nombre' => 'Garruchos','departamento_id' => '168'),\n array('id' => '24','nombre' => 'Gobernador Martinez','url' => '','logo' => 'images/municipios/gobernador_martinez.png','microrregion_id' => '4','indec_id' => '0196','indec_nombre' => 'Gobernador Juan E. Martínez','departamento_id' => '091'),\n array('id' => '25','nombre' => 'Gobernador V. Virasoro','url' => 'http://www.virasoro.gob.ar/','logo' => 'images/municipios/virasoro.jpg','microrregion_id' => '2','indec_id' => '0434','indec_nombre' => 'Gobernador Igr. Valentín Virasoro ','departamento_id' => '168'),\n array('id' => '26','nombre' => 'Goya','url' => '','logo' => 'images/municipios/goya.png','microrregion_id' => '4','indec_id' => '0140','indec_nombre' => 'Goya','departamento_id' => '070'),\n array('id' => '27','nombre' => 'Guaviraví','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '2','indec_id' => '0364','indec_nombre' => 'Guaviraví','departamento_id' => '147'),\n array('id' => '28','nombre' => 'Herliztka','url' => '','logo' => 'images/municipios/escudo-herliztka.png','microrregion_id' => '6','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '29','nombre' => 'Ita Ibaté','url' => 'http://www.corrientes.gov.ar/home/ita-ibate/municipio','logo' => 'images/municipios/itaibate.jpg','microrregion_id' => '6','indec_id' => '0119','indec_nombre' => 'Itá Ibaté','departamento_id' => '063'),\n array('id' => '30','nombre' => 'Itatí','url' => '','logo' => 'images/municipios/escudo-itati.png','microrregion_id' => '6','indec_id' => '0147','indec_nombre' => 'Itatí','departamento_id' => '077'),\n array('id' => '31','nombre' => 'Ituzaingó','url' => '','logo' => 'images/municipios/ituzaingo.jpg','microrregion_id' => '2','indec_id' => '0168','indec_nombre' => 'Ituzaingó','departamento_id' => '084'),\n array('id' => '32','nombre' => 'José Rafael Gomez','url' => '','logo' => 'images/municipios/escudo-jose-r-gomez.png','microrregion_id' => '2','indec_id' => '0441','indec_nombre' => 'José Rafael Gómez (Garabí)','departamento_id' => '168'),\n array('id' => '33','nombre' => 'Juan Pujol','url' => '','logo' => 'images/municipios/escudo-juan-pujol.png','microrregion_id' => '3','indec_id' => '0259','indec_nombre' => 'Juan Pujol','departamento_id' => '112'),\n array('id' => '34','nombre' => 'La Cruz','url' => 'http://www.lacruz.gov.ar/','logo' => 'images/municipios/la-cruz.png','microrregion_id' => '2','indec_id' => '0371','indec_nombre' => 'La Cruz','departamento_id' => '147'),\n array('id' => '35','nombre' => 'San Isidro','url' => '','logo' => 'images/municipios/escudo-san-isidro.png','microrregion_id' => '4','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '36','nombre' => 'Lomas de Vallejos','url' => 'http://www.corrientes.gov.ar/home/lomas-de-vallejos/municipio','logo' => 'images/municipios/loma-de-vallejos.jpg','microrregion_id' => '6','indec_id' => '0126','indec_nombre' => 'Lomas de Vallejos','departamento_id' => '063'),\n array('id' => '37','nombre' => 'Loreto','url' => 'https://www.corrientes.gov.ar/home/loreto/municipio','logo' => 'images/municipios/loreto.jpg','microrregion_id' => '5','indec_id' => '0385','indec_nombre' => 'Loreto','departamento_id' => '154'),\n array('id' => '38','nombre' => 'Mariano I. Loza','url' => 'http://www.corrientes.gov.ar/home/mariano-i-loza/municipio','logo' => 'images/municipios/mariano-loza.jpg','microrregion_id' => '3','indec_id' => '0238','indec_nombre' => 'Mariano I. Loza (Est. Justino Solari)','departamento_id' => '105'),\n array('id' => '39','nombre' => 'Mburucuyá','url' => 'http://www.corrientes.gov.ar/home/mburucuya/municipio','logo' => 'images/municipios/mburucuya.jpg','microrregion_id' => '5','indec_id' => '0224','indec_nombre' => 'Mburucuyá','departamento_id' => '098'),\n array('id' => '40','nombre' => 'Mercedes','url' => '','logo' => 'images/municipios/mercedes.png','microrregion_id' => '3','indec_id' => '0245','indec_nombre' => 'Mercedes','departamento_id' => '105'),\n array('id' => '41','nombre' => 'Mocoretá','url' => 'http://www.corrientes.gov.ar/home/mocoreta/municipio','logo' => 'images/municipios/mocoreta.JPG','microrregion_id' => '3','indec_id' => '0266','indec_nombre' => 'Mocoretá','departamento_id' => '112'),\n array('id' => '42','nombre' => 'Monte Caseros','url' => 'http://www.corrientes.gov.ar/home/monte-caseros/municipio','logo' => 'images/municipios/monte-caseros.gif','microrregion_id' => '3','indec_id' => '0273','indec_nombre' => 'Monte Caseros','departamento_id' => '112'),\n array('id' => '43','nombre' => 'Pago de los Deseos','url' => '','logo' => 'images/municipios/escudo-pago-de-los-deseos.png','microrregion_id' => '5','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '44','nombre' => 'Palmar Grande','url' => '','logo' => 'images/municipios/escudo-palmar-grande.png','microrregion_id' => '6','indec_id' => '0133','indec_nombre' => 'Palmar Grande','departamento_id' => '063'),\n array('id' => '45','nombre' => 'Parada Pucheta','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '3','indec_id' => '0287','indec_nombre' => 'Parada Pucheta','departamento_id' => '119'),\n array('id' => '46','nombre' => 'Paso de la Patria','url' => '','logo' => 'images/municipios/escudo-paso-de-la-patria.png','microrregion_id' => '6','indec_id' => '0322','indec_nombre' => 'Paso de la Patria','departamento_id' => '133'),\n array('id' => '47','nombre' => 'Paso de los Libres','url' => 'http://pasodeloslibres.gob.ar/','logo' => 'images/municipios/paso-de-los-libres.jpg','microrregion_id' => '3','indec_id' => '0294','indec_nombre' => 'Paso de los Libres','departamento_id' => '119'),\n array('id' => '48','nombre' => 'Pedro R. Fernandez','url' => '','logo' => 'images/municipios/escudo-pedro-r-Fernandez.png','microrregion_id' => '4','indec_id' => '0406','indec_nombre' => 'Pedro R. Fernández (Est. Manuel F. Mantilla)','departamento_id' => '161'),\n array('id' => '49','nombre' => 'Perugorria','url' => 'http://www.corrientes.gov.ar/home/perugorria/municipio','logo' => 'images/municipios/perugorria.gif','microrregion_id' => '3','indec_id' => '0070','indec_nombre' => 'Perugorría','departamento_id' => '035'),\n array('id' => '50','nombre' => 'Pueblo Libertador','url' => '','logo' => 'images/municipios/escudo-libertador.png','microrregion_id' => '4','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '51','nombre' => 'Lavalle','url' => 'http://www.corrientes.gov.ar/home/lavalle/municipio','logo' => 'images/municipios/lavalle.jpg','microrregion_id' => '4','indec_id' => '0203','indec_nombre' => 'Lavalle','departamento_id' => '091'),\n array('id' => '52','nombre' => 'Ramada Paso','url' => '','logo' => 'images/municipios/escudo-ramada-paso.png','microrregion_id' => '6','indec_id' => '0154','indec_nombre' => 'Ramada Paso','departamento_id' => '077'),\n array('id' => '53','nombre' => 'Riachuelo','url' => 'http://www.municipioriachuelo.gov.ar/','logo' => 'images/municipios/riachuelo.jpg','microrregion_id' => '1','indec_id' => '0028','indec_nombre' => 'Riachuelo','departamento_id' => '021'),\n array('id' => '54','nombre' => 'Saladas','url' => '','logo' => 'images/municipios/escudo-saladas.png','microrregion_id' => '5','indec_id' => '0308','indec_nombre' => 'Saladas','departamento_id' => '126'),\n array('id' => '55','nombre' => 'San Antonio de Apipe','url' => 'http://www.corrientes.gov.ar/home/san-antonio/municipio','logo' => 'images/municipios/san-antonio-de-apipe.png','microrregion_id' => '2','indec_id' => '0175','indec_nombre' => 'San Antonio','departamento_id' => '084'),\n array('id' => '56','nombre' => 'San Carlos','url' => '','logo' => 'images/municipios/escudo-san-carlos.png','microrregion_id' => '2','indec_id' => '0182','indec_nombre' => 'San Carlos','departamento_id' => '084'),\n array('id' => '58','nombre' => 'San Cosme','url' => 'https://www.corrientes.gov.ar/home/san-cosme/municipio','logo' => 'images/municipios/sancosme-escudo.gif','microrregion_id' => '6','indec_id' => '0329','indec_nombre' => 'San Cosme','departamento_id' => '133'),\n array('id' => '59','nombre' => 'San Lorenzo','url' => 'http://www.corrientes.gov.ar/home/san-lorenzo/municipio','logo' => 'images/municipios/sanlorenzo.png','microrregion_id' => '5','indec_id' => '0315','indec_nombre' => 'San Lorenzo','departamento_id' => '126'),\n array('id' => '60','nombre' => 'San Luis del Palmar','url' => '','logo' => 'images/municipios/sanluisdelpalmar.png','microrregion_id' => '6','indec_id' => '0350','indec_nombre' => 'San Luis del Palmar','departamento_id' => '140'),\n array('id' => '61','nombre' => 'San Miguel','url' => 'https://www.corrientes.gov.ar/home/san-miguel/municipio','logo' => 'images/municipios/San-Miguel.jpg','microrregion_id' => '5','indec_id' => '0392','indec_nombre' => 'San Miguel','departamento_id' => '154'),\n array('id' => '62','nombre' => 'San Roque','url' => 'http://www.sanroquemunicipio.gob.ar/','logo' => 'images/municipios/san-roque.jpg','microrregion_id' => '4','indec_id' => '0420','indec_nombre' => 'San Roque','departamento_id' => '161'),\n array('id' => '63','nombre' => 'Santa Ana de los Guacaras','url' => 'http://www.santaanadelosguacaras.com/','logo' => 'images/municipios/santa-ana-escudo.png','microrregion_id' => '6','indec_id' => '0336','indec_nombre' => 'Santa Ana','departamento_id' => '133'),\n array('id' => '64','nombre' => 'Santa Lucía','url' => '','logo' => 'images/municipios/santa_lucia.png','microrregion_id' => '4','indec_id' => '0210','indec_nombre' => 'Santa Lucía','departamento_id' => '091'),\n array('id' => '65','nombre' => 'Colonia Santa Rosa','url' => 'http://www.corrientes.gov.ar/home/colonia-santa-rosa/municipio','logo' => 'images/municipios/santa-rosa.jpg','microrregion_id' => '5','indec_id' => '0035','indec_nombre' => 'Santa Rosa','departamento_id' => '028'),\n array('id' => '66','nombre' => 'Santo Tome','url' => 'http://municipalidadstome.com.ar/','logo' => 'images/municipios/santo_tome.jpg','microrregion_id' => '2','indec_id' => '0448','indec_nombre' => 'Santo Tomé','departamento_id' => '168'),\n array('id' => '67','nombre' => 'Sauce','url' => 'http://www.corrientes.gov.ar/home/sauce/municipio','logo' => 'images/municipios/sauce.jpg','microrregion_id' => '3','indec_id' => '0455','indec_nombre' => 'Sauce','departamento_id' => '175'),\n array('id' => '68','nombre' => 'Tabay','url' => '','logo' => 'images/municipios/escudo-tabay.png','microrregion_id' => '5','indec_id' => '0049','indec_nombre' => 'Tabay','departamento_id' => '028'),\n array('id' => '69','nombre' => 'Tapebicuá','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '3','indec_id' => '0301','indec_nombre' => 'Tapebicuá','departamento_id' => '119'),\n array('id' => '70','nombre' => 'Tatacua','url' => 'https://www.corrientes.gov.ar/home/tatacua/municipio','logo' => 'images/municipios/tatacua.jpg','microrregion_id' => '5','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '71','nombre' => 'Villa Olivari','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '2','indec_id' => '0186','indec_nombre' => 'Villa Olivari','departamento_id' => '084'),\n array('id' => '72','nombre' => 'Yapeyú','url' => 'https://www.corrientes.gov.ar/home/yapeyu/municipio','logo' => 'images/municipios/yapeyu.jpg','microrregion_id' => '2','indec_id' => '0378','indec_nombre' => 'Yapeyú','departamento_id' => '147'),\n array('id' => '73','nombre' => 'Yatayti Calle','url' => 'http://www.corrientes.gov.ar/home/yatayti-calle/municipio','logo' => 'images/municipios/yatayti_calle.jpg','microrregion_id' => '4','indec_id' => '0217','indec_nombre' => 'Yatayti Calle','departamento_id' => NULL),\n array('id' => '75','nombre' => 'El Sombrero','url' => 'http://elsombrero.corrientes.gob.ar/','logo' => 'images/municipios/sombrero.jpg','microrregion_id' => '5','indec_id' => '0','indec_nombre' => 'El Sombrero','departamento_id' => '042')\n);\n\n\n foreach ($municipios as $key => $value)\n {\n $m = new Municipio();\n $m->construct($value);\n }\n\n\n\n\n }", "function prepare_remito($id_remito,&$filas)\r\n{\r\n while ($filas['cantidad']--)\r\n {\r\n\t$filas[$filas['cantidad']]['id_remito']=$id_remito;\r\n \t$filas[$filas['cantidad']]['descripcion']=\"'\".$filas[$filas['cantidad']]['descripcion'].\"'\";\r\n \tunset($filas[$filas['cantidad']]['subtotal']);\r\n }\r\n unset($filas['cantidad']);\r\n}", "function generarOrden($arreglo){\n $nomEstadoItemOK = $this->datos->traerIdEstadoItemOK();\n $idEstadoEnUso = $this->datos->traerIdEstadoUso();\n $idEstadoOfertado = $this->datos->traerIdEstadoOferProd();\n $idEstadoOfertaEco = $this->datos->traerIdEstadoOferOK();\n \n //ACTUALIZO ESTADO ITEM OFERTA OK\n $this->datos->actualizaEstadoItemOK($arreglo[\"idOfe\"],$nomEstadoItemOK->nomEstado);\n \n //ACTUALIZO ESTADO OFERTA\n $this->datos->actualizaEstadoOfertaCom($arreglo[\"idOfe\"],$idEstadoOfertaEco->idEstadoOfOk);\n $ofertaEconomica = $this->datos->datosOfertaEconomica($arreglo[\"idOfe\"]);\n \n $idDetProductoOfertado = $this->datos->traerIdDetProUso($arreglo[\"idOfe\"],$idEstadoOfertado->idEstadoOferProd);\n \n \n /* \n $idDetProductoEnUso = $this->datos->traerIdDetProUso($arreglo[\"idOfe\"],$idEstadoOfertado->idEstadoOferProd);\n \n \n //ACTUALIZO ESTADO PRODUCTO\n foreach ($idDetProductoEnUso as $key => $valueProdOrden) {\n \n $this->datos->actualizaCantidadDetProd($valueProdOrden[\"idDetalle\"],$idEstadoEnUso->idEnUso);\n }\n \n $idDetProducto = $this->datos->traerIdDetProUso($arreglo[\"idOfe\"],$idEstadoEnUso->idEnUso);*/\n \n //INSERTO ENCABEZADO \n $idOrdenCompra = $this->datos->insertarOrdenCompra($ofertaEconomica,$arreglo[\"idOfe\"]);\n \n //INSERTO DETALLE\n foreach ($idDetProductoOfertado as $key => $valueDetOfe) {\n \n $this->datos->insertarOrdenDes($valueDetOfe[\"idDetalle\"],$idOrdenCompra);\n \n }\n \n $this->mostrarOfertaEconomica($arreglo);\n \n }", "function autorizar_producto_san_luis($id_mov){\r\n\r\nglobal $db;\t\r\n \r\n $db->starttrans();\r\n $fecha_hoy=date(\"Y-m-d H:i:s\",mktime());\r\n \r\n //traigo el deposito origen\r\n $sql = \"select deposito_origen,deposito_destino\r\n from movimiento_material where id_movimiento_material = $id_mov\"; \r\n $res = sql($sql) or fin_pagina();\r\n $id_deposito_origen = $res->fields[\"deposito_origen\"];\r\n $id_deposito_destino = $res->fields[\"deposito_destino\"];\r\n \t \r\n //traigo el detalle de los movimientos a liberar \t \r\n $sql=\"select * from detalle_movimiento where id_movimiento_material=$id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\r\n $comentario = \" Autorizacion de PM Producto San Luis nro: $id_mov\";\r\n $id_tipo_movimiento = 7;\r\n\r\n //por cada detalle voy liberando las reservas del pm autorizado \r\n for($i=0;$i<$res->recordcount();$i++) {\r\n \t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n $cantidad = $res->fields[\"cantidad\"];\r\n $id_detalle_movimiento = $res->fields[\"id_detalle_movimiento\"]; \r\n ///////////////////////////////////////\r\n $sql = \"select id_recibidos_mov,cantidad\r\n from recibidos_mov where id_detalle_movimiento=$id_detalle_movimiento \r\n and ent_rec=0\";\r\n $detalle_rec = sql($sql) or fin_pagina();\r\n $id_recibido_mov = $detalle_rec->fields[\"id_recibidos_mov\"];\r\n if($id_recibido_mov==\"\") {\r\n\t \t //insert\r\n\t\t $sql = \"select nextval('recibidos_mov_id_recibidos_mov_seq') as id_recibido_mov\";\r\n\t\t $res_1 = sql($sql) or fin_pagina();\r\n\t\t $id_recibido_mov = $res_1->fields[\"id_recibido_mov\"];\r\n\t\t $sql=\"insert into recibidos_mov(id_recibidos_mov,id_detalle_movimiento,cantidad,ent_rec)\r\n\t\t values($id_recibido_mov,$id_detalle_movimiento,$cantidad,0)\";\r\n }else {\r\n\t //update\r\n\t $sql=\"update recibidos_mov set cantidad=cantidad+$cantidad\r\n\t where id_recibidos_mov=$id_recibido_mov\";\r\n }//del else\r\n sql($sql) or fin_pagina();\r\n $sql =\"insert into log_recibidos_mov(id_recibidos_mov,usuario,fecha,cantidad_recibida,tipo)\r\n values($id_recibido_mov,'\".$_ses_user[\"name\"].\"','$fecha_hoy',$cantidad,'entrega')\";\r\n sql($sql) or fin_pagina();\r\n /////////////////////////////////////// \r\n descontar_reserva($id_prod_esp,$cantidad,$id_deposito_origen,$comentario,$id_tipo_movimiento,\"\",$id_detalle_movimiento,\"\");\r\n $res->movenext(); \r\n }//del for\r\n \t \r\n //Inserto la Mercaderia entrante en el stock BS AS \r\n $sql = \"select * from mercaderia_entrante where id_movimiento_material = $id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n $comentario = \"Producto San Luis perteneciente al PM nro: $id_mov\";\r\n for($i=0;$i<$res->recordcount();$i++){\r\n\t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n\t $cantidad = $res->fields[\"cantidad\"];\r\n\t $descripcion = $res->fields[\"descripcion\"]; \r\n\t //el id_tipo_movimiento le hardcodeo uno de la tabla stock.tipo_movimiento\r\n\t $id_tipo_movimiento='13';\r\n\t //el ingreso del producto es a \"disponible\" por lo tanto la funcion no toma en cuenta los parametros que siguen\r\n\t $a_stock='disponible';\r\n\t agregar_stock($id_prod_esp,$cantidad,$id_deposito_destino,$comentario,$id_tipo_movimiento,$a_stock,$id_tipo_reserva,\"\",$id_detalle_movimiento,$id_licitacion,$nro_caso);\r\n\t $res->movenext();\r\n }//del for\r\n $db->completetrans();\r\n\r\n }", "function crear_trabajador($mysqli, $id_usuario, $calle_trabajador, $numero_trabajador, $colonia_trabajador, $correo_trabajador, $telefono_trabajador, $tipo_telefono_trabajador, $lada_trabajador, $ciudad, $estado, $municipio)\n {\n $estatus = 1;//Por defecto los trabajadores estan activos\n\n //Encrypta los datos privados\n $correo_trabajador = encrypt_string($correo_trabajador);\n $calle_trabajador = encrypt_string($calle_trabajador);\n $numero_trabajador = encrypt_string($numero_trabajador);\n $colonia_trabajador = encrypt_string($colonia_trabajador);\n $telefono_trabajador = encrypt_string($telefono_trabajador);\n\n //******Alta del trabajador******\n $stmt = $mysqli->prepare(\"INSERT INTO `trabajador`(`id_trabajador`, `id_usuario`, `estatus`, `fecha_creacion`, `ultima_modificacion`)\n \t\t\t\t\t\t\t\t\t\t\t\t\tVALUES\n \t\t\t\t\t\t\t\t\t\t\t\t\t(NULL,?,?,now(),now())\");\n\n //Indica a la base de datos que recibira 2 integer correspoendietes a los signos de ? en el query\n $stmt->bind_param(\"ii\", $id_usuario, $estatus);\n\n //Ejecuta el query\n $stmt->execute();\n\n //Toma el ID del insert recien hecho\n $nuevo_id_trabajador = $mysqli->insert_id;\n\n //Cierra el query\n $stmt->close();\n\n\n\n //******Relacion del trabajador con correo_electronico******\n $stmt = $mysqli->prepare(\"INSERT INTO `correo_electronico`(`id_correo_electronico`, `correo_electronico`, `estatus`, `fecha_creacion`, `ultima_modificacion`)\n \t\t\t\t\t\t\t\t\t\t\t\t\tVALUES\n \t\t\t\t\t\t\t\t\t\t\t\t\t(NULL,?,?,now(),now())\");\n\n //Indica a la base de datos que recibira 1 string y 1 integer correspoendietes a los signos de ? en el query\n $stmt->bind_param(\"si\", $correo_trabajador, $estatus);\n\n //Ejecuta el query\n $stmt->execute();\n\n\t//Toma el ID del insert recien hecho\n $nuevo_id_correo_electronico = $mysqli->insert_id;\n\n //Cierra el query\n $stmt->close();\n\n\n\n //******Relacion del correo_electronico con trabajador_correo******\n $stmt = $mysqli->prepare(\"INSERT INTO `trabajador_correo`(`id_trabajador_correo`, `id_trabajador`, `id_correo_electronico`, `estatus`, `fecha_creacion`, `ultima_modificacion`)\n \t\t\t\t\t\t\t\t\t\t\t\t\tVALUES\n \t\t\t\t\t\t\t\t\t\t\t\t\t(NULL,?,?,?,now(),now())\");\n\n //Indica a la base de datos que recibira 3 integer correspoendietes a los signos de ? en el query\n $stmt->bind_param(\"iii\", $nuevo_id_trabajador, $nuevo_id_correo_electronico, $estatus);\n\n //Ejecuta el query\n $stmt->execute();\n\n //Cierra el query\n $stmt->close();\n\n\n\n //******Relacion del trabajador con su domicilio******\n $stmt = $mysqli->prepare(\"INSERT INTO `domicilio`(`id_domicilio`, `calle`, `numero`, `colonia`, `estatus`, `fecha_creacion`, `ultima_modificacion`)\n \t\t\t\t\t\t\t\t\t\t\t\t\tVALUES\n \t\t\t\t\t\t\t\t\t\t\t\t\t(NULL,?,?,?,?,now(),now())\");\n\n //Indica a la base de datos que recibira 3 String y 1 integer correspondientes a los signos de ? en el query\n $stmt->bind_param(\"sssi\", $calle_trabajador, $numero_trabajador, $colonia_trabajador, $estatus);\n\n //Ejecuta el query\n $stmt->execute();\n\n\t//Toma el ID del insert recien hecho\n $nuevo_id_domicilio = $mysqli->insert_id;\n\n //Cierra el query\n $stmt->close();\n\n\n\n\t //******Relacion de domicilio con trabajador_domicilio******\n $stmt = $mysqli->prepare(\"INSERT INTO `trabajador_domicilio`(`id_trabajador_domicilio`, `id_trabajador`, `id_domicilio`, `estatus`, `fecha_creacion`, `ultima_modificacion`)\n \t\t\t\t\t\t\t\t\t\t\t\t\tVALUES\n \t\t\t\t\t\t\t\t\t\t\t\t\t(NULL,?,?,?,now(),now())\");\n\n //Indica a la base de datos que recibira 3 integer correspondientes a los signos de ? en el query\n $stmt->bind_param(\"iii\", $nuevo_id_trabajador, $nuevo_id_domicilio, $estatus);\n\n //Ejecuta el query\n $stmt->execute();\n\n //Cierra el query\n $stmt->close();\n\n\n\n\t //******Relacion del trabajador con su telefono******\n $stmt = $mysqli->prepare(\"INSERT INTO `telefono`(`id_telefono`, `telefono`, `tipo_telefono`, `lada`, `estatus`, `fecha_creacion`, `ultima_modificacion`)\n \t\t\t\t\t\t\t\t\t\t\t\t\tVALUES\n \t\t\t\t\t\t\t\t\t\t\t\t\t(NULL,?,?,?,?,now(),now())\");\n\n //Indica a la base de datos que recibira 1 String y 3 integer correspondientes a los signos de ? en el query\n $stmt->bind_param(\"siii\", $telefono_trabajador, $tipo_telefono_trabajador, $lada_trabajador, $estatus);\n\n //Ejecuta el query\n $stmt->execute();\n\n\t//Toma el ID del insert recien hecho\n $nuevo_id_telefono = $mysqli->insert_id;\n\n //Cierra el query\n $stmt->close();\n\n\n\n\t //******Relacion del telefono con su trabajador_telefono******\n $stmt = $mysqli->prepare(\"INSERT INTO `trabajador_telefono`(`id_trabajador_telefono`, `id_trabajador`, `id_telefono`, `estatus`, `fecha_creacion`, `ultima_modificacion`)\n \t\t\t\t\t\t\t\t\t\t\t\t\tVALUES\n \t\t\t\t\t\t\t\t\t\t\t\t\t(NULL,?,?,?,now(),now())\");\n\n //Indica a la base de datos que recibira 3 integer correspondientes a los signos de ? en el query\n $stmt->bind_param(\"iii\", $nuevo_id_trabajador, $nuevo_id_telefono, $estatus);\n\n //Ejecuta el query\n $stmt->execute();\n\n //Cierra el query\n $stmt->close();\n\n\t\n\t//relacion de usuario con estado\n\t$stmt = $mysqli->prepare(\"INSERT INTO `usuario_estado`(`id_usuario_estado`, `id_usuario`, `id_estado`, `estatus`, `fecha_creacion`, `ultima_modificacion`) VALUES (NULL, ?, ?, ?, now(), now())\");\n\t$estado = 4;\n\t$stmt->bind_param(\"iii\", $id_usuario, $estado, $estatus);\n\t\n\t$stmt->execute();\n\n\t//Cierra el query\n\t$stmt->close();\n\t\n\t\n\t//relacion de usuario con municipio\n\t$stmt = $mysqli->prepare(\"INSERT INTO `usuario_municipio`(`id_usuario_municipio`, `id_usuario`, `id_municipio`, `ciudad`, `estatus`, `fecha_creacion`, `ultima_modificacion`) VALUES (NULL, ?, ?, ?, ?, now(), now())\");\n\t\n\t$stmt->bind_param(\"iisi\", $id_usuario, $municipio, $ciudad, $estatus);\n\t\n\t$stmt->execute();\n\n\t//Cierra el query\n\t$stmt->close();\n\t\n\t\n\n return $nuevo_id_trabajador;\n }", "static public function almacenar_nueva_categoria_ganada($id_nueva_categ_ganada, $id_usuario, $id_ronda)\n {\n //Se valida que no exista ganada ya, esta categoria para la partida actual del usuario\n $id_partida = static::get_id_partida(self::$conexion->safeText(utf8_encode($id_ronda)));\n\n $queryExiste = \"SELECT tro_cat.id_categoria AS 'id_categoria' FROM trofeo_categoria_ganada AS tro_cat, partida_ronda_usupreg AS par_ron WHERE tro_cat.id_partida_ronda_usupreg = par_ron.id_partida_ronda_usupreg AND par_ron.id_partida = \".self::$conexion->safeText($id_partida).\" AND tro_cat.id_usuario = \".self::$conexion->safeText(utf8_encode($id_usuario)).\" AND tro_cat.id_categoria = \".self::$conexion->safeText(utf8_encode($id_nueva_categ_ganada));\n $resultExiste = self::$conexion->query_db($queryExiste);\n\n if(!empty(isset($resultExiste[0]))){\n return false;\n }\n else{\n $query = \"INSERT INTO trofeo_categoria_ganada(id_categoria, id_usuario, id_partida_ronda_usupreg) VALUES (\".self::$conexion->safeText(utf8_encode($id_nueva_categ_ganada)).\", \".self::$conexion->safeText(utf8_encode($id_usuario)).\", \".self::$conexion->safeText(utf8_encode($id_ronda)).\")\";\n return self::$conexion->exec_query_db($query);\n\n }\n \n }", "protected function cargaIdUbicacion() {\n $dao = new PGDAO();\n $strSql = $this->COLECCIONMAPEOUBICA . $this->propiedad->getId_ubica();\n $arrayDatos = $this->leeDBArray($dao->execSql($strSql));\n $id = $arrayDatos[0]['zpubica'];\n return $id;\n }", "static public function ctrCrearTransportadora(){\n\n\t\tif(isset($_POST[\"nuevaTransportadora\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ\\. ]+$/', $_POST[\"nuevaTransportadora\"])){\n\n\t\t\t /*=============================================\n\t\t\t\tVALIDAR IMAGEN DEL LOGO\n\t\t\t\t=============================================*/\n\n\t\t\t\t$ruta = \"\";\n\n\t\t\t\tif(isset($_FILES[\"nuevoLogo\"][\"tmp_name\"])){\n\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"nuevoLogo\"][\"tmp_name\"]);\n\n\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tCREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR EL LOGO DE LA TRANSPORTADORA\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t$nuevaTransportadoraDir = str_replace(array('ñ','Ñ','á','é','í','ó','ú','Á','É','Í','Ó','Ú','.',' '),array('n','N','a','e','i','o','u','A','E','I','O','U','_','_'),trim($_POST[\"nuevaTransportadora\"]));\n\n\t\t\t\t\t$directorio = \"vistas/img/transportadoras/\".$nuevaTransportadoraDir;\n\n\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\tif($_FILES[\"nuevoLogo\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$ruta = \"vistas/img/transportadoras/\".$nuevaTransportadoraDir.\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"nuevoLogo\"][\"tmp_name\"]);\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($_FILES[\"nuevoLogo\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$ruta = \"vistas/img/transportadoras/\".$nuevaTransportadoraDir.\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"nuevoLogo\"][\"tmp_name\"]);\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/* =====================================\n\t\t\t\t\tVALIDAR TRANSPORTADORA\n\t\t\t\t========================================== */\n\n\t\t\t\t$tabla = \"transportadoras\";\n\n\t\t\t\t$datos = array(\"transportadora\" => $_POST[\"nuevaTransportadora\"],\n\t\t\t\t\t \"logo\"=>$ruta);\n\n\t\t\t\t$respuesta = ModeloTransportadoras::mdlIngresarTransportadora($tabla, $datos);\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\ttitle: \"¡La transportadora ha sido guardada correctamente!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\twindow.location = \"transportadoras\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\n\t\t\t\t\t</script>';\n\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n\n\t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"¡La transportadora no puede ir vacía o llevar caracteres especiales!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\twindow.location = \"transportadoras\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\n\t\t\t\t</script>';\n\n\t\t\t}\n\n\n\t\t}\n\n\n\t}", "static public function ctrCrearAtencion(){\r\n\t\t\tif (isset($_POST[\"nuevoCodigo\"])){\r\n\t\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"idUser\"])){\r\n\r\n\r\n\t\t\t\t\t$tabla = \"atencion\";\r\n\r\n\t\t\t\t\t\t$datos = array(\"codigo_atencion\" => $_POST[\"nuevoCodigo\"],\r\n\t\t\t\t\t\t\t\t\t \"id_usuario\" => $_POST[\"idUsuario\"],\r\n\t\t\t\t\t\t\t\t\t \"id_personal_salud\" => $_POST[\"nuevaPersonalSalud\"],\r\n\t\t\t\t\t\t\t\t\t \"id_paciente\" => $_POST[\"nuevoPaciente\"],\r\n\t\t\t\t\t\t\t\t\t \"ups\" => $_POST[\"nuevaUps\"],\r\n\t\t\t\t\t\t\t\t\t \"servicio\" => $_POST[\"nuevoServicio\"],\r\n\t\t\t\t\t\t\t\t\t \"especialidad\" => $_POST[\"nuevaEspecialidad\"],\r\n\t\t\t\t\t\t\t\t\t \"diagnostico\" => $_POST[\"nuevoDiagnostico\"],\r\n\t\t\t\t\t\t\t\t\t \"fecha_atencion\" => $_POST[\"nuevaFechaAtencion\"]);\r\n\r\n\t\t\t\t\t\t$respuesta = ModeloAtenciones::mdlIngresarAtenciones($tabla, $datos);\r\n\r\n\t\t\t\t\t\tif ($respuesta == \"ok\") {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\r\n\t\t\t\t\t\t\t\t\t\ttitle: \"¡La Atención ha sido guardado correctamente!\",\r\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\twindow.location = \"atenciones\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t \t\t </script>';\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\ttype: \"error\",\r\n\t\t\t\t\t\t\t\ttitle: \"¡La Atención no puede ir vacía o llevar caracteres especiales !\",\r\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\twindow.location = \"atenciones\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t </script>';\r\n\r\n\t\t\t}\r\n\t\t }\r\n\t\t/*===== FIN registro pacientes ======*/\t\t\t\t\t\r\n\t\t}", "function crear_relato(){\r\n $this->load->database();\r\n\r\n $datos_insertar = $this->input->post();\r\n unset($datos_insertar['bt_enviar']); //le quitamos el boton enviar, pues no lo necesitamos para el insert de\r\n\r\n //print_r($datos_insertar);\r\n $this->db->insert('relatos',$datos_insertar);\r\n\r\n //insertamos el relato en nuestra BD\r\n $id_relato = $this->db->insert_id();\r\n\r\n //tras crear el relato, insertamos el primer capitulo, pues todos los relatos constarán de al menos un capitulo\r\n $datos_primer_capitulo = array(\r\n \"numRelato\" => $id_relato,\r\n \"texto\" => 'CAPÍTULO 1:'\r\n );\r\n\r\n //print_r($datos_primer_capitulo);\r\n $this->db->insert('capitulos',$datos_primer_capitulo);\r\n\r\n return $id_relato;\r\n }", "private function getCodigoPresupuestarioInmuebleUrbano()\r\n\t\t{\r\n\t\t\t$codigoPresupuesto['codigo'] = '301020500';\r\n\t\t\treturn $codigo = self::getCodigoPresupuestarioByCodigo($codigoPresupuesto['codigo']);\r\n\t\t}", "function insertAtenciones(){\n\n\t$id_item=2; // proyecto : LEVEL\n\t$id_status=3;\n\t$id_nivel=1;\n\t$id_usuario=146; //larry portanova\n\t$id_user=203; //larry portanova\n\n\n\t//leer archivo\n\t$buffer=implode('',file('atenciones2/level.csv'));\n\n\t//parsear csv\n\t$atenciones=[];\n\n\t$lineas=explode(\"\\n\",$buffer);\n\n\t$campos=explode(\",\",$lineas[0]);\n\n\tforeach($lineas as $i => $linea){\n\n\t\tif($i==0) continue;\n\n\t\t$columnas=str_getcsv($linea);\n\n\t\tforeach($columnas as $j => $columna){\n\n\t\t\t$atenciones[$i][strtolower(trim($campos[$j]))]=$columna;\n\t\t}\n\n\t}\n\n\t// prin($atenciones);\n\n\t//inserts\n\n\t$fechaMonth=[\n\t'Ene'=>'01','Feb'=>'02','Mar'=>'03','Apr'=>'04','May'=>'05','Jun'=>'06','Jul'=>'07','Aug'=>'08','Set'=>'09','Oct'=>'10','Nov'=>'11','Dic'=>'12',\n\t'01'=>'01','02'=>'02','03'=>'03','04'=>'04','05'=>'05','06'=>'06','07'=>'07','08'=>'08','09'=>'09','10'=>'10','11'=>'11','12'=>'12',\n\t];\n\n\n\n\tforeach($atenciones as $i => &$atencion){\n\n\t\tif(trim($atencion['nombre'])=='') continue;\n\n\t\t//eliminamos vacio\n\t\tunset($atencion['']);\n\n\t\t//nombre completo\n\t\t$atencion['nombre_completo']=$atencion['nombre'];\n\n\t\t//nombre y apellidos\n\t\t$nom_partes=explode(\" \",$atencion['nombre']);\n\t\t$atencion['nombre']=$nom_partes[0];\n\t\tunset($nom_partes[0]);\n\t\t$atencion['apellidos']=trim(implode(\" \",$nom_partes));\n\n\t\t//fecha\n\t\t$atencion['fecha_original']=$atencion['fecha'];\n\t\t$fecha_partes=explode(\"-\",$atencion['fecha']);\n\t\t$atencion['fecha']=\"2015-\".$fechaMonth[$fecha_partes[1]].\"-\".str_pad($fecha_partes[0], 2, \"0\", STR_PAD_LEFT).\" 14:00:00\";\n\n\t\t$atencion['seguimiento']='Primer contacto';\n\t\t// prin($atencion['fecha']);\n\n\t\t// prin($atencion);\n\n\t\t// continue;\n\n\t\t//\n\t\t//cliente\n\t\t$clienteId=getIdOrCreate(\n\t\t\t\"clientes\",\n\t\t\t[\n\t\t\t\t\"nombre\" =>$atencion['nombre'],\n\t\t\t\t\"apellidos\" =>$atencion['apellidos'],\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"celular_claro\" =>$atencion['tel. cel.'],\n\t\t\t\t\"email\" =>$atencion['email'],\n\t\t\t\t\"telefono\" =>$atencion['fijo'],\n\n\t\t\t\t\"id_usuario\" =>$id_usuario,//\n\t\t\t\t\"user\" \t\t =>$id_user,//\n\n\t\t\t\t// \"tipo_cliente\" =>rand(1, 2),\n\t\t\t\t// \"genero\" \t\t=>rand(1, 2),\n\t\t\t\t// \"genero\" \t\t=>rand(1, 2),\n\t\t\t\t// \"email\" \t\t=>\"[email protected]\",\n\t\t\t]\n\t\t\t);\n\n\n\t\t//\t$pedido='[{\"type\":\"departamento\",\"price\":\"621000\",\"id\":\"12\"}]';\n\t\t//departamento\n\t\t$item_item=select_fila(\"id,pvlista\",\"productos_items_items\",\"where numero=\".$atencion['departamento'].\" and id_item=\".$id_item);\n\n\t\t// $pedido='[{\"type\":\"departamento\",\"price\":\"'.$item_item['pvlista'].'\",\"id\":\"'.$item_item['id'].'\"}]';\n\n\t\t// $pedido='[{\"type\":\"departamento\",\"price\":\"'.$item_item['pvlista'].'\",\"id\":\"'.$item_item['id'].'\",\"name\":\"1 departamento'.$atencion['departamento'].'\",\"num\":\"'.$atencion['departamento'].'\",\"torre\":\"1\"}]';\n\n\t\t$canalId=getIdOrCreate(\n\t\t\t\"contacto_canales\",\n\t\t\t[\n\t\t\t\"nombre\" =>$atencion['medio'],\n\t\t\t]\n\t\t\t);\n\n\n\t\t// prin($atencion);\n\t\t//atencion\n\t\t$venta=insert(\n\t\t\t[\n\t\t\t\"fecha_creacion\" =>$atencion['fecha'],//\n\t\t\t\"fecha_creacion2\"=>$atencion['fecha'],//\n\t\t\t\"visibilidad\" =>'1',\n\t\t\t\"id_cliente\" =>$clienteId,\n\t\t\t\"id_status\" =>$id_status,//\n\t\t\t\"id_nivel\" =>$id_nivel,//\n\t\t\t\"id_canal\" =>$canalId,\n\t\t\t\"id_item\" =>$id_item,//\n\t\t\t\"id_usuario\" =>$id_usuario,//\n\t\t\t\"user\" \t\t =>$id_user,//\n\t\t\t\n\t\t\t// \"pedido\" =>$pedido,//\n\t\t\t// \"pvlista\" =>$item_item['pvlista'],//\n\t\t\t// \"pvpromocion\" =>$item_item['pvlista'],//\n\n\t\t\t// \"id_item_item\" =>$item_item['id'],//\n\n\t\t\t]\n\t\t\t,\"ventas_items\"\n\t\t\t);\n\n\t\tif(trim($atencion['seguimiento'])!='')\n\t\tinsert(\n\t\t\t[\n\t\t\t'fecha_creacion' =>$atencion['fecha'],\n\t\t\t// \"id_item\" =>$id_item,//\n\t\t\t'id_grupo' =>$venta['id'],\n\t\t\t// \"id_cliente\" =>$clienteId,\n\t\t\t'texto' =>$atencion['seguimiento'],\n\t\t\t]\n\t\t\t,'ventas_mensajes'\n\t\t\t,1\n\t\t\t);\n\n\t}\n\n\t// exit();\n\n\tprin(\"Inserciones DONE\");\n\n\t// prin($atenciones);\n\n\t// prin($celdas);\n\n\n\t// $matriz = str_getcsv($buffer,',','\"','\\\\',\"\\n\");\n\n\t// $matriz = str_getcsv($buffer); \n\n\t// prin($matriz);\n\n}", "function alta_unidad_m(){\n\t\t$u= new Unidad_medida();\n\t\t$u->fecha_alta=date(\"Y-m-d\");\n\t\t$u->estatus_general_id=1;\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$related = $u->from_array($_POST);\n\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han registrado los datos de la Unidad de Medida.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "function RegistrarNotasAnticipo($tipoCambioFac = 0,$montoAnticipo=0,$tagref, $monedaFactura, $fechaemision, $DebtorNo, $DebtorTransIDFactura, $tieneIVA,$idAnticipo,$ivaFactura, $db, $puntoVenta = 0, $nocuentaPuntoVenta = '', $nomClientePuntoVenta = ''){\n // *********************************************** //\n // ********************************************** //\n // ******** No dejar echo en la funcion *********//\n // ******** Declarar Variables a usar ******** //\n // ******** Afecta al punto de venta ********* //\n // ****************************************** //\n // ***************************************** //\n \n //global $db;\n $systype_doc = 13;\n /*$tipocambio = $_SESSION['Items' . $identifier]->CurrencyRate;\n $montoAnticipo = $LineAnticipo->Monto;\n $moneda = $_SESSION['Items' . $identifier]->CurrAbrev;\n $fecha = split(\"-\", $fechaemision) ;\n $DebtorNo = $_SESSION['Items' . $identifier]->DebtorNo;\n $tagref = $_SESSION['Items' . $identifier]->Tagref;\n $tieneIVA = $tieneIVA;\n $idAnticipo = $LineAnticipo->TransID;*/\n\n //echo \"<br> AnticipoIVA: \".$tieneIVA;\n $tipocambio = $tipoCambioFac;\n $montoAnticipo = $montoAnticipo;\n $monto = $montoAnticipo;\n $moneda = $monedaFactura;\n $fecha = explode(\"-\", $fechaemision) ;\n $DebtorNo = $DebtorNo;\n $tagref = $tagref;\n $tieneIVA = $tieneIVA;\n $idAnticipo = $idAnticipo;\n $ErrMsg = '';\n $DbgMsg = '';\n\n $InputError = 0;\n\n $FromDia = $fecha [2];\n $FromMes = $fecha [1];\n $FromYear = $fecha [0];\n $_POST['aplparcial'] = 2; // PARA TIMBRAR\n $_POST['cmbUsoCfdi'] = 'G02'; \n $_POST['cmbTipoComprobante'] = 'E';\n $_POST['cmbMetodoPago'] = 'PUE';\n $_POST['cmbTipoRelacion'] = '07';\n $_POST['paymentname'] = 'Aplicacion de anticipos';\n $vrcodepay = utf8_decode('Aplicacion de anticipos');\n $concepto = utf8_decode('Aplicacion de anticipos'); \n $vrcodeasat = '30';\n //$idSaldoAnticipo = $LineAnticipo->TransID;\n $DebtorTransID = $DebtorTransIDFactura ;\n\n $SQLDatosFactura= \"SELECT debtortrans.*, name FROM debtortrans\n INNER JOIN debtorsmaster ON debtortrans.debtorno = debtorsmaster.debtorno\n WHERE id =\" .$DebtorTransIDFactura;\n $resultFactura = DB_query($SQLDatosFactura, $db);\n $myrowFactura = DB_fetch_array($resultFactura);\n $TotalFactura = $myrowFactura['ovamount'] + $myrowFactura['ovgst'];\n $typeFactura = $myrowFactura['type'];\n $nombrecliente= $myrowFactura['name'];\n \n\n //echo \"<br> Tipo cambio BIEN\".$tipoCambioFacBIEN;\n\n $_POST ['TaxCat'] = 2;\n if($tieneIVA == '1'){\n $_POST ['TaxCat'] = 4;\n }\n\n $nocuenta = '';\n if ($puntoVenta == 1) {\n $nocuenta = $nocuentaPuntoVenta;\n } else {\n if (isset($_POST ['nocuenta'])) {\n $nocuenta = $_POST ['nocuenta'];\n }\n }\n\n $nomCliente = '';\n if ($puntoVenta == 1) {\n $nomCliente = $nomClientePuntoVenta;\n } else {\n if (isset($nombrecliente)) {\n $nomCliente = $nombrecliente;\n }\n }\n\n $_POST ['nocuenta'] = $nocuenta;\n\n $nombrecliente = $nomCliente;\n\n $SQLSaldoANT = \"SELECT debtortrans.*, bien.rate as cambiobien FROM debtortrans \n INNER JOIN debtortrans bien ON bien.id = debtortrans.ref1\n WHERE debtortrans.id ='\".$idAnticipo.\"'\"; \n\n //echo \"<br> saldo\".$SQLSaldoANT;\n $resultSaldoANT = DB_query($SQLSaldoANT, $db);\n $rowSaldoANT = DB_fetch_array($resultSaldoANT);\n $monedaSaldoANT = $rowSaldoANT['currcode'];\n $rateSaldoANT = $rowSaldoANT['rate'];\n $ivaSaldoANT = $rowSaldoANT['ovgst'];\n $tipoCambioFacBIEN= $rowSaldoANT['cambiobien'];\n \n\n //echo \"<br> Pruebas: \".$rowSaldoANT;\n //echo \"<br> saldo ANt: \".$rateSaldoANT;\n if ($InputError != 1) {\n $Result = DB_Txn_Begin($db);\n \n // Obtiene el trans no que le corsesponde en base al tagref y al $systype_doc\n $transno = GetNextTransNo($systype_doc, $db);\n \n $taxrate = 0;\n $montoiva = 0;\n $rate = ( $tipocambio);\n $DefaultDispatchDate = $FromDia . '/' . $FromMes . '/' . $FromYear;\n $fechaini = rtrim($FromYear) . '-' . rtrim($FromMes) . '-' . rtrim($FromDia);\n $diae = rtrim($FromDia);\n $mese = rtrim($FromMes);\n $anioe = rtrim($FromYear);\n $horax = date('H:i:s');\n $horax = strtotime($horax);\n $hora = date('H');\n $minuto = date('i');\n $segundo = date('s');\n $fechainic = mktime($hora, $minuto, $segundo, rtrim($mese), rtrim($diae), rtrim($anioe));\n $fechaemision = date(\"Y-m-d H:i:s\", $fechainic);\n $PeriodNo = GetPeriod($DefaultDispatchDate, $db, $tagref);\n $DefaultDispatchDate = FormatDateForSQL($DefaultDispatchDate);\n \n if (isset($_POST ['TaxCat']) and $_POST ['TaxCat'] != \"\") {\n $sqliva = \"SELECT taxrate,taxglcode,taxglcodepaid\n FROM taxauthrates, taxauthorities\n WHERE taxauthrates.taxauthority=taxauthorities.taxid\n AND taxauthrates.taxcatid =\" . $_POST ['TaxCat'];\n\n //echo \"<br> SQL IVA\".$sqliva;\n\n $result = DB_query($sqliva, $db);\n $myrow = DB_fetch_row($result);\n $taxrate = $myrow [0];\n $taxglcode = $myrow [1];\n $taxglcodepaid = $myrow [2];\n }\n\n // calcula iva y desglosa de iva\n // $montosiniva = $monto / (1 + $taxrate);\n // $montoiva = $monto - $montosiniva;\n\n $mntIVA = 0;\n if (isset($_POST['mntIVA'])) {\n $mntIVA = $_POST['mntIVA'];\n }\n\n // calcula iva y desglosa de iva\n if (($mntIVA == 0 || empty($mntIVA))) {\n //Iva del categoria impuestos\n $montosiniva = $monto / (1 + $taxrate);\n $montoiva = $monto - $montosiniva;\n }else{\n //Iva agregado manual\n $_SESSION['IvaManualAbonoDirectoClientes'] = 1;\n //\n $montosiniva = $monto - $mntIVA;\n //$montosiniva = $monto;\n $montoiva = $mntIVA;\n } \n // se valida ya que debe de acuerdo al iva de l factura\n //echo \"<br> ivaFactura2: \".$ivaFactura;\n if( (Round($TotalFactura,2) - Round($monto,2) < -.01) AND $tieneIVA ==1 AND $ivaFactura == 0){\n $monto = $montosiniva;\n $montoiva = $montosiniva - ($montosiniva/1.16);\n $montosiniva = ($montosiniva/1.16);\n $montoAnticipo = $monto;\n }\n \n // Datos del Periodo y fecha ***\n // $DefaultDispatchDate=Date($_SESSION['DefaultDateFormat'],CalcEarliestDispatchDate());\n // $PeriodNo = GetPeriod($DefaultDispatchDate, $db);\n \n // $DefaultDispatchDate = FormatDateForSQL($DefaultDispatchDate);\n // *****************************\n if ($_SESSION['MostrarCuentaNC']=='1') {\n $SQL=\"SELECT accountcode,\n concept AS accountname\n FROM chartbridge\n WHERE accountcode='\".$_POST['GLCode'].\"'\n ORDER BY accountcode\";\n $ResultR=DB_query($SQL, $db);\n $rowR=DB_fetch_array($ResultR);\n $concepto.=' '.$rowR['accountname'];\n }\n // Realiza el insert en la tabla de debtortrans\n $SQL = \"INSERT INTO debtortrans (`tagref`,\n `transno`,`type`,\n `debtorno`,`branchcode`,\n `origtrandate`,`trandate`,`prd`,\n `settled`,`reference`,`tpe`,`order_`,\n `rate`,`ovamount`,`ovgst`,`ovfreight`,\n `ovdiscount`,`diffonexch`,`alloc`,`invtext`,\n `shipvia`,`edisent`,`consignment`,`folio`,`ref1`,`ref2`,`currcode`,paymentname,nocuenta,userid)\";\n $SQL .= \" VALUES (\" . $tagref . \",\n \" . $transno . \",\" . $systype_doc . \",\n '\" . $DebtorNo . \"', '\" . $DebtorNo . \"','\" . $fechaemision . \"','\" . $fechaini . \"',\" . $PeriodNo . \",'0','\" . $concepto . \"', '','0','\" . $rate . \"',\" . ($montosiniva * - 1) . \",\" . ($montoiva * - 1) . \",'0','0','0','0','','1','0','', 'FANT','NCR','NCR','\" . $moneda . \"','\" . $_POST ['paymentname'] . \"','\" . $_POST ['nocuenta'] . \"','\".$_SESSION['UserID'].\"')\";\n // echo '<pre>sql NC:'.$SQL;\n $result = DB_query($SQL, $db);\n \n $DebtorTransIDND = DB_Last_Insert_ID($db, 'debtortrans', 'id');\n\n // ***************************************************************************************************\n // **** CFDI Relacionados ****\n // ***************************************************************************************************\n // \n //******************GENERAR NOTA DE CARGO Y SE HACE LA APLICACION YA QUE ES SIN CONTABILIDAD****************** \n $systype_docN = 21;\n $transnoN = GetNextTransNo($systype_docN, $db); \n $SQLN = \"INSERT INTO debtortrans (`tagref`,\n `transno`,`type`,\n `debtorno`,`branchcode`,\n `origtrandate`,`trandate`,`prd`,\n `settled`,`reference`,`tpe`,`order_`,\n `rate`,`ovamount`,`ovgst`,`ovfreight`,\n `ovdiscount`,`diffonexch`,`alloc`,`invtext`,\n `shipvia`,`edisent`,`consignment`,`folio`,`ref1`,`ref2`,`currcode`,paymentname,nocuenta,userid)\";\n $SQLN .= \" VALUES (\" . $tagref . \",\n \" . $transnoN . \",\" . $systype_docN . \",\n '\" . $DebtorNo . \"', '\" . $DebtorNo . \"','\" . $fechaemision . \"','\" . $fechaini . \"',\" . $PeriodNo . \",'0','\" . $concepto . \"', '','0','\" . $rateSaldoANT . \"',\" . ($montosiniva) . \",\" . ($montoiva) . \",'0','0','0','0','','1','0','', 'FANT','NCR','NCR','\" . $moneda . \"','\" . $_POST['paymentname'] . \"','\" . $_POST ['nocuenta'] . \"','\".$_SESSION['UserID'].\"')\";\n //echo '<pre>sql NC:'.$SQLN;\n $result = DB_query($SQLN, $db);\n $DebtorTransIDCargo = DB_Last_Insert_ID($db, 'debtortrans', 'id');\n\n $ISQL = \"INSERT INTO custallocns (datealloc,transid_allocfrom,amt,transid_allocto, rate_to,currcode_to, rate_from, currcode_from)\n VALUES ( NOW(),\" . $idAnticipo . ',' . abs($montoAnticipo) . ',' . $DebtorTransIDCargo . ',\"'.$tipocambio.'\", \"'.$moneda.'\", \"'.$rate.'\", \"'.$moneda.'\" )';\n $Result = DB_query($ISQL, $db, $ErrMsg, $DbgMsg, true);\n\n $ISQL = \"UPDATE debtortrans SET alloc = alloc + \".($montoAnticipo * -1 ).\" WHERE id = '\".$idAnticipo.\"' \" ;\n $Result = DB_query($ISQL, $db, $ErrMsg, $DbgMsg, true);\n\n\n $ISQL = \"UPDATE debtortrans SET alloc = alloc + \".abs($montoAnticipo).\", settled=1 WHERE id = '\".$DebtorTransIDCargo.\"' \" ;\n $Result = DB_query($ISQL, $db, $ErrMsg, $DbgMsg, true);\n\n //********************GENERAR NOTA DE CARGO Y SE HACE LA APLICACION YA QUE ES SIN CONTABILIDAD********************\n $percentDescription=\"\";\n if ($_SESSION['FacturaVersion']==\"3.3\") {\n\n $queryInsert=\"INSERT INTO notesorders_invoice(transid,transid_relacion,monto, tiporelacion_relacion, trandate)\";\n $queryInsert.=\" VALUES ('\".$DebtorTransIDND.\"','\".$DebtorTransID.\"',\".str_replace(\",\", \"\", $monto ).\", '\".$_POST['cmbTipoRelacion'].\"', NOW())\";\n\n\n // echo \" Consulta: <br> notesordes: \".$queryInsert;\n $result = DB_query($queryInsert, $db);\n\n // SE HACE LA RELACION DE FACTURA CON NOTA DE CREDITO\n $ISQL = \"INSERT INTO custallocns (datealloc,transid_allocfrom,amt,transid_allocto, rate_to,currcode_to, rate_from, currcode_from )\n VALUES (NOW(),\" . $DebtorTransIDND . ',' . abs($monto ) . ',' . $DebtorTransID . ', \"'.$tipocambio.'\", \"'.$moneda.'\", \"'.$rate.'\", \"'.$moneda.'\")';\n //echo \"<br> PRUEBAS: \".$ISQL;\n $Result = DB_query($ISQL, $db, $ErrMsg, $DbgMsg, true);\n\n $ISQL = \"UPDATE debtortrans SET alloc = alloc + \". (abs($monto ) * -1 ).\", settled=1 WHERE id = '\".$DebtorTransIDND.\"' \" ;\n //echo \"<br> PRUEBAS: \".$ISQL;\n $Result = DB_query($ISQL, $db, $ErrMsg, $DbgMsg, true);\n $ISQL = \"UPDATE debtortrans SET alloc = alloc + \".abs($monto).\" WHERE id = '\".$DebtorTransID.\"' \" ;\n //echo \"<br> PRUEBAS: \".$ISQL;\n $Result = DB_query($ISQL, $db, $ErrMsg, $DbgMsg, true);\n // SE HACE LA RELACION DE FACTURA CON NOTA DE CREDITO\n \n \n if ($result && 1 == 2) {\n $banderaEx = 0;\n if ($banderaEx > 0) {\n while ($rse = DB_fetch_array($rrr)) {\n $queryFolio=\"SELECT REPLACE(folio,'|','') as folio FROM debtortrans WHERE id = '\".$rse['transid_relacion'].\"'\";\n $resultFolio = DB_query($queryFolio, $db);\n $myrowFolio = DB_fetch_array($resultFolio);\n $percentDescription .= \", aplicado al folio: \" .$myrowFolio['folio'] ;// \", \" . number_format((($rse['monto']/$monto) * 100), '0', '.', '') .\" % al saldo del folio: \" .$myrowFolio['folio'] ;\n }\n } else {\n $queryFolio=\"SELECT REPLACE(folio,'|','') as folio FROM debtortrans WHERE id = '\".$_POST['InvoiceTransId_'.$index].\"'\";\n $resultFolio = DB_query($queryFolio, $db);\n $myrowFolio = DB_fetch_array($resultFolio);\n $percentDescription .= \", aplicado al folio: \" .$myrowFolio['folio'] ;//$percentDescription .= \", \" . number_format((( str_replace(\",\", \"\", $_POST['InvoiceAmount_'.$index])/$monto) * 100), '0', '.', '') .\" % al saldo del folio: \" .$myrowFolio['folio'] ;\n }\n }\n //SE CREA INSERT PARA REGISTRAR LA RELACION DE LA FACTURA CON EL ANTICIPO\n $SQLAnt = \"UPDATE salesinvoiceadvance SET transidncredito = '\".$DebtorTransIDND.\"' , montoncredito = '\".str_replace(\",\", \"\", $monto).\"', transidncargo = '\".$DebtorTransIDCargo.\"' WHERE transidinvoice = '\".$DebtorTransID.\"' AND transidanticipo = '\".$idAnticipo.\"';\";\n $resultado = DB_query($SQLAnt, $db);\n\n //SE CREA INSERT PARA REGISTRAR LA RELACION DE LA FACTURA CON EL ANTICIPO\n\n $querySelect=\"select notesorders_invoice.transid_relacion,(abs(notesorders_invoice.monto)) AS ovamount ,codesat,c_paymentid,paymentname\n from notesorders_invoice\n left join debtortrans on notesorders_invoice.transid_relacion = debtortrans.id\n where notesorders_invoice.transid='\".$DebtorTransIDND.\"'\n order by notesorders_invoice.monto desc limit 1;\";\n $resultSelect = DB_query($querySelect, $db);\n\n if (DB_num_rows($resultSelect)) {\n $myrowResult=DB_fetch_array($resultSelect);\n\n if ($myrowResult['codesat']==null or $myrowResult['codesat']=='') {\n $queryGetCod=\"SELECT debtortrans.paymentname, paymentmethods.codesat\n FROM debtortrans \n INNER JOIN paymentmethods ON paymentmethods.paymentname= debtortrans.paymentname\n WHERE id='\".$myrowResult['transid_relacion'].\"'\n LIMIT 1\";\n $resultGetc = DB_query($queryGetCod, $db);\n if (DB_num_rows($resultGetc)) {\n $myrowGet=DB_fetch_array($resultGetc);\n\n //$vrcodeasat=$myrowGet['codesat'];\n //$vrcodepay=$myrowGet['paymentname'];\n }\n if ($_SESSION['UserID'] == 'desarrollo') {\n //echo '<pre> paymentname:'.$queryGetCod;\n //echo htmlentities($arrayGeneracion['xml']);\n }\n } else {\n //$vrcodeasat=$myrowResult['codesat'];\n //$vrcodepay=$myrowResult['paymentname'];\n }\n\n $vrcodepayid= $_POST['cmbMetodoPago'];\n \n \n $percentDescription = \"\"; // se deja vacio ya que la descripción solo permite 1000 caracteres, si no se timbra, se agrega solo en PDF\n\n $queryUpdate=\"UPDATE debtortrans SET paymentname='\".$vrcodepay.\"',codesat='\".$vrcodeasat.\"',c_TipoDeComprobante='E',c_paymentid='\".$vrcodepayid.\"',c_UsoCFDI='\".$_POST['cmbUsoCfdi'] .\"',invtext=concat(invtext,' ', '\".$percentDescription.\"') WHERE id='\".$DebtorTransIDND.\"'\";\n //echo \"<br>sqlUpdate:<pre>\".$queryUpdate;\n\n $result = DB_query($queryUpdate, $db);\n } else {\n $percentDescription = \"\"; // se deja vacio ya que la descripción solo permite 1000 caracteres, si no se timbra, se agrega solo en PDF\n\n $queryUpdate=\"UPDATE debtortrans SET paymentname='\".$_POST['paymentname'].\"',codesat='\".$vrcodeasat.\"',c_TipoDeComprobante='E',c_paymentid='\".$_POST['cmbMetodoPago'].\"',c_UsoCFDI='\".$_POST['cmbUsoCfdi'] .\"',invtext=concat(invtext,' ', '\".$percentDescription.\"') WHERE id='\".$DebtorTransIDND.\"'\";\n //echo \"<br>sqlUpdate:<pre>\".$queryUpdate;\n\n $result = DB_query($queryUpdate, $db);\n }\n }\n \n \n // ***************************************************************************************************\n // **** AFECTACIONES CONTABLES ****\n // ***************************************************************************************************\n $rmontosiniva = ($montosiniva / $rate);\n $rmontosinivaANT = ($montosiniva / $tipoCambioFacBIEN);\n $rmontoiva = ($montoiva / $rate);\n $rmontoivaP = ($montoiva / $rateSaldoANT);\n $rmonto = ($monto / $rate);\n\n /*echo \"<br> MONTO; TOTAL total: \".$monto.\" \".$rate.\" \".($monto/$rate);\n echo \"<br> MONTO; TOTAL montoiva : \".$montoiva.\" \".$rateSaldoANT.\" \".($montoiva/$rateSaldoANT);\n echo \"<br> MONTO; TOTAL MONTO SIN IVA : \".$montosiniva.\" \".$rate.\" \".($montosiniva/$rate);\n echo \"<br> MONTO; TOTAL MONTO SIN IVA tipoCambioFacBIEN : \".$montosiniva.\" \".$tipoCambioFacBIEN.\" \".($montosiniva/$tipoCambioFacBIEN);*/\n //$montoiva = $ivaNotaCredito/$rate;\n //$rmonto = $montoNotaCredito/$rate;\n \n // Obtiene la cuentas contables que se afectaran\n // *****************************************\n // Se afecta la cuenta de CxC\n // *****************************************\n // $cuenta_cxc=$_SESSION['CompanyRecord']['debtorsact'];\n $SQLClient = \"SELECT typeid FROM debtorsmaster WHERE debtorno='\" . $DebtorNo . \"'\";\n $result_typeclient = DB_query($SQLClient, $db, $ErrMsg, $DbgMsg, true);\n \n if (DB_num_rows($result_typeclient) == 1) {\n $myrowtype = DB_fetch_array($result_typeclient);\n $tipocliente = $myrowtype ['typeid'];\n }\n \n if ($typeFactura == 110 ) {\n \n $cuenta_cxc = ClientAccount($tipocliente, 'gl_accountcontado', $db);\n }else{\n $cuenta_cxc = ClientAccount($tipocliente, 'gl_accountsreceivable', $db);\n }\n\n \n\n $diferenciCambiariaTotal = 0;\n $diferenciCambiariaIVA = 0;\n if($monedaSaldoANT== $moneda aND $moneda!=$_SESSION ['CountryOfOperation'] ){\n\n $diferenciCambiaria=Round( abs((str_replace(\",\", \"\", $montosiniva)/$tipoCambioFacBIEN)) - (str_replace(\",\", \"\", $montosiniva)/$rate),8) ;\n\n $diferenciCambiariaIVA =Round( abs($montosiniva) /$rateSaldoANT - (str_replace(\",\", \"\", $montosiniva)/$rate),8) ;\n }elseif($monedaSaldoANT!=$_SESSION ['CountryOfOperation'] AND $moneda!=$_SESSION ['CountryOfOperation']){\n\n $diferenciCambiaria=Round(abs((str_replace(\",\", \"\", $montosiniva)/$tipoCambioFacBIEN)) - (str_replace(\",\", \"\", $montosiniva)/$rate),8) ;\n $diferenciCambiariaIVA =Round( abs($montoiva) /$rateSaldoANT - (str_replace(\",\", \"\", $montoiva)/$rate),8) ;\n }elseif($monedaSaldoANT!=$_SESSION ['CountryOfOperation'] AND $moneda==$_SESSION ['CountryOfOperation']){\n\n $diferenciCambiaria=Round(abs((str_replace(\",\", \"\", $montosiniva)/$tipoCambioFacBIEN)) - (str_replace(\",\", \"\", $montosiniva)/$rate),8) ;\n $diferenciCambiariaIVA =Round( abs($montoiva) /$rateSaldoANT - (str_replace(\",\", \"\", $montoiva)/$rate),8) ;\n }\n \n \n if ($montoiva != 0) {\n\n $SQL = \"INSERT INTO gltrans (\n type,\n typeno,\n trandate,\n periodno,\n account,\n narrative,\n amount,\n tag\n )\n VALUES (\n '\" . $systype_doc . \"',\n '\" . $transno . \"',\n '\" . $DefaultDispatchDate . \"',\n '\" . $PeriodNo . \"',\n '\" . $taxglcode . \"',\n '\" . $DebtorNo . \" No. de Nota de Credito: \" . $transno . \" @\" . $nombrecliente . \" ',\n '\" . ($rmontoiva) . \"',\n '\" . $tagref . \"'\n )\";\n \n $result = DB_query($SQL, $db);\n\n if( abs($ivaSaldoANT) ==0 ){\n $SQL = \"INSERT INTO gltrans (\n type,\n typeno,\n trandate,\n periodno,\n account,\n narrative,\n amount,\n tag\n )\n VALUES (\n '\" . $systype_doc . \"',\n '\" . $transno . \"',\n '\" . $DefaultDispatchDate . \"',\n '\" . $PeriodNo . \"',\n '\" . $taxglcodepaid . \"',\n '\" . $DebtorNo . \" No. de Nota de Credito: \" . $transno .' @TC:' . (1 / $rateSaldoANT). \" @\" . $nombrecliente . \" ',\n '\" . ($rmontoivaP *-1) . \"',\n '\" . $tagref . \"'\n )\";\n if ($_SESSION ['UserID'] == \"admin\") {\n // echo '<pre>'.$SQL;\n }\n $result = DB_query($SQL, $db);\n\n }else{\n //$diferenciCambiaria = $diferenciCambiaria + $diferenciCambiariaIVA;\n }\n\n\n \n }\n \n // Obtiene la cuentas contables que se afectar�n\n // $cuenta_notacredito=$_SESSION['CompanyRecord']['creditnote'];\n\n $cuenta_notacredito= ClientAccount($tipocliente, 'gl_debtoradvances', $db);\n\n // *****************************************\n // Se afecta la cuenta de CxC\n // *****************************************\n \n $SQL = \"INSERT INTO gltrans (\n type,\n typeno,\n trandate,\n periodno,\n account,\n narrative,\n amount,\n tag\n )\n VALUES (\n '\" . $systype_doc . \"',\n '\" . $transno . \"',\n '\" . $DefaultDispatchDate . \"',\n '\" . $PeriodNo . \"',\n '\" . $cuenta_cxc . \"',\n '\" . $DebtorNo . \" No. de Nota de Credito: \" . $transno .' @TC:' . (1 / $tipoCambioFacBIEN). \" @\" . $nombrecliente . \" ',\n '\" . ($rmonto * - 1) . \"',\n '\" . $tagref . \"'\n )\";\n // echo $SQL;\n if ($_SESSION ['UserID'] == \"admin\") {\n // echo '<pre>'.$SQL;\n }\n $result = DB_query($SQL, $db);\n\n\n\n if(abs($diferenciCambiaria)>0){\n if (($diferenciCambiaria) >= 0) {\n $ctautilidadperdida = $_SESSION ['CompanyRecord'] ['exchangediffact'];\n } else {\n $ctautilidadperdida = $_SESSION ['CompanyRecord'] ['gllink_exchangediffactutil'];\n }\n \n // $PeriodNo = GetPeriod($_SESSION['AllocCustomer']->TransDate, $db, $_SESSION['AllocCustomer']->tagref);\n \n $reference = $DebtorNo . \"@UTIL/PERD CAMBIARIA@\" . $diferenciCambiaria . ' @TC:' . (1 / $rateSaldoANT).' cliente:'.($nombrecliente);\n // extrae porcentaje de iva\n \n //echo \"<br> diferencia cambiaria \".$diferenciCambiaria;\n \n $SQL = \"INSERT INTO gltrans (type,\n typeno,\n trandate,\n periodno,\n account,\n narrative,\n amount,\n tag\n )\n VALUES ('\" . $systype_doc . \"',\n '\" . $transno. \"',\n '\" . $DefaultDispatchDate . \"',\n '\" . $PeriodNo . \"',\n '\" . $ctautilidadperdida . \"',\n '\" . $reference . \"',\n '\" . ($diferenciCambiaria)*(-1) . \"',\n '\" . $tagref . \"')\";\n //echo \"<br>gltrans 510: \".$SQL;\n $ErrMsg = _ ( 'CRITICAL ERROR' ) . '! ' . _ ( 'NOTE DOWN THIS ERROR AND SEEK ASSISTANCE' ) . ': ' . _ ( 'The GL entry for the difference on exchange arising out of this allocation could not be inserted because' );\n $DbgMsg = _ ( 'The following SQL to insert the GLTrans record was used' );\n $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True);\n\n }\n \n \n // *****************************************\n // Se afecta la cuenta de Notas de Credito\n // *****************************************\n \n $DebtorTransIDGL = DB_Last_Insert_ID($db, 'gltrans', 'counterindex');\n \n $SQL = \"INSERT INTO debtortransmovs (`tagref`,`transno`,`type`,`debtorno`,`branchcode`,`origtrandate`,`trandate`,`prd`,`settled`,`reference`,`tpe`,`order_`,`rate`,`ovamount`,`ovgst`,`ovfreight`,`ovdiscount`,`diffonexch`,`alloc`,`invtext`,`shipvia`,`edisent`,`consignment`,`folio`,`ref1`,`ref2`,`currcode`,`idgltrans`,`userid`)\";\n $SQL .= \" VALUES (\" . $tagref . \", \" . $transno . \",\" . $systype_doc . \", '\" . $DebtorNo . \"', '\" . $DebtorNo . \"', now(), '\" . $fechaini . \"',\" . $PeriodNo . \",'0','\" . $concepto . \"', '','0','\" . $rate . \"',\" . ($montosiniva * - 1) . \",\" . ($montoiva * - 1) . \",'0','0','0','0','','1','0','', 'NCR','NCR','NCR','\" . $moneda . \"',\" . $DebtorTransIDGL . \",'\" . $_SESSION ['UserID'] . \"')\";\n $result = DB_query($SQL, $db);\n \n // afecta cuentas de notas de credito\n $SQL = \"INSERT INTO gltrans (\n type,\n typeno,\n trandate,\n periodno,\n account,\n narrative,\n amount,\n tag\n )\n VALUES (\n '\" . $systype_doc . \"',\n '\" . $transno . \"',\n '\" . $DefaultDispatchDate . \"',\n '\" . $PeriodNo . \"',\n '\" . $cuenta_notacredito . \"',\n '\" . $DebtorNo . \" No. de Nota de Credito: \" . $transno . \" @\" . $nombrecliente . \" ',\n '\" . $rmontosinivaANT . \"',\n '\" . $tagref . \"'\n )\";\n if ($_SESSION ['UserID'] == \"admin\") {\n // echo '<pre>'.$SQL;\n }\n $msgexito = '<b>LA NOTA DE CREDITO SE HA GENERADO EXITOSAMENTE...';\n $result = DB_query($SQL, $db, $msgexito);\n \n if ($puntoVenta != 1) {\n prnMsg(_($msgexito), 'success');\n }\n $_SESSION['IvaManualAbonoDirectoClientes'] = 0;\n \n // imprimir datos de la nota de credito\n if (! isset($legaid) or $legaid == '' or ! isset($area) or $area == '') {\n $sql = \"Select legalid,areacode from tags where tagref=\" . $tagref;\n $result = DB_query($sql, $db);\n while ($myrow = DB_fetch_array($result, $db)) {\n $legaid = $myrow ['legalid'];\n $area = $myrow ['areacode'];\n }\n }\n \n // Consulta el rfc y clave de facturacion electronica\n $SQL = \" SELECT l.taxid,l.address5,t.tagname,t.typeinvoice, l.legalname\n FROM legalbusinessunit l, tags t\n WHERE l.legalid=t.legalid AND tagref='\" . $tagref . \"'\";\n \n if ($_SESSION['UserID'] == 'desarrollo')\n echo \"<pre> SQL -> $SQL </pre>\";\n\n $Result = DB_query($SQL, $db);\n if (DB_num_rows($Result) == 1) {\n $myrowtags = DB_fetch_array($Result);\n $rfc = trim($myrowtags ['taxid']);\n $keyfact = trim($myrowtags ['address5']);\n $nombre = trim($myrowtags ['tagname']);\n $tipofacturacionxtag = $myrowtags ['typeinvoice'];\n $legalname = $myrowtags ['legalname'];\n // $nombre=\"SERVILLANTAS DE QUERETARO S.A. DE C.V.\";\n }\n\n if ($_SESSION['UserID'] == 'desarrollo')\n echo \"<pre> tipofacturacionxtag -> $tipofacturacionxtag </pre>\";\n\n if ($tipofacturacionxtag == 0) {\n $InvoiceNoTAG = DocumentNext($systype_doc, $tagref, $area, $legaid, $db);\n } else {\n $InvoiceNoTAG = DocumentNext(11, $tagref, $area, $legaid, $db);\n }\n\n if ($_SESSION['UserID'] == 'desarrollo')\n echo \"<pre> InvoiceNoTAG ->\". print_r($InvoiceNoTAG) .\"</pre>\";\n \n \n $separa = explode('|', $InvoiceNoTAG);\n $serie = $separa [1];\n $folio = $separa [0];\n // echo 'folio:'.$InvoiceNoTAG;\n \n $OrderNo = 0;\n $factelectronica = XSAInvoicingCreditdirect($transno, $OrderNo, $DebtorNo, $systype_doc, $tagref, $serie, $folio, $db);\n // Envia los datos al archivooooo\n $factelectronica = utf8_encode($factelectronica);\n \n if ($_SESSION['UserID'] == 'desarrollo') {\n echo '<pre> cadena de XSAInvoicingCreditdirect:'.$factelectronica;\n //echo htmlentities($arrayGeneracion['xml']);\n }\n \n $empresa = $keyfact . '-' . $rfc;\n $nombre = $nombre;\n $tipo = 'Notas de Credito';\n // if ($ambiente == \"desarrollo\") {\n // $tipo = 'NOTA DE CREDITO';\n // }\n \n // $tipo='NOTA DE CREDITO';\n $myfile = '';\n $factelectronica = $factelectronica;\n // echo '<pre><br>'.$factelectronica;\n $param = array (\n 'in0' => $empresa,\n 'in1' => $nombre,\n 'in2' => $tipo,\n 'in3' => $myfile,\n 'in4' => $factelectronica\n );\n \n // Seccion para validar si selecciono la opcion de timbrar o no\n if ($typeFactura == 119 ) {\n $flagsendfiscal = 0;\n }else{\n $flagsendfiscal = 1;\n }\n \n $ligaN = '';\n\n // Si se va a timbrar el documento entra a esta condicion\n //echo \"<br>tipofacturacionxtag:\". $tipofacturacionxtag;\n if ($flagsendfiscal == 1) {\n if ($tipofacturacionxtag == 1) {\n //echo \"entra1\";\n try {\n $client = new SoapClient($_SESSION ['XSA'] . \"xsamanager/services/FileReceiverService?wsdl\");\n $codigo = $client->guardarDocumento($param);\n } catch (SoapFault $exception) {\n $errorMessage = $exception->getMessage();\n }\n $liga = $_SESSION ['XSA'] . \"xsamanager/downloadCfdWebView?serie=\" . $serie . \"&folio=\" . $folio . \"&tipo=PDF&rfc=\" . $rfc . \"&key=\" . $keyfact;\n $liga = '<p><img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _('Imprimir') . '\" alt=\"\">' . ' ' . '<a target=\"_blank\" href=\"' . $liga . '\">' . _('Imprimir Nota de Credito') . ' (' . _('Laser') . ')' . '</a>';\n } elseif ($tipofacturacionxtag == 2) {\n echo \"entra2\";\n $arrayGeneracion = generaXML($factelectronica, 'egreso', $tagref, $serie, $folio, $DebtorTransIDND, 'NCreditoDirect', $OrderNo, $db);\n $XMLElectronico = $arrayGeneracion [\"xml\"];\n // Se agrega la generacion de xml_intermedio\n\n $array = generaXMLIntermedio($factelectronica, $XMLElectronico, ($arrayGeneracion [\"cadenaOriginal\"]), utf8_encode($arrayGeneracion [\"cantidadLetra\"]), $DebtorTransIDND, $db, 13, $tagref, $systype_doc, $transno);\n $xmlImpresion = ( $array [\"xmlImpresion\"] );\n $rfcEmisor = $array [\"rfcEmisor\"];\n $fechaEmision = $array [\"fechaEmision\"];\n\n $XMLElectronico = caracteresEspecialesFactura($XMLElectronico);\n $xmlImpresion = caracteresEspecialesFactura($xmlImpresion);\n $xmlImpresion =str_replace(\"&\", \"&amp;\", $xmlImpresion);\n \n // Almacenar XML\n $XMLElectronico = str_replace(\"<?xml version='1.0' encoding='UTF-8'?>\", '<?xml version=\"1.0\" encoding=\"UTF-8\"?>', $XMLElectronico);\n $query = \"INSERT INTO Xmls(transNo,type,rfcEmisor,fechaEmision,xmlSat,xmlImpresion,fiscal)\n VALUES(\" . $transno . \",\" . $systype_doc . \",'\" . $rfcEmisor . \"','\" . $fechaemision . \"','\" . utf8_decode(addslashes($XMLElectronico)) . \"','\" . utf8_decode(addslashes($xmlImpresion)) . \"',\" . $flagsendfiscal . \");\";\n $Result = DB_query($query, $db, $ErrMsg, $DbgMsg, true);\n \n if ($_SESSION ['Template_V6'] != '1') {\n $ligaN = \"PDFCreditDirect.php\";\n } else {\n $ligaN = \"PDFInvoice.php\";\n }\n // $liga = \"PDFCreditDirect.php\";\n $ligaN = '<p><img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _('Imprimir') . '\" alt=\"\">' . ' ' . '<a target=\"_blank\" href=\"' . $rootpath . '/' . $ligaN . SID . '?tipo=' . $systype_doc . '&area=' . $area . '&legal=' . $legaid . '&TransNo=' . $transno . '&Type=13&Tagref=' . $tagref . '\">' . _('Imprimir Nota de Credito') . ' (' . _('Laser') . ')' . '</a>';\n } elseif ($tipofacturacionxtag == 3) {\n // $XMLElectronico=generaXML($factelectronica,'egreso',$tagref,$serie,$folio,$DebtorTransIDND,'NCreditoDirect',$OrderNo,$db);\n \n $ligaN = \"PDFNoteCreditDirectTemplate.php\";\n $ligaN = '<p><img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _('Imprimir') . '\" alt=\"\">' . ' ' . '<a target=\"_blank\" href=\"' . $rootpath . '/' . $ligaN . SID . '&tipo=' . $systype_doc . '&area=' . $area . '&legal=' . $legaid . '&TransNo=' . $transno . '&Tagref=' . $tagref . '\">' . _('Imprimir Nota de Credito') . ' (' . _('Laser') . ')' . '</a>';\n } elseif ($tipofacturacionxtag == 4) {\n $success = false;\n $config = $_SESSION;\n //echo \"<br>---\".$_SESSION['FacturaVersion'];\n if ($_SESSION['FacturaVersion'] == \"3.3\") {\n //echo \"<br>generaXMLCFDI3_3:\";\n $arrayGeneracion = generaXMLCFDI3_3($factelectronica, 'egreso', $tagref, $serie, $folio, $DebtorTransIDND, 'NCreditoDirect', $OrderNo, $db);\n } else {\n $arrayGeneracion = generaXMLCFDI($factelectronica, 'egreso', $tagref, $serie, $folio, $DebtorTransIDND, 'NCreditoDirect', $OrderNo, $db);\n }\n \n $XMLElectronico = $arrayGeneracion [\"xml\"];\n $XMLElectronico = str_replace('<?xml version=\"1.0\" encoding=\"UTF-8\"?>', '', $XMLElectronico);\n\n if ($_SESSION['UserID'] == 'aenriquez' or $_SESSION['UserID'] == 'desarrollo') {\n //echo '<pre>'.$factelectronica;\n //echo '<br>XMLElectronico: <br><pre>'.htmlentities($XMLElectronico);\n }\n \n //require_once '../../.././' .'timbradores/TimbradorFactory.php';\n //include_once 'timbradores/TimbradorFactory.php';\n $timbrador = TimbradorFactory::getTimbrador($config);\n if ($timbrador != null) {\n $timbrador->setRfcEmisor($rfc);\n $timbrador->setDb($db);\n $cfdi = $timbrador->timbrarDocumento($XMLElectronico);\n $success = ($timbrador->tieneErrores() == false);\n foreach ($timbrador->getErrores() as $error) {\n if ($puntoVenta != 1) {\n prnMsg($error, 'error');\n }\n }\n } else {\n if ($puntoVenta != 1) {\n prnMsg(_('No hay un timbrador configurado en el sistema'), 'error');\n }\n }\n \n if ($success) {\n if ($_SESSION['UserID'] == \"desarrollo\") {\n echo '<br>success';\n }\n // leemos la informacion del cfdi en un arreglo\n $DatosCFDI = TraeTimbreCFDI($cfdi);\n if (strlen($DatosCFDI ['FechaTimbrado']) > 0) {\n //$cadenatimbre = '||1.1|' . $DatosCFDI ['UUID'] . '|' . $DatosCFDI ['FechaTimbrado'] . '|' . $DatosCFDI ['selloCFD'] . '|' . $DatosCFDI ['noCertificadoSAT'] . '||';\n $cadenatimbre = '||1.1|' . $DatosCFDI ['UUID'] . '|' . $DatosCFDI ['FechaTimbrado'] .'|' . $DatosCFDI ['RfcProvCertif']. '||' . $DatosCFDI ['SelloCFD'] . '|' . $DatosCFDI ['NoCertificadoSAT'] . '||';\n \n // guardamos el timbre fiscal en la base de datos para efectos de impresion de datos\n $sql = \"UPDATE debtortrans\n SET fechatimbrado='\" . $DatosCFDI ['FechaTimbrado'] . \"',\n uuid='\" . $DatosCFDI ['UUID'] . \"',\n timbre='\" . $DatosCFDI ['SelloSAT'] . \"',\n cadenatimbre='\" . $cadenatimbre . \"'\n where id=\" . $DebtorTransIDND;\n \n $ErrMsg = _('El Sql que fallo fue');\n $DbgMsg = _('No se pudo actualizar el sello y cadena del documento');\n $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg, true);\n $XMLElectronico = $cfdi;\n // Guardamos el XML una vez que se agrego el timbre fiscal\n \n $legalname= caracteresEspecialesFactura($legalname);\n \n $carpeta = 'NCreditoDirect';\n\n $dir = \"/var/www/html\" . dirname($_SERVER ['PHP_SELF']) . \"/companies/\" . $_SESSION ['DatabaseName'] . \"/SAT/\" . utf8_decode(addslashes((str_replace('.', '', str_replace(' ', '', $legalname))))) . \"/XML/\" . $carpeta . \"/\";\n\n //$dir=\"/var/www/html/erpdistribucion/companies/\".$_SESSION ['DatabaseName'].\"/SAT/\".utf8_decode(addslashes((str_replace ( '.', '', str_replace ( ' ', '', $legalname ) )))).\"/XML/NCreditoDirect/\";\n \n if ($puntoVenta == 1) {\n // Si es punto de venta quitar carpetas\n $dir = str_replace('mvc/api/v1/', '', $dir);\n }\n\n \n $nufa = $serie . $folio;\n $mitxt = $dir . $nufa . \".xml\";\n if ($puntoVenta != 1) {\n unlink($mitxt);\n }\n \n //echo \"<br>\".$mitxt;\n // Se modifico la fucion\n $fp = fopen($mitxt, \"w\");\n fwrite($fp, $XMLElectronico);\n fclose($fp);\n\n \n $fp = fopen($mitxt . '.COPIA', \"w\");\n fwrite($fp, $XMLElectronico);\n fclose($fp);\n //Se agrega la generacion de xml_intermedio\n \n $XMLElectronico_Impresion=\"\";\n if ($_SESSION['FacturaVersion'] == \"3.3\") {\n $XMLElectronico_Impresion = generaXMLCFDI_Impresion($factelectronica, $XMLElectronico, $tagref, $db);\n }\n \n\n if (!empty($XMLElectronico_Impresion)) {\n $array = generaXMLIntermedio($factelectronica, $XMLElectronico_Impresion, $cadenatimbre, utf8_encode($arrayGeneracion [\"cantidadLetra\"]), $OrderNo, $db, 13, $tagref, $systype_doc, $transno);\n } else {\n $array = generaXMLIntermedio($factelectronica, $XMLElectronico, $cadenatimbre, utf8_encode($arrayGeneracion [\"cantidadLetra\"]), $DebtorTransIDND, $db, 13, $tagref, $systype_doc, $transno);\n }\n \n\n //$array = generaXMLIntermedio ( $factelectronica, $XMLElectronico, $cadenatimbre, utf8_encode ( $arrayGeneracion [\"cantidadLetra\"] ), $DebtorTransIDND, $db, 13, $tagref, $systype_doc, $transno );\n\n $xmlImpresion = ( $array [\"xmlImpresion\"] );\n $rfcEmisor = $array [\"rfcEmisor\"];\n $fechaEmision = $array [\"fechaEmision\"];\n $XMLElectronico = caracteresEspecialesFactura($XMLElectronico);\n $xmlImpresion = caracteresEspecialesFactura($xmlImpresion);\n $xmlImpresion =str_replace(\"&\", \"&amp;\", $xmlImpresion);\n\n if ($_SESSION['UserID']=='desarrollo') {\n echo '<br>XMLElectronico: <br><pre>'.htmlentities($XMLElectronico);\n echo '<br>xmlImpresion: <br><pre>'.htmlentities($xmlImpresion);\n }\n\n // Almacenar XML//\n $XMLElectronico = str_replace(\"<?xml version='1.0' encoding='UTF-8'?>\", '<?xml version=\"1.0\" encoding=\"UTF-8\"?>', $XMLElectronico);\n $query = \"INSERT INTO Xmls(transNo,type,rfcEmisor,fechaEmision,xmlSat,xmlImpresion,fiscal)\n VALUES(\" . $transno . \",\" . $systype_doc . \",'\" . $rfcEmisor . \"','\" . $fechaemision . \"','\" . utf8_decode(addslashes($XMLElectronico)) . \"','\" . utf8_decode(addslashes($xmlImpresion)) . \"',\" . $flagsendfiscal . \");\";\n $Result = DB_query($query, $db, $ErrMsg, $DbgMsg, true);\n \n if ($_SESSION ['Template_V6'] != '1') {\n $ligaN = \"PDFCreditDirect.php\";\n } else {\n $ligaN = \"PDFInvoice.php\";\n }\n \n if ($puntoVenta != 1) {\n $ligaN = '<p><img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _('Imprimir') . '\" alt=\"\">' . ' ' . '<a target=\"_blank\" href=\"' . $rootpath . '/' . $ligaN . SID . '?Type=' . $systype_doc . '&area=' . $area . '&legal=' . $legaid . '&TransNo=' . $transno . '&Tagref=' . $tagref . '\">' . _('Imprimir Nota de Credito') . ' (' . _('Laser') . ')' . '</a>';\n }\n } else {\n prnMsg(_('No fue posible realizar el timbrado del documento, verifique con el administrador; el numero de error es:') . $cfdi, 'error');\n // exit;\n }\n }\n } else {\n $ligaN = GetUrlToPrintNu($tagref, $area, $legaid, $systype_doc, $db);\n $ligaN = '<p><img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _('Imprimir') . '\" alt=\"\">' . ' ' . '<a target=\"_blank\" href=\"' . $rootpath . '/' . $ligaN . SID . '&tipo=' . $systype_doc . '&area=' . $area . '&legal=' . $legaid . '&TransNo=' . $transno . '&Tagref=' . $tagref . '\">' . _('Imprimir Nota de Credito') . ' (' . _('Laser') . ')' . '</a>';\n }\n } else {\n //echo \"<br> flagsendfiscal\";\n // Documento No Fiscal\n $arrayGeneracion = generaXMLCFDI($factelectronica, 'egreso', $tagref, $serie, $folio, $DebtorTransIDND, 'NCreditoDirect', $OrderNo, $db);\n $XMLElectronico = $arrayGeneracion [\"xml\"];\n \n // Se agrega la generacion de xml_intermedio\n $array = generaXMLIntermedio($factelectronica, $XMLElectronico, $arrayGeneracion [\"cadenaOriginal\"], utf8_encode($arrayGeneracion [\"cantidadLetra\"]), $DebtorTransIDND, $db, 13, $tagref, $systype_doc, $transno);\n $xmlImpresion = utf8_decode($array [\"xmlImpresion\"]);\n $rfcEmisor = $array [\"rfcEmisor\"];\n $fechaEmision = $array [\"fechaEmision\"];\n $XMLElectronico = caracteresEspecialesFactura($XMLElectronico);\n $xmlImpresion = caracteresEspecialesFactura($xmlImpresion);\n $xmlImpresion =str_replace(\"&\", \"&amp;\", $xmlImpresion);\n\n \n // Insertar el registro en la tabla de XMLS\n $query = \"INSERT INTO Xmls(transNo,type,rfcEmisor,fechaEmision,xmlSat,xmlImpresion,fiscal)\n VALUES(\" . $transno . \",\" . $systype_doc . \",'\" . $rfcEmisor . \"','\" . $fechaemision . \"','\" . utf8_decode(addslashes($XMLElectronico)) . \"','\" . utf8_decode(addslashes($xmlImpresion)) . \"',\" . $flagsendfiscal . \");\";\n \n $Result = DB_query($query, $db, $ErrMsg, $DbgMsg, true);\n \n if ($_SESSION ['Template_V6'] != '1') {\n $ligaN = \"PDFCreditDirect.php\";\n } else {\n $ligaN = \"PDFInvoice.php\";\n }\n \n $ligaN = '<p><img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _('Imprimir') . '\" alt=\"\">' . ' ' . '<a target=\"_blank\" href=\"' . $rootpath . '/' . $ligaN . SID . '?Type=' . $systype_doc . '&area=' . $area . '&legal=' . $legaid . '&TransNo=' . $transno . '&Tagref=' . $tagref . '\">' . _('Imprimir Nota de Credito') . ' (' . _('Laser') . ')' . '</a>';\n \n /*$PrintDispatchNote = $rootpath . '/' . $liga . '?OrderNo=' . $OrderNo . '&TransNo=' . $BatchNo . '&Type=' . $tipodefacturacion;\n \n echo '<p class=\"page_title_text\">';\n echo '<img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _ ( 'Imprimir Recibo ' ) . '\" alt=\"\">' . ' ';\n echo '<a href=\"' . $PrintDispatchNote . '\" target=\"_blank\">';\n echo _ ( 'Imprimir Recibo PDF ' ) . '</a></p>';*/\n } // Fin de condicion para timbrar el documento o no\n \n // Actualizar el documento para folio\n $SQL = \"UPDATE debtortrans\n SET folio='\" . $serie . '|' . $folio . \"',\n flagfiscal= '\" . $flagsendfiscal . \"' \n WHERE transno=\" . $transno . \" and type=\" . $systype_doc;\n \n $ErrMsg = _('ERROR CRITICO') . '! ' . _('ANOTE EL ERROR') . ': ' . _('La Actualizacion para saldar la factura, no se pudo realizar');\n $DbgMsg = _('El SQL utilizado para el registro de la fatura es:');\n $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true);\n $Result = DB_Txn_Commit($db);\n\n if ($puntoVenta != 1) {\n echo '<p><div align=\"center\">';\n echo $ligaN;\n echo '</div>';\n }\n\n if (function_exists(\"updateGlTransAccountingInfo\")) {\n $valued = updateGlTransAccountingInfo($systype_doc, $transno, $db);\n }\n \n if ($puntoVenta != 1) {\n echo '<p><div align=\"center\">';\n echo '<a href=\"ReportCustomerInqueryV3.php?CustomerID=' . $DebtorNo . '\">';\n echo '<font size=2 face=\"arial\"><b>';\n echo _('IR AL ESTADO DE CUENTA DEL CLIENTE');\n echo '</b></font>';\n echo '</a>';\n echo '</div>';\n }\n }\n \n // ***************************************************************************************************\n // ***************************************************************************************************\n // ***************************************************************************************************\n}", "function asignacion_anp_objetivos($id_objetivo_estrategico){\r\n\t\t//OBJETIVO ESTRATEGICO\t\t\t\t\r\n\t\t$sql_aae = \" SELECT * FROM anp_objetivo_estrategico \r\n\t\t\t\tWHERE id_objetivo_estrategico='\".$id_objetivo_estrategico.\"' \";\r\n\t\t$query_aae = new Consulta($sql_aae);\r\n\t\t$in_aae = \"\";\r\n\t\twhile($row_aae = $query_aae->ConsultaVerRegistro()){\r\n\t\t\t$in_aae .=$in_aae == \"\" ? $row_aae['id_anp_objetivo_estrategico'] : \",\".$row_aae['id_anp_objetivo_estrategico'];\t\r\n\t\t}\t\r\n\t\t\t\t\t\r\n\t\t//asignaciopn anp objetivos\r\n\t\t$sql_aao = \"SELECT * FROM asignacion_anp_objetivos \r\n\t\t\t\t\tWHERE id_anp_objetivo_estrategico in(\".$in_aae.\") \r\n\t\t\t\t\tAND id_axo_poa='\".$_SESSION[inrena_4][2].\"' \";\r\n\t\t\t\t\t\t\r\n\t\t$query_aao = new Consulta($sql_aao);\r\n\t\t$in_aao=\"\";\r\n\t\twhile($row_aao = $query_aao->ConsultaVerRegistro()){\r\n\t\t\t$in_aao .=$in_aao == \"\" ? $row_aao['id_asignacion_anp_objetivos'] : \",\".$row_aao['id_asignacion_anp_objetivos'];\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $in_aao;\r\n\t\r\n\t}", "function CrearDetalleIndicador()\n{\n\tglobal $tablaCapacitados;\n\n\n\t//global $tabla;\n\tglobal $eventosAsistentes;\n\t$anioCurso = getAnioSeleccionado();\n\t$indicadorSel = getIndicador();\n\t$mesSel = getMes();\n\t$zonaSel = getZona();\n\t$lineasTabla = \"\";\n\t$tablaHeader = \"\";\n\n\t//echo $anioCurso . \" - \" . $indicadorSel . \" - \" . $mesSel. \" - \" . $zonaSel . \"<br>\";\n\n\tif($indicadorSel == 1)\n\t{\n\t\t$resIndicador = primer_indicador($mesSel, $zonaSel);\n\t\t//print_r2($resIndicador);\n\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t//provincias de las organizaciones\n\t\t\t$provOrg = RecuperarInfoOrg($resIndicador, 'provincia');\n\t\t\t//nombres de las organizaciones\n\t\t\t$nombresOrganizaciones = RecuperarInfoOrg($resIndicador, 'nombresOrg');\n\t\t\t// ruc de las organizaciones\n\t\t\t$rucProvisional = RecuperarInfoOrg($resIndicador, 'rucProvisionalOrg');\n\t\t\t$rucDefinitivo = RecuperarInfoOrg($resIndicador, 'rucDefinitivoOrg');\n\t\t\t//categoria Matriz productiva de las organizaciones\n\t\t\t$catMatrizProductivaOrg = RecuperarInfoOrg($resIndicador, 'categoriaMatriz');\n\t\t\t// numero de socios por cada organizacion\n\t\t\t$numSociosOrganizacion = NumSociosOrganizacion($resIndicador);\n\t\t\t// numero de personas Capacitadas\n\t\t\t$numPerCapacitadas = NumPersonasCapacitadas($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel);\n\t\t\t//print_r2($eventosAsistentes);\n\t\t\t//Servicio Brindado por Fortalecimiento\n\t\t\t$servicioFortalecimiento = ServiciosBrindadosOrg($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel);\n\t\t\t// identificacion actividad matriz productiva\n\t\t\t$actOrgMP = RecuperarInfoOrg($resIndicador, 'identificacionMatriz');\n\t\t\t//capacitados por Genero\n\t\t\t$capMujeres = NumCapacitadosGenero($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel, 'mujer');\n\t\t\t$capHombres = NumCapacitadosGenero($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel, 'hombre');\n\n\t\t\t// BORRAR LUEGO SOLO PARA FORTALECIMIENTO\n\t\t\t$tablaCapacitados .= \"</table>\";\n\n\n\t\t\t//print_r2($resIndicador);\n\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES REPORTE</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>ORGANIZACION</th>\n\t\t\t\t\t\t\t\t<th>RUC</th>\n\t\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MP</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE SOCIOS</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS TOTAL</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS MUJERES TOTAL</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS HOMBRES TOTAL</th>\n\t\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\n\t\t\t\t\t\t\t\t<th>CODIGO EVENTO</th>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\n\n\t\t\t\t\n\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nombresOrganizaciones[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $rucDefinitivo[$cont] . \" - \" . $rucProvisional[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $catMatrizProductivaOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actOrgMP[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numSociosOrganizacion[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numPerCapacitadas[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $capMujeres[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $capHombres[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $servicioFortalecimiento[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $eventosAsistentes[$cont] . \"</td>\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t$cont++;\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\n\n\t\t\n\t}\n\tif($indicadorSel == 2)\n\t{\n\t\t//print_r2($resIndicador);\n\t\t$resIndicador = segundo_indicador($mesSel,$zonaSel);\n\t\t//print_r2($resIndicador);\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t//provincias de las uep\n\t\t\t$provUep = RecuperarInfoOrg($resIndicador, 'provincia');\n\t\t\t//nombres de las uep\n\t\t\t$nombresUep = RecuperarInfoOrg($resIndicador, 'nombresOrg');\n\t\t\t// ruc de las uep\n\t\t\t$rucProvisional = RecuperarInfoOrg($resIndicador, 'rucProvisionalOrg');\n\t\t\t$rucDefinitivo = RecuperarInfoOrg($resIndicador, 'rucDefinitivoOrg');\n\t\t\t//categoria Matriz productiva de las uep\n\t\t\t$catMatrizProductivaOrg = RecuperarInfoOrg($resIndicador, 'categoriaMatriz');\n\t\t\t// numero de socios por cada organizacion\n\t\t\t$numSociosOrganizacion = NumSociosOrganizacion($resIndicador);\n\t\t\t// numero de personas Capacitadas\n\t\t\t$numPerCapacitadas = NumPersonasCapacitadas($resIndicador, $anioCurso, $mesSel, 'UEP', $zonaSel);\n\t\t\t//print_r2($eventosAsistentes);\n\t\t\t//Servicio Brindado por Fortalecimiento\n\t\t\t$servicioFortalecimiento = ServiciosBrindadosOrg($resIndicador, $anioCurso, $mesSel, 'UEP', $zonaSel);\n\t\t\t// identificacion actividad matriz productiva\n\t\t\t$actOrgMP = RecuperarInfoOrg($resIndicador, 'identificacionMatriz');\n\t\t\t//capacitados por Genero\n\t\t\t$capMujeres = NumCapacitadosGenero($resIndicador, $anioCurso, $mesSel, 'UEP', $zonaSel, 'mujer');\n\t\t\t$capHombres = NumCapacitadosGenero($resIndicador, $anioCurso, $mesSel, 'UEP', $zonaSel, 'hombre');\n\n\n\t\t\t// BORRAR LUEGO SOLO PARA FORTALECIMIENTO\n\t\t\t$tablaCapacitados .= \"</table>\";\n\n\n\n\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t<th>MES REPORTE</th>\n\t\t\t\t\t\t\t<th>ZONA</th>\n\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t<th>UEP</th>\n\t\t\t\t\t\t\t<th>RUC PROVISIONAL</th>\n\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MP</th>\n\t\t\t\t\t\t\t<th>NUMERO DE SOCIOS</th>\n\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS TOTAL</th>\n\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS MUJERES TOTAL</th>\n\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS HOMBRES TOTAL</th>\n\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\n\t\t\t\t\t\t\t<th>CODIGO EVENTO</th>\n\t\t\t\t\t\t</tr>\";\n\n\t\t\t\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\n\n\t\t\t\t\n\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provUep[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nombresUep[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $rucDefinitivo[$cont] . \" - \" . $rucProvisional[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $catMatrizProductivaOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actOrgMP[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numSociosOrganizacion[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numPerCapacitadas[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $capMujeres[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $capHombres[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $servicioFortalecimiento[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $eventosAsistentes[$cont] . \"</td>\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t$cont++;\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\n\t}\n\n\tif($indicadorSel == 3)\n\t{\n\t\t$resIndicador = tercer_indicador($mesSel,$zonaSel);\n\t\t//print_r2($resIndicador);\t\t\t\n\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t//provincias de las organizaciones\n\t\t\t$provOrg = RecuperarInfoOrg($resIndicador, 'provincia');\n\t\t\t//nombres de las organizaciones\n\t\t\t$nombresOrganizaciones = RecuperarInfoOrg($resIndicador, 'nombresOrg');\n\t\t\t// ruc de las organizaciones\n\t\t\t$rucProvisional = RecuperarInfoOrg($resIndicador, 'rucProvisionalOrg');\n\t\t\t$rucDefinitivo = RecuperarInfoOrg($resIndicador, 'rucDefinitivoOrg');\n\t\t\t// actividad de la organizacion\n\t\t\t$actividadOrg = RecuperarInfoOrg($resIndicador, 'identificacionMatriz');\n\t\t\t//categoria Matriz productiva de las organizaciones\n\t\t\t$catMatrizProductivaOrg = RecuperarInfoOrg($resIndicador, 'categoriaMatriz');\n\t\t\t// numero de socios por cada organizacion\n\t\t\t$numSociosOrganizacion = NumSociosOrganizacion($resIndicador);\t\t\t\n\t\t\t//Servicio Brindado por Fortalecimiento\n\t\t\t$servicioFortalecimiento = ServiciosBrindadosOrg($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel);\n\t\t\t//print_r2($resIndicador);\n\t\t\t// identificacion actividad matriz productiva\n\t\t\t$actOrgMP = RecuperarInfoOrg($resIndicador, 'identificacionMatriz');\n\t\t\t//Asistentes al circuito\n\t\t\t$asistentesCircuito = GetAsistentesCircuitosEconomicos($resIndicador, $anioCurso, $mesSel, $zonaSel);\n\n\n\t\t\t// BORRAR LUEGO SOLO PARA FORTALECIMIENTO\n\t\t\t$tablaCapacitados .= \"</table>\";\n\n\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>RUC</th>\n\t\t\t\t\t\t\t\t<th>ORGANIZACION</th>\n\t\t\t\t\t\t\t\t<th>ACTIVIDAD</th>\n\t\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MP</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE ASISTENTES</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE SOCIOS</th>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\n\n\t\t\t\t\n\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $rucDefinitivo[$cont] . \" - \" . $rucProvisional[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nombresOrganizaciones[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actividadOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $catMatrizProductivaOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actOrgMP[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $servicioFortalecimiento[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $asistentesCircuito[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numSociosOrganizacion[$cont] . \"</td>\t\t\t\t\t\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t$cont++;\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\t}\n\n\tif($indicadorSel == 4)\n\t{\n\t\tglobal $orgSocios;\n\t\t$resIndicador = cuarto_indicador($mesSel, $zonaSel);\n\t\t$provNombre = \"\";\n\t\t$rucSocio = \"\";\n\t\t$cedulaSocio = \"\";\n\t\t$apellidosSocio = \"\";\n\t\t$orgSocio = \"\";\n\t\t$actividadOrgSocio = \"\";\n\t\t$categoriaOrgSocio = \"\";\n\t\t$identificacionCategoriaOrgSocio = \"\";\n\t\t$campoFortalecimiento = \"\";\n\t\t$generoSocio = \"\";\n\t\t$poblacionSocio = \"\";\n\t\t$grupoEtnicoSocio = \"\";\n\n\n\t\t//print_r2($resIndicador);\n\t\t//print_r2($orgSocios);\n\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t$provNombre = \"\";\n\t\t\t\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>RUC</th>\n\t\t\t\t\t\t\t\t<th>CEDULA</th>\n\t\t\t\t\t\t\t\t<th>APELLIDOS Y NOMBRES</th>\n\t\t\t\t\t\t\t\t<th>GENERO</th>\n\t\t\t\t\t\t\t\t<th>POBLACION</th>\n\t\t\t\t\t\t\t\t<th>GRUPO ETNICO</th>\n\t\t\t\t\t\t\t\t<th>ORGANIZACION</th>\n\t\t\t\t\t\t\t\t<th>ACTIVIDAD</th>\n\t\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MP</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\t\t\t\t\t\n\t\t\t\t$rucSocio = \"\";\n\t\t\t\t$cedulaSocio = \"\";\n\t\t\t\t$apellidosSocio = \"\";\n\t\t\t\t$orgSocio = \"\";\n\t\t\t\t$actividadOrgSocio = \"\";\n\t\t\t\t$categoriaOrgSocio = \"\";\n\t\t\t\t$identificacionCategoriaOrgSocio = \"\";\n\t\t\t\t$campoFortalecimiento = \"\";\n\t\t\t\t$generoSocio = \"\";\n\t\t\t\t$poblacionSocio = \"\";\n\t\t\t\t$grupoEtnicoSocio = \"\";\n\n\t\t\t\t$sqlOrgSocios = \"select cod_u_organizaciones from socios where cedula = '\" . $valor . \"' and estado = 1 group by cod_u_organizaciones\";\n\n\t\t\t\t$resSqlOrgSocios = query($sqlOrgSocios);\n\t\t\t\t$numRegistros = mysql_num_rows($resSqlOrgSocios);\n\t\t\t\t//echo $sqlOrgSocios . \"<br>\";\n\t\t\t\t//echo $cont . \" \" . $numRegistros . \"<br>\";\n\n\t\t\t\tif($numRegistros > 1)\n\t\t\t\t{\n\t\t\t\t\t// El socio existe en mas de una organizacion, por lo cual se debe de tomar los cod_u_organizaciones\n\t\t\t\t\t$codOrgSocio = array();\n\t\t\t\t\t$codOrgReportada = array();\n\t\t\t\t\twhile($fila = mysql_fetch_array($resSqlOrgSocios))\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($codOrgSocio, $fila['cod_u_organizaciones']);\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t// Se busca las organizaciones que han sido reportadas en el mes\n\t\t\t\t\tforeach($codOrgSocio as $codigoOrg)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(in_array($codigoOrg, $orgSocios))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//si el codigo de organizacion se encuentra reportada se guarda en codOrgReportada\n\t\t\t\t\t\t\tarray_push($codOrgReportada, $codigoOrg);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//print_r2($codOrgReportada);\n\n\t\t\t\t\t// Se completa la informacion correspondiente\n\t\t\t\t\t$sqlNombresSocios = \"select apellidos, cedula, zona, cod_provincia, cod_canton, cod_parroquia, genero, grupo_etnico, poblacion, fecha_nacimiento, discapacidad, tipo_discapacidad, fecha_reporte from socios where cedula = '\" . $valor . \"' group by cedula\";\n\n\t\t\t\t\t$resSqlSocios = query($sqlNombresSocios);\n\t\t\t\t\twhile($fila = mysql_fetch_array($resSqlSocios))\n\t\t\t\t\t{\n\t\t\t\t\t\t//echo $fila['cod_provincia'] . \" $indice<br>\";\n\t\t\t\t\t\t$provNombre = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t\t$cedulaSocio = $fila['cedula'];\n\t\t\t\t\t\t$apellidosSocio = $fila['apellidos'];\n\t\t\t\t\t\t$generoSocio = $fila['genero'];\n\t\t\t\t\t\tif($generoSocio == '') $generoSocio = \"No registrado\";\n\t\t\t\t\t\t$poblacionSocio = $fila['poblacion'];\n\t\t\t\t\t\tif($poblacionSocio == '') $poblacionSocio = \"No registrado\";\n\t\t\t\t\t\t$grupoEtnicoSocio = $fila['grupo_etnico'];\n\t\t\t\t\t\tif($grupoEtnicoSocio == '') $grupoEtnicoSocio = \"No registrado\";\n\n\t\t\t\t\t\t$aux = 0;\n\t\t\t\t\t\tforeach($codOrgReportada as $codigoOrg)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sqlRucOrgSocio = \"select ruc_definitivo, ruc_provisional, organizacion, actividad, categoria_actividad_mp, identificacion_actividad_mp from u_organizaciones where cod_u_organizaciones = \" . $codigoOrg;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$resSqlRucOrgSocio = query($sqlRucOrgSocio);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resSqlRucOrgSocio))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($aux == 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rucSocio = $fila1['ruc_definitivo'] . \" - \" . $fila1['ruc_provisional'];\n\t\t\t\t\t\t\t\t\t$orgSocio = $fila1['organizacion'];\n\t\t\t\t\t\t\t\t\t$actividadOrgSocio = $fila1['actividad'];\n\t\t\t\t\t\t\t\t\t$categoriaOrgSocio = $fila1['categoria_actividad_mp'];\n\t\t\t\t\t\t\t\t\t$identificacionCategoriaOrgSocio = $fila1['identificacion_actividad_mp'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rucSocio .= \" - \" . $fila1['ruc_definitivo'] . \" - \" . $fila1['ruc_provisional'];\n\t\t\t\t\t\t\t\t\t$orgSocio .= \" - \" . $fila1['organizacion'];\n\t\t\t\t\t\t\t\t\t$actividadOrgSocio .= \" - \" . $fila1['actividad'];\n\t\t\t\t\t\t\t\t\t$categoriaOrgSocio .= \" - \" . $fila1['categoria_actividad_mp'];\n\t\t\t\t\t\t\t\t\t$identificacionCategoriaOrgSocio .= \" - \" . $fila1['identificacion_actividad_mp'];\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}\n\n\t\t\t\t\t\t\t$sqlFortalecimiento = \"select e.campo_fortalecimiento, e.cod_evento from eventos_u_organizaciones ev inner join eventos e on (e.cod_evento = ev.cod_evento) where ev.cod_u_organizaciones = \" . $codigoOrg . \" and month(e.fecha_reporte) = \" . $mesSel . \" and e.anio = \" . $anioCurso . \" group by e.campo_fortalecimiento\";\n\t\t\t\t\t\t\t//echo $sqlFortalecimiento . \"<br>\";\n\t\t\t\t\t\t\t$resFortalecimiento = query($sqlFortalecimiento);\n\t\t\t\t\t\t\t$aux1 = 0;\n\t\t\t\t\t\t\tif(mysql_num_rows($resFortalecimiento) > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resFortalecimiento))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//se tiene que revisar si hay mas de un evento relacionado con esta org\n\t\t\t\t\t\t\t\t\tif($aux1 == 0) $campoFortalecimiento .= $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\t\t\telse $campoFortalecimiento .= \" - \" . $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\t\t\t$aux1++;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sqlFortalecimiento = \"select e.cod_asistencia_legal from asistencia_legal_org e where e.cod_u_organizaciones = \" . $fila['cod_u_organizaciones'] . \" and month(e.fecha_reporte) = \" . $mesSel . \" and e.anio = \" . $anioCurso . \" group by e.cod_asistencia_legal\";\n\t\t\t\t\t\t\t\t//echo $sqlFortalecimiento . \"<br>\";\n\t\t\t\t\t\t\t\t$resFortalecimiento = query($sqlFortalecimiento);\n\t\t\t\t\t\t\t\tif(mysql_num_rows($resFortalecimiento) > 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$campoFortalecimiento = \"asistencia_legal\";\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$aux++;\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\t\t\t\tif($numRegistros == 1)\n\t\t\t\t{\n\t\t\t\t\t$sqlNombresSocios = \"select apellidos, cedula, zona, cod_provincia, cod_canton, cod_parroquia, genero, grupo_etnico, poblacion, fecha_nacimiento, discapacidad, tipo_discapacidad, fecha_reporte , cod_u_organizaciones from socios where cedula = '\" . $valor . \"' order by cod_u_organizaciones\";\n\n\t\t\t\t\t$resSqlSocios = query($sqlNombresSocios);\n\t\t\t\t\twhile($fila = mysql_fetch_array($resSqlSocios))\n\t\t\t\t\t{\n\t\t\t\t\t\t//echo $fila['cod_provincia'] . \" $indice - $zonaSel<br>\";\n\t\t\t\t\t\t$provNombre = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t\t$cedulaSocio = $fila['cedula'];\n\t\t\t\t\t\t$apellidosSocio = $fila['apellidos'];\n\t\t\t\t\t\t$generoSocio = $fila['genero'];\n\t\t\t\t\t\tif($generoSocio == '') $generoSocio = \"No registrado\";\n\t\t\t\t\t\t$poblacionSocio = $fila['poblacion'];\n\t\t\t\t\t\tif($poblacionSocio == '') $poblacionSocio = \"No registrado\";\n\t\t\t\t\t\t$grupoEtnicoSocio = $fila['grupo_etnico'];\n\t\t\t\t\t\tif($grupoEtnicoSocio == '') $grupoEtnicoSocio = \"No registrado\";\n\n\t\t\t\t\t\t$sqlRucOrgSocio = \"select ruc_definitivo, ruc_provisional, organizacion, actividad, categoria_actividad_mp, identificacion_actividad_mp from u_organizaciones where cod_u_organizaciones = \" . $fila['cod_u_organizaciones'];\n\t\t\t\t\t\t//echo $sqlRucOrgSocio . \"<br>\";\n\t\t\t\t\t\t$resSqlRucOrgSocio = query($sqlRucOrgSocio);\n\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resSqlRucOrgSocio))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$rucSocio = $fila1['ruc_definitivo'] . \" - \" . $fila1['ruc_provisional'];\n\t\t\t\t\t\t\t$orgSocio = $fila1['organizacion'];\n\t\t\t\t\t\t\t$actividadOrgSocio = $fila1['actividad'];\n\t\t\t\t\t\t\t$categoriaOrgSocio = $fila1['categoria_actividad_mp'];\n\t\t\t\t\t\t\t$identificacionCategoriaOrgSocio = $fila1['identificacion_actividad_mp'];\n\t\t\t\t\t\t} \n\n\t\t\t\t\t\t$sqlFortalecimiento = \"select e.campo_fortalecimiento, e.cod_evento from eventos_u_organizaciones ev inner join eventos e on (e.cod_evento = ev.cod_evento) where ev.cod_u_organizaciones = \" . $fila['cod_u_organizaciones'] . \" and month(e.fecha_reporte) = \" . $mesSel . \" and e.anio = \" . $anioCurso . \" group by e.campo_fortalecimiento\";\n\t\t\t\t\t\t//echo $sqlFortalecimiento . \"<br>\";\n\t\t\t\t\t\t$resFortalecimiento = query($sqlFortalecimiento);\n\t\t\t\t\t\t$aux = 0;\n\t\t\t\t\t\tif(mysql_num_rows($resFortalecimiento) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resFortalecimiento))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//se tiene que revisar si hay mas de un evento relacionado con esta org\n\t\t\t\t\t\t\t\tif($aux == 0) $campoFortalecimiento .= $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\t\telse $campoFortalecimiento .= \" - \" . $fila1['campo_fortalecimiento'];\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\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sqlFortalecimiento = \"select e.cod_asistencia_legal from asistencia_legal_org e where e.cod_u_organizaciones = \" . $fila['cod_u_organizaciones'] . \" and month(e.fecha_reporte) = \" . $mesSel . \" and e.anio = \" . $anioCurso . \" group by e.cod_asistencia_legal\";\n\t\t\t\t\t\t\t//echo $sqlFortalecimiento . \"<br>\";\n\t\t\t\t\t\t\t$resFortalecimiento = query($sqlFortalecimiento);\n\t\t\t\t\t\t\tif(mysql_num_rows($resFortalecimiento) > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$campoFortalecimiento = \"asistencia_legal\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$aux++;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provNombre . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $rucSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $cedulaSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $apellidosSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $generoSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $poblacionSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $grupoEtnicoSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $orgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actividadOrgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $categoriaOrgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $identificacionCategoriaOrgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $campoFortalecimiento . \"</td>\t\t\t\t\t\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t$cont++;\t\t\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\n\t\t\n\t}\n\n\tif($indicadorSel == 5)\n\t{\n\t\t$resIndicador = quinto_indicador($mesSel,$zonaSel);\n\t\t//print_r2($resIndicador);\n\n\t\t$numRegistros = count($resIndicador);\n\t\tif($numRegistros > 0)\n\t\t{\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>ORGANIZACION</th>\n\t\t\t\t\t\t\t\t<th>RUC</th>\n\t\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE HORAS DE CAPACITACION</th>\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\n\t\t\t\t\t\t\t\t<th>EVENTO</th>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\n\t\t\tfor($i = 0; $i < count($resIndicador); $i = $i + 2)\n\t\t\t{\n\t\t\t\t$orgEvento = array();\n\t\t\t\t$orgFortalecimiento = array();\n\t\t\t\t$sqlOrgEventos = \"select ev.cod_u_organizaciones, e.campo_fortalecimiento from eventos_u_organizaciones ev inner join eventos e on (e.cod_evento = ev.cod_evento) where ev.anio = \" . $anioCurso . \" and ev.cod_evento = '\" . $resIndicador[$i] . \"' group by ev.cod_u_organizaciones\";\n\t\t\t\t//echo $sqlOrgEventos . \"<br>\";\n\t\t\t\t$resOrgEventos = query($sqlOrgEventos);\n\n\t\t\t\tif(mysql_num_rows($resOrgEventos) > 0)\n\t\t\t\t{\n\t\t\t\t\twhile($fila = mysql_fetch_array($resOrgEventos))\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($orgEvento, $fila['cod_u_organizaciones']);\n\t\t\t\t\t\tarray_push($orgFortalecimiento, $fila['campo_fortalecimiento']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$cont1 = 0;\t\t\t\t\t\n\t\t\t\t\tforeach($orgEvento as $valor)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$sqlOrganizacion = \"select cod_provincia, organizacion, ruc_definitivo, ruc_provisional, categoria_actividad_mp, identificacion_actividad_mp from u_organizaciones where cod_u_organizaciones = \" . $valor;\n\t\t\t\t\t\t$resOrganizacion = query($sqlOrganizacion);\n\t\t\t\t\t\t$provOrg = \"\";\n\t\t\t\t\t\t$nombreOrg = \"\";\n\t\t\t\t\t\t$catMatrizProductivaOrg = \"\";\n\t\t\t\t\t\t$actividadOrg = \"\";\n\t\t\t\t\t\twhile($fila = mysql_fetch_array($resOrganizacion))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$provOrg = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t\t\t$nombreOrg = $fila['organizacion'];\n\t\t\t\t\t\t\t$rucDefinitivo = $fila['ruc_definitivo'] . \" - \" . $fila['ruc_provisional'];\n\t\t\t\t\t\t\t$catMatrizProductivaOrg = $fila['categoria_actividad_mp'];\n\t\t\t\t\t\t\t$actividadOrg = $fila['identificacion_actividad_mp'];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $provOrg . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $nombreOrg . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $rucDefinitivo . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $catMatrizProductivaOrg . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $actividadOrg . \"</td>\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $resIndicador[$i + 1] . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $orgFortalecimiento[$cont1] . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $resIndicador[$i] . \"</td>\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t\t\t$cont++;\n\t\t\t\t\t\t$cont1++;\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$indice = $cont + 1;\n\n\t\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td> - </td>\n\t\t\t\t\t\t\t\t\t\t<td>NO EXISTEN ORGANIZACIONES REGISTRADAS</td>\n\t\t\t\t\t\t\t\t\t\t<td> - </td>\n\t\t\t\t\t\t\t\t\t\t<td> - </td>\n\t\t\t\t\t\t\t\t\t\t<td> - </td>\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t<td>\" . $resIndicador[$i + 1] . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td> - </td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $resIndicador[$i] . \"</td>\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t\t$cont++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\t\t\n\n\t\t\n\n\t}\n\n\tif($indicadorSel == 6)\n\t{\n\t\t$resIndicador = sexto_indicador($mesSel, $zonaSel);\n\t\t//print_r2($resIndicador);\n\t\t$numRegistros = count($resIndicador);\n\t\t$nomMes = GetNombreMes($mesSel);\n\n\t\t// si hay registros se debe crear la tabla de detalle\n\t\tif($numRegistros > 0)\n\t\t{\n\t\t\t// armado del header de la tabla\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>CEDULA</th>\n\t\t\t\t\t\t\t\t<th>APELLIDOS Y NOMBRES</th>\n\t\t\t\t\t\t\t\t<th>GRUPO ETNICO</th>\n\t\t\t\t\t\t\t\t<th>GENERO</th>\n\t\t\t\t\t\t\t\t<th>POBLACION</th>\n\t\t\t\t\t\t\t\t<th>CODIGO DIALOGO SOCIAL</th>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\n\t\t\t//tengo el array con codigos del dialgo social devuelto por el indicador\n\t\t\t$cont = 0;\n\t\t\t$lineasTabla = \"\";\t\t\t\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\n\t\t\t\t// debe buscar la informacion del dialogo social\n\t\t\t\t$sqlDetalleDialogo = \"select cod_provincia, cedula, nombres, apellidos, grupo_etnico, poblacion, genero from asistentes where cod_evento = '\" . $valor . \"' and anio = \" . $anioCurso . \" group by cedula\";\n\t\t\t\t//echo $sqlDetalleDialogo . \"<br>\";\n\t\t\t\t$resDetalleDialogo = query($sqlDetalleDialogo);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\twhile($fila = mysql_fetch_array($resDetalleDialogo))\n\t\t\t\t{\n\t\t\t\t\t$indice = $cont + 1;\n\t\t\t\t\t$provOrg = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t$cedulaA = $fila['cedula'];\n\t\t\t\t\t$apellidosNombres = $fila['apellidos'];\n\t\t\t\t\t$grupoEtnico = $fila['grupo_etnico'];\n\t\t\t\t\t$generoA = $fila['genero'];\n\t\t\t\t\t$poblacionA = $fila['poblacion'];\n\n\t\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $provOrg . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $cedulaA . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $apellidosNombres . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $grupoEtnico . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $generoA . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $poblacionA . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $valor . \"</td>\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</tr>\";\n\t\t\t\t\t$cont++;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// si no existe registros lo hacemos saber al usuario\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\n\t\t\n\t\t\n\n\t}\n\n\tif($indicadorSel == 7)\n\t{\n\t\t$resIndicador = septimo_indicador($mesSel, $zonaSel);\n\t\t//print_r2($resIndicador);\n\n\t\t// si el indicador regresa datos comenzamos a armar la tabla de detalle\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t// armado del header de la tabla\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>CEDULA</th>\n\t\t\t\t\t\t\t\t<th>APELLIDOS Y NOMBRES</th>\n\t\t\t\t\t\t\t\t<th>GRUPO ETNICO</th>\n\t\t\t\t\t\t\t\t<th>GENERO</th>\n\t\t\t\t\t\t\t\t<th>POBLACION</th>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\t\t\t$cont = 0;\n\t\t\t$lineasTabla = \"\";\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\n\t\t\t\t// consulto el detalle de los asistentes a eps\n\t\t\t\t$sqlAsistentes = \"select cod_provincia, apellidos, grupo_etnico, genero, poblacion from asistentes where tipo_evento = 'EPS' and zona=\" . $zonaSel . \" and month(fecha_reporte) = \" . $mesSel . \" and year(fecha_reporte) =\" . $anioCurso . \" and anio =\" . $anioCurso . \" and cedula = '\" . $valor . \"'\";\n\t\t\t\t$resAsistentes = query($sqlAsistentes);\n\t\t\t\twhile($fila = mysql_fetch_array($resAsistentes))\n\t\t\t\t{\n\t\t\t\t\t$provOrg = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t$apellidosNombres = $fila['apellidos'];\n\t\t\t\t\t$grupoEtnico = $fila['grupo_etnico'];\n\t\t\t\t\t$generoA = $fila['genero'];\n\t\t\t\t\t$poblacionA = $fila['poblacion'];\n\n\t\t\t\t}\n\n\t\t\t\t$indice = $cont + 1;\n\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provOrg . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $valor . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $apellidosNombres . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $grupoEtnico . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $generoA . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $poblacionA . \"</td>\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</tr>\";\n\t\t\t\t$cont++;\n\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// si no hay registros\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\t}\n\n\tif($indicadorSel == 8)\n\t{\n\t\t$resIndicador = octavo_indicador($mesSel, $zonaSel);\n\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t//provincias de las organizaciones\n\t\t\t$provOrg = RecuperarInfoOrg($resIndicador, 'provincia');\n\t\t\t//nombres de las organizaciones\n\t\t\t$nombresOrganizaciones = RecuperarInfoOrg($resIndicador, 'nombresOrg');\n\t\t\t// ruc de las organizaciones\n\t\t\t$rucProvisional = RecuperarInfoOrg($resIndicador, 'rucProvisionalOrg');\n\t\t\t$rucDefinitivo = RecuperarInfoOrg($resIndicador, 'rucDefinitivoOrg');\n\t\t\t//categoria Matriz productiva de las organizaciones\n\t\t\t$catMatrizProductivaOrg = RecuperarInfoOrg($resIndicador, 'categoriaMatriz');\n\t\t\t// numero de socios por cada organizacion\n\t\t\t$numSociosOrganizacion = NumSociosOrganizacion($resIndicador);\n\t\t\t// numero de personas Capacitadas\n\t\t\t$numPerCapacitadas = NumPersonasCapacitadas($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel);\n\t\t\t//print_r2($eventosAsistentes);\n\t\t\t//Servicio Brindado por Fortalecimiento\n\t\t\t$servicioFortalecimiento = ServiciosBrindadosOrg($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel);\n\t\t\t//print_r2($resIndicador);\n\t\t\t// identificacion actividad matriz productiva\n\t\t\t$actOrgMP = RecuperarInfoOrg($resIndicador, 'identificacionMatriz');\n\t\t\t//capacitados por Genero\n\t\t\t$capMujeres = NumCapacitadosGenero($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel, 'mujer');\n\t\t\t$capHombres = NumCapacitadosGenero($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel, 'hombre');\n\n\n\t\t\t// BORRAR LUEGO SOLO PARA FORTALECIMIENTO\n\t\t\t$tablaCapacitados .= \"</table>\";\n\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES REPORTE</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>ORGANIZACION</th>\n\t\t\t\t\t\t\t\t<th>RUC</th>\n\t\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MP</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE SOCIOS</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS MUJERES</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS HOMBRES</th>\n\t\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\n\t\t\t\t\t\t\t\t<th>CODIGO EVENTO</th>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\n\n\t\t\t\t\n\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nombresOrganizaciones[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $rucDefinitivo[$cont] . \" - \" . $rucProvisional[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $catMatrizProductivaOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actOrgMP[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numSociosOrganizacion[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numPerCapacitadas[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $capMujeres[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $capHombres[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $servicioFortalecimiento[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $eventosAsistentes[$cont] . \"</td>\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t$cont++;\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\t}\n\n\tif($indicadorSel == 9)\n\t{\n\t\t$resIndicador = noveno_indicador($mesSel, $zonaSel);\n\t\t//print_r2($resIndicador);\n\t\t//global $orgSocios;\n\n\t\t$provNombre = \"\";\n\t\t$rucSocio = \"\";\n\t\t$cedulaSocio = \"\";\n\t\t$apellidosSocio = \"\";\n\t\t$orgSocio = \"\";\n\t\t$actividadOrgSocio = \"\";\n\t\t$categoriaOrgSocio = \"\";\n\t\t$identificacionCategoriaOrgSocio = \"\";\n\t\t$campoFortalecimiento = \"\";\n\t\t$generoSocio = \"\";\n\t\t$poblacionSocio = \"\";\n\t\t$grupoEtnicoSocio = \"\";\n\n\t\t//print_r2($resIndicador);\n\t\t//print_r2($orgSocios);\n\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t$provNombre = \"\";\n\t\t\t\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>RUC</th>\n\t\t\t\t\t\t\t\t<th>CEDULA</th>\n\t\t\t\t\t\t\t\t<th>APELLIDOS Y NOMBRES</th>\n\t\t\t\t\t\t\t\t<th>GENERO</th>\n\t\t\t\t\t\t\t\t<th>GRUPO ETNICO</th>\n\t\t\t\t\t\t\t\t<th>POBLACION</th>\n\t\t\t\t\t\t\t\t<th>ORGANIZACION</th>\n\t\t\t\t\t\t\t\t<th>ACTIVIDAD</th>\n\t\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MP</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\t\t\t\t\t\n\t\t\t\t$rucSocio = \"\";\n\t\t\t\t$cedulaSocio = \"\";\n\t\t\t\t$apellidosSocio = \"\";\n\t\t\t\t$orgSocio = \"\";\n\t\t\t\t$actividadOrgSocio = \"\";\n\t\t\t\t$categoriaOrgSocio = \"\";\n\t\t\t\t$identificacionCategoriaOrgSocio = \"\";\n\t\t\t\t$campoFortalecimiento = \"\";\n\t\t\t\t$generoSocio = \"\";\n\t\t\t\t$poblacionSocio = \"\";\n\t\t\t\t$grupoEtnicoSocio = \"\";\n\n\t\t\t\t$sqlOrgSocios = \"select cod_u_organizaciones from socios where cedula = '\" . $valor . \"' group by cod_u_organizaciones\";\n\n\t\t\t\t$resSqlOrgSocios = query($sqlOrgSocios);\n\t\t\t\t$numRegistros = mysql_num_rows($resSqlOrgSocios);\n\t\t\t\t//echo $numRegistros . \"<br>\";\n\n\t\t\t\tif($numRegistros > 1)\n\t\t\t\t{\n\t\t\t\t\t// El socio existe en mas de una organizacion, por lo cual se debe de tomar los cod_u_organizaciones\n\t\t\t\t\t$codOrgSocio = array();\n\t\t\t\t\t$codOrgReportada = array();\n\t\t\t\t\twhile($fila = mysql_fetch_array($resSqlOrgSocios))\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($codOrgSocio, $fila['cod_u_organizaciones']);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Se busca las organizaciones que han sido reportadas en el mes\n\t\t\t\t\t/*foreach($codOrgSocio as $codigoOrg)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(in_array($codigoOrg, $orgSocios))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//si el codigo de organizacion se encuentra reportada se guarda en codOrgReportada\n\t\t\t\t\t\t\tarray_push($codOrgReportada, $codigoOrg);\n\t\t\t\t\t\t}\n\t\t\t\t\t}*/\n\n\t\t\t\t\t// Se completa la informacion correspondiente\n\t\t\t\t\t$sqlNombresSocios = \"select apellidos, cedula, zona, cod_provincia, cod_canton, cod_parroquia, genero, grupo_etnico, poblacion, fecha_nacimiento, discapacidad, tipo_discapacidad, fecha_reporte from socios where cedula = '\" . $valor . \"' group by cedula\";\n\n\t\t\t\t\t$resSqlSocios = query($sqlNombresSocios);\n\t\t\t\t\t$codOrgReportada = $codOrgSocio;\n\t\t\t\t\twhile($fila = mysql_fetch_array($resSqlSocios))\n\t\t\t\t\t{\n\t\t\t\t\t\t$provNombre = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t\t$cedulaSocio = $fila['cedula'];\n\t\t\t\t\t\t$apellidosSocio = $fila['apellidos'];\n\t\t\t\t\t\t$generoSocio = $fila['genero'];\n\t\t\t\t\t\tif($generoSocio == '') $generoSocio = \"No registrado\";\n\t\t\t\t\t\t$poblacionSocio = $fila['poblacion'];\n\t\t\t\t\t\tif($poblacionSocio == '') $poblacionSocio = \"No registrado\";\n\t\t\t\t\t\t$grupoEtnicoSocio = $fila['grupo_etnico'];\n\t\t\t\t\t\tif($grupoEtnicoSocio == '') $grupoEtnicoSocio = \"No registrado\";\n\n\t\t\t\t\t\t$aux = 0;\n\t\t\t\t\t\tforeach($codOrgReportada as $codigoOrg)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sqlRucOrgSocio = \"select ruc_definitivo, ruc_provisional, organizacion, actividad, categoria_actividad_mp, identificacion_actividad_mp from u_organizaciones where cod_u_organizaciones = \" . $codigoOrg;\n\t\t\t\t\t\t\t$resSqlRucOrgSocio = query($sqlRucOrgSocio);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resSqlRucOrgSocio))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($aux == 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rucSocio = $fila1['ruc_definitivo'] . \" - \" . $fila1['ruc_provisional'];\n\t\t\t\t\t\t\t\t\t$orgSocio = $fila1['organizacion'];\n\t\t\t\t\t\t\t\t\t$actividadOrgSocio = $fila1['actividad'];\n\t\t\t\t\t\t\t\t\t$categoriaOrgSocio = $fila1['categoria_actividad_mp'];\n\t\t\t\t\t\t\t\t\t$identificacionCategoriaOrgSocio = $fila1['identificacion_actividad_mp'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rucSocio .= \" - \" . $fila1['ruc_definitivo'] . \" - \" . $fila1['ruc_provisional'];\n\t\t\t\t\t\t\t\t\t$orgSocio .= \" - \" . $fila1['organizacion'];\n\t\t\t\t\t\t\t\t\t$actividadOrgSocio .= \" - \" . $fila1['actividad'];\n\t\t\t\t\t\t\t\t\t$categoriaOrgSocio .= \" - \" . $fila1['categoria_actividad_mp'];\n\t\t\t\t\t\t\t\t\t$identificacionCategoriaOrgSocio .= \" - \" . $fila1['identificacion_actividad_mp'];\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}\n\n\t\t\t\t\t\t\t$sqlFortalecimiento = \"select e.campo_fortalecimiento, e.cod_evento from eventos_u_organizaciones ev inner join eventos e on (e.cod_evento = ev.cod_evento) where ev.cod_u_organizaciones = \" . $codigoOrg . \" and month(e.fecha_reporte) = \" . $mesSel . \" and e.anio = \" . $anioCurso . \" group by e.campo_fortalecimiento\";\n\n\t\t\t\t\t\t\t//echo $sqlFortalecimiento . \"<br>\";\n\t\t\t\t\t\t\t$resFortalecimiento = query($sqlFortalecimiento);\n\t\t\t\t\t\t\t$aux1 = 0;\n\t\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resFortalecimiento))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//se tiene que revisar si hay mas de un evento relacionado con esta org\n\t\t\t\t\t\t\t\tif($aux1 == 0) $campoFortalecimiento .= $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\t\telse $campoFortalecimiento .= \" - \" . $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\t\t$aux1++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$aux++;\n\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\t\t\t\tif($numRegistros == 1)\n\t\t\t\t{\n\t\t\t\t\t$sqlNombresSocios = \"select apellidos, cedula, zona, cod_provincia, cod_canton, cod_parroquia, genero, grupo_etnico, poblacion, fecha_nacimiento, discapacidad, tipo_discapacidad, fecha_reporte , cod_u_organizaciones from socios where cedula = '\" . $valor . \"' order by cod_u_organizaciones\";\n\n\t\t\t\t\t$resSqlSocios = query($sqlNombresSocios);\n\t\t\t\t\twhile($fila = mysql_fetch_array($resSqlSocios))\n\t\t\t\t\t{\n\t\t\t\t\t\t$provNombre = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t\t$cedulaSocio = $fila['cedula'];\n\t\t\t\t\t\t$apellidosSocio = $fila['apellidos'];\n\t\t\t\t\t\t$generoSocio = $fila['genero'];\n\t\t\t\t\t\tif($generoSocio == '') $generoSocio = \"No registrado\";\n\t\t\t\t\t\t$poblacionSocio = $fila['poblacion'];\n\t\t\t\t\t\tif($poblacionSocio == '') $poblacionSocio = \"No registrado\";\n\t\t\t\t\t\t$grupoEtnicoSocio = $fila['grupo_etnico'];\n\t\t\t\t\t\tif($grupoEtnicoSocio == '') $grupoEtnicoSocio = \"No registrado\";\n\n\t\t\t\t\t\t$sqlRucOrgSocio = \"select ruc_definitivo, ruc_provisional, organizacion, actividad, categoria_actividad_mp, identificacion_actividad_mp from u_organizaciones where cod_u_organizaciones = \" . $fila['cod_u_organizaciones'];\n\t\t\t\t\t\t//echo $sqlRucOrgSocio . \"<br>\";\n\t\t\t\t\t\t$resSqlRucOrgSocio = query($sqlRucOrgSocio);\n\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resSqlRucOrgSocio))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$rucSocio = $fila1['ruc_definitivo'] . \" - \" . $fila1['ruc_provisional'];\n\t\t\t\t\t\t\t$orgSocio = $fila1['organizacion'];\n\t\t\t\t\t\t\t$actividadOrgSocio = $fila1['actividad'];\n\t\t\t\t\t\t\t$categoriaOrgSocio = $fila1['categoria_actividad_mp'];\n\t\t\t\t\t\t\t$identificacionCategoriaOrgSocio = $fila1['identificacion_actividad_mp'];\n\t\t\t\t\t\t} \n\n\t\t\t\t\t\t$sqlFortalecimiento = \"select e.campo_fortalecimiento, e.cod_evento from eventos_u_organizaciones ev inner join eventos e on (e.cod_evento = ev.cod_evento) where ev.cod_u_organizaciones = \" . $fila['cod_u_organizaciones'] . \" and month(e.fecha_reporte) = \" . $mesSel . \" and e.anio = \" . $anioCurso . \" group by e.campo_fortalecimiento\";\n\t\t\t\t\t\t$resFortalecimiento = query($sqlFortalecimiento);\n\t\t\t\t\t\t$aux = 0;\n\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resFortalecimiento))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//se tiene que revisar si hay mas de un evento relacionado con esta org\n\t\t\t\t\t\t\tif($aux == 0) $campoFortalecimiento .= $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\telse $campoFortalecimiento .= \" - \" . $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\t$aux++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($numRegistros == 0)\n\t\t\t\t{\n\t\t\t\t\t// No es un asistente que pertnezca a una organizacion\n\t\t\t\t\t$rucSocio = \"No pertenece a una ORG/UEP\";\n\t\t\t\t\t$orgSocio = \"No pertenece a una ORG/UEP\";\n\t\t\t\t\t$actividadOrgSocio = \"No pertenece a una ORG/UEP\";\n\t\t\t\t\t$categoriaOrgSocio = \"No pertenece a una ORG/UEP\";\n\t\t\t\t\t$identificacionCategoriaOrgSocio = \"No pertenece a una ORG/UEP\";\n\t\t\t\t\t$sqlAsisten = \"select cod_provincia, cedula, apellidos, campo_fortalecimiento, genero, grupo_etnico, poblacion from asistentes where cedula = '\" . $valor . \"' and month(fecha_reporte) = \" . $mesSel . \" and year(fecha_reporte) = \" . $anioCurso . \" and anio = \" . $anioCurso;\n\t\t\t\t\t$resAsisten = query($sqlAsisten);\n\t\t\t\t\twhile($fila = mysql_fetch_array($resAsisten))\n\t\t\t\t\t{\n\t\t\t\t\t\t$provNombre = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t\t$cedulaSocio = $valor;\n\t\t\t\t\t\t$apellidosSocio = $fila['apellidos'];\n\t\t\t\t\t\t$campoFortalecimiento = $fila['campo_fortalecimiento'];\n\t\t\t\t\t\t$generoSocio = $fila['genero'];\n\t\t\t\t\t\tif($generoSocio == '') $generoSocio = \"No registrado\";\n\t\t\t\t\t\t$poblacionSocio = $fila['poblacion'];\n\t\t\t\t\t\tif($poblacionSocio == '') $poblacionSocio = \"No registrado\";\n\t\t\t\t\t\t$grupoEtnicoSocio = $fila['grupo_etnico'];\n\t\t\t\t\t\tif($grupoEtnicoSocio == '') $grupoEtnicoSocio = \"No registrado\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provNombre . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $rucSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $cedulaSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $apellidosSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $generoSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $grupoEtnicoSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $poblacionSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $orgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actividadOrgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $categoriaOrgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $identificacionCategoriaOrgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $campoFortalecimiento . \"</td>\t\t\t\t\t\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t$cont++;\t\t\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\n\n\n\t}\n\t$resultadoFinal = $tablaHeader . $lineasTabla;\n\treturn $resultadoFinal;\n}", "public static function generarRepresentanteLegal(Empresa $empresa,$nombres,$apellidop,$apellidom,$tipodocumento,$documento,$direccion,$numerocontacto2,$idpais,$genero,$email,$id_persona,$cargo,$expedido)\n {\n $logs = new Logs();\n $sqlLogs = new SQLLogs();\n \n $persona = new Persona();\n $sqlPersona = new SQLPersona();\n $hoy = date(\"Y-m-d h:m:s\");\n $usuario = new Usuario();\n $sqlUsuario = new SQLUsuario();\n \n if($id_persona=='0')\n {\n //es nuevo\n $persona->setNombres(mb_strtoupper($nombres));\n $persona->setPaterno(mb_strtoupper($apellidop));\n $persona->setMaterno(mb_strtoupper($apellidom));\n $persona->setId_tipo_documento($tipodocumento);\n $persona->setNumero_documento($documento);//este es el documento\n $persona->setDireccion($direccion);\n // if($numerocontacto!=''){$persona->setNumero_contacto($numerocontacto);}\n // if($numerocontacto2!=''){$persona->setNumero_contacto2($numerocontacto2);}\n $persona->setExpedido($expedido);\n $persona->setEmail($email);\n $persona->setId_pais_origen($idpais);\n $persona->setFecha_creacion($hoy);\n $persona->setEstado(1);//para el estado activo\n $persona->setId_usuario_creacion($_SESSION['id_usuario']);\n if($genero==1) $persona->setGenero(true);\n else $persona->setGenero(false);\n try{\n $sqlPersona->setGuardarPersona($persona);\n } catch (Exception $ex) {\n $logs->setDescripcion('ERROR: generarRepresentanteLegal: creacion de la PERSONA');\n $logs->setId_servicio(0);\n $logs->setMensaje($ex->getMessage());\n $logs->setObjeto(print_r($persona,true));\n $logs->setDate(Date('Y-m-d H:i:s'));\n $sqlLogs->Save($logs);\n return null;\n }\n \n \n //esto es para crear el nombre del usuario\n $campousuario=trim($persona->getNombres());\n $campousuario=$campousuario[0].$persona->getNumero_documento();\n //-guardamos el usuario\n \n $usuario->setUsuario($campousuario);\n $usuario->setClave(substr(str_shuffle(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, 8));\n //$usuario->setClave('123456');\n $usuario->setFecha_creacion($hoy);\n $usuario->setId_persona($persona->getId_persona());\n $usuario->setActivo(1);\n $usuario->setId_tipo_usuario(2);\n try{\n $sqlUsuario->setGuardarUsuario($usuario);\n } catch (Exception $ex) {\n $logs->setDescripcion('ERROR: generarRepresentanteLegal: creacion del USUARIO');\n $logs->setId_servicio(0);\n $logs->setMensaje($ex->getMessage());\n $logs->setObjeto(print_r($usuario,true));\n $logs->setDate(Date('Y-m-d H:i:s'));\n $sqlLogs->Save($logs);\n $sqlPersona->delete($persona);\n return null;\n }\n }\n else\n {\n //es antiguo\n $persona->setId_persona($id_persona);\n $persona = $sqlPersona->getDatosPersonaPorId($persona);\n $usuario->setId_persona($id_persona);\n $usuario=$sqlUsuario->getDatosUsuarioPorIdPersona($usuario);\n }\n \n $perfil = new Perfil();\n $sqlPerfil = new SQLPerfil();\n $perfil->setId_perfil(3);//es pa el RL\n $perfil=$sqlPerfil->getBuscarDescripcionPorId($perfil);\n $perfil->getOpciones();\n\n $empresa_persona = new EmpresaPersona();\n $sqlEmpresaPersona = new SQLEmpresaPersona();\n $empresa_persona->setId_Persona($persona->getId_persona());\n $empresa_persona->setId_Empresa($empresa->getId_empresa());\n $empresa_persona->setId_Perfil(3);\n $empresa_persona->setFecha_Vinculacion($hoy);\n $empresa_persona->setOpciones_persona($perfil->getOpciones());\n $empresa_persona->setActivo(1);\n $empresa_persona->setCargo($cargo);\n try{\n $sqlEmpresaPersona->setGuardarEmpresaPersona($empresa_persona);\n return $persona->getId_persona().','.$usuario->getClave().','.$campousuario.','.$persona->getEmail();\n } catch (Exception $ex) {\n $logs->setDescripcion('ERROR: generarRepresentanteLegal: registo EMPRESA - PERSONA');\n $logs->setId_servicio(0);\n $logs->setMensaje($ex->getMessage());\n $logs->setObjeto(print_r($empresa_persona,true));\n $logs->setDate(Date('Y-m-d H:i:s'));\n $sqlLogs->Save($logs);\n $sqlPersona->delete($persona);\n $sqlUsuario->delete($usuario);\n }\n return null;\n /*if($sqlEmpresaPersona->setGuardarEmpresaPersona($empresa_persona)){\n return $persona->getId_persona().','.$usuario->getClave().','.$campousuario.','.$persona->getEmail();\n }else return null;*/\n }", "function add_traduccion_temp($id_palabra, $id_idioma, $traduccion,$explicacion,$pronunciacion,$id_colaborador,$estado) {\n\t\t$timestamp=time();\n\t\t$fecha=date(\"Y-m-d H:i:s\",$timestamp);\n\t\t$fecha_modificacion=date(\"Y-m-d H:i:s\",$timestamp);\n\t\t\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$ssql = \"INSERT INTO traducciones_temp (id_palabra, traduccion, explicacion,pronunciacion, id_idioma, id_colaborador, estado, fecha_alta, fecha_modificacion) \n\t\t\tVALUES ('$id_palabra', '$traduccion', '$explicacion', '$pronunciacion','$id_idioma', '$id_colaborador', '$estado', '$fecha', '$fecha')\";\n\t\t\t\n\t\t\t//lo inserto en la base de datos\n\t\t\tif (mysql_query($ssql,$connection)){\n\t\t\t\t//recibo el último id\n\t\t\t\t$ultimo_id = mysql_insert_id($connection);\n\t\t\t\tmysql_close($connection);\n\t\t\t\treturn $ultimo_id;\n\t\t\t}else{\n\t\t\t\tmysql_close($connection);\n\t\t\t\treturn false;\n\t\t\t} \t\t\n\t}", "static public function ctrCrearAtencionCPANEL(){\r\n\t\t\tif (isset($_POST[\"nuevoCodigo\"])){\r\n\t\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"idUser\"])){\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN ATENCIONL =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta = \"\";\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"fotoDiagnostico\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"fotoDiagnostico\"][\"tmp_name\"]);\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio = \"vistas/img/atenciones/\".$_POST[\"nuevoCodigo\"];\r\n\r\n\t\t\t\t\t\tmkdir($directorio, 0755);\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta = \"vistas/img/atenciones/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"fotoDiagnostico\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta = \"vistas/img/atenciones/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"fotoDiagnostico\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta);\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN ATENCION 2 =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta2 = \"\";\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"fotoDiagnostico2\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho2, $alto2) = getimagesize($_FILES[\"fotoDiagnostico2\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio2 = \"vistas/img/atenciones/i2/\".$_POST[\"nuevoCodigo\"];\r\n\r\n\t\t\t\t\t\tmkdir($directorio2, 0755);\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico2\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta2 = \"vistas/img/atenciones/i2/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"fotoDiagnostico2\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho2, $alto2);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta2);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico2\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta2 = \"vistas/img/atenciones/i2/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"fotoDiagnostico2\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho2, $alto2);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta2);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\r\n\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN ATENCION 3 =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta3 = \"\";\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"fotoDiagnostico3\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"fotoDiagnostico3\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio = \"vistas/img/atenciones/i3/\".$_POST[\"nuevoCodigo\"];\r\n\r\n\t\t\t\t\t\tmkdir($directorio, 0755);\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico3\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta3 = \"vistas/img/atenciones/i3/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"fotoDiagnostico3\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta3);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico3\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta3 = \"vistas/img/atenciones/i3/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"fotoDiagnostico3\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta3);\r\n\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN ATENCION 4 =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta4 =\"\";\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"fotoDiagnostico4\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"fotoDiagnostico4\"][\"tmp_name\"]);\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio = \"vistas/img/atenciones/i4/\".$_POST[\"nuevoCodigo\"];\r\n\r\n\t\t\t\t\t\tmkdir($directorio, 0755);\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico4\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta4 = \"vistas/img/atenciones/i4/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"fotoDiagnostico4\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta4);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico4\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta4 = \"vistas/img/atenciones/i4/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"fotoDiagnostico4\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta4);\r\n\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\r\n\r\n\r\n\r\n\t\t\t\t\t$tabla = \"atencion\";\r\n\r\n\t\t\t\t\t\t$datos = array(\"codigo_atencion\" => $_POST[\"nuevoCodigo\"],\r\n\t\t\t\t\t\t\t\t\t \"id_usuario\" => $_POST[\"idUsuario\"],\r\n\t\t\t\t\t\t\t\t\t \"id_personal_salud\" => $_POST[\"nuevaPersonalSalud\"],\r\n\t\t\t\t\t\t\t\t\t \"id_paciente\" => $_POST[\"nuevoPaciente\"],\r\n\t\t\t\t\t\t\t\t\t \"ups\" => $_POST[\"nuevaUps\"],\r\n\t\t\t\t\t\t\t\t\t \"servicio\" => $_POST[\"nuevoServicio\"],\r\n\t\t\t\t\t\t\t\t\t \"especialidad\" => $_POST[\"nuevaEspecialidad\"],\r\n\t\t\t\t\t\t\t\t\t \"diagnostico\" => $_POST[\"nuevoDiagnostico\"],\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico\" => $ruta,\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico2\" => $ruta2,\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico3\" => $ruta3,\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico4\" => $ruta4,\r\n\t\t\t\t\t\t\t\t\t \"fecha_atencion\" => $_POST[\"nuevaFechaAtencion\"]);\r\n\r\n\t\t\t\t\t\t$respuesta = ModeloAtenciones::mdlIngresarAtenciones($tabla, $datos);\r\n\r\n\t\t\t\t\t\tif ($respuesta == \"ok\") {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\r\n\t\t\t\t\t\t\t\t\t\ttitle: \"¡La Atención ha sido guardado correctamente!\",\r\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\twindow.location = \"historias-clinicas-crear\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t \t\t </script>';\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\ttype: \"error\",\r\n\t\t\t\t\t\t\t\ttitle: \"¡La Atención no puede ir vacía o llevar caracteres especiales !\",\r\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\twindow.location = \"historias-clinicas-crear\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t </script>';\r\n\r\n\t\t\t}\r\n\t\t }\r\n\t\t/*===== FIN registro atenciones CPANEL ======*/\t\t\t\t\t\r\n\t }", "function d3jspie_generateur_autoriser(){}", "function AddUSTIDPruefungKunde($kunde)\n {\n\n\n }", "public function Registrar_Licencia_noRemunerada3(HojaVida $data) {\n $modelo = new HojaVida();\n $fechahora = $modelo->get_fecha_actual();\n $datosfecha = explode(\" \",$fechahora);\n $fechalog = $datosfecha[0];\n $horalog = $datosfecha[1];\n \n if($data->lic_id_tipo == 5) \n { // Licencia 3 meses\n $tiporegistro = \"Solicitud Licencia no Remunerada (3 Meses)\";\n }\n else\n {\n $tiporegistro = \"Solicitud Licencia no Remunerada hasta por 2 años\";\n }\n\n $accion = \"Registra una Nueva \".$tiporegistro.\" En el Sistema TALENTO HUMANO\";\n $detalle = $_SESSION['nombre'].\" \".$accion.\" \".$fechalog.\" \".\"a las: \".$horalog;\n $tipolog = 15;\n $idusuario = $_SESSION['idUsuario']; // idusuario que registra la solicitud de licencia\n \n $per_DI_other = $_POST['cedula_other'];\n $per_name_other = $_POST['nombre_other'];\n if($per_DI_other != \"\" && $per_name_other != \"\")\n {\n $id_usuario_soli = $_POST['id_servidor']; // id del usuario que solicita la licencia\n $cedula_solicitante = $_POST['cedula_other'];\n $nombre_solicitante = $_POST['nombre_other'];\n $cargo_solicitante = $_POST['cargo_servidor'];\n }\n else\n {\n $id_usuario_soli = $_SESSION['idUsuario']; // id del usuario que solicita la licencia\n $cedula_solicitante = $_SESSION['nomusu'];\n $nombre_solicitante = $_SESSION['nombre'];\n $cargo_solicitante = $_SESSION['cargo'];\n }\n try {\n\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\t\t\n //EMPIEZA LA TRANSACCION\n $this->pdo->beginTransaction();\n \n $sql = \"INSERT INTO `th_licencias_no_remunerada`(\n `lic_no_rem_id_tipo_resolucion`, \n `lic_no_rem_fecha_solicitud`, \n `lic_no_rem_fecha_escrito`, \n `lic_no_rem_cedula_servidor`, \n `lic_no_rem_nombre_servidor`, \n `lic_no_rem_fecha_inicio`, \n `lic_no_rem_fecha_fin`, \n `lic_no_rem_motivo`, \n `lic_no_rem_id_user`, \n `lic_no_rem_estado`,\n `lic_no_rem_ruta_doc_escrito`, \n `lic_no_rem_id_user_registra`, \n `lic_no_rem_cargo_cs`) \n VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n $this->pdo->prepare($sql)\n ->execute(\n array(\n $data->lic_id_tipo,\n $fechalog,\n $data->fecha_escrito,\n $cedula_solicitante,\n $nombre_solicitante,\n $data->fechaInicio,\n $data->fechaFin,\n $data->comentario,\n $id_usuario_soli,\n 0,\n $data->ruta_doc_adjunto, \n $idusuario, \n $cargo_solicitante\n )\n );\n $this->pdo->exec(\"INSERT INTO log (fecha, accion, detalle, idusuario, idtipolog) VALUES ('$fechalog', '$accion','$detalle','$idusuario','$tipolog')\");\n\n //SE TERMINA LA TRANSACCION \n $this->pdo->commit();\n } catch (Exception $e) {\n $this->pdo->rollBack();\n die($e->getMessage());\n }\n }" ]
[ "0.63479996", "0.6222491", "0.59448594", "0.5871154", "0.58694696", "0.5861741", "0.58404166", "0.58074963", "0.57517076", "0.57491374", "0.5747312", "0.5734514", "0.5726603", "0.57103276", "0.5695436", "0.5692024", "0.5682", "0.56688267", "0.566635", "0.5661396", "0.56532234", "0.56500816", "0.56496555", "0.56451064", "0.56390166", "0.56316966", "0.5614679", "0.55954134", "0.5594936", "0.5594892" ]
0.7156163
0
/ Adding a new pengetahuan
function add() { if(isset($_POST) && count($_POST) > 0) { $params = array( 'kode_penyakit' => $this->input->post('kode_penyakit'), 'id_gejala' => $this->input->post('id_gejala'), 'mb' => $this->input->post('mb'), 'md' => $this->input->post('md'), ); $pengetahuan_id = $this->Pengetahuan_model->add_pengetahuan($params); redirect('pengetahuan/index'); } else { $data['_view'] = 'pengetahuan/add'; $this->load->view('layouts/main',$data); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_plazo()\n\t{\n\t\tif(!empty($this->data))\n\t\t{\n\t\t\techo var_dump($this->data);\n\t\t\t$etapa = mb_strtoupper($this->data['Plazo']['etapa']);\t\t\n\t\t\t$etapa = $etapa;\n\t\t\t$datos = array('etapa'=> $etapa,\n\t\t\t\t\t\t 'etapa_id'\t=> $this->data['Plazo']['etapa_id'],\n\t\t\t\t\t\t 'plazo'\t=> $this->data['Plazo']['plazo']\t\t\t\t\t\t \n\t\t\t\t\t\t );\n\t\t\t$this->Plazo->create();\n\t\t\tif($this->Plazo->saveAll($datos))\n\t\t\t{\n\t\t\t\t$this->Session->setFlash(__('Plazo creado correctamente'),'mensaje-exito');\n\t\t\t\t$this->redirect(array('action' => 'index_plazos'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->Session->setFlash(__('Hubo un error al guardar el plazo'),'mensaje-error');\n\t\t\t\t$this->redirect(array('action' => 'index_sede'));\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public function add()\n\t{\n\t\t$data = [\n\t\t\t'BatasNilaiBawah2' => $this->input->post('batas_bawah2'),\n\t\t\t'BatasNilaiAtas2' => $this->input->post('batas_atas2'),\n\t\t\t'PredikatHasil2' => $this->input->post('predikat_hasil2'),\n\t\t\t'KetHasil2' => $this->input->post('ket_hasil2'),\n\t\t];\n\t\t$this->Predikat_hasil2_M->addPredikatHasil2($data);\n\t\t$this->session->set_flashdata('pesan', 'Berhasil ditambahkan!');\n\t\tredirect('nilai/predikat_hasil2');\n\t}", "public function addProses(Request $p)\n {\n //untuk memvalidasi bahwa data yang diisi nanti (dari 5 variabel dibawah) tidak null\n $this->validate($p, [\n 'id_keilmuan' => 'required',\n 'judul_jurnal' => 'required',\n 'nama_penulis' => 'required',\n 'abstrak' => 'required',\n 'kata_kunci' => 'required'\n ]);\n \n //prosesnya disini\n $jurnal = Klasifikasi::create([\n 'id_keilmuan' => request()->get('id_keilmuan'),\n 'judul_jurnal' => request()->get('judul_jurnal'),\n 'nama_penulis' => request()->get('nama_penulis'),\n 'abstrak' => request()->get('abstrak'),\n 'kata_kunci' => request()->get('kata_kunci')\n ]);\n $jurnal->save();\n return redirect()->route('jurnal');\n }", "public function add_peserta_borang($data) {\r\n $objektif = $this-> input -> post('objektif');\r\n $sebab = $this-> input -> post('sebab');\r\n $penyampaian =$this -> input ->post('penyampaian');\r\n $komunikasi = $this-> input -> post('komunikasi');\r\n $interaksi =$this -> input ->post('interaksi');\r\n $respon = $this-> input -> post('respon');\r\n $difahami =$this -> input ->post('difahami');\r\n $kesan = $this-> input -> post('kesan');\r\n $aktiviti =$this -> input ->post('aktiviti');\r\n $bahan = $this-> input -> post('bahan');\r\n $tahap =$this -> input ->post('tahap');\r\n $kemahiran = $this-> input -> post('kemahiran');\r\n $tempoh =$this -> input ->post('tempoh');\r\n $lokasi = $this-> input -> post('lokasi');\r\n $penginapan =$this -> input ->post('penginapan');\r\n $makanan = $this-> input -> post('makanan');\r\n $dewan =$this -> input ->post('dewan');\r\n $urusetia = $this-> input -> post('urusetia');\r\n $faedah = $this-> input -> post('faedah');\r\n $cadangan = $this-> input -> post('cadangan');\r\n\r\n \r\n\r\n $data = array(\r\n 'ID_LATIHAN' => $data['id_latihan'],\r\n 'ID_USER' => $data['user'],\r\n 'ID_PENYELIA' =>$data['penyelia'],\r\n 'Objektif' => $objektif,\r\n 'Sebab' => $sebab,\r\n 'Penyampaian' => $penyampaian,\r\n 'Komunikasi' => $komunikasi,\r\n 'Interaksi' => $interaksi,\r\n 'Respon' => $respon,\r\n 'Difahami' => $difahami,\r\n 'Kesan' => $kesan,\r\n 'Aktiviti' => $aktiviti,\r\n 'BahanKursus' => $bahan,\r\n 'TahapPengetahuan' => $tahap,\r\n 'Kemahiran' => $kemahiran,\r\n 'TempohLatihan' => $tempoh,\r\n 'Lokasi' => $lokasi,\r\n 'Makanan' => $makanan,\r\n 'DewanKuliah' => $dewan,\r\n 'Urusetia' => $urusetia,\r\n 'Faedah' => $faedah,\r\n 'Cadangan' => $cadangan\r\n );\r\n\r\n $this-> db -> insert('penilaianpeserta',$data);\r\n \r\n}", "public function modelDoAdd(){\n\t\t\t$tenphongban = $_POST[\"tenphongban\"];\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//chuan bi truy van\n\t\t\t$query = $conn->prepare(\"insert into phongban set tenphongban=:ten\");\n\t\t\t$query->execute(array(\"ten\"=>$tenphongban));\n\t\t}", "public function addPesan()\n\t{\n\t\t$ambil_akun1 = $this->Wali_Kelas_model->ambil_user($this->session->userdata('uname'));\n\t\t$ambil_status = $this->Wali_Kelas_model->ambil_status($this->session->userdata('kode'));\n\t\t$data = array(\n\t\t\t'user1' => $ambil_akun1,\n\t\t\t'status' => $ambil_status\n\t\t);\n\t\t$data['jumlah']=$this->Wali_Kelas_model->ambil_jumlah($this->session->userdata('uname'));\n\t\t$data['listMahasiswa_W'] = $this->Wali_Kelas_model->getAllMahasiswa_W();\n\t\t$data['notifInformasi']=$this->Wali_Kelas_model->notifInformasi_Wali();\n\t\t$data['ListNotifInformasi']=$this->Wali_Kelas_model->ListNotifInformasi_Wali();\n\t\t$data['notif'] = $this->Wali_Kelas_model->notifikasiPesan();\n\t\t$data['LihatNotifRespon']=$this->Wali_Kelas_model->LihatNotifRespon_Wali();\n\t\t$data['notifPesan'] = $this->Wali_Kelas_model->notifPesan_Wali();\n\t\t$data['ListnotifPesan'] = $this->Wali_Kelas_model->ListNotifPesan_Wali();\n\t\t$this->load->view('W_Buat_Pesan',$data);\n\t}", "public function act_add_penjualan()\n {\n\n $produk = $this->input->post('produk');\n $presentase = $this->input->post('presentase');\n $no_hp = $this->input->post('no_hp');\n\n $action = $this->general->create('m_customer_penjualan',\n array('produk' => $produk,\n 'presentase' => $presentase,\n 'no_hp' => $no_hp,\n ));\n if ($action) {\n echo (\"<script LANGUAGE='JavaScript'>window.location.href='\".base_url('sales/customer/data_verifikasi1/').\"';</script>\");\n }\n\n }", "public function add() \n { \n $data['piutang'] = $this->piutangs->add();\n $data['action'] = 'piutang/save';\n \n $tmp_statuss = $this->statuss->get_all();\n foreach($tmp_statuss as $row){\n $statuss[$row['id']] = $row['status'];\n }\n $data['statuss'] = $statuss;\n \n $this->template->js_add('\n $(document).ready(function(){\n // binds form submission and fields to the validation engine\n $(\"#form_piutang\").parsley();\n });','embed');\n \n $this->template->render('piutang/form',$data);\n\n }", "public function add() {\n\n\t\t\t$projetoNome = $_POST['pjt_new_1'];\n\t\t\t$projetoData = $_POST['pjt_new_2'];\n\n\t\t\t$db = new Projetos_Model();\n\t\t\t$db->insert('sis_pjt', array(\n\t\t\t\t\"pjt_nme\" => \"$projetoNome\",\n\t\t\t\t\"pjt_data\" => \"$projetoData\",\n\t\t\t));\n\n\t\t\treturn header( \"Location: ../projetos\" );\n\t\t}", "public function addPenName($penno,$fxn,$h_id,$user)\r\n\t\t{\r\n\t\t\t/* \r\n\t\t\t\tThis function inserts new pen name in pen table.\r\n\t\t\t\tIt also inserts new transaction that the user added new pen name in user_transaction table.\r\n\t\t\t*/\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$q = \"SELECT max(pen_id)\r\n\t\t\t\t\tFROM pen\";\r\n\t\t\t\t$r = mysqli_query($link, $q);\r\n\t\t\t\t$ro = mysqli_fetch_row($r);\r\n\t\t\t\t$max = $ro[0] + 1;\r\n\t\t\t\t$query = \"INSERT INTO pen(pen_id,pen_no,function,house_id) \r\n\t\t\t\t\t\tVALUES('\" . $max . \"','\" . $penno . \"','\" . $fxn . \"','\" . $h_id . \"');\";\r\n\t\t\t\tif ($result = mysqli_query( $link, $query )) {\r\n\t\t \t$data = array(\"success\"=>\"true\",\r\n\t\t \"newId\"=> $link->insert_id);\r\n\t\t \t\t $this->userTransactionEdit($user,$max,\"pen\",0,$penno,1,0);\r\n\t\t\t }else {\r\n\t\t\t $data = array(\"success\"=>\"false\",\r\n\t\t\t \"error\"=>mysqli_error($link));\r\n\t\t\t }\r\n\t\t\t return $data;\r\n\t\t}", "function add_surat_keputusan_pemutih_penyalur() {\n//\t\tif (! $this->get_permission('fill_this')) return $this->intruder();\n\t\tglobal ${$GLOBALS['post_vars']};\n\t\t$record = array (\n\t\t\t'no_surat_keputusan_pemutih_penyalur' => ${$GLOBALS['post_vars']}['no_surat_keputusan_pemutih_penyalur'],\n\t\t\t'id_cek_pemutih' => ${$GLOBALS['post_vars']}['id_cek_pemutih'],\n\t\t\t'nama' => ${$GLOBALS['post_vars']}['nama'],\n\t\t\t\n\t\t\t'nip' => ${$GLOBALS['post_vars']}['nip'],\n\t\t\t'insert_by' => $GLOBALS['ses']->loginid,\n\t\t\t'date_insert' => time()\n\t\t);\n\t\t$_block = new block();\n\t\t$_block->set_config('title', __('Status').' '.__('Add').' Surat Keputusan Pemutihan Izin Penyalur');\n\t\t$_block->set_config('width', 595);\n\t\tif (! surat_keputusan_pemutih_penyalur::get($record)) {\n\t\t\teval($this->save_config);\n\t\t\tif (surat_keputusan_pemutih_penyalur::add($record)) {\n\n\n\t\t\t\tif ($GLOBALS[$GLOBALS['post_vars']]['opener']) {\n\t\t\t\t\t$opener_sql = $GLOBALS[$GLOBALS['post_vars']]['opener_sql'];\n\t\t\t\t\t$opener_var = $GLOBALS[$GLOBALS['post_vars']]['opener_var'];\n\t\t\t\t\tif (! $record[$opener_var]) {\n\t\t\t\t\t\tif (eregi('postgre', $GLOBALS['adodb_type']))\n\t\t\t\t\t\t\t$last_id = $GLOBALS['adodb']->Execute(\n\t\t\t\t\t\t\t\"SELECT\n\t\t\t\t\t\t\t\tcurrval('surat_keputusan_pemutih_penyalur_{$opener_var}_seq') AS last_id\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\tsurat_keputusan_pemutih_penyalur\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\telse if (eregi('mysql', $GLOBALS['adodb_type']))\n\t\t\t\t\t\t\t$last_id = $GLOBALS['adodb']->Execute(\n\t\t\t\t\t\t\t'SELECT last_insert_id() AS last_id'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t$record[$opener_var] = $last_id->fields['last_id'];\n\t\t\t\t\t}\n\t\t\t\t\t$result = $GLOBALS['adodb']->Execute($opener_sql);\n\t\t\t\t\t$refresh_add_js = '';\n\t\t\t\t\twhile (! $result->EOF) {\n\t\t\t\t\t\t$result_text = '';\n\t\t\t\t\t\tif (isset($result->fields['svalue'])) $result_text .= $result->fields['svalue'];\n\t\t\t\t\t\tif (isset($result->fields['svalue2'])) $result_text .= ' - '.$result->fields['svalue2'];\n\t\t\t\t\t\tif (isset($result->fields['svalue3'])) $result_text .= ' - '.$result->fields['svalue3'];\n\t\t\t\t\t\tif (isset($result->fields['svalue4'])) $result_text .= ' - '.$result->fields['svalue4'];\n\t\t\t\t\t\tif (isset($result->fields['svalue5'])) $result_text .= ' - '.$result->fields['svalue5'];\n\t\t\t\t\t\t$refresh_add_js .= \"index=window.top.opener.{$opener_var}_add(\".\n\t\t\t\t\t\t\t\"'{$result_text}', \".\n\t\t\t\t\t\t\t\"'{$result->fields['skey']}');\\n\";\n\t\t\t\t\t\tif ($result->fields['skey'] == $record[$opener_var])\n\t\t\t\t\t\t\t$refresh_add_js .= 'window.top.opener.document.theform.'.\n\t\t\t\t\t\t\t\t$opener_var.'.options[index].selected = true;';\n\t\t\t\t\t\t$result->MoveNext();\n\t\t\t\t\t}\n\t\t\t\t\t$refresh_js = <<< EOT\n<script language=javascript>\n\tvar q=window.top.opener.document.theform.{$opener_var}.options.length-1;\n\tfor (;q>=1;q--)\n\t\twindow.top.opener.document.theform.{$opener_var}.options[q] = null;\n{$refresh_add_js}\n</script>\nEOT;\n\t\t\t\t\t$GLOBALS['self_close_js'] = <<< EOT\n<script language=javascript>\nself.setTimeout('window.top.opener.focus();window.top.close();', 500);\n</script>\nEOT;\n\t\t\t\t}\n\n\t\t\t\t$_block->parse(array('+<font color=green><b>'.__('Successfull Added').'</b></font>'));\n\t\t\t\treturn $_block->get_str().$refresh_js;\n\t\t\t}\n\t\t}\n\t\t$GLOBALS['self_close_js'] = $GLOBALS['adodb']->ErrorMsg();\n\t\t$_block->parse(array('+<font color=red><b>'.__('Failed Added').'</b></font>'.' :'.__('Data already exists')));\n\t\treturn $_block->get_str();\n\t}", "public function actionCreate()\n {\n $model = new Penulis();\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 insertPenyimpananPendistribusian($data)\n {\n $pendistribusian = new PenyimpananDistribusi();\n $pendistribusian->id_user = $data['id_user'];\n $pendistribusian->status = $data['status'];\n $pendistribusian->transaksi = json_encode($data['transaksi']);\n\n if($pendistribusian->save())\n {\n return \"success\";\n }\n else\n {\n return \"something wrong\";\n }\n }", "public function actionCreate()\n {\n $model = new Penilaian();\n\n $data_pegawai_exist = $model->find()->select(['id_pegawai'])->column();\n $pegawais = Pegawai::find()->where(['NOT IN', 'id_pegawai', $data_pegawai_exist])->all();\n $kriteria = Kriteria::find()->all();\n $data_pegawai = [];\n\n foreach ($pegawais as $key => $pegawai) {\n $data_pegawai[$pegawai->id_pegawai] = $pegawai->nip . ' | ' . $pegawai->nama_pegawai;\n }\n\n $post_data = Yii::$app->request->post();\n if (!empty($post_data)) {\n $model->load($post_data);\n\n if (!empty($post_data['Penilaian']['penilaian'])) {\n $model->penilaian = json_encode($post_data['Penilaian']['penilaian']); \n }\n\n if ($model->save()) {\n return $this->redirect(['index']);\n }\n\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'data_pegawai' => $data_pegawai,\n 'kriteria' => $kriteria,\n ]);\n }", "public function add() {\n\n $sql = \"INSERT INTO persona(id,nombre,apellido_paterno,apellido_materno,estado_salud,telefono,ubicacion)\n VALUES(null,'{$this->nombre}','{$this->apellido_paterno}','{$this->apellido_materno}',\n '{$this->estado_salud}','{$this->telefono}','{$this->ubicacion}')\";\n $this->con->consultaSimple($sql);\n }", "public function add(){\n\t\t$nama = $_POST['nama_sekolah'];\n\t\t$lati = $_POST['latitude'];\n\t\t$longi = $_POST['longitude'];\n\t\t$alamat = $_POST['alamat'];\n\n\t\t$data['nama_sekolah'] = $nama;\n\t\t$data['latitude'] = $lati;\n\t\t$data['longitude'] = $longi;\n\t\t$data['alamat'] = $alamat;\n\n\t\t$this->m_sekolah->addData($data);\n\t\tredirect('Welcome/index');\n\t}", "function add(){\n\t\tif(is_post_request()){\n\t\t\t$modeldata = transform_request_data($_POST);\n\t\t\t$rules_array = array(\n\t\t\t\t'judul' => 'required',\n\t\t\t\t'pengarang' => 'required',\n\t\t\t\t'penerbit' => 'required',\n\t\t\t\t'tanggalmasuk' => 'required',\n\t\t\t\t'fotobuku' => 'required',\n\t\t\t);\n\t\t\t$is_valid = GUMP::is_valid($modeldata, $rules_array);\n\t\t\tif( $is_valid !== true) {\n\t\t\t\tif(is_array($is_valid)){\n\t\t\t\t\tforeach($is_valid as $error_msg){\n\t\t\t\t\t\t$this->view->page_error[] = $error_msg;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->view->page_error[] = $is_valid;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( empty($this->view->page_error) ){\n\t\t\t\t$db = $this->GetModel();\n\t\t\t\t$rec_id = $db->insert( 'buku' , $modeldata );\n\t\t\t\tif(!empty($rec_id)){\n\t\t\t\t\tset_flash_msg('','');\n\t\t\t\t\tredirect_to_page(\"buku\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif($db->getLastError()){\n\t\t\t\t\t\t$this->view->page_error[] = $db->getLastError();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$this->view->page_error[] = \"Error inserting record\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->view->page_title =\"Add New Buku\";\n\t\t$this->view->render('buku/add.php' ,null,'main_layout.php');\n\t}", "function addNewprefect (){\n $data = array(\n 'prfct_nom' => $this->input->post('prfct_nom')\n );\n $this->db->insert('prefectures',$data);\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 store(Request $request)\n {\n $request->validate([\n 'nama' => 'required',\n 'jk' => 'required',\n 'no_hp' => 'required',\n 'alamat' => 'required',\n ]);\n \n Penjual::create($request->all());\n \n return redirect()->route('penjual.index')\n ->with('success','Penjual berhasil di tambahkan');\n }", "public function actionAdd($penilaian_id)\n {\n\n $model = new PoinKebaikan();\n $dim = DimPenilaian::find()->where('deleted!=1')->andWhere(['penilaian_id' => $penilaian_id])->one();\n\n if ($model->load(Yii::$app->request->post())) {\n $pelanggaran = DimPelanggaran::find()->where('deleted!=1')->andWhere(['penilaian_id' => $penilaian_id])->andWhere(['pelanggaran_id' => $model->pelanggaran_id])->one();\n $model->penilaian_id = $penilaian_id;\n\n if ($model->pelanggaran_id != NULL) {\n $new_skor = $dim->akumulasi_skor - $pelanggaran->poin->poin;\n if ($new_skor < 0) {\n $dim->akumulasi_skor = 0;\n } else {\n $dim->akumulasi_skor = $new_skor;\n }\n $pelanggaran->status_pelanggaran = 1;\n $dim->save();\n $pelanggaran->save();\n $model->save();\n return $this->redirect(['dim-penilaian/view', 'id' => $penilaian_id, 'penilaian_id' => $penilaian_id]);\n }\n\n if ($model->save()) {\n return $this->redirect(['dim-penilaian/view', 'id' => $penilaian_id, 'penilaian_id' => $penilaian_id]);\n } else {\n return $this->render('add', [\n 'model' => $model,\n 'dim' => $dim->dim->nama,\n ]);\n }\n } else {\n return $this->render('add', [\n 'model' => $model,\n 'dim' => $dim->dim->nama,\n ]);\n }\n }", "public function tambah_produk() {\n $dataInputan = array(\n 'nama' => $this->input->post('nama'),\n 'deskripsi' => $this->input->post('deskripsi'),\n 'harga' => $this->input->post('harga'),\n 'stok' => $this->input->post('stok'),\n 'gambar' => $this->modelToko->_uploadImage('gambar'),\n );\n\n $this->modelToko->masukkan('product', $dataInputan);\n redirect(base_url().\"index.php/admin\");\n }", "public function add() {\n $this->layout = 'ajax';\n if ($this->request->is('post')) {\n $this->Tratamiento->create();\n if ($this->Tratamiento->save($this->request->data)) {\n $this->Session->setFlash('Se Registro correctamente', 'msgbueno');\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash('No se pudo registrar!!', 'msgerror');\n }\n }\n $penfigo_tipo = $this->Penfigo->find('list', array('fields' => 'nombre'));\n $this->set(compact('penfigo_tipo'));\n }", "public function add_pemesan($nm_pemesan,$jk,$no_hp,$alamat){\r\n\r\n if(empty($nm_pemesan) || empty($jk) || empty($no_hp) || empty($alamat)){\r\n return $this->empty_response();\r\n }else{\r\n $data = array(\r\n \"nm_pemesan\"=>$nm_pemesan,\r\n \"jk\"=>$jk,\r\n \"no_hp\"=>$no_hp,\r\n \"alamat\"=>$alamat\r\n );\r\n\r\n $insert = $this->db->insert(\"pemesan\", $data);\r\n\r\n if($insert){\r\n $response['status']=200;\r\n $response['error']=false;\r\n $response['message']='Data pemesan ditambahkan.';\r\n return $response;\r\n }else{\r\n $response['status']=502;\r\n $response['error']=true;\r\n $response['message']='Data pemesan gagal ditambahkan.';\r\n return $response;\r\n }\r\n }\r\n\r\n }", "function add_kunjungan_pasien($no_rm){\n $kunjungan = $this->db->query(\"select kunjungan from pasien where no_rm = '\".$no_rm.\"' \")->row()->kunjungan;\n \n $data = array(\n 'kunjungan' => ($kunjungan + 1)\n );\n\n $this->db->where('no_rm', $no_rm);\n $this->db->update('pasien',$data);\n }", "public function __construct(PengajuanPenjualan $pengajuanPenjualan)\n {\n $this->pengajuanPenjualan = $pengajuanPenjualan;\n }", "public function prosesTambah()\n {\n $siswa = [\n 'nama' => $this->input->post('nama', true),\n 'alamat' => $this->input->post('alamat', true),\n 'nis' => $this->input->post('nis', true),\n 'kelas' => $this->input->post('kelas', true),\n 'jk' => $this->input->post('jk', true),\n 'no_hp' => $this->input->post('no_hp', true)\n\n ];\n $data = $this->siswa->insert_siswa($siswa);\n }", "public function agregar()\n {\n if (AuthHelper::obtenerUsuarixAdmin() == 2){\n $nombre = $_POST['name'];\n \n //chequeo que no este vacio el nombre\n if (!empty($_POST['name'])) {\n \n //busco en la tabla de paises alguno que coincida con el nombre puesto por el usuario.\n $paisDb = $this->modelpaises->obtenerPais($nombre);\n\n //y si no se obtuvo un pais en la base de datos que coincida\n //con lo ingresado por el usuario ahi si lo agrego.\n if (empty($paisDb)) {\n $this->modelpaises->agregar($nombre);\n header(\"Location: \" . BASE_URL . 'home');\n } else $this->mostrarAgregar(\"Ya existe un pais con ese nombre\");\n } else $this->mostrarAgregar(\"No es posible agregar paises vacios\");\n } else {\n $this->view->mostrarError(\"Acceso denegado\");\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Pegawai;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t $this->performAjaxValidation($model);\n\n\n\t\tif(isset($_POST['Pegawai']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Pegawai'];\n\t\t\t\n\t\t\t$nip = $_POST['Pegawai']['nip'];\n\t\t\t$nama_peg = $_POST['Pegawai']['nama'];\n\t\t\t$alamat = $_POST['Pegawai']['alamat'];\n\t\t\t$ttl = $_POST['Pegawai']['tanggal_lahir'];\n\t\t\t$agama = $_POST['Pegawai']['agama'];\n\n $sql = \"INSERT INTO pegawai(nip, nama, alamat, tanggal_lahir, agama)\n VALUES(:nip,:nama_peg,:alamat,:ttl,:agama)\";\n\n $cmd = Yii::app()->db->createCommand($sql);\n $cmd->bindParam(\":nip\",$nip,PDO::PARAM_INT);\n $cmd->bindParam(\":nama_peg\",$nama_peg,PDO::PARAM_STR);\n $cmd->bindParam(\":alamat\",$alamat,PDO::PARAM_STR);\n $cmd->bindParam(\"ttl\",$ttl,PDO::PARAM_INT);\n $cmd->bindParam(\"agama\",$agama,PDO::PARAM_STR);\n try {\n \t$cmd->execute();\n \t$this->redirect(array('admin'));\n } catch (Exception $e) {\n \tYii:app()->user->setFlash('adaKesalahan',\n \t\t\"Ada Kesalahan :\".\"{$e->getMessage()}\");\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function addProduk()\n {\n return view('blogedit.add');\n }" ]
[ "0.68769336", "0.67311484", "0.6614731", "0.6588668", "0.6549776", "0.65324175", "0.65178704", "0.64994824", "0.6492128", "0.64155567", "0.6411806", "0.6389164", "0.63716537", "0.6325359", "0.62724966", "0.62557507", "0.62435836", "0.6242445", "0.6241005", "0.6207467", "0.6201842", "0.61995345", "0.6182872", "0.61639875", "0.6159955", "0.61445737", "0.611126", "0.6083991", "0.60824454", "0.6075978" ]
0.6846086
1
Remove field from palette definition
public static function removeFromPalette($table = '', $palette = '', $field = '') { if(!empty($table) && !empty($palette) && !empty($field) && isset($GLOBALS['TCA'][$table]['palettes'][$palette]['showitem'])) { $GLOBALS['TCA'][$table]['palettes'][$palette]['showitem'] = preg_replace( '/[, ]+'.preg_quote($field, '/').'/', '', $GLOBALS['TCA'][$table]['palettes'][$palette]['showitem'] ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function acf_remove_local_field($key = '')\n{\n}", "public function unset_legend() {\n $this->legend = null;\n }", "public function removeField( $field ) {\r\n if ( isset($this->fields[$field]) ) {\r\n unset($this->fields[$field]);\r\n }\r\n\r\n }", "protected function unsetFields()\n\t{\n unset(\n $this['headshot_id'], $this['created_at'],\n $this['updated_at'], $this['slug']\n );\n\t}", "function image_features_override_export_render_deletion($alter, $element) {\n $code = array();\n if (isset($alter['keys'])) {\n $component_start = \"\\$data['$element']\";\n $code_line = features_override_export_keys($alter['keys']);\n $code[] = \"\";\n $code[] = \" if (\" . $component_start . \"['storage'] == IMAGE_STORAGE_DEFAULT) {\";\n $code[] = ' unset(' . $component_start . $code_line . ');';\n $code[] = \" }\";\n }\n return $code;\n}", "function remove_website_field($fields) {\n unset($fields['url']);\n return $fields;\n}", "function website_remove($fields){\n\n\tif(isset($fields['url']))\n\tunset($fields['url']);\n\n\treturn $fields;\n}", "public function removeField($field_name){\n\t\tif(isset($this->Fields[$field_name])){\n\t\t\tunset($this->Fields[$field_name]);\n\t\t}\n\t}", "private function removePseudoRelationsFromFieldSet(FieldSet& $fields) {\n\t\t$dataFields = $fields->dataFields();\n\t\tif ($dataFields) foreach ($dataFields as $field) {\n\t\t\tif (preg_match('/^__/', $field->Name()))\n\t\t\t\t$fields->removeByName($field->Name());\n\t\t}\n\t}", "protected function unsetFields()\n {\n }", "function remove_custom_background()\n {\n }", "public function remove_field(form_item $field) {\n foreach($this->_fields as $key=>$f) {\n if ($f == $field) {\n unset($this->_fields[$key]);\n return;\n }\n }\n }", "public function canAddFieldsToPaletteAfterNotExistingOnes() {}", "function acf_remove_local_field_group($key = '')\n{\n}", "public function __unset($field) {\n\t\t$this->offsetUnset($field);\n\t}", "public function __unset(string $field): void\n\t{\n\t\t$this->unsetValue($field);\n\t}", "public function remove_form_field()\n\t{\n\t\t//Get logged in session admin id\n\t\t$user_id \t\t\t\t\t\t= ($this->session->userdata('user_id_hotcargo')) ? $this->session->userdata('user_id_hotcargo') : 1;\n\t\t$setting_data \t\t\t\t\t= $this->myaccount_model->get_account_data($user_id);\n\t\t$data['data']['setting_data'] \t= $setting_data;\n\t\t$data['data']['settings'] \t\t= $this->sitesetting_model->get_settings();\n\t\t$data['data']['dealer_id'] \t\t= $user_id;\n\t\t\n\t\t//getting all admin data \n\t\t$data['myaccount_data'] \t\t\t= $this->myaccount_model->get_account_data($user_id);\n\t\t\n\t\t\n\t\t//Get requested id to remove\n\t\t$field_id \t\t\t\t\t= $this->input->get('form_id');\n\t\t\n\t\t//deleting query\n\t\t$this->mongo_db->where(array('field_name' => $field_id));\n\t\tif($this->mongo_db->delete('form_fields'))\n\t\t\techo 1;\n\t\telse\n\t\t\techo 0;\n\t}", "static public function clearField($name) {\n $self = self::_getInstance();\n if ($self->_hasField($name)) {\n COption::RemoveOption(self::MODULE_NAME, $name);\n }\n }", "function projectpentagon_remove() {\n\ndelete_option('projectpentagon_title');\n\ndelete_option('projectpentagon_name1');\n\ndelete_option('projectpentagon_name2');\n\ndelete_option('projectpentagon_name3');\n\ndelete_option('projectpentagon_name4');\n\ndelete_option('projectpentagon_name5');\n\ndelete_option('projectpentagon_color1');\n\ndelete_option('projectpentagon_color2');\n\ndelete_option('projectpentagon_color3');\n\ndelete_option('projectpentagon_color4');\n\ndelete_option('projectpentagon_color5');\n\ndelete_option('projectpentagon_category');\ndelete_option('projectpentagon-titleonpages');\n\n}", "function bt_custom_shipping_fields( $fields = array() ) {\n unset($fields['shipping_company']);\n // unset($fields['shipping_address_1']);\n // unset($fields['shipping_address_2']);\n // unset($fields['shipping_state']);\n // unset($fields['shipping_city']);\n // unset($fields['shipping_phone']);\n // unset($fields['shipping_postcode']);\n // unset($fields['shipping_country']);\n return $fields;\n}", "public function dropField( $table, $field );", "public function canAddFieldsToPaletteAfterExistingOnes() {}", "protected function removeFile($field) {\n $utilArbo = new ServiceArborescence();\n $utilFichier = new UtilFichier();\n $strNomImageThumb = nomImageThumbnail($utilArbo->getRepertoireDossiersMIP() . $this->getObject()->getPhotographie());\n $utilFichier->supprimerFichier($strNomImageThumb);\n\n parent::removeFile($field);\n }", "function deregister_graphql_field(string $type_name, string $field_name)\n {\n }", "function modify_user_meta($profile_fields) {\n\n // Add new fields\n $profile_fields['facebook_id'] = 'Facebook Profile ID';\n $profile_fields['twitter_username'] = 'Twitter @usename';\n\n // Remove old fields\n unset($profile_fields['aim']);\n unset($profile_fields['yim']);\n //not working unset($profile_fields['url']);\n unset($profile_fields['jabber']);\n\n return $profile_fields;\n}", "function convertizer_remove() {\ndelete_option('convertizer_data');\n}", "protected function removeColorPicker() {\n $setting = $this->getOptions();\n if (\n $setting['disable_color_picker'] == true\n ) {\n remove_action('admin_color_scheme_picker', 'admin_color_scheme_picker');\n }\n }", "function cinerama_edge_remove_default_custom_fields() {\n\t\tforeach ( array( 'normal', 'advanced', 'side' ) as $context ) {\n\t\t\tforeach ( apply_filters( 'cinerama_edge_filter_meta_box_post_types_remove', array( 'post', 'page' ) ) as $postType ) {\n\t\t\t\tremove_meta_box( 'postcustom', $postType, $context );\n\t\t\t}\n\t\t}\n\t}", "public function canAddFieldsToPaletteBeforeExistingOnes() {}", "function custom_remove() { \n remove_meta_box('add-sfwd-certificates', 'nav-menus', 'side');\n remove_meta_box('add-sfwd-assignment', 'nav-menus', 'side'); \n}" ]
[ "0.60165906", "0.60121745", "0.59430176", "0.5838733", "0.58139676", "0.5799772", "0.5764606", "0.57289225", "0.5708306", "0.5705625", "0.56833756", "0.564094", "0.5622882", "0.5605879", "0.56040865", "0.55895424", "0.55871224", "0.55558527", "0.5545748", "0.5503513", "0.55021816", "0.55019176", "0.54868627", "0.5471467", "0.5465299", "0.54615563", "0.54604447", "0.5453426", "0.54389983", "0.540106" ]
0.6717171
0
Fix broken wizard icons for plugins generated by extension builder
public static function fixWizardPluginIcons($icons, $extKey) { $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); /** * Register Icons */ $pageTsConfigString = ''; foreach($icons as $iconKey => $icon) { $iconRegistry->registerIcon( $extKey.'-plugin-' . $iconKey, $icon['class'], ['source' => $icon['source']] ); $pageTsConfigString .= $iconKey.".iconIdentifier = ".$extKey."-plugin-".$iconKey."\n"; } /** * Fix broken wizard icons */ \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(' mod { wizards.newContentElement.wizardItems.plugins { elements { '.$pageTsConfigString.' } } } '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function registerPluginTriggersAddPluginWhichSetsPluginIconPathIfIconPathIsGiven() {}", "public function registerPluginTriggersAddPluginWhichSetsPluginIconPathIfUsingUpperCameCasedExtensionNameAndIconPathNotGiven() {}", "public function registerPluginTriggersAddPluginWhichSetsPluginIconPathIfUsingUnderscoredExtensionNameAndIconPathNotGiven() {}", "function _upgrade_422_remove_genericons()\n {\n }", "function proc($wizardItems)\t{\r\n\t\tglobal $LANG;\r\n\r\n\t\t$LL = $this->includeLocalLang();\r\n\r\n\t\t$wizardItems['plugins_f4luceneworkshop_ui'] = array(\r\n\t\t\t'icon'=>t3lib_extMgm::extRelPath('f4_lucene_workshop').'ui/ce_wiz.gif',\r\n\t\t\t'title'=>$LANG->getLLL('ui_title',$LL),\r\n\t\t\t'description'=>$LANG->getLLL('ui_plus_wiz_description',$LL),\r\n\t\t\t'params'=>'&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=f4_lucene_workshop_ui'\r\n\t\t);\r\n\r\n\t\treturn $wizardItems;\r\n\t}", "function wp_super_emoticons_shutdown() {\t\n\t$current_plugins = get_settings('active_plugins');\n\t$current_plugin_basename = plugin_basename( __FILE__ );\t\t\n\tarray_splice( $current_plugins, array_search( $current_plugin_basename, $current_plugins ), 1 ); // Array-function!\n\tupdate_option( 'active_plugins', $current_plugins );\n \n echo '<div class=\"settings-error error\" id=\"setting-error-settings_updated\"><p><strong>';\n _e( 'WP Super Edit Plugin Required! Activate WP Super Edit before using. Plugin Deactivated.', 'wp-super-edit' );\n echo '</p></div>';\n}", "function inkpro_set_customizer_tabs_icons() {\r\n\t$mods = inkpro_customizer_get_mods();\r\n\r\n\t$css = '';\r\n\r\n\tforeach ( $mods as $key => $value) {\r\n\t\t\r\n\t\tif ( isset( $value['icon'] ) && isset( $value['id'] ) ) {\r\n\r\n\t\t\t$section_id = $value['id'];\r\n\t\t\t$icon_slug = $value['icon'];\r\n\r\n\t\t\t$css .= '\r\n\t\t\t\t#accordion-section-' . $section_id . ' .accordion-section-title:before{\r\n\t\t\t\t\tposition:relative;\r\n\t\t\t\t\tfont-family:Dashicons;\r\n\t\t\t\t\tcontent : \"' . inkpro_get_dashicon_css_unicode( $icon_slug ) . '\";\r\n\t\t\t\t\tposition: relative;\r\n\t\t\t\t\ttop: 2px;\r\n\t\t\t\t\tmargin-left: 5px;\r\n\t\t\t\t\tleft: -6px;\r\n\t\t\t\t\tline-height: inherit;\r\n\t\t\t\t\tfont-weight: normal;\r\n\t\t\t\t}\r\n\t\t\t';\r\n\t\t}\r\n\t}\r\n\r\n\tif ( ! SCRIPT_DEBUG ) {\r\n\t\t$css = wolf_compact_css( $css );\r\n\t}\r\n\r\n\twp_add_inline_style( 'inkpro-customizer-style', $css );\r\n}", "protected function registerTCAIcons() {}", "protected function buildCssAndRegisterIcons() {}", "function add_galleries_icon() {\n\n\t\t$plugin_css = plugin_dir_url( __FILE__ ) . '/css/admin-style.css';\n\n\t\twp_register_style( 'admin-style', $plugin_css );\n\n\t\twp_enqueue_style( 'admin-style' );\n\t}", "function wp_site_icon()\n {\n }", "function plugin_geticon_bad_behavior2 ()\n{\n global $_CONF;\n\n return $_CONF['site_url'] . '/' . BAD_BEHAVIOR_PLUGIN\n . '/images/bad_behavior2.png';\n}", "public function getPluginButtons() {}", "public function getIconReturnsReplacementIconWhenDeprecatedDataProvider() {}", "function plugin_geticon_nexmenu()\n{\n global $_CONF;\n\n return $_CONF['layout_url'] .'/nexmenu/images/admin/nexmenu.gif';\n}", "public function showEnableInstallToolButtonAction() {}", "function travelogue_buttons() {\n add_filter( \"mce_external_plugins\", \"travelogue_add_buttons\" );\n // add new buttons\n add_filter( 'mce_buttons', 'travelogue_register_buttons' );\n}", "function gtpress_admin_menu() {\r\n\t$gtpress_ico = get_option('siteurl').'/wp-content/plugins/'.basename(dirname(__FILE__)).'/';\r\n\tadd_options_page('GT Press', 'GT Press Setup', 8, basename(__FILE__), 'gtpressMenu_options_page', '', $gtpress_ico.'gtpress.png');\r\n}", "function render_wizard() {\n\t\t$lines=array();\n\n\t\t$action = explode(':',$this->wizard->modData['wizAction']);\n\t\tif ($action[0]=='edit')\t{\n\t\t\t$this->regNewEntry($this->sectionID, $action[1]);\n\t\t\t$lines = $this->catHeaderLines($lines, $this->sectionID, $this->wizard->options[$this->sectionID], '<strong>Edit Plugin #'.$action[1].'</strong>', $action[1]);\n\t\t\t$piConf = $this->wizard->wizArray[$this->sectionID][$action[1]];\n\t\t\t$ffPrefix = '['.$this->sectionID.']['.$action[1].']';\n\n\t\t\t\t// Enter title of the plugin\n\t\t\t$subContent='<strong>Enter a title for the plugin:</strong><br />'.\n\t\t\t\t$this->renderStringBox_lang('title',$ffPrefix,$piConf);\n\t\t\t$lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';\n\n\t\t\t\t// Position\n\t\t\tif (is_array($this->wizard->wizArray['fields']))\t{\n\t\t\t\t$optValues = array(\n\t\t\t\t\t'0' => '',\n\t\t\t\t);\n\t\t\t\tforeach($this->wizard->wizArray['fields'] as $kk => $fC)\t{\n\t\t\t\t\tif ($fC['which_table']=='tt_content')\t{\n\t\t\t\t\t\t$optValues[$kk]=($fC['title']?$fC['title']:'Item '.$kk).' ('.count($fC['fields']).' fields)';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count($optValues)>1)\t{\n\t\t\t\t\t$subContent='<strong>Apply a set of extended fields</strong><br />\n\t\t\t\t\t\tIf you have configured a set of extra fields (Extend existing Tables) for the tt_content table, you can have them assigned to this plugin.\n\t\t\t\t\t\t<br />'.\n\t\t\t\t\t\t$this->renderSelectBox($ffPrefix.'[apply_extended]',$piConf['apply_extended'],$optValues);\n\t\t\t\t\t$lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';\n\t\t\t\t}\n\t\t\t}\n/*\n\t\t\t\t// Insert Plugin\n\t\t\tif (is_array($this->wizard->wizArray['tables']))\t{\n\t\t\t\t$optValues = array(\n\t\t\t\t\t'0' => '',\n\t\t\t\t);\n\t\t\t\tforeach($this->wizard->wizArray['tables'] as $kk => $fC)\t{\n\t\t\t\t\t$optValues[$kk]=($fC['tablename']||$fC['title']?$fC['title'].' ('.$this->returnName($this->wizard->extKey,'tables').($fC['tablename']?'_'.$fC['tablename']:'').')':'Item '.$kk).' ('.count($fC['fields']).' fields)';\n\t\t\t\t}\n\t\t\t\t$subContent='<strong>Example Code Generation</strong><br />'.\n\t\t\t\t\t\t'If you have configured custom tables you can select one of the tables to list by default as an example:<br />'.\n\t\t\t\t\t\t$this->renderSelectBox($ffPrefix.'[list_default]',$piConf['list_default'],$optValues);\n\t\t\t\t$lines[] = '<tr><td><hr /></td></tr>';\n\t\t\t $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';\n\t\t\t}\n*/\n\n\t\t\t$subContent='<strong>New Content Element Wizard</strong><br />'.\n\t\t\t $this->renderCheckBox($ffPrefix.'[plus_wiz]',$piConf['plus_wiz']).\n\t\t\t\t'Add icon to \\'New Content Element\\' wizard<br />'.\n\t\t\t\t'Write a description for the entry (if any):<br />'.\n\t\t\t\t$this->renderStringBox_lang('plus_wiz_description',$ffPrefix,$piConf)\n\t\t\t\t;\n\t\t\t$lines[] = '<tr><td><hr /></td></tr>';\n\t\t\t$lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';\n\n\t\t\t$subContent='<strong>Code Layout Selection</strong><br />'.\n\t\t\t $this->renderSelectBox($ffPrefix.'[code_sel]',$piConf['code_sel'],\n\t\t\t\t$this->renderer_select);\n\t\t\t$lines[] = '<tr><td><hr /></td></tr>';\n\t\t\t$lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';\n\n\t\t\t\t/* create default controller */\n\t\t\tif(!isset($piConf[done])) {\n\t\t\t\t$ctr_cnt = count($this->wizard->wizArray['mvccontroller'])+1;\n\t\t\t\t$this->regNewEntry('mvccontroller', $ctr_cnt);;\n\t\t\t\t$this->wizard->wizArray['mvccontroller'][$ctr_cnt] = array('plugin'=>$action[1],'title'=>'default'.$action[1]);\n\t\t\t\t$piConf[done] = 1;\n\t\t\t}\n\t\t\t$lines[] = '<input type=\"hidden\" name=\"kickstarter[wizArray_upd]'.$ffPrefix.'[done]\" value=\"'.$piConf[done].'\" />';\n\t\t}\n\n\t\t$content = '<table border=0 cellpadding=2 cellspacing=2>'.implode(\"\\n\",$lines).'</table>';\n\t\treturn $content;\n\t}", "function admin_menu_link() {\n //If you change this from add_options_page, MAKE SURE you change the filter_plugin_actions function (below) to\n //reflect the page filename (ie - options-general.php) of the page your plugin is under!\n add_options_page('HITS- IE6 PNG Fix', 'HITS- IE6 PNG Fix', 'edit_pages', basename(__FILE__), array(&$this,'admin_options_page'));\n add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'filter_plugin_actions'), 10, 2 );\n }", "function wpdocs_dequeue_dashicon() {\n if (current_user_can( 'update_core' )) {\n return;\n }\n wp_deregister_style('dashicons');\n}", "public function theme_installer()\n {\n }", "public function setIcons() {\n\t\t$this->icons = array(\n\t\t\t'slider' => $this->getSkinURI().'/assets/img/admin-logo-icon.png',\n\t\t\t'carousel' => $this->getSkinURI().'/assets/img/admin-logo-icon.png',\n\t\t\t'testimonial' => $this->getSkinURI().'/assets/img/admin-logo-icon.png',\n\t\t\t'portfolio' => $this->getSkinURI().'/assets/img/admin-logo-icon.png',\n\t\t\t'options' => 'dashicons-admin-generic'\n\t\t);\n\t}", "public function after_setup_theme()\n {\n }", "public function getWizardItems() {}", "function wpdocs_dequeue_dashicon() {\n\tif ( current_user_can( 'update_core' ) ) {\n\t\treturn;\n\t}\n\twp_deregister_style( 'dashicons' );\n}", "function unhook_parent_style() {\n \n wp_dequeue_style( 'genericons' );\n\twp_deregister_style( 'genericons' );\n wp_dequeue_style( 'twentyfifteen-ie' );\n\twp_deregister_style( 'twentyfifteen-ie' );\n wp_dequeue_style( 'twentyfifteen-ie7' );\n\twp_deregister_style( 'twentyfifteen-ie7' );\n wp_dequeue_style( 'twentyfifteen-fonts' );\n\twp_deregister_style( 'twentyfifteen-fonts' );\n}", "function register_block_core_site_icon_setting()\n {\n }", "function woodstock_removeDemoModeLink() {\n if ( class_exists('ReduxFrameworkPlugin') ) {\n remove_filter( 'plugin_row_meta', array( ReduxFrameworkPlugin::get_instance(), 'plugin_metalinks'), null, 2 );\n }\n if ( class_exists('ReduxFrameworkPlugin') ) {\n remove_action('admin_notices', array( ReduxFrameworkPlugin::get_instance(), 'admin_notices' ) ); \n }\n }", "public function afterLoadRegisterControlsUI(){\n\t\t\n\t}" ]
[ "0.60629165", "0.6047844", "0.6012591", "0.59231424", "0.5919418", "0.5880163", "0.58073235", "0.5781766", "0.56969285", "0.56843084", "0.5548291", "0.5511798", "0.54904664", "0.5446991", "0.5434388", "0.54055536", "0.5397255", "0.5273456", "0.52485824", "0.5236595", "0.52168536", "0.52159613", "0.52112436", "0.519978", "0.5196072", "0.51941746", "0.5190551", "0.5156774", "0.5154628", "0.51416457" ]
0.6696858
0
/ Atributos increments('id') unsignedInteger('Estado_id') integer('Activo_id') string('Activo_type')
function estado() { return $this->belongsTo( EstadoActivo::class, 'Estado_id', 'id' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actualizaEstado(){\n $this->estado = 'Completo';\n // $this->cotiza = $this->generarCustomID();\n $this->save();\n }", "public function getEstadoId() {\r\n return $this->estadoId;\r\n }", "function contratos_por_estado($id_estado){\n $sql =\n \"SELECT\n c.Numero,\n c.Objeto,\n c.Lugar,\n c.Valor_Inicial,\n c.Acta_Inicio,\n c.Fecha_Acta_Inicio,\n c.Plazo,\n c.Fecha_Vencimiento,\n c.Fecha_Inicial,\n t.Nombre AS Contratista,\n e.Estado \n FROM\n contratos AS c\n INNER JOIN tbl_terceros AS t ON c.Fk_Id_Terceros = t.Pk_Id_Terceros\n INNER JOIN tbl_estados AS e ON c.Fk_Id_Estado = e.Pk_Id_Estado \n WHERE\n c.Fk_Id_Estado = $id_estado \n AND c.Fk_Id_Proyecto = {$this->session->userdata('Fk_Id_Proyecto')} \n ORDER BY\n c.Numero ASC\";\n \n //Se retorna la consulta\n return $this->db->query($sql)->result();\n }", "function CambiarEstado($id_factura, $estado) {\n $q=\"UPDATE \".self::$table.\" SET estado='$estado' WHERE id=$id_factura\";\n return DBManager::execute($q);\n }", "public\n function edit(Estado $estado)\n {\n //\n }", "function getDatosId_activ()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_activ'));\n $oDatosCampo->setEtiqueta(_(\"id_activ\"));\n return $oDatosCampo;\n }", "public function activar_cliente($id,$estado){\n $conectar= parent::conexion();\n parent::set_names();\n $sql=\"CALL spc_actualizar_estadoCliente(?,?)\";\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1, $estado);\n $sql->bindValue(2, $id);\n $sql->execute();\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n }", "public function GuardarEstado()\n\t{\n\t\t$query=\"INSERT INTO estado (idpais,estado,descripcion) VALUES ($this->id_pais,'$this->estado','$this->descripcion')\";\n\t\t$resp=$this->db->consulta($query);\n\t\t$this->id_estado = $this->db->id_ultimo();\n\t\t\n\t\t\n\t\t\n\t}", "function get_estado($idEstado)\n\t{\n\t\treturn $this->db->get_where('estado',array('idEstado'=>$idEstado))->row_array();\n\t}", "public function activar()\n {\n $this->estatus = 1;\n $this->save();\n }", "private function tbl_estados() {\r\n\t\t\t$this->estados = $this->esquema->createTable('ESTADOS');\r\n\t\t\t$this->estados->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado'\r\n\t\t\t));\r\n\t\t\t$this->estados->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre del Estado'\r\n\t\t\t));\r\n\t\t\t$this->estados->setPrimaryKey(array('ID'));\r\n\t\t}", "public function estado()\n {\n return $this->belongsTo('App\\Estado');\n }", "function update_estado($id)\n {\n $data = array(\n 'estado' => 2\n );\n\n $this->db->where('id', $id);\n return $this->db->update('servicio', $data);\n }", "function activar($id,$estado){\n\n\t$activarCategoria = new ajaxCategoria();\n\t$activarCategoria -> activarCategoria = $estado;\n\t$activarCategoria -> activarId = $id;\n\t$activarCategoria-> ajaxactivarCategoria();\n\n}", "function Activar($id) {\n $fecha=date(\"Y-m-d H:i:s\");\n $query=\"UPDATE \".self::$table.\" SET activa='si', fechamodificacion='$fecha' WHERE id=$id\";\n return DBManager::execute($query);\n }", "public function ModificarEstado()\n\t{\n\t\t$query=\"UPDATE estado SET idpais=$this->id_pais, estado='$this->estado' , descripcion='$this->descripcion' WHERE idestado=$this->id_estado\";\n\t\t$resp=$this->db->consulta($query);\n\t}", "function ResumenEstadoCC(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_RESESTCC_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n\n $this->setCount(false);\n\n\n $this->setParametro('id_agencia','id_agencia','int4');\n\n\n\n //Definicion de la lista del resultado del query\n $this->captura('id_agencia','int4');\n $this->captura('tipo','varchar');\n $this->captura('moneda','varchar');\n $this->captura('monto','numeric');\n $this->captura('monto_mb','numeric');\n\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n\n\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function listEstado($id){\n\t$sql = 'SELECT * FROM tb_estado';\n\tif($id>0){\n\t\t$sql.=' WHERE id='.$id;\n\t}\n\t$resultado = $GLOBALS['con']->query($sql);\n\treturn $resultado;\n}", "public function actividadesPorSegmento()\n {\n //\n }", "public function anuncioGetEstado($idAnuncio){\n $query = \"SELECT estado FROM final_anuncio WHERE idAnuncio='\".$idAnuncio.\"'\";\n return $this->con->action($query);\n }", "function Editar($id, $fecha_emision, $condicion_pago, $estado, $fecha_pago, $observaciones_pago, $tipo) {\n $fecha=explode(\"-\", $fecha_emision);\n $fecha_vencimiento=date(\"Y-m-d\",mktime(0,0,0,$fecha[1],$fecha[2]+$condicion_pago,$fecha[0]));\n $q=\"UPDATE \".self::$table.\"\nSET condicionpago='$condicion_pago', fechaemision='$fecha_emision',\nfechavencimiento='$fecha_vencimiento', estado='$estado', fecha_pago='$fecha_pago',\nobservaciones_pago='$observaciones_pago', tipo='$tipo'\nWHERE id=$id\";\n return DBManager::execute($q);\n }", "public function ObtenerDatosEstado()\n\t{\n\t\t$query=\"SELECT * FROM estado WHERE idestado=\".$this->id_estado;\n\t\t$resp=$this->db->consulta($query);\n\t\t\n\t\t\n\t\treturn $resp;\n\t}", "function activar($id){\n\t\trequire_once('../conexion/conexion.php');\n\t\t$conn = conexion();\n\t\ttry{\n\t\t\t$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t$sql = \"UPDATE tipousuario SET idestado = '1' where idtipoUsuario = '$id'\";\n\t\t\t$conn->exec($sql);\n\t\t}catch(PDOExcepcion $e){\n \t\t\techo \"Error:\".$e->getMessage();\n\t\t}\n\t}", "public function estado () {\n return $this->belongsTo(EstadoMedicion::class, 'estado_id');\n }", "function add_estado($params)\n\t{\n\t\t$this->db->insert('estado',$params);\n\t\treturn $this->db->insert_id();\n\t}", "function editar_producto_estatus($id, $id_estatus){\n\t\t$conexion_bd = conectar_bd();\n\t\t\n\t\t//Prepaprar la consulta\n\t\t$dml = 'UPDATE `producto` SET `id_estatus` = id_estatus WHERE `producto`.`id` = id ';\n\t\tif ( !($statement = $conexion_bd->prepare($dml)) ){\n\t\t\tdie(\"Error: (\" . $conexion_bd->errno . \") \" . $conexion_bd->error);\n\t\t\treturn 0;\n\t\t\t}\n\n\t\t// Unir los parametros de la funcion con los parametros de la consulta\n\t\t// El primer argumento de bind_param es el formato de cada parametro\n\t\tif (!$statement->bind_param(\"s\", $id_estatus)) {\n\t\t\tdie(\"Error en vinculación: (\" . $statement->errno . \") \" . $statement->error);\n\t\t\treturn 0;\n\t\t\t}\n\n\t\t// Ejecutar la consulta\n\t\tif (!$statement->execute()) {\n\t\t\tdie(\"Error en ejecución: (\" . $statement->errno . \") \" . $statement->error);\n\t\t\treturn 0;\n\t\t\t}\n\n\t\t//Desconectarse de la base de datos\n\t\t\t desconectar_bd($conexion_bd);\n\t\t\t return 1;\n \n\t}", "public function estado()\n {\n return $this->belongsTo(Estado::class, 'FK_GIT_Estado', 'PK_ESD_Id');\n }", "function anularVenta_servicio($idFactura, $estado){\n\n\t\t$this->db->set('estado', $estado);\t\n\t\t$this->db->where('idFactura' ,$idFactura);\n\t\t$this->db->update('ventaservicio');\n\t}", "function get_servicios_activos($id)\n {\n $id = $this->session->id;\n $this->db->select('*');\n $this->db->from('servicio');\n $this->db->where('estado', 1);\n $this->db->where('id_trabajador', $id);\n $this->db->order_by('fecha','DESC');\n $query = $this->db->get();\n return $query->result();\n }", "public function activar($categoria){\n\t\t\t\t\t\t\t\t\t$db=DB::conectar();\n\t\t\t\t\t\t\t\t\t$update=$db->prepare('UPDATE categoria SET estado = 1 WHERE id = :id;');\n\t\t\t\t\t\t\t\t\t$update->bindValue('id',$categoria->getId());\n\t\t\t\t\t\t\t\t\t$update->execute();\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}" ]
[ "0.62779737", "0.5969324", "0.59401876", "0.5783107", "0.5695844", "0.56819177", "0.5670147", "0.5665536", "0.5657428", "0.5642819", "0.5622605", "0.5620276", "0.56175643", "0.5612324", "0.5611702", "0.56001997", "0.55922496", "0.5590539", "0.5569303", "0.5552694", "0.55312043", "0.5525649", "0.5502655", "0.54864943", "0.5482754", "0.54739684", "0.54632545", "0.54413337", "0.5423881", "0.54111195" ]
0.6620097
0
Finds index of station in the array
function findStationIndex($checkStationName, $dataArray) { foreach($dataArray as $key => $station) if ($checkStationName == $station["stationName"]) return $key; return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findArray($array,$item){\n for ($i=0;$i<count($array);$i++){\n if($array[$i]==$item)\n return $i;\n }\n return -1;\n }", "function getIndexOfRegistry($registryNumber, $array) {\n $i = 0;\n\t$index = -1;\n\tfor ($i = 0; $i < sizeof($array); $i++) {\n\t\tif ($array[$i][0] == $registryNumber) {\n\t\t\t$index = $i;\n\t\t\tbreak;\n\t\t}\n\t} \n\treturn $index;\n}", "function search_loc_index($data, $loc)\n{\n\tforeach($data as $d)\n\t{\n\t\tif($d['loc']==$loc) $index=array_search($d,$data);\n\t}\n\tif(!isset($index)) return false;\n\telse return $index;\n}", "function getIndexOfWarmestDay($arr)\n{\n $result;\n $maxElRow = [];\n $indexMax = 0;\n if (count($arr) === 0) {\n return null;\n }\n foreach ($arr as $index => $row) {\n foreach ($row as $value) {\n $maxElement = max($row);\n } $maxElRow[] = $maxElement;\n } var_dump($maxElRow);\n $result = max($maxElRow);\n $indexMax = array_search($result, $maxElRow);\n return $indexMax;\n}", "function getIndex() ;", "function searchIndex($array, $id){\n\t$i = 0;\n\t$length = count($array);\n\t$result = -1;\n\twhile ($i < $length && $array[$i]['id'] != $id){\n\t\t$i++;\n\t}\n\tif($i < $length){\n\t\t$result = $i;\n\t}\n\t\n\treturn $result;\n}", "function search_loc_index_stdcls($data, $loc)\n{\n\tforeach($data as $d)\n\t{\n\t\tif($d->loc==$loc) $index=array_search($d,$data);\n\t}\n\tif(!isset($index)) return false;\n\telse return $index;\n}", "function search($array, $value) {\n // check for empty array\n if (empty($array)) {\n return;\n }\n // iterate through array, looking for the value\n // if value found, return the index.\n for ($i=0; $i < sizeof($array); $i++) { \n if ($value == $array[$i]) {\n return $i;\n }\n }\n}", "private function whichStation() {\n\t\t$stations = @file(Flight::get(\"pathStation\"),FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\t\tif (count($stations) >=1 && $stations ) {\n\t\t\t$x = '';\n\t\t\tforeach ($stations as $st) {\n\t\t\t\tif (substr($st,0,1) == '1') {\n\t\t\t\t\t$x = substr($st,1);\n\t\t\t\t\t$x = explode(\" #\",$x);\n\t\t\t\t\t$x = $x[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($x == '') {$x = Flight::get(\"defaultStation\");}\n\t\t}\n\t\telse $x = (Flight::get(\"defaultStation\"));\n\t\treturn trim($x);\n\t}", "public function search($array, $value)\n {\n $n = count($array);\n for ($i = 0; $i < $n; $i++) {\n if ($array[$i] == $value) {\n return $i;\n }\n }\n\n return -1;\n }", "function ST_index($ST_key) {\n\t$this->ST_head = $this->ST_indexR($this->ST_head, $ST_key, 0);\n\treturn $this->ST_val;\n\t}", "function search($array, $value)\n{\n $counter = 0;\n $found = false;\n\n foreach($array as $v) {\n if(strcmp($v[0], $value) == 0) {\n $found = true;\n break;\n } \n\n $counter++;\n }\n \n if($found)\n return $counter;\n \n return -1;\n}", "public function indexOf($element)\n {\n return array_search($element, $this->data);\n }", "function indexof($item)\r\n {\r\n $result=-1;\r\n\r\n reset($this->items);\r\n while (list($k,$v)=each($this->items))\r\n {\r\n if ($v===$item)\r\n {\r\n $result=$k;\r\n break;\r\n }\r\n }\r\n\r\n return($result);\r\n }", "function get_index($arr, $selected)\n{\n $ret = false; // return false if not found\n foreach ($arr as $key => $val) {\n if (strtolower(substr($val, 0, strlen($selected))) == strtolower($selected)) {\n $ret = $key;\n break;\n }\n }\n\n return $ret;\n}", "public function indexOf ($item)\n {\n $index = array_search($item, $this->data);\n return $index === false ? -1 : $index;\n }", "function indexOf ($value, $strict = true)\n {\n return array_search ($value, $this->A, $strict);\n }", "public function indexOf($listener){\n\t\t$iterator = $this->getIterator();\n\t\tif($iterator->valid()) do{\n\t\t\t$curr = $iterator->current();\n\t\t\tif($listener === $curr[0]){\n\t\t\t\treturn $iterator->key();\n\t\t\t}\n\t\t\t$iterator->next();\n\t\t}while($iterator->valid());\n\t\treturn false;\n\t}", "public function findPlayerIndex($arr, $player){\n\t\t//var_dump($arr);\n\t\t//echo $player;\n\t\tforeach ($arr as $k => $id) {\n\t\t\tif($id['player_id'] == $player){\n\t\t\t\t$this->key = $k;\n\t\t\t\treturn $this->key;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "protected function Find_in_STATE($node_num,$element){\t\t\t\t\t\t\t\t\n\t\t\tfor ($i=0; $i < $node_num ; $i++) { \n\t\t\t\t\n\t\t\t\t\tif ($this->STATE[$i]==$element) {\n\t\t\t\t\t\treturn $i;\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\treturn null;\n\t\t}", "function pos($array)\n{\n}", "function linear_search($list, $key ) {\n\tfor($i = 0; $i < count($list); $i++) {\n\t\tif($list[$i] == $key) {\n\t\t\treturn $i;\n\t\t}\n\t}\n\treturn -1; \n}", "public function testIndexOf() {\n\t\t$array = array(1, 2, 3, 4, 5);\n\t\t$result = _::indexOf($array, 4);\n\t\t$this->assertEquals(3, $result);\n\n\t\t// test not finding an element's index\n\t\t$result = _::indexOf($array, 6);\n\t\t$this->assertEquals(-1, $result);\n\t}", "public static function indexOf($c, $a){\n\t\tfor($i = count($a) - 1; $i >= 0; $i--)\n\t\t\tif( $a[$i]->equals($c) )\n\t\t\t\treturn $i;\n\t\treturn -1;\n\t}", "public function indexOfObject($object)\n {\n // RsoNumber\n return array_search($object, $this->array);\n }", "abstract protected function getIndex();", "public function getStation()\n {\n return $this->station;\n }", "function search_2d_array($array, $key, $value) {\n\t\tfor ($i = 0; $i < count($array); $i++)\n\t\t{\n\t\t\tif (isset($array[$i][$key])) {\n\t\t\t\tif ($array[$i][$key] == $value) {\n\t\t\t\t\treturn $i;\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\treturn false;\n }", "public function getSymbolPosition($symbol)\n {\n return array_search($symbol, $this->getSymbolIndex(), true);\n }", "public function getStationID(string $station_name)\n {\n if (substr($station_name, 0, 11) === \"TRADE HUB: \") {\n $station_name = substr($station_name, 11);\n }\n\n $this->db->select('eve_idstation');\n $this->db->where('name', $station_name);\n $query = $this->db->get('station');\n\n if ($query->num_rows() != 0) {\n $result = $query->row();\n } else {\n $result = false;\n }\n\n return $result;\n }" ]
[ "0.63796544", "0.62801325", "0.5961767", "0.5904147", "0.5861937", "0.5849601", "0.582228", "0.5756937", "0.5708686", "0.5703343", "0.5696692", "0.5637787", "0.55793285", "0.5578864", "0.55673933", "0.5535584", "0.5534612", "0.55225575", "0.54975885", "0.54793376", "0.54644823", "0.5460277", "0.54315037", "0.54185164", "0.5407388", "0.53358734", "0.5320583", "0.53051573", "0.53040594", "0.53020996" ]
0.80100924
0
Formats and displays dashboard of stations
function displayDashboard($myLocations, $myStations, $lastUpdated) { ?> <?=$lastUpdated?> | <a href="<?=$GLOBALS['MAP_URL']?>" target="_blank">citibike live station map</a> <table cellpadding="2"> <tr><th colspan="2">Going to work</th></tr> <tr><td>Available Bikes</td><td>Available Docks</td></tr> <tr valign="top"> <?php $count = 0; foreach ($myLocations as $type => $location) { ?> <td> <?php foreach ($myStations as $station) if ($station->type == $type) echo displayStation($station, $count == 0 ? "bikes" : "docks")."<br />"; ?> </td> <?php $count++; } ?> </tr> <tr><th colspan="2">Heading home</th></tr> <tr><td>Available Bikes</td><td>Available Docks</td></tr> <tr valign="top"> <tr valign="top"> <?php $count = 0; foreach (array_reverse($myLocations) as $type => $location) { ?> <td> <?php foreach ($myStations as $station) if ($station->type == $type) echo displayStation($station, $count == 0 ? "bikes" : "docks")."<br />"; ?> </td> <?php $count++; } ?> </tr> </table> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStation() {\n\t\t$stations = @file(Flight::get(\"pathStation\"),FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\t\tif (count($stations) >=1 && $stations ) {\n\t\t\tforeach ($stations as $station) {\n\t\t\t\t$station = explode(\"#\",$station);\n\t\t\t\t$x = explode(' ',$station[0]);\n\t\t\t\t$entry[] = array('URL'=>rtrim($x[1]),'name'=>ltrim($station[1],\"#\"),'selected'=> $x[0]);\n\t\t\t}\n\t\t\tFlight::json(array('Status' => \"OK\", 'station' => $entry));\n\t\t}\n\t\telse Flight::json(array('Status' => \"KO\", 'station' => 'Not Found'));\n\t}", "public function run()\n {\n $station_func = array(array('station'=>'Headquarters', 'function'=>'AIM Products Management'),\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport NOF', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Nairobi Wilson Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Moi International Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Eldoret International Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Kisumu Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Malindi Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Wajir Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Lokochoggio Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Nairobi Wilson Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Moi International Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Eldoret International Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Kisumu Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Malindi Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Wajir Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Lokochoggio Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray('station'=>'Headquarters', 'function'=>'Maps and Charts Management'),\n\t\t\t\t\t\tarray('station'=>'Headquarters', 'function'=>'Terrain and Obstacle Data Management'),\n\t\t\t\t\t\tarray('station'=>'Headquarters', 'function'=>'Instrument/Visual flight procedure design'),\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray('station'=>'Headquarters', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport NOF', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Nairobi Wilson Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Moi International Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Eldoret International Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Kisumu Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Malindi Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Wajir Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Lokochoggio Airport', 'function'=>'Technical library'),\n\t\t);\n\t\t\n\t\t$stations = Station::all();\n\t\t$functions = Func::all();\n\t\t\n\t\tfor($i = 0; $i < count($station_func); $i++){\n\t\t\tforeach($stations as $station){\n\t\t\t\tif($station_func[$i]['station'] == $station->name){\n\t\t\t\t\tforeach($functions as $function){\n\t\t\t\t\t\tif($station_func[$i]['function'] == $function->name){\n\t\t\t\t\t\t\t$station->func()->attach($function);\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 }", "public function index()\n\t{\n\t\t$stations = Station::paginate(9);\n\t\t$branches = DB::table('branches')->get();\n\t\t$branches_id = DB::table('branches')\n\t\t->lists('branch_name', 'id');\n\n\t\treturn View::make('stations.index', compact('stations'))\n\t\t->with('stations', $stations)\n\t\t->with('branches', $branches)\n\t\t->with('branches_id', $branches_id);\n\t}", "public function index()\n {\n $stations = Station::paginate(20);\n return view('stations.index')->withStations($stations);\n }", "public function index()\n {\n return view('places.index')->with([ \n 'stations' => DB::table('stations')\n ->select('name')\n ->groupBy('name')\n ->get() \n ]); \n }", "public function standings()\n {\n return view('standings.realtime');\n }", "public function run()\n {\n $station = new \\App\\Station();\n $station->code = \"OR14\";\n $station->kilometer_marker = 13.54;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"ศูนย์วัฒนธรรมแห่งประเทศไทย\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Thailand Cultural Center\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR15\";\n $station->kilometer_marker = 15.05;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"รฟม.\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"MRTA\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR16\";\n $station->kilometer_marker = 16.62;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"ประดิษฐ์มนูธรรม\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Pradit Manutham\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR17\";\n $station->kilometer_marker = 18.77;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"รามคำแหง 12\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Ramkhamhaeng 12\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR18\";\n $station->kilometer_marker = 19.98;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"มหาวิทยาลัยรามคำแหง\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Ramkhamhaeng University\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR19\";\n $station->kilometer_marker = 20.93;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"ราชมังคลา\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Rajamangala\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR20\";\n $station->kilometer_marker = 22.20;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"หัวหมาก\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Hua Mak\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR21\";\n $station->kilometer_marker = 23.20;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"ลำสาลี\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Lam Sali\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR22\";\n $station->kilometer_marker = 24.56;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"ศรีบูรพา\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Si Burapha\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR23\";\n $station->kilometer_marker = 25.75;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"คลองบ้านม้า\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Khlong Ban Ma\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR24\";\n $station->kilometer_marker = 26.73;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"สัมมากร\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Sammakon\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR25\";\n $station->kilometer_marker = 28.66;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"น้อมเกล้า\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Nom Klao\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR26\";\n $station->kilometer_marker = 29.95;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"ราษฎร์พัฒนา\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Rat Phatthana\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR27\";\n $station->kilometer_marker = 31.01;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"วัดบางเพ็ง\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Wat Bang Pheng\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR28\";\n $station->kilometer_marker = 32.59;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"เคหะรามคำแหง\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Kheha Ramkhamhaeng\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR29\";\n $station->kilometer_marker = 33.85;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"มีนบุรี\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Min Buri\";\n $station_translation->save();\n\n $station = new \\App\\Station();\n $station->code = \"OR30\";\n $station->kilometer_marker = 34.63;\n $station->status_id = 2;\n $station->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"th\";\n $station_translation->name = \"สุวินทวงศ์\";\n $station_translation->save();\n $station_translation = new \\App\\StationTranslation();\n $station_translation->station_id = $station->id;\n $station_translation->local = \"en\";\n $station_translation->name = \"Suwinthawong\";\n $station_translation->save();\n }", "protected function get_station( ) {\n// This function is never called. It is here for completeness of documentation.\n\n if (strlen($this->current_group_text) == 4) {\n $this->wxInfo['STATION'] = $this->current_group_text;\n $this->current_ptr++;\n }\n $this->current_group++;\n }", "public function index()\n {\n $stations = Stations::whereIn('type', [1,2])->get();\n return view('stations.index', ['stations'=>$stations]);\n }", "public function allStations() {\n\t\t$data ['stations'] = $this->_station->getStations($keyword);\n\t\t//print_r($data ['stations']);\n\t\theader('Content-Type: application/json');\n\t\techo json_encode($data ['stations']);\n\t}", "public function index() {\n\t\t$this->load->model('logbook_model');\n\t\t$this->load->model('bands');\n\t\t$total_sat = $this->logbook_model->total_sat();\n\t\tif ($total_sat->num_rows() == 0) {\n\t\t\tredirect('gridsquares/band/2m');\n\t\t\treturn;\n\t\t}\n\n\t\t$data['page_title'] = \"Gridsquare Map\";\n\t\t$data['sat_active'] = array_search(\"SAT\", $this->bands->get_user_bands(), true);\n\n\t\t$this->load->view('interface_assets/header', $data);\n\t\t$this->load->view('gridsquares/main.php');\n\t\t$this->load->view('interface_assets/footer');\n\t}", "function displayStation ($station, $value)\n {\n global $THRESHOLD, $IN_SERVICE;\n $str = $station->$value.\" @ \".$station->name;\n\n if ($station->status != $IN_SERVICE)\n return \"<b><font color='red'>\".$station->status.\"</font></b>\";\n if (intval($station->$value) < $THRESHOLD)\n return \"<b><font color='red'>\".$str.\"</font></b>\";\n\n return $str;\n }", "public function stationview_get(){\n\t\t$id = $this->get('id');\n\t\tif(count($this->get())>1){\n\t\t\t$response = array(\n\t\t\t\t\"status\"=>\"error\",\n\t\t\t\t\"status_code\"=>409,\n\t\t\t\t\"message\"=>\"Too many params was sent\",\n\t\t\t\t\"validations\"=>array(\n\t\t\t\t\t\"id\"=>\"Send Id (Get) to get specific station, or empty to get all stations\"\n\t\t\t\t),\n\t\t\t\t\"data\"=>null\n\t\t\t);\n\t\t}else{\n\t\t\tif($id){\n\t\t\t\t$response = $this->DAO->entitySelection('systemStation',array('idStation'=>$id),TRUE);\n\t\t\t}else{\n\t\t\t\t$response = $this->DAO->entitySelection('systemStation');\n\t\t\t}\n\t\t}\n\t\t$this->response($response,200);\n\t}", "function show_dashboardlist()\n{\n\tglobal $db;\n\t$result = $db->fetchAll(\"select station.sid, value, station_variables.name as name from station, station_variables where (station_variables.name='options' or station_variables.name='name') and station.sid = station_variables.sid\");\n\n#encode moduels into array\n\tforeach ($result as $value)\n\t{\n\t $modules[$value['sid']][$value['name']] = $value['value'];\n\t}\n\n#find all the dashboards that are used in a specific modues\n\tforeach ($modules as $sid => $value)\n\t{\n\t\t\n\t\t//var_dump($option_field);\n\t $option_field = json_decode($value['options'], true);\n\t\tif(isset($option_field)) \n\t\t{\n\t\t\tforeach ($option_field as $dashboard => $options)\n\t\t\t{\n\t\t\t\tif(is_int($dashboard))\n\t\t\t\t{\n\t\t\t\t\t$dashboardlist[$dashboard][$sid]=$value['name'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$content = '<html><head><title>CSF Dashboard List</title>';\n\t$content .= '<link rel=\"stylesheet\" href=\"css/base.css\" type=\"text/css\" />';\n\t$content .= '</head><body>';\n#list all the dashboards with their respective \n\tif(isset($dashboardlist))\n\t{\n\t\tksort($dashboardlist);\n\t\n\t\t$content .= '<table class=\"dashboardlist\">';\n\t\t$content .= '<tr><th>Dashboards</th><th></th><th>Modules</th>';\n\t\tforeach ($dashboardlist as $dashboard => $value)\n\t\t{\n\t\t\t$content .= '<tr onClick=\"location.href=\\'index.php?dashboard='.$dashboard.'\\'\" onMouseOver=\"this.style.backgroundColor=\\'#E1EAFE\\';this.style.cursor=\\'pointer\\'\"; onMouseOut=\"this.style.backgroundColor=\\'transparent\\'\"\n\t><td class=\"dashboardlist\" align=\"center\" valign=\"top\">'.$dashboard .'<td class=\"dashboardlist \"valign=\"top\"> -> </td><td class=\"dashboardlist\" valign=\"top\">';\n\t\t\t$i = 0;\n\t\t\tforeach($value as $sid => $name)\n\t\t\t{\n\t\t\t#if($i!=0) $content .= \", \";\n\t\t\t$i++;\n\t\t\t$content .= $name.'<br>';\n\t\t\t}\n\t\t\t$content .= '</td></tr>';\n\t\t}\n\t}\n\telse\n\t{\n\t\t$content .= '<table class=\"dashboardlist\">';\n\t\t$content .= '<tr><th>You do not have any dashboards set.</th></th></tr>';\n\t}\n\t$content .= '</table></body></html>';\n\t\n\techo $content;\n}", "public function index()\n {\n $StationDetails = array(\"station_name\"=>\"\",\n \"station_number\"=>\"\",\n \"city\"=>\"\",\n \"longitude\"=>\"\",\n \"latitude\"=>\"\",\n \"code\"=>\"\",\n \"region\"=>\"\",\n \"StationCategory\"=>\"\",\n // \"10m_node\"=>array(\n // \"name\"=>\"10m node\",\n // \"txt_key\"=>\"TXT\",\n // \"mac_add\"=>\"E64\",\n // \"date\"=>\"D\",\n // \"vin_label\"=>\"V_IN\",\n // \"time\"=>\"TZ\",\n // \"gwlat\"=>\"GW_LAT\",\n // \"gwlong\"=>\"GW_LONG\",\n // \"v_in_max_value\"=>\"4\",\n // \"v_in_min_value\"=>\"2\",\n // \"ttl\"=>\"TTL\",\n // \"rssi\"=>\"RSSI\",\n // \"lqi\"=>\"LQI\",\n // \"drp\"=>\"DRP\",\n // \"ps\"=>\"PS\",\n // \"v_mcu_max_value\"=>\"3\",\n // \"v_mcu_min_value\"=>\"1\",\n // \"v_mcu_label\"=>\"V_MCU\",\n // \"ut\"=>\"UT\",\n // ),\n // \"ground_node\"=>array(\n // \"name\"=>\"ground node\",\n // \"txt_key\"=>\"TXT\",\n // \"mac_add\"=>\"E64\",\n // \"date\"=>\"D\",\n // \"vin_label\"=>\"V_IN\",\n // \"time\"=>\"TZ\",\n // \"ut\"=>\"UT\",\n // \"gwlat\"=>\"GW_LAT\",\n // \"gwlong\"=>\"GW_LONG\",\n // \"v_in_max_value\"=>\"4\",\n // \"v_in_min_value\"=>\"2\",\n // \"ttl\"=>\"TTL\",\n // \"rssi\"=>\"RSSI\",\n // \"lqi\"=>\"LQI\",\n // \"drp\"=>\"DRP\",\n // \"ps\"=>\"PS\",\n // \"v_mcu_max_value\"=>\"3\",\n // \"v_mcu_min_value\"=>\"1\",\n // \"v_mcu_label\"=>\"V_MCU\",\n // \"po\"=>\"P0\",\n // \"rain_pulses\"=>\"P0_IST60\",\n // \"up\"=>\"UP\",\n // \"t\"=>\"T\",\n // \"v_a2\"=>\"V_A2\",\n \n // ),\n // \"sink_node\"=>array(\n // \"name\"=>\"Sink node\",\n // \"txt_key\"=>\"TXT\",\n // \"mac_add\"=>\"E64\",\n // \"date\"=>\"D\",\n // \"vin_label\"=>\"V_IN\",\n // \"time\"=>\"TZ\",\n // \"gwlat\"=>\"GW_LAT\",\n // \"gwlong\"=>\"GW_LONG\",\n // \"v_in_max_value\"=>\"4\",\n // \"v_in_min_value\"=>\"2\",\n // \"ttl\"=>\"TTL\",\n // \"rssi\"=>\"RSSI\",\n // \"lqi\"=>\"LQI\",\n // \"drp\"=>\"DRP\",\n // \"ps\"=>\"PS\",\n // \"v_mcu_max_value\"=>\"3\",\n // \"v_mcu_min_value\"=>\"1\",\n // \"v_mcu_label\"=>\"V_MCU\",\n // \"ut\"=>\"UT\",\n // \"up\"=>\"UP\",\n \n // ),\n // \"2m_node\"=>array(\n // \"name\"=>\"2m node\",\n // \"txt_key\"=>\"TXT\",\n // \"mac_add\"=>\"E64\",\n // \"date\"=>\"D\",\n // \"vin_label\"=>\"V_IN\",\n // \"time\"=>\"TZ\",\n // \"gwlat\"=>\"GW_LAT\",\n // \"gwlong\"=>\"GW_LONG\",\n // \"v_in_max_value\"=>\"4\",\n // \"v_in_min_value\"=>\"2\",\n // \"ttl\"=>\"TTL\",\n // \"rssi\"=>\"RSSI\",\n // \"lqi\"=>\"LQI\",\n // \"drp\"=>\"DRP\",\n // \"ps\"=>\"PS\",\n // \"v_mcu_max_value\"=>\"3\",\n // \"v_mcu_min_value\"=>\"1\",\n // \"v_mcu_label\"=>\"V_MCU\",\n // \"ut\"=>\"UT\",\n // ),\n // \"Temp_semsor\"=>array(\n // \"parameter_read\"=>\"Temperature\",\n // \"identifier_used\"=>\"T_SHT2X\",\n // \"max_value\"=>\"6\",\n // \"min_value\"=>\"2\",\n // \"rpt_intvl\"=>\"1\",\n // ),\n \n // \"wind_speed_semsor\"=>array(\n // \"parameter_read\"=>\"wind speed\",\n // \"identifier_used\"=>\"P0_LST60\",\n // \"max_value\"=>\"5\",\n // \"min_value\"=>\"3\",\n // \"rpt_intvl\"=>\"1\",\n // ),\n // \"wind_direction_semsor\"=>array(\n // \"parameter_read\"=>\"wind direction\",\n // \"identifier_used\"=>\"V_A1,V_A2\",\n // \"max_value\"=>\"360\",\n // \"min_value\"=>\"0\",\n // \"rpt_intvl\"=>\"1\",\n // ),\n // \"insulation_sensor\"=>array(\n // \"parameter_read\"=>\"insolation\",\n // \"identifier_used\"=>\"V_AD1,V_AD2\",\n // \"max_value\"=>\"2\",\n // \"min_value\"=>\"1\",\n // \"rpt_intvl\"=>\"1\",\n // ),\n // \"relative_humidity_semsor\"=>array(\n // \"parameter_read\"=>\"relative humidity\",\n // \"identifier_used\"=>\"RH_SHT2X\",\n // \"max_value\"=>\"6\",\n // \"min_value\"=>\"1\",\n // \"rpt_intvl\"=>\"1\",\n // ),\n // \"soil_moisture_semsor\"=>array(\n // \"parameter_read\"=>\"soil moisture\",\n // \"identifier_used\"=>\"V_A1,V_A2\",\n // \"max_value\"=>\"5\",\n // \"min_value\"=>\"2\",\n // \"rpt_intvl\"=>\"1\",\n // ),\n // \"soil_temp_semsor\"=>array(\n // \"parameter_read\"=>\"soil temperature\",\n // \"identifier_used\"=>\"T1\",\n // \"max_value\"=>\"2\",\n // \"min_value\"=>\"1\",\n // \"rpt_intvl\"=>\"1\",\n // ),\n // \"preciptation_semsor\"=>array(\n // \"parameter_read\"=>\"preciptation\",\n // \"identifier_used\"=>\"P0_IST60\",\n // \"max_value\"=>\"4.5\",\n // \"min_value\"=>\"4.7\",\n // \"rpt_intvl\"=>\"1\",\n // ),\n // \"pressure_semsor\"=>array(\n // \"parameter_read\"=>\"pressure\",\n // \"identifier_used\"=>\"P_MS5611\",\n // \"max_value\"=>\"8\",\n // \"min_value\"=>\"1\",\n // \"rpt_intvl\"=>\"1\",\n );\n\n return view('layouts.addstation')\n ->with('stationdetails', $StationDetails);\n }", "public function index()\n {\n \n $train_station = TrainStation::all();\n return view('index', compact( 'train_station'));\n }", "function show_standings()\n\t{\n\t\t// Retrieve all the players, teams, or seasons.\n\t\t$leagues = $this->league->retrieve_roster();\n\t\t$seasons = $this->seasons->retrieve_roster();\n\n\t\t// If there are no players, teams, or seasons...\n\t\tif (!$leagues || !$seasons)\n\t\t{\n\t\t\tshow_error('At least one league, one team, and one season must be added for standings functions to work.');\n\t\t}\n\n\t\t$data = array(\n\t\t\t'form_action' => 'action_show_standings',\n\t\t\t'title' => 'View Standings',\n\t\t\t'js' => array('/js/admin/show_roster.js'),\n\t\t\t'css' => array('/styles/admin.css'),\n\t\t\t'leagues' => $leagues,\n\t\t\t'seasons' => $seasons,\n\t\t\t'msg' => 'Please select the league and the season for the standings you wish to see.',\n\t\t\t'submit_message' => 'Show Standings',\n\t\t\t'sidenav' => self::$user_links\n\t\t);\n\n\t\t$this->load->helper(array('form'));\n\n\t\t$this->load->view('admin/show_standings.php', $data);\n\t}", "public function create()\n {\n return view('stations.create');\n }", "public function dashboard() {\n\t\t$template = \"dashboard.tpl\";\n\t\t$data['name'] = $_SESSION['first'] . \" \" . $_SESSION['last'];\n\t\t$data['html'] = $this->paint_screen();\n\t\t$this->load_smarty($data,$template);\n\t}", "function buildModuleDashboard() {\n\tglobal $fmdb, $__FM_CONFIG;\n\n\t$dashboard = $errors = null;\n\t\n\t/** Name server stats */\n\tif (currentUserCan('manage_servers', $_SESSION['module'])) {\n\t\tbasicGetList('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'servers', 'server_id', 'server_', 'AND server_type!=\"remote\"');\n\t\t$server_count = $fmdb->num_rows;\n\t\t$server_results = $fmdb->last_result;\n\t\tfor ($i=0; $i<$server_count; $i++) {\n\t\t\tif ($server_results[$i]->server_installed != 'yes') {\n\t\t\t\t$errors .= sprintf('<b>%s</b> - %s' . \"\\n\", $server_results[$i]->server_name, __('Client is not installed.'));\n\t\t\t} elseif (isset($server_results[$i]->server_client_version) && $server_results[$i]->server_client_version != getOption('client_version', 0, $_SESSION['module'])) {\n\t\t\t\t$errors .= sprintf('<a href=\"%s\"><b>%s</b></a> - %s' . \"\\n\", getMenuURL(_('Servers')), $server_results[$i]->server_name, __('Client needs to be upgraded.'));\n\t\t\t} elseif ($server_results[$i]->server_build_config != 'no' && $server_results[$i]->server_status == 'active') {\n\t\t\t\t$errors .= sprintf('<a href=\"%s\"><b>%s</b></a> - %s' . \"\\n\", getMenuURL(_('Servers')), $server_results[$i]->server_name, __('Server needs a new configuration built.'));\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/** Zone stats */\n\tbasicGet('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'domains', 'no', 'domain_', 'domain_template');\n\t$domain_count = $fmdb->num_rows;\n\t$domain_results = $fmdb->last_result;\n\tfor ($i=0; $i<$domain_count; $i++) {\n\t\tif (!getSOACount($domain_results[$i]->domain_id) && !$domain_results[$i]->domain_clone_domain_id && \n\t\t\t\t$domain_results[$i]->domain_type == 'master' && \n\t\t\t\tcurrentUserCan(array('access_specific_zones'), $_SESSION['module'], array(0, $domain_results[$i]->domain_id))) {\n\t\t\t$errors .= '<a href=\"zone-records.php?map=' . $domain_results[$i]->domain_mapping . '&domain_id=' . $domain_results[$i]->domain_id;\n\t\t\tif (currentUserCan('manage_zones', $_SESSION['module'])) $errors .= '&record_type=SOA';\n\t\t\t$errors .= '\">' . displayFriendlyDomainName($domain_results[$i]->domain_name) . '</a> - ' . __('Zone does not have a SOA defined.') . \"\\n\";\n\t\t} elseif (!getNSCount($domain_results[$i]->domain_id) && !$domain_results[$i]->domain_clone_domain_id && \n\t\t\t\t$domain_results[$i]->domain_type == 'master' && \n\t\t\t\tcurrentUserCan(array('access_specific_zones'), $_SESSION['module'], array(0, $domain_results[$i]->domain_id))) {\n\t\t\t$errors .= '<a href=\"zone-records.php?map=' . $domain_results[$i]->domain_mapping . '&domain_id=' . $domain_results[$i]->domain_id;\n\t\t\tif (currentUserCan('manage_zones', $_SESSION['module'])) $errors .= '&record_type=NS';\n\t\t\t$errors .= '\">' . displayFriendlyDomainName($domain_results[$i]->domain_name) . '</a> - ' . __('Zone does not have any NS records defined.') . \"\\n\";\n\t\t} elseif ($domain_results[$i]->domain_reload != 'no' && \n\t\t\t\tcurrentUserCan(array('access_specific_zones'), $_SESSION['module'], array(0, $domain_results[$i]->domain_id)) &&\n\t\t\t\tcurrentUserCan('reload_zones', $_SESSION['module'])) {\n\t\t\t$errors .= '<a href=\"' . getMenuURL(ucfirst($domain_results[$i]->domain_mapping)) . '\"><b>' . displayFriendlyDomainName($domain_results[$i]->domain_name) . '</b></a> - ' . __('Zone needs to be reloaded.') . \"\\n\";\n\t\t}\n\t}\n\tif ($errors) {\n\t\t$error_display = '<li>' . str_replace(\"\\n\", \"</li>\\n<li>\", $errors);\n\t\t$error_display = rtrim($error_display, '<li>');\n\t} else $error_display = null;\n\n\t/** Record stats */\n\t$query = 'SELECT COUNT(*) record_count FROM fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'records WHERE record_status!=\"deleted\" AND account_id=' . $_SESSION['user']['account_id'] .\n\t\t\t' AND domain_id NOT IN (SELECT domain_id FROM fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'domains WHERE domain_status!=\"deleted\" AND account_id=' . $_SESSION['user']['account_id'] .\n\t\t\t' AND domain_template=\"yes\")';\n\t$fmdb->get_results($query);\n\t$record_count = $fmdb->last_result[0]->record_count;\n\n\t$dashboard = sprintf('<div>\n\t<div id=\"shadow_box\">\n\t\t<div id=\"shadow_container\">\n\t\t<h3>%s</h3>\n\t\t<li>%s</li>\n\t\t<li>%s</li>\n\t\t<li>%s</li>\n\t\t</div>\n\t</div>\n\t</div>', __('Summary'),\n\t\t\tsprintf(ngettext('You have <b>%s</b> name server configured.', 'You have <b>%s</b> name servers configured.', $server_count), formatNumber($server_count)),\n\t\t\tsprintf(ngettext('You have <b>%s</b> zone defined.', 'You have <b>%s</b> zones defined.', $domain_count), formatNumber($domain_count)),\n\t\t\tsprintf(ngettext('You have <b>%s</b> record.', 'You have <b>%s</b> records.', $record_count), formatNumber($record_count))\n\t\t\t);\n\n\tif ($error_display) {\n\t\t$dashboard .= sprintf('<div>\n\t<div id=\"shadow_box\">\n\t\t<div id=\"shadow_container\">\n\t\t<h3>%s</h3>\n\t\t%s\n\t\t</div>\n\t</div>\n\t</div>', __('Needs Attention'), $error_display);\n\t}\n\n\treturn $dashboard;\n}", "public function dashboard_widget() {\n\t\t$data = DB::get_stats();\n\t\t?>\n\t\t<h3>\n\t\t\t<?php esc_html_e( 'Redirections', 'rank-math' ); ?>\n\t\t\t<a href=\"<?php echo esc_url( Helper::get_admin_url( 'redirections' ) ); ?>\" class=\"rank-math-view-report\" title=\"<?php esc_html_e( 'View Report', 'rank-math' ); ?>\"><i class=\"dashicons dashicons-ellipsis\"></i></a>\n\t\t</h3>\n\t\t<div class=\"rank-math-dashabord-block\">\n\t\t\t<div>\n\t\t\t\t<h4>\n\t\t\t\t\t<?php esc_html_e( 'Redirection Count', 'rank-math' ); ?>\n\t\t\t\t\t<span class=\"rank-math-tooltip\"><em class=\"dashicons-before dashicons-editor-help\"></em><span><?php esc_html_e( 'Total number of Redirections created in the Rank Math.', 'rank-math' ); ?></span></span>\n\t\t\t\t</h4>\n\t\t\t\t<strong class=\"text-large\"><?php echo esc_html( Str::human_number( $data->total ) ); ?></strong>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<h4>\n\t\t\t\t\t<?php esc_html_e( 'Redirection Hits', 'rank-math' ); ?>\n\t\t\t\t\t<span class=\"rank-math-tooltip\"><em class=\"dashicons-before dashicons-editor-help\"></em><span><?php esc_html_e( 'Total number of hits received by all the Redirections.', 'rank-math' ); ?></span></span>\n\t\t\t\t</h4>\n\t\t\t\t<strong class=\"text-large\"><?php echo esc_html( Str::human_number( $data->hits ) ); ?></strong>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}", "public function index($id){\n $StationData = Station::StationWhereMemberId($id)->first();\n //$StationData = Station::where('Member_ID',$id)->first();\n // $gammaDoseRates = 1500;\n $gammaDoseRates = SensorValue::GammaValue($id)->orderById()->first();\n //$termoDeg = 100;\n $termoDeg = SensorValue::TermoDegValue($id)->OrderById()->first();\t\n //$windDir = \"NNE\";\n $windDir = SensorValue::WindDirValue($id)->OrderById()->first();\n if($windDir){\n\t\t$num = $windDir->SValue;\n $windDir = SensorValue::DegToCompass($num);\n\t}\t\n //$windSpeed = 25;\n $windSpeed = SensorValue::WindSpeedValue($id)->OrderById()->first();\n //$solarRad = 94;\n $solarRad = SensorValue::SolarRadValue($id)->OrderById()->first();\n //$barometer = 1000;\n $barometer = SensorValue::BarometerValue($id)->OrderById()->first();\n //$percipitation = 0;\n $percipitation = SensorValue::PercipitationValue($id)->OrderById()->first();\n //$humidity = 100;\n $humidity = SensorValue::HumidityValue($id)->OrderById()->first();\n\n date_default_timezone_set(\"Asia/Jakarta\");\n\n return view('user.StationLastValue', compact('nameStation', 'termoDeg', 'windDir', 'windSpeed', 'solarRad', 'gammaDoseRates', 'barometer',\n 'percipitation', 'humidity', 'StationData','asd','asdasdasdasd'));\n }", "public function dashboard() {\n\t\t//populate data: tasks, forum discussions, timeline, burndown chart\n\t}", "public function index($station_id)\n {\n //\n $stationName = Station::where('id', $station_id)->first();\n $railroads = Railroad::where('station_id', $station_id)->get();\n return view('railroads.index', [ \n 'railroads' => $railroads,\n 'station_id' => $station_id,\n 'station_name' => $stationName->name\n ]);\n }", "public function showDashboard()\n {\n\n $locations = Location::where('site_type','!=','fiz')->with('device')->get();\n $bgppeers = BGPPeer::get();\n $totalpppoe = \\DB::table('devices')->where('ping','!=','0')->sum('active_pppoe');\n $totaldownlocationslist= Location::where('status', '<', 0)->get();\n $devices = Device::where(\"devicetype_id\",\"=\",\"1\")->get();\n $instantdevice = Device::first();\n\n //return view('home',compact('totalpppoe','gaugechart','totaldownlocationslist','locations'));\n return view('home',compact('sounds','totalpppoe','gaugechart','totaldownlocationslist','locations','devices','bgppeers','instantdevice'));\n }", "public function run()\n {\n Station::unguard();\n DB::table('stations')->insert(\n [\n ['id' =>1, 'name' =>'Stock'],\n ['id' =>2, 'name' =>'Accounts division'],\n ['id' =>3, 'name' =>'IT division'],\n ['id' =>4, 'name' =>'Management division'],\n ['id' =>5, 'name' =>'Kalutara district office'],\n ['id' =>6, 'name' =>'Galle district office'],\n ['id' =>7, 'name' =>'Operations division'],\n ]\n );\n Station::reguard();\n }", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function run()\n {\n $stations = Http::get(\"https://api.irail.be/stations/?format=json\")->json();\n foreach ($stations['station'] as $s) {\n $station = new Station();\n $station->name = $s['name'];\n $station->latitude = $s['locationY'];\n $station->longitude = $s['locationX'];\n $station->save();\n }\n }", "public function overview() {\r\n\r\n // load model\r\n require_once APP_PATH . '/models/LocationsModel.php';\r\n\r\n // get all locations\r\n $locationsModel = new LocationsModel();\r\n $locations = $locationsModel->getAll();\r\n\r\n // show views\r\n loadView('theme/header');\r\n loadView('locations/overview', [\r\n 'locations' => $locations,\r\n ]);\r\n loadView('theme/footer');\r\n }", "public function index()\n {\n $schedules = Bus_Schedule::count();\n $regions = Region::count();\n $buses = Buses::count();\n return view('admin.admin-dashboard',compact('schedules','buses','regions'));\n }" ]
[ "0.6272476", "0.62643003", "0.61255234", "0.6099523", "0.6097676", "0.59891903", "0.5905546", "0.58994234", "0.5876704", "0.5871399", "0.58583367", "0.5828901", "0.5817738", "0.581594", "0.57782346", "0.5762041", "0.5718652", "0.56769264", "0.56759626", "0.5670443", "0.5657929", "0.5640103", "0.56171143", "0.5610701", "0.55947524", "0.55823135", "0.5576667", "0.5561063", "0.5552904", "0.5541328" ]
0.695451
0
Parse the shop's items into inventory
public function inventory() { $list = array(); if (count($this->items) > 0) { foreach ($this->items as $item) { $list[] = array( 'id' => $item->id, 'name' => $item->name(), 'price' => $item->parameter, 'img' => $item->img(), ); } } return $list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function populateItems()\n\t{\n\t\tif ( empty( $this->ingredients ) )\n\t\t\treturn;\n\t\t\n\t\tforeach( $this->ingredients as $ingredient )\n\t\t{\n\t\t\tif ( !( $item = Fridge::getInstance()->getItem( $ingredient[Item::FIELD_NAME] ) ) || $ingredient[Item::FIELD_AMOUNT] > $item->getAmount() )\n\t\t\t{\n\t\t\t\t$this->valid = false;\n\t\t\t\t$this->items = array();\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\n\t\t\t$useBy = $item->getUseBy();\n\t\t\t\n\t\t\t$this->valid = ( $useBy >= REQUEST_TIME )?: false;\n\t\t\t$this->minOutOfDate = ( empty( $this->minOutOfDate ) || $useBy <= $this->minOutOfDate )? $useBy : $this->minOutOfDate;\n\t\t\t\n\t\t\t$this->items[$item->getName()] = $item;\n\t\t}\n\t}", "public function parse_inventory_from_web() {\n require_once BASEPATH . 'phpQuery/phpQuery.php';\n log_message('debug', 'START parse_inventory_from_web');\n\n $dayAgo = date(DOCTRINE_DATE_FORMAT, (time() - (3600 * 12)));\n $settings = ManagerHolder::get('StoreInventoryParserSetting')->getAllWhere(array('last_parse_at<' => $dayAgo, 'url<>' => ''), 'e.*,store.*', 200);\n\n foreach ($settings as $setting) {\n $webPage = $this->getWebPage($setting['url']);\n ManagerHolder::get('StoreInventoryParserSetting')->updateById($setting['id'], 'last_http_code', $webPage['header']['http_code']);\n\n $markup = $webPage['result'];\n\n if ($setting['store']['code'] == 'Magbaby') {\n if (strpos($markup, '<span class=\"b-product__state b-product__state_type_available\">В наличии</span>') !== FALSE) {\n $qty = 10;\n } else {\n $qty = 0;\n }\n if (!empty($setting['product_group_id'])) {\n $productGroup = ManagerHolder::get('ParameterGroup')->getById($setting['product_group_id'], 'bar_code');\n $barCode = $productGroup['bar_code'];\n } else {\n $product = ManagerHolder::get('Product')->getById($setting['product_id'], 'bar_code');\n $barCode = $product['bar_code'];\n }\n\n $where = array('product_id' => $setting['product_id'], 'bar_code' => $barCode, 'store_id' => $setting['store_id']);\n $exists = ManagerHolder::get('StoreInventory')->existsWhere($where);\n $entity = array();\n $entity['qty'] = $qty;\n if (!empty($setting['product_group_id'])) {\n $entity['product_group_id'] = $productGroup['id'];\n }\n $entity['update_by_admin_id'] = '';\n $entity['update_source'] = 'web';\n $entity['updated_at'] = date(DOCTRINE_DATE_FORMAT);\n if ($exists) {\n ManagerHolder::get('StoreInventory')->updateAllWhere($where, $entity);\n } else {\n $entity = array_merge($entity, $where);\n ManagerHolder::get('StoreInventory')->insert($entity);\n }\n\n ManagerHolder::get('StoreInventoryParserSetting')->updateById($setting['id'], 'last_parse_at', date(DOCTRINE_DATE_FORMAT));\n }\n\n if ($setting['store']['code'] == 'i-love-mum') {\n $markup = file_get_contents($setting['url']);\n\n $params = array();\n if (strpos($markup, '<li>Доступность: На складе</li>') !== FALSE) {\n @phpQuery::newDocumentHTML($markup);\n\n foreach(pq('h3:contains(Доступные опции)')->next('div')->find('div:first > div') as $item) {\n // print pq($item)->html();\n // print \"\\n\";\n\n $param = pq($item)->find('label')->text();\n $param = trim($param);\n $param = ManagerHolder::get('ParameterValue')->getOneWhere(array('name' => $param), 'e.*');\n\n $value = pq($item)->find('label')->attr('title');\n $value = trim($value);\n if ($value == 'нет в наличии') {\n $qty = 0;\n } else {\n preg_match(\"/в наличии ([0-9]*) шт./\", $value, $mch);\n $qty = $mch[1];\n }\n\n $params[$param['id']] = $qty;\n }\n } else {\n $productGroups = ManagerHolder::get('ParameterGroup')->getAllWhere(array('product_id' => $setting['product_id']), 'main_parameter_value_id');\n foreach ($productGroups as $pg) {\n $params[$pg['main_parameter_value_id']] = 0;\n }\n }\n\n ManagerHolder::get('StoreInventory')->updateAllWhere(array('product_id' => $setting['product_id'], 'store_id' => $setting['store_id']), array('qty' => 0));\n foreach ($params as $paramId => $qty) {\n $productGroup = ManagerHolder::get('ParameterGroup')->getOneWhere(array('product_id' => $setting['product_id'], 'main_parameter_value_id' => $paramId), 'bar_code');\n if (!$productGroup) {\n continue;\n }\n\n $where = array('product_id' => $setting['product_id'], 'bar_code' => $productGroup['bar_code'], 'store_id' => $setting['store_id']);\n $exists = ManagerHolder::get('StoreInventory')->existsWhere($where);\n $entity = array();\n $entity['qty'] = $qty;\n $entity['product_group_id'] = $productGroup['id'];\n $entity['update_by_admin_id'] = '';\n $entity['update_source'] = 'web';\n $entity['updated_at'] = date(DOCTRINE_DATE_FORMAT);\n if ($exists) {\n ManagerHolder::get('StoreInventory')->updateAllWhere($where, $entity);\n } else {\n $entity = array_merge($entity, $where);\n ManagerHolder::get('StoreInventory')->insert($entity);\n }\n\n ManagerHolder::get('StoreInventoryParserSetting')->updateById($setting['id'], 'last_parse_at', date(DOCTRINE_DATE_FORMAT));\n }\n }\n sleep(rand(1,3));\n }\n\n ManagerHolder::get('StoreInventory')->updateProductStatuses();\n log_message('debug', 'FINISH parse_inventory_from_web');\n }", "public function refactorBasedonItems()\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n if ($cabinet->wood_xml)\n {\n $woods = self::returnWoodArray($cabinet);\n foreach ($woods AS $wood)\n {\n $this->cabItems += $wood['qty'];\n $this->instItems += $wood['qty'];\n }\n }\n }\n\n /*\n if ($this->cabItems < 30)\n {\n $this->cabItems = 30;\n }\n\n if ($this->instItems < 30 && $this->quote->type != 'Cabinet Small Job')\n {\n $this->instItems = 30;\n }\n\n\n if ($this->instItems > 35 && $this->instItems < 40)\n {\n $this->instItems = 40;\n }\n\n // Start Staging Price Blocks.\n if ($this->cabItems > 30 && $this->cabItems < 40)\n {\n $this->cabItems = 40;\n }\n */\n\n // For Designer\n if ($this->quote->type == 'Full Kitchen' || $this->quote->type == 'Cabinet and Install')\n {\n if ($this->cabItems <= 35)\n {\n $this->forDesigner = $this->getSetting('dL35');\n }\n else\n {\n if ($this->cabItems > 35 && $this->cabItems <= 55)\n {\n $this->forDesigner = $this->getSetting('dG35L55');\n }\n else\n {\n if ($this->cabItems > 55 && $this->cabItems <= 65)\n {\n $this->forDesigner = $this->getSetting('dG55L65');\n }\n else\n {\n if ($this->cabItems > 65 && $this->cabItems <= 75)\n {\n $this->forDesigner = $this->getSetting('dG65L75');\n }\n else\n {\n if ($this->cabItems > 75 && $this->cabItems <= 85)\n {\n $this->forDesigner = $this->getSetting('dG75L85');\n }\n else\n {\n if ($this->cabItems > 85 && $this->cabItems <= 94)\n {\n $this->forDesigner = $this->getSetting('dG85L94');\n }\n else\n {\n if ($this->cabItems > 94 && $this->cabItems <= 110)\n {\n $this->forDesigner = $this->getSetting('dG94L110');\n }\n else\n {\n if ($this->cabItems > 110)\n {\n $this->forDesigner = $this->getSetting('dG110');\n }\n }\n }\n }\n }\n }\n }\n }\n\n }\n else\n {\n if ($this->quote->type == 'Cabinet Small Job' || $this->quote->type == 'Builder')\n {\n $this->forDesigner = 250;\n }\n }\n\n // ----------------------- Quote Type Specific values\n\n // For Frugal + on Quote and remove plumber and electrician rates.\n if ($this->quote->type == 'Cabinet Only')\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n if (!$cabinet->cabinet || !$cabinet->cabinet->vendor)\n {\n echo \\BS::alert(\"danger\", \"Unable To Determine Cabinets\",\n \"Cabinet type has not been selected! Unable to figure multiplier.\");\n return;\n }\n $add = ($cabinet->price * $cabinet->cabinet->vendor->multiplier) * .40;\n $this->forFrugal += $add; // Frugal gets 40% of the cabprice\n $this->setDebug(\"40% of {$cabinet->cabinet->frugal_name} to Frugal\", $add);\n $amt = ($cabinet->measure) ? 500 : 250;\n $this->forDesigner += $amt;\n $this->setDebug(\"Field Measure for Designer (Y=500/N=250)\", $amt);\n $this->forFrugal += 250; // for cabinet buildup.\n $this->setDebug(\"Frugal got $250 for Buildup\", 250);\n switch ($cabinet->location)\n {\n case 'North':\n $this->forFrugal += 300;\n $this->setDebug(\"Delivery North\", 300);\n break;\n case 'South':\n $this->forFrugal += 200;\n $this->setDebug(\"Delivery South\", 200);\n break;\n default:\n $this->forFrugal += 500;\n $this->setDebug(\"Further than 50m\", 500);\n break;\n }\n } // fe\n }\n else\n {\n if ($this->quote->type == 'Granite Only')\n {\n $this->forInstaller = 0;\n $this->forPlumber = 350;\n $this->forElectrician = 0;\n //$this->appElectrician = 0 ;\n //$this->forDesigner = 0;\n }\n else\n {\n if ($this->quote->type == \"Cabinet and Install\" || $this->quote->type == 'Builder')\n {\n if ($this->quote->type == 'Cabinet and Install')\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n $add = ($cabinet->price * $cabinet->cabinet->vendor->multiplier) * .40;\n $this->forFrugal += $add; // Frugal gets 40% of the cabprice\n $this->setDebug(\"40% of {$cabinet->cabinet->frugal_name} to Frugal\", $add);\n }\n\n $this->forInstaller += $this->instItems * 20; // get 20 per installable item not attach\n $this->forFrugal += 250; // For delivery\n $this->forFrugal += 250; // for cabinet buildup.\n $this->forFrugal += $this->instItems * 10; // Cabinet + Install gets $10 for frugal.\n $this->forFrugal += $this->attCount * 30; // Attachment Count.\n } // If it's cabinet install\n else\n {\n if ($this->instItems < 40)\n {\n $this->forInstaller += 500;\n }\n else\n {\n $remainder = $this->instItems - 40;\n $this->forInstaller += 500;\n $this->forInstaller += $remainder * 10;\n } // more than 40\n } // If builder\n } // if cabinet and install or builder\n else\n {\n if ($this->cabItems <= 35)\n {\n $this->forFrugal += $this->getSetting('fL35');\n }\n else\n {\n if ($this->cabItems > 35 && $this->cabItems <= 55)\n {\n $this->forFrugal += $this->getSetting('fG35L55');\n }\n else\n {\n if ($this->cabItems > 55 && $this->cabItems <= 65)\n {\n $this->forFrugal += $this->getSetting('fG55L65');\n }\n else\n {\n if ($this->cabItems > 65 && $this->cabItems <= 75)\n {\n $this->forFrugal += $this->getSetting('fG65L75');\n }\n else\n {\n if ($this->cabItems > 75 && $this->cabItems <= 85)\n {\n $this->forFrugal += $this->getSetting('fG75L85');\n }\n else\n {\n if ($this->cabItems > 85 && $this->cabItems <= 94)\n {\n $this->forFrugal += $this->getSetting('fG85L94');\n }\n else\n {\n if ($this->cabItems > 94 && $this->cabItems <= 110)\n {\n $this->forFrugal += $this->getSetting('fG94L110');\n }\n else\n {\n if ($this->cabItems > 110)\n {\n $this->forFrugal += $this->getSetting('fG110');\n }\n }\n }\n }\n }\n }\n }\n }\n\n $this->forFrugal += ($this->attCount * 20);\n $this->setDebug(\"Frugal gets Attachment count * 20\", $this->attCount * 20);\n $this->forInstaller += ($this->instItems * 20);\n $this->setDebug(\"Installer gets Cabinet Installable ($this->instItems * 20)\",\n $this->instItems * 20);\n }\n }\n }\n\n $this->forElectrician += $this->appElectrician;\n $this->forPlumber += $this->appPlumber;\n $this->forInstaller += $this->accInstaller;\n $this->forFrugal += $this->accFrugal;\n // Additional - LED Lighting let's add this.\n $this->forDesigner += $this->designerLED;\n $this->forFrugal += $this->frugalLED;\n $this->forElectrician += $this->electricianLED;\n\n // No electrician or plumber if cabinet + install\n // For Frugal + on Quote and remove plumber and electrician rates.\n if ($this->quote->type == 'Cabinet and Install' || $this->quote->type == 'Cabinet Only')\n {\n $this->forPlumber = 0;\n $this->forElectrician = 0;\n }\n if ($this->quote->type == 'Cabinet Only')\n {\n $this->forInstaller = 0;\n }\n\n if ($this->quote->type == 'Granite Only')\n {\n $this->forElectrician = 0;\n }\n /*\n if ($this->quote->type == 'Cabinet Small Job')\n {\n if (!isset($this->gPrice))\n {\n $this->gPrice = 0;\n }\n\n $gMarkup = $this->gPrice * .2;\n $this->forFrugal += $gMarkup;\n\n $this->setDebug(\"Small Job Marks up Granite 20%\", $gMarkup);\n $sTotal = 0;\n if (isset($this->meta['sinks']))\n {\n foreach ($this->meta['sinks'] AS $sink)\n {\n if (!$sink)\n {\n continue;\n }\n $sink = Sink::find($sink);\n $sTotal += $sink->price;\n }\n $sMarkup = $sTotal * .2;\n $this->setDebug(\"Small Job Marks up Sink Costs 20%\", $sMarkup);\n $this->forFrugal += $sMarkup;\n }\n }\n */\n if ($this->quote->type == 'Cabinet Small Job')\n {\n $markup = $this->total * .4;\n $this->setDebug(\"Applying 40% Markup to Frugal for Cabinet Small Job\", $markup);\n $this->forFrugal = $markup;\n }\n\n // Add for installer to total\n $this->total += $this->forInstaller;\n $this->setDebug(\"Applying Installer Payouts to Quote\", $this->forInstaller);\n $this->total += $this->forElectrician;\n $this->setDebug(\"Applying Electrician Payouts to Quote\", $this->forElectrician);\n $this->total += $this->forPlumber;\n $this->setDebug(\"Applying Plumber Payouts to Quote\", $this->forPlumber);\n if ($this->quote->type != 'Builder')\n {\n $this->total += $this->forFrugal;\n $this->setDebug(\"Applying Frugal Payouts to Quote\", $this->forFrugal);\n }\n $this->total += $this->forDesigner;\n $this->setDebug(\"Applying Designer Payouts to Quote\", $this->forDesigner);\n if ($this->quote->type == 'Builder')\n {\n if ($this->quote->markup == 0)\n {\n $this->quote->markup = 30;\n $this->quote->save();\n }\n\n $perc = $this->quote->markup / 100;\n $markup = $this->total * $perc;\n $this->total += $markup;\n $this->setDebug(\"Applying {$this->quote->markup}% to Total For Builder Markup\", $markup);\n $this->forFrugal = $markup;\n }\n\n }", "protected function _getItems($items)\n {\n try {\n $data = array();\n $configurableSkus = array();\n\n foreach($items as $item) {\n $_item = array();\n $_item['vars'] = array();\n if ($item->getProductType() == 'configurable') {\n $parentIds[] = $item->getParentItemId();\n $options = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());\n $_item['id'] = $options['simple_sku'];\n $_item['title'] = $options['simple_name'];\n $_item['vars'] = $this->_getVars($options);\n if($item->getProduct()->getSpecialPrice())\n {\n $_item['vars']['special_price']=Mage::helper('sailthruemail')->formatAmount($item->getProduct()->getSpecialPrice());\n } \n $configurableSkus[] = $options['simple_sku'];\n } elseif (!in_array($item->getSku(),$configurableSkus) && $item->getProductType() != 'bundle') {\n $_item['id'] = $item->getSku();\n $_item['title'] = $item->getName();\n } else {\n $_item['id'] = null;\n }\n\n if ($_item['id']) {\n if (get_class($item) == 'Mage_Sales_Model_Order_Item' ) {\n $_item['qty'] = intval($item->getQtyOrdered());\n } else {\n $_item['qty'] = intval($item->getQty());\n }\n\n $_item['url'] = str_replace('admin.','www.',$item->getProduct()->getProductUrl());\n $_item['price'] = Mage::helper('sailthruemail')->formatAmount($item->getProduct()->getPrice());\n\n // Uncomment to pass Images as a var. May require reconfiguring per Magento Product Configurations.\n /* if (!isset($_item['vars']['image'])) {\n if ($item->getProduct()->hasImage()) {\n $_item['vars']['image'] = $item->getProduct()->getImageUrl();\n } elseif ($item->getProduct()->hasSmallImage()) {\n $_item['vars']['image'] = $item->getProduct()->getSmallImageUrl(300,300);\n }\n }*/\n if (!isset($_item['vars']['image'])) {\n if ($item->getProduct()->hasImage()) {\n $pImage = $item->getProduct()->getImage();\n $pImageUrl = \"\";\n $pImageUrl = Mage::helper('sailthruemail')->getSailthruProductImage($pImage);\n if(empty($pImageUrl)){\n $pImageUrl = $item->getProduct()->getImageUrl();\n }\n $_item['vars']['image'] = $pImageUrl;\n\n } elseif ($item->getProduct()->hasSmallImage()) {\n $pSmallImage = $item->getProduct()->getSmallImage();\n $pSmallImageUrl = \"\";\n $pSmallImageUrl = Mage::helper('sailthruemail')->getSailthruProductImage($pSmallImage,'300x300');\n if(empty($pSmallImageUrl)){\n $pSmallImageUrl= $item->getProduct()->getSmallImageUrl(300, 300);\n }\n $_item['vars']['image']=$pSmallImageUrl;\n\n }\n } \n if ($tags = $this->_getTags($item->getProductId())) {\n $_item['tags'] = $tags;\n }\n\n $data[] = $_item;\n }\n }\n return $data;\n } catch (Exception $e) {\n Mage::logException($e);\n return false;\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 }", "public function prepare_items()\n {\n }", "public function get_inventory() {\n\n\t\t$inventory = array();\n\n\t\tforeach ( $this->resource->items as $item ) {\n\n\t\t\t$data = $item->resource;\n\n\t\t\t$inventory[ $data->sku ] = (array) $data;\n\t\t}\n\n\t\treturn $inventory;\n\t}", "public function processInventory()\n\t{\n\t\tif (($handle = fopen($this->outboundDir.$this->archivedFile, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n if($i!=0)\n\t\t{\n\t\t\t$stock = (int) $data[1];\n $sku = $data[0];\n\t\t\t$this->blinkeInventory[$sku]['blinke'] = $stock;\n\t\n\t\t}\n\t\t\t$i++;\n\t\t}\n\t\t\tfclose($handle);\n\t\t}\n\t\tMage::log(\"Total sku count from blinke- \" .count($this->blinkeInventory),null,$this->logfile);\n\t\n\t\tforeach($this->blinkeInventory as $sku=>$array)\n\t\t{\n\t\t\t$fstock = $array['blinke'];\n // calclulate stock by substracting stock for on hold orders\n if(array_key_exists($sku, $this->onHoldOrders))\n {\n Mage::log(\"On hold stock for $sku is. \".$this->onHoldOrders[$sku],null,$this->logfile);\n\t\t\t\t$this->blinkeInventory[$sku]['onHold'] = $this->onHoldOrders[$sku];\n Mage::log(\"Blinke stock for $sku is. \".$fstock,null,$this->logfile);\n $fstock = (int) ($fstock - $this->onHoldOrders[$sku]);\n\t\t\t\t$this->blinkeInventory[$sku]['finalMagento'] = $fstock;\n Mage::log(\"EDIT :: Final stock for $sku is $fstock\",null,$this->logfile); \n }\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->blinkeInventory[$sku]['finalMagento'] = $fstock;\n\t\t\t}\n\t\t\t\n\n\t\t\t//process inventory for the sku\n\t\t\t$product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);\n\t\t\tif($product)\n\t\t {\n\t\t\t\ttry { $productId = $product->getIdBySku($sku); }\n\t\t catch(Exception $e)\n \t\t{\n \t\t\t Mage::log(\"Special SKU: $sku not found in magento\",null,$this->logfile);\n \t\t continue;\n\t\t }\n\n\t\t\t\t$stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\n\t\t $stockItemId = $stockItem->getId();\n \t\tif (!$stockItemId) {\n\t Mage::log(\"STOCK ID for SKU: $sku doesnot exist\",null,$this->logfile);\n \t continue;\n \t\t} else {\n \t$stock = $stockItem->getData();\n \t\t}\n\t\t\t\t\n\t\t\t\t$originalStock = $stock['qty'];\n\t\t\t\t$this->blinkeInventory[$sku]['currentMagento'] = $originalStock;\n\t\t\t\tif($originalStock != $fstock)\n {\n \t\tif($fstock > 0)\n\t\t {\n \t\t $stock['qty'] = $fstock;\n\t\t $stock['is_in_stock'] = '1';\n\t\t $stock['manage_stock'] = '1';\n\t \t\t}\n\t\t\t\telse\n\t\t {\n \t\t $stock['qty'] = 0;\n \t\t}\n\t\t\t\t foreach($stock as $field => $value) {\n\t $stockItem->setData($field, $value?$value:0);\n \t\t }\n \t\ttry{\n \t\t$stockItem->save();\n\t\t }\n\t\t catch(Exception $e)\n \t\t{\n\t\t\t\t\tMage::log(\"cannot save inventory for $sku\",null,$this->logfile);\n\t\t continue;\n \t\t}\n\t\t Mage::log(\"Inventory updated for: $sku with value: $fstock from $originalStock\",null,$this->logfile);\n \t\tunset($stockItem);\n\t\t unset($product);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tMage::log(\"Inventory not updated for: $sku with value: $fstock from $originalStock\",null,$this->logfile);\n\t\t\t\t}\n\n\t\n\t\t\t}\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t Mage::log(\"Special SKU: $sku not found in magento\",null,$this->logfile);\n\t\t\t}\n\t\t}\n\t}", "public function productVariantInventory($product_id, $store_id = 0);", "public function updateProductInventory($command)\n {\n $command->info('Updating inventory...');\n $items = $this->sqlRepository->use(Item::class)->findAll();\n\n /** @var Item $item */\n foreach($items as $item)\n {\n $command->line('Evaluating Item ID: ' . $item->id);\n $rel_stock_locations = $item->rel_stock_location_items()->where('is_inactive', false)->get();\n\n /** @var RelStockLocationItem $rel_stock_location */\n foreach($rel_stock_locations as $rel_stock_location)\n {\n $quantity_reserved = 0;\n $total_quantity = ($rel_stock_location->quantity_available ?? 0);\n $total_quantity += ($rel_stock_location->quantity_reserved ?? 0);\n\n // Open all order lines on this line item\n $line_items = TransactionLineItem::whereRaw('item_id = ? AND transaction_line_itemable_type =? AND status != ?',\n [$item->id, 'SalesOrder', 'out_of_stock'])\n ->get();\n\n // Filter out line items that are not shipping from this location\n $line_items = $line_items->filter(function(TransactionLineItem $tli) use($rel_stock_location) {\n return($tli->ship_from_location_id == $rel_stock_location->stock_location_id);\n })\n ->filter(function(TransactionLineItem $tli) {\n // Filter out lines that are on canceled or shipped orders\n $parent_sales_order = SalesOrder::where('transaction_id', $tli->transaction_id)->first();\n return(in_array($parent_sales_order->status, ['pending', 'processing']));\n });\n\n /** @var TransactionLineItem $line_item */\n foreach($line_items as $line_item)\n {\n $quantity_reserved += $line_item->quantity;\n }\n\n $quantity_available = $total_quantity - $quantity_reserved;\n\n if($quantity_available < 0)\n $quantity_available = 0;\n\n if($quantity_reserved < 0)\n $quantity_reserved = 0;\n\n $rel_stock_location->quantity_reserved = $quantity_reserved;\n $rel_stock_location->quantity_available = $quantity_available;\n $rel_stock_location->save();\n\n $command->comment('Stock Location: ' . $rel_stock_location->stock_location->name . ' | Reserved: ' . $quantity_reserved . ' | Avail: ' . $quantity_available);\n }\n }\n\n $command->info('Complete!');\n }", "public function convertSaleItemsData();", "public function testDestiny2EquipItems()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function prepare_items() {\n\n\t\t$columns = $this->get_columns();\n\t\t$hidden = get_hidden_columns( $this->screen );\n \t\t$sortable = $this->get_sortable_columns();\n \t\t$this->_column_headers = array($columns, $hidden, $sortable);\n \t\t//$this->_column_headers = $this->get_column_info();\n\t\t/** Process bulk action */\n\t\t$this->process_bulk_action();\n\n\t\t$per_page = $this->get_items_per_page( 'transactions_per_page', 10 );\n\t\t$current_page = $this->get_pagenum();\n\t\t$total_items = self::record_count();\n\n\t\t$this->set_pagination_args( array(\n\t\t\t'total_items' => $total_items, //WE have to calculate the total number of items\n\t\t\t'per_page' => $per_page //WE have to determine how many items to show on a page\n\t\t));\n\n\t\t$this->items = self::get_customers( $per_page, $current_page );\n\t}", "public function getInventoryItems(){\n $accounts = [];\n return $accounts;\n }", "abstract protected function _getItems();", "public function getItemBag() {\n $item_classname = $this->getItemClass();\n $item_bag_classname = $this->getItemBagClass();\n $items = new $item_bag_classname();\n $currency = NULL;\n foreach ($this->getPayment()->getLineItems() as $line_item) {\n $item = new $item_classname();\n $item->setPrice($line_item->getAmount());\n $item->setQuantity($line_item->getQuantity());\n $item->setDescription($line_item->getDescription());\n $item->setName($line_item->getName());\n $items->add($item);\n\n $line_item_currency = $line_item->getCurrencyCode();\n\n if ($line_item_currency != $currency) {\n if ($currency != NULL) {\n // This is the second time we are changing the currency which means\n // that our line items have mixed currencies. This ain't gonna work!\n drupal_set_message($this->t('Mixed currencies detected which is not yet supported.'), 'error');\n return new OperationResult(NULL);\n }\n $currency = $line_item_currency;\n }\n }\n $this->setCurrency($currency);\n return $items;\n }", "public static function manageinventory()\n\t\t{\n\t\t\t$stageDBO = DatabaseObjectFactory::build('Material');\n\t\t\t$arr = ['material_id','unit_price'];\n\t\t\t$materials = $stageDBO->getRecords($arr);\n\t\t\t\n\t\t\t$stageDBO = DatabaseObjectFactory::build('craft');\n\t\t\t$arr = ['craft_id','calculated_qoh'];\n\t\t\t$stageDBO->SetJoin(['[><]item' => 'item_id']);\n\t\t\t$crafts = $stageDBO->getRecords($arr);\n\n\t\t\t$stageDBO = DatabaseObjectFactory::build('return_details');\n\t\t\t$stageDBO->SetJoin(['[><]item' => 'item_id']);\n\t\t\t$arr = ['return_id','item_id','qty','current_price'];\n\t\t\t$returns = $stageDBO->getRecords($arr);\n\n\t\t\tinclude('views/pages/manageinventory.php');\n\t\t}", "abstract public function items();", "public function getItemsInfo()\n {\n $data = [];\n foreach ($this->getOrder()->getAllItems() as $item) {\n if ($this->getDisplayWrappingBothPrices()) {\n $temp['price_excl_tax'] = $this->_preparePrices($item->getGwBasePrice(), $item->getGwPrice());\n $temp['price_incl_tax'] = $this->_preparePrices(\n $item->getGwBasePrice() + $item->getGwBaseTaxAmount(),\n $item->getGwPrice() + $item->getGwTaxAmount()\n );\n } elseif ($this->getDisplayWrappingPriceInclTax()) {\n $temp['price'] = $this->_preparePrices(\n $item->getGwBasePrice() + $item->getGwBaseTaxAmount(),\n $item->getGwPrice() + $item->getGwTaxAmount()\n );\n } else {\n $temp['price'] = $this->_preparePrices($item->getGwBasePrice(), $item->getGwPrice());\n }\n $temp['design'] = $item->getGwId();\n $data[$item->getId()] = $temp;\n }\n return new \\Magento\\Framework\\DataObject($data);\n }", "protected function buildItemsFields(): void\n {\n $groupName = __(\"Items\");\n $isReadOnly = !Splash::isTravisMode();\n\n //====================================================================//\n // Order Line Description\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"name\")\n ->inList(\"items\")\n ->name(__(\"Item\"))\n ->group($groupName)\n ->microData(\"http://schema.org/partOfInvoice\", \"description\")\n ->association(\"name@items\", \"quantity@items\", \"subtotal@items\")\n ->isReadOnly($isReadOnly)\n ;\n //====================================================================//\n // Order Line Product Identifier\n $this->fieldsFactory()->create((string) self::objects()->encode(\"Product\", SPL_T_ID))\n ->identifier(\"product\")\n ->inList(\"items\")\n ->name(__(\"Product\"))\n ->group($groupName)\n ->microData(\"http://schema.org/Product\", \"productID\")\n ->association(\"name@items\", \"quantity@items\", \"subtotal@items\")\n ->isReadOnly($isReadOnly)\n ->isNotTested()\n ;\n //====================================================================//\n // Order Line Product SKU\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"sku\")\n ->inList(\"items\")\n ->name(__(\"SKU\"))\n ->microData(\"http://schema.org/Product\", \"sku\")\n ->group($groupName)\n ->isReadOnly()\n ;\n //====================================================================//\n // Order Line Quantity\n $this->fieldsFactory()->create(SPL_T_INT)\n ->identifier(\"quantity\")\n ->inList(\"items\")\n ->name(__(\"Quantity\"))\n ->group($groupName)\n ->microData(\"http://schema.org/QuantitativeValue\", \"value\")\n ->association(\"name@items\", \"quantity@items\", \"subtotal@items\")\n ->isReadOnly($isReadOnly)\n ;\n //====================================================================//\n // Order Line Discount\n $this->fieldsFactory()->create(SPL_T_DOUBLE)\n ->identifier(\"discount\")\n ->inList(\"items\")\n ->name(__(\"Percentage discount\"))\n ->group($groupName)\n ->microData(\"http://schema.org/Order\", \"discount\")\n ->association(\"name@items\", \"quantity@items\", \"subtotal@items\")\n ->isReadOnly($isReadOnly)\n ;\n //====================================================================//\n // Order Line Unit Price\n $this->fieldsFactory()->create(SPL_T_PRICE)\n ->identifier(\"subtotal\")\n ->inList(\"items\")\n ->name(__(\"Price\"))\n ->group($groupName)\n ->microData(\"http://schema.org/PriceSpecification\", \"price\")\n ->association(\"name@items\", \"quantity@items\", \"subtotal@items\")\n ->isReadOnly($isReadOnly)\n ;\n //====================================================================//\n // Order Line Tax Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"tax_name\")\n ->inList(\"items\")\n ->name(__(\"Tax name\"))\n ->microData(\"http://schema.org/PriceSpecification\", \"valueAddedTaxName\")\n ->group($groupName)\n ->association(\"name@items\", \"quantity@items\", \"subtotal@items\")\n ->isReadOnly()\n ;\n }", "function prepare_items() {\n\t\tglobal $post;\n\n\t\t$this->regs = query_posts( \"post_parent={$post->ID}&post_type=ep_reg\" );\n\t\t$this->total_items = count( $this->regs );\n\t}", "protected function addItems()\n {\n $origin = 'stock';\n $code = 'cataloginventory';\n $message = Data::ERROR_QTY;\n $additionalData = null;\n $mockItems = [];\n\n for ($i = 0; $i < 2; $i++) {\n $mockItems[] = [\n 'origin' => $origin . $i,\n 'code' => $code,\n 'message' => $message . $i,\n 'additionalData' => $additionalData,\n ];\n $this->listStatus->addItem($origin . $i, $code, $message . $i, $additionalData);\n }\n return $mockItems;\n }", "function set_items() { \n\n\t\t$this->items = $this->get_items();\n\n\t}", "public function add_inventory() {\n\t\t$values=array(\"brand_id\"=>$_POST['brand_list_id'],\"product_id\"=>$_POST['product_list_id'],\"item_name\"=>$_POST['item_name'],\"entry_date\"=>$_POST['purchase_date'],\"buy_price\"=>$_POST['product_buy_price'],\"sell_price\"=>$_POST['product_sell_price'],\"quantity\"=>$_POST['item_qty'],\"update_by\"=>isset($_SESSION['user_id']));\n\t\tif($this->insert(\"inventory\",$values)) {\t\n\t\t\t$result=$this->runQuery('getAll','select max(id) as inv_item_id from inventory');\n\t\t\techo '{\"inventoryItemList\":{\"updateFlag\":false,\"item\":'.json_encode($result).'}}';\n\t\t}\n\t\telse\n\t\t\techo 'Error while inserting inventory tbl';\n\t}", "public function get_concurinventory() {\n\t\t\t$response = $this->get_inventory();\n\t\t\t$inventory = $response['Items'];\n\t\t\t\n\t\t\twhile (!empty($response['NextPage'])) {\n\t\t\t\t$response = $this->get_inventory($response['NextPage']);\n\t\t\t\t$inventory = array_merge($inventory, $response['Items']);\n\t\t\t}\n\t\t\treturn $inventory;\n\t\t}", "private function prepareItems()\n {\n $attribute = $this->attribute;\n $items = $this->model->$attribute;\n if (!is_array($items)) {\n $items = [];\n }\n\n $this->_items = $items;\n }", "public function getItems()\r\n\t{\r\n\t\t$items = parent::getItems();\r\n\r\n\t\tforeach ($items as $oneItem) {\r\n\r\n\t\t\tif ( isset($oneItem->genre) ) {\r\n\t\t\t\t// Catch the item tags (string with ',' coma glue)\r\n\t\t\t\t$tags = explode(\",\",$oneItem->genre);\r\n\r\n\t\t\t\t$db = JFactory::getDbo();\r\n\t\t\t\t\t$namedTags = array(); // Cleaning and initalization of named tags array\r\n\r\n\t\t\t\t\t// Get the tag names of each tag id\r\n\t\t\t\t\tforeach ($tags as $tag) {\r\n\r\n\t\t\t\t\t\t$query = $db->getQuery(true);\r\n\t\t\t\t\t\t$query->select(\"title\");\r\n\t\t\t\t\t\t$query->from('`#__tags`');\r\n\t\t\t\t\t\t$query->where( \"id=\" . intval($tag) );\r\n\r\n\t\t\t\t\t\t$db->setQuery($query);\r\n\t\t\t\t\t\t$row = $db->loadObjectList();\r\n\r\n\t\t\t\t\t\t// Read the row and get the tag name (title)\r\n\t\t\t\t\t\tif (!is_null($row)) {\r\n\t\t\t\t\t\t\tforeach ($row as $value) {\r\n\t\t\t\t\t\t\t\tif ( $value && isset($value->title) ) {\r\n\t\t\t\t\t\t\t\t\t$namedTags[] = trim($value->title);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Finally replace the data object with proper information\r\n\t\t\t\t\t$oneItem->genre = !empty($namedTags) ? implode(', ',$namedTags) : $oneItem->genre;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Get the title of every option selected.\r\n\r\n\t\t\t\t$options = json_decode($oneItem->days_of_the_week);\r\n\r\n\t\t\t\t$options_text = array();\r\n\r\n\t\t\t\tforeach($options as $option){\r\n\t\t\t\t\t\t$options_text[] = JText::_('COM_PROGRAMAS_PROGRAMAS_DAYS_OF_THE_WEEK_OPTION_' . strtoupper($option));\r\n\r\n\t\t\t\t}\r\n\t\t\t\t\t$oneItem->days_of_the_week = !empty($options_text) ? implode(',', $options_text) : $oneItem->days_of_the_week;\r\n\t\t}\r\n\t\treturn $items;\r\n\t}" ]
[ "0.5970491", "0.5859345", "0.5770674", "0.57299966", "0.5664743", "0.56629896", "0.56629896", "0.56629896", "0.56625295", "0.56437635", "0.5574545", "0.5550445", "0.554269", "0.5430928", "0.5421432", "0.5395878", "0.5371188", "0.5346838", "0.53333586", "0.5319892", "0.52968013", "0.52893597", "0.52884597", "0.5284502", "0.52814925", "0.5274203", "0.5251751", "0.52443403", "0.5241682", "0.52054095" ]
0.6121278
0
Get Nice Recipe URL
public function niceUrl() { return '/' . $this->recipe_id . '/' . $this->url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function url()\n {\n return '/recipe/' . $this->recipe->getKey();\n }", "public function get_url();", "public function getURL();", "public function getURL();", "public function getURL ();", "function get_url()\n {\n }", "public function get_url()\n {\n }", "public function url()\n {\n return $this->factory->getUrl($this->handle);\n }", "public abstract function getURL();", "public function getUrl(): string\n {\n return $this->generateChoiceUrl();\n }", "protected function url()\n\t{\n\t\treturn Phpfox::getLib('url');\t\n\t}", "public function getUrl() {\n\t\treturn $this->rawUrl;\n\t}", "public function getUrl()\n {\n return $this->createUrl();\n }", "public function getUrl() {\n return $this->get(self::URL);\n }", "public static function getThisUrl() {}", "public function getUrl(): string\n {\n return ($this->prefix ?? '') . $this->uri;\n }", "protected function _getUrl(): string\n {\n property_exists_or_fail($this, ['id', 'album']);\n\n return Router::url(['_name' => 'photo', 'slug' => $this->get('album')->get('slug'), 'id' => (string)$this->get('id')], true);\n }", "function getUrl()\n {\n return partial_url($this->getNodeType(), $this->m_action, $this->m_partial, $this->m_params, $this->m_sessionStatus);\n }", "public function getURL(): string\n {\n return $this->http->getURL();\n }", "public function getURL() {\n\t\treturn $this->urlStub() .'/' . $this->publicContainer .'/' . $this->getId();\n\t}", "public function url(): string;", "public function get_url(): string\n {\n return $this->get_url_internal();\n }", "public static function url(): string\n\t{\n\t\treturn static::$url;\n\t}", "private function generateUrl() : string\n {\n return $this->apiUrl.$this->ownerRepo.$this->branchPath.$this->branch;\n }", "public function getURL()\n {\n return $this->uRL;\n }", "public function getUrl(): string;", "public function getUrl(): string;", "public function getUrl(): string;", "public function getOfficialLink();", "public function url()\n\t{\n\t\treturn Url::to(\"review/\".$this->id.\"/\".$this->slug.\"/\".Session::get('Lang'));\n\t}" ]
[ "0.8005495", "0.6684302", "0.66728646", "0.66728646", "0.66376525", "0.6599835", "0.65327835", "0.6515474", "0.6506297", "0.649406", "0.646237", "0.64425784", "0.6424262", "0.6366747", "0.6355705", "0.6354239", "0.63503903", "0.6322692", "0.6319833", "0.6304408", "0.6288087", "0.62755024", "0.6275285", "0.6270783", "0.6270073", "0.6269856", "0.6269856", "0.6269856", "0.6238681", "0.62385136" ]
0.7425859
1